Skip to main content
aboutsummaryrefslogtreecommitdiffstats
BranchCommit messageAuthorAge
Branch301removed unused web icon:bchilds16 years
Cleanup0508[230291] remove dead codepberkland16 years
JSDT302This commit was manufactured by cvs2svn to create branch 'JSDT302'.nitind16 years
JSDT303fix hyperlink detection in HTML files.bchilds16 years
M3Candidate11-9-07This commit was manufactured by cvs2svn to create branchnitind17 years
R0_7_maintenance[110356] WSDL editor content assist not working if WSDL schemas are not expli...jeffliu19 years
R1_0_maintenance[151925] Need to produce update jars in 1.0.3 builddavid_williams18 years
R1_5_5_patches[304575] [translation] Cannot be resolved errors when Struts <bean:define> is...david_williams14 years
R1_5_branchFix filterkchong18 years
R1_5_maintenance[197315] Refresh of the Extensions Section doesn't behave correctlykchong17 years
R1_5_maintenance_patches[166738] Request for feature patch for 5 bugsdavid_williams18 years
R2_0_2_patchesfix URL to bugdavid_williams16 years
R2_0_maintenanceincrement service feild for features with modified contentsdavid_williams16 years
R3_0_0_patchescleanup project names, to include branch, etc.david_williams16 years
R3_0_1_patches246795 Regression from 246275david_williams16 years
R3_0_4_patchesThis commit was manufactured by cvs2svn to create branch 'R3_0_4_patches'.nitind15 years
R3_0_4_updatesThis commit was manufactured by cvs2svn to create branch 'R3_0_4_updates'.nitind15 years
R3_0_5_patches[352148] JSP Validator will not allow use of default namespacenitind13 years
R3_0_maintenance[276552] URL redirection breaks references to external schemasgindik15 years
R3_10_maintenanceBug 534862 - [releng] stop using jsr14 as a targetMat Booth6 years
R3_1_2_patches312patches builddavid_williams15 years
R3_1_maintenance[297520] EL for pageContext.request generates wrong class for castingnitind15 years
R3_2_1_patchesfix title of build notes pagedavid_williams14 years
R3_2_1aThis commit was manufactured by cvs2svn to create branch 'R3_2_1a'.nitind14 years
R3_2_2_patches[326632] [ui] Project web content settings is not saved when Document type is...nitind14 years
R3_2_3_patches[370379] Not all schema locations are honored for some WSDLsnsandonato13 years
R3_2_4_patches[345778] Duplicate tld entries in taglib indexnitind13 years
R3_2_5_patches[436412] backport Bug 428374: [formatting] unknown regions remove inline css ...Nick Sandonato10 years
R3_2_maintenance[329094] Cleanup unread fields/variables that are only incremented/decrementednitind13 years
R3_3_2_patches[nobug] increment version for 3.3.2 patchesNick Sandonato12 years
R3_3_maintenance[371021] Incorrect validation of resource across web projectsnsandonato13 years
R3_4_2_patches[440912] Can not change names in XML Schema Editor when schema does notkchong10 years
R3_4_maintenance[399934] jsp_2_1.xsd and jsp_2_2.xsd are incorrectly registeredNitin Dahyabhai12 years
R3_5_maintenance[nobug] Increment version for 3.5.2Nick Sandonato11 years
R3_6_2_maintenance[444545] [validation] Ability to ignore custom html tag - Fix build breakNick Sandonato10 years
R3_6_maintenanceBug 458962 - WTP 3.7.0 Compile errorDavid Williams10 years
R3_7_maintenance[482859] Failure to check namespace in OpenOnSelectionHelper - 3.7.2kchong9 years
R3_8_maintenance[508083] XML External Entity vulnerability, increment org.eclipse.wst.xml.cor...Nitin Dahyabhai8 years
R3_9_maintenance[530140] Increment for 3.9.3 releaseNitin Dahyabhai7 years
Refactor0428turned debuging offbchilds16 years
T_Early302[243660] NullPointerException from AnnotationQuery invoking QuickFixnitind16 years
T_Early_302This commit was manufactured by cvs2svn to create branch 'T_Early_302'.nitind16 years
david_williams_tempBranchprep for source jarsdavid_williams17 years
david_williams_tempTests2prep for update site scriptsdavid_williams16 years
jsdtDev11082007This commit was manufactured by cvs2svn to create branch 'jsdtDev11082007'.nitind17 years
master[nobug] Change synchronization setup to reduce chance of blocking UI during v...Nitin Dahyabhai13 months
tempBug155790[155790] Missing HTML-ish functions on IDOMModel created from XHTML text/xml ...david_williams18 years
unlabeled-1.1.2Fix filterkchong18 years
unlabeled-1.1.4[127360] Renaming a file fails with a NullPointerExceptionkchong19 years
unlabeled-1.1.6[129902] CSS parser doesn't handle negative value correctly -- potential fix ...david_williams18 years
unlabeled-1.10.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.12.2experimental version of JSP indexerdavid_williams19 years
unlabeled-1.12.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.15.2added "interrupt" logic, cancels job if build starts, then resumes when build...pavery19 years
unlabeled-1.16.2Remove AppInfo labels and replace them with Extensionskchong18 years
unlabeled-1.17.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.18.2Export refactor.rename packagekchong18 years
unlabeled-1.2.2Use correct plugin classkchong19 years
unlabeled-1.2.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.3.2re-enable refactoring and search actions from design viewcsalter19 years
unlabeled-1.3.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.34.2Remove AppInfo labels and replace them with Extensionskchong18 years
unlabeled-1.4.2re-enable refactoring and search actions from design viewcsalter19 years
unlabeled-1.4.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.5.2[129902] CSS parser doesn't handle negative value correctly -- potential fix ...david_williams18 years
unlabeled-1.5.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.6.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.7.4committing work in progress to temp branchdavid_williams20 years
unlabeled-1.9.2Add src-search folderkchong19 years
 
TagDownloadAuthorAge
R3_31webtools.sourceediting-R3_31.tar.gz  webtools.sourceediting-R3_31.tar.xz  webtools.sourceediting-R3_31.zip  Nitin Dahyabhai13 months
R3_30webtools.sourceediting-R3_30.tar.gz  webtools.sourceediting-R3_30.tar.xz  webtools.sourceediting-R3_30.zip  Nitin Dahyabhai16 months
R3_29webtools.sourceediting-R3_29.tar.gz  webtools.sourceediting-R3_29.tar.xz  webtools.sourceediting-R3_29.zip  Nitin Dahyabhai19 months
R3_28webtools.sourceediting-R3_28.tar.gz  webtools.sourceediting-R3_28.tar.xz  webtools.sourceediting-R3_28.zip  Nitin Dahyabhai22 months
R3_27webtools.sourceediting-R3_27.tar.gz  webtools.sourceediting-R3_27.tar.xz  webtools.sourceediting-R3_27.zip  Nitin Dahyabhai2 years
R3_26webtools.sourceediting-R3_26.tar.gz  webtools.sourceediting-R3_26.tar.xz  webtools.sourceediting-R3_26.zip  Nitin Dahyabhai2 years
R3_25webtools.sourceediting-R3_25.tar.gz  webtools.sourceediting-R3_25.tar.xz  webtools.sourceediting-R3_25.zip  Nitin Dahyabhai3 years
R3_24webtools.sourceediting-R3_24.tar.gz  webtools.sourceediting-R3_24.tar.xz  webtools.sourceediting-R3_24.zip  Nitin Dahyabhai3 years
R3_23webtools.sourceediting-R3_23.tar.gz  webtools.sourceediting-R3_23.tar.xz  webtools.sourceediting-R3_23.zip  Nitin Dahyabhai3 years
R3_22webtools.sourceediting-R3_22.tar.gz  webtools.sourceediting-R3_22.tar.xz  webtools.sourceediting-R3_22.zip  Nitin Dahyabhai3 years
R3_21webtools.sourceediting-R3_21.tar.gz  webtools.sourceediting-R3_21.tar.xz  webtools.sourceediting-R3_21.zip  Nitin Dahyabhai4 years
R3_20webtools.sourceediting-R3_20.tar.gz  webtools.sourceediting-R3_20.tar.xz  webtools.sourceediting-R3_20.zip  Nitin Dahyabhai4 years
R3_19webtools.sourceediting-R3_19.tar.gz  webtools.sourceediting-R3_19.tar.xz  webtools.sourceediting-R3_19.zip  Nitin Dahyabhai4 years
R3_18webtools.sourceediting-R3_18.tar.gz  webtools.sourceediting-R3_18.tar.xz  webtools.sourceediting-R3_18.zip  Nitin Dahyabhai4 years
R3_17webtools.sourceediting-R3_17.tar.gz  webtools.sourceediting-R3_17.tar.xz  webtools.sourceediting-R3_17.zip  Nitin Dahyabhai5 years
R3_16webtools.sourceediting-R3_16.tar.gz  webtools.sourceediting-R3_16.tar.xz  webtools.sourceediting-R3_16.zip  Nitin Dahyabhai5 years
R3_15webtools.sourceediting-R3_15.tar.gz  webtools.sourceediting-R3_15.tar.xz  webtools.sourceediting-R3_15.zip  Nitin Dahyabhai5 years
R3_14webtools.sourceediting-R3_14.tar.gz  webtools.sourceediting-R3_14.tar.xz  webtools.sourceediting-R3_14.zip  Nitin Dahyabhai5 years
R3_13webtools.sourceediting-R3_13.tar.gz  webtools.sourceediting-R3_13.tar.xz  webtools.sourceediting-R3_13.zip  Nitin Dahyabhai6 years
R3_12webtools.sourceediting-R3_12.tar.gz  webtools.sourceediting-R3_12.tar.xz  webtools.sourceediting-R3_12.zip  Nitin Dahyabhai6 years
R3_11webtools.sourceediting-R3_11.tar.gz  webtools.sourceediting-R3_11.tar.xz  webtools.sourceediting-R3_11.zip  Nitin Dahyabhai6 years
R3_10_0webtools.sourceediting-R3_10_0.tar.gz  webtools.sourceediting-R3_10_0.tar.xz  webtools.sourceediting-R3_10_0.zip  Mat Booth6 years
R3_9_3webtools.sourceediting-R3_9_3.tar.gz  webtools.sourceediting-R3_9_3.tar.xz  webtools.sourceediting-R3_9_3.zip  Nitin Dahyabhai7 years
R3_9_3awebtools.sourceediting-R3_9_3a.tar.gz  webtools.sourceediting-R3_9_3a.tar.xz  webtools.sourceediting-R3_9_3a.zip  Nitin Dahyabhai7 years
R3_9_1a_finalwebtools.sourceediting-R3_9_1a_final.tar.gz  webtools.sourceediting-R3_9_1a_final.tar.xz  webtools.sourceediting-R3_9_1a_final.zip  Keith Chong7 years
R3_9_1awebtools.sourceediting-R3_9_1a.tar.gz  webtools.sourceediting-R3_9_1a.tar.xz  webtools.sourceediting-R3_9_1a.zip  Keith Chong7 years
R3_9_1webtools.sourceediting-R3_9_1.tar.gz  webtools.sourceediting-R3_9_1.tar.xz  webtools.sourceediting-R3_9_1.zip  Nitin Dahyabhai7 years
R3_9_0webtools.sourceediting-R3_9_0.tar.gz  webtools.sourceediting-R3_9_0.tar.xz  webtools.sourceediting-R3_9_0.zip  Keith Chong7 years
R3_8_2webtools.sourceediting-R3_8_2.tar.gz  webtools.sourceediting-R3_8_2.tar.xz  webtools.sourceediting-R3_8_2.zip  Nitin Dahyabhai8 years
R3_8_1webtools.sourceediting-R3_8_1.tar.gz  webtools.sourceediting-R3_8_1.tar.xz  webtools.sourceediting-R3_8_1.zip  Ilya Buziuk8 years
R3_8_0webtools.sourceediting-R3_8_0.tar.gz  webtools.sourceediting-R3_8_0.tar.xz  webtools.sourceediting-R3_8_0.zip  Victor Rubezhny8 years
R3_7_2webtools.sourceediting-R3_7_2.tar.gz  webtools.sourceediting-R3_7_2.tar.xz  webtools.sourceediting-R3_7_2.zip  kchong9 years
R3_7_1webtools.sourceediting-R3_7_1.tar.gz  webtools.sourceediting-R3_7_1.tar.xz  webtools.sourceediting-R3_7_1.zip  Alina Marin9 years
R3_7_0webtools.sourceediting-R3_7_0.tar.gz  webtools.sourceediting-R3_7_0.tar.xz  webtools.sourceediting-R3_7_0.zip  Nitin Dahyabhai9 years
R3_6_3webtools.sourceediting-R3_6_3.tar.gz  webtools.sourceediting-R3_6_3.tar.xz  webtools.sourceediting-R3_6_3.zip  David Williams10 years
R3_6_1webtools.sourceediting-R3_6_1.tar.gz  webtools.sourceediting-R3_6_1.tar.xz  webtools.sourceediting-R3_6_1.zip  Nick Sandonato10 years
v201408131441webtools.sourceediting-201408131441.tar.gz  webtools.sourceediting-201408131441.tar.xz  webtools.sourceediting-201408131441.zip  kchong10 years
v201408112023webtools.sourceediting-201408112023.tar.gz  webtools.sourceediting-201408112023.tar.xz  webtools.sourceediting-201408112023.zip  kchong10 years
v201407282104webtools.sourceediting-201407282104.tar.gz  webtools.sourceediting-201407282104.tar.xz  webtools.sourceediting-201407282104.zip  Nick Sandonato10 years
v201406121520webtools.sourceediting-201406121520.tar.gz  webtools.sourceediting-201406121520.tar.xz  webtools.sourceediting-201406121520.zip  Nick Sandonato10 years
R3_6_0webtools.sourceediting-R3_6_0.tar.gz  webtools.sourceediting-R3_6_0.tar.xz  webtools.sourceediting-R3_6_0.zip  vrubezhny10 years
v201405291913webtools.sourceediting-201405291913.tar.gz  webtools.sourceediting-201405291913.tar.xz  webtools.sourceediting-201405291913.zip  vrubezhny10 years
v201405221842webtools.sourceediting-201405221842.tar.gz  webtools.sourceediting-201405221842.tar.xz  webtools.sourceediting-201405221842.zip  Gregory Amerson10 years
v201405151950webtools.sourceediting-201405151950.tar.gz  webtools.sourceediting-201405151950.tar.xz  webtools.sourceediting-201405151950.zip  vrubezhny10 years
v201405062158webtools.sourceediting-201405062158.tar.gz  webtools.sourceediting-201405062158.tar.xz  webtools.sourceediting-201405062158.zip  Nick Sandonato10 years
v201405062148webtools.sourceediting-201405062148.tar.gz  webtools.sourceediting-201405062148.tar.xz  webtools.sourceediting-201405062148.zip  Nick Sandonato10 years
v201404240330webtools.sourceediting-201404240330.tar.gz  webtools.sourceediting-201404240330.tar.xz  webtools.sourceediting-201404240330.zip  vrubezhny10 years
v201404240319webtools.sourceediting-201404240319.tar.gz  webtools.sourceediting-201404240319.tar.xz  webtools.sourceediting-201404240319.zip  Dawid PakuÅ‚a10 years
v201404240239webtools.sourceediting-201404240239.tar.gz  webtools.sourceediting-201404240239.tar.xz  webtools.sourceediting-201404240239.zip  Gregory Amerson10 years
v201404092334webtools.sourceediting-201404092334.tar.gz  webtools.sourceediting-201404092334.tar.xz  webtools.sourceediting-201404092334.zip  Greg Amerson10 years
v201404091739webtools.sourceediting-201404091739.tar.gz  webtools.sourceediting-201404091739.tar.xz  webtools.sourceediting-201404091739.zip  Nick Sandonato10 years
v201404081933webtools.sourceediting-201404081933.tar.gz  webtools.sourceediting-201404081933.tar.xz  webtools.sourceediting-201404081933.zip  Nick Sandonato10 years
v201403281809webtools.sourceediting-201403281809.tar.gz  webtools.sourceediting-201403281809.tar.xz  webtools.sourceediting-201403281809.zip  Nitin Dahyabhai10 years
v201403271810webtools.sourceediting-201403271810.tar.gz  webtools.sourceediting-201403271810.tar.xz  webtools.sourceediting-201403271810.zip  Nitin Dahyabhai10 years
v201403122203webtools.sourceediting-201403122203.tar.gz  webtools.sourceediting-201403122203.tar.xz  webtools.sourceediting-201403122203.zip  Nick Sandonato11 years
v201403122151webtools.sourceediting-201403122151.tar.gz  webtools.sourceediting-201403122151.tar.xz  webtools.sourceediting-201403122151.zip  vrubezhny11 years
v201403121649webtools.sourceediting-201403121649.tar.gz  webtools.sourceediting-201403121649.tar.xz  webtools.sourceediting-201403121649.zip  vrubezhny11 years
v201402270431webtools.sourceediting-201402270431.tar.gz  webtools.sourceediting-201402270431.tar.xz  webtools.sourceediting-201402270431.zip  vrubezhny11 years
v201402182334webtools.sourceediting-201402182334.tar.gz  webtools.sourceediting-201402182334.tar.xz  webtools.sourceediting-201402182334.zip  Nick Sandonato11 years
v201402172110webtools.sourceediting-201402172110.tar.gz  webtools.sourceediting-201402172110.tar.xz  webtools.sourceediting-201402172110.zip  Nick Sandonato11 years
v201402052029webtools.sourceediting-201402052029.tar.gz  webtools.sourceediting-201402052029.tar.xz  webtools.sourceediting-201402052029.zip  Nick Sandonato11 years
R3_5_2webtools.sourceediting-R3_5_2.tar.gz  webtools.sourceediting-R3_5_2.tar.xz  webtools.sourceediting-R3_5_2.zip  Nick Sandonato11 years
v201402052019webtools.sourceediting-201402052019.tar.gz  webtools.sourceediting-201402052019.tar.xz  webtools.sourceediting-201402052019.zip  Nick Sandonato11 years
v201401301446webtools.sourceediting-201401301446.tar.gz  webtools.sourceediting-201401301446.tar.xz  webtools.sourceediting-201401301446.zip  Nitin Dahyabhai11 years
v201401292150webtools.sourceediting-201401292150.tar.gz  webtools.sourceediting-201401292150.tar.xz  webtools.sourceediting-201401292150.zip  vrubezhny11 years
v201401172315webtools.sourceediting-201401172315.tar.gz  webtools.sourceediting-201401172315.tar.xz  webtools.sourceediting-201401172315.zip  Nitin Dahyabhai11 years
v201401151909webtools.sourceediting-201401151909.tar.gz  webtools.sourceediting-201401151909.tar.xz  webtools.sourceediting-201401151909.zip  Nick Sandonato11 years
v201401151906webtools.sourceediting-201401151906.tar.gz  webtools.sourceediting-201401151906.tar.xz  webtools.sourceediting-201401151906.zip  Nick Sandonato11 years
v201401141907webtools.sourceediting-201401141907.tar.gz  webtools.sourceediting-201401141907.tar.xz  webtools.sourceediting-201401141907.zip  kchong11 years
v201401132128webtools.sourceediting-201401132128.tar.gz  webtools.sourceediting-201401132128.tar.xz  webtools.sourceediting-201401132128.zip  Nick Sandonato11 years
v201401132103webtools.sourceediting-201401132103.tar.gz  webtools.sourceediting-201401132103.tar.xz  webtools.sourceediting-201401132103.zip  Nick Sandonato11 years
v201401131445webtools.sourceediting-201401131445.tar.gz  webtools.sourceediting-201401131445.tar.xz  webtools.sourceediting-201401131445.zip  Nick Sandonato11 years
v201401101955webtools.sourceediting-201401101955.tar.gz  webtools.sourceediting-201401101955.tar.xz  webtools.sourceediting-201401101955.zip  Nick Sandonato11 years
v201401101620webtools.sourceediting-201401101620.tar.gz  webtools.sourceediting-201401101620.tar.xz  webtools.sourceediting-201401101620.zip  Nick Sandonato11 years
v201401101615webtools.sourceediting-201401101615.tar.gz  webtools.sourceediting-201401101615.tar.xz  webtools.sourceediting-201401101615.zip  Nick Sandonato11 years
v201401062113webtools.sourceediting-201401062113.tar.gz  webtools.sourceediting-201401062113.tar.xz  webtools.sourceediting-201401062113.zip  Nick Sandonato11 years
v201312271449webtools.sourceediting-201312271449.tar.gz  webtools.sourceediting-201312271449.tar.xz  webtools.sourceediting-201312271449.zip  Nick Sandonato11 years
v201312271445webtools.sourceediting-201312271445.tar.gz  webtools.sourceediting-201312271445.tar.xz  webtools.sourceediting-201312271445.zip  Nick Sandonato11 years
v201312202040webtools.sourceediting-201312202040.tar.gz  webtools.sourceediting-201312202040.tar.xz  webtools.sourceediting-201312202040.zip  Nick Sandonato11 years
v201312111539webtools.sourceediting-201312111539.tar.gz  webtools.sourceediting-201312111539.tar.xz  webtools.sourceediting-201312111539.zip  Nick Sandonato11 years
v201312092033webtools.sourceediting-201312092033.tar.gz  webtools.sourceediting-201312092033.tar.xz  webtools.sourceediting-201312092033.zip  Nick Sandonato11 years
v201312092029webtools.sourceediting-201312092029.tar.gz  webtools.sourceediting-201312092029.tar.xz  webtools.sourceediting-201312092029.zip  Nick Sandonato11 years
v201312101952webtools.sourceediting-201312101952.tar.gz  webtools.sourceediting-201312101952.tar.xz  webtools.sourceediting-201312101952.zip  Nick Sandonato11 years
v201312091617webtools.sourceediting-201312091617.tar.gz  webtools.sourceediting-201312091617.tar.xz  webtools.sourceediting-201312091617.zip  Nick Sandonato11 years
v201312080345webtools.sourceediting-201312080345.tar.gz  webtools.sourceediting-201312080345.tar.xz  webtools.sourceediting-201312080345.zip  Nitin Dahyabhai11 years
v201312091610webtools.sourceediting-201312091610.tar.gz  webtools.sourceediting-201312091610.tar.xz  webtools.sourceediting-201312091610.zip  Nick Sandonato11 years
v201311181802webtools.sourceediting-201311181802.tar.gz  webtools.sourceediting-201311181802.tar.xz  webtools.sourceediting-201311181802.zip  Nick Sandonato11 years
v201311152002webtools.sourceediting-201311152002.tar.gz  webtools.sourceediting-201311152002.tar.xz  webtools.sourceediting-201311152002.zip  Nick Sandonato11 years
v201311151629webtools.sourceediting-201311151629.tar.gz  webtools.sourceediting-201311151629.tar.xz  webtools.sourceediting-201311151629.zip  Nick Sandonato11 years
v201311151625webtools.sourceediting-201311151625.tar.gz  webtools.sourceediting-201311151625.tar.xz  webtools.sourceediting-201311151625.zip  Nick Sandonato11 years
v201311142216webtools.sourceediting-201311142216.tar.gz  webtools.sourceediting-201311142216.tar.xz  webtools.sourceediting-201311142216.zip  Nick Sandonato11 years
v201311081527webtools.sourceediting-201311081527.tar.gz  webtools.sourceediting-201311081527.tar.xz  webtools.sourceediting-201311081527.zip  Nick Sandonato11 years
v201311081525webtools.sourceediting-201311081525.tar.gz  webtools.sourceediting-201311081525.tar.xz  webtools.sourceediting-201311081525.zip  Nick Sandonato11 years
v201311081522webtools.sourceediting-201311081522.tar.gz  webtools.sourceediting-201311081522.tar.xz  webtools.sourceediting-201311081522.zip  Nick Sandonato11 years
v201311070437webtools.sourceediting-201311070437.tar.gz  webtools.sourceediting-201311070437.tar.xz  webtools.sourceediting-201311070437.zip  Nick Sandonato11 years
v201311062119webtools.sourceediting-201311062119.tar.gz  webtools.sourceediting-201311062119.tar.xz  webtools.sourceediting-201311062119.zip  Nick Sandonato11 years
v201311061556webtools.sourceediting-201311061556.tar.gz  webtools.sourceediting-201311061556.tar.xz  webtools.sourceediting-201311061556.zip  Nick Sandonato11 years
v201311061554webtools.sourceediting-201311061554.tar.gz  webtools.sourceediting-201311061554.tar.xz  webtools.sourceediting-201311061554.zip  vrubezhny11 years
v201311052055webtools.sourceediting-201311052055.tar.gz  webtools.sourceediting-201311052055.tar.xz  webtools.sourceediting-201311052055.zip  Nick Sandonato11 years
v201311052047webtools.sourceediting-201311052047.tar.gz  webtools.sourceediting-201311052047.tar.xz  webtools.sourceediting-201311052047.zip  Nick Sandonato11 years
v201311052034webtools.sourceediting-201311052034.tar.gz  webtools.sourceediting-201311052034.tar.xz  webtools.sourceediting-201311052034.zip  Nick Sandonato11 years
v201310281754webtools.sourceediting-201310281754.tar.gz  webtools.sourceediting-201310281754.tar.xz  webtools.sourceediting-201310281754.zip  Nick Sandonato11 years
v201310281751webtools.sourceediting-201310281751.tar.gz  webtools.sourceediting-201310281751.tar.xz  webtools.sourceediting-201310281751.zip  Nick Sandonato11 years
v201310281748webtools.sourceediting-201310281748.tar.gz  webtools.sourceediting-201310281748.tar.xz  webtools.sourceediting-201310281748.zip  Nick Sandonato11 years
v201310242110webtools.sourceediting-201310242110.tar.gz  webtools.sourceediting-201310242110.tar.xz  webtools.sourceediting-201310242110.zip  Nick Sandonato11 years
v201310232024webtools.sourceediting-201310232024.tar.gz  webtools.sourceediting-201310232024.tar.xz  webtools.sourceediting-201310232024.zip  Nick Sandonato11 years
v201310222038webtools.sourceediting-201310222038.tar.gz  webtools.sourceediting-201310222038.tar.xz  webtools.sourceediting-201310222038.zip  Nick Sandonato11 years
v201310222036webtools.sourceediting-201310222036.tar.gz  webtools.sourceediting-201310222036.tar.xz  webtools.sourceediting-201310222036.zip  Nick Sandonato11 years
v201310221739webtools.sourceediting-201310221739.tar.gz  webtools.sourceediting-201310221739.tar.xz  webtools.sourceediting-201310221739.zip  Nick Sandonato11 years
v201310221736webtools.sourceediting-201310221736.tar.gz  webtools.sourceediting-201310221736.tar.xz  webtools.sourceediting-201310221736.zip  Nick Sandonato11 years
v201310212110webtools.sourceediting-201310212110.tar.gz  webtools.sourceediting-201310212110.tar.xz  webtools.sourceediting-201310212110.zip  Nick Sandonato11 years
v201310212103webtools.sourceediting-201310212103.tar.gz  webtools.sourceediting-201310212103.tar.xz  webtools.sourceediting-201310212103.zip  Nick Sandonato11 years
v201310181508webtools.sourceediting-201310181508.tar.gz  webtools.sourceediting-201310181508.tar.xz  webtools.sourceediting-201310181508.zip  Nick Sandonato11 years
v201310051920webtools.sourceediting-201310051920.tar.gz  webtools.sourceediting-201310051920.tar.xz  webtools.sourceediting-201310051920.zip  Nitin Dahyabhai11 years
v201310051915webtools.sourceediting-201310051915.tar.gz  webtools.sourceediting-201310051915.tar.xz  webtools.sourceediting-201310051915.zip  Nitin Dahyabhai11 years
v201310051836webtools.sourceediting-201310051836.tar.gz  webtools.sourceediting-201310051836.tar.xz  webtools.sourceediting-201310051836.zip  Nitin Dahyabhai11 years
v201310051835webtools.sourceediting-201310051835.tar.gz  webtools.sourceediting-201310051835.tar.xz  webtools.sourceediting-201310051835.zip  Nitin Dahyabhai11 years
v201310051830webtools.sourceediting-201310051830.tar.gz  webtools.sourceediting-201310051830.tar.xz  webtools.sourceediting-201310051830.zip  Nitin Dahyabhai11 years
v201310051825webtools.sourceediting-201310051825.tar.gz  webtools.sourceediting-201310051825.tar.xz  webtools.sourceediting-201310051825.zip  Nitin Dahyabhai11 years
v201309181520webtools.sourceediting-201309181520.tar.gz  webtools.sourceediting-201309181520.tar.xz  webtools.sourceediting-201309181520.zip  Nick Sandonato11 years
v201309112107webtools.sourceediting-201309112107.tar.gz  webtools.sourceediting-201309112107.tar.xz  webtools.sourceediting-201309112107.zip  Thanh Ha11 years
R3_5_1webtools.sourceediting-R3_5_1.tar.gz  webtools.sourceediting-R3_5_1.tar.xz  webtools.sourceediting-R3_5_1.zip  Jason Peterson11 years
v201308282108webtools.sourceediting-201308282108.tar.gz  webtools.sourceediting-201308282108.tar.xz  webtools.sourceediting-201308282108.zip  Jason Peterson11 years
v201308132110webtools.sourceediting-201308132110.tar.gz  webtools.sourceediting-201308132110.tar.xz  webtools.sourceediting-201308132110.zip  Nick Sandonato11 years
v201308132106webtools.sourceediting-201308132106.tar.gz  webtools.sourceediting-201308132106.tar.xz  webtools.sourceediting-201308132106.zip  Nick Sandonato11 years
v201308100603webtools.sourceediting-201308100603.tar.gz  webtools.sourceediting-201308100603.tar.xz  webtools.sourceediting-201308100603.zip  Nitin Dahyabhai11 years
v201308080352webtools.sourceediting-201308080352.tar.gz  webtools.sourceediting-201308080352.tar.xz  webtools.sourceediting-201308080352.zip  Nitin Dahyabhai11 years
v201308012100webtools.sourceediting-201308012100.tar.gz  webtools.sourceediting-201308012100.tar.xz  webtools.sourceediting-201308012100.zip  Nick Sandonato11 years
v201307311532webtools.sourceediting-201307311532.tar.gz  webtools.sourceediting-201307311532.tar.xz  webtools.sourceediting-201307311532.zip  Salvador Zalapa11 years
v201307311518webtools.sourceediting-201307311518.tar.gz  webtools.sourceediting-201307311518.tar.xz  webtools.sourceediting-201307311518.zip  Nick Sandonato11 years
v201307311419webtools.sourceediting-201307311419.tar.gz  webtools.sourceediting-201307311419.tar.xz  webtools.sourceediting-201307311419.zip  Nick Sandonato11 years
v201307241839webtools.sourceediting-201307241839.tar.gz  webtools.sourceediting-201307241839.tar.xz  webtools.sourceediting-201307241839.zip  Nick Sandonato11 years
v201307241658webtools.sourceediting-201307241658.tar.gz  webtools.sourceediting-201307241658.tar.xz  webtools.sourceediting-201307241658.zip  Salvador Zalapa11 years
v201307241514webtools.sourceediting-201307241514.tar.gz  webtools.sourceediting-201307241514.tar.xz  webtools.sourceediting-201307241514.zip  Nick Sandonato11 years
v201307171524webtools.sourceediting-201307171524.tar.gz  webtools.sourceediting-201307171524.tar.xz  webtools.sourceediting-201307171524.zip  Nitin Dahyabhai11 years
v201307162035webtools.sourceediting-201307162035.tar.gz  webtools.sourceediting-201307162035.tar.xz  webtools.sourceediting-201307162035.zip  Jason Peterson11 years
v201307101442webtools.sourceediting-201307101442.tar.gz  webtools.sourceediting-201307101442.tar.xz  webtools.sourceediting-201307101442.zip  Salvador Zalapa11 years
v201306100319webtools.sourceediting-201306100319.tar.gz  webtools.sourceediting-201306100319.tar.xz  webtools.sourceediting-201306100319.zip  Nitin Dahyabhai11 years
v201307100319webtools.sourceediting-201307100319.tar.gz  webtools.sourceediting-201307100319.tar.xz  webtools.sourceediting-201307100319.zip  Nitin Dahyabhai11 years
v201306191907webtools.sourceediting-201306191907.tar.gz  webtools.sourceediting-201306191907.tar.xz  webtools.sourceediting-201306191907.zip  Nick Sandonato11 years
R3_5_0webtools.sourceediting-R3_5_0.tar.gz  webtools.sourceediting-R3_5_0.tar.xz  webtools.sourceediting-R3_5_0.zip  Nitin Dahyabhai11 years
v201306071601webtools.sourceediting-201306071601.tar.gz  webtools.sourceediting-201306071601.tar.xz  webtools.sourceediting-201306071601.zip  Nitin Dahyabhai11 years
v201305231718webtools.sourceediting-201305231718.tar.gz  webtools.sourceediting-201305231718.tar.xz  webtools.sourceediting-201305231718.zip  Chandler Zhang11 years
v201305161752webtools.sourceediting-201305161752.tar.gz  webtools.sourceediting-201305161752.tar.xz  webtools.sourceediting-201305161752.zip  Nick Sandonato11 years
v201305152105webtools.sourceediting-201305152105.tar.gz  webtools.sourceediting-201305152105.tar.xz  webtools.sourceediting-201305152105.zip  Nick Sandonato11 years
v201305152046webtools.sourceediting-201305152046.tar.gz  webtools.sourceediting-201305152046.tar.xz  webtools.sourceediting-201305152046.zip  Salvador Zalapa11 years
v201305151425webtools.sourceediting-201305151425.tar.gz  webtools.sourceediting-201305151425.tar.xz  webtools.sourceediting-201305151425.zip  Nick Sandonato11 years
v201305081755webtools.sourceediting-201305081755.tar.gz  webtools.sourceediting-201305081755.tar.xz  webtools.sourceediting-201305081755.zip  Nick Sandonato11 years
v201304301825webtools.sourceediting-201304301825.tar.gz  webtools.sourceediting-201304301825.tar.xz  webtools.sourceediting-201304301825.zip  Salvador Zalapa11 years
v201304301743webtools.sourceediting-201304301743.tar.gz  webtools.sourceediting-201304301743.tar.xz  webtools.sourceediting-201304301743.zip  Salvador Zalapa11 years
v201304292145webtools.sourceediting-201304292145.tar.gz  webtools.sourceediting-201304292145.tar.xz  webtools.sourceediting-201304292145.zip  Nick Sandonato11 years
v201304292057webtools.sourceediting-201304292057.tar.gz  webtools.sourceediting-201304292057.tar.xz  webtools.sourceediting-201304292057.zip  Paul Fullbright11 years
v201304222123webtools.sourceediting-201304222123.tar.gz  webtools.sourceediting-201304222123.tar.xz  webtools.sourceediting-201304222123.zip  Nitin Dahyabhai11 years
v201304171716webtools.sourceediting-201304171716.tar.gz  webtools.sourceediting-201304171716.tar.xz  webtools.sourceediting-201304171716.zip  kchong11 years
v201304110304webtools.sourceediting-201304110304.tar.gz  webtools.sourceediting-201304110304.tar.xz  webtools.sourceediting-201304110304.zip  Nick Sandonato11 years
v201304051651webtools.sourceediting-201304051651.tar.gz  webtools.sourceediting-201304051651.tar.xz  webtools.sourceediting-201304051651.zip  Nitin Dahyabhai11 years
v201304051851webtools.sourceediting-201304051851.tar.gz  webtools.sourceediting-201304051851.tar.xz  webtools.sourceediting-201304051851.zip  Nitin Dahyabhai11 years
v201304051740webtools.sourceediting-201304051740.tar.gz  webtools.sourceediting-201304051740.tar.xz  webtools.sourceediting-201304051740.zip  Salvador Zalapa11 years
v201304021914webtools.sourceediting-201304021914.tar.gz  webtools.sourceediting-201304021914.tar.xz  webtools.sourceediting-201304021914.zip  Nick Sandonato11 years
v201304012131webtools.sourceediting-201304012131.tar.gz  webtools.sourceediting-201304012131.tar.xz  webtools.sourceediting-201304012131.zip  Nick Sandonato11 years
v201303281757webtools.sourceediting-201303281757.tar.gz  webtools.sourceediting-201303281757.tar.xz  webtools.sourceediting-201303281757.zip  Nick Sandonato11 years
v201303252101webtools.sourceediting-201303252101.tar.gz  webtools.sourceediting-201303252101.tar.xz  webtools.sourceediting-201303252101.zip  Nick Sandonato11 years
v201303252031webtools.sourceediting-201303252031.tar.gz  webtools.sourceediting-201303252031.tar.xz  webtools.sourceediting-201303252031.zip  Nick Sandonato11 years
v201303221844webtools.sourceediting-201303221844.tar.gz  webtools.sourceediting-201303221844.tar.xz  webtools.sourceediting-201303221844.zip  Nick Sandonato12 years
v201303132123webtools.sourceediting-201303132123.tar.gz  webtools.sourceediting-201303132123.tar.xz  webtools.sourceediting-201303132123.zip  Nick Sandonato12 years
v201303131958webtools.sourceediting-201303131958.tar.gz  webtools.sourceediting-201303131958.tar.xz  webtools.sourceediting-201303131958.zip  Nick Sandonato12 years
v201303071547webtools.sourceediting-201303071547.tar.gz  webtools.sourceediting-201303071547.tar.xz  webtools.sourceediting-201303071547.zip  Nick Sandonato12 years
v201303070140webtools.sourceediting-201303070140.tar.gz  webtools.sourceediting-201303070140.tar.xz  webtools.sourceediting-201303070140.zip  Nick Sandonato12 years
v201303062206webtools.sourceediting-201303062206.tar.gz  webtools.sourceediting-201303062206.tar.xz  webtools.sourceediting-201303062206.zip  Nick Sandonato12 years
v201303051900webtools.sourceediting-201303051900.tar.gz  webtools.sourceediting-201303051900.tar.xz  webtools.sourceediting-201303051900.zip  Nick Sandonato12 years
v201302262134webtools.sourceediting-201302262134.tar.gz  webtools.sourceediting-201302262134.tar.xz  webtools.sourceediting-201302262134.zip  Nick Sandonato12 years
v201302262113webtools.sourceediting-201302262113.tar.gz  webtools.sourceediting-201302262113.tar.xz  webtools.sourceediting-201302262113.zip  Nick Sandonato12 years
v201302260115webtools.sourceediting-201302260115.tar.gz  webtools.sourceediting-201302260115.tar.xz  webtools.sourceediting-201302260115.zip  Nick Sandonato12 years
v201302202248webtools.sourceediting-201302202248.tar.gz  webtools.sourceediting-201302202248.tar.xz  webtools.sourceediting-201302202248.zip  Nick Sandonato12 years
v201302201551webtools.sourceediting-201302201551.tar.gz  webtools.sourceediting-201302201551.tar.xz  webtools.sourceediting-201302201551.zip  Nick Sandonato12 years
v201302140348webtools.sourceediting-201302140348.tar.gz  webtools.sourceediting-201302140348.tar.xz  webtools.sourceediting-201302140348.zip  Nick Sandonato12 years
v201302131613webtools.sourceediting-201302131613.tar.gz  webtools.sourceediting-201302131613.tar.xz  webtools.sourceediting-201302131613.zip  Nick Sandonato12 years
v201302131536webtools.sourceediting-201302131536.tar.gz  webtools.sourceediting-201302131536.tar.xz  webtools.sourceediting-201302131536.zip  Nick Sandonato12 years
v201302131502webtools.sourceediting-201302131502.tar.gz  webtools.sourceediting-201302131502.tar.xz  webtools.sourceediting-201302131502.zip  Nick Sandonato12 years
v201302121550webtools.sourceediting-201302121550.tar.gz  webtools.sourceediting-201302121550.tar.xz  webtools.sourceediting-201302121550.zip  Nitin Dahyabhai12 years
R3_4_2webtools.sourceediting-R3_4_2.tar.gz  webtools.sourceediting-R3_4_2.tar.xz  webtools.sourceediting-R3_4_2.zip  Nitin Dahyabhai12 years
v201302050732webtools.sourceediting-201302050732.tar.gz  webtools.sourceediting-201302050732.tar.xz  webtools.sourceediting-201302050732.zip  Nitin Dahyabhai12 years
v201302050445webtools.sourceediting-201302050445.tar.gz  webtools.sourceediting-201302050445.tar.xz  webtools.sourceediting-201302050445.zip  Nitin Dahyabhai12 years
v201302050421webtools.sourceediting-201302050421.tar.gz  webtools.sourceediting-201302050421.tar.xz  webtools.sourceediting-201302050421.zip  Nitin Dahyabhai12 years
v201301301822webtools.sourceediting-201301301822.tar.gz  webtools.sourceediting-201301301822.tar.xz  webtools.sourceediting-201301301822.zip  Nitin Dahyabhai12 years
v201301292217webtools.sourceediting-201301292217.tar.gz  webtools.sourceediting-201301292217.tar.xz  webtools.sourceediting-201301292217.zip  Salvador Zalapa12 years
v201301292120webtools.sourceediting-201301292120.tar.gz  webtools.sourceediting-201301292120.tar.xz  webtools.sourceediting-201301292120.zip  Nitin Dahyabhai12 years
v201201292024webtools.sourceediting-201201292024.tar.gz  webtools.sourceediting-201201292024.tar.xz  webtools.sourceediting-201201292024.zip  Nitin Dahyabhai12 years
v201301291945webtools.sourceediting-201301291945.tar.gz  webtools.sourceediting-201301291945.tar.xz  webtools.sourceediting-201301291945.zip  Salvador Zalapa12 years
v201301251101webtools.sourceediting-201301251101.tar.gz  webtools.sourceediting-201301251101.tar.xz  webtools.sourceediting-201301251101.zip  Nitin Dahyabhai12 years
v201301242151webtools.sourceediting-201301242151.tar.gz  webtools.sourceediting-201301242151.tar.xz  webtools.sourceediting-201301242151.zip  Nitin Dahyabhai12 years
v201301241617webtools.sourceediting-201301241617.tar.gz  webtools.sourceediting-201301241617.tar.xz  webtools.sourceediting-201301241617.zip  Nick Sandonato12 years
v201301230355webtools.sourceediting-201301230355.tar.gz  webtools.sourceediting-201301230355.tar.xz  webtools.sourceediting-201301230355.zip  Nitin Dahyabhai12 years
v201301221523webtools.sourceediting-201301221523.tar.gz  webtools.sourceediting-201301221523.tar.xz  webtools.sourceediting-201301221523.zip  Nick Sandonato12 years
v201301180434webtools.sourceediting-201301180434.tar.gz  webtools.sourceediting-201301180434.tar.xz  webtools.sourceediting-201301180434.zip  Nitin Dahyabhai12 years
v201301172222webtools.sourceediting-201301172222.tar.gz  webtools.sourceediting-201301172222.tar.xz  webtools.sourceediting-201301172222.zip  Nick Sandonato12 years
v201301162325webtools.sourceediting-201301162325.tar.gz  webtools.sourceediting-201301162325.tar.xz  webtools.sourceediting-201301162325.zip  Nick Sandonato12 years
v201301162301webtools.sourceediting-201301162301.tar.gz  webtools.sourceediting-201301162301.tar.xz  webtools.sourceediting-201301162301.zip  Nick Sandonato12 years
v201301162256webtools.sourceediting-201301162256.tar.gz  webtools.sourceediting-201301162256.tar.xz  webtools.sourceediting-201301162256.zip  Nick Sandonato12 years
v201301142144webtools.sourceediting-201301142144.tar.gz  webtools.sourceediting-201301142144.tar.xz  webtools.sourceediting-201301142144.zip  Snjezana Peco12 years
v201301101836webtools.sourceediting-201301101836.tar.gz  webtools.sourceediting-201301101836.tar.xz  webtools.sourceediting-201301101836.zip  Nitin Dahyabhai12 years
v201301092124webtools.sourceediting-201301092124.tar.gz  webtools.sourceediting-201301092124.tar.xz  webtools.sourceediting-201301092124.zip  Nick Sandonato12 years
v201301091923webtools.sourceediting-201301091923.tar.gz  webtools.sourceediting-201301091923.tar.xz  webtools.sourceediting-201301091923.zip  Nick Sandonato12 years
v201301091921webtools.sourceediting-201301091921.tar.gz  webtools.sourceediting-201301091921.tar.xz  webtools.sourceediting-201301091921.zip  Nick Sandonato12 years
v201301091812webtools.sourceediting-201301091812.tar.gz  webtools.sourceediting-201301091812.tar.xz  webtools.sourceediting-201301091812.zip  Nick Sandonato12 years
v201301091806webtools.sourceediting-201301091806.tar.gz  webtools.sourceediting-201301091806.tar.xz  webtools.sourceediting-201301091806.zip  Nick Sandonato12 years
v201301091615webtools.sourceediting-201301091615.tar.gz  webtools.sourceediting-201301091615.tar.xz  webtools.sourceediting-201301091615.zip  Nick Sandonato12 years
v201301082053webtools.sourceediting-201301082053.tar.gz  webtools.sourceediting-201301082053.tar.xz  webtools.sourceediting-201301082053.zip  Nick Sandonato12 years
v201301082034webtools.sourceediting-201301082034.tar.gz  webtools.sourceediting-201301082034.tar.xz  webtools.sourceediting-201301082034.zip  Nick Sandonato12 years
v201301082021webtools.sourceediting-201301082021.tar.gz  webtools.sourceediting-201301082021.tar.xz  webtools.sourceediting-201301082021.zip  Nick Sandonato12 years
v201301082005webtools.sourceediting-201301082005.tar.gz  webtools.sourceediting-201301082005.tar.xz  webtools.sourceediting-201301082005.zip  Salvador Zalapa12 years
v201301081913webtools.sourceediting-201301081913.tar.gz  webtools.sourceediting-201301081913.tar.xz  webtools.sourceediting-201301081913.zip  Nick Sandonato12 years
v201301081519webtools.sourceediting-201301081519.tar.gz  webtools.sourceediting-201301081519.tar.xz  webtools.sourceediting-201301081519.zip  Salvador Zalapa12 years
v201301072245webtools.sourceediting-201301072245.tar.gz  webtools.sourceediting-201301072245.tar.xz  webtools.sourceediting-201301072245.zip  Salvador Zalapa12 years
v201301072141webtools.sourceediting-201301072141.tar.gz  webtools.sourceediting-201301072141.tar.xz  webtools.sourceediting-201301072141.zip  Snjezana Peco12 years
v201301072125webtools.sourceediting-201301072125.tar.gz  webtools.sourceediting-201301072125.tar.xz  webtools.sourceediting-201301072125.zip  Nitin Dahyabhai12 years
v201301072121webtools.sourceediting-201301072121.tar.gz  webtools.sourceediting-201301072121.tar.xz  webtools.sourceediting-201301072121.zip  Nitin Dahyabhai12 years
v201301072137webtools.sourceediting-201301072137.tar.gz  webtools.sourceediting-201301072137.tar.xz  webtools.sourceediting-201301072137.zip  Snjezana Peco12 years
v201301032305webtools.sourceediting-201301032305.tar.gz  webtools.sourceediting-201301032305.tar.xz  webtools.sourceediting-201301032305.zip  Nitin Dahyabhai12 years
v201301031908webtools.sourceediting-201301031908.tar.gz  webtools.sourceediting-201301031908.tar.xz  webtools.sourceediting-201301031908.zip  Nick Sandonato12 years
v201301022304webtools.sourceediting-201301022304.tar.gz  webtools.sourceediting-201301022304.tar.xz  webtools.sourceediting-201301022304.zip  Nick Sandonato12 years
v201301022000webtools.sourceediting-201301022000.tar.gz  webtools.sourceediting-201301022000.tar.xz  webtools.sourceediting-201301022000.zip  Nitin Dahyabhai12 years
v201301021810webtools.sourceediting-201301021810.tar.gz  webtools.sourceediting-201301021810.tar.xz  webtools.sourceediting-201301021810.zip  Nick Sandonato12 years
v201301021807webtools.sourceediting-201301021807.tar.gz  webtools.sourceediting-201301021807.tar.xz  webtools.sourceediting-201301021807.zip  Nick Sandonato12 years
v201301011327webtools.sourceediting-201301011327.tar.gz  webtools.sourceediting-201301011327.tar.xz  webtools.sourceediting-201301011327.zip  Nick Sandonato12 years
v201212312015webtools.sourceediting-201212312015.tar.gz  webtools.sourceediting-201212312015.tar.xz  webtools.sourceediting-201212312015.zip  Nick Sandonato12 years
v201212312011webtools.sourceediting-201212312011.tar.gz  webtools.sourceediting-201212312011.tar.xz  webtools.sourceediting-201212312011.zip  Nick Sandonato12 years
v201212142059webtools.sourceediting-201212142059.tar.gz  webtools.sourceediting-201212142059.tar.xz  webtools.sourceediting-201212142059.zip  Nick Sandonato12 years
v201212142054webtools.sourceediting-201212142054.tar.gz  webtools.sourceediting-201212142054.tar.xz  webtools.sourceediting-201212142054.zip  Nick Sandonato12 years
v201212132133webtools.sourceediting-201212132133.tar.gz  webtools.sourceediting-201212132133.tar.xz  webtools.sourceediting-201212132133.zip  Nick Sandonato12 years
v201212132132webtools.sourceediting-201212132132.tar.gz  webtools.sourceediting-201212132132.tar.xz  webtools.sourceediting-201212132132.zip  Nick Sandonato12 years
v201212122115webtools.sourceediting-201212122115.tar.gz  webtools.sourceediting-201212122115.tar.xz  webtools.sourceediting-201212122115.zip  Nick Sandonato12 years
v201212122108webtools.sourceediting-201212122108.tar.gz  webtools.sourceediting-201212122108.tar.xz  webtools.sourceediting-201212122108.zip  Nick Sandonato12 years
v201212041613webtools.sourceediting-201212041613.tar.gz  webtools.sourceediting-201212041613.tar.xz  webtools.sourceediting-201212041613.zip  Nick Sandonato12 years
v201212031606webtools.sourceediting-201212031606.tar.gz  webtools.sourceediting-201212031606.tar.xz  webtools.sourceediting-201212031606.zip  Nick Sandonato12 years
v201212051812webtools.sourceediting-201212051812.tar.gz  webtools.sourceediting-201212051812.tar.xz  webtools.sourceediting-201212051812.zip  Nick Sandonato12 years
v201212131556webtools.sourceediting-201212131556.tar.gz  webtools.sourceediting-201212131556.tar.xz  webtools.sourceediting-201212131556.zip  Nick Sandonato12 years
v201212031554webtools.sourceediting-201212031554.tar.gz  webtools.sourceediting-201212031554.tar.xz  webtools.sourceediting-201212031554.zip  Nick Sandonato12 years
v201211292049webtools.sourceediting-201211292049.tar.gz  webtools.sourceediting-201211292049.tar.xz  webtools.sourceediting-201211292049.zip  Nick Sandonato12 years
v201211292047webtools.sourceediting-201211292047.tar.gz  webtools.sourceediting-201211292047.tar.xz  webtools.sourceediting-201211292047.zip  Nick Sandonato12 years
v201211262010webtools.sourceediting-201211262010.tar.gz  webtools.sourceediting-201211262010.tar.xz  webtools.sourceediting-201211262010.zip  Nick Sandonato12 years
v201211261954webtools.sourceediting-201211261954.tar.gz  webtools.sourceediting-201211261954.tar.xz  webtools.sourceediting-201211261954.zip  Nick Sandonato12 years
v201211261625webtools.sourceediting-201211261625.tar.gz  webtools.sourceediting-201211261625.tar.xz  webtools.sourceediting-201211261625.zip  Nitin Dahyabhai12 years
v201211192110webtools.sourceediting-201211192110.tar.gz  webtools.sourceediting-201211192110.tar.xz  webtools.sourceediting-201211192110.zip  Nitin Dahyabhai12 years
v201211192058webtools.sourceediting-201211192058.tar.gz  webtools.sourceediting-201211192058.tar.xz  webtools.sourceediting-201211192058.zip  Nitin Dahyabhai12 years
v201211141927webtools.sourceediting-201211141927.tar.gz  webtools.sourceediting-201211141927.tar.xz  webtools.sourceediting-201211141927.zip  Nick Sandonato12 years
v201211131605webtools.sourceediting-201211131605.tar.gz  webtools.sourceediting-201211131605.tar.xz  webtools.sourceediting-201211131605.zip  Nick Sandonato12 years
v201211131545webtools.sourceediting-201211131545.tar.gz  webtools.sourceediting-201211131545.tar.xz  webtools.sourceediting-201211131545.zip  Nick Sandonato12 years
v201211131338webtools.sourceediting-201211131338.tar.gz  webtools.sourceediting-201211131338.tar.xz  webtools.sourceediting-201211131338.zip  Nitin Dahyabhai12 years
v201211121853webtools.sourceediting-201211121853.tar.gz  webtools.sourceediting-201211121853.tar.xz  webtools.sourceediting-201211121853.zip  Nick Sandonato12 years
v201211121850webtools.sourceediting-201211121850.tar.gz  webtools.sourceediting-201211121850.tar.xz  webtools.sourceediting-201211121850.zip  Nick Sandonato12 years
v201211090419webtools.sourceediting-201211090419.tar.gz  webtools.sourceediting-201211090419.tar.xz  webtools.sourceediting-201211090419.zip  Nick Sandonato12 years
v201211090417webtools.sourceediting-201211090417.tar.gz  webtools.sourceediting-201211090417.tar.xz  webtools.sourceediting-201211090417.zip  Nick Sandonato12 years
v201211090112webtools.sourceediting-201211090112.tar.gz  webtools.sourceediting-201211090112.tar.xz  webtools.sourceediting-201211090112.zip  Nick Sandonato12 years
v201211090108webtools.sourceediting-201211090108.tar.gz  webtools.sourceediting-201211090108.tar.xz  webtools.sourceediting-201211090108.zip  Nick Sandonato12 years
v201211082015webtools.sourceediting-201211082015.tar.gz  webtools.sourceediting-201211082015.tar.xz  webtools.sourceediting-201211082015.zip  Nick Sandonato12 years
v201211081627webtools.sourceediting-201211081627.tar.gz  webtools.sourceediting-201211081627.tar.xz  webtools.sourceediting-201211081627.zip  Nitin Dahyabhai12 years
v201211081619webtools.sourceediting-201211081619.tar.gz  webtools.sourceediting-201211081619.tar.xz  webtools.sourceediting-201211081619.zip  Nick Sandonato12 years
v201211072310webtools.sourceediting-201211072310.tar.gz  webtools.sourceediting-201211072310.tar.xz  webtools.sourceediting-201211072310.zip  Nick Sandonato12 years
v201211072124webtools.sourceediting-201211072124.tar.gz  webtools.sourceediting-201211072124.tar.xz  webtools.sourceediting-201211072124.zip  Nick Sandonato12 years
v201211061806webtools.sourceediting-201211061806.tar.gz  webtools.sourceediting-201211061806.tar.xz  webtools.sourceediting-201211061806.zip  Nick Sandonato12 years
v201211052108webtools.sourceediting-201211052108.tar.gz  webtools.sourceediting-201211052108.tar.xz  webtools.sourceediting-201211052108.zip  Nick Sandonato12 years
v201211022038webtools.sourceediting-201211022038.tar.gz  webtools.sourceediting-201211022038.tar.xz  webtools.sourceediting-201211022038.zip  Nick Sandonato12 years
v201211022020webtools.sourceediting-201211022020.tar.gz  webtools.sourceediting-201211022020.tar.xz  webtools.sourceediting-201211022020.zip  Nick Sandonato12 years
v201211012113webtools.sourceediting-201211012113.tar.gz  webtools.sourceediting-201211012113.tar.xz  webtools.sourceediting-201211012113.zip  Nick Sandonato12 years
v201210311838webtools.sourceediting-201210311838.tar.gz  webtools.sourceediting-201210311838.tar.xz  webtools.sourceediting-201210311838.zip  Nick Sandonato12 years
v201210311734webtools.sourceediting-201210311734.tar.gz  webtools.sourceediting-201210311734.tar.xz  webtools.sourceediting-201210311734.zip  Nick Sandonato12 years
v201210311730webtools.sourceediting-201210311730.tar.gz  webtools.sourceediting-201210311730.tar.xz  webtools.sourceediting-201210311730.zip  Nick Sandonato12 years
v201210311514webtools.sourceediting-201210311514.tar.gz  webtools.sourceediting-201210311514.tar.xz  webtools.sourceediting-201210311514.zip  Nick Sandonato12 years
v201210291837webtools.sourceediting-201210291837.tar.gz  webtools.sourceediting-201210291837.tar.xz  webtools.sourceediting-201210291837.zip  Nitin Dahyabhai12 years
v201210251025webtools.sourceediting-201210251025.tar.gz  webtools.sourceediting-201210251025.tar.xz  webtools.sourceediting-201210251025.zip  Nitin Dahyabhai12 years
v201210242035webtools.sourceediting-201210242035.tar.gz  webtools.sourceediting-201210242035.tar.xz  webtools.sourceediting-201210242035.zip  Nitin Dahyabhai12 years
v201210241859webtools.sourceediting-201210241859.tar.gz  webtools.sourceediting-201210241859.tar.xz  webtools.sourceediting-201210241859.zip  Nick Sandonato12 years
v201210241849webtools.sourceediting-201210241849.tar.gz  webtools.sourceediting-201210241849.tar.xz  webtools.sourceediting-201210241849.zip  Nick Sandonato12 years
v201210231801webtools.sourceediting-201210231801.tar.gz  webtools.sourceediting-201210231801.tar.xz  webtools.sourceediting-201210231801.zip  Nick Sandonato12 years
v201210222033webtools.sourceediting-201210222033.tar.gz  webtools.sourceediting-201210222033.tar.xz  webtools.sourceediting-201210222033.zip  Nick Sandonato12 years
v201210221950webtools.sourceediting-201210221950.tar.gz  webtools.sourceediting-201210221950.tar.xz  webtools.sourceediting-201210221950.zip  Nick Sandonato12 years
v201210221921webtools.sourceediting-201210221921.tar.gz  webtools.sourceediting-201210221921.tar.xz  webtools.sourceediting-201210221921.zip  Nick Sandonato12 years
v201210221513webtools.sourceediting-201210221513.tar.gz  webtools.sourceediting-201210221513.tar.xz  webtools.sourceediting-201210221513.zip  Nick Sandonato12 years
v201210221430webtools.sourceediting-201210221430.tar.gz  webtools.sourceediting-201210221430.tar.xz  webtools.sourceediting-201210221430.zip  Nick Sandonato12 years
v201210192156webtools.sourceediting-201210192156.tar.gz  webtools.sourceediting-201210192156.tar.xz  webtools.sourceediting-201210192156.zip  Nick Sandonato12 years
v201210192049webtools.sourceediting-201210192049.tar.gz  webtools.sourceediting-201210192049.tar.xz  webtools.sourceediting-201210192049.zip  Nick Sandonato12 years
v201210171937webtools.sourceediting-201210171937.tar.gz  webtools.sourceediting-201210171937.tar.xz  webtools.sourceediting-201210171937.zip  Nick Sandonato12 years
v201210171536webtools.sourceediting-201210171536.tar.gz  webtools.sourceediting-201210171536.tar.xz  webtools.sourceediting-201210171536.zip  Nick Sandonato12 years
v201210171531webtools.sourceediting-201210171531.tar.gz  webtools.sourceediting-201210171531.tar.xz  webtools.sourceediting-201210171531.zip  Nick Sandonato12 years
v201210122249webtools.sourceediting-201210122249.tar.gz  webtools.sourceediting-201210122249.tar.xz  webtools.sourceediting-201210122249.zip  Nick Sandonato12 years
v201210122244webtools.sourceediting-201210122244.tar.gz  webtools.sourceediting-201210122244.tar.xz  webtools.sourceediting-201210122244.zip  Nick Sandonato12 years
v201210122030webtools.sourceediting-201210122030.tar.gz  webtools.sourceediting-201210122030.tar.xz  webtools.sourceediting-201210122030.zip  Nick Sandonato12 years
v201210121856webtools.sourceediting-201210121856.tar.gz  webtools.sourceediting-201210121856.tar.xz  webtools.sourceediting-201210121856.zip  Nick Sandonato12 years
v201210121450webtools.sourceediting-201210121450.tar.gz  webtools.sourceediting-201210121450.tar.xz  webtools.sourceediting-201210121450.zip  Nick Sandonato12 years
v201210121441webtools.sourceediting-201210121441.tar.gz  webtools.sourceediting-201210121441.tar.xz  webtools.sourceediting-201210121441.zip  Nick Sandonato12 years
v201210121428webtools.sourceediting-201210121428.tar.gz  webtools.sourceediting-201210121428.tar.xz  webtools.sourceediting-201210121428.zip  Nick Sandonato12 years
v201210112146webtools.sourceediting-201210112146.tar.gz  webtools.sourceediting-201210112146.tar.xz  webtools.sourceediting-201210112146.zip  Nick Sandonato12 years
v201210111719webtools.sourceediting-201210111719.tar.gz  webtools.sourceediting-201210111719.tar.xz  webtools.sourceediting-201210111719.zip  Nick Sandonato12 years
v201210101749webtools.sourceediting-201210101749.tar.gz  webtools.sourceediting-201210101749.tar.xz  webtools.sourceediting-201210101749.zip  Nick Sandonato12 years
v201210101727webtools.sourceediting-201210101727.tar.gz  webtools.sourceediting-201210101727.tar.xz  webtools.sourceediting-201210101727.zip  Nick Sandonato12 years
v201210091814webtools.sourceediting-201210091814.tar.gz  webtools.sourceediting-201210091814.tar.xz  webtools.sourceediting-201210091814.zip  Nick Sandonato12 years
v201210091811webtools.sourceediting-201210091811.tar.gz  webtools.sourceediting-201210091811.tar.xz  webtools.sourceediting-201210091811.zip  Nick Sandonato12 years
v201210091807webtools.sourceediting-201210091807.tar.gz  webtools.sourceediting-201210091807.tar.xz  webtools.sourceediting-201210091807.zip  Nick Sandonato12 years
v201210091733webtools.sourceediting-201210091733.tar.gz  webtools.sourceediting-201210091733.tar.xz  webtools.sourceediting-201210091733.zip  Nick Sandonato12 years
v201210091717webtools.sourceediting-201210091717.tar.gz  webtools.sourceediting-201210091717.tar.xz  webtools.sourceediting-201210091717.zip  Nick Sandonato12 years
v201210082138webtools.sourceediting-201210082138.tar.gz  webtools.sourceediting-201210082138.tar.xz  webtools.sourceediting-201210082138.zip  Nick Sandonato12 years
v201210082125webtools.sourceediting-201210082125.tar.gz  webtools.sourceediting-201210082125.tar.xz  webtools.sourceediting-201210082125.zip  Nick Sandonato12 years
v201210082109webtools.sourceediting-201210082109.tar.gz  webtools.sourceediting-201210082109.tar.xz  webtools.sourceediting-201210082109.zip  Nick Sandonato12 years
v201210081918webtools.sourceediting-201210081918.tar.gz  webtools.sourceediting-201210081918.tar.xz  webtools.sourceediting-201210081918.zip  Nick Sandonato12 years
v201210051901webtools.sourceediting-201210051901.tar.gz  webtools.sourceediting-201210051901.tar.xz  webtools.sourceediting-201210051901.zip  Nick Sandonato12 years
v201210032131webtools.sourceediting-201210032131.tar.gz  webtools.sourceediting-201210032131.tar.xz  webtools.sourceediting-201210032131.zip  Nick Sandonato12 years
v201210041846webtools.sourceediting-201210041846.tar.gz  webtools.sourceediting-201210041846.tar.xz  webtools.sourceediting-201210041846.zip  nsandonato12 years
v201209252144webtools.sourceediting-201209252144.tar.gz  webtools.sourceediting-201209252144.tar.xz  webtools.sourceediting-201209252144.zip  Nitin Dahyabhai12 years
v201209201510webtools.sourceediting-201209201510.tar.gz  webtools.sourceediting-201209201510.tar.xz  webtools.sourceediting-201209201510.zip  Nitin Dahyabhai12 years
201209172236webtools.sourceediting-201209172236.tar.gz  webtools.sourceediting-201209172236.tar.xz  webtools.sourceediting-201209172236.zip  Nitin Dahyabhai12 years
v201209172236webtools.sourceediting-v201209172236.tar.gz  webtools.sourceediting-v201209172236.tar.xz  webtools.sourceediting-v201209172236.zip  Nitin Dahyabhai12 years
v201209122122webtools.sourceediting-201209122122.tar.gz  webtools.sourceediting-201209122122.tar.xz  webtools.sourceediting-201209122122.zip  Nick Sandonato12 years
v201209122005webtools.sourceediting-201209122005.tar.gz  webtools.sourceediting-201209122005.tar.xz  webtools.sourceediting-201209122005.zip  Nick Sandonato12 years
R3_4_1webtools.sourceediting-R3_4_1.tar.gz  webtools.sourceediting-R3_4_1.tar.xz  webtools.sourceediting-R3_4_1.zip  Nick Sandonato12 years
v201208281801webtools.sourceediting-201208281801.tar.gz  webtools.sourceediting-201208281801.tar.xz  webtools.sourceediting-201208281801.zip  Nick Sandonato12 years
v201208171701webtools.sourceediting-201208171701.tar.gz  webtools.sourceediting-201208171701.tar.xz  webtools.sourceediting-201208171701.zip  Nitin Dahyabhai12 years
v201208170345webtools.sourceediting-201208170345.tar.gz  webtools.sourceediting-201208170345.tar.xz  webtools.sourceediting-201208170345.zip  Nitin Dahyabhai12 years
v201208162035webtools.sourceediting-201208162035.tar.gz  webtools.sourceediting-201208162035.tar.xz  webtools.sourceediting-201208162035.zip  Nick Sandonato12 years
v201208170133webtools.sourceediting-201208170133.tar.gz  webtools.sourceediting-201208170133.tar.xz  webtools.sourceediting-201208170133.zip  Nick Sandonato12 years
v201208161957webtools.sourceediting-201208161957.tar.gz  webtools.sourceediting-201208161957.tar.xz  webtools.sourceediting-201208161957.zip  Nick Sandonato12 years
v201208161818webtools.sourceediting-201208161818.tar.gz  webtools.sourceediting-201208161818.tar.xz  webtools.sourceediting-201208161818.zip  Nick Sandonato12 years
v201208142033webtools.sourceediting-201208142033.tar.gz  webtools.sourceediting-201208142033.tar.xz  webtools.sourceediting-201208142033.zip  Nick Sandonato12 years
v201208131741webtools.sourceediting-201208131741.tar.gz  webtools.sourceediting-201208131741.tar.xz  webtools.sourceediting-201208131741.zip  Nick Sandonato12 years
v201208102117webtools.sourceediting-201208102117.tar.gz  webtools.sourceediting-201208102117.tar.xz  webtools.sourceediting-201208102117.zip  Nick Sandonato12 years
v201208102046webtools.sourceediting-201208102046.tar.gz  webtools.sourceediting-201208102046.tar.xz  webtools.sourceediting-201208102046.zip  Nick Sandonato12 years
v201208102008webtools.sourceediting-201208102008.tar.gz  webtools.sourceediting-201208102008.tar.xz  webtools.sourceediting-201208102008.zip  Nick Sandonato12 years
v201208102009webtools.sourceediting-201208102009.tar.gz  webtools.sourceediting-201208102009.tar.xz  webtools.sourceediting-201208102009.zip  Nick Sandonato12 years
v201208101940webtools.sourceediting-201208101940.tar.gz  webtools.sourceediting-201208101940.tar.xz  webtools.sourceediting-201208101940.zip  Nick Sandonato12 years
v201205241808webtools.sourceediting-201205241808.tar.gz  webtools.sourceediting-201205241808.tar.xz  webtools.sourceediting-201205241808.zip  nitind12 years
R3_4_0webtools.sourceediting-R3_4_0.tar.gz  webtools.sourceediting-R3_4_0.tar.xz  webtools.sourceediting-R3_4_0.zip  nitind12 years
v201205181848webtools.sourceediting-201205181848.tar.gz  webtools.sourceediting-201205181848.tar.xz  webtools.sourceediting-201205181848.zip  nitind12 years
v201205171933webtools.sourceediting-201205171933.tar.gz  webtools.sourceediting-201205171933.tar.xz  webtools.sourceediting-201205171933.zip  nitind12 years
v201205171812webtools.sourceediting-201205171812.tar.gz  webtools.sourceediting-201205171812.tar.xz  webtools.sourceediting-201205171812.zip  nitind12 years
v201205170417webtools.sourceediting-201205170417.tar.gz  webtools.sourceediting-201205170417.tar.xz  webtools.sourceediting-201205170417.zip  nitind12 years
v201205161709webtools.sourceediting-201205161709.tar.gz  webtools.sourceediting-201205161709.tar.xz  webtools.sourceediting-201205161709.zip  nitind12 years
v201205032158webtools.sourceediting-201205032158.tar.gz  webtools.sourceediting-201205032158.tar.xz  webtools.sourceediting-201205032158.zip  nitind12 years
v201205031806webtools.sourceediting-201205031806.tar.gz  webtools.sourceediting-201205031806.tar.xz  webtools.sourceediting-201205031806.zip  nitind12 years
v201205022014webtools.sourceediting-201205022014.tar.gz  webtools.sourceediting-201205022014.tar.xz  webtools.sourceediting-201205022014.zip  nitind12 years
v201205021417webtools.sourceediting-201205021417.tar.gz  webtools.sourceediting-201205021417.tar.xz  webtools.sourceediting-201205021417.zip  nitind12 years
v20120428155webtools.sourceediting-20120428155.tar.gz  webtools.sourceediting-20120428155.tar.xz  webtools.sourceediting-20120428155.zip  nitind12 years
v20120428130webtools.sourceediting-20120428130.tar.gz  webtools.sourceediting-20120428130.tar.xz  webtools.sourceediting-20120428130.zip  nitind12 years
v201204262143webtools.sourceediting-201204262143.tar.gz  webtools.sourceediting-201204262143.tar.xz  webtools.sourceediting-201204262143.zip  nitind12 years
v201204260115webtools.sourceediting-201204260115.tar.gz  webtools.sourceediting-201204260115.tar.xz  webtools.sourceediting-201204260115.zip  nitind12 years
v201204260100webtools.sourceediting-201204260100.tar.gz  webtools.sourceediting-201204260100.tar.xz  webtools.sourceediting-201204260100.zip  nitind12 years
v201204252256webtools.sourceediting-201204252256.tar.gz  webtools.sourceediting-201204252256.tar.xz  webtools.sourceediting-201204252256.zip  nitind12 years
v201204241737webtools.sourceediting-201204241737.tar.gz  webtools.sourceediting-201204241737.tar.xz  webtools.sourceediting-201204241737.zip  nitind12 years
v201204162211webtools.sourceediting-201204162211.tar.gz  webtools.sourceediting-201204162211.tar.xz  webtools.sourceediting-201204162211.zip  nitind12 years
v201204241853webtools.sourceediting-201204241853.tar.gz  webtools.sourceediting-201204241853.tar.xz  webtools.sourceediting-201204241853.zip  nitind12 years
v201204102147webtools.sourceediting-201204102147.tar.gz  webtools.sourceediting-201204102147.tar.xz  webtools.sourceediting-201204102147.zip  nitind12 years
Root_R3_3_2_patcheswebtools.sourceediting-Root_R3_3_2_patches.tar.gz  webtools.sourceediting-Root_R3_3_2_patches.tar.xz  webtools.sourceediting-Root_R3_3_2_patches.zip  nitind12 years
v201204101934webtools.sourceediting-201204101934.tar.gz  webtools.sourceediting-201204101934.tar.xz  webtools.sourceediting-201204101934.zip  nitind12 years
v201204101913webtools.sourceediting-201204101913.tar.gz  webtools.sourceediting-201204101913.tar.xz  webtools.sourceediting-201204101913.zip  nitind12 years
v201204092132webtools.sourceediting-201204092132.tar.gz  webtools.sourceediting-201204092132.tar.xz  webtools.sourceediting-201204092132.zip  nitind12 years
v201203281408webtools.sourceediting-201203281408.tar.gz  webtools.sourceediting-201203281408.tar.xz  webtools.sourceediting-201203281408.zip  nitind12 years
v201203141800webtools.sourceediting-201203141800.tar.gz  webtools.sourceediting-201203141800.tar.xz  webtools.sourceediting-201203141800.zip  nitind13 years
v201203131900webtools.sourceediting-201203131900.tar.gz  webtools.sourceediting-201203131900.tar.xz  webtools.sourceediting-201203131900.zip  nitind13 years
v201203131821webtools.sourceediting-201203131821.tar.gz  webtools.sourceediting-201203131821.tar.xz  webtools.sourceediting-201203131821.zip  nitind13 years
v201203081826webtools.sourceediting-201203081826.tar.gz  webtools.sourceediting-201203081826.tar.xz  webtools.sourceediting-201203081826.zip  nitind13 years
v201203081802webtools.sourceediting-201203081802.tar.gz  webtools.sourceediting-201203081802.tar.xz  webtools.sourceediting-201203081802.zip  nitind13 years
v201203072306webtools.sourceediting-201203072306.tar.gz  webtools.sourceediting-201203072306.tar.xz  webtools.sourceediting-201203072306.zip  nitind13 years
v201203071954webtools.sourceediting-201203071954.tar.gz  webtools.sourceediting-201203071954.tar.xz  webtools.sourceediting-201203071954.zip  nitind13 years
v201203061846webtools.sourceediting-201203061846.tar.gz  webtools.sourceediting-201203061846.tar.xz  webtools.sourceediting-201203061846.zip  nitind13 years
v201202292140webtools.sourceediting-201202292140.tar.gz  webtools.sourceediting-201202292140.tar.xz  webtools.sourceediting-201202292140.zip  nitind13 years
v201202141737webtools.sourceediting-201202141737.tar.gz  webtools.sourceediting-201202141737.tar.xz  webtools.sourceediting-201202141737.zip  nitind13 years
v201202100400webtools.sourceediting-201202100400.tar.gz  webtools.sourceediting-201202100400.tar.xz  webtools.sourceediting-201202100400.zip  nitind13 years
v201202100200webtools.sourceediting-201202100200.tar.gz  webtools.sourceediting-201202100200.tar.xz  webtools.sourceediting-201202100200.zip  nitind13 years
v201202091936webtools.sourceediting-201202091936.tar.gz  webtools.sourceediting-201202091936.tar.xz  webtools.sourceediting-201202091936.zip  nitind13 years
R3_3_2webtools.sourceediting-R3_3_2.tar.gz  webtools.sourceediting-R3_3_2.tar.xz  webtools.sourceediting-R3_3_2.zip  nitind13 years
v201202021954webtools.sourceediting-201202021954.tar.gz  webtools.sourceediting-201202021954.tar.xz  webtools.sourceediting-201202021954.zip  nsandonato13 years
v201201170500webtools.sourceediting-201201170500.tar.gz  webtools.sourceediting-201201170500.tar.xz  webtools.sourceediting-201201170500.zip  nitind13 years
v201201170400webtools.sourceediting-201201170400.tar.gz  webtools.sourceediting-201201170400.tar.xz  webtools.sourceediting-201201170400.zip  nitind13 years
v201201161500webtools.sourceediting-201201161500.tar.gz  webtools.sourceediting-201201161500.tar.xz  webtools.sourceediting-201201161500.zip  nitind13 years
v201201132200webtools.sourceediting-201201132200.tar.gz  webtools.sourceediting-201201132200.tar.xz  webtools.sourceediting-201201132200.zip  nitind13 years
v201201122309webtools.sourceediting-201201122309.tar.gz  webtools.sourceediting-201201122309.tar.xz  webtools.sourceediting-201201122309.zip  nitind13 years
v201201102037webtools.sourceediting-201201102037.tar.gz  webtools.sourceediting-201201102037.tar.xz  webtools.sourceediting-201201102037.zip  nitind13 years
v201201102024webtools.sourceediting-201201102024.tar.gz  webtools.sourceediting-201201102024.tar.xz  webtools.sourceediting-201201102024.zip  nitind13 years
v201201101759webtools.sourceediting-201201101759.tar.gz  webtools.sourceediting-201201101759.tar.xz  webtools.sourceediting-201201101759.zip  nitind13 years
v201201101544webtools.sourceediting-201201101544.tar.gz  webtools.sourceediting-201201101544.tar.xz  webtools.sourceediting-201201101544.zip  nitind13 years
v201201101621webtools.sourceediting-201201101621.tar.gz  webtools.sourceediting-201201101621.tar.xz  webtools.sourceediting-201201101621.zip  nitind13 years
v201201100211webtools.sourceediting-201201100211.tar.gz  webtools.sourceediting-201201100211.tar.xz  webtools.sourceediting-201201100211.zip  nitind13 years
v201201102013webtools.sourceediting-201201102013.tar.gz  webtools.sourceediting-201201102013.tar.xz  webtools.sourceediting-201201102013.zip  nitind13 years
v201201091947webtools.sourceediting-201201091947.tar.gz  webtools.sourceediting-201201091947.tar.xz  webtools.sourceediting-201201091947.zip  nitind13 years
v201201091944webtools.sourceediting-201201091944.tar.gz  webtools.sourceediting-201201091944.tar.xz  webtools.sourceediting-201201091944.zip  nitind13 years
v201201051309webtools.sourceediting-201201051309.tar.gz  webtools.sourceediting-201201051309.tar.xz  webtools.sourceediting-201201051309.zip  nitind13 years
v201201051306webtools.sourceediting-201201051306.tar.gz  webtools.sourceediting-201201051306.tar.xz  webtools.sourceediting-201201051306.zip  nitind13 years
v201201042037webtools.sourceediting-201201042037.tar.gz  webtools.sourceediting-201201042037.tar.xz  webtools.sourceediting-201201042037.zip  nitind13 years
v201201042029webtools.sourceediting-201201042029.tar.gz  webtools.sourceediting-201201042029.tar.xz  webtools.sourceediting-201201042029.zip  nitind13 years
v201201041821webtools.sourceediting-201201041821.tar.gz  webtools.sourceediting-201201041821.tar.xz  webtools.sourceediting-201201041821.zip  nitind13 years
v201201041818webtools.sourceediting-201201041818.tar.gz  webtools.sourceediting-201201041818.tar.xz  webtools.sourceediting-201201041818.zip  nitind13 years
v201201041527webtools.sourceediting-201201041527.tar.gz  webtools.sourceediting-201201041527.tar.xz  webtools.sourceediting-201201041527.zip  nitind13 years
v201201041522webtools.sourceediting-201201041522.tar.gz  webtools.sourceediting-201201041522.tar.xz  webtools.sourceediting-201201041522.zip  nitind13 years
v201112162102webtools.sourceediting-201112162102.tar.gz  webtools.sourceediting-201112162102.tar.xz  webtools.sourceediting-201112162102.zip  nitind13 years
v201112080535webtools.sourceediting-201112080535.tar.gz  webtools.sourceediting-201112080535.tar.xz  webtools.sourceediting-201112080535.zip  nitind13 years
v201112072049webtools.sourceediting-201112072049.tar.gz  webtools.sourceediting-201112072049.tar.xz  webtools.sourceediting-201112072049.zip  nitind13 years
v201112071853webtools.sourceediting-201112071853.tar.gz  webtools.sourceediting-201112071853.tar.xz  webtools.sourceediting-201112071853.zip  nitind13 years
v201112071854webtools.sourceediting-201112071854.tar.gz  webtools.sourceediting-201112071854.tar.xz  webtools.sourceediting-201112071854.zip  nitind13 years
v201112071516webtools.sourceediting-201112071516.tar.gz  webtools.sourceediting-201112071516.tar.xz  webtools.sourceediting-201112071516.zip  nitind13 years
v201112062019webtools.sourceediting-201112062019.tar.gz  webtools.sourceediting-201112062019.tar.xz  webtools.sourceediting-201112062019.zip  nitind13 years
v201112062018webtools.sourceediting-201112062018.tar.gz  webtools.sourceediting-201112062018.tar.xz  webtools.sourceediting-201112062018.zip  nitind13 years
v201112062017webtools.sourceediting-201112062017.tar.gz  webtools.sourceediting-201112062017.tar.xz  webtools.sourceediting-201112062017.zip  nitind13 years
v201112061948webtools.sourceediting-201112061948.tar.gz  webtools.sourceediting-201112061948.tar.xz  webtools.sourceediting-201112061948.zip  nitind13 years
v201112061947webtools.sourceediting-201112061947.tar.gz  webtools.sourceediting-201112061947.tar.xz  webtools.sourceediting-201112061947.zip  nitind13 years
v201112061927webtools.sourceediting-201112061927.tar.gz  webtools.sourceediting-201112061927.tar.xz  webtools.sourceediting-201112061927.zip  nitind13 years
v201112061925webtools.sourceediting-201112061925.tar.gz  webtools.sourceediting-201112061925.tar.xz  webtools.sourceediting-201112061925.zip  nitind13 years
v201111292151webtools.sourceediting-201111292151.tar.gz  webtools.sourceediting-201111292151.tar.xz  webtools.sourceediting-201111292151.zip  nitind13 years
v201111292150webtools.sourceediting-201111292150.tar.gz  webtools.sourceediting-201111292150.tar.xz  webtools.sourceediting-201111292150.zip  nitind13 years
v201111292133webtools.sourceediting-201111292133.tar.gz  webtools.sourceediting-201111292133.tar.xz  webtools.sourceediting-201111292133.zip  nitind13 years
v201111291606webtools.sourceediting-201111291606.tar.gz  webtools.sourceediting-201111291606.tar.xz  webtools.sourceediting-201111291606.zip  nitind13 years
v201111282229webtools.sourceediting-201111282229.tar.gz  webtools.sourceediting-201111282229.tar.xz  webtools.sourceediting-201111282229.zip  nitind13 years
v201111282237webtools.sourceediting-201111282237.tar.gz  webtools.sourceediting-201111282237.tar.xz  webtools.sourceediting-201111282237.zip  nitind13 years
v201111282227webtools.sourceediting-201111282227.tar.gz  webtools.sourceediting-201111282227.tar.xz  webtools.sourceediting-201111282227.zip  nitind13 years
v201111161841webtools.sourceediting-201111161841.tar.gz  webtools.sourceediting-201111161841.tar.xz  webtools.sourceediting-201111161841.zip  nitind13 years
v201111161826webtools.sourceediting-201111161826.tar.gz  webtools.sourceediting-201111161826.tar.xz  webtools.sourceediting-201111161826.zip  nitind13 years
v201109202150webtools.sourceediting-201109202150.tar.gz  webtools.sourceediting-201109202150.tar.xz  webtools.sourceediting-201109202150.zip  nitind13 years
v201106142156webtools.sourceediting-201106142156.tar.gz  webtools.sourceediting-201106142156.tar.xz  webtools.sourceediting-201106142156.zip  nitind13 years
v201011121919webtools.sourceediting-201011121919.tar.gz  webtools.sourceediting-201011121919.tar.xz  webtools.sourceediting-201011121919.zip  nitind13 years
Root_R3_2_5_patcheswebtools.sourceediting-Root_R3_2_5_patches.tar.gz  webtools.sourceediting-Root_R3_2_5_patches.tar.xz  webtools.sourceediting-Root_R3_2_5_patches.zip  nitind13 years
v201111031920webtools.sourceediting-201111031920.tar.gz  webtools.sourceediting-201111031920.tar.xz  webtools.sourceediting-201111031920.zip  nitind13 years
v201111030500webtools.sourceediting-201111030500.tar.gz  webtools.sourceediting-201111030500.tar.xz  webtools.sourceediting-201111030500.zip  nitind13 years
v201111021744webtools.sourceediting-201111021744.tar.gz  webtools.sourceediting-201111021744.tar.xz  webtools.sourceediting-201111021744.zip  nitind13 years
v201111021750webtools.sourceediting-201111021750.tar.gz  webtools.sourceediting-201111021750.tar.xz  webtools.sourceediting-201111021750.zip  nitind13 years
v201110262304webtools.sourceediting-201110262304.tar.gz  webtools.sourceediting-201110262304.tar.xz  webtools.sourceediting-201110262304.zip  nitind13 years
R3_2_5webtools.sourceediting-R3_2_5.tar.gz  webtools.sourceediting-R3_2_5.tar.xz  webtools.sourceediting-R3_2_5.zip  nitind13 years
v201110252054webtools.sourceediting-201110252054.tar.gz  webtools.sourceediting-201110252054.tar.xz  webtools.sourceediting-201110252054.zip  nitind13 years
v201110252016webtools.sourceediting-201110252016.tar.gz  webtools.sourceediting-201110252016.tar.xz  webtools.sourceediting-201110252016.zip  nitind13 years
v201110252015webtools.sourceediting-201110252015.tar.gz  webtools.sourceediting-201110252015.tar.xz  webtools.sourceediting-201110252015.zip  nitind13 years
v201110251454webtools.sourceediting-201110251454.tar.gz  webtools.sourceediting-201110251454.tar.xz  webtools.sourceediting-201110251454.zip  nitind13 years
v201110242129webtools.sourceediting-201110242129.tar.gz  webtools.sourceediting-201110242129.tar.xz  webtools.sourceediting-201110242129.zip  nitind13 years
v201110242128webtools.sourceediting-201110242128.tar.gz  webtools.sourceediting-201110242128.tar.xz  webtools.sourceediting-201110242128.zip  nitind13 years
v201110241458webtools.sourceediting-201110241458.tar.gz  webtools.sourceediting-201110241458.tar.xz  webtools.sourceediting-201110241458.zip  nitind13 years
v201110241459webtools.sourceediting-201110241459.tar.gz  webtools.sourceediting-201110241459.tar.xz  webtools.sourceediting-201110241459.zip  nitind13 years
v201110211728webtools.sourceediting-201110211728.tar.gz  webtools.sourceediting-201110211728.tar.xz  webtools.sourceediting-201110211728.zip  nitind13 years
v201110201853webtools.sourceediting-201110201853.tar.gz  webtools.sourceediting-201110201853.tar.xz  webtools.sourceediting-201110201853.zip  nitind13 years
v201110201440webtools.sourceediting-201110201440.tar.gz  webtools.sourceediting-201110201440.tar.xz  webtools.sourceediting-201110201440.zip  nitind13 years
v201110192002webtools.sourceediting-201110192002.tar.gz  webtools.sourceediting-201110192002.tar.xz  webtools.sourceediting-201110192002.zip  nitind13 years
v201110192000webtools.sourceediting-201110192000.tar.gz  webtools.sourceediting-201110192000.tar.xz  webtools.sourceediting-201110192000.zip  nitind13 years
v201110181854webtools.sourceediting-201110181854.tar.gz  webtools.sourceediting-201110181854.tar.xz  webtools.sourceediting-201110181854.zip  nitind13 years
v201110181855webtools.sourceediting-201110181855.tar.gz  webtools.sourceediting-201110181855.tar.xz  webtools.sourceediting-201110181855.zip  nitind13 years
v201110181808webtools.sourceediting-201110181808.tar.gz  webtools.sourceediting-201110181808.tar.xz  webtools.sourceediting-201110181808.zip  nitind13 years
v201110112031webtools.sourceediting-201110112031.tar.gz  webtools.sourceediting-201110112031.tar.xz  webtools.sourceediting-201110112031.zip  nitind13 years
v201110112030webtools.sourceediting-201110112030.tar.gz  webtools.sourceediting-201110112030.tar.xz  webtools.sourceediting-201110112030.zip  nitind13 years
v201110111925webtools.sourceediting-201110111925.tar.gz  webtools.sourceediting-201110111925.tar.xz  webtools.sourceediting-201110111925.zip  nitind13 years
v201110111928webtools.sourceediting-201110111928.tar.gz  webtools.sourceediting-201110111928.tar.xz  webtools.sourceediting-201110111928.zip  nitind13 years
v201110061906webtools.sourceediting-201110061906.tar.gz  webtools.sourceediting-201110061906.tar.xz  webtools.sourceediting-201110061906.zip  nitind13 years
v201110051951webtools.sourceediting-201110051951.tar.gz  webtools.sourceediting-201110051951.tar.xz  webtools.sourceediting-201110051951.zip  nitind13 years
v201110051941webtools.sourceediting-201110051941.tar.gz  webtools.sourceediting-201110051941.tar.xz  webtools.sourceediting-201110051941.zip  nitind13 years
v201110051800webtools.sourceediting-201110051800.tar.gz  webtools.sourceediting-201110051800.tar.xz  webtools.sourceediting-201110051800.zip  nitind13 years
v201110041915webtools.sourceediting-201110041915.tar.gz  webtools.sourceediting-201110041915.tar.xz  webtools.sourceediting-201110041915.zip  nitind13 years
v201110041918webtools.sourceediting-201110041918.tar.gz  webtools.sourceediting-201110041918.tar.xz  webtools.sourceediting-201110041918.zip  nitind13 years
v201110041930webtools.sourceediting-201110041930.tar.gz  webtools.sourceediting-201110041930.tar.xz  webtools.sourceediting-201110041930.zip  nitind13 years
v201109271810webtools.sourceediting-201109271810.tar.gz  webtools.sourceediting-201109271810.tar.xz  webtools.sourceediting-201109271810.zip  nitind13 years
v201109211743webtools.sourceediting-201109211743.tar.gz  webtools.sourceediting-201109211743.tar.xz  webtools.sourceediting-201109211743.zip  nitind13 years
v201109202208webtools.sourceediting-201109202208.tar.gz  webtools.sourceediting-201109202208.tar.xz  webtools.sourceediting-201109202208.zip  nitind13 years
v201109202151webtools.sourceediting-201109202151.tar.gz  webtools.sourceediting-201109202151.tar.xz  webtools.sourceediting-201109202151.zip  nitind13 years
v201110041937webtools.sourceediting-201110041937.tar.gz  webtools.sourceediting-201110041937.tar.xz  webtools.sourceediting-201110041937.zip  nitind13 years
v201109201552webtools.sourceediting-201109201552.tar.gz  webtools.sourceediting-201109201552.tar.xz  webtools.sourceediting-201109201552.zip  nitind13 years
v201109151453webtools.sourceediting-201109151453.tar.gz  webtools.sourceediting-201109151453.tar.xz  webtools.sourceediting-201109151453.zip  nitind13 years
v201109150340webtools.sourceediting-201109150340.tar.gz  webtools.sourceediting-201109150340.tar.xz  webtools.sourceediting-201109150340.zip  nitind13 years
Root_R3_3_maintenancewebtools.sourceediting-Root_R3_3_maintenance.tar.gz  webtools.sourceediting-Root_R3_3_maintenance.tar.xz  webtools.sourceediting-Root_R3_3_maintenance.zip  nitind13 years
v201109080146webtools.sourceediting-201109080146.tar.gz  webtools.sourceediting-201109080146.tar.xz  webtools.sourceediting-201109080146.zip  nitind13 years
v201109080145webtools.sourceediting-201109080145.tar.gz  webtools.sourceediting-201109080145.tar.xz  webtools.sourceediting-201109080145.zip  nitind13 years
R3_3_1webtools.sourceediting-R3_3_1.tar.gz  webtools.sourceediting-R3_3_1.tar.xz  webtools.sourceediting-R3_3_1.zip  nitind13 years
v201109061850webtools.sourceediting-201109061850.tar.gz  webtools.sourceediting-201109061850.tar.xz  webtools.sourceediting-201109061850.zip  nitind13 years
v201108302149webtools.sourceediting-201108302149.tar.gz  webtools.sourceediting-201108302149.tar.xz  webtools.sourceediting-201108302149.zip  nitind13 years
v201108302147webtools.sourceediting-201108302147.tar.gz  webtools.sourceediting-201108302147.tar.xz  webtools.sourceediting-201108302147.zip  nitind13 years
v201108242059webtools.sourceediting-201108242059.tar.gz  webtools.sourceediting-201108242059.tar.xz  webtools.sourceediting-201108242059.zip  nitind13 years
v201108242058webtools.sourceediting-201108242058.tar.gz  webtools.sourceediting-201108242058.tar.xz  webtools.sourceediting-201108242058.zip  nitind13 years
v201108241905webtools.sourceediting-201108241905.tar.gz  webtools.sourceediting-201108241905.tar.xz  webtools.sourceediting-201108241905.zip  nitind13 years
v201108241855webtools.sourceediting-201108241855.tar.gz  webtools.sourceediting-201108241855.tar.xz  webtools.sourceediting-201108241855.zip  nitind13 years
v201108241854webtools.sourceediting-201108241854.tar.gz  webtools.sourceediting-201108241854.tar.xz  webtools.sourceediting-201108241854.zip  nitind13 years
v201108222024webtools.sourceediting-201108222024.tar.gz  webtools.sourceediting-201108222024.tar.xz  webtools.sourceediting-201108222024.zip  nitind13 years
v201108222023webtools.sourceediting-201108222023.tar.gz  webtools.sourceediting-201108222023.tar.xz  webtools.sourceediting-201108222023.zip  nitind13 years
v201108191505webtools.sourceediting-201108191505.tar.gz  webtools.sourceediting-201108191505.tar.xz  webtools.sourceediting-201108191505.zip  nitind13 years
v201108191312webtools.sourceediting-201108191312.tar.gz  webtools.sourceediting-201108191312.tar.xz  webtools.sourceediting-201108191312.zip  nitind13 years
v201108191310webtools.sourceediting-201108191310.tar.gz  webtools.sourceediting-201108191310.tar.xz  webtools.sourceediting-201108191310.zip  nitind13 years
v201108191305webtools.sourceediting-201108191305.tar.gz  webtools.sourceediting-201108191305.tar.xz  webtools.sourceediting-201108191305.zip  nitind13 years
v201108191304webtools.sourceediting-201108191304.tar.gz  webtools.sourceediting-201108191304.tar.xz  webtools.sourceediting-201108191304.zip  nitind13 years
v201109081701webtools.sourceediting-201109081701.tar.gz  webtools.sourceediting-201109081701.tar.xz  webtools.sourceediting-201109081701.zip  nitind13 years
v201108152113webtools.sourceediting-201108152113.tar.gz  webtools.sourceediting-201108152113.tar.xz  webtools.sourceediting-201108152113.zip  nitind13 years
v201108151912webtools.sourceediting-201108151912.tar.gz  webtools.sourceediting-201108151912.tar.xz  webtools.sourceediting-201108151912.zip  nitind13 years
v201109010118webtools.sourceediting-201109010118.tar.gz  webtools.sourceediting-201109010118.tar.xz  webtools.sourceediting-201109010118.zip  nitind13 years
v201108151521webtools.sourceediting-201108151521.tar.gz  webtools.sourceediting-201108151521.tar.xz  webtools.sourceediting-201108151521.zip  nitind13 years
v201108171425webtools.sourceediting-201108171425.tar.gz  webtools.sourceediting-201108171425.tar.xz  webtools.sourceediting-201108171425.zip  nitind13 years
v201108121841webtools.sourceediting-201108121841.tar.gz  webtools.sourceediting-201108121841.tar.xz  webtools.sourceediting-201108121841.zip  nitind13 years
v201108121844webtools.sourceediting-201108121844.tar.gz  webtools.sourceediting-201108121844.tar.xz  webtools.sourceediting-201108121844.zip  nitind13 years
v201108151525webtools.sourceediting-201108151525.tar.gz  webtools.sourceediting-201108151525.tar.xz  webtools.sourceediting-201108151525.zip  nitind13 years
v201108102009webtools.sourceediting-201108102009.tar.gz  webtools.sourceediting-201108102009.tar.xz  webtools.sourceediting-201108102009.zip  nitind13 years
v201108102003webtools.sourceediting-201108102003.tar.gz  webtools.sourceediting-201108102003.tar.xz  webtools.sourceediting-201108102003.zip  nitind13 years
v201108091927webtools.sourceediting-201108091927.tar.gz  webtools.sourceediting-201108091927.tar.xz  webtools.sourceediting-201108091927.zip  nitind13 years
v201108091926webtools.sourceediting-201108091926.tar.gz  webtools.sourceediting-201108091926.tar.xz  webtools.sourceediting-201108091926.zip  nitind13 years
v201108091851webtools.sourceediting-201108091851.tar.gz  webtools.sourceediting-201108091851.tar.xz  webtools.sourceediting-201108091851.zip  nitind13 years
v201108091850webtools.sourceediting-201108091850.tar.gz  webtools.sourceediting-201108091850.tar.xz  webtools.sourceediting-201108091850.zip  nitind13 years
v201108082144webtools.sourceediting-201108082144.tar.gz  webtools.sourceediting-201108082144.tar.xz  webtools.sourceediting-201108082144.zip  nitind13 years
v201108082143webtools.sourceediting-201108082143.tar.gz  webtools.sourceediting-201108082143.tar.xz  webtools.sourceediting-201108082143.zip  nitind13 years
v201108081923webtools.sourceediting-201108081923.tar.gz  webtools.sourceediting-201108081923.tar.xz  webtools.sourceediting-201108081923.zip  nitind13 years
v201108081922webtools.sourceediting-201108081922.tar.gz  webtools.sourceediting-201108081922.tar.xz  webtools.sourceediting-201108081922.zip  nitind13 years
v201108081906webtools.sourceediting-201108081906.tar.gz  webtools.sourceediting-201108081906.tar.xz  webtools.sourceediting-201108081906.zip  nitind13 years
v201108081905webtools.sourceediting-201108081905.tar.gz  webtools.sourceediting-201108081905.tar.xz  webtools.sourceediting-201108081905.zip  nitind13 years
v201108041505webtools.sourceediting-201108041505.tar.gz  webtools.sourceediting-201108041505.tar.xz  webtools.sourceediting-201108041505.zip  nitind13 years
v201107261346webtools.sourceediting-201107261346.tar.gz  webtools.sourceediting-201107261346.tar.xz  webtools.sourceediting-201107261346.zip  nitind13 years
v201107261344webtools.sourceediting-201107261344.tar.gz  webtools.sourceediting-201107261344.tar.xz  webtools.sourceediting-201107261344.zip  nitind13 years
v201107252021webtools.sourceediting-201107252021.tar.gz  webtools.sourceediting-201107252021.tar.xz  webtools.sourceediting-201107252021.zip  nitind13 years
v201107252013webtools.sourceediting-201107252013.tar.gz  webtools.sourceediting-201107252013.tar.xz  webtools.sourceediting-201107252013.zip  nitind13 years
v201107220223webtools.sourceediting-201107220223.tar.gz  webtools.sourceediting-201107220223.tar.xz  webtools.sourceediting-201107220223.zip  nitind13 years
v201107190500webtools.sourceediting-201107190500.tar.gz  webtools.sourceediting-201107190500.tar.xz  webtools.sourceediting-201107190500.zip  nitind13 years
v201107190400webtools.sourceediting-201107190400.tar.gz  webtools.sourceediting-201107190400.tar.xz  webtools.sourceediting-201107190400.zip  nitind13 years
v201107132118webtools.sourceediting-201107132118.tar.gz  webtools.sourceediting-201107132118.tar.xz  webtools.sourceediting-201107132118.zip  nitind13 years
v201107072300webtools.sourceediting-201107072300.tar.gz  webtools.sourceediting-201107072300.tar.xz  webtools.sourceediting-201107072300.zip  nitind13 years
v201107072200webtools.sourceediting-201107072200.tar.gz  webtools.sourceediting-201107072200.tar.xz  webtools.sourceediting-201107072200.zip  nitind13 years
v201107062113webtools.sourceediting-201107062113.tar.gz  webtools.sourceediting-201107062113.tar.xz  webtools.sourceediting-201107062113.zip  nitind13 years
v201106211503webtools.sourceediting-201106211503.tar.gz  webtools.sourceediting-201106211503.tar.xz  webtools.sourceediting-201106211503.zip  nitind13 years
v201106230225webtools.sourceediting-201106230225.tar.gz  webtools.sourceediting-201106230225.tar.xz  webtools.sourceediting-201106230225.zip  nitind13 years
v201106161725webtools.sourceediting-201106161725.tar.gz  webtools.sourceediting-201106161725.tar.xz  webtools.sourceediting-201106161725.zip  nitind13 years
v201106202200webtools.sourceediting-201106202200.tar.gz  webtools.sourceediting-201106202200.tar.xz  webtools.sourceediting-201106202200.zip  nitind13 years
v201106160200webtools.sourceediting-201106160200.tar.gz  webtools.sourceediting-201106160200.tar.xz  webtools.sourceediting-201106160200.zip  nitind13 years
v201106142155webtools.sourceediting-201106142155.tar.gz  webtools.sourceediting-201106142155.tar.xz  webtools.sourceediting-201106142155.zip  nitind13 years
v201106091951webtools.sourceediting-201106091951.tar.gz  webtools.sourceediting-201106091951.tar.xz  webtools.sourceediting-201106091951.zip  nitind13 years
v201106071538webtools.sourceediting-201106071538.tar.gz  webtools.sourceediting-201106071538.tar.xz  webtools.sourceediting-201106071538.zip  nitind13 years
v201105311835webtools.sourceediting-201105311835.tar.gz  webtools.sourceediting-201105311835.tar.xz  webtools.sourceediting-201105311835.zip  nitind13 years
v201105251904webtools.sourceediting-201105251904.tar.gz  webtools.sourceediting-201105251904.tar.xz  webtools.sourceediting-201105251904.zip  nitind13 years
v201105162116webtools.sourceediting-201105162116.tar.gz  webtools.sourceediting-201105162116.tar.xz  webtools.sourceediting-201105162116.zip  nitind13 years
R3_3_0webtools.sourceediting-R3_3_0.tar.gz  webtools.sourceediting-R3_3_0.tar.xz  webtools.sourceediting-R3_3_0.zip  nitind13 years
v201105162026webtools.sourceediting-201105162026.tar.gz  webtools.sourceediting-201105162026.tar.xz  webtools.sourceediting-201105162026.zip  nitind13 years
v201105162004webtools.sourceediting-201105162004.tar.gz  webtools.sourceediting-201105162004.tar.xz  webtools.sourceediting-201105162004.zip  nitind13 years
v201105121658webtools.sourceediting-201105121658.tar.gz  webtools.sourceediting-201105121658.tar.xz  webtools.sourceediting-201105121658.zip  nitind13 years
v201105121540webtools.sourceediting-201105121540.tar.gz  webtools.sourceediting-201105121540.tar.xz  webtools.sourceediting-201105121540.zip  nitind13 years
v201105111835webtools.sourceediting-201105111835.tar.gz  webtools.sourceediting-201105111835.tar.xz  webtools.sourceediting-201105111835.zip  nitind13 years
v201105111821webtools.sourceediting-201105111821.tar.gz  webtools.sourceediting-201105111821.tar.xz  webtools.sourceediting-201105111821.zip  nitind13 years
v201105111747webtools.sourceediting-201105111747.tar.gz  webtools.sourceediting-201105111747.tar.xz  webtools.sourceediting-201105111747.zip  nitind13 years
v201105101529webtools.sourceediting-201105101529.tar.gz  webtools.sourceediting-201105101529.tar.xz  webtools.sourceediting-201105101529.zip  nitind13 years
v201105101522webtools.sourceediting-201105101522.tar.gz  webtools.sourceediting-201105101522.tar.xz  webtools.sourceediting-201105101522.zip  nitind13 years
v201105092101webtools.sourceediting-201105092101.tar.gz  webtools.sourceediting-201105092101.tar.xz  webtools.sourceediting-201105092101.zip  nitind13 years
v201105092017webtools.sourceediting-201105092017.tar.gz  webtools.sourceediting-201105092017.tar.xz  webtools.sourceediting-201105092017.zip  nitind13 years
v201105050216webtools.sourceediting-201105050216.tar.gz  webtools.sourceediting-201105050216.tar.xz  webtools.sourceediting-201105050216.zip  nitind13 years
v201105041431webtools.sourceediting-201105041431.tar.gz  webtools.sourceediting-201105041431.tar.xz  webtools.sourceediting-201105041431.zip  nitind13 years
v201104291809webtools.sourceediting-201104291809.tar.gz  webtools.sourceediting-201104291809.tar.xz  webtools.sourceediting-201104291809.zip  nitind13 years
Root_R3_2_4_patcheswebtools.sourceediting-Root_R3_2_4_patches.tar.gz  webtools.sourceediting-Root_R3_2_4_patches.tar.xz  webtools.sourceediting-Root_R3_2_4_patches.zip  nitind13 years
v201104281428webtools.sourceediting-201104281428.tar.gz  webtools.sourceediting-201104281428.tar.xz  webtools.sourceediting-201104281428.zip  nitind13 years
R3_2_4webtools.sourceediting-R3_2_4.tar.gz  webtools.sourceediting-R3_2_4.tar.xz  webtools.sourceediting-R3_2_4.zip  nsandonato13 years
v201104272153webtools.sourceediting-201104272153.tar.gz  webtools.sourceediting-201104272153.tar.xz  webtools.sourceediting-201104272153.zip  nitind13 years
v201104272155webtools.sourceediting-201104272155.tar.gz  webtools.sourceediting-201104272155.tar.xz  webtools.sourceediting-201104272155.zip  nitind13 years
v201104251227webtools.sourceediting-201104251227.tar.gz  webtools.sourceediting-201104251227.tar.xz  webtools.sourceediting-201104251227.zip  nitind13 years
v201104211436webtools.sourceediting-201104211436.tar.gz  webtools.sourceediting-201104211436.tar.xz  webtools.sourceediting-201104211436.zip  nitind13 years
v201104192009webtools.sourceediting-201104192009.tar.gz  webtools.sourceediting-201104192009.tar.xz  webtools.sourceediting-201104192009.zip  nitind13 years
v201104191935webtools.sourceediting-201104191935.tar.gz  webtools.sourceediting-201104191935.tar.xz  webtools.sourceediting-201104191935.zip  nitind13 years
v201104191926webtools.sourceediting-201104191926.tar.gz  webtools.sourceediting-201104191926.tar.xz  webtools.sourceediting-201104191926.zip  nitind13 years
v201104191551webtools.sourceediting-201104191551.tar.gz  webtools.sourceediting-201104191551.tar.xz  webtools.sourceediting-201104191551.zip  nitind13 years
v201104191549webtools.sourceediting-201104191549.tar.gz  webtools.sourceediting-201104191549.tar.xz  webtools.sourceediting-201104191549.zip  nitind13 years
v201104190230webtools.sourceediting-201104190230.tar.gz  webtools.sourceediting-201104190230.tar.xz  webtools.sourceediting-201104190230.zip  nitind13 years
v201104151514webtools.sourceediting-201104151514.tar.gz  webtools.sourceediting-201104151514.tar.xz  webtools.sourceediting-201104151514.zip  nitind13 years
v201104151438webtools.sourceediting-201104151438.tar.gz  webtools.sourceediting-201104151438.tar.xz  webtools.sourceediting-201104151438.zip  nitind13 years
v201104132127webtools.sourceediting-201104132127.tar.gz  webtools.sourceediting-201104132127.tar.xz  webtools.sourceediting-201104132127.zip  nitind13 years
v201104132014webtools.sourceediting-201104132014.tar.gz  webtools.sourceediting-201104132014.tar.xz  webtools.sourceediting-201104132014.zip  nitind13 years
v201104132013webtools.sourceediting-201104132013.tar.gz  webtools.sourceediting-201104132013.tar.xz  webtools.sourceediting-201104132013.zip  nitind13 years
v201104131852webtools.sourceediting-201104131852.tar.gz  webtools.sourceediting-201104131852.tar.xz  webtools.sourceediting-201104131852.zip  nitind13 years
v201104131853webtools.sourceediting-201104131853.tar.gz  webtools.sourceediting-201104131853.tar.xz  webtools.sourceediting-201104131853.zip  nitind13 years
v201104111747webtools.sourceediting-201104111747.tar.gz  webtools.sourceediting-201104111747.tar.xz  webtools.sourceediting-201104111747.zip  nitind13 years
v201104080225webtools.sourceediting-201104080225.tar.gz  webtools.sourceediting-201104080225.tar.xz  webtools.sourceediting-201104080225.zip  nitind13 years
v201104080600webtools.sourceediting-201104080600.tar.gz  webtools.sourceediting-201104080600.tar.xz  webtools.sourceediting-201104080600.zip  nitind13 years
v201104070043webtools.sourceediting-201104070043.tar.gz  webtools.sourceediting-201104070043.tar.xz  webtools.sourceediting-201104070043.zip  nitind13 years
v201104070059webtools.sourceediting-201104070059.tar.gz  webtools.sourceediting-201104070059.tar.xz  webtools.sourceediting-201104070059.zip  nitind13 years
v201104052048webtools.sourceediting-201104052048.tar.gz  webtools.sourceediting-201104052048.tar.xz  webtools.sourceediting-201104052048.zip  nitind13 years
v201104052042webtools.sourceediting-201104052042.tar.gz  webtools.sourceediting-201104052042.tar.xz  webtools.sourceediting-201104052042.zip  nitind13 years
v201104011551webtools.sourceediting-201104011551.tar.gz  webtools.sourceediting-201104011551.tar.xz  webtools.sourceediting-201104011551.zip  nitind13 years
v201103310011webtools.sourceediting-201103310011.tar.gz  webtools.sourceediting-201103310011.tar.xz  webtools.sourceediting-201103310011.zip  nitind13 years
v201103302014webtools.sourceediting-201103302014.tar.gz  webtools.sourceediting-201103302014.tar.xz  webtools.sourceediting-201103302014.zip  nitind13 years
v201103302013webtools.sourceediting-201103302013.tar.gz  webtools.sourceediting-201103302013.tar.xz  webtools.sourceediting-201103302013.zip  nitind13 years
v201103300335webtools.sourceediting-201103300335.tar.gz  webtools.sourceediting-201103300335.tar.xz  webtools.sourceediting-201103300335.zip  nitind13 years
v201103242140webtools.sourceediting-201103242140.tar.gz  webtools.sourceediting-201103242140.tar.xz  webtools.sourceediting-201103242140.zip  nitind13 years
v201103240050webtools.sourceediting-201103240050.tar.gz  webtools.sourceediting-201103240050.tar.xz  webtools.sourceediting-201103240050.zip  nitind14 years
v201103231834webtools.sourceediting-201103231834.tar.gz  webtools.sourceediting-201103231834.tar.xz  webtools.sourceediting-201103231834.zip  nitind14 years
v201103231819webtools.sourceediting-201103231819.tar.gz  webtools.sourceediting-201103231819.tar.xz  webtools.sourceediting-201103231819.zip  nitind14 years
v201103222103webtools.sourceediting-201103222103.tar.gz  webtools.sourceediting-201103222103.tar.xz  webtools.sourceediting-201103222103.zip  nitind14 years
v201103222101webtools.sourceediting-201103222101.tar.gz  webtools.sourceediting-201103222101.tar.xz  webtools.sourceediting-201103222101.zip  nitind14 years
v201103222050webtools.sourceediting-201103222050.tar.gz  webtools.sourceediting-201103222050.tar.xz  webtools.sourceediting-201103222050.zip  nitind14 years
v201103222049webtools.sourceediting-201103222049.tar.gz  webtools.sourceediting-201103222049.tar.xz  webtools.sourceediting-201103222049.zip  nitind14 years
v201103222020webtools.sourceediting-201103222020.tar.gz  webtools.sourceediting-201103222020.tar.xz  webtools.sourceediting-201103222020.zip  nitind14 years
v201103212144webtools.sourceediting-201103212144.tar.gz  webtools.sourceediting-201103212144.tar.xz  webtools.sourceediting-201103212144.zip  nitind14 years
v201103212143webtools.sourceediting-201103212143.tar.gz  webtools.sourceediting-201103212143.tar.xz  webtools.sourceediting-201103212143.zip  nitind14 years
v201103182052webtools.sourceediting-201103182052.tar.gz  webtools.sourceediting-201103182052.tar.xz  webtools.sourceediting-201103182052.zip  nitind14 years
v201103182047webtools.sourceediting-201103182047.tar.gz  webtools.sourceediting-201103182047.tar.xz  webtools.sourceediting-201103182047.zip  nitind14 years
v201103182045webtools.sourceediting-201103182045.tar.gz  webtools.sourceediting-201103182045.tar.xz  webtools.sourceediting-201103182045.zip  nitind14 years
v201103171359webtools.sourceediting-201103171359.tar.gz  webtools.sourceediting-201103171359.tar.xz  webtools.sourceediting-201103171359.zip  nitind14 years
v201103170600webtools.sourceediting-201103170600.tar.gz  webtools.sourceediting-201103170600.tar.xz  webtools.sourceediting-201103170600.zip  nitind14 years
v201103170010webtools.sourceediting-201103170010.tar.gz  webtools.sourceediting-201103170010.tar.xz  webtools.sourceediting-201103170010.zip  nitind14 years
v201103162104webtools.sourceediting-201103162104.tar.gz  webtools.sourceediting-201103162104.tar.xz  webtools.sourceediting-201103162104.zip  nitind14 years
v201103162058webtools.sourceediting-201103162058.tar.gz  webtools.sourceediting-201103162058.tar.xz  webtools.sourceediting-201103162058.zip  nitind14 years
v201103162045webtools.sourceediting-201103162045.tar.gz  webtools.sourceediting-201103162045.tar.xz  webtools.sourceediting-201103162045.zip  nitind14 years
v201103162029webtools.sourceediting-201103162029.tar.gz  webtools.sourceediting-201103162029.tar.xz  webtools.sourceediting-201103162029.zip  nitind14 years
v201103102320webtools.sourceediting-201103102320.tar.gz  webtools.sourceediting-201103102320.tar.xz  webtools.sourceediting-201103102320.zip  nitind14 years
v201103100444webtools.sourceediting-201103100444.tar.gz  webtools.sourceediting-201103100444.tar.xz  webtools.sourceediting-201103100444.zip  nitind14 years
v201103092248webtools.sourceediting-201103092248.tar.gz  webtools.sourceediting-201103092248.tar.xz  webtools.sourceediting-201103092248.zip  nitind14 years
v201103092149webtools.sourceediting-201103092149.tar.gz  webtools.sourceediting-201103092149.tar.xz  webtools.sourceediting-201103092149.zip  nitind14 years
v201103091947webtools.sourceediting-201103091947.tar.gz  webtools.sourceediting-201103091947.tar.xz  webtools.sourceediting-201103091947.zip  nitind14 years
v201103091913webtools.sourceediting-201103091913.tar.gz  webtools.sourceediting-201103091913.tar.xz  webtools.sourceediting-201103091913.zip  nitind14 years
v201103091700webtools.sourceediting-201103091700.tar.gz  webtools.sourceediting-201103091700.tar.xz  webtools.sourceediting-201103091700.zip  nitind14 years
v201103091439webtools.sourceediting-201103091439.tar.gz  webtools.sourceediting-201103091439.tar.xz  webtools.sourceediting-201103091439.zip  nitind14 years
v201103082225webtools.sourceediting-201103082225.tar.gz  webtools.sourceediting-201103082225.tar.xz  webtools.sourceediting-201103082225.zip  nitind14 years
v201103081948webtools.sourceediting-201103081948.tar.gz  webtools.sourceediting-201103081948.tar.xz  webtools.sourceediting-201103081948.zip  nitind14 years
v201103081945webtools.sourceediting-201103081945.tar.gz  webtools.sourceediting-201103081945.tar.xz  webtools.sourceediting-201103081945.zip  nitind14 years
v201103080228webtools.sourceediting-201103080228.tar.gz  webtools.sourceediting-201103080228.tar.xz  webtools.sourceediting-201103080228.zip  nitind14 years
v201103072156webtools.sourceediting-201103072156.tar.gz  webtools.sourceediting-201103072156.tar.xz  webtools.sourceediting-201103072156.zip  nitind14 years
v201103072022webtools.sourceediting-201103072022.tar.gz  webtools.sourceediting-201103072022.tar.xz  webtools.sourceediting-201103072022.zip  nitind14 years
v201103022054webtools.sourceediting-201103022054.tar.gz  webtools.sourceediting-201103022054.tar.xz  webtools.sourceediting-201103022054.zip  nitind14 years
v201103021532webtools.sourceediting-201103021532.tar.gz  webtools.sourceediting-201103021532.tar.xz  webtools.sourceediting-201103021532.zip  nitind14 years
v201103021533webtools.sourceediting-201103021533.tar.gz  webtools.sourceediting-201103021533.tar.xz  webtools.sourceediting-201103021533.zip  nitind14 years
v201103170144webtools.sourceediting-201103170144.tar.gz  webtools.sourceediting-201103170144.tar.xz  webtools.sourceediting-201103170144.zip  nitind14 years
v201102281349webtools.sourceediting-201102281349.tar.gz  webtools.sourceediting-201102281349.tar.xz  webtools.sourceediting-201102281349.zip  nitind14 years
v201102240336webtools.sourceediting-201102240336.tar.gz  webtools.sourceediting-201102240336.tar.xz  webtools.sourceediting-201102240336.zip  nitind14 years
v201102240324webtools.sourceediting-201102240324.tar.gz  webtools.sourceediting-201102240324.tar.xz  webtools.sourceediting-201102240324.zip  nitind14 years
v201102230136webtools.sourceediting-201102230136.tar.gz  webtools.sourceediting-201102230136.tar.xz  webtools.sourceediting-201102230136.zip  nitind14 years
v201102222200webtools.sourceediting-201102222200.tar.gz  webtools.sourceediting-201102222200.tar.xz  webtools.sourceediting-201102222200.zip  nitind14 years
v201102221920webtools.sourceediting-201102221920.tar.gz  webtools.sourceediting-201102221920.tar.xz  webtools.sourceediting-201102221920.zip  nitind14 years
v201102241833webtools.sourceediting-201102241833.tar.gz  webtools.sourceediting-201102241833.tar.xz  webtools.sourceediting-201102241833.zip  nitind14 years
v201102221823webtools.sourceediting-201102221823.tar.gz  webtools.sourceediting-201102221823.tar.xz  webtools.sourceediting-201102221823.zip  nitind14 years
v201102221423webtools.sourceediting-201102221423.tar.gz  webtools.sourceediting-201102221423.tar.xz  webtools.sourceediting-201102221423.zip  nitind14 years
v201102200555webtools.sourceediting-201102200555.tar.gz  webtools.sourceediting-201102200555.tar.xz  webtools.sourceediting-201102200555.zip  nitind14 years
v201102171523webtools.sourceediting-201102171523.tar.gz  webtools.sourceediting-201102171523.tar.xz  webtools.sourceediting-201102171523.zip  nitind14 years
v201102170450webtools.sourceediting-201102170450.tar.gz  webtools.sourceediting-201102170450.tar.xz  webtools.sourceediting-201102170450.zip  nitind14 years
v201102161624webtools.sourceediting-201102161624.tar.gz  webtools.sourceediting-201102161624.tar.xz  webtools.sourceediting-201102161624.zip  nitind14 years
R3_2_3webtools.sourceediting-R3_2_3.tar.gz  webtools.sourceediting-R3_2_3.tar.xz  webtools.sourceediting-R3_2_3.zip  nitind14 years
v201102160550webtools.sourceediting-201102160550.tar.gz  webtools.sourceediting-201102160550.tar.xz  webtools.sourceediting-201102160550.zip  nitind14 years
v201102160542webtools.sourceediting-201102160542.tar.gz  webtools.sourceediting-201102160542.tar.xz  webtools.sourceediting-201102160542.zip  nitind14 years
v201102071641webtools.sourceediting-201102071641.tar.gz  webtools.sourceediting-201102071641.tar.xz  webtools.sourceediting-201102071641.zip  nitind14 years
v201102031915webtools.sourceediting-201102031915.tar.gz  webtools.sourceediting-201102031915.tar.xz  webtools.sourceediting-201102031915.zip  nitind14 years
v201102022042webtools.sourceediting-201102022042.tar.gz  webtools.sourceediting-201102022042.tar.xz  webtools.sourceediting-201102022042.zip  nitind14 years
v201102011900webtools.sourceediting-201102011900.tar.gz  webtools.sourceediting-201102011900.tar.xz  webtools.sourceediting-201102011900.zip  nitind14 years
v201102011857webtools.sourceediting-201102011857.tar.gz  webtools.sourceediting-201102011857.tar.xz  webtools.sourceediting-201102011857.zip  nitind14 years
Root_R3_2_3_patcheswebtools.sourceediting-Root_R3_2_3_patches.tar.gz  webtools.sourceediting-Root_R3_2_3_patches.tar.xz  webtools.sourceediting-Root_R3_2_3_patches.zip  nitind14 years
v201102102045webtools.sourceediting-201102102045.tar.gz  webtools.sourceediting-201102102045.tar.xz  webtools.sourceediting-201102102045.zip  nitind14 years
v201101311855webtools.sourceediting-201101311855.tar.gz  webtools.sourceediting-201101311855.tar.xz  webtools.sourceediting-201101311855.zip  nitind14 years
v201101281910webtools.sourceediting-201101281910.tar.gz  webtools.sourceediting-201101281910.tar.xz  webtools.sourceediting-201101281910.zip  nitind14 years
v201101262302webtools.sourceediting-201101262302.tar.gz  webtools.sourceediting-201101262302.tar.xz  webtools.sourceediting-201101262302.zip  nitind14 years
v201101262228webtools.sourceediting-201101262228.tar.gz  webtools.sourceediting-201101262228.tar.xz  webtools.sourceediting-201101262228.zip  nitind14 years
v201101262225webtools.sourceediting-201101262225.tar.gz  webtools.sourceediting-201101262225.tar.xz  webtools.sourceediting-201101262225.zip  nitind14 years
v201101252020webtools.sourceediting-201101252020.tar.gz  webtools.sourceediting-201101252020.tar.xz  webtools.sourceediting-201101252020.zip  nitind14 years
v201101252005webtools.sourceediting-201101252005.tar.gz  webtools.sourceediting-201101252005.tar.xz  webtools.sourceediting-201101252005.zip  nitind14 years
v201101251958webtools.sourceediting-201101251958.tar.gz  webtools.sourceediting-201101251958.tar.xz  webtools.sourceediting-201101251958.zip  nitind14 years
v201101230055webtools.sourceediting-201101230055.tar.gz  webtools.sourceediting-201101230055.tar.xz  webtools.sourceediting-201101230055.zip  nitind14 years
v201101212140webtools.sourceediting-201101212140.tar.gz  webtools.sourceediting-201101212140.tar.xz  webtools.sourceediting-201101212140.zip  nitind14 years
v201101212236webtools.sourceediting-201101212236.tar.gz  webtools.sourceediting-201101212236.tar.xz  webtools.sourceediting-201101212236.zip  nitind14 years
v201101212141webtools.sourceediting-201101212141.tar.gz  webtools.sourceediting-201101212141.tar.xz  webtools.sourceediting-201101212141.zip  nitind14 years
v201101212130webtools.sourceediting-201101212130.tar.gz  webtools.sourceediting-201101212130.tar.xz  webtools.sourceediting-201101212130.zip  nitind14 years
v201101212051webtools.sourceediting-201101212051.tar.gz  webtools.sourceediting-201101212051.tar.xz  webtools.sourceediting-201101212051.zip  nitind14 years
v201101211857webtools.sourceediting-201101211857.tar.gz  webtools.sourceediting-201101211857.tar.xz  webtools.sourceediting-201101211857.zip  nitind14 years
v201101211856webtools.sourceediting-201101211856.tar.gz  webtools.sourceediting-201101211856.tar.xz  webtools.sourceediting-201101211856.zip  nitind14 years
v201101190005webtools.sourceediting-201101190005.tar.gz  webtools.sourceediting-201101190005.tar.xz  webtools.sourceediting-201101190005.zip  nitind14 years
v201101190004webtools.sourceediting-201101190004.tar.gz  webtools.sourceediting-201101190004.tar.xz  webtools.sourceediting-201101190004.zip  nitind14 years
v201101181807webtools.sourceediting-201101181807.tar.gz  webtools.sourceediting-201101181807.tar.xz  webtools.sourceediting-201101181807.zip  nitind14 years
v201101181805webtools.sourceediting-201101181805.tar.gz  webtools.sourceediting-201101181805.tar.xz  webtools.sourceediting-201101181805.zip  nitind14 years
v201101181716webtools.sourceediting-201101181716.tar.gz  webtools.sourceediting-201101181716.tar.xz  webtools.sourceediting-201101181716.zip  nitind14 years
v201101181711webtools.sourceediting-201101181711.tar.gz  webtools.sourceediting-201101181711.tar.xz  webtools.sourceediting-201101181711.zip  nitind14 years
v201101142102webtools.sourceediting-201101142102.tar.gz  webtools.sourceediting-201101142102.tar.xz  webtools.sourceediting-201101142102.zip  nitind14 years
v201101142031webtools.sourceediting-201101142031.tar.gz  webtools.sourceediting-201101142031.tar.xz  webtools.sourceediting-201101142031.zip  nitind14 years
v201101141822webtools.sourceediting-201101141822.tar.gz  webtools.sourceediting-201101141822.tar.xz  webtools.sourceediting-201101141822.zip  nitind14 years
v201101130531webtools.sourceediting-201101130531.tar.gz  webtools.sourceediting-201101130531.tar.xz  webtools.sourceediting-201101130531.zip  nitind14 years
v201101130526webtools.sourceediting-201101130526.tar.gz  webtools.sourceediting-201101130526.tar.xz  webtools.sourceediting-201101130526.zip  nitind14 years
v201101130455webtools.sourceediting-201101130455.tar.gz  webtools.sourceediting-201101130455.tar.xz  webtools.sourceediting-201101130455.zip  nitind14 years
v201101130456webtools.sourceediting-201101130456.tar.gz  webtools.sourceediting-201101130456.tar.xz  webtools.sourceediting-201101130456.zip  nitind14 years
v201101130348webtools.sourceediting-201101130348.tar.gz  webtools.sourceediting-201101130348.tar.xz  webtools.sourceediting-201101130348.zip  nitind14 years
v201101130332webtools.sourceediting-201101130332.tar.gz  webtools.sourceediting-201101130332.tar.xz  webtools.sourceediting-201101130332.zip  nitind14 years
v201101122301webtools.sourceediting-201101122301.tar.gz  webtools.sourceediting-201101122301.tar.xz  webtools.sourceediting-201101122301.zip  nitind14 years
v201101122259webtools.sourceediting-201101122259.tar.gz  webtools.sourceediting-201101122259.tar.xz  webtools.sourceediting-201101122259.zip  nitind14 years
v201101122255webtools.sourceediting-201101122255.tar.gz  webtools.sourceediting-201101122255.tar.xz  webtools.sourceediting-201101122255.zip  nitind14 years
v201101122108webtools.sourceediting-201101122108.tar.gz  webtools.sourceediting-201101122108.tar.xz  webtools.sourceediting-201101122108.zip  nitind14 years
v201101122107webtools.sourceediting-201101122107.tar.gz  webtools.sourceediting-201101122107.tar.xz  webtools.sourceediting-201101122107.zip  nitind14 years
v201101122006webtools.sourceediting-201101122006.tar.gz  webtools.sourceediting-201101122006.tar.xz  webtools.sourceediting-201101122006.zip  nitind14 years
v201101122005webtools.sourceediting-201101122005.tar.gz  webtools.sourceediting-201101122005.tar.xz  webtools.sourceediting-201101122005.zip  nitind14 years
v201101122003webtools.sourceediting-201101122003.tar.gz  webtools.sourceediting-201101122003.tar.xz  webtools.sourceediting-201101122003.zip  nitind14 years
v201101122002webtools.sourceediting-201101122002.tar.gz  webtools.sourceediting-201101122002.tar.xz  webtools.sourceediting-201101122002.zip  nitind14 years
v201101121939webtools.sourceediting-201101121939.tar.gz  webtools.sourceediting-201101121939.tar.xz  webtools.sourceediting-201101121939.zip  nitind14 years
v201101121937webtools.sourceediting-201101121937.tar.gz  webtools.sourceediting-201101121937.tar.xz  webtools.sourceediting-201101121937.zip  nitind14 years
v201101121923webtools.sourceediting-201101121923.tar.gz  webtools.sourceediting-201101121923.tar.xz  webtools.sourceediting-201101121923.zip  nitind14 years
v201101121924webtools.sourceediting-201101121924.tar.gz  webtools.sourceediting-201101121924.tar.xz  webtools.sourceediting-201101121924.zip  nitind14 years
v201101120152webtools.sourceediting-201101120152.tar.gz  webtools.sourceediting-201101120152.tar.xz  webtools.sourceediting-201101120152.zip  nitind14 years
v201101120156webtools.sourceediting-201101120156.tar.gz  webtools.sourceediting-201101120156.tar.xz  webtools.sourceediting-201101120156.zip  nitind14 years
v201101102244webtools.sourceediting-201101102244.tar.gz  webtools.sourceediting-201101102244.tar.xz  webtools.sourceediting-201101102244.zip  nitind14 years
v201101101908webtools.sourceediting-201101101908.tar.gz  webtools.sourceediting-201101101908.tar.xz  webtools.sourceediting-201101101908.zip  nitind14 years
v201101072137webtools.sourceediting-201101072137.tar.gz  webtools.sourceediting-201101072137.tar.xz  webtools.sourceediting-201101072137.zip  nitind14 years
v201101071824webtools.sourceediting-201101071824.tar.gz  webtools.sourceediting-201101071824.tar.xz  webtools.sourceediting-201101071824.zip  nitind14 years
v201101071823webtools.sourceediting-201101071823.tar.gz  webtools.sourceediting-201101071823.tar.xz  webtools.sourceediting-201101071823.zip  nitind14 years
v201101052153webtools.sourceediting-201101052153.tar.gz  webtools.sourceediting-201101052153.tar.xz  webtools.sourceediting-201101052153.zip  nitind14 years
v201101052152webtools.sourceediting-201101052152.tar.gz  webtools.sourceediting-201101052152.tar.xz  webtools.sourceediting-201101052152.zip  nitind14 years
v201101052103webtools.sourceediting-201101052103.tar.gz  webtools.sourceediting-201101052103.tar.xz  webtools.sourceediting-201101052103.zip  nitind14 years
v201101052053webtools.sourceediting-201101052053.tar.gz  webtools.sourceediting-201101052053.tar.xz  webtools.sourceediting-201101052053.zip  nitind14 years
v201101052051webtools.sourceediting-201101052051.tar.gz  webtools.sourceediting-201101052051.tar.xz  webtools.sourceediting-201101052051.zip  nitind14 years
v201101052038webtools.sourceediting-201101052038.tar.gz  webtools.sourceediting-201101052038.tar.xz  webtools.sourceediting-201101052038.zip  nitind14 years
v201101052036webtools.sourceediting-201101052036.tar.gz  webtools.sourceediting-201101052036.tar.xz  webtools.sourceediting-201101052036.zip  nitind14 years
v201101051842webtools.sourceediting-201101051842.tar.gz  webtools.sourceediting-201101051842.tar.xz  webtools.sourceediting-201101051842.zip  nitind14 years
v201101051843webtools.sourceediting-201101051843.tar.gz  webtools.sourceediting-201101051843.tar.xz  webtools.sourceediting-201101051843.zip  nitind14 years
v201012310730webtools.sourceediting-201012310730.tar.gz  webtools.sourceediting-201012310730.tar.xz  webtools.sourceediting-201012310730.zip  nitind14 years
v201012212238webtools.sourceediting-201012212238.tar.gz  webtools.sourceediting-201012212238.tar.xz  webtools.sourceediting-201012212238.zip  nitind14 years
v201012212221webtools.sourceediting-201012212221.tar.gz  webtools.sourceediting-201012212221.tar.xz  webtools.sourceediting-201012212221.zip  nitind14 years
v201012201932webtools.sourceediting-201012201932.tar.gz  webtools.sourceediting-201012201932.tar.xz  webtools.sourceediting-201012201932.zip  nitind14 years
v201012160416webtools.sourceediting-201012160416.tar.gz  webtools.sourceediting-201012160416.tar.xz  webtools.sourceediting-201012160416.zip  nitind14 years
v201012160350webtools.sourceediting-201012160350.tar.gz  webtools.sourceediting-201012160350.tar.xz  webtools.sourceediting-201012160350.zip  nitind14 years
v201012160349webtools.sourceediting-201012160349.tar.gz  webtools.sourceediting-201012160349.tar.xz  webtools.sourceediting-201012160349.zip  nitind14 years
v201012150331webtools.sourceediting-201012150331.tar.gz  webtools.sourceediting-201012150331.tar.xz  webtools.sourceediting-201012150331.zip  nitind14 years
v201012161951webtools.sourceediting-201012161951.tar.gz  webtools.sourceediting-201012161951.tar.xz  webtools.sourceediting-201012161951.zip  nitind14 years
v201012160047webtools.sourceediting-201012160047.tar.gz  webtools.sourceediting-201012160047.tar.xz  webtools.sourceediting-201012160047.zip  nitind14 years
v201012160027webtools.sourceediting-201012160027.tar.gz  webtools.sourceediting-201012160027.tar.xz  webtools.sourceediting-201012160027.zip  nitind14 years
v201012160030webtools.sourceediting-201012160030.tar.gz  webtools.sourceediting-201012160030.tar.xz  webtools.sourceediting-201012160030.zip  nitind14 years
v201012152059webtools.sourceediting-201012152059.tar.gz  webtools.sourceediting-201012152059.tar.xz  webtools.sourceediting-201012152059.zip  nitind14 years
v201012152100webtools.sourceediting-201012152100.tar.gz  webtools.sourceediting-201012152100.tar.xz  webtools.sourceediting-201012152100.zip  nitind14 years
v201012152057webtools.sourceediting-201012152057.tar.gz  webtools.sourceediting-201012152057.tar.xz  webtools.sourceediting-201012152057.zip  nitind14 years
v201012152206webtools.sourceediting-201012152206.tar.gz  webtools.sourceediting-201012152206.tar.xz  webtools.sourceediting-201012152206.zip  nitind14 years
v201012152204webtools.sourceediting-201012152204.tar.gz  webtools.sourceediting-201012152204.tar.xz  webtools.sourceediting-201012152204.zip  nitind14 years
v201012142249webtools.sourceediting-201012142249.tar.gz  webtools.sourceediting-201012142249.tar.xz  webtools.sourceediting-201012142249.zip  nitind14 years
v201012142248webtools.sourceediting-201012142248.tar.gz  webtools.sourceediting-201012142248.tar.xz  webtools.sourceediting-201012142248.zip  nitind14 years
v201012142241webtools.sourceediting-201012142241.tar.gz  webtools.sourceediting-201012142241.tar.xz  webtools.sourceediting-201012142241.zip  nitind14 years
v201012142240webtools.sourceediting-201012142240.tar.gz  webtools.sourceediting-201012142240.tar.xz  webtools.sourceediting-201012142240.zip  nitind14 years
v201012142237webtools.sourceediting-201012142237.tar.gz  webtools.sourceediting-201012142237.tar.xz  webtools.sourceediting-201012142237.zip  nitind14 years
v201012142045webtools.sourceediting-201012142045.tar.gz  webtools.sourceediting-201012142045.tar.xz  webtools.sourceediting-201012142045.zip  nitind14 years
v201012142046webtools.sourceediting-201012142046.tar.gz  webtools.sourceediting-201012142046.tar.xz  webtools.sourceediting-201012142046.zip  nitind14 years
v201012142041webtools.sourceediting-201012142041.tar.gz  webtools.sourceediting-201012142041.tar.xz  webtools.sourceediting-201012142041.zip  nitind14 years
v201012142040webtools.sourceediting-201012142040.tar.gz  webtools.sourceediting-201012142040.tar.xz  webtools.sourceediting-201012142040.zip  nitind14 years
v201012142031webtools.sourceediting-201012142031.tar.gz  webtools.sourceediting-201012142031.tar.xz  webtools.sourceediting-201012142031.zip  nitind14 years
v201012142032webtools.sourceediting-201012142032.tar.gz  webtools.sourceediting-201012142032.tar.xz  webtools.sourceediting-201012142032.zip  nitind14 years
v201012142028webtools.sourceediting-201012142028.tar.gz  webtools.sourceediting-201012142028.tar.xz  webtools.sourceediting-201012142028.zip  nitind14 years
v201012142029webtools.sourceediting-201012142029.tar.gz  webtools.sourceediting-201012142029.tar.xz  webtools.sourceediting-201012142029.zip  nitind14 years
v201012142018webtools.sourceediting-201012142018.tar.gz  webtools.sourceediting-201012142018.tar.xz  webtools.sourceediting-201012142018.zip  nitind14 years
v201012072151webtools.sourceediting-201012072151.tar.gz  webtools.sourceediting-201012072151.tar.xz  webtools.sourceediting-201012072151.zip  nitind14 years
v201012072153webtools.sourceediting-201012072153.tar.gz  webtools.sourceediting-201012072153.tar.xz  webtools.sourceediting-201012072153.zip  nitind14 years
v201012031938webtools.sourceediting-201012031938.tar.gz  webtools.sourceediting-201012031938.tar.xz  webtools.sourceediting-201012031938.zip  nitind14 years
v201012031921webtools.sourceediting-201012031921.tar.gz  webtools.sourceediting-201012031921.tar.xz  webtools.sourceediting-201012031921.zip  nitind14 years
v201012031923webtools.sourceediting-201012031923.tar.gz  webtools.sourceediting-201012031923.tar.xz  webtools.sourceediting-201012031923.zip  nitind14 years
v201012010142webtools.sourceediting-201012010142.tar.gz  webtools.sourceediting-201012010142.tar.xz  webtools.sourceediting-201012010142.zip  nitind14 years
v201011300734webtools.sourceediting-201011300734.tar.gz  webtools.sourceediting-201011300734.tar.xz  webtools.sourceediting-201011300734.zip  nitind14 years
v201011300715webtools.sourceediting-201011300715.tar.gz  webtools.sourceediting-201011300715.tar.xz  webtools.sourceediting-201011300715.zip  nitind14 years
v201011232037webtools.sourceediting-201011232037.tar.gz  webtools.sourceediting-201011232037.tar.xz  webtools.sourceediting-201011232037.zip  nitind14 years
v201011232031webtools.sourceediting-201011232031.tar.gz  webtools.sourceediting-201011232031.tar.xz  webtools.sourceediting-201011232031.zip  nitind14 years
v201011192110webtools.sourceediting-201011192110.tar.gz  webtools.sourceediting-201011192110.tar.xz  webtools.sourceediting-201011192110.zip  nitind14 years
v201011191934webtools.sourceediting-201011191934.tar.gz  webtools.sourceediting-201011191934.tar.xz  webtools.sourceediting-201011191934.zip  nitind14 years
v201011191933webtools.sourceediting-201011191933.tar.gz  webtools.sourceediting-201011191933.tar.xz  webtools.sourceediting-201011191933.zip  nitind14 years
v201011171841webtools.sourceediting-201011171841.tar.gz  webtools.sourceediting-201011171841.tar.xz  webtools.sourceediting-201011171841.zip  nitind14 years
v201011171831webtools.sourceediting-201011171831.tar.gz  webtools.sourceediting-201011171831.tar.xz  webtools.sourceediting-201011171831.zip  nitind14 years
v201011152023webtools.sourceediting-201011152023.tar.gz  webtools.sourceediting-201011152023.tar.xz  webtools.sourceediting-201011152023.zip  nitind14 years
v201011152026webtools.sourceediting-201011152026.tar.gz  webtools.sourceediting-201011152026.tar.xz  webtools.sourceediting-201011152026.zip  nitind14 years
v201011151911webtools.sourceediting-201011151911.tar.gz  webtools.sourceediting-201011151911.tar.xz  webtools.sourceediting-201011151911.zip  nitind14 years
v201011152200webtools.sourceediting-201011152200.tar.gz  webtools.sourceediting-201011152200.tar.xz  webtools.sourceediting-201011152200.zip  nitind14 years
v201011151631webtools.sourceediting-201011151631.tar.gz  webtools.sourceediting-201011151631.tar.xz  webtools.sourceediting-201011151631.zip  nitind14 years
v201011151623webtools.sourceediting-201011151623.tar.gz  webtools.sourceediting-201011151623.tar.xz  webtools.sourceediting-201011151623.zip  nitind14 years
v201011151456webtools.sourceediting-201011151456.tar.gz  webtools.sourceediting-201011151456.tar.xz  webtools.sourceediting-201011151456.zip  nitind14 years
v201104070312webtools.sourceediting-201104070312.tar.gz  webtools.sourceediting-201104070312.tar.xz  webtools.sourceediting-201104070312.zip  nitind14 years
v201011122042webtools.sourceediting-201011122042.tar.gz  webtools.sourceediting-201011122042.tar.xz  webtools.sourceediting-201011122042.zip  nitind14 years
v201011151512webtools.sourceediting-201011151512.tar.gz  webtools.sourceediting-201011151512.tar.xz  webtools.sourceediting-201011151512.zip  nitind14 years
v201011052107webtools.sourceediting-201011052107.tar.gz  webtools.sourceediting-201011052107.tar.xz  webtools.sourceediting-201011052107.zip  nitind14 years
v201011052105webtools.sourceediting-201011052105.tar.gz  webtools.sourceediting-201011052105.tar.xz  webtools.sourceediting-201011052105.zip  nitind14 years
v201011030149webtools.sourceediting-201011030149.tar.gz  webtools.sourceediting-201011030149.tar.xz  webtools.sourceediting-201011030149.zip  nitind14 years
v201011031706webtools.sourceediting-201011031706.tar.gz  webtools.sourceediting-201011031706.tar.xz  webtools.sourceediting-201011031706.zip  nitind14 years
v201011031707webtools.sourceediting-201011031707.tar.gz  webtools.sourceediting-201011031707.tar.xz  webtools.sourceediting-201011031707.zip  nitind14 years
v201011022204webtools.sourceediting-201011022204.tar.gz  webtools.sourceediting-201011022204.tar.xz  webtools.sourceediting-201011022204.zip  nitind14 years
v201011022203webtools.sourceediting-201011022203.tar.gz  webtools.sourceediting-201011022203.tar.xz  webtools.sourceediting-201011022203.zip  nitind14 years
v201011021846webtools.sourceediting-201011021846.tar.gz  webtools.sourceediting-201011021846.tar.xz  webtools.sourceediting-201011021846.zip  nitind14 years
v201011021843webtools.sourceediting-201011021843.tar.gz  webtools.sourceediting-201011021843.tar.xz  webtools.sourceediting-201011021843.zip  nitind14 years
v201011012148webtools.sourceediting-201011012148.tar.gz  webtools.sourceediting-201011012148.tar.xz  webtools.sourceediting-201011012148.zip  nitind14 years
v201011012107webtools.sourceediting-201011012107.tar.gz  webtools.sourceediting-201011012107.tar.xz  webtools.sourceediting-201011012107.zip  nitind14 years
v201010292144webtools.sourceediting-201010292144.tar.gz  webtools.sourceediting-201010292144.tar.xz  webtools.sourceediting-201010292144.zip  nitind14 years
v201010291852webtools.sourceediting-201010291852.tar.gz  webtools.sourceediting-201010291852.tar.xz  webtools.sourceediting-201010291852.zip  nitind14 years
v201102160541webtools.sourceediting-201102160541.tar.gz  webtools.sourceediting-201102160541.tar.xz  webtools.sourceediting-201102160541.zip  nitind14 years
v201102160540webtools.sourceediting-201102160540.tar.gz  webtools.sourceediting-201102160540.tar.xz  webtools.sourceediting-201102160540.zip  nitind14 years
v201101260444webtools.sourceediting-201101260444.tar.gz  webtools.sourceediting-201101260444.tar.xz  webtools.sourceediting-201101260444.zip  nitind14 years
v201101260441webtools.sourceediting-201101260441.tar.gz  webtools.sourceediting-201101260441.tar.xz  webtools.sourceediting-201101260441.zip  nitind14 years
v201101201924webtools.sourceediting-201101201924.tar.gz  webtools.sourceediting-201101201924.tar.xz  webtools.sourceediting-201101201924.zip  nitind14 years
v201010280330webtools.sourceediting-201010280330.tar.gz  webtools.sourceediting-201010280330.tar.xz  webtools.sourceediting-201010280330.zip  nitind14 years
v201010280031webtools.sourceediting-201010280031.tar.gz  webtools.sourceediting-201010280031.tar.xz  webtools.sourceediting-201010280031.zip  nitind14 years
v201010280030webtools.sourceediting-201010280030.tar.gz  webtools.sourceediting-201010280030.tar.xz  webtools.sourceediting-201010280030.zip  nitind14 years
v201010272312webtools.sourceediting-201010272312.tar.gz  webtools.sourceediting-201010272312.tar.xz  webtools.sourceediting-201010272312.zip  nitind14 years
v201010272316webtools.sourceediting-201010272316.tar.gz  webtools.sourceediting-201010272316.tar.xz  webtools.sourceediting-201010272316.zip  nitind14 years
v201010271711webtools.sourceediting-201010271711.tar.gz  webtools.sourceediting-201010271711.tar.xz  webtools.sourceediting-201010271711.zip  nitind14 years
v201010271710webtools.sourceediting-201010271710.tar.gz  webtools.sourceediting-201010271710.tar.xz  webtools.sourceediting-201010271710.zip  nitind14 years
v201010270339webtools.sourceediting-201010270339.tar.gz  webtools.sourceediting-201010270339.tar.xz  webtools.sourceediting-201010270339.zip  nitind14 years
v201010262029webtools.sourceediting-201010262029.tar.gz  webtools.sourceediting-201010262029.tar.xz  webtools.sourceediting-201010262029.zip  nitind14 years
v201010262022webtools.sourceediting-201010262022.tar.gz  webtools.sourceediting-201010262022.tar.xz  webtools.sourceediting-201010262022.zip  nitind14 years
v201010261855webtools.sourceediting-201010261855.tar.gz  webtools.sourceediting-201010261855.tar.xz  webtools.sourceediting-201010261855.zip  nitind14 years
v201010261400webtools.sourceediting-201010261400.tar.gz  webtools.sourceediting-201010261400.tar.xz  webtools.sourceediting-201010261400.zip  nitind14 years
v201010261459webtools.sourceediting-201010261459.tar.gz  webtools.sourceediting-201010261459.tar.xz  webtools.sourceediting-201010261459.zip  nitind14 years
v201010221838webtools.sourceediting-201010221838.tar.gz  webtools.sourceediting-201010221838.tar.xz  webtools.sourceediting-201010221838.zip  nitind14 years
v201010221826webtools.sourceediting-201010221826.tar.gz  webtools.sourceediting-201010221826.tar.xz  webtools.sourceediting-201010221826.zip  nitind14 years
v201010221824webtools.sourceediting-201010221824.tar.gz  webtools.sourceediting-201010221824.tar.xz  webtools.sourceediting-201010221824.zip  nitind14 years
v201010221431webtools.sourceediting-201010221431.tar.gz  webtools.sourceediting-201010221431.tar.xz  webtools.sourceediting-201010221431.zip  nitind14 years
v201010221430webtools.sourceediting-201010221430.tar.gz  webtools.sourceediting-201010221430.tar.xz  webtools.sourceediting-201010221430.zip  nitind14 years
v201010201911webtools.sourceediting-201010201911.tar.gz  webtools.sourceediting-201010201911.tar.xz  webtools.sourceediting-201010201911.zip  nitind14 years
v201010192207webtools.sourceediting-201010192207.tar.gz  webtools.sourceediting-201010192207.tar.xz  webtools.sourceediting-201010192207.zip  nitind14 years
v201010192201webtools.sourceediting-201010192201.tar.gz  webtools.sourceediting-201010192201.tar.xz  webtools.sourceediting-201010192201.zip  nitind14 years
v201010192159webtools.sourceediting-201010192159.tar.gz  webtools.sourceediting-201010192159.tar.xz  webtools.sourceediting-201010192159.zip  nitind14 years
v201010192135webtools.sourceediting-201010192135.tar.gz  webtools.sourceediting-201010192135.tar.xz  webtools.sourceediting-201010192135.zip  nitind14 years
v201010192117webtools.sourceediting-201010192117.tar.gz  webtools.sourceediting-201010192117.tar.xz  webtools.sourceediting-201010192117.zip  nitind14 years
v201010182049webtools.sourceediting-201010182049.tar.gz  webtools.sourceediting-201010182049.tar.xz  webtools.sourceediting-201010182049.zip  nitind14 years
v201010182028webtools.sourceediting-201010182028.tar.gz  webtools.sourceediting-201010182028.tar.xz  webtools.sourceediting-201010182028.zip  nitind14 years
v201010160450webtools.sourceediting-201010160450.tar.gz  webtools.sourceediting-201010160450.tar.xz  webtools.sourceediting-201010160450.zip  nitind14 years
v201010152255webtools.sourceediting-201010152255.tar.gz  webtools.sourceediting-201010152255.tar.xz  webtools.sourceediting-201010152255.zip  nitind14 years
v201010152142webtools.sourceediting-201010152142.tar.gz  webtools.sourceediting-201010152142.tar.xz  webtools.sourceediting-201010152142.zip  nitind14 years
v201010152141webtools.sourceediting-201010152141.tar.gz  webtools.sourceediting-201010152141.tar.xz  webtools.sourceediting-201010152141.zip  nitind14 years
v201010152133webtools.sourceediting-201010152133.tar.gz  webtools.sourceediting-201010152133.tar.xz  webtools.sourceediting-201010152133.zip  nitind14 years
v201010152131webtools.sourceediting-201010152131.tar.gz  webtools.sourceediting-201010152131.tar.xz  webtools.sourceediting-201010152131.zip  nitind14 years
v201010151912webtools.sourceediting-201010151912.tar.gz  webtools.sourceediting-201010151912.tar.xz  webtools.sourceediting-201010151912.zip  nitind14 years
v201010160200webtools.sourceediting-201010160200.tar.gz  webtools.sourceediting-201010160200.tar.xz  webtools.sourceediting-201010160200.zip  nitind14 years
v201010131809webtools.sourceediting-201010131809.tar.gz  webtools.sourceediting-201010131809.tar.xz  webtools.sourceediting-201010131809.zip  nitind14 years
v201010131807webtools.sourceediting-201010131807.tar.gz  webtools.sourceediting-201010131807.tar.xz  webtools.sourceediting-201010131807.zip  nitind14 years
v201010111805webtools.sourceediting-201010111805.tar.gz  webtools.sourceediting-201010111805.tar.xz  webtools.sourceediting-201010111805.zip  nitind14 years
v201010111900webtools.sourceediting-201010111900.tar.gz  webtools.sourceediting-201010111900.tar.xz  webtools.sourceediting-201010111900.zip  nitind14 years
v201010111428webtools.sourceediting-201010111428.tar.gz  webtools.sourceediting-201010111428.tar.xz  webtools.sourceediting-201010111428.zip  nitind14 years
v201010111430webtools.sourceediting-201010111430.tar.gz  webtools.sourceediting-201010111430.tar.xz  webtools.sourceediting-201010111430.zip  nitind14 years
v201010081850webtools.sourceediting-201010081850.tar.gz  webtools.sourceediting-201010081850.tar.xz  webtools.sourceediting-201010081850.zip  nitind14 years
v201010062018webtools.sourceediting-201010062018.tar.gz  webtools.sourceediting-201010062018.tar.xz  webtools.sourceediting-201010062018.zip  nitind14 years
v201010061947webtools.sourceediting-201010061947.tar.gz  webtools.sourceediting-201010061947.tar.xz  webtools.sourceediting-201010061947.zip  nitind14 years
v201010061917webtools.sourceediting-201010061917.tar.gz  webtools.sourceediting-201010061917.tar.xz  webtools.sourceediting-201010061917.zip  nitind14 years
v201010061428webtools.sourceediting-201010061428.tar.gz  webtools.sourceediting-201010061428.tar.xz  webtools.sourceediting-201010061428.zip  nitind14 years
v201010061427webtools.sourceediting-201010061427.tar.gz  webtools.sourceediting-201010061427.tar.xz  webtools.sourceediting-201010061427.zip  nitind14 years
v201010060410webtools.sourceediting-201010060410.tar.gz  webtools.sourceediting-201010060410.tar.xz  webtools.sourceediting-201010060410.zip  nitind14 years
v201010051538webtools.sourceediting-201010051538.tar.gz  webtools.sourceediting-201010051538.tar.xz  webtools.sourceediting-201010051538.zip  nitind14 years
v201010051537webtools.sourceediting-201010051537.tar.gz  webtools.sourceediting-201010051537.tar.xz  webtools.sourceediting-201010051537.zip  nitind14 years
v201010050832webtools.sourceediting-201010050832.tar.gz  webtools.sourceediting-201010050832.tar.xz  webtools.sourceediting-201010050832.zip  nitind14 years
v201010050500webtools.sourceediting-201010050500.tar.gz  webtools.sourceediting-201010050500.tar.xz  webtools.sourceediting-201010050500.zip  nitind14 years
v201010042135webtools.sourceediting-201010042135.tar.gz  webtools.sourceediting-201010042135.tar.xz  webtools.sourceediting-201010042135.zip  nitind14 years
v201010112050webtools.sourceediting-201010112050.tar.gz  webtools.sourceediting-201010112050.tar.xz  webtools.sourceediting-201010112050.zip  nitind14 years
v201010012100webtools.sourceediting-201010012100.tar.gz  webtools.sourceediting-201010012100.tar.xz  webtools.sourceediting-201010012100.zip  nitind14 years
v201010012053webtools.sourceediting-201010012053.tar.gz  webtools.sourceediting-201010012053.tar.xz  webtools.sourceediting-201010012053.zip  nitind14 years
v201010140517webtools.sourceediting-201010140517.tar.gz  webtools.sourceediting-201010140517.tar.xz  webtools.sourceediting-201010140517.zip  nitind14 years
v201009292100webtools.sourceediting-201009292100.tar.gz  webtools.sourceediting-201009292100.tar.xz  webtools.sourceediting-201009292100.zip  nitind14 years
v201009292040webtools.sourceediting-201009292040.tar.gz  webtools.sourceediting-201009292040.tar.xz  webtools.sourceediting-201009292040.zip  nitind14 years
v201009291530webtools.sourceediting-201009291530.tar.gz  webtools.sourceediting-201009291530.tar.xz  webtools.sourceediting-201009291530.zip  nitind14 years
v201009291529webtools.sourceediting-201009291529.tar.gz  webtools.sourceediting-201009291529.tar.xz  webtools.sourceediting-201009291529.zip  nitind14 years
v201009291422webtools.sourceediting-201009291422.tar.gz  webtools.sourceediting-201009291422.tar.xz  webtools.sourceediting-201009291422.zip  nitind14 years
v201009291421webtools.sourceediting-201009291421.tar.gz  webtools.sourceediting-201009291421.tar.xz  webtools.sourceediting-201009291421.zip  nitind14 years
v201009290706webtools.sourceediting-201009290706.tar.gz  webtools.sourceediting-201009290706.tar.xz  webtools.sourceediting-201009290706.zip  nitind14 years
v201009282130webtools.sourceediting-201009282130.tar.gz  webtools.sourceediting-201009282130.tar.xz  webtools.sourceediting-201009282130.zip  nitind14 years
v201009282128webtools.sourceediting-201009282128.tar.gz  webtools.sourceediting-201009282128.tar.xz  webtools.sourceediting-201009282128.zip  nitind14 years
v201009282011webtools.sourceediting-201009282011.tar.gz  webtools.sourceediting-201009282011.tar.xz  webtools.sourceediting-201009282011.zip  nitind14 years
v201009281954webtools.sourceediting-201009281954.tar.gz  webtools.sourceediting-201009281954.tar.xz  webtools.sourceediting-201009281954.zip  nitind14 years
v201009281952webtools.sourceediting-201009281952.tar.gz  webtools.sourceediting-201009281952.tar.xz  webtools.sourceediting-201009281952.zip  nitind14 years
v201009281811webtools.sourceediting-201009281811.tar.gz  webtools.sourceediting-201009281811.tar.xz  webtools.sourceediting-201009281811.zip  nitind14 years
v201009281806webtools.sourceediting-201009281806.tar.gz  webtools.sourceediting-201009281806.tar.xz  webtools.sourceediting-201009281806.zip  nitind14 years
v201009281746webtools.sourceediting-201009281746.tar.gz  webtools.sourceediting-201009281746.tar.xz  webtools.sourceediting-201009281746.zip  nitind14 years
v201009281743webtools.sourceediting-201009281743.tar.gz  webtools.sourceediting-201009281743.tar.xz  webtools.sourceediting-201009281743.zip  nitind14 years
v201009211737webtools.sourceediting-201009211737.tar.gz  webtools.sourceediting-201009211737.tar.xz  webtools.sourceediting-201009211737.zip  nitind14 years
v201009211402webtools.sourceediting-201009211402.tar.gz  webtools.sourceediting-201009211402.tar.xz  webtools.sourceediting-201009211402.zip  nitind14 years
v201009201954webtools.sourceediting-201009201954.tar.gz  webtools.sourceediting-201009201954.tar.xz  webtools.sourceediting-201009201954.zip  nitind14 years
v201009151600webtools.sourceediting-201009151600.tar.gz  webtools.sourceediting-201009151600.tar.xz  webtools.sourceediting-201009151600.zip  nitind14 years
v201009151510webtools.sourceediting-201009151510.tar.gz  webtools.sourceediting-201009151510.tar.xz  webtools.sourceediting-201009151510.zip  nitind14 years
v201009151438webtools.sourceediting-201009151438.tar.gz  webtools.sourceediting-201009151438.tar.xz  webtools.sourceediting-201009151438.zip  nitind14 years
v201009151439webtools.sourceediting-201009151439.tar.gz  webtools.sourceediting-201009151439.tar.xz  webtools.sourceediting-201009151439.zip  nitind14 years
v201009091745webtools.sourceediting-201009091745.tar.gz  webtools.sourceediting-201009091745.tar.xz  webtools.sourceediting-201009091745.zip  nitind14 years
R3_2_2webtools.sourceediting-R3_2_2.tar.gz  webtools.sourceediting-R3_2_2.tar.xz  webtools.sourceediting-R3_2_2.zip  nitind14 years
v201009082014webtools.sourceediting-201009082014.tar.gz  webtools.sourceediting-201009082014.tar.xz  webtools.sourceediting-201009082014.zip  nitind14 years
v201009011527webtools.sourceediting-201009011527.tar.gz  webtools.sourceediting-201009011527.tar.xz  webtools.sourceediting-201009011527.zip  nitind14 years
v201009010342webtools.sourceediting-201009010342.tar.gz  webtools.sourceediting-201009010342.tar.xz  webtools.sourceediting-201009010342.zip  nitind14 years
v201008311926webtools.sourceediting-201008311926.tar.gz  webtools.sourceediting-201008311926.tar.xz  webtools.sourceediting-201008311926.zip  nitind14 years
v201008311915webtools.sourceediting-201008311915.tar.gz  webtools.sourceediting-201008311915.tar.xz  webtools.sourceediting-201008311915.zip  nitind14 years
v201008311901webtools.sourceediting-201008311901.tar.gz  webtools.sourceediting-201008311901.tar.xz  webtools.sourceediting-201008311901.zip  nitind14 years
v201008311858webtools.sourceediting-201008311858.tar.gz  webtools.sourceediting-201008311858.tar.xz  webtools.sourceediting-201008311858.zip  nitind14 years
v201008311545webtools.sourceediting-201008311545.tar.gz  webtools.sourceediting-201008311545.tar.xz  webtools.sourceediting-201008311545.zip  nitind14 years
v201008301811webtools.sourceediting-201008301811.tar.gz  webtools.sourceediting-201008301811.tar.xz  webtools.sourceediting-201008301811.zip  nitind14 years
v201008301900webtools.sourceediting-201008301900.tar.gz  webtools.sourceediting-201008301900.tar.xz  webtools.sourceediting-201008301900.zip  nitind14 years
Root_R3_2_2_patcheswebtools.sourceediting-Root_R3_2_2_patches.tar.gz  webtools.sourceediting-Root_R3_2_2_patches.tar.xz  webtools.sourceediting-Root_R3_2_2_patches.zip  nitind14 years
v201008251906webtools.sourceediting-201008251906.tar.gz  webtools.sourceediting-201008251906.tar.xz  webtools.sourceediting-201008251906.zip  nitind14 years
v201008251905webtools.sourceediting-201008251905.tar.gz  webtools.sourceediting-201008251905.tar.xz  webtools.sourceediting-201008251905.zip  nitind14 years
v201008251829webtools.sourceediting-201008251829.tar.gz  webtools.sourceediting-201008251829.tar.xz  webtools.sourceediting-201008251829.zip  nitind14 years
v201008251808webtools.sourceediting-201008251808.tar.gz  webtools.sourceediting-201008251808.tar.xz  webtools.sourceediting-201008251808.zip  nitind14 years
v201008251735webtools.sourceediting-201008251735.tar.gz  webtools.sourceediting-201008251735.tar.xz  webtools.sourceediting-201008251735.zip  nitind14 years
v201008251737webtools.sourceediting-201008251737.tar.gz  webtools.sourceediting-201008251737.tar.xz  webtools.sourceediting-201008251737.zip  nitind14 years
v201008242041webtools.sourceediting-201008242041.tar.gz  webtools.sourceediting-201008242041.tar.xz  webtools.sourceediting-201008242041.zip  nitind14 years
v201008242039webtools.sourceediting-201008242039.tar.gz  webtools.sourceediting-201008242039.tar.xz  webtools.sourceediting-201008242039.zip  nitind14 years
v201008232150webtools.sourceediting-201008232150.tar.gz  webtools.sourceediting-201008232150.tar.xz  webtools.sourceediting-201008232150.zip  nitind14 years
v201008232149webtools.sourceediting-201008232149.tar.gz  webtools.sourceediting-201008232149.tar.xz  webtools.sourceediting-201008232149.zip  nitind14 years
v201008232126webtools.sourceediting-201008232126.tar.gz  webtools.sourceediting-201008232126.tar.xz  webtools.sourceediting-201008232126.zip  nitind14 years
v201008232128webtools.sourceediting-201008232128.tar.gz  webtools.sourceediting-201008232128.tar.xz  webtools.sourceediting-201008232128.zip  nitind14 years
v201008232043webtools.sourceediting-201008232043.tar.gz  webtools.sourceediting-201008232043.tar.xz  webtools.sourceediting-201008232043.zip  nitind14 years
v201008232042webtools.sourceediting-201008232042.tar.gz  webtools.sourceediting-201008232042.tar.xz  webtools.sourceediting-201008232042.zip  nitind14 years
v201008232037webtools.sourceediting-201008232037.tar.gz  webtools.sourceediting-201008232037.tar.xz  webtools.sourceediting-201008232037.zip  nitind14 years
v201008232032webtools.sourceediting-201008232032.tar.gz  webtools.sourceediting-201008232032.tar.xz  webtools.sourceediting-201008232032.zip  nitind14 years
v201008231959webtools.sourceediting-201008231959.tar.gz  webtools.sourceediting-201008231959.tar.xz  webtools.sourceediting-201008231959.zip  nitind14 years
v201008231957webtools.sourceediting-201008231957.tar.gz  webtools.sourceediting-201008231957.tar.xz  webtools.sourceediting-201008231957.zip  nitind14 years
v201008231419webtools.sourceediting-201008231419.tar.gz  webtools.sourceediting-201008231419.tar.xz  webtools.sourceediting-201008231419.zip  nitind14 years
v201008231415webtools.sourceediting-201008231415.tar.gz  webtools.sourceediting-201008231415.tar.xz  webtools.sourceediting-201008231415.zip  nitind14 years
v201008201550webtools.sourceediting-201008201550.tar.gz  webtools.sourceediting-201008201550.tar.xz  webtools.sourceediting-201008201550.zip  nitind14 years
v201008201521webtools.sourceediting-201008201521.tar.gz  webtools.sourceediting-201008201521.tar.xz  webtools.sourceediting-201008201521.zip  nitind14 years
v201008200146webtools.sourceediting-201008200146.tar.gz  webtools.sourceediting-201008200146.tar.xz  webtools.sourceediting-201008200146.zip  nitind14 years
v201008181908webtools.sourceediting-201008181908.tar.gz  webtools.sourceediting-201008181908.tar.xz  webtools.sourceediting-201008181908.zip  nitind14 years
v201008181909webtools.sourceediting-201008181909.tar.gz  webtools.sourceediting-201008181909.tar.xz  webtools.sourceediting-201008181909.zip  nitind14 years
v201008170029webtools.sourceediting-201008170029.tar.gz  webtools.sourceediting-201008170029.tar.xz  webtools.sourceediting-201008170029.zip  nitind14 years
v201008162125webtools.sourceediting-201008162125.tar.gz  webtools.sourceediting-201008162125.tar.xz  webtools.sourceediting-201008162125.zip  nitind14 years
v201008162026webtools.sourceediting-201008162026.tar.gz  webtools.sourceediting-201008162026.tar.xz  webtools.sourceediting-201008162026.zip  nitind14 years
v201008162025webtools.sourceediting-201008162025.tar.gz  webtools.sourceediting-201008162025.tar.xz  webtools.sourceediting-201008162025.zip  nitind14 years
v201008162004webtools.sourceediting-201008162004.tar.gz  webtools.sourceediting-201008162004.tar.xz  webtools.sourceediting-201008162004.zip  nitind14 years
v201008162005webtools.sourceediting-201008162005.tar.gz  webtools.sourceediting-201008162005.tar.xz  webtools.sourceediting-201008162005.zip  nitind14 years
v201008161955webtools.sourceediting-201008161955.tar.gz  webtools.sourceediting-201008161955.tar.xz  webtools.sourceediting-201008161955.zip  nitind14 years
v201008161948webtools.sourceediting-201008161948.tar.gz  webtools.sourceediting-201008161948.tar.xz  webtools.sourceediting-201008161948.zip  nitind14 years
v201008161947webtools.sourceediting-201008161947.tar.gz  webtools.sourceediting-201008161947.tar.xz  webtools.sourceediting-201008161947.zip  nitind14 years
v201008161848webtools.sourceediting-201008161848.tar.gz  webtools.sourceediting-201008161848.tar.xz  webtools.sourceediting-201008161848.zip  nitind14 years
v201008161807webtools.sourceediting-201008161807.tar.gz  webtools.sourceediting-201008161807.tar.xz  webtools.sourceediting-201008161807.zip  nitind14 years
v201008161805webtools.sourceediting-201008161805.tar.gz  webtools.sourceediting-201008161805.tar.xz  webtools.sourceediting-201008161805.zip  nitind14 years
v201008161756webtools.sourceediting-201008161756.tar.gz  webtools.sourceediting-201008161756.tar.xz  webtools.sourceediting-201008161756.zip  nitind14 years
v201008161749webtools.sourceediting-201008161749.tar.gz  webtools.sourceediting-201008161749.tar.xz  webtools.sourceediting-201008161749.zip  nitind14 years
v201008112018webtools.sourceediting-201008112018.tar.gz  webtools.sourceediting-201008112018.tar.xz  webtools.sourceediting-201008112018.zip  nitind14 years
v201008102046webtools.sourceediting-201008102046.tar.gz  webtools.sourceediting-201008102046.tar.xz  webtools.sourceediting-201008102046.zip  nitind14 years
v201008102055webtools.sourceediting-201008102055.tar.gz  webtools.sourceediting-201008102055.tar.xz  webtools.sourceediting-201008102055.zip  nitind14 years
v201008101128webtools.sourceediting-201008101128.tar.gz  webtools.sourceediting-201008101128.tar.xz  webtools.sourceediting-201008101128.zip  nitind14 years
v201008092214webtools.sourceediting-201008092214.tar.gz  webtools.sourceediting-201008092214.tar.xz  webtools.sourceediting-201008092214.zip  nitind14 years
v201008092200webtools.sourceediting-201008092200.tar.gz  webtools.sourceediting-201008092200.tar.xz  webtools.sourceediting-201008092200.zip  nitind14 years
v201008091930webtools.sourceediting-201008091930.tar.gz  webtools.sourceediting-201008091930.tar.xz  webtools.sourceediting-201008091930.zip  nitind14 years
v201008091931webtools.sourceediting-201008091931.tar.gz  webtools.sourceediting-201008091931.tar.xz  webtools.sourceediting-201008091931.zip  nitind14 years
v201008091906webtools.sourceediting-201008091906.tar.gz  webtools.sourceediting-201008091906.tar.xz  webtools.sourceediting-201008091906.zip  nitind14 years
v201008091907webtools.sourceediting-201008091907.tar.gz  webtools.sourceediting-201008091907.tar.xz  webtools.sourceediting-201008091907.zip  nitind14 years
v201008091359webtools.sourceediting-201008091359.tar.gz  webtools.sourceediting-201008091359.tar.xz  webtools.sourceediting-201008091359.zip  nitind14 years
v201008100100webtools.sourceediting-201008100100.tar.gz  webtools.sourceediting-201008100100.tar.xz  webtools.sourceediting-201008100100.zip  nitind14 years
v201010270400webtools.sourceediting-201010270400.tar.gz  webtools.sourceediting-201010270400.tar.xz  webtools.sourceediting-201010270400.zip  nitind14 years
v201010071250webtools.sourceediting-201010071250.tar.gz  webtools.sourceediting-201010071250.tar.xz  webtools.sourceediting-201010071250.zip  nitind14 years
v201008062100webtools.sourceediting-201008062100.tar.gz  webtools.sourceediting-201008062100.tar.xz  webtools.sourceediting-201008062100.zip  nitind14 years
v201008060821webtools.sourceediting-201008060821.tar.gz  webtools.sourceediting-201008060821.tar.xz  webtools.sourceediting-201008060821.zip  nitind14 years
v201008041947webtools.sourceediting-201008041947.tar.gz  webtools.sourceediting-201008041947.tar.xz  webtools.sourceediting-201008041947.zip  nitind14 years
v201008041745webtools.sourceediting-201008041745.tar.gz  webtools.sourceediting-201008041745.tar.xz  webtools.sourceediting-201008041745.zip  nitind14 years
v201008032110webtools.sourceediting-201008032110.tar.gz  webtools.sourceediting-201008032110.tar.xz  webtools.sourceediting-201008032110.zip  nitind14 years
v201008032044webtools.sourceediting-201008032044.tar.gz  webtools.sourceediting-201008032044.tar.xz  webtools.sourceediting-201008032044.zip  nitind14 years
v201008031541webtools.sourceediting-201008031541.tar.gz  webtools.sourceediting-201008031541.tar.xz  webtools.sourceediting-201008031541.zip  nitind14 years
v201008031535webtools.sourceediting-201008031535.tar.gz  webtools.sourceediting-201008031535.tar.xz  webtools.sourceediting-201008031535.zip  nitind14 years
v201008031527webtools.sourceediting-201008031527.tar.gz  webtools.sourceediting-201008031527.tar.xz  webtools.sourceediting-201008031527.zip  nitind14 years
v201008031506webtools.sourceediting-201008031506.tar.gz  webtools.sourceediting-201008031506.tar.xz  webtools.sourceediting-201008031506.zip  nitind14 years
v201008031451webtools.sourceediting-201008031451.tar.gz  webtools.sourceediting-201008031451.tar.xz  webtools.sourceediting-201008031451.zip  nitind14 years
v201008022010webtools.sourceediting-201008022010.tar.gz  webtools.sourceediting-201008022010.tar.xz  webtools.sourceediting-201008022010.zip  david_williams14 years
v201007311522webtools.sourceediting-201007311522.tar.gz  webtools.sourceediting-201007311522.tar.xz  webtools.sourceediting-201007311522.zip  nitind14 years
v201010070622webtools.sourceediting-201010070622.tar.gz  webtools.sourceediting-201010070622.tar.xz  webtools.sourceediting-201010070622.zip  nitind14 years
v201010070618webtools.sourceediting-201010070618.tar.gz  webtools.sourceediting-201010070618.tar.xz  webtools.sourceediting-201010070618.zip  nitind14 years
v201007301850webtools.sourceediting-201007301850.tar.gz  webtools.sourceediting-201007301850.tar.xz  webtools.sourceediting-201007301850.zip  nitind14 years
v201007282055webtools.sourceediting-201007282055.tar.gz  webtools.sourceediting-201007282055.tar.xz  webtools.sourceediting-201007282055.zip  nitind14 years
v201007282037webtools.sourceediting-201007282037.tar.gz  webtools.sourceediting-201007282037.tar.xz  webtools.sourceediting-201007282037.zip  nitind14 years
v201007281945webtools.sourceediting-201007281945.tar.gz  webtools.sourceediting-201007281945.tar.xz  webtools.sourceediting-201007281945.zip  nitind14 years
v201007272149webtools.sourceediting-201007272149.tar.gz  webtools.sourceediting-201007272149.tar.xz  webtools.sourceediting-201007272149.zip  nitind14 years
v201007272132webtools.sourceediting-201007272132.tar.gz  webtools.sourceediting-201007272132.tar.xz  webtools.sourceediting-201007272132.zip  nitind14 years
v201007141733webtools.sourceediting-201007141733.tar.gz  webtools.sourceediting-201007141733.tar.xz  webtools.sourceediting-201007141733.zip  nitind14 years
Root_R3_2_1_patcheswebtools.sourceediting-Root_R3_2_1_patches.tar.gz  webtools.sourceediting-Root_R3_2_1_patches.tar.xz  webtools.sourceediting-Root_R3_2_1_patches.zip  nitind14 years
v201007261820webtools.sourceediting-201007261820.tar.gz  webtools.sourceediting-201007261820.tar.xz  webtools.sourceediting-201007261820.zip  nitind14 years
v201007151827webtools.sourceediting-201007151827.tar.gz  webtools.sourceediting-201007151827.tar.xz  webtools.sourceediting-201007151827.zip  nitind14 years
R3_2_1webtools.sourceediting-R3_2_1.tar.gz  webtools.sourceediting-R3_2_1.tar.xz  webtools.sourceediting-R3_2_1.zip  nitind14 years
v201007141939webtools.sourceediting-201007141939.tar.gz  webtools.sourceediting-201007141939.tar.xz  webtools.sourceediting-201007141939.zip  nitind14 years
v201007141735webtools.sourceediting-201007141735.tar.gz  webtools.sourceediting-201007141735.tar.xz  webtools.sourceediting-201007141735.zip  nitind14 years
v201007141714webtools.sourceediting-201007141714.tar.gz  webtools.sourceediting-201007141714.tar.xz  webtools.sourceediting-201007141714.zip  nitind14 years
v201007132152webtools.sourceediting-201007132152.tar.gz  webtools.sourceediting-201007132152.tar.xz  webtools.sourceediting-201007132152.zip  nitind14 years
v201008101740webtools.sourceediting-201008101740.tar.gz  webtools.sourceediting-201008101740.tar.xz  webtools.sourceediting-201008101740.zip  nitind14 years
v201007131535webtools.sourceediting-201007131535.tar.gz  webtools.sourceediting-201007131535.tar.xz  webtools.sourceediting-201007131535.zip  nitind14 years
v201007131447webtools.sourceediting-201007131447.tar.gz  webtools.sourceediting-201007131447.tar.xz  webtools.sourceediting-201007131447.zip  nitind14 years
v201007131444webtools.sourceediting-201007131444.tar.gz  webtools.sourceediting-201007131444.tar.xz  webtools.sourceediting-201007131444.zip  nitind14 years
v201007091430webtools.sourceediting-201007091430.tar.gz  webtools.sourceediting-201007091430.tar.xz  webtools.sourceediting-201007091430.zip  nitind14 years
v201007261900webtools.sourceediting-201007261900.tar.gz  webtools.sourceediting-201007261900.tar.xz  webtools.sourceediting-201007261900.zip  nitind14 years
v201007071800webtools.sourceediting-201007071800.tar.gz  webtools.sourceediting-201007071800.tar.xz  webtools.sourceediting-201007071800.zip  nitind14 years
v201007071754webtools.sourceediting-201007071754.tar.gz  webtools.sourceediting-201007071754.tar.xz  webtools.sourceediting-201007071754.zip  nitind14 years
Root_R3_2_maintenancewebtools.sourceediting-Root_R3_2_maintenance.tar.gz  webtools.sourceediting-Root_R3_2_maintenance.tar.xz  webtools.sourceediting-Root_R3_2_maintenance.zip  nitind14 years
v201007070628webtools.sourceediting-201007070628.tar.gz  webtools.sourceediting-201007070628.tar.xz  webtools.sourceediting-201007070628.zip  nitind14 years
v201007061413webtools.sourceediting-201007061413.tar.gz  webtools.sourceediting-201007061413.tar.xz  webtools.sourceediting-201007061413.zip  nitind14 years
v201007061411webtools.sourceediting-201007061411.tar.gz  webtools.sourceediting-201007061411.tar.xz  webtools.sourceediting-201007061411.zip  nitind14 years
v201007080222webtools.sourceediting-201007080222.tar.gz  webtools.sourceediting-201007080222.tar.xz  webtools.sourceediting-201007080222.zip  nitind14 years
v201007021514webtools.sourceediting-201007021514.tar.gz  webtools.sourceediting-201007021514.tar.xz  webtools.sourceediting-201007021514.zip  nitind14 years
v201006302117webtools.sourceediting-201006302117.tar.gz  webtools.sourceediting-201006302117.tar.xz  webtools.sourceediting-201006302117.zip  nitind14 years
v201006302102webtools.sourceediting-201006302102.tar.gz  webtools.sourceediting-201006302102.tar.xz  webtools.sourceediting-201006302102.zip  nitind14 years
v201006301546webtools.sourceediting-201006301546.tar.gz  webtools.sourceediting-201006301546.tar.xz  webtools.sourceediting-201006301546.zip  nitind14 years
v201006291756webtools.sourceediting-201006291756.tar.gz  webtools.sourceediting-201006291756.tar.xz  webtools.sourceediting-201006291756.zip  nitind14 years
v201006291750webtools.sourceediting-201006291750.tar.gz  webtools.sourceediting-201006291750.tar.xz  webtools.sourceediting-201006291750.zip  nitind14 years
v201006291744webtools.sourceediting-201006291744.tar.gz  webtools.sourceediting-201006291744.tar.xz  webtools.sourceediting-201006291744.zip  nitind14 years
v201006291730webtools.sourceediting-201006291730.tar.gz  webtools.sourceediting-201006291730.tar.xz  webtools.sourceediting-201006291730.zip  nitind14 years
v201006291537webtools.sourceediting-201006291537.tar.gz  webtools.sourceediting-201006291537.tar.xz  webtools.sourceediting-201006291537.zip  nitind14 years
v201006291533webtools.sourceediting-201006291533.tar.gz  webtools.sourceediting-201006291533.tar.xz  webtools.sourceediting-201006291533.zip  nitind14 years
v201006281444webtools.sourceediting-201006281444.tar.gz  webtools.sourceediting-201006281444.tar.xz  webtools.sourceediting-201006281444.zip  nitind14 years
v201006281425webtools.sourceediting-201006281425.tar.gz  webtools.sourceediting-201006281425.tar.xz  webtools.sourceediting-201006281425.zip  nitind14 years
v201006251813webtools.sourceediting-201006251813.tar.gz  webtools.sourceediting-201006251813.tar.xz  webtools.sourceediting-201006251813.zip  nitind14 years
v201006251806webtools.sourceediting-201006251806.tar.gz  webtools.sourceediting-201006251806.tar.xz  webtools.sourceediting-201006251806.zip  nitind14 years
v201006241540webtools.sourceediting-201006241540.tar.gz  webtools.sourceediting-201006241540.tar.xz  webtools.sourceediting-201006241540.zip  nitind14 years
v201006241535webtools.sourceediting-201006241535.tar.gz  webtools.sourceediting-201006241535.tar.xz  webtools.sourceediting-201006241535.zip  nitind14 years
v201006240059webtools.sourceediting-201006240059.tar.gz  webtools.sourceediting-201006240059.tar.xz  webtools.sourceediting-201006240059.zip  nitind14 years
v201006251545webtools.sourceediting-201006251545.tar.gz  webtools.sourceediting-201006251545.tar.xz  webtools.sourceediting-201006251545.zip  nitind14 years
v201006240107webtools.sourceediting-201006240107.tar.gz  webtools.sourceediting-201006240107.tar.xz  webtools.sourceediting-201006240107.zip  nitind14 years
v201006230058webtools.sourceediting-201006230058.tar.gz  webtools.sourceediting-201006230058.tar.xz  webtools.sourceediting-201006230058.zip  nitind14 years
v201006240047webtools.sourceediting-201006240047.tar.gz  webtools.sourceediting-201006240047.tar.xz  webtools.sourceediting-201006240047.zip  nitind14 years
v201006240045webtools.sourceediting-201006240045.tar.gz  webtools.sourceediting-201006240045.tar.xz  webtools.sourceediting-201006240045.zip  nitind14 years
v201006221949webtools.sourceediting-201006221949.tar.gz  webtools.sourceediting-201006221949.tar.xz  webtools.sourceediting-201006221949.zip  nitind14 years
v201006220300webtools.sourceediting-201006220300.tar.gz  webtools.sourceediting-201006220300.tar.xz  webtools.sourceediting-201006220300.zip  nitind14 years
v201006040347webtools.sourceediting-201006040347.tar.gz  webtools.sourceediting-201006040347.tar.xz  webtools.sourceediting-201006040347.zip  nitind14 years
v201006030742webtools.sourceediting-201006030742.tar.gz  webtools.sourceediting-201006030742.tar.xz  webtools.sourceediting-201006030742.zip  nitind14 years
R3_2_0webtools.sourceediting-R3_2_0.tar.gz  webtools.sourceediting-R3_2_0.tar.xz  webtools.sourceediting-R3_2_0.zip  nitind14 years
v201006020308webtools.sourceediting-201006020308.tar.gz  webtools.sourceediting-201006020308.tar.xz  webtools.sourceediting-201006020308.zip  nitind14 years
v201005271618webtools.sourceediting-201005271618.tar.gz  webtools.sourceediting-201005271618.tar.xz  webtools.sourceediting-201005271618.zip  nitind14 years
v201005271731webtools.sourceediting-201005271731.tar.gz  webtools.sourceediting-201005271731.tar.xz  webtools.sourceediting-201005271731.zip  nitind14 years
v201005270159webtools.sourceediting-201005270159.tar.gz  webtools.sourceediting-201005270159.tar.xz  webtools.sourceediting-201005270159.zip  nitind14 years
v201005261534webtools.sourceediting-201005261534.tar.gz  webtools.sourceediting-201005261534.tar.xz  webtools.sourceediting-201005261534.zip  nitind14 years
v201005241510webtools.sourceediting-201005241510.tar.gz  webtools.sourceediting-201005241510.tar.xz  webtools.sourceediting-201005241510.zip  nitind14 years
v201005241420webtools.sourceediting-201005241420.tar.gz  webtools.sourceediting-201005241420.tar.xz  webtools.sourceediting-201005241420.zip  nitind14 years
v201005210551webtools.sourceediting-201005210551.tar.gz  webtools.sourceediting-201005210551.tar.xz  webtools.sourceediting-201005210551.zip  nitind14 years
v201005200151webtools.sourceediting-201005200151.tar.gz  webtools.sourceediting-201005200151.tar.xz  webtools.sourceediting-201005200151.zip  nitind14 years
v201005192212webtools.sourceediting-201005192212.tar.gz  webtools.sourceediting-201005192212.tar.xz  webtools.sourceediting-201005192212.zip  nitind14 years
v201005191945webtools.sourceediting-201005191945.tar.gz  webtools.sourceediting-201005191945.tar.xz  webtools.sourceediting-201005191945.zip  nitind14 years
v201005130131webtools.sourceediting-201005130131.tar.gz  webtools.sourceediting-201005130131.tar.xz  webtools.sourceediting-201005130131.zip  nitind14 years
v201005120325webtools.sourceediting-201005120325.tar.gz  webtools.sourceediting-201005120325.tar.xz  webtools.sourceediting-201005120325.zip  nitind14 years
v201005112221webtools.sourceediting-201005112221.tar.gz  webtools.sourceediting-201005112221.tar.xz  webtools.sourceediting-201005112221.zip  nitind14 years
v201005111441webtools.sourceediting-201005111441.tar.gz  webtools.sourceediting-201005111441.tar.xz  webtools.sourceediting-201005111441.zip  nitind14 years
v201005130425webtools.sourceediting-201005130425.tar.gz  webtools.sourceediting-201005130425.tar.xz  webtools.sourceediting-201005130425.zip  nitind14 years
v201005041847webtools.sourceediting-201005041847.tar.gz  webtools.sourceediting-201005041847.tar.xz  webtools.sourceediting-201005041847.zip  nitind14 years
v201005041548webtools.sourceediting-201005041548.tar.gz  webtools.sourceediting-201005041548.tar.xz  webtools.sourceediting-201005041548.zip  nitind14 years
v201005041435webtools.sourceediting-201005041435.tar.gz  webtools.sourceediting-201005041435.tar.xz  webtools.sourceediting-201005041435.zip  nitind14 years
v201005041433webtools.sourceediting-201005041433.tar.gz  webtools.sourceediting-201005041433.tar.xz  webtools.sourceediting-201005041433.zip  nitind14 years
v201004292000webtools.sourceediting-201004292000.tar.gz  webtools.sourceediting-201004292000.tar.xz  webtools.sourceediting-201004292000.zip  nitind14 years
v201004292007webtools.sourceediting-201004292007.tar.gz  webtools.sourceediting-201004292007.tar.xz  webtools.sourceediting-201004292007.zip  nitind14 years
v201004290512webtools.sourceediting-201004290512.tar.gz  webtools.sourceediting-201004290512.tar.xz  webtools.sourceediting-201004290512.zip  nitind14 years
v201004290328webtools.sourceediting-201004290328.tar.gz  webtools.sourceediting-201004290328.tar.xz  webtools.sourceediting-201004290328.zip  nitind14 years
v201004281733webtools.sourceediting-201004281733.tar.gz  webtools.sourceediting-201004281733.tar.xz  webtools.sourceediting-201004281733.zip  nitind14 years
v201004281622webtools.sourceediting-201004281622.tar.gz  webtools.sourceediting-201004281622.tar.xz  webtools.sourceediting-201004281622.zip  nitind14 years
v201004281620webtools.sourceediting-201004281620.tar.gz  webtools.sourceediting-201004281620.tar.xz  webtools.sourceediting-201004281620.zip  nitind14 years
v201004280700webtools.sourceediting-201004280700.tar.gz  webtools.sourceediting-201004280700.tar.xz  webtools.sourceediting-201004280700.zip  nitind14 years
v201004262353webtools.sourceediting-201004262353.tar.gz  webtools.sourceediting-201004262353.tar.xz  webtools.sourceediting-201004262353.zip  nitind14 years
v201004261930webtools.sourceediting-201004261930.tar.gz  webtools.sourceediting-201004261930.tar.xz  webtools.sourceediting-201004261930.zip  nitind14 years
v201004232103webtools.sourceediting-201004232103.tar.gz  webtools.sourceediting-201004232103.tar.xz  webtools.sourceediting-201004232103.zip  nitind14 years
v201004220312webtools.sourceediting-201004220312.tar.gz  webtools.sourceediting-201004220312.tar.xz  webtools.sourceediting-201004220312.zip  nitind14 years
v201004220258webtools.sourceediting-201004220258.tar.gz  webtools.sourceediting-201004220258.tar.xz  webtools.sourceediting-201004220258.zip  nitind14 years
v201004212222webtools.sourceediting-201004212222.tar.gz  webtools.sourceediting-201004212222.tar.xz  webtools.sourceediting-201004212222.zip  nitind14 years
v201004212131webtools.sourceediting-201004212131.tar.gz  webtools.sourceediting-201004212131.tar.xz  webtools.sourceediting-201004212131.zip  nitind14 years
v201004212111webtools.sourceediting-201004212111.tar.gz  webtools.sourceediting-201004212111.tar.xz  webtools.sourceediting-201004212111.zip  nitind14 years
v201004212103webtools.sourceediting-201004212103.tar.gz  webtools.sourceediting-201004212103.tar.xz  webtools.sourceediting-201004212103.zip  nitind14 years
v201004212059webtools.sourceediting-201004212059.tar.gz  webtools.sourceediting-201004212059.tar.xz  webtools.sourceediting-201004212059.zip  nitind14 years
v201004212055webtools.sourceediting-201004212055.tar.gz  webtools.sourceediting-201004212055.tar.xz  webtools.sourceediting-201004212055.zip  nitind14 years
v201004212054webtools.sourceediting-201004212054.tar.gz  webtools.sourceediting-201004212054.tar.xz  webtools.sourceediting-201004212054.zip  nitind14 years
v201004211933webtools.sourceediting-201004211933.tar.gz  webtools.sourceediting-201004211933.tar.xz  webtools.sourceediting-201004211933.zip  nitind14 years
v201004211519webtools.sourceediting-201004211519.tar.gz  webtools.sourceediting-201004211519.tar.xz  webtools.sourceediting-201004211519.zip  nitind14 years
v201004210707webtools.sourceediting-201004210707.tar.gz  webtools.sourceediting-201004210707.tar.xz  webtools.sourceediting-201004210707.zip  nitind14 years
v201004202155webtools.sourceediting-201004202155.tar.gz  webtools.sourceediting-201004202155.tar.xz  webtools.sourceediting-201004202155.zip  nitind14 years
v201004191719webtools.sourceediting-201004191719.tar.gz  webtools.sourceediting-201004191719.tar.xz  webtools.sourceediting-201004191719.zip  nitind14 years
v201004150625webtools.sourceediting-201004150625.tar.gz  webtools.sourceediting-201004150625.tar.xz  webtools.sourceediting-201004150625.zip  nitind14 years
v201004150418webtools.sourceediting-201004150418.tar.gz  webtools.sourceediting-201004150418.tar.xz  webtools.sourceediting-201004150418.zip  nitind14 years
v201004150328webtools.sourceediting-201004150328.tar.gz  webtools.sourceediting-201004150328.tar.xz  webtools.sourceediting-201004150328.zip  nitind14 years
v201004150313webtools.sourceediting-201004150313.tar.gz  webtools.sourceediting-201004150313.tar.xz  webtools.sourceediting-201004150313.zip  nitind14 years
v201004150251webtools.sourceediting-201004150251.tar.gz  webtools.sourceediting-201004150251.tar.xz  webtools.sourceediting-201004150251.zip  nitind14 years
v201004150255webtools.sourceediting-201004150255.tar.gz  webtools.sourceediting-201004150255.tar.xz  webtools.sourceediting-201004150255.zip  nitind14 years
v201004142130webtools.sourceediting-201004142130.tar.gz  webtools.sourceediting-201004142130.tar.xz  webtools.sourceediting-201004142130.zip  nitind14 years
v201004122116webtools.sourceediting-201004122116.tar.gz  webtools.sourceediting-201004122116.tar.xz  webtools.sourceediting-201004122116.zip  nitind14 years
v201004110600webtools.sourceediting-201004110600.tar.gz  webtools.sourceediting-201004110600.tar.xz  webtools.sourceediting-201004110600.zip  nitind14 years
v201004110500webtools.sourceediting-201004110500.tar.gz  webtools.sourceediting-201004110500.tar.xz  webtools.sourceediting-201004110500.zip  nitind14 years
v201005102000webtools.sourceediting-201005102000.tar.gz  webtools.sourceediting-201005102000.tar.xz  webtools.sourceediting-201005102000.zip  nitind14 years
v201004102233webtools.sourceediting-201004102233.tar.gz  webtools.sourceediting-201004102233.tar.xz  webtools.sourceediting-201004102233.zip  nitind14 years
v201004092306webtools.sourceediting-201004092306.tar.gz  webtools.sourceediting-201004092306.tar.xz  webtools.sourceediting-201004092306.zip  nitind14 years
v201004091847webtools.sourceediting-201004091847.tar.gz  webtools.sourceediting-201004091847.tar.xz  webtools.sourceediting-201004091847.zip  nitind14 years
v201004082128webtools.sourceediting-201004082128.tar.gz  webtools.sourceediting-201004082128.tar.xz  webtools.sourceediting-201004082128.zip  nitind14 years
v201004062000webtools.sourceediting-201004062000.tar.gz  webtools.sourceediting-201004062000.tar.xz  webtools.sourceediting-201004062000.zip  nitind14 years
v201004061759webtools.sourceediting-201004061759.tar.gz  webtools.sourceediting-201004061759.tar.xz  webtools.sourceediting-201004061759.zip  nitind14 years
v201004080109webtools.sourceediting-201004080109.tar.gz  webtools.sourceediting-201004080109.tar.xz  webtools.sourceediting-201004080109.zip  nitind14 years
v201004061547webtools.sourceediting-201004061547.tar.gz  webtools.sourceediting-201004061547.tar.xz  webtools.sourceediting-201004061547.zip  nitind14 years
v201004000104webtools.sourceediting-201004000104.tar.gz  webtools.sourceediting-201004000104.tar.xz  webtools.sourceediting-201004000104.zip  nitind14 years
v201004030430webtools.sourceediting-201004030430.tar.gz  webtools.sourceediting-201004030430.tar.xz  webtools.sourceediting-201004030430.zip  nitind14 years
v201004030403webtools.sourceediting-201004030403.tar.gz  webtools.sourceediting-201004030403.tar.xz  webtools.sourceediting-201004030403.zip  nitind14 years
v201004022008webtools.sourceediting-201004022008.tar.gz  webtools.sourceediting-201004022008.tar.xz  webtools.sourceediting-201004022008.zip  nitind14 years
v201004010114webtools.sourceediting-201004010114.tar.gz  webtools.sourceediting-201004010114.tar.xz  webtools.sourceediting-201004010114.zip  nitind14 years
v201003311846webtools.sourceediting-201003311846.tar.gz  webtools.sourceediting-201003311846.tar.xz  webtools.sourceediting-201003311846.zip  nitind14 years
v201003292204webtools.sourceediting-201003292204.tar.gz  webtools.sourceediting-201003292204.tar.xz  webtools.sourceediting-201003292204.zip  nitind14 years
v201003291742webtools.sourceediting-201003291742.tar.gz  webtools.sourceediting-201003291742.tar.xz  webtools.sourceediting-201003291742.zip  nitind14 years
v201003291711webtools.sourceediting-201003291711.tar.gz  webtools.sourceediting-201003291711.tar.xz  webtools.sourceediting-201003291711.zip  nitind14 years
v201003262113webtools.sourceediting-201003262113.tar.gz  webtools.sourceediting-201003262113.tar.xz  webtools.sourceediting-201003262113.zip  nitind14 years
v201003242131webtools.sourceediting-201003242131.tar.gz  webtools.sourceediting-201003242131.tar.xz  webtools.sourceediting-201003242131.zip  nitind14 years
v201003242042webtools.sourceediting-201003242042.tar.gz  webtools.sourceediting-201003242042.tar.xz  webtools.sourceediting-201003242042.zip  nitind15 years
v201003241757webtools.sourceediting-201003241757.tar.gz  webtools.sourceediting-201003241757.tar.xz  webtools.sourceediting-201003241757.zip  nitind15 years
v201003181725webtools.sourceediting-201003181725.tar.gz  webtools.sourceediting-201003181725.tar.xz  webtools.sourceediting-201003181725.zip  david_williams15 years
v201003170515webtools.sourceediting-201003170515.tar.gz  webtools.sourceediting-201003170515.tar.xz  webtools.sourceediting-201003170515.zip  david_williams15 years
v201003170340webtools.sourceediting-201003170340.tar.gz  webtools.sourceediting-201003170340.tar.xz  webtools.sourceediting-201003170340.zip  david_williams15 years
v201003170222webtools.sourceediting-201003170222.tar.gz  webtools.sourceediting-201003170222.tar.xz  webtools.sourceediting-201003170222.zip  nitind15 years
v201003111758webtools.sourceediting-201003111758.tar.gz  webtools.sourceediting-201003111758.tar.xz  webtools.sourceediting-201003111758.zip  nitind15 years
v201003102131webtools.sourceediting-201003102131.tar.gz  webtools.sourceediting-201003102131.tar.xz  webtools.sourceediting-201003102131.zip  nitind15 years
v201003102222webtools.sourceediting-201003102222.tar.gz  webtools.sourceediting-201003102222.tar.xz  webtools.sourceediting-201003102222.zip  nitind15 years
v201003092337webtools.sourceediting-201003092337.tar.gz  webtools.sourceediting-201003092337.tar.xz  webtools.sourceediting-201003092337.zip  nitind15 years
v201003092125webtools.sourceediting-201003092125.tar.gz  webtools.sourceediting-201003092125.tar.xz  webtools.sourceediting-201003092125.zip  nitind15 years
v201003082046webtools.sourceediting-201003082046.tar.gz  webtools.sourceediting-201003082046.tar.xz  webtools.sourceediting-201003082046.zip  nitind15 years
v201003081913webtools.sourceediting-201003081913.tar.gz  webtools.sourceediting-201003081913.tar.xz  webtools.sourceediting-201003081913.zip  nitind15 years
v201003070245webtools.sourceediting-201003070245.tar.gz  webtools.sourceediting-201003070245.tar.xz  webtools.sourceediting-201003070245.zip  nitind15 years
v201003052050webtools.sourceediting-201003052050.tar.gz  webtools.sourceediting-201003052050.tar.xz  webtools.sourceediting-201003052050.zip  nitind15 years
v201003051650webtools.sourceediting-201003051650.tar.gz  webtools.sourceediting-201003051650.tar.xz  webtools.sourceediting-201003051650.zip  nitind15 years
v201003051621webtools.sourceediting-201003051621.tar.gz  webtools.sourceediting-201003051621.tar.xz  webtools.sourceediting-201003051621.zip  nitind15 years
v201003050440webtools.sourceediting-201003050440.tar.gz  webtools.sourceediting-201003050440.tar.xz  webtools.sourceediting-201003050440.zip  nitind15 years
v201003041650webtools.sourceediting-201003041650.tar.gz  webtools.sourceediting-201003041650.tar.xz  webtools.sourceediting-201003041650.zip  nitind15 years
v201003040540webtools.sourceediting-201003040540.tar.gz  webtools.sourceediting-201003040540.tar.xz  webtools.sourceediting-201003040540.zip  nitind15 years
v201003040746webtools.sourceediting-201003040746.tar.gz  webtools.sourceediting-201003040746.tar.xz  webtools.sourceediting-201003040746.zip  nitind15 years
v201003040339webtools.sourceediting-201003040339.tar.gz  webtools.sourceediting-201003040339.tar.xz  webtools.sourceediting-201003040339.zip  nitind15 years
v201003031644webtools.sourceediting-201003031644.tar.gz  webtools.sourceediting-201003031644.tar.xz  webtools.sourceediting-201003031644.zip  nitind15 years
v201003022307webtools.sourceediting-201003022307.tar.gz  webtools.sourceediting-201003022307.tar.xz  webtools.sourceediting-201003022307.zip  nitind15 years
v201003022107webtools.sourceediting-201003022107.tar.gz  webtools.sourceediting-201003022107.tar.xz  webtools.sourceediting-201003022107.zip  nitind15 years
v201003021839webtools.sourceediting-201003021839.tar.gz  webtools.sourceediting-201003021839.tar.xz  webtools.sourceediting-201003021839.zip  nitind15 years
v201003012345webtools.sourceediting-201003012345.tar.gz  webtools.sourceediting-201003012345.tar.xz  webtools.sourceediting-201003012345.zip  nitind15 years
v201002262235webtools.sourceediting-201002262235.tar.gz  webtools.sourceediting-201002262235.tar.xz  webtools.sourceediting-201002262235.zip  nitind15 years
v201002262219webtools.sourceediting-201002262219.tar.gz  webtools.sourceediting-201002262219.tar.xz  webtools.sourceediting-201002262219.zip  nitind15 years
v201002262205webtools.sourceediting-201002262205.tar.gz  webtools.sourceediting-201002262205.tar.xz  webtools.sourceediting-201002262205.zip  nitind15 years
v201002262156webtools.sourceediting-201002262156.tar.gz  webtools.sourceediting-201002262156.tar.xz  webtools.sourceediting-201002262156.zip  nitind15 years
v201002262124webtools.sourceediting-201002262124.tar.gz  webtools.sourceediting-201002262124.tar.xz  webtools.sourceediting-201002262124.zip  nitind15 years
v201002262121webtools.sourceediting-201002262121.tar.gz  webtools.sourceediting-201002262121.tar.xz  webtools.sourceediting-201002262121.zip  nitind15 years
v201002241841webtools.sourceediting-201002241841.tar.gz  webtools.sourceediting-201002241841.tar.xz  webtools.sourceediting-201002241841.zip  nitind15 years
v201002232029webtools.sourceediting-201002232029.tar.gz  webtools.sourceediting-201002232029.tar.xz  webtools.sourceediting-201002232029.zip  nitind15 years
v201002232025webtools.sourceediting-201002232025.tar.gz  webtools.sourceediting-201002232025.tar.xz  webtools.sourceediting-201002232025.zip  nitind15 years
v201002230645webtools.sourceediting-201002230645.tar.gz  webtools.sourceediting-201002230645.tar.xz  webtools.sourceediting-201002230645.zip  nitind15 years
v201002222138webtools.sourceediting-201002222138.tar.gz  webtools.sourceediting-201002222138.tar.xz  webtools.sourceediting-201002222138.zip  nitind15 years
v201002222100webtools.sourceediting-201002222100.tar.gz  webtools.sourceediting-201002222100.tar.xz  webtools.sourceediting-201002222100.zip  nitind15 years
v201002222020webtools.sourceediting-201002222020.tar.gz  webtools.sourceediting-201002222020.tar.xz  webtools.sourceediting-201002222020.zip  nitind15 years
v201002180732webtools.sourceediting-201002180732.tar.gz  webtools.sourceediting-201002180732.tar.xz  webtools.sourceediting-201002180732.zip  nitind15 years
v201002180530webtools.sourceediting-201002180530.tar.gz  webtools.sourceediting-201002180530.tar.xz  webtools.sourceediting-201002180530.zip  nitind15 years
v201002180600webtools.sourceediting-201002180600.tar.gz  webtools.sourceediting-201002180600.tar.xz  webtools.sourceediting-201002180600.zip  nitind15 years
v201002171157webtools.sourceediting-201002171157.tar.gz  webtools.sourceediting-201002171157.tar.xz  webtools.sourceediting-201002171157.zip  nitind15 years
v201002172056webtools.sourceediting-201002172056.tar.gz  webtools.sourceediting-201002172056.tar.xz  webtools.sourceediting-201002172056.zip  nitind15 years
v201002172002webtools.sourceediting-201002172002.tar.gz  webtools.sourceediting-201002172002.tar.xz  webtools.sourceediting-201002172002.zip  nitind15 years
v201002162050webtools.sourceediting-201002162050.tar.gz  webtools.sourceediting-201002162050.tar.xz  webtools.sourceediting-201002162050.zip  nitind15 years
v201002162030webtools.sourceediting-201002162030.tar.gz  webtools.sourceediting-201002162030.tar.xz  webtools.sourceediting-201002162030.zip  nitind15 years
v201002100221webtools.sourceediting-201002100221.tar.gz  webtools.sourceediting-201002100221.tar.xz  webtools.sourceediting-201002100221.zip  nitind15 years
v201002092225webtools.sourceediting-201002092225.tar.gz  webtools.sourceediting-201002092225.tar.xz  webtools.sourceediting-201002092225.zip  nitind15 years
v201002091858webtools.sourceediting-201002091858.tar.gz  webtools.sourceediting-201002091858.tar.xz  webtools.sourceediting-201002091858.zip  nitind15 years
v201002050507webtools.sourceediting-201002050507.tar.gz  webtools.sourceediting-201002050507.tar.xz  webtools.sourceediting-201002050507.zip  nitind15 years
v201002042121webtools.sourceediting-201002042121.tar.gz  webtools.sourceediting-201002042121.tar.xz  webtools.sourceediting-201002042121.zip  nitind15 years
v201002031606webtools.sourceediting-201002031606.tar.gz  webtools.sourceediting-201002031606.tar.xz  webtools.sourceediting-201002031606.zip  nitind15 years
v201002012015webtools.sourceediting-201002012015.tar.gz  webtools.sourceediting-201002012015.tar.xz  webtools.sourceediting-201002012015.zip  nitind15 years
v201001282004webtools.sourceediting-201001282004.tar.gz  webtools.sourceediting-201001282004.tar.xz  webtools.sourceediting-201001282004.zip  nitind15 years
v201001270045webtools.sourceediting-201001270045.tar.gz  webtools.sourceediting-201001270045.tar.xz  webtools.sourceediting-201001270045.zip  nitind15 years
R3_1_2webtools.sourceediting-R3_1_2.tar.gz  webtools.sourceediting-R3_1_2.tar.xz  webtools.sourceediting-R3_1_2.zip  nitind15 years
v2010012803webtools.sourceediting-2010012803.tar.gz  webtools.sourceediting-2010012803.tar.xz  webtools.sourceediting-2010012803.zip  nitind15 years
v201001262330webtools.sourceediting-201001262330.tar.gz  webtools.sourceediting-201001262330.tar.xz  webtools.sourceediting-201001262330.zip  nitind15 years
v201001252222webtools.sourceediting-201001252222.tar.gz  webtools.sourceediting-201001252222.tar.xz  webtools.sourceediting-201001252222.zip  nitind15 years
v201001251516webtools.sourceediting-201001251516.tar.gz  webtools.sourceediting-201001251516.tar.xz  webtools.sourceediting-201001251516.zip  nitind15 years
v201001261446webtools.sourceediting-201001261446.tar.gz  webtools.sourceediting-201001261446.tar.xz  webtools.sourceediting-201001261446.zip  nitind15 years
v201001222130webtools.sourceediting-201001222130.tar.gz  webtools.sourceediting-201001222130.tar.xz  webtools.sourceediting-201001222130.zip  nitind15 years
v201001220717webtools.sourceediting-201001220717.tar.gz  webtools.sourceediting-201001220717.tar.xz  webtools.sourceediting-201001220717.zip  nitind15 years
v201001211817webtools.sourceediting-201001211817.tar.gz  webtools.sourceediting-201001211817.tar.xz  webtools.sourceediting-201001211817.zip  nitind15 years
v201001202222webtools.sourceediting-201001202222.tar.gz  webtools.sourceediting-201001202222.tar.xz  webtools.sourceediting-201001202222.zip  nitind15 years
v201001202054webtools.sourceediting-201001202054.tar.gz  webtools.sourceediting-201001202054.tar.xz  webtools.sourceediting-201001202054.zip  nitind15 years
v201001200346webtools.sourceediting-201001200346.tar.gz  webtools.sourceediting-201001200346.tar.xz  webtools.sourceediting-201001200346.zip  nitind15 years
v201001192219webtools.sourceediting-201001192219.tar.gz  webtools.sourceediting-201001192219.tar.xz  webtools.sourceediting-201001192219.zip  nitind15 years
v201001192024webtools.sourceediting-201001192024.tar.gz  webtools.sourceediting-201001192024.tar.xz  webtools.sourceediting-201001192024.zip  nitind15 years
v201001192004webtools.sourceediting-201001192004.tar.gz  webtools.sourceediting-201001192004.tar.xz  webtools.sourceediting-201001192004.zip  nitind15 years
v201001182314webtools.sourceediting-201001182314.tar.gz  webtools.sourceediting-201001182314.tar.xz  webtools.sourceediting-201001182314.zip  nitind15 years
v201001132032webtools.sourceediting-201001132032.tar.gz  webtools.sourceediting-201001132032.tar.xz  webtools.sourceediting-201001132032.zip  nitind15 years
v201001131955webtools.sourceediting-201001131955.tar.gz  webtools.sourceediting-201001131955.tar.xz  webtools.sourceediting-201001131955.zip  nitind15 years
v201001122114webtools.sourceediting-201001122114.tar.gz  webtools.sourceediting-201001122114.tar.xz  webtools.sourceediting-201001122114.zip  nitind15 years
v201001111655webtools.sourceediting-201001111655.tar.gz  webtools.sourceediting-201001111655.tar.xz  webtools.sourceediting-201001111655.zip  nitind15 years
v201001110212webtools.sourceediting-201001110212.tar.gz  webtools.sourceediting-201001110212.tar.xz  webtools.sourceediting-201001110212.zip  nitind15 years
v201001110207webtools.sourceediting-201001110207.tar.gz  webtools.sourceediting-201001110207.tar.xz  webtools.sourceediting-201001110207.zip  nitind15 years
v201001110015webtools.sourceediting-201001110015.tar.gz  webtools.sourceediting-201001110015.tar.xz  webtools.sourceediting-201001110015.zip  nitind15 years
v201001110014webtools.sourceediting-201001110014.tar.gz  webtools.sourceediting-201001110014.tar.xz  webtools.sourceediting-201001110014.zip  nitind15 years
v201001080612webtools.sourceediting-201001080612.tar.gz  webtools.sourceediting-201001080612.tar.xz  webtools.sourceediting-201001080612.zip  nitind15 years
v201001140312webtools.sourceediting-201001140312.tar.gz  webtools.sourceediting-201001140312.tar.xz  webtools.sourceediting-201001140312.zip  nitind15 years
v200912212007webtools.sourceediting-200912212007.tar.gz  webtools.sourceediting-200912212007.tar.xz  webtools.sourceediting-200912212007.zip  nitind15 years
v200912170622webtools.sourceediting-200912170622.tar.gz  webtools.sourceediting-200912170622.tar.xz  webtools.sourceediting-200912170622.zip  nitind15 years
v200912082108webtools.sourceediting-200912082108.tar.gz  webtools.sourceediting-200912082108.tar.xz  webtools.sourceediting-200912082108.zip  nitind15 years
v200912082014webtools.sourceediting-200912082014.tar.gz  webtools.sourceediting-200912082014.tar.xz  webtools.sourceediting-200912082014.zip  nitind15 years
v201002230224webtools.sourceediting-201002230224.tar.gz  webtools.sourceediting-201002230224.tar.xz  webtools.sourceediting-201002230224.zip  nitind15 years
v200912071517webtools.sourceediting-200912071517.tar.gz  webtools.sourceediting-200912071517.tar.xz  webtools.sourceediting-200912071517.zip  nitind15 years
v201001221931webtools.sourceediting-201001221931.tar.gz  webtools.sourceediting-201001221931.tar.xz  webtools.sourceediting-201001221931.zip  nitind15 years
v200912030320webtools.sourceediting-200912030320.tar.gz  webtools.sourceediting-200912030320.tar.xz  webtools.sourceediting-200912030320.zip  nitind15 years
v200912022353webtools.sourceediting-200912022353.tar.gz  webtools.sourceediting-200912022353.tar.xz  webtools.sourceediting-200912022353.zip  nitind15 years
v200912021535webtools.sourceediting-200912021535.tar.gz  webtools.sourceediting-200912021535.tar.xz  webtools.sourceediting-200912021535.zip  nitind15 years
v200912012217webtools.sourceediting-200912012217.tar.gz  webtools.sourceediting-200912012217.tar.xz  webtools.sourceediting-200912012217.zip  nitind15 years
v200911302232webtools.sourceediting-200911302232.tar.gz  webtools.sourceediting-200911302232.tar.xz  webtools.sourceediting-200911302232.zip  nitind15 years
v200911302150webtools.sourceediting-200911302150.tar.gz  webtools.sourceediting-200911302150.tar.xz  webtools.sourceediting-200911302150.zip  nitind15 years
v200911251936webtools.sourceediting-200911251936.tar.gz  webtools.sourceediting-200911251936.tar.xz  webtools.sourceediting-200911251936.zip  nitind15 years
v200911302206webtools.sourceediting-200911302206.tar.gz  webtools.sourceediting-200911302206.tar.xz  webtools.sourceediting-200911302206.zip  nitind15 years
v200911201641webtools.sourceediting-200911201641.tar.gz  webtools.sourceediting-200911201641.tar.xz  webtools.sourceediting-200911201641.zip  nitind15 years
v200911182203webtools.sourceediting-200911182203.tar.gz  webtools.sourceediting-200911182203.tar.xz  webtools.sourceediting-200911182203.zip  nitind15 years
v200911162115webtools.sourceediting-200911162115.tar.gz  webtools.sourceediting-200911162115.tar.xz  webtools.sourceediting-200911162115.zip  nitind15 years
v200911162023webtools.sourceediting-200911162023.tar.gz  webtools.sourceediting-200911162023.tar.xz  webtools.sourceediting-200911162023.zip  nitind15 years
v200911162000webtools.sourceediting-200911162000.tar.gz  webtools.sourceediting-200911162000.tar.xz  webtools.sourceediting-200911162000.zip  nitind15 years
v200911160530webtools.sourceediting-200911160530.tar.gz  webtools.sourceediting-200911160530.tar.xz  webtools.sourceediting-200911160530.zip  nitind15 years
v200911120546webtools.sourceediting-200911120546.tar.gz  webtools.sourceediting-200911120546.tar.xz  webtools.sourceediting-200911120546.zip  nitind15 years
v200911122113webtools.sourceediting-200911122113.tar.gz  webtools.sourceediting-200911122113.tar.xz  webtools.sourceediting-200911122113.zip  nitind15 years
v200911112108webtools.sourceediting-200911112108.tar.gz  webtools.sourceediting-200911112108.tar.xz  webtools.sourceediting-200911112108.zip  nitind15 years
v200911112046webtools.sourceediting-200911112046.tar.gz  webtools.sourceediting-200911112046.tar.xz  webtools.sourceediting-200911112046.zip  nitind15 years
v200911050716webtools.sourceediting-200911050716.tar.gz  webtools.sourceediting-200911050716.tar.xz  webtools.sourceediting-200911050716.zip  nitind15 years
v200910300213webtools.sourceediting-200910300213.tar.gz  webtools.sourceediting-200910300213.tar.xz  webtools.sourceediting-200910300213.zip  nitind15 years
v200910291754webtools.sourceediting-200910291754.tar.gz  webtools.sourceediting-200910291754.tar.xz  webtools.sourceediting-200910291754.zip  nitind15 years
v200910281925webtools.sourceediting-200910281925.tar.gz  webtools.sourceediting-200910281925.tar.xz  webtools.sourceediting-200910281925.zip  nitind15 years
v200910272050webtools.sourceediting-200910272050.tar.gz  webtools.sourceediting-200910272050.tar.xz  webtools.sourceediting-200910272050.zip  nitind15 years
v200910271723webtools.sourceediting-200910271723.tar.gz  webtools.sourceediting-200910271723.tar.xz  webtools.sourceediting-200910271723.zip  nitind15 years
v200910221446webtools.sourceediting-200910221446.tar.gz  webtools.sourceediting-200910221446.tar.xz  webtools.sourceediting-200910221446.zip  nitind15 years
v200910212138webtools.sourceediting-200910212138.tar.gz  webtools.sourceediting-200910212138.tar.xz  webtools.sourceediting-200910212138.zip  nitind15 years
v200910202110webtools.sourceediting-200910202110.tar.gz  webtools.sourceediting-200910202110.tar.xz  webtools.sourceediting-200910202110.zip  nitind15 years
v200910202024webtools.sourceediting-200910202024.tar.gz  webtools.sourceediting-200910202024.tar.xz  webtools.sourceediting-200910202024.zip  nitind15 years
v200910201929webtools.sourceediting-200910201929.tar.gz  webtools.sourceediting-200910201929.tar.xz  webtools.sourceediting-200910201929.zip  nitind15 years
v200910200227webtools.sourceediting-200910200227.tar.gz  webtools.sourceediting-200910200227.tar.xz  webtools.sourceediting-200910200227.zip  nitind15 years
v200910161534webtools.sourceediting-200910161534.tar.gz  webtools.sourceediting-200910161534.tar.xz  webtools.sourceediting-200910161534.zip  nitind15 years
v200910161438webtools.sourceediting-200910161438.tar.gz  webtools.sourceediting-200910161438.tar.xz  webtools.sourceediting-200910161438.zip  nitind15 years
v200910161432webtools.sourceediting-200910161432.tar.gz  webtools.sourceediting-200910161432.tar.xz  webtools.sourceediting-200910161432.zip  nitind15 years
v200910152250webtools.sourceediting-200910152250.tar.gz  webtools.sourceediting-200910152250.tar.xz  webtools.sourceediting-200910152250.zip  nitind15 years
v200910142337webtools.sourceediting-200910142337.tar.gz  webtools.sourceediting-200910142337.tar.xz  webtools.sourceediting-200910142337.zip  nitind15 years
v200910142331webtools.sourceediting-200910142331.tar.gz  webtools.sourceediting-200910142331.tar.xz  webtools.sourceediting-200910142331.zip  nitind15 years
v200910132135webtools.sourceediting-200910132135.tar.gz  webtools.sourceediting-200910132135.tar.xz  webtools.sourceediting-200910132135.zip  nitind15 years
v200910131904webtools.sourceediting-200910131904.tar.gz  webtools.sourceediting-200910131904.tar.xz  webtools.sourceediting-200910131904.zip  nitind15 years
v200910131817webtools.sourceediting-200910131817.tar.gz  webtools.sourceediting-200910131817.tar.xz  webtools.sourceediting-200910131817.zip  nitind15 years
v200910121719webtools.sourceediting-200910121719.tar.gz  webtools.sourceediting-200910121719.tar.xz  webtools.sourceediting-200910121719.zip  nitind15 years
v200910121457webtools.sourceediting-200910121457.tar.gz  webtools.sourceediting-200910121457.tar.xz  webtools.sourceediting-200910121457.zip  nitind15 years
v200910121445webtools.sourceediting-200910121445.tar.gz  webtools.sourceediting-200910121445.tar.xz  webtools.sourceediting-200910121445.zip  nitind15 years
v200910091841webtools.sourceediting-200910091841.tar.gz  webtools.sourceediting-200910091841.tar.xz  webtools.sourceediting-200910091841.zip  nitind15 years
v200910060534webtools.sourceediting-200910060534.tar.gz  webtools.sourceediting-200910060534.tar.xz  webtools.sourceediting-200910060534.zip  nitind15 years
v200910060730webtools.sourceediting-200910060730.tar.gz  webtools.sourceediting-200910060730.tar.xz  webtools.sourceediting-200910060730.zip  nitind15 years
Root_R3_1_2_patcheswebtools.sourceediting-Root_R3_1_2_patches.tar.gz  webtools.sourceediting-Root_R3_1_2_patches.tar.xz  webtools.sourceediting-Root_R3_1_2_patches.zip  nitind15 years
v200910051533webtools.sourceediting-200910051533.tar.gz  webtools.sourceediting-200910051533.tar.xz  webtools.sourceediting-200910051533.zip  nitind15 years
v200910011120webtools.sourceediting-200910011120.tar.gz  webtools.sourceediting-200910011120.tar.xz  webtools.sourceediting-200910011120.zip  nitind15 years
v200909301948webtools.sourceediting-200909301948.tar.gz  webtools.sourceediting-200909301948.tar.xz  webtools.sourceediting-200909301948.zip  nitind15 years
v200909281930webtools.sourceediting-200909281930.tar.gz  webtools.sourceediting-200909281930.tar.xz  webtools.sourceediting-200909281930.zip  nitind15 years
v200909221403webtools.sourceediting-200909221403.tar.gz  webtools.sourceediting-200909221403.tar.xz  webtools.sourceediting-200909221403.zip  nitind15 years
v200909180415webtools.sourceediting-200909180415.tar.gz  webtools.sourceediting-200909180415.tar.xz  webtools.sourceediting-200909180415.zip  nitind15 years
v200909172215webtools.sourceediting-200909172215.tar.gz  webtools.sourceediting-200909172215.tar.xz  webtools.sourceediting-200909172215.zip  nitind15 years
R3_1_1webtools.sourceediting-R3_1_1.tar.gz  webtools.sourceediting-R3_1_1.tar.xz  webtools.sourceediting-R3_1_1.zip  nitind15 years
v200909170506webtools.sourceediting-200909170506.tar.gz  webtools.sourceediting-200909170506.tar.xz  webtools.sourceediting-200909170506.zip  nitind15 years
v200909162206webtools.sourceediting-200909162206.tar.gz  webtools.sourceediting-200909162206.tar.xz  webtools.sourceediting-200909162206.zip  nitind15 years
v200909162156webtools.sourceediting-200909162156.tar.gz  webtools.sourceediting-200909162156.tar.xz  webtools.sourceediting-200909162156.zip  nitind15 years
v200909160651webtools.sourceediting-200909160651.tar.gz  webtools.sourceediting-200909160651.tar.xz  webtools.sourceediting-200909160651.zip  nitind15 years
v200909140645webtools.sourceediting-200909140645.tar.gz  webtools.sourceediting-200909140645.tar.xz  webtools.sourceediting-200909140645.zip  nitind15 years
v200909092250webtools.sourceediting-200909092250.tar.gz  webtools.sourceediting-200909092250.tar.xz  webtools.sourceediting-200909092250.zip  nitind15 years
v200909092207webtools.sourceediting-200909092207.tar.gz  webtools.sourceediting-200909092207.tar.xz  webtools.sourceediting-200909092207.zip  nitind15 years
v200909092042webtools.sourceediting-200909092042.tar.gz  webtools.sourceediting-200909092042.tar.xz  webtools.sourceediting-200909092042.zip  nitind15 years
v200909090450webtools.sourceediting-200909090450.tar.gz  webtools.sourceediting-200909090450.tar.xz  webtools.sourceediting-200909090450.zip  nitind15 years
v200909030027webtools.sourceediting-200909030027.tar.gz  webtools.sourceediting-200909030027.tar.xz  webtools.sourceediting-200909030027.zip  nitind15 years
v200909021538webtools.sourceediting-200909021538.tar.gz  webtools.sourceediting-200909021538.tar.xz  webtools.sourceediting-200909021538.zip  nitind15 years
v200909021537webtools.sourceediting-200909021537.tar.gz  webtools.sourceediting-200909021537.tar.xz  webtools.sourceediting-200909021537.zip  nitind15 years
v200909011338webtools.sourceediting-200909011338.tar.gz  webtools.sourceediting-200909011338.tar.xz  webtools.sourceediting-200909011338.zip  nitind15 years
v200909011328webtools.sourceediting-200909011328.tar.gz  webtools.sourceediting-200909011328.tar.xz  webtools.sourceediting-200909011328.zip  nitind15 years
v200908280526webtools.sourceediting-200908280526.tar.gz  webtools.sourceediting-200908280526.tar.xz  webtools.sourceediting-200908280526.zip  nitind15 years
v200908262053webtools.sourceediting-200908262053.tar.gz  webtools.sourceediting-200908262053.tar.xz  webtools.sourceediting-200908262053.zip  nitind15 years
v200908261807webtools.sourceediting-200908261807.tar.gz  webtools.sourceediting-200908261807.tar.xz  webtools.sourceediting-200908261807.zip  nitind15 years
v200908261758webtools.sourceediting-200908261758.tar.gz  webtools.sourceediting-200908261758.tar.xz  webtools.sourceediting-200908261758.zip  nitind15 years
v200908252235webtools.sourceediting-200908252235.tar.gz  webtools.sourceediting-200908252235.tar.xz  webtools.sourceediting-200908252235.zip  nitind15 years
v200908242145webtools.sourceediting-200908242145.tar.gz  webtools.sourceediting-200908242145.tar.xz  webtools.sourceediting-200908242145.zip  nitind15 years
v200908241726webtools.sourceediting-200908241726.tar.gz  webtools.sourceediting-200908241726.tar.xz  webtools.sourceediting-200908241726.zip  nitind15 years
v200908241601webtools.sourceediting-200908241601.tar.gz  webtools.sourceediting-200908241601.tar.xz  webtools.sourceediting-200908241601.zip  nitind15 years
v200908241513webtools.sourceediting-200908241513.tar.gz  webtools.sourceediting-200908241513.tar.xz  webtools.sourceediting-200908241513.zip  nitind15 years
v200908241426webtools.sourceediting-200908241426.tar.gz  webtools.sourceediting-200908241426.tar.xz  webtools.sourceediting-200908241426.zip  nitind15 years
v200908240124webtools.sourceediting-200908240124.tar.gz  webtools.sourceediting-200908240124.tar.xz  webtools.sourceediting-200908240124.zip  nitind15 years
v200908211943webtools.sourceediting-200908211943.tar.gz  webtools.sourceediting-200908211943.tar.xz  webtools.sourceediting-200908211943.zip  nitind15 years
v200908202355webtools.sourceediting-200908202355.tar.gz  webtools.sourceediting-200908202355.tar.xz  webtools.sourceediting-200908202355.zip  nitind15 years
v200908181539webtools.sourceediting-200908181539.tar.gz  webtools.sourceediting-200908181539.tar.xz  webtools.sourceediting-200908181539.zip  nitind15 years
v200908171701webtools.sourceediting-200908171701.tar.gz  webtools.sourceediting-200908171701.tar.xz  webtools.sourceediting-200908171701.zip  nitind15 years
v200908242115webtools.sourceediting-200908242115.tar.gz  webtools.sourceediting-200908242115.tar.xz  webtools.sourceediting-200908242115.zip  nitind15 years
v200908171553webtools.sourceediting-200908171553.tar.gz  webtools.sourceediting-200908171553.tar.xz  webtools.sourceediting-200908171553.zip  nitind15 years
v200908141706webtools.sourceediting-200908141706.tar.gz  webtools.sourceediting-200908141706.tar.xz  webtools.sourceediting-200908141706.zip  nitind15 years
v200908140232webtools.sourceediting-200908140232.tar.gz  webtools.sourceediting-200908140232.tar.xz  webtools.sourceediting-200908140232.zip  nitind15 years
v200908111935webtools.sourceediting-200908111935.tar.gz  webtools.sourceediting-200908111935.tar.xz  webtools.sourceediting-200908111935.zip  nitind15 years
v200908120400webtools.sourceediting-200908120400.tar.gz  webtools.sourceediting-200908120400.tar.xz  webtools.sourceediting-200908120400.zip  nitind15 years
v200908102056webtools.sourceediting-200908102056.tar.gz  webtools.sourceediting-200908102056.tar.xz  webtools.sourceediting-200908102056.zip  nitind15 years
v200908102054webtools.sourceediting-200908102054.tar.gz  webtools.sourceediting-200908102054.tar.xz  webtools.sourceediting-200908102054.zip  nitind15 years
v200908121636webtools.sourceediting-200908121636.tar.gz  webtools.sourceediting-200908121636.tar.xz  webtools.sourceediting-200908121636.zip  nitind15 years
v200908101458webtools.sourceediting-200908101458.tar.gz  webtools.sourceediting-200908101458.tar.xz  webtools.sourceediting-200908101458.zip  nitind15 years
v200908101452webtools.sourceediting-200908101452.tar.gz  webtools.sourceediting-200908101452.tar.xz  webtools.sourceediting-200908101452.zip  nitind15 years
v200908070030webtools.sourceediting-200908070030.tar.gz  webtools.sourceediting-200908070030.tar.xz  webtools.sourceediting-200908070030.zip  nitind15 years
v200908031823webtools.sourceediting-200908031823.tar.gz  webtools.sourceediting-200908031823.tar.xz  webtools.sourceediting-200908031823.zip  nitind15 years
v200908031807webtools.sourceediting-200908031807.tar.gz  webtools.sourceediting-200908031807.tar.xz  webtools.sourceediting-200908031807.zip  nitind15 years
v200908031759webtools.sourceediting-200908031759.tar.gz  webtools.sourceediting-200908031759.tar.xz  webtools.sourceediting-200908031759.zip  nitind15 years
v200908031747webtools.sourceediting-200908031747.tar.gz  webtools.sourceediting-200908031747.tar.xz  webtools.sourceediting-200908031747.zip  nitind15 years
v200908041451webtools.sourceediting-200908041451.tar.gz  webtools.sourceediting-200908041451.tar.xz  webtools.sourceediting-200908041451.zip  nitind15 years
v200908030810webtools.sourceediting-200908030810.tar.gz  webtools.sourceediting-200908030810.tar.xz  webtools.sourceediting-200908030810.zip  nitind15 years
v200907312033webtools.sourceediting-200907312033.tar.gz  webtools.sourceediting-200907312033.tar.xz  webtools.sourceediting-200907312033.zip  nitind15 years
v200907281549webtools.sourceediting-200907281549.tar.gz  webtools.sourceediting-200907281549.tar.xz  webtools.sourceediting-200907281549.zip  nitind15 years
v200907291435webtools.sourceediting-200907291435.tar.gz  webtools.sourceediting-200907291435.tar.xz  webtools.sourceediting-200907291435.zip  nitind15 years
v200907231323webtools.sourceediting-200907231323.tar.gz  webtools.sourceediting-200907231323.tar.xz  webtools.sourceediting-200907231323.zip  nitind15 years
v200907222213webtools.sourceediting-200907222213.tar.gz  webtools.sourceediting-200907222213.tar.xz  webtools.sourceediting-200907222213.zip  nitind15 years
v200907222205webtools.sourceediting-200907222205.tar.gz  webtools.sourceediting-200907222205.tar.xz  webtools.sourceediting-200907222205.zip  nitind15 years
v200907230542webtools.sourceediting-200907230542.tar.gz  webtools.sourceediting-200907230542.tar.xz  webtools.sourceediting-200907230542.zip  nitind15 years
v200907222105webtools.sourceediting-200907222105.tar.gz  webtools.sourceediting-200907222105.tar.xz  webtools.sourceediting-200907222105.zip  nitind15 years
v200907201747webtools.sourceediting-200907201747.tar.gz  webtools.sourceediting-200907201747.tar.xz  webtools.sourceediting-200907201747.zip  nitind15 years
v200907180416webtools.sourceediting-200907180416.tar.gz  webtools.sourceediting-200907180416.tar.xz  webtools.sourceediting-200907180416.zip  nitind15 years
v200907171535webtools.sourceediting-200907171535.tar.gz  webtools.sourceediting-200907171535.tar.xz  webtools.sourceediting-200907171535.zip  nitind15 years
v200907171517webtools.sourceediting-200907171517.tar.gz  webtools.sourceediting-200907171517.tar.xz  webtools.sourceediting-200907171517.zip  nitind15 years
v200907171458webtools.sourceediting-200907171458.tar.gz  webtools.sourceediting-200907171458.tar.xz  webtools.sourceediting-200907171458.zip  nitind15 years
v200907171457webtools.sourceediting-200907171457.tar.gz  webtools.sourceediting-200907171457.tar.xz  webtools.sourceediting-200907171457.zip  nitind15 years
v200907170515webtools.sourceediting-200907170515.tar.gz  webtools.sourceediting-200907170515.tar.xz  webtools.sourceediting-200907170515.zip  nitind15 years
v200907160530webtools.sourceediting-200907160530.tar.gz  webtools.sourceediting-200907160530.tar.xz  webtools.sourceediting-200907160530.zip  nitind15 years
v200907161031webtools.sourceediting-200907161031.tar.gz  webtools.sourceediting-200907161031.tar.xz  webtools.sourceediting-200907161031.zip  nitind15 years
v200907151837webtools.sourceediting-200907151837.tar.gz  webtools.sourceediting-200907151837.tar.xz  webtools.sourceediting-200907151837.zip  nitind15 years
v200907102020webtools.sourceediting-200907102020.tar.gz  webtools.sourceediting-200907102020.tar.xz  webtools.sourceediting-200907102020.zip  nitind15 years
v200907091742webtools.sourceediting-200907091742.tar.gz  webtools.sourceediting-200907091742.tar.xz  webtools.sourceediting-200907091742.zip  nitind15 years
v200907081731webtools.sourceediting-200907081731.tar.gz  webtools.sourceediting-200907081731.tar.xz  webtools.sourceediting-200907081731.zip  nitind15 years
v200907081719webtools.sourceediting-200907081719.tar.gz  webtools.sourceediting-200907081719.tar.xz  webtools.sourceediting-200907081719.zip  nitind15 years
v200907072039webtools.sourceediting-200907072039.tar.gz  webtools.sourceediting-200907072039.tar.xz  webtools.sourceediting-200907072039.zip  nitind15 years
v200907061846webtools.sourceediting-200907061846.tar.gz  webtools.sourceediting-200907061846.tar.xz  webtools.sourceediting-200907061846.zip  nitind15 years
v200907061900webtools.sourceediting-200907061900.tar.gz  webtools.sourceediting-200907061900.tar.xz  webtools.sourceediting-200907061900.zip  nitind15 years
v200907061825webtools.sourceediting-200907061825.tar.gz  webtools.sourceediting-200907061825.tar.xz  webtools.sourceediting-200907061825.zip  nitind15 years
v200907011339webtools.sourceediting-200907011339.tar.gz  webtools.sourceediting-200907011339.tar.xz  webtools.sourceediting-200907011339.zip  nitind15 years
v200907010422webtools.sourceediting-200907010422.tar.gz  webtools.sourceediting-200907010422.tar.xz  webtools.sourceediting-200907010422.zip  nitind15 years
v200906300116webtools.sourceediting-200906300116.tar.gz  webtools.sourceediting-200906300116.tar.xz  webtools.sourceediting-200906300116.zip  nitind15 years
v200906300123webtools.sourceediting-200906300123.tar.gz  webtools.sourceediting-200906300123.tar.xz  webtools.sourceediting-200906300123.zip  nitind15 years
v200906292300webtools.sourceediting-200906292300.tar.gz  webtools.sourceediting-200906292300.tar.xz  webtools.sourceediting-200906292300.zip  nitind15 years
v200906300230webtools.sourceediting-200906300230.tar.gz  webtools.sourceediting-200906300230.tar.xz  webtools.sourceediting-200906300230.zip  nitind15 years
v200906291814webtools.sourceediting-200906291814.tar.gz  webtools.sourceediting-200906291814.tar.xz  webtools.sourceediting-200906291814.zip  nitind15 years
v200906291748webtools.sourceediting-200906291748.tar.gz  webtools.sourceediting-200906291748.tar.xz  webtools.sourceediting-200906291748.zip  nitind15 years
v200906292000webtools.sourceediting-200906292000.tar.gz  webtools.sourceediting-200906292000.tar.xz  webtools.sourceediting-200906292000.zip  nitind15 years
v200906292223webtools.sourceediting-200906292223.tar.gz  webtools.sourceediting-200906292223.tar.xz  webtools.sourceediting-200906292223.zip  nitind15 years
v200906072300webtools.sourceediting-200906072300.tar.gz  webtools.sourceediting-200906072300.tar.xz  webtools.sourceediting-200906072300.zip  nitind15 years
R3_1_0webtools.sourceediting-R3_1_0.tar.gz  webtools.sourceediting-R3_1_0.tar.xz  webtools.sourceediting-R3_1_0.zip  nitind15 years
v200906051701webtools.sourceediting-200906051701.tar.gz  webtools.sourceediting-200906051701.tar.xz  webtools.sourceediting-200906051701.zip  nitind15 years
v200906032205webtools.sourceediting-200906032205.tar.gz  webtools.sourceediting-200906032205.tar.xz  webtools.sourceediting-200906032205.zip  nitind15 years
v200906020459webtools.sourceediting-200906020459.tar.gz  webtools.sourceediting-200906020459.tar.xz  webtools.sourceediting-200906020459.zip  nitind15 years
v200906012014webtools.sourceediting-200906012014.tar.gz  webtools.sourceediting-200906012014.tar.xz  webtools.sourceediting-200906012014.zip  nitind15 years
v200905271544webtools.sourceediting-200905271544.tar.gz  webtools.sourceediting-200905271544.tar.xz  webtools.sourceediting-200905271544.zip  nitind15 years
v200905271542webtools.sourceediting-200905271542.tar.gz  webtools.sourceediting-200905271542.tar.xz  webtools.sourceediting-200905271542.zip  nitind15 years
v200905261843webtools.sourceediting-200905261843.tar.gz  webtools.sourceediting-200905261843.tar.xz  webtools.sourceediting-200905261843.zip  nitind15 years
v200805261842webtools.sourceediting-200805261842.tar.gz  webtools.sourceediting-200805261842.tar.xz  webtools.sourceediting-200805261842.zip  nitind15 years
v200905242131webtools.sourceediting-200905242131.tar.gz  webtools.sourceediting-200905242131.tar.xz  webtools.sourceediting-200905242131.zip  nitind15 years
v200905242047webtools.sourceediting-200905242047.tar.gz  webtools.sourceediting-200905242047.tar.xz  webtools.sourceediting-200905242047.zip  nitind15 years
v200905242031webtools.sourceediting-200905242031.tar.gz  webtools.sourceediting-200905242031.tar.xz  webtools.sourceediting-200905242031.zip  nitind15 years
v200905240756webtools.sourceediting-200905240756.tar.gz  webtools.sourceediting-200905240756.tar.xz  webtools.sourceediting-200905240756.zip  nitind15 years
v200905260400webtools.sourceediting-200905260400.tar.gz  webtools.sourceediting-200905260400.tar.xz  webtools.sourceediting-200905260400.zip  nitind15 years
v200905221740webtools.sourceediting-200905221740.tar.gz  webtools.sourceediting-200905221740.tar.xz  webtools.sourceediting-200905221740.zip  nitind15 years
v200905212145webtools.sourceediting-200905212145.tar.gz  webtools.sourceediting-200905212145.tar.xz  webtools.sourceediting-200905212145.zip  nitind15 years
v200905201703webtools.sourceediting-200905201703.tar.gz  webtools.sourceediting-200905201703.tar.xz  webtools.sourceediting-200905201703.zip  nitind15 years
R3_0_5webtools.sourceediting-R3_0_5.tar.gz  webtools.sourceediting-R3_0_5.tar.xz  webtools.sourceediting-R3_0_5.zip  nitind15 years
v200905201654webtools.sourceediting-200905201654.tar.gz  webtools.sourceediting-200905201654.tar.xz  webtools.sourceediting-200905201654.zip  nitind15 years
v200905201407webtools.sourceediting-200905201407.tar.gz  webtools.sourceediting-200905201407.tar.xz  webtools.sourceediting-200905201407.zip  nitind15 years
v200905151456webtools.sourceediting-200905151456.tar.gz  webtools.sourceediting-200905151456.tar.xz  webtools.sourceediting-200905151456.zip  nitind15 years
v200903242040webtools.sourceediting-200903242040.tar.gz  webtools.sourceediting-200903242040.tar.xz  webtools.sourceediting-200903242040.zip  nitind15 years
Root_R3_0_5_patcheswebtools.sourceediting-Root_R3_0_5_patches.tar.gz  webtools.sourceediting-Root_R3_0_5_patches.tar.xz  webtools.sourceediting-Root_R3_0_5_patches.zip  nitind15 years
v200905200735webtools.sourceediting-200905200735.tar.gz  webtools.sourceediting-200905200735.tar.xz  webtools.sourceediting-200905200735.zip  nitind15 years
v200905200355webtools.sourceediting-200905200355.tar.gz  webtools.sourceediting-200905200355.tar.xz  webtools.sourceediting-200905200355.zip  nitind15 years
v200905182240webtools.sourceediting-200905182240.tar.gz  webtools.sourceediting-200905182240.tar.xz  webtools.sourceediting-200905182240.zip  nitind15 years
v200905151803webtools.sourceediting-200905151803.tar.gz  webtools.sourceediting-200905151803.tar.xz  webtools.sourceediting-200905151803.zip  nitind15 years
v200905141750webtools.sourceediting-200905141750.tar.gz  webtools.sourceediting-200905141750.tar.xz  webtools.sourceediting-200905141750.zip  nitind15 years
Root_R3_1_maintenancewebtools.sourceediting-Root_R3_1_maintenance.tar.gz  webtools.sourceediting-Root_R3_1_maintenance.tar.xz  webtools.sourceediting-Root_R3_1_maintenance.zip  nitind15 years
v200905120445webtools.sourceediting-200905120445.tar.gz  webtools.sourceediting-200905120445.tar.xz  webtools.sourceediting-200905120445.zip  nitind15 years
v200905081451webtools.sourceediting-200905081451.tar.gz  webtools.sourceediting-200905081451.tar.xz  webtools.sourceediting-200905081451.zip  nitind15 years
v200905071842webtools.sourceediting-200905071842.tar.gz  webtools.sourceediting-200905071842.tar.xz  webtools.sourceediting-200905071842.zip  nitind15 years
v200905060217webtools.sourceediting-200905060217.tar.gz  webtools.sourceediting-200905060217.tar.xz  webtools.sourceediting-200905060217.zip  nitind15 years
v200905062029webtools.sourceediting-200905062029.tar.gz  webtools.sourceediting-200905062029.tar.xz  webtools.sourceediting-200905062029.zip  nitind15 years
v200905061430webtools.sourceediting-200905061430.tar.gz  webtools.sourceediting-200905061430.tar.xz  webtools.sourceediting-200905061430.zip  nitind15 years
v200905060006webtools.sourceediting-200905060006.tar.gz  webtools.sourceediting-200905060006.tar.xz  webtools.sourceediting-200905060006.zip  nitind15 years
v200905020500webtools.sourceediting-200905020500.tar.gz  webtools.sourceediting-200905020500.tar.xz  webtools.sourceediting-200905020500.zip  nitind15 years
v200905020341webtools.sourceediting-200905020341.tar.gz  webtools.sourceediting-200905020341.tar.xz  webtools.sourceediting-200905020341.zip  nitind15 years
v200904300717webtools.sourceediting-200904300717.tar.gz  webtools.sourceediting-200904300717.tar.xz  webtools.sourceediting-200904300717.zip  nitind15 years
v200904300540webtools.sourceediting-200904300540.tar.gz  webtools.sourceediting-200904300540.tar.xz  webtools.sourceediting-200904300540.zip  nitind15 years
v200904292352webtools.sourceediting-200904292352.tar.gz  webtools.sourceediting-200904292352.tar.xz  webtools.sourceediting-200904292352.zip  nitind15 years
v200904292308webtools.sourceediting-200904292308.tar.gz  webtools.sourceediting-200904292308.tar.xz  webtools.sourceediting-200904292308.zip  nitind15 years
v200904292045webtools.sourceediting-200904292045.tar.gz  webtools.sourceediting-200904292045.tar.xz  webtools.sourceediting-200904292045.zip  nitind15 years
v200904292008webtools.sourceediting-200904292008.tar.gz  webtools.sourceediting-200904292008.tar.xz  webtools.sourceediting-200904292008.zip  nitind15 years
v200904291925webtools.sourceediting-200904291925.tar.gz  webtools.sourceediting-200904291925.tar.xz  webtools.sourceediting-200904291925.zip  nitind15 years
v200904291414webtools.sourceediting-200904291414.tar.gz  webtools.sourceediting-200904291414.tar.xz  webtools.sourceediting-200904291414.zip  nitind15 years
v200904290539webtools.sourceediting-200904290539.tar.gz  webtools.sourceediting-200904290539.tar.xz  webtools.sourceediting-200904290539.zip  nitind15 years
v200904290035webtools.sourceediting-200904290035.tar.gz  webtools.sourceediting-200904290035.tar.xz  webtools.sourceediting-200904290035.zip  nitind15 years
v200904272215webtools.sourceediting-200904272215.tar.gz  webtools.sourceediting-200904272215.tar.xz  webtools.sourceediting-200904272215.zip  nitind15 years
v200904271435webtools.sourceediting-200904271435.tar.gz  webtools.sourceediting-200904271435.tar.xz  webtools.sourceediting-200904271435.zip  nitind15 years
v200904270330webtools.sourceediting-200904270330.tar.gz  webtools.sourceediting-200904270330.tar.xz  webtools.sourceediting-200904270330.zip  nitind15 years
v200904270300webtools.sourceediting-200904270300.tar.gz  webtools.sourceediting-200904270300.tar.xz  webtools.sourceediting-200904270300.zip  nitind15 years
v200904252311webtools.sourceediting-200904252311.tar.gz  webtools.sourceediting-200904252311.tar.xz  webtools.sourceediting-200904252311.zip  nitind15 years
v200904242109webtools.sourceediting-200904242109.tar.gz  webtools.sourceediting-200904242109.tar.xz  webtools.sourceediting-200904242109.zip  nitind15 years
v200904242107webtools.sourceediting-200904242107.tar.gz  webtools.sourceediting-200904242107.tar.xz  webtools.sourceediting-200904242107.zip  nitind15 years
v200904242022webtools.sourceediting-200904242022.tar.gz  webtools.sourceediting-200904242022.tar.xz  webtools.sourceediting-200904242022.zip  nitind15 years
v200904241849webtools.sourceediting-200904241849.tar.gz  webtools.sourceediting-200904241849.tar.xz  webtools.sourceediting-200904241849.zip  nitind15 years
v200904241844webtools.sourceediting-200904241844.tar.gz  webtools.sourceediting-200904241844.tar.xz  webtools.sourceediting-200904241844.zip  nitind15 years
v200904232027webtools.sourceediting-200904232027.tar.gz  webtools.sourceediting-200904232027.tar.xz  webtools.sourceediting-200904232027.zip  nitind15 years
v200904230645webtools.sourceediting-200904230645.tar.gz  webtools.sourceediting-200904230645.tar.xz  webtools.sourceediting-200904230645.zip  nitind15 years
v200904230740webtools.sourceediting-200904230740.tar.gz  webtools.sourceediting-200904230740.tar.xz  webtools.sourceediting-200904230740.zip  nitind15 years
v200904230847webtools.sourceediting-200904230847.tar.gz  webtools.sourceediting-200904230847.tar.xz  webtools.sourceediting-200904230847.zip  nitind15 years
v200904222044webtools.sourceediting-200904222044.tar.gz  webtools.sourceediting-200904222044.tar.xz  webtools.sourceediting-200904222044.zip  nitind15 years
v200904222030webtools.sourceediting-200904222030.tar.gz  webtools.sourceediting-200904222030.tar.xz  webtools.sourceediting-200904222030.zip  nitind15 years
v200904221806webtools.sourceediting-200904221806.tar.gz  webtools.sourceediting-200904221806.tar.xz  webtools.sourceediting-200904221806.zip  nitind15 years
v200904212326webtools.sourceediting-200904212326.tar.gz  webtools.sourceediting-200904212326.tar.xz  webtools.sourceediting-200904212326.zip  nitind15 years
v200904210530webtools.sourceediting-200904210530.tar.gz  webtools.sourceediting-200904210530.tar.xz  webtools.sourceediting-200904210530.zip  nitind15 years
v200904181727webtools.sourceediting-200904181727.tar.gz  webtools.sourceediting-200904181727.tar.xz  webtools.sourceediting-200904181727.zip  nitind15 years
Root_R3_0_4_patcheswebtools.sourceediting-Root_R3_0_4_patches.tar.gz  webtools.sourceediting-Root_R3_0_4_patches.tar.xz  webtools.sourceediting-Root_R3_0_4_patches.zip  nitind15 years
v200904162000webtools.sourceediting-200904162000.tar.gz  webtools.sourceediting-200904162000.tar.xz  webtools.sourceediting-200904162000.zip  nitind15 years
Root_R3_0_4_updateswebtools.sourceediting-Root_R3_0_4_updates.tar.gz  webtools.sourceediting-Root_R3_0_4_updates.tar.xz  webtools.sourceediting-Root_R3_0_4_updates.zip  nitind15 years
v200904151345webtools.sourceediting-200904151345.tar.gz  webtools.sourceediting-200904151345.tar.xz  webtools.sourceediting-200904151345.zip  nitind15 years
v200904150220webtools.sourceediting-200904150220.tar.gz  webtools.sourceediting-200904150220.tar.xz  webtools.sourceediting-200904150220.zip  nitind15 years
v200904142207webtools.sourceediting-200904142207.tar.gz  webtools.sourceediting-200904142207.tar.xz  webtools.sourceediting-200904142207.zip  nitind15 years
v200904141411webtools.sourceediting-200904141411.tar.gz  webtools.sourceediting-200904141411.tar.xz  webtools.sourceediting-200904141411.zip  nitind15 years
v200904140255webtools.sourceediting-200904140255.tar.gz  webtools.sourceediting-200904140255.tar.xz  webtools.sourceediting-200904140255.zip  nitind15 years
v200904140251webtools.sourceediting-200904140251.tar.gz  webtools.sourceediting-200904140251.tar.xz  webtools.sourceediting-200904140251.zip  nitind15 years
v200904132038webtools.sourceediting-200904132038.tar.gz  webtools.sourceediting-200904132038.tar.xz  webtools.sourceediting-200904132038.zip  nitind15 years
v200904131908webtools.sourceediting-200904131908.tar.gz  webtools.sourceediting-200904131908.tar.xz  webtools.sourceediting-200904131908.zip  nitind15 years
v200904131653webtools.sourceediting-200904131653.tar.gz  webtools.sourceediting-200904131653.tar.xz  webtools.sourceediting-200904131653.zip  nitind15 years
v200904120605webtools.sourceediting-200904120605.tar.gz  webtools.sourceediting-200904120605.tar.xz  webtools.sourceediting-200904120605.zip  nitind15 years
v200904102327webtools.sourceediting-200904102327.tar.gz  webtools.sourceediting-200904102327.tar.xz  webtools.sourceediting-200904102327.zip  nitind15 years
Root_R3_0_maintenancewebtools.sourceediting-Root_R3_0_maintenance.tar.gz  webtools.sourceediting-Root_R3_0_maintenance.tar.xz  webtools.sourceediting-Root_R3_0_maintenance.zip  nitind15 years
v200904070030webtools.sourceediting-200904070030.tar.gz  webtools.sourceediting-200904070030.tar.xz  webtools.sourceediting-200904070030.zip  nitind15 years
v200904041834webtools.sourceediting-200904041834.tar.gz  webtools.sourceediting-200904041834.tar.xz  webtools.sourceediting-200904041834.zip  nitind15 years
v200904040632webtools.sourceediting-200904040632.tar.gz  webtools.sourceediting-200904040632.tar.xz  webtools.sourceediting-200904040632.zip  nitind15 years
v200904020304webtools.sourceediting-200904020304.tar.gz  webtools.sourceediting-200904020304.tar.xz  webtools.sourceediting-200904020304.zip  nitind15 years
v200904020302webtools.sourceediting-200904020302.tar.gz  webtools.sourceediting-200904020302.tar.xz  webtools.sourceediting-200904020302.zip  nitind15 years
v200904132250webtools.sourceediting-200904132250.tar.gz  webtools.sourceediting-200904132250.tar.xz  webtools.sourceediting-200904132250.zip  nitind15 years
v200904011422webtools.sourceediting-200904011422.tar.gz  webtools.sourceediting-200904011422.tar.xz  webtools.sourceediting-200904011422.zip  nitind15 years
v200903311528webtools.sourceediting-200903311528.tar.gz  webtools.sourceediting-200903311528.tar.xz  webtools.sourceediting-200903311528.zip  nitind15 years
v200903310029webtools.sourceediting-200903310029.tar.gz  webtools.sourceediting-200903310029.tar.xz  webtools.sourceediting-200903310029.zip  nitind15 years
v200903231723webtools.sourceediting-200903231723.tar.gz  webtools.sourceediting-200903231723.tar.xz  webtools.sourceediting-200903231723.zip  nitind16 years
v200903212312webtools.sourceediting-200903212312.tar.gz  webtools.sourceediting-200903212312.tar.xz  webtools.sourceediting-200903212312.zip  nitind16 years
v200903202317webtools.sourceediting-200903202317.tar.gz  webtools.sourceediting-200903202317.tar.xz  webtools.sourceediting-200903202317.zip  nitind16 years
v200903201958webtools.sourceediting-200903201958.tar.gz  webtools.sourceediting-200903201958.tar.xz  webtools.sourceediting-200903201958.zip  nitind16 years
v200903192052webtools.sourceediting-200903192052.tar.gz  webtools.sourceediting-200903192052.tar.xz  webtools.sourceediting-200903192052.zip  nitind16 years
v200903120635webtools.sourceediting-200903120635.tar.gz  webtools.sourceediting-200903120635.tar.xz  webtools.sourceediting-200903120635.zip  nitind16 years
v200903120608webtools.sourceediting-200903120608.tar.gz  webtools.sourceediting-200903120608.tar.xz  webtools.sourceediting-200903120608.zip  nitind16 years
v200903120214webtools.sourceediting-200903120214.tar.gz  webtools.sourceediting-200903120214.tar.xz  webtools.sourceediting-200903120214.zip  nitind16 years
v200903111830webtools.sourceediting-200903111830.tar.gz  webtools.sourceediting-200903111830.tar.xz  webtools.sourceediting-200903111830.zip  nitind16 years
v200903102247webtools.sourceediting-200903102247.tar.gz  webtools.sourceediting-200903102247.tar.xz  webtools.sourceediting-200903102247.zip  nitind16 years
v200903101449webtools.sourceediting-200903101449.tar.gz  webtools.sourceediting-200903101449.tar.xz  webtools.sourceediting-200903101449.zip  nitind16 years
v200903101436webtools.sourceediting-200903101436.tar.gz  webtools.sourceediting-200903101436.tar.xz  webtools.sourceediting-200903101436.zip  nitind16 years
v200903100717webtools.sourceediting-200903100717.tar.gz  webtools.sourceediting-200903100717.tar.xz  webtools.sourceediting-200903100717.zip  nitind16 years
v200903090428webtools.sourceediting-200903090428.tar.gz  webtools.sourceediting-200903090428.tar.xz  webtools.sourceediting-200903090428.zip  nitind16 years
v200903090348webtools.sourceediting-200903090348.tar.gz  webtools.sourceediting-200903090348.tar.xz  webtools.sourceediting-200903090348.zip  nitind16 years
v200903071919webtools.sourceediting-200903071919.tar.gz  webtools.sourceediting-200903071919.tar.xz  webtools.sourceediting-200903071919.zip  nitind16 years
v200903050238webtools.sourceediting-200903050238.tar.gz  webtools.sourceediting-200903050238.tar.xz  webtools.sourceediting-200903050238.zip  nitind16 years
v200903041950webtools.sourceediting-200903041950.tar.gz  webtools.sourceediting-200903041950.tar.xz  webtools.sourceediting-200903041950.zip  nitind16 years
v200903041930webtools.sourceediting-200903041930.tar.gz  webtools.sourceediting-200903041930.tar.xz  webtools.sourceediting-200903041930.zip  nitind16 years
v200903041700webtools.sourceediting-200903041700.tar.gz  webtools.sourceediting-200903041700.tar.xz  webtools.sourceediting-200903041700.zip  nitind16 years
v200903041556webtools.sourceediting-200903041556.tar.gz  webtools.sourceediting-200903041556.tar.xz  webtools.sourceediting-200903041556.zip  nitind16 years
v200903021905webtools.sourceediting-200903021905.tar.gz  webtools.sourceediting-200903021905.tar.xz  webtools.sourceediting-200903021905.zip  nitind16 years
v200903021621webtools.sourceediting-200903021621.tar.gz  webtools.sourceediting-200903021621.tar.xz  webtools.sourceediting-200903021621.zip  nitind16 years
v200903021606webtools.sourceediting-200903021606.tar.gz  webtools.sourceediting-200903021606.tar.xz  webtools.sourceediting-200903021606.zip  nitind16 years
v200903020335webtools.sourceediting-200903020335.tar.gz  webtools.sourceediting-200903020335.tar.xz  webtools.sourceediting-200903020335.zip  nitind16 years
v200902270715webtools.sourceediting-200902270715.tar.gz  webtools.sourceediting-200902270715.tar.xz  webtools.sourceediting-200902270715.zip  nitind16 years
v200902270508webtools.sourceediting-200902270508.tar.gz  webtools.sourceediting-200902270508.tar.xz  webtools.sourceediting-200902270508.zip  nitind16 years
v200902270501webtools.sourceediting-200902270501.tar.gz  webtools.sourceediting-200902270501.tar.xz  webtools.sourceediting-200902270501.zip  nitind16 years
v200902270215webtools.sourceediting-200902270215.tar.gz  webtools.sourceediting-200902270215.tar.xz  webtools.sourceediting-200902270215.zip  nitind16 years
v200902252158webtools.sourceediting-200902252158.tar.gz  webtools.sourceediting-200902252158.tar.xz  webtools.sourceediting-200902252158.zip  nitind16 years
v200902252146webtools.sourceediting-200902252146.tar.gz  webtools.sourceediting-200902252146.tar.xz  webtools.sourceediting-200902252146.zip  nitind16 years
v200902241836webtools.sourceediting-200902241836.tar.gz  webtools.sourceediting-200902241836.tar.xz  webtools.sourceediting-200902241836.zip  nitind16 years
v200902181857webtools.sourceediting-200902181857.tar.gz  webtools.sourceediting-200902181857.tar.xz  webtools.sourceediting-200902181857.zip  nitind16 years
v200902181828webtools.sourceediting-200902181828.tar.gz  webtools.sourceediting-200902181828.tar.xz  webtools.sourceediting-200902181828.zip  nitind16 years
v200902190438webtools.sourceediting-200902190438.tar.gz  webtools.sourceediting-200902190438.tar.xz  webtools.sourceediting-200902190438.zip  nitind16 years
v200902170232webtools.sourceediting-200902170232.tar.gz  webtools.sourceediting-200902170232.tar.xz  webtools.sourceediting-200902170232.zip  nitind16 years
v200902160240webtools.sourceediting-200902160240.tar.gz  webtools.sourceediting-200902160240.tar.xz  webtools.sourceediting-200902160240.zip  nitind16 years
v200902162252webtools.sourceediting-200902162252.tar.gz  webtools.sourceediting-200902162252.tar.xz  webtools.sourceediting-200902162252.zip  nitind16 years
v200902121909webtools.sourceediting-200902121909.tar.gz  webtools.sourceediting-200902121909.tar.xz  webtools.sourceediting-200902121909.zip  nitind16 years
R3_0_4webtools.sourceediting-R3_0_4.tar.gz  webtools.sourceediting-R3_0_4.tar.xz  webtools.sourceediting-R3_0_4.zip  nitind16 years
v200902110057webtools.sourceediting-200902110057.tar.gz  webtools.sourceediting-200902110057.tar.xz  webtools.sourceediting-200902110057.zip  nitind16 years
v200902052112webtools.sourceediting-200902052112.tar.gz  webtools.sourceediting-200902052112.tar.xz  webtools.sourceediting-200902052112.zip  nitind16 years
v200902031645webtools.sourceediting-200902031645.tar.gz  webtools.sourceediting-200902031645.tar.xz  webtools.sourceediting-200902031645.zip  nitind16 years
v200901290909webtools.sourceediting-200901290909.tar.gz  webtools.sourceediting-200901290909.tar.xz  webtools.sourceediting-200901290909.zip  nitind16 years
v200901290830webtools.sourceediting-200901290830.tar.gz  webtools.sourceediting-200901290830.tar.xz  webtools.sourceediting-200901290830.zip  nitind16 years
v200901290811webtools.sourceediting-200901290811.tar.gz  webtools.sourceediting-200901290811.tar.xz  webtools.sourceediting-200901290811.zip  nitind16 years
v20090129012webtools.sourceediting-20090129012.tar.gz  webtools.sourceediting-20090129012.tar.xz  webtools.sourceediting-20090129012.zip  nitind16 years
v200901290024webtools.sourceediting-200901290024.tar.gz  webtools.sourceediting-200901290024.tar.xz  webtools.sourceediting-200901290024.zip  nitind16 years
v200901282329webtools.sourceediting-200901282329.tar.gz  webtools.sourceediting-200901282329.tar.xz  webtools.sourceediting-200901282329.zip  nitind16 years
v200901282355webtools.sourceediting-200901282355.tar.gz  webtools.sourceediting-200901282355.tar.xz  webtools.sourceediting-200901282355.zip  nitind16 years
v200901282243webtools.sourceediting-200901282243.tar.gz  webtools.sourceediting-200901282243.tar.xz  webtools.sourceediting-200901282243.zip  nitind16 years
v200901290905webtools.sourceediting-200901290905.tar.gz  webtools.sourceediting-200901290905.tar.xz  webtools.sourceediting-200901290905.zip  nitind16 years
v200901282132webtools.sourceediting-200901282132.tar.gz  webtools.sourceediting-200901282132.tar.xz  webtools.sourceediting-200901282132.zip  nitind16 years
v200901282127webtools.sourceediting-200901282127.tar.gz  webtools.sourceediting-200901282127.tar.xz  webtools.sourceediting-200901282127.zip  nitind16 years
v200901280206webtools.sourceediting-200901280206.tar.gz  webtools.sourceediting-200901280206.tar.xz  webtools.sourceediting-200901280206.zip  nitind16 years
v200901272028webtools.sourceediting-200901272028.tar.gz  webtools.sourceediting-200901272028.tar.xz  webtools.sourceediting-200901272028.zip  nitind16 years
v200901272012webtools.sourceediting-200901272012.tar.gz  webtools.sourceediting-200901272012.tar.xz  webtools.sourceediting-200901272012.zip  nitind16 years
v200901271918webtools.sourceediting-200901271918.tar.gz  webtools.sourceediting-200901271918.tar.xz  webtools.sourceediting-200901271918.zip  nitind16 years
v200901281800webtools.sourceediting-200901281800.tar.gz  webtools.sourceediting-200901281800.tar.xz  webtools.sourceediting-200901281800.zip  nitind16 years
v200901281702webtools.sourceediting-200901281702.tar.gz  webtools.sourceediting-200901281702.tar.xz  webtools.sourceediting-200901281702.zip  nitind16 years
v200901262359webtools.sourceediting-200901262359.tar.gz  webtools.sourceediting-200901262359.tar.xz  webtools.sourceediting-200901262359.zip  nitind16 years
v200901270011webtools.sourceediting-200901270011.tar.gz  webtools.sourceediting-200901270011.tar.xz  webtools.sourceediting-200901270011.zip  nitind16 years
v200901262318webtools.sourceediting-200901262318.tar.gz  webtools.sourceediting-200901262318.tar.xz  webtools.sourceediting-200901262318.zip  nitind16 years
v200901262203webtools.sourceediting-200901262203.tar.gz  webtools.sourceediting-200901262203.tar.xz  webtools.sourceediting-200901262203.zip  nitind16 years
v200901261614webtools.sourceediting-200901261614.tar.gz  webtools.sourceediting-200901261614.tar.xz  webtools.sourceediting-200901261614.zip  nitind16 years
v200901260254webtools.sourceediting-200901260254.tar.gz  webtools.sourceediting-200901260254.tar.xz  webtools.sourceediting-200901260254.zip  nitind16 years
v200901252121webtools.sourceediting-200901252121.tar.gz  webtools.sourceediting-200901252121.tar.xz  webtools.sourceediting-200901252121.zip  nitind16 years
v200901242352webtools.sourceediting-200901242352.tar.gz  webtools.sourceediting-200901242352.tar.xz  webtools.sourceediting-200901242352.zip  nitind16 years
v200901231300webtools.sourceediting-200901231300.tar.gz  webtools.sourceediting-200901231300.tar.xz  webtools.sourceediting-200901231300.zip  nitind16 years
v200901220230webtools.sourceediting-200901220230.tar.gz  webtools.sourceediting-200901220230.tar.xz  webtools.sourceediting-200901220230.zip  nitind16 years
v200901220046webtools.sourceediting-200901220046.tar.gz  webtools.sourceediting-200901220046.tar.xz  webtools.sourceediting-200901220046.zip  nitind16 years
v200901220045webtools.sourceediting-200901220045.tar.gz  webtools.sourceediting-200901220045.tar.xz  webtools.sourceediting-200901220045.zip  nitind16 years
v200901212327webtools.sourceediting-200901212327.tar.gz  webtools.sourceediting-200901212327.tar.xz  webtools.sourceediting-200901212327.zip  nitind16 years
v200901212230webtools.sourceediting-200901212230.tar.gz  webtools.sourceediting-200901212230.tar.xz  webtools.sourceediting-200901212230.zip  nitind16 years
v200901211100webtools.sourceediting-200901211100.tar.gz  webtools.sourceediting-200901211100.tar.xz  webtools.sourceediting-200901211100.zip  nitind16 years
v200901210010webtools.sourceediting-200901210010.tar.gz  webtools.sourceediting-200901210010.tar.xz  webtools.sourceediting-200901210010.zip  nitind16 years
v200901202345webtools.sourceediting-200901202345.tar.gz  webtools.sourceediting-200901202345.tar.xz  webtools.sourceediting-200901202345.zip  nitind16 years
v200901202215webtools.sourceediting-200901202215.tar.gz  webtools.sourceediting-200901202215.tar.xz  webtools.sourceediting-200901202215.zip  nitind16 years
v200901150054webtools.sourceediting-200901150054.tar.gz  webtools.sourceediting-200901150054.tar.xz  webtools.sourceediting-200901150054.zip  nitind16 years
v200901142006webtools.sourceediting-200901142006.tar.gz  webtools.sourceediting-200901142006.tar.xz  webtools.sourceediting-200901142006.zip  nitind16 years
v200901141610webtools.sourceediting-200901141610.tar.gz  webtools.sourceediting-200901141610.tar.xz  webtools.sourceediting-200901141610.zip  nitind16 years
v200901141603webtools.sourceediting-200901141603.tar.gz  webtools.sourceediting-200901141603.tar.xz  webtools.sourceediting-200901141603.zip  nitind16 years
v200901141536webtools.sourceediting-200901141536.tar.gz  webtools.sourceediting-200901141536.tar.xz  webtools.sourceediting-200901141536.zip  nitind16 years
v200901131859webtools.sourceediting-200901131859.tar.gz  webtools.sourceediting-200901131859.tar.xz  webtools.sourceediting-200901131859.zip  nitind16 years
v200901141514webtools.sourceediting-200901141514.tar.gz  webtools.sourceediting-200901141514.tar.xz  webtools.sourceediting-200901141514.zip  nitind16 years
v200901121835webtools.sourceediting-200901121835.tar.gz  webtools.sourceediting-200901121835.tar.xz  webtools.sourceediting-200901121835.zip  nitind16 years
v200901121830webtools.sourceediting-200901121830.tar.gz  webtools.sourceediting-200901121830.tar.xz  webtools.sourceediting-200901121830.zip  nitind16 years
v200901121606webtools.sourceediting-200901121606.tar.gz  webtools.sourceediting-200901121606.tar.xz  webtools.sourceediting-200901121606.zip  nitind16 years
v200901130309webtools.sourceediting-200901130309.tar.gz  webtools.sourceediting-200901130309.tar.xz  webtools.sourceediting-200901130309.zip  nitind16 years
v200901072320webtools.sourceediting-200901072320.tar.gz  webtools.sourceediting-200901072320.tar.xz  webtools.sourceediting-200901072320.zip  nitind16 years
v200812160131webtools.sourceediting-200812160131.tar.gz  webtools.sourceediting-200812160131.tar.xz  webtools.sourceediting-200812160131.zip  nitind16 years
v200812160130webtools.sourceediting-200812160130.tar.gz  webtools.sourceediting-200812160130.tar.xz  webtools.sourceediting-200812160130.zip  nitind16 years
v200812122152webtools.sourceediting-200812122152.tar.gz  webtools.sourceediting-200812122152.tar.xz  webtools.sourceediting-200812122152.zip  nitind16 years
v200812121649webtools.sourceediting-200812121649.tar.gz  webtools.sourceediting-200812121649.tar.xz  webtools.sourceediting-200812121649.zip  nitind16 years
v200812112112webtools.sourceediting-200812112112.tar.gz  webtools.sourceediting-200812112112.tar.xz  webtools.sourceediting-200812112112.zip  nitind16 years
v200812110458webtools.sourceediting-200812110458.tar.gz  webtools.sourceediting-200812110458.tar.xz  webtools.sourceediting-200812110458.zip  nitind16 years
v200812110445webtools.sourceediting-200812110445.tar.gz  webtools.sourceediting-200812110445.tar.xz  webtools.sourceediting-200812110445.zip  nitind16 years
v200812110422webtools.sourceediting-200812110422.tar.gz  webtools.sourceediting-200812110422.tar.xz  webtools.sourceediting-200812110422.zip  nitind16 years
v200812110350webtools.sourceediting-200812110350.tar.gz  webtools.sourceediting-200812110350.tar.xz  webtools.sourceediting-200812110350.zip  nitind16 years
v200812102330webtools.sourceediting-200812102330.tar.gz  webtools.sourceediting-200812102330.tar.xz  webtools.sourceediting-200812102330.zip  nitind16 years
v200812102010webtools.sourceediting-200812102010.tar.gz  webtools.sourceediting-200812102010.tar.xz  webtools.sourceediting-200812102010.zip  nitind16 years
v200812101958webtools.sourceediting-200812101958.tar.gz  webtools.sourceediting-200812101958.tar.xz  webtools.sourceediting-200812101958.zip  nitind16 years
v200812100500webtools.sourceediting-200812100500.tar.gz  webtools.sourceediting-200812100500.tar.xz  webtools.sourceediting-200812100500.zip  nitind16 years
v200812081921webtools.sourceediting-200812081921.tar.gz  webtools.sourceediting-200812081921.tar.xz  webtools.sourceediting-200812081921.zip  nitind16 years
v200812040936webtools.sourceediting-200812040936.tar.gz  webtools.sourceediting-200812040936.tar.xz  webtools.sourceediting-200812040936.zip  nitind16 years
v200812040924webtools.sourceediting-200812040924.tar.gz  webtools.sourceediting-200812040924.tar.xz  webtools.sourceediting-200812040924.zip  nitind16 years
v200812040854webtools.sourceediting-200812040854.tar.gz  webtools.sourceediting-200812040854.tar.xz  webtools.sourceediting-200812040854.zip  nitind16 years
v200812040804webtools.sourceediting-200812040804.tar.gz  webtools.sourceediting-200812040804.tar.xz  webtools.sourceediting-200812040804.zip  nitind16 years
v200811282340webtools.sourceediting-200811282340.tar.gz  webtools.sourceediting-200811282340.tar.xz  webtools.sourceediting-200811282340.zip  nitind16 years
v200811282320webtools.sourceediting-200811282320.tar.gz  webtools.sourceediting-200811282320.tar.xz  webtools.sourceediting-200811282320.zip  nitind16 years
v200811282205webtools.sourceediting-200811282205.tar.gz  webtools.sourceediting-200811282205.tar.xz  webtools.sourceediting-200811282205.zip  nitind16 years
v200811282000webtools.sourceediting-200811282000.tar.gz  webtools.sourceediting-200811282000.tar.xz  webtools.sourceediting-200811282000.zip  nitind16 years
v200811270433webtools.sourceediting-200811270433.tar.gz  webtools.sourceediting-200811270433.tar.xz  webtools.sourceediting-200811270433.zip  nitind16 years
v200812032045webtools.sourceediting-200812032045.tar.gz  webtools.sourceediting-200812032045.tar.xz  webtools.sourceediting-200812032045.zip  nitind16 years
v200811260459webtools.sourceediting-200811260459.tar.gz  webtools.sourceediting-200811260459.tar.xz  webtools.sourceediting-200811260459.zip  nitind16 years
v200811242316webtools.sourceediting-200811242316.tar.gz  webtools.sourceediting-200811242316.tar.xz  webtools.sourceediting-200811242316.zip  nitind16 years
v200811241726webtools.sourceediting-200811241726.tar.gz  webtools.sourceediting-200811241726.tar.xz  webtools.sourceediting-200811241726.zip  nitind16 years
v200811212200webtools.sourceediting-200811212200.tar.gz  webtools.sourceediting-200811212200.tar.xz  webtools.sourceediting-200811212200.zip  nitind16 years
v200812232221webtools.sourceediting-200812232221.tar.gz  webtools.sourceediting-200812232221.tar.xz  webtools.sourceediting-200812232221.zip  nitind16 years
v200812032146webtools.sourceediting-200812032146.tar.gz  webtools.sourceediting-200812032146.tar.xz  webtools.sourceediting-200812032146.zip  nitind16 years
v200811240900webtools.sourceediting-200811240900.tar.gz  webtools.sourceediting-200811240900.tar.xz  webtools.sourceediting-200811240900.zip  nitind16 years
v200811211541webtools.sourceediting-200811211541.tar.gz  webtools.sourceediting-200811211541.tar.xz  webtools.sourceediting-200811211541.zip  nitind16 years
v200811210207webtools.sourceediting-200811210207.tar.gz  webtools.sourceediting-200811210207.tar.xz  webtools.sourceediting-200811210207.zip  nitind16 years
v200811200550webtools.sourceediting-200811200550.tar.gz  webtools.sourceediting-200811200550.tar.xz  webtools.sourceediting-200811200550.zip  nitind16 years
v200811200527webtools.sourceediting-200811200527.tar.gz  webtools.sourceediting-200811200527.tar.xz  webtools.sourceediting-200811200527.zip  nitind16 years
v200811192308webtools.sourceediting-200811192308.tar.gz  webtools.sourceediting-200811192308.tar.xz  webtools.sourceediting-200811192308.zip  nitind16 years
v200811161948webtools.sourceediting-200811161948.tar.gz  webtools.sourceediting-200811161948.tar.xz  webtools.sourceediting-200811161948.zip  nitind16 years
v200811140043webtools.sourceediting-200811140043.tar.gz  webtools.sourceediting-200811140043.tar.xz  webtools.sourceediting-200811140043.zip  nitind16 years
v200811132211webtools.sourceediting-200811132211.tar.gz  webtools.sourceediting-200811132211.tar.xz  webtools.sourceediting-200811132211.zip  nitind16 years
v200811131902webtools.sourceediting-200811131902.tar.gz  webtools.sourceediting-200811131902.tar.xz  webtools.sourceediting-200811131902.zip  nitind16 years
v200811131640webtools.sourceediting-200811131640.tar.gz  webtools.sourceediting-200811131640.tar.xz  webtools.sourceediting-200811131640.zip  nitind16 years
v200811131635webtools.sourceediting-200811131635.tar.gz  webtools.sourceediting-200811131635.tar.xz  webtools.sourceediting-200811131635.zip  nitind16 years
v200811131623webtools.sourceediting-200811131623.tar.gz  webtools.sourceediting-200811131623.tar.xz  webtools.sourceediting-200811131623.zip  nitind16 years
v200811122137webtools.sourceediting-200811122137.tar.gz  webtools.sourceediting-200811122137.tar.xz  webtools.sourceediting-200811122137.zip  nitind16 years
v200811122145webtools.sourceediting-200811122145.tar.gz  webtools.sourceediting-200811122145.tar.xz  webtools.sourceediting-200811122145.zip  nitind16 years
v200811080037webtools.sourceediting-200811080037.tar.gz  webtools.sourceediting-200811080037.tar.xz  webtools.sourceediting-200811080037.zip  nitind16 years
v200811030646webtools.sourceediting-200811030646.tar.gz  webtools.sourceediting-200811030646.tar.xz  webtools.sourceediting-200811030646.zip  nitind16 years
v200810301815webtools.sourceediting-200810301815.tar.gz  webtools.sourceediting-200810301815.tar.xz  webtools.sourceediting-200810301815.zip  nitind16 years
R3_0_3webtools.sourceediting-R3_0_3.tar.gz  webtools.sourceediting-R3_0_3.tar.xz  webtools.sourceediting-R3_0_3.zip  nitind16 years
v200810301812webtools.sourceediting-200810301812.tar.gz  webtools.sourceediting-200810301812.tar.xz  webtools.sourceediting-200810301812.zip  nitind16 years
v200810300316webtools.sourceediting-200810300316.tar.gz  webtools.sourceediting-200810300316.tar.xz  webtools.sourceediting-200810300316.zip  nitind16 years
v200810291925webtools.sourceediting-200810291925.tar.gz  webtools.sourceediting-200810291925.tar.xz  webtools.sourceediting-200810291925.zip  nitind16 years
v200810291900webtools.sourceediting-200810291900.tar.gz  webtools.sourceediting-200810291900.tar.xz  webtools.sourceediting-200810291900.zip  nitind16 years
v200810291905webtools.sourceediting-200810291905.tar.gz  webtools.sourceediting-200810291905.tar.xz  webtools.sourceediting-200810291905.zip  nitind16 years
v200810292213webtools.sourceediting-200810292213.tar.gz  webtools.sourceediting-200810292213.tar.xz  webtools.sourceediting-200810292213.zip  nitind16 years
v200810292210webtools.sourceediting-200810292210.tar.gz  webtools.sourceediting-200810292210.tar.xz  webtools.sourceediting-200810292210.zip  nitind16 years
v200810291746webtools.sourceediting-200810291746.tar.gz  webtools.sourceediting-200810291746.tar.xz  webtools.sourceediting-200810291746.zip  nitind16 years
v200810291731webtools.sourceediting-200810291731.tar.gz  webtools.sourceediting-200810291731.tar.xz  webtools.sourceediting-200810291731.zip  nitind16 years
v200810232056webtools.sourceediting-200810232056.tar.gz  webtools.sourceediting-200810232056.tar.xz  webtools.sourceediting-200810232056.zip  nitind16 years
v200810221955webtools.sourceediting-200810221955.tar.gz  webtools.sourceediting-200810221955.tar.xz  webtools.sourceediting-200810221955.zip  nitind16 years
v200810222200webtools.sourceediting-200810222200.tar.gz  webtools.sourceediting-200810222200.tar.xz  webtools.sourceediting-200810222200.zip  nitind16 years
v200810220345webtools.sourceediting-200810220345.tar.gz  webtools.sourceediting-200810220345.tar.xz  webtools.sourceediting-200810220345.zip  nitind16 years
v200810212021webtools.sourceediting-200810212021.tar.gz  webtools.sourceediting-200810212021.tar.xz  webtools.sourceediting-200810212021.zip  nitind16 years
v200810210016webtools.sourceediting-200810210016.tar.gz  webtools.sourceediting-200810210016.tar.xz  webtools.sourceediting-200810210016.zip  nitind16 years
v200810201503webtools.sourceediting-200810201503.tar.gz  webtools.sourceediting-200810201503.tar.xz  webtools.sourceediting-200810201503.zip  nitind16 years
v200810180004webtools.sourceediting-200810180004.tar.gz  webtools.sourceediting-200810180004.tar.xz  webtools.sourceediting-200810180004.zip  nitind16 years
v200810172355webtools.sourceediting-200810172355.tar.gz  webtools.sourceediting-200810172355.tar.xz  webtools.sourceediting-200810172355.zip  nitind16 years
v200810160200webtools.sourceediting-200810160200.tar.gz  webtools.sourceediting-200810160200.tar.xz  webtools.sourceediting-200810160200.zip  nitind16 years
v200810151959webtools.sourceediting-200810151959.tar.gz  webtools.sourceediting-200810151959.tar.xz  webtools.sourceediting-200810151959.zip  nitind16 years
v200810151843webtools.sourceediting-200810151843.tar.gz  webtools.sourceediting-200810151843.tar.xz  webtools.sourceediting-200810151843.zip  nitind16 years
v200810142015webtools.sourceediting-200810142015.tar.gz  webtools.sourceediting-200810142015.tar.xz  webtools.sourceediting-200810142015.zip  nitind16 years
v200810141505webtools.sourceediting-200810141505.tar.gz  webtools.sourceediting-200810141505.tar.xz  webtools.sourceediting-200810141505.zip  nitind16 years
v200810131704webtools.sourceediting-200810131704.tar.gz  webtools.sourceediting-200810131704.tar.xz  webtools.sourceediting-200810131704.zip  nitind16 years
v200810131528webtools.sourceediting-200810131528.tar.gz  webtools.sourceediting-200810131528.tar.xz  webtools.sourceediting-200810131528.zip  nitind16 years
v200810110028webtools.sourceediting-200810110028.tar.gz  webtools.sourceediting-200810110028.tar.xz  webtools.sourceediting-200810110028.zip  nitind16 years
v200810091554webtools.sourceediting-200810091554.tar.gz  webtools.sourceediting-200810091554.tar.xz  webtools.sourceediting-200810091554.zip  nitind16 years
v200810091536webtools.sourceediting-200810091536.tar.gz  webtools.sourceediting-200810091536.tar.xz  webtools.sourceediting-200810091536.zip  nitind16 years
v200810090336webtools.sourceediting-200810090336.tar.gz  webtools.sourceediting-200810090336.tar.xz  webtools.sourceediting-200810090336.zip  nitind16 years
v200810082205webtools.sourceediting-200810082205.tar.gz  webtools.sourceediting-200810082205.tar.xz  webtools.sourceediting-200810082205.zip  nitind16 years
v200810081959webtools.sourceediting-200810081959.tar.gz  webtools.sourceediting-200810081959.tar.xz  webtools.sourceediting-200810081959.zip  nitind16 years
v200810081958webtools.sourceediting-200810081958.tar.gz  webtools.sourceediting-200810081958.tar.xz  webtools.sourceediting-200810081958.zip  nitind16 years
v200810081720webtools.sourceediting-200810081720.tar.gz  webtools.sourceediting-200810081720.tar.xz  webtools.sourceediting-200810081720.zip  nitind16 years
v200810081711webtools.sourceediting-200810081711.tar.gz  webtools.sourceediting-200810081711.tar.xz  webtools.sourceediting-200810081711.zip  nitind16 years
v200810081710webtools.sourceediting-200810081710.tar.gz  webtools.sourceediting-200810081710.tar.xz  webtools.sourceediting-200810081710.zip  nitind16 years
v200810081509webtools.sourceediting-200810081509.tar.gz  webtools.sourceediting-200810081509.tar.xz  webtools.sourceediting-200810081509.zip  nitind16 years
v200810081511webtools.sourceediting-200810081511.tar.gz  webtools.sourceediting-200810081511.tar.xz  webtools.sourceediting-200810081511.zip  nitind16 years
v200810081435webtools.sourceediting-200810081435.tar.gz  webtools.sourceediting-200810081435.tar.xz  webtools.sourceediting-200810081435.zip  nitind16 years
v200810080556webtools.sourceediting-200810080556.tar.gz  webtools.sourceediting-200810080556.tar.xz  webtools.sourceediting-200810080556.zip  nitind16 years
v200810080547webtools.sourceediting-200810080547.tar.gz  webtools.sourceediting-200810080547.tar.xz  webtools.sourceediting-200810080547.zip  nitind16 years
v200810080440webtools.sourceediting-200810080440.tar.gz  webtools.sourceediting-200810080440.tar.xz  webtools.sourceediting-200810080440.zip  nitind16 years
v200810072032webtools.sourceediting-200810072032.tar.gz  webtools.sourceediting-200810072032.tar.xz  webtools.sourceediting-200810072032.zip  nitind16 years
v200810071953webtools.sourceediting-200810071953.tar.gz  webtools.sourceediting-200810071953.tar.xz  webtools.sourceediting-200810071953.zip  nitind16 years
v200810062106webtools.sourceediting-200810062106.tar.gz  webtools.sourceediting-200810062106.tar.xz  webtools.sourceediting-200810062106.zip  nitind16 years
v200810062006webtools.sourceediting-200810062006.tar.gz  webtools.sourceediting-200810062006.tar.xz  webtools.sourceediting-200810062006.zip  nitind16 years
v200810061609webtools.sourceediting-200810061609.tar.gz  webtools.sourceediting-200810061609.tar.xz  webtools.sourceediting-200810061609.zip  nitind16 years
v200810061442webtools.sourceediting-200810061442.tar.gz  webtools.sourceediting-200810061442.tar.xz  webtools.sourceediting-200810061442.zip  nitind16 years
v200810061439webtools.sourceediting-200810061439.tar.gz  webtools.sourceediting-200810061439.tar.xz  webtools.sourceediting-200810061439.zip  nitind16 years
v200810021900webtools.sourceediting-200810021900.tar.gz  webtools.sourceediting-200810021900.tar.xz  webtools.sourceediting-200810021900.zip  nitind16 years
v200810021840webtools.sourceediting-200810021840.tar.gz  webtools.sourceediting-200810021840.tar.xz  webtools.sourceediting-200810021840.zip  nitind16 years
v200810021802webtools.sourceediting-200810021802.tar.gz  webtools.sourceediting-200810021802.tar.xz  webtools.sourceediting-200810021802.zip  nitind16 years
v200810020602webtools.sourceediting-200810020602.tar.gz  webtools.sourceediting-200810020602.tar.xz  webtools.sourceediting-200810020602.zip  nitind16 years
v200810020300webtools.sourceediting-200810020300.tar.gz  webtools.sourceediting-200810020300.tar.xz  webtools.sourceediting-200810020300.zip  nitind16 years
v200810012207webtools.sourceediting-200810012207.tar.gz  webtools.sourceediting-200810012207.tar.xz  webtools.sourceediting-200810012207.zip  nitind16 years
jsdt1001mergewebtools.sourceediting-jsdt1001merge.tar.gz  webtools.sourceediting-jsdt1001merge.tar.xz  webtools.sourceediting-jsdt1001merge.zip  nitind16 years
JSDT302Mergewebtools.sourceediting-JSDT302Merge.tar.gz  webtools.sourceediting-JSDT302Merge.tar.xz  webtools.sourceediting-JSDT302Merge.zip  nitind16 years
v200810010400webtools.sourceediting-200810010400.tar.gz  webtools.sourceediting-200810010400.tar.xz  webtools.sourceediting-200810010400.zip  nitind16 years
v200810012103webtools.sourceediting-200810012103.tar.gz  webtools.sourceediting-200810012103.tar.xz  webtools.sourceediting-200810012103.zip  nitind16 years
v200809292000webtools.sourceediting-200809292000.tar.gz  webtools.sourceediting-200809292000.tar.xz  webtools.sourceediting-200809292000.zip  nitind16 years
v200809291546webtools.sourceediting-200809291546.tar.gz  webtools.sourceediting-200809291546.tar.xz  webtools.sourceediting-200809291546.zip  nitind16 years
v200809291500webtools.sourceediting-200809291500.tar.gz  webtools.sourceediting-200809291500.tar.xz  webtools.sourceediting-200809291500.zip  nitind16 years
v200809291456webtools.sourceediting-200809291456.tar.gz  webtools.sourceediting-200809291456.tar.xz  webtools.sourceediting-200809291456.zip  nitind16 years
v200809242130webtools.sourceediting-200809242130.tar.gz  webtools.sourceediting-200809242130.tar.xz  webtools.sourceediting-200809242130.zip  nitind16 years
v200809241224webtools.sourceediting-200809241224.tar.gz  webtools.sourceediting-200809241224.tar.xz  webtools.sourceediting-200809241224.zip  nitind16 years
v200809241216webtools.sourceediting-200809241216.tar.gz  webtools.sourceediting-200809241216.tar.xz  webtools.sourceediting-200809241216.zip  nitind16 years
v200809241209webtools.sourceediting-200809241209.tar.gz  webtools.sourceediting-200809241209.tar.xz  webtools.sourceediting-200809241209.zip  nitind16 years
v200809241205webtools.sourceediting-200809241205.tar.gz  webtools.sourceediting-200809241205.tar.xz  webtools.sourceediting-200809241205.zip  nitind16 years
v200809240746webtools.sourceediting-200809240746.tar.gz  webtools.sourceediting-200809240746.tar.xz  webtools.sourceediting-200809240746.zip  nitind16 years
v200809240733webtools.sourceediting-200809240733.tar.gz  webtools.sourceediting-200809240733.tar.xz  webtools.sourceediting-200809240733.zip  nitind16 years
v200809240645webtools.sourceediting-200809240645.tar.gz  webtools.sourceediting-200809240645.tar.xz  webtools.sourceediting-200809240645.zip  nitind16 years
v200809240720webtools.sourceediting-200809240720.tar.gz  webtools.sourceediting-200809240720.tar.xz  webtools.sourceediting-200809240720.zip  nitind16 years
v200809171922webtools.sourceediting-200809171922.tar.gz  webtools.sourceediting-200809171922.tar.xz  webtools.sourceediting-200809171922.zip  nitind16 years
v200809120354webtools.sourceediting-200809120354.tar.gz  webtools.sourceediting-200809120354.tar.xz  webtools.sourceediting-200809120354.zip  nitind16 years
R3_0_2webtools.sourceediting-R3_0_2.tar.gz  webtools.sourceediting-R3_0_2.tar.xz  webtools.sourceediting-R3_0_2.zip  nitind16 years
v200809121346webtools.sourceediting-200809121346.tar.gz  webtools.sourceediting-200809121346.tar.xz  webtools.sourceediting-200809121346.zip  nitind16 years
v200809120250webtools.sourceediting-200809120250.tar.gz  webtools.sourceediting-200809120250.tar.xz  webtools.sourceediting-200809120250.zip  nitind16 years
v200809120245webtools.sourceediting-200809120245.tar.gz  webtools.sourceediting-200809120245.tar.xz  webtools.sourceediting-200809120245.zip  nitind16 years
v200809120241webtools.sourceediting-200809120241.tar.gz  webtools.sourceediting-200809120241.tar.xz  webtools.sourceediting-200809120241.zip  nitind16 years
v200809120159webtools.sourceediting-200809120159.tar.gz  webtools.sourceediting-200809120159.tar.xz  webtools.sourceediting-200809120159.zip  nitind16 years
v200809120143webtools.sourceediting-200809120143.tar.gz  webtools.sourceediting-200809120143.tar.xz  webtools.sourceediting-200809120143.zip  nitind16 years
v200809120137webtools.sourceediting-200809120137.tar.gz  webtools.sourceediting-200809120137.tar.xz  webtools.sourceediting-200809120137.zip  nitind16 years
v200809120122webtools.sourceediting-200809120122.tar.gz  webtools.sourceediting-200809120122.tar.xz  webtools.sourceediting-200809120122.zip  nitind16 years
v200810080425webtools.sourceediting-200810080425.tar.gz  webtools.sourceediting-200810080425.tar.xz  webtools.sourceediting-200810080425.zip  nitind16 years
v200809101758webtools.sourceediting-200809101758.tar.gz  webtools.sourceediting-200809101758.tar.xz  webtools.sourceediting-200809101758.zip  nitind16 years
v200809101755webtools.sourceediting-200809101755.tar.gz  webtools.sourceediting-200809101755.tar.xz  webtools.sourceediting-200809101755.zip  nitind16 years
v200809101117webtools.sourceediting-200809101117.tar.gz  webtools.sourceediting-200809101117.tar.xz  webtools.sourceediting-200809101117.zip  nitind16 years
v200809101112webtools.sourceediting-200809101112.tar.gz  webtools.sourceediting-200809101112.tar.xz  webtools.sourceediting-200809101112.zip  nitind16 years
v200809100752webtools.sourceediting-200809100752.tar.gz  webtools.sourceediting-200809100752.tar.xz  webtools.sourceediting-200809100752.zip  nitind16 years
v200809100351webtools.sourceediting-200809100351.tar.gz  webtools.sourceediting-200809100351.tar.xz  webtools.sourceediting-200809100351.zip  nitind16 years
v200809100249webtools.sourceediting-200809100249.tar.gz  webtools.sourceediting-200809100249.tar.xz  webtools.sourceediting-200809100249.zip  nitind16 years
v200809092106webtools.sourceediting-200809092106.tar.gz  webtools.sourceediting-200809092106.tar.xz  webtools.sourceediting-200809092106.zip  nitind16 years
v200809092105webtools.sourceediting-200809092105.tar.gz  webtools.sourceediting-200809092105.tar.xz  webtools.sourceediting-200809092105.zip  nitind16 years
v200809070645webtools.sourceediting-200809070645.tar.gz  webtools.sourceediting-200809070645.tar.xz  webtools.sourceediting-200809070645.zip  nitind16 years
v200809112355webtools.sourceediting-200809112355.tar.gz  webtools.sourceediting-200809112355.tar.xz  webtools.sourceediting-200809112355.zip  nitind16 years
v20080902040webtools.sourceediting-20080902040.tar.gz  webtools.sourceediting-20080902040.tar.xz  webtools.sourceediting-20080902040.zip  nitind16 years
v200809040612webtools.sourceediting-200809040612.tar.gz  webtools.sourceediting-200809040612.tar.xz  webtools.sourceediting-200809040612.zip  nitind16 years
v200809040552webtools.sourceediting-200809040552.tar.gz  webtools.sourceediting-200809040552.tar.xz  webtools.sourceediting-200809040552.zip  nitind16 years
v200809040530webtools.sourceediting-200809040530.tar.gz  webtools.sourceediting-200809040530.tar.xz  webtools.sourceediting-200809040530.zip  nitind16 years
v200809031825webtools.sourceediting-200809031825.tar.gz  webtools.sourceediting-200809031825.tar.xz  webtools.sourceediting-200809031825.zip  nitind16 years
v200809031815webtools.sourceediting-200809031815.tar.gz  webtools.sourceediting-200809031815.tar.xz  webtools.sourceediting-200809031815.zip  nitind16 years
v200809031803webtools.sourceediting-200809031803.tar.gz  webtools.sourceediting-200809031803.tar.xz  webtools.sourceediting-200809031803.zip  nitind16 years
v200809031718webtools.sourceediting-200809031718.tar.gz  webtools.sourceediting-200809031718.tar.xz  webtools.sourceediting-200809031718.zip  nitind16 years
v200809172119webtools.sourceediting-200809172119.tar.gz  webtools.sourceediting-200809172119.tar.xz  webtools.sourceediting-200809172119.zip  nitind16 years
v200808282230webtools.sourceediting-200808282230.tar.gz  webtools.sourceediting-200808282230.tar.xz  webtools.sourceediting-200808282230.zip  nitind16 years
v200808281704webtools.sourceediting-200808281704.tar.gz  webtools.sourceediting-200808281704.tar.xz  webtools.sourceediting-200808281704.zip  nitind16 years
v200808271909webtools.sourceediting-200808271909.tar.gz  webtools.sourceediting-200808271909.tar.xz  webtools.sourceediting-200808271909.zip  nitind16 years
v200808271642webtools.sourceediting-200808271642.tar.gz  webtools.sourceediting-200808271642.tar.xz  webtools.sourceediting-200808271642.zip  nitind16 years
v200808271628webtools.sourceediting-200808271628.tar.gz  webtools.sourceediting-200808271628.tar.xz  webtools.sourceediting-200808271628.zip  nitind16 years
v200808270431webtools.sourceediting-200808270431.tar.gz  webtools.sourceediting-200808270431.tar.xz  webtools.sourceediting-200808270431.zip  nitind16 years
v200808260334webtools.sourceediting-200808260334.tar.gz  webtools.sourceediting-200808260334.tar.xz  webtools.sourceediting-200808260334.zip  nitind16 years
v200808260321webtools.sourceediting-200808260321.tar.gz  webtools.sourceediting-200808260321.tar.xz  webtools.sourceediting-200808260321.zip  nitind16 years
v200808261826webtools.sourceediting-200808261826.tar.gz  webtools.sourceediting-200808261826.tar.xz  webtools.sourceediting-200808261826.zip  nitind16 years
v200808260415webtools.sourceediting-200808260415.tar.gz  webtools.sourceediting-200808260415.tar.xz  webtools.sourceediting-200808260415.zip  nitind16 years
v200808260045webtools.sourceediting-200808260045.tar.gz  webtools.sourceediting-200808260045.tar.xz  webtools.sourceediting-200808260045.zip  nitind16 years
v200808251850webtools.sourceediting-200808251850.tar.gz  webtools.sourceediting-200808251850.tar.xz  webtools.sourceediting-200808251850.zip  nitind16 years
v200808251825webtools.sourceediting-200808251825.tar.gz  webtools.sourceediting-200808251825.tar.xz  webtools.sourceediting-200808251825.zip  nitind16 years
v200808260338webtools.sourceediting-200808260338.tar.gz  webtools.sourceediting-200808260338.tar.xz  webtools.sourceediting-200808260338.zip  nitind16 years
v200808242055webtools.sourceediting-200808242055.tar.gz  webtools.sourceediting-200808242055.tar.xz  webtools.sourceediting-200808242055.zip  nitind16 years
v200808241836webtools.sourceediting-200808241836.tar.gz  webtools.sourceediting-200808241836.tar.xz  webtools.sourceediting-200808241836.zip  nitind16 years
v200808241534webtools.sourceediting-200808241534.tar.gz  webtools.sourceediting-200808241534.tar.xz  webtools.sourceediting-200808241534.zip  nitind16 years
v200808241427webtools.sourceediting-200808241427.tar.gz  webtools.sourceediting-200808241427.tar.xz  webtools.sourceediting-200808241427.zip  nitind16 years
v200808251820webtools.sourceediting-200808251820.tar.gz  webtools.sourceediting-200808251820.tar.xz  webtools.sourceediting-200808251820.zip  nitind16 years
JSDT301Mergewebtools.sourceediting-JSDT301Merge.tar.gz  webtools.sourceediting-JSDT301Merge.tar.xz  webtools.sourceediting-JSDT301Merge.zip  nitind16 years
v200808200430webtools.sourceediting-200808200430.tar.gz  webtools.sourceediting-200808200430.tar.xz  webtools.sourceediting-200808200430.zip  nitind16 years
Root_R3_0_1_patcheswebtools.sourceediting-Root_R3_0_1_patches.tar.gz  webtools.sourceediting-Root_R3_0_1_patches.tar.xz  webtools.sourceediting-Root_R3_0_1_patches.zip  nitind16 years
v200905312045webtools.sourceediting-200905312045.tar.gz  webtools.sourceediting-200905312045.tar.xz  webtools.sourceediting-200905312045.zip  nitind16 years
v200808192018webtools.sourceediting-200808192018.tar.gz  webtools.sourceediting-200808192018.tar.xz  webtools.sourceediting-200808192018.zip  nitind16 years
v200808191955webtools.sourceediting-200808191955.tar.gz  webtools.sourceediting-200808191955.tar.xz  webtools.sourceediting-200808191955.zip  nitind16 years
v200808200318webtools.sourceediting-200808200318.tar.gz  webtools.sourceediting-200808200318.tar.xz  webtools.sourceediting-200808200318.zip  nitind16 years
v200808190830webtools.sourceediting-200808190830.tar.gz  webtools.sourceediting-200808190830.tar.xz  webtools.sourceediting-200808190830.zip  nitind16 years
v200808190717webtools.sourceediting-200808190717.tar.gz  webtools.sourceediting-200808190717.tar.xz  webtools.sourceediting-200808190717.zip  nitind16 years
v200808190709webtools.sourceediting-200808190709.tar.gz  webtools.sourceediting-200808190709.tar.xz  webtools.sourceediting-200808190709.zip  nitind16 years
v200808190652webtools.sourceediting-200808190652.tar.gz  webtools.sourceediting-200808190652.tar.xz  webtools.sourceediting-200808190652.zip  nitind16 years
v200808190648webtools.sourceediting-200808190648.tar.gz  webtools.sourceediting-200808190648.tar.xz  webtools.sourceediting-200808190648.zip  nitind16 years
v200808152330webtools.sourceediting-200808152330.tar.gz  webtools.sourceediting-200808152330.tar.xz  webtools.sourceediting-200808152330.zip  nitind16 years
v200808152024webtools.sourceediting-200808152024.tar.gz  webtools.sourceediting-200808152024.tar.xz  webtools.sourceediting-200808152024.zip  nitind16 years
R3_0_1webtools.sourceediting-R3_0_1.tar.gz  webtools.sourceediting-R3_0_1.tar.xz  webtools.sourceediting-R3_0_1.zip  nitind16 years
v200808141919webtools.sourceediting-200808141919.tar.gz  webtools.sourceediting-200808141919.tar.xz  webtools.sourceediting-200808141919.zip  nitind16 years
v200808160100webtools.sourceediting-200808160100.tar.gz  webtools.sourceediting-200808160100.tar.xz  webtools.sourceediting-200808160100.zip  nitind16 years
v200808141745webtools.sourceediting-200808141745.tar.gz  webtools.sourceediting-200808141745.tar.xz  webtools.sourceediting-200808141745.zip  nitind16 years
v200808141740webtools.sourceediting-200808141740.tar.gz  webtools.sourceediting-200808141740.tar.xz  webtools.sourceediting-200808141740.zip  nitind16 years
v200808141000webtools.sourceediting-200808141000.tar.gz  webtools.sourceediting-200808141000.tar.xz  webtools.sourceediting-200808141000.zip  nitind16 years
v200808140915webtools.sourceediting-200808140915.tar.gz  webtools.sourceediting-200808140915.tar.xz  webtools.sourceediting-200808140915.zip  nitind16 years
v200808140855webtools.sourceediting-200808140855.tar.gz  webtools.sourceediting-200808140855.tar.xz  webtools.sourceediting-200808140855.zip  nitind16 years
v200808111055webtools.sourceediting-200808111055.tar.gz  webtools.sourceediting-200808111055.tar.xz  webtools.sourceediting-200808111055.zip  nitind16 years
v200808111040webtools.sourceediting-200808111040.tar.gz  webtools.sourceediting-200808111040.tar.xz  webtools.sourceediting-200808111040.zip  nitind16 years
v200808091925webtools.sourceediting-200808091925.tar.gz  webtools.sourceediting-200808091925.tar.xz  webtools.sourceediting-200808091925.zip  nitind16 years
v200808072012webtools.sourceediting-200808072012.tar.gz  webtools.sourceediting-200808072012.tar.xz  webtools.sourceediting-200808072012.zip  nitind16 years
v200808072008webtools.sourceediting-200808072008.tar.gz  webtools.sourceediting-200808072008.tar.xz  webtools.sourceediting-200808072008.zip  nitind16 years
Root_T_Early302webtools.sourceediting-Root_T_Early302.tar.gz  webtools.sourceediting-Root_T_Early302.tar.xz  webtools.sourceediting-Root_T_Early302.zip  nitind16 years
Root_T_Early_302webtools.sourceediting-Root_T_Early_302.tar.gz  webtools.sourceediting-Root_T_Early_302.tar.xz  webtools.sourceediting-Root_T_Early_302.zip  nitind16 years
v200808071546webtools.sourceediting-200808071546.tar.gz  webtools.sourceediting-200808071546.tar.xz  webtools.sourceediting-200808071546.zip  nitind16 years
v200808071323webtools.sourceediting-200808071323.tar.gz  webtools.sourceediting-200808071323.tar.xz  webtools.sourceediting-200808071323.zip  nitind16 years
v200807310316webtools.sourceediting-200807310316.tar.gz  webtools.sourceediting-200807310316.tar.xz  webtools.sourceediting-200807310316.zip  nitind16 years
v200807310312webtools.sourceediting-200807310312.tar.gz  webtools.sourceediting-200807310312.tar.xz  webtools.sourceediting-200807310312.zip  nitind16 years
v200807310230webtools.sourceediting-200807310230.tar.gz  webtools.sourceediting-200807310230.tar.xz  webtools.sourceediting-200807310230.zip  nitind16 years
Root_JSDT302webtools.sourceediting-Root_JSDT302.tar.gz  webtools.sourceediting-Root_JSDT302.tar.xz  webtools.sourceediting-Root_JSDT302.zip  nitind16 years
Root_JSDT303webtools.sourceediting-Root_JSDT303.tar.gz  webtools.sourceediting-Root_JSDT303.tar.xz  webtools.sourceediting-Root_JSDT303.zip  nitind16 years
jsdt301webtools.sourceediting-jsdt301.tar.gz  webtools.sourceediting-jsdt301.tar.xz  webtools.sourceediting-jsdt301.zip  nitind16 years
v200807241900webtools.sourceediting-200807241900.tar.gz  webtools.sourceediting-200807241900.tar.xz  webtools.sourceediting-200807241900.zip  nitind16 years
v200807240448webtools.sourceediting-200807240448.tar.gz  webtools.sourceediting-200807240448.tar.xz  webtools.sourceediting-200807240448.zip  nitind16 years
v200807232215webtools.sourceediting-200807232215.tar.gz  webtools.sourceediting-200807232215.tar.xz  webtools.sourceediting-200807232215.zip  nitind16 years
v200807232135webtools.sourceediting-200807232135.tar.gz  webtools.sourceediting-200807232135.tar.xz  webtools.sourceediting-200807232135.zip  nitind16 years
v200807232119webtools.sourceediting-200807232119.tar.gz  webtools.sourceediting-200807232119.tar.xz  webtools.sourceediting-200807232119.zip  nitind16 years
v200807231855webtools.sourceediting-200807231855.tar.gz  webtools.sourceediting-200807231855.tar.xz  webtools.sourceediting-200807231855.zip  nitind16 years
v200807221525webtools.sourceediting-200807221525.tar.gz  webtools.sourceediting-200807221525.tar.xz  webtools.sourceediting-200807221525.zip  nitind16 years
v200807220739webtools.sourceediting-200807220739.tar.gz  webtools.sourceediting-200807220739.tar.xz  webtools.sourceediting-200807220739.zip  nitind16 years
v200807220733webtools.sourceediting-200807220733.tar.gz  webtools.sourceediting-200807220733.tar.xz  webtools.sourceediting-200807220733.zip  nitind16 years
v200807220523webtools.sourceediting-200807220523.tar.gz  webtools.sourceediting-200807220523.tar.xz  webtools.sourceediting-200807220523.zip  nitind16 years
v200807220139webtools.sourceediting-200807220139.tar.gz  webtools.sourceediting-200807220139.tar.xz  webtools.sourceediting-200807220139.zip  nitind16 years
v200807232357webtools.sourceediting-200807232357.tar.gz  webtools.sourceediting-200807232357.tar.xz  webtools.sourceediting-200807232357.zip  nitind16 years
v200807170740webtools.sourceediting-200807170740.tar.gz  webtools.sourceediting-200807170740.tar.xz  webtools.sourceediting-200807170740.zip  nitind16 years
v200807170542webtools.sourceediting-200807170542.tar.gz  webtools.sourceediting-200807170542.tar.xz  webtools.sourceediting-200807170542.zip  nitind16 years
v200807170535webtools.sourceediting-200807170535.tar.gz  webtools.sourceediting-200807170535.tar.xz  webtools.sourceediting-200807170535.zip  nitind16 years
v200807170605webtools.sourceediting-200807170605.tar.gz  webtools.sourceediting-200807170605.tar.xz  webtools.sourceediting-200807170605.zip  nitind16 years
v200807170520webtools.sourceediting-200807170520.tar.gz  webtools.sourceediting-200807170520.tar.xz  webtools.sourceediting-200807170520.zip  nitind16 years
v200807100715webtools.sourceediting-200807100715.tar.gz  webtools.sourceediting-200807100715.tar.xz  webtools.sourceediting-200807100715.zip  nitind16 years
v200807092156webtools.sourceediting-200807092156.tar.gz  webtools.sourceediting-200807092156.tar.xz  webtools.sourceediting-200807092156.zip  nitind16 years
v200807081731webtools.sourceediting-200807081731.tar.gz  webtools.sourceediting-200807081731.tar.xz  webtools.sourceediting-200807081731.zip  nitind16 years
v200807081710webtools.sourceediting-200807081710.tar.gz  webtools.sourceediting-200807081710.tar.xz  webtools.sourceediting-200807081710.zip  nitind16 years
v200807070400webtools.sourceediting-200807070400.tar.gz  webtools.sourceediting-200807070400.tar.xz  webtools.sourceediting-200807070400.zip  nitind16 years
v200807070351webtools.sourceediting-200807070351.tar.gz  webtools.sourceediting-200807070351.tar.xz  webtools.sourceediting-200807070351.zip  nitind16 years
v200807070343webtools.sourceediting-200807070343.tar.gz  webtools.sourceediting-200807070343.tar.xz  webtools.sourceediting-200807070343.zip  nitind16 years
v200807070318webtools.sourceediting-200807070318.tar.gz  webtools.sourceediting-200807070318.tar.xz  webtools.sourceediting-200807070318.zip  nitind16 years
v200807050745webtools.sourceediting-200807050745.tar.gz  webtools.sourceediting-200807050745.tar.xz  webtools.sourceediting-200807050745.zip  nitind16 years
v200807030900webtools.sourceediting-200807030900.tar.gz  webtools.sourceediting-200807030900.tar.xz  webtools.sourceediting-200807030900.zip  nitind16 years
v200807030835webtools.sourceediting-200807030835.tar.gz  webtools.sourceediting-200807030835.tar.xz  webtools.sourceediting-200807030835.zip  nitind16 years
v200806302140webtools.sourceediting-200806302140.tar.gz  webtools.sourceediting-200806302140.tar.xz  webtools.sourceediting-200806302140.zip  nitind16 years
v20080909webtools.sourceediting-20080909.tar.gz  webtools.sourceediting-20080909.tar.xz  webtools.sourceediting-20080909.zip  nitind16 years
v200806270315webtools.sourceediting-200806270315.tar.gz  webtools.sourceediting-200806270315.tar.xz  webtools.sourceediting-200806270315.zip  nitind16 years
v200806270231webtools.sourceediting-200806270231.tar.gz  webtools.sourceediting-200806270231.tar.xz  webtools.sourceediting-200806270231.zip  nitind16 years
v200806270230webtools.sourceediting-200806270230.tar.gz  webtools.sourceediting-200806270230.tar.xz  webtools.sourceediting-200806270230.zip  nitind16 years
v200807092146webtools.sourceediting-200807092146.tar.gz  webtools.sourceediting-200807092146.tar.xz  webtools.sourceediting-200807092146.zip  nitind16 years
v200806252211webtools.sourceediting-200806252211.tar.gz  webtools.sourceediting-200806252211.tar.xz  webtools.sourceediting-200806252211.zip  nitind16 years
R2_0_3webtools.sourceediting-R2_0_3.tar.gz  webtools.sourceediting-R2_0_3.tar.xz  webtools.sourceediting-R2_0_3.zip  nitind16 years
v200806261636webtools.sourceediting-200806261636.tar.gz  webtools.sourceediting-200806261636.tar.xz  webtools.sourceediting-200806261636.zip  nitind16 years
v2008062300800webtools.sourceediting-2008062300800.tar.gz  webtools.sourceediting-2008062300800.tar.xz  webtools.sourceediting-2008062300800.zip  nitind16 years
v200806221945webtools.sourceediting-200806221945.tar.gz  webtools.sourceediting-200806221945.tar.xz  webtools.sourceediting-200806221945.zip  nitind16 years
v200806191440webtools.sourceediting-200806191440.tar.gz  webtools.sourceediting-200806191440.tar.xz  webtools.sourceediting-200806191440.zip  david_williams16 years
v200806190435webtools.sourceediting-200806190435.tar.gz  webtools.sourceediting-200806190435.tar.xz  webtools.sourceediting-200806190435.zip  david_williams16 years
v200806111800webtools.sourceediting-200806111800.tar.gz  webtools.sourceediting-200806111800.tar.xz  webtools.sourceediting-200806111800.zip  nitind16 years
v200806110525webtools.sourceediting-200806110525.tar.gz  webtools.sourceediting-200806110525.tar.xz  webtools.sourceediting-200806110525.zip  nitind16 years
v200806100245webtools.sourceediting-200806100245.tar.gz  webtools.sourceediting-200806100245.tar.xz  webtools.sourceediting-200806100245.zip  nitind16 years
v200806092130webtools.sourceediting-200806092130.tar.gz  webtools.sourceediting-200806092130.tar.xz  webtools.sourceediting-200806092130.zip  nitind16 years
R3_0_0webtools.sourceediting-R3_0_0.tar.gz  webtools.sourceediting-R3_0_0.tar.xz  webtools.sourceediting-R3_0_0.zip  nitind16 years
v200806081733webtools.sourceediting-200806081733.tar.gz  webtools.sourceediting-200806081733.tar.xz  webtools.sourceediting-200806081733.zip  nitind16 years
v200806081732webtools.sourceediting-200806081732.tar.gz  webtools.sourceediting-200806081732.tar.xz  webtools.sourceediting-200806081732.zip  nitind16 years
v200806081731webtools.sourceediting-200806081731.tar.gz  webtools.sourceediting-200806081731.tar.xz  webtools.sourceediting-200806081731.zip  nitind16 years
v200806081730webtools.sourceediting-200806081730.tar.gz  webtools.sourceediting-200806081730.tar.xz  webtools.sourceediting-200806081730.zip  nitind16 years
v200806080830webtools.sourceediting-200806080830.tar.gz  webtools.sourceediting-200806080830.tar.xz  webtools.sourceediting-200806080830.zip  nitind16 years
v200806080815webtools.sourceediting-200806080815.tar.gz  webtools.sourceediting-200806080815.tar.xz  webtools.sourceediting-200806080815.zip  nitind16 years
v200806072033webtools.sourceediting-200806072033.tar.gz  webtools.sourceediting-200806072033.tar.xz  webtools.sourceediting-200806072033.zip  nitind16 years
v200806072030webtools.sourceediting-200806072030.tar.gz  webtools.sourceediting-200806072030.tar.xz  webtools.sourceediting-200806072030.zip  nitind16 years
v200806071842webtools.sourceediting-200806071842.tar.gz  webtools.sourceediting-200806071842.tar.xz  webtools.sourceediting-200806071842.zip  nitind16 years
v200806052254webtools.sourceediting-200806052254.tar.gz  webtools.sourceediting-200806052254.tar.xz  webtools.sourceediting-200806052254.zip  nitind16 years
v200806051910webtools.sourceediting-200806051910.tar.gz  webtools.sourceediting-200806051910.tar.xz  webtools.sourceediting-200806051910.zip  nitind16 years
v200806051715webtools.sourceediting-200806051715.tar.gz  webtools.sourceediting-200806051715.tar.xz  webtools.sourceediting-200806051715.zip  nitind16 years
v200806051600webtools.sourceediting-200806051600.tar.gz  webtools.sourceediting-200806051600.tar.xz  webtools.sourceediting-200806051600.zip  nitind16 years
v200806051500webtools.sourceediting-200806051500.tar.gz  webtools.sourceediting-200806051500.tar.xz  webtools.sourceediting-200806051500.zip  nitind16 years
v200806050800webtools.sourceediting-200806050800.tar.gz  webtools.sourceediting-200806050800.tar.xz  webtools.sourceediting-200806050800.zip  nitind16 years
v200806050630webtools.sourceediting-200806050630.tar.gz  webtools.sourceediting-200806050630.tar.xz  webtools.sourceediting-200806050630.zip  nitind16 years
Root_david_williams_tempTests2webtools.sourceediting-Root_david_williams_tempTests2.tar.gz  webtools.sourceediting-Root_david_williams_tempTests2.tar.xz  webtools.sourceediting-Root_david_williams_tempTests2.zip  nitind16 years
v200806050320webtools.sourceediting-200806050320.tar.gz  webtools.sourceediting-200806050320.tar.xz  webtools.sourceediting-200806050320.zip  nitind16 years
v200806050300webtools.sourceediting-200806050300.tar.gz  webtools.sourceediting-200806050300.tar.xz  webtools.sourceediting-200806050300.zip  nitind16 years
v200806042020webtools.sourceediting-200806042020.tar.gz  webtools.sourceediting-200806042020.tar.xz  webtools.sourceediting-200806042020.zip  nitind16 years
v200806041847webtools.sourceediting-200806041847.tar.gz  webtools.sourceediting-200806041847.tar.xz  webtools.sourceediting-200806041847.zip  nitind16 years
v200806021952webtools.sourceediting-200806021952.tar.gz  webtools.sourceediting-200806021952.tar.xz  webtools.sourceediting-200806021952.zip  nitind16 years
v200806020915webtools.sourceediting-200806020915.tar.gz  webtools.sourceediting-200806020915.tar.xz  webtools.sourceediting-200806020915.zip  nitind16 years
v200806020650webtools.sourceediting-200806020650.tar.gz  webtools.sourceediting-200806020650.tar.xz  webtools.sourceediting-200806020650.zip  nitind16 years
v200806010600webtools.sourceediting-200806010600.tar.gz  webtools.sourceediting-200806010600.tar.xz  webtools.sourceediting-200806010600.zip  nitind16 years
v20080601-addhtml401webtools.sourceediting-20080601-addhtml401.tar.gz  webtools.sourceediting-20080601-addhtml401.tar.xz  webtools.sourceediting-20080601-addhtml401.zip  nitind16 years
v200805301547webtools.sourceediting-200805301547.tar.gz  webtools.sourceediting-200805301547.tar.xz  webtools.sourceediting-200805301547.zip  nitind16 years
v200805301545webtools.sourceediting-200805301545.tar.gz  webtools.sourceediting-200805301545.tar.xz  webtools.sourceediting-200805301545.zip  nitind16 years
v200805291846webtools.sourceediting-200805291846.tar.gz  webtools.sourceediting-200805291846.tar.xz  webtools.sourceediting-200805291846.zip  nitind16 years
v200805290005webtools.sourceediting-200805290005.tar.gz  webtools.sourceediting-200805290005.tar.xz  webtools.sourceediting-200805290005.zip  nitind16 years
v200805282012webtools.sourceediting-200805282012.tar.gz  webtools.sourceediting-200805282012.tar.xz  webtools.sourceediting-200805282012.zip  nitind16 years
v200805281955webtools.sourceediting-200805281955.tar.gz  webtools.sourceediting-200805281955.tar.xz  webtools.sourceediting-200805281955.zip  nitind16 years
v200805281545webtools.sourceediting-200805281545.tar.gz  webtools.sourceediting-200805281545.tar.xz  webtools.sourceediting-200805281545.zip  nitind16 years
v200805230600webtools.sourceediting-200805230600.tar.gz  webtools.sourceediting-200805230600.tar.xz  webtools.sourceediting-200805230600.zip  nitind16 years
v200805221637webtools.sourceediting-200805221637.tar.gz  webtools.sourceediting-200805221637.tar.xz  webtools.sourceediting-200805221637.zip  nitind16 years
v200805221633webtools.sourceediting-200805221633.tar.gz  webtools.sourceediting-200805221633.tar.xz  webtools.sourceediting-200805221633.zip  nitind16 years
v200805221604webtools.sourceediting-200805221604.tar.gz  webtools.sourceediting-200805221604.tar.xz  webtools.sourceediting-200805221604.zip  nitind16 years
v200805210422webtools.sourceediting-200805210422.tar.gz  webtools.sourceediting-200805210422.tar.xz  webtools.sourceediting-200805210422.zip  nitind16 years
v200805211530webtools.sourceediting-200805211530.tar.gz  webtools.sourceediting-200805211530.tar.xz  webtools.sourceediting-200805211530.zip  nitind16 years
v200805160650webtools.sourceediting-200805160650.tar.gz  webtools.sourceediting-200805160650.tar.xz  webtools.sourceediting-200805160650.zip  nitind16 years
v200805152207webtools.sourceediting-200805152207.tar.gz  webtools.sourceediting-200805152207.tar.xz  webtools.sourceediting-200805152207.zip  nitind16 years
v200805151943webtools.sourceediting-200805151943.tar.gz  webtools.sourceediting-200805151943.tar.xz  webtools.sourceediting-200805151943.zip  nitind16 years
v200805150134webtools.sourceediting-200805150134.tar.gz  webtools.sourceediting-200805150134.tar.xz  webtools.sourceediting-200805150134.zip  nitind16 years
v200805150028webtools.sourceediting-200805150028.tar.gz  webtools.sourceediting-200805150028.tar.xz  webtools.sourceediting-200805150028.zip  nitind16 years
v200805142245webtools.sourceediting-200805142245.tar.gz  webtools.sourceediting-200805142245.tar.xz  webtools.sourceediting-200805142245.zip  nitind16 years
v200805142308webtools.sourceediting-200805142308.tar.gz  webtools.sourceediting-200805142308.tar.xz  webtools.sourceediting-200805142308.zip  nitind16 years
Root_Branch301webtools.sourceediting-Root_Branch301.tar.gz  webtools.sourceediting-Root_Branch301.tar.xz  webtools.sourceediting-Root_Branch301.zip  nitind16 years
v200805141231webtools.sourceediting-200805141231.tar.gz  webtools.sourceediting-200805141231.tar.xz  webtools.sourceediting-200805141231.zip  nitind16 years
v200805140415webtools.sourceediting-200805140415.tar.gz  webtools.sourceediting-200805140415.tar.xz  webtools.sourceediting-200805140415.zip  nitind16 years
v200805140305webtools.sourceediting-200805140305.tar.gz  webtools.sourceediting-200805140305.tar.xz  webtools.sourceediting-200805140305.zip  nitind16 years
v200805140200webtools.sourceediting-200805140200.tar.gz  webtools.sourceediting-200805140200.tar.xz  webtools.sourceediting-200805140200.zip  nitind16 years
v200805140022webtools.sourceediting-200805140022.tar.gz  webtools.sourceediting-200805140022.tar.xz  webtools.sourceediting-200805140022.zip  nitind16 years
v200805140020webtools.sourceediting-200805140020.tar.gz  webtools.sourceediting-200805140020.tar.xz  webtools.sourceediting-200805140020.zip  nitind16 years
v200805132221webtools.sourceediting-200805132221.tar.gz  webtools.sourceediting-200805132221.tar.xz  webtools.sourceediting-200805132221.zip  nitind16 years
v200805131635webtools.sourceediting-200805131635.tar.gz  webtools.sourceediting-200805131635.tar.xz  webtools.sourceediting-200805131635.zip  nitind16 years
v200805130630webtools.sourceediting-200805130630.tar.gz  webtools.sourceediting-200805130630.tar.xz  webtools.sourceediting-200805130630.zip  nitind16 years
v200805130626webtools.sourceediting-200805130626.tar.gz  webtools.sourceediting-200805130626.tar.xz  webtools.sourceediting-200805130626.zip  nitind16 years
v200805122136webtools.sourceediting-200805122136.tar.gz  webtools.sourceediting-200805122136.tar.xz  webtools.sourceediting-200805122136.zip  nitind16 years
v200805122117webtools.sourceediting-200805122117.tar.gz  webtools.sourceediting-200805122117.tar.xz  webtools.sourceediting-200805122117.zip  nitind16 years
v200805122109webtools.sourceediting-200805122109.tar.gz  webtools.sourceediting-200805122109.tar.xz  webtools.sourceediting-200805122109.zip  nitind16 years
v200805082206webtools.sourceediting-200805082206.tar.gz  webtools.sourceediting-200805082206.tar.xz  webtools.sourceediting-200805082206.zip  nitind16 years
v200805082134webtools.sourceediting-200805082134.tar.gz  webtools.sourceediting-200805082134.tar.xz  webtools.sourceediting-200805082134.zip  nitind16 years
v200805082133webtools.sourceediting-200805082133.tar.gz  webtools.sourceediting-200805082133.tar.xz  webtools.sourceediting-200805082133.zip  nitind16 years
v200805040310webtools.sourceediting-200805040310.tar.gz  webtools.sourceediting-200805040310.tar.xz  webtools.sourceediting-200805040310.zip  nitind16 years
v200805040226webtools.sourceediting-200805040226.tar.gz  webtools.sourceediting-200805040226.tar.xz  webtools.sourceediting-200805040226.zip  nitind16 years
v200805040201webtools.sourceediting-200805040201.tar.gz  webtools.sourceediting-200805040201.tar.xz  webtools.sourceediting-200805040201.zip  nitind16 years
v200805040200webtools.sourceediting-200805040200.tar.gz  webtools.sourceediting-200805040200.tar.xz  webtools.sourceediting-200805040200.zip  nitind16 years
v200805040010webtools.sourceediting-200805040010.tar.gz  webtools.sourceediting-200805040010.tar.xz  webtools.sourceediting-200805040010.zip  nitind16 years
v200805021400webtools.sourceediting-200805021400.tar.gz  webtools.sourceediting-200805021400.tar.xz  webtools.sourceediting-200805021400.zip  nitind16 years
v200805020221webtools.sourceediting-200805020221.tar.gz  webtools.sourceediting-200805020221.tar.xz  webtools.sourceediting-200805020221.zip  nitind16 years
v200805020220webtools.sourceediting-200805020220.tar.gz  webtools.sourceediting-200805020220.tar.xz  webtools.sourceediting-200805020220.zip  nitind16 years
v200805011940webtools.sourceediting-200805011940.tar.gz  webtools.sourceediting-200805011940.tar.xz  webtools.sourceediting-200805011940.zip  nitind16 years
v200804302330webtools.sourceediting-200804302330.tar.gz  webtools.sourceediting-200804302330.tar.xz  webtools.sourceediting-200804302330.zip  nitind16 years
v200805010322webtools.sourceediting-200805010322.tar.gz  webtools.sourceediting-200805010322.tar.xz  webtools.sourceediting-200805010322.zip  nitind16 years
v200805010257webtools.sourceediting-200805010257.tar.gz  webtools.sourceediting-200805010257.tar.xz  webtools.sourceediting-200805010257.zip  nitind16 years
v200804302218webtools.sourceediting-200804302218.tar.gz  webtools.sourceediting-200804302218.tar.xz  webtools.sourceediting-200804302218.zip  nitind16 years
Root_Cleanup0508webtools.sourceediting-Root_Cleanup0508.tar.gz  webtools.sourceediting-Root_Cleanup0508.tar.xz  webtools.sourceediting-Root_Cleanup0508.zip  nitind16 years
v200804301938webtools.sourceediting-200804301938.tar.gz  webtools.sourceediting-200804301938.tar.xz  webtools.sourceediting-200804301938.zip  nitind16 years
v200804302010webtools.sourceediting-200804302010.tar.gz  webtools.sourceediting-200804302010.tar.xz  webtools.sourceediting-200804302010.zip  nitind16 years
v200804302007webtools.sourceediting-200804302007.tar.gz  webtools.sourceediting-200804302007.tar.xz  webtools.sourceediting-200804302007.zip  nitind16 years
v200804300610webtools.sourceediting-200804300610.tar.gz  webtools.sourceediting-200804300610.tar.xz  webtools.sourceediting-200804300610.zip  nitind16 years
v200804291638webtools.sourceediting-200804291638.tar.gz  webtools.sourceediting-200804291638.tar.xz  webtools.sourceediting-200804291638.zip  nitind16 years
v200804290124webtools.sourceediting-200804290124.tar.gz  webtools.sourceediting-200804290124.tar.xz  webtools.sourceediting-200804290124.zip  nitind16 years
v200804240612webtools.sourceediting-200804240612.tar.gz  webtools.sourceediting-200804240612.tar.xz  webtools.sourceediting-200804240612.zip  nitind16 years
v200804240538webtools.sourceediting-200804240538.tar.gz  webtools.sourceediting-200804240538.tar.xz  webtools.sourceediting-200804240538.zip  nitind16 years
v200804240527webtools.sourceediting-200804240527.tar.gz  webtools.sourceediting-200804240527.tar.xz  webtools.sourceediting-200804240527.zip  nitind16 years
v200804240437webtools.sourceediting-200804240437.tar.gz  webtools.sourceediting-200804240437.tar.xz  webtools.sourceediting-200804240437.zip  nitind16 years
v200804240335webtools.sourceediting-200804240335.tar.gz  webtools.sourceediting-200804240335.tar.xz  webtools.sourceediting-200804240335.zip  nitind16 years
v200804240210webtools.sourceediting-200804240210.tar.gz  webtools.sourceediting-200804240210.tar.xz  webtools.sourceediting-200804240210.zip  nitind16 years
v2008050028webtools.sourceediting-2008050028.tar.gz  webtools.sourceediting-2008050028.tar.xz  webtools.sourceediting-2008050028.zip  nitind16 years
v2008050002webtools.sourceediting-2008050002.tar.gz  webtools.sourceediting-2008050002.tar.xz  webtools.sourceediting-2008050002.zip  nitind16 years
v200804232416webtools.sourceediting-200804232416.tar.gz  webtools.sourceediting-200804232416.tar.xz  webtools.sourceediting-200804232416.zip  nitind16 years
v200804232359webtools.sourceediting-200804232359.tar.gz  webtools.sourceediting-200804232359.tar.xz  webtools.sourceediting-200804232359.zip  nitind16 years
v200804232351webtools.sourceediting-200804232351.tar.gz  webtools.sourceediting-200804232351.tar.xz  webtools.sourceediting-200804232351.zip  nitind16 years
v200804231413webtools.sourceediting-200804231413.tar.gz  webtools.sourceediting-200804231413.tar.xz  webtools.sourceediting-200804231413.zip  nitind16 years
v200804232224webtools.sourceediting-200804232224.tar.gz  webtools.sourceediting-200804232224.tar.xz  webtools.sourceediting-200804232224.zip  nitind16 years
Root_Refactor0428webtools.sourceediting-Root_Refactor0428.tar.gz  webtools.sourceediting-Root_Refactor0428.tar.xz  webtools.sourceediting-Root_Refactor0428.zip  nitind16 years
v200804230230webtools.sourceediting-200804230230.tar.gz  webtools.sourceediting-200804230230.tar.xz  webtools.sourceediting-200804230230.zip  nitind16 years
v200804220215webtools.sourceediting-200804220215.tar.gz  webtools.sourceediting-200804220215.tar.xz  webtools.sourceediting-200804220215.zip  nitind16 years
v200804211825webtools.sourceediting-200804211825.tar.gz  webtools.sourceediting-200804211825.tar.xz  webtools.sourceediting-200804211825.zip  nitind16 years
v200804211820webtools.sourceediting-200804211820.tar.gz  webtools.sourceediting-200804211820.tar.xz  webtools.sourceediting-200804211820.zip  nitind16 years
v200804211743webtools.sourceediting-200804211743.tar.gz  webtools.sourceediting-200804211743.tar.xz  webtools.sourceediting-200804211743.zip  nitind16 years
v2008050004webtools.sourceediting-2008050004.tar.gz  webtools.sourceediting-2008050004.tar.xz  webtools.sourceediting-2008050004.zip  nitind16 years
v200804162335webtools.sourceediting-200804162335.tar.gz  webtools.sourceediting-200804162335.tar.xz  webtools.sourceediting-200804162335.zip  nitind16 years
v200804161710webtools.sourceediting-200804161710.tar.gz  webtools.sourceediting-200804161710.tar.xz  webtools.sourceediting-200804161710.zip  nitind16 years
v200804142219webtools.sourceediting-200804142219.tar.gz  webtools.sourceediting-200804142219.tar.xz  webtools.sourceediting-200804142219.zip  nitind16 years
v200804141818webtools.sourceediting-200804141818.tar.gz  webtools.sourceediting-200804141818.tar.xz  webtools.sourceediting-200804141818.zip  nitind16 years
v200804100606webtools.sourceediting-200804100606.tar.gz  webtools.sourceediting-200804100606.tar.xz  webtools.sourceediting-200804100606.zip  nitind16 years
v200804092352webtools.sourceediting-200804092352.tar.gz  webtools.sourceediting-200804092352.tar.xz  webtools.sourceediting-200804092352.zip  nitind16 years
v200804091743webtools.sourceediting-200804091743.tar.gz  webtools.sourceediting-200804091743.tar.xz  webtools.sourceediting-200804091743.zip  nitind16 years
v200804091733webtools.sourceediting-200804091733.tar.gz  webtools.sourceediting-200804091733.tar.xz  webtools.sourceediting-200804091733.zip  nitind16 years
v200804091628webtools.sourceediting-200804091628.tar.gz  webtools.sourceediting-200804091628.tar.xz  webtools.sourceediting-200804091628.zip  nitind16 years
v200804162336webtools.sourceediting-200804162336.tar.gz  webtools.sourceediting-200804162336.tar.xz  webtools.sourceediting-200804162336.zip  nitind16 years
v200804040626webtools.sourceediting-200804040626.tar.gz  webtools.sourceediting-200804040626.tar.xz  webtools.sourceediting-200804040626.zip  nitind16 years
v200804032120webtools.sourceediting-200804032120.tar.gz  webtools.sourceediting-200804032120.tar.xz  webtools.sourceediting-200804032120.zip  nitind16 years
v200804032007webtools.sourceediting-200804032007.tar.gz  webtools.sourceediting-200804032007.tar.xz  webtools.sourceediting-200804032007.zip  nitind16 years
v200804030647webtools.sourceediting-200804030647.tar.gz  webtools.sourceediting-200804030647.tar.xz  webtools.sourceediting-200804030647.zip  nitind16 years
v200804030205webtools.sourceediting-200804030205.tar.gz  webtools.sourceediting-200804030205.tar.xz  webtools.sourceediting-200804030205.zip  nitind16 years
v200804030054webtools.sourceediting-200804030054.tar.gz  webtools.sourceediting-200804030054.tar.xz  webtools.sourceediting-200804030054.zip  nitind16 years
v200804022225webtools.sourceediting-200804022225.tar.gz  webtools.sourceediting-200804022225.tar.xz  webtools.sourceediting-200804022225.zip  nitind16 years
v200804021903webtools.sourceediting-200804021903.tar.gz  webtools.sourceediting-200804021903.tar.xz  webtools.sourceediting-200804021903.zip  nitind16 years
v200804021833webtools.sourceediting-200804021833.tar.gz  webtools.sourceediting-200804021833.tar.xz  webtools.sourceediting-200804021833.zip  nitind16 years
v200804021800webtools.sourceediting-200804021800.tar.gz  webtools.sourceediting-200804021800.tar.xz  webtools.sourceediting-200804021800.zip  nitind16 years
v200804021739webtools.sourceediting-200804021739.tar.gz  webtools.sourceediting-200804021739.tar.xz  webtools.sourceediting-200804021739.zip  nitind16 years
v200804021607webtools.sourceediting-200804021607.tar.gz  webtools.sourceediting-200804021607.tar.xz  webtools.sourceediting-200804021607.zip  nitind16 years
v200804021524webtools.sourceediting-200804021524.tar.gz  webtools.sourceediting-200804021524.tar.xz  webtools.sourceediting-200804021524.zip  nitind16 years
v200804022258webtools.sourceediting-200804022258.tar.gz  webtools.sourceediting-200804022258.tar.xz  webtools.sourceediting-200804022258.zip  nitind16 years
v200804020355webtools.sourceediting-200804020355.tar.gz  webtools.sourceediting-200804020355.tar.xz  webtools.sourceediting-200804020355.zip  nitind16 years
v200804020515webtools.sourceediting-200804020515.tar.gz  webtools.sourceediting-200804020515.tar.xz  webtools.sourceediting-200804020515.zip  nitind16 years
v200804012002webtools.sourceediting-200804012002.tar.gz  webtools.sourceediting-200804012002.tar.xz  webtools.sourceediting-200804012002.zip  nitind16 years
v200804011757webtools.sourceediting-200804011757.tar.gz  webtools.sourceediting-200804011757.tar.xz  webtools.sourceediting-200804011757.zip  nitind16 years
v200804011700webtools.sourceediting-200804011700.tar.gz  webtools.sourceediting-200804011700.tar.xz  webtools.sourceediting-200804011700.zip  nitind16 years
v200804010115webtools.sourceediting-200804010115.tar.gz  webtools.sourceediting-200804010115.tar.xz  webtools.sourceediting-200804010115.zip  nitind16 years
v200803310700webtools.sourceediting-200803310700.tar.gz  webtools.sourceediting-200803310700.tar.xz  webtools.sourceediting-200803310700.zip  nitind16 years
v200803282310webtools.sourceediting-200803282310.tar.gz  webtools.sourceediting-200803282310.tar.xz  webtools.sourceediting-200803282310.zip  nitind16 years
v200803281848webtools.sourceediting-200803281848.tar.gz  webtools.sourceediting-200803281848.tar.xz  webtools.sourceediting-200803281848.zip  nitind16 years
v200803271141webtools.sourceediting-200803271141.tar.gz  webtools.sourceediting-200803271141.tar.xz  webtools.sourceediting-200803271141.zip  nitind16 years
v200803270717webtools.sourceediting-200803270717.tar.gz  webtools.sourceediting-200803270717.tar.xz  webtools.sourceediting-200803270717.zip  nitind16 years
v200803270601webtools.sourceediting-200803270601.tar.gz  webtools.sourceediting-200803270601.tar.xz  webtools.sourceediting-200803270601.zip  nitind16 years
v200803270323webtools.sourceediting-200803270323.tar.gz  webtools.sourceediting-200803270323.tar.xz  webtools.sourceediting-200803270323.zip  nitind16 years
v200803270327webtools.sourceediting-200803270327.tar.gz  webtools.sourceediting-200803270327.tar.xz  webtools.sourceediting-200803270327.zip  nitind16 years
v200803262310webtools.sourceediting-200803262310.tar.gz  webtools.sourceediting-200803262310.tar.xz  webtools.sourceediting-200803262310.zip  nitind16 years
v200803262325webtools.sourceediting-200803262325.tar.gz  webtools.sourceediting-200803262325.tar.xz  webtools.sourceediting-200803262325.zip  nitind16 years
v200803262324webtools.sourceediting-200803262324.tar.gz  webtools.sourceediting-200803262324.tar.xz  webtools.sourceediting-200803262324.zip  nitind16 years
v200803261940webtools.sourceediting-200803261940.tar.gz  webtools.sourceediting-200803261940.tar.xz  webtools.sourceediting-200803261940.zip  nitind16 years
v200803261954webtools.sourceediting-200803261954.tar.gz  webtools.sourceediting-200803261954.tar.xz  webtools.sourceediting-200803261954.zip  nitind16 years
v200803260607webtools.sourceediting-200803260607.tar.gz  webtools.sourceediting-200803260607.tar.xz  webtools.sourceediting-200803260607.zip  nitind16 years
v200803261945webtools.sourceediting-200803261945.tar.gz  webtools.sourceediting-200803261945.tar.xz  webtools.sourceediting-200803261945.zip  nitind16 years
v200803260015webtools.sourceediting-200803260015.tar.gz  webtools.sourceediting-200803260015.tar.xz  webtools.sourceediting-200803260015.zip  nitind16 years
v200803251830webtools.sourceediting-200803251830.tar.gz  webtools.sourceediting-200803251830.tar.xz  webtools.sourceediting-200803251830.zip  nitind16 years
v200803250550webtools.sourceediting-200803250550.tar.gz  webtools.sourceediting-200803250550.tar.xz  webtools.sourceediting-200803250550.zip  nitind16 years
v200803250340webtools.sourceediting-200803250340.tar.gz  webtools.sourceediting-200803250340.tar.xz  webtools.sourceediting-200803250340.zip  nitind16 years
v200803242351webtools.sourceediting-200803242351.tar.gz  webtools.sourceediting-200803242351.tar.xz  webtools.sourceediting-200803242351.zip  nitind16 years
v200803242140webtools.sourceediting-200803242140.tar.gz  webtools.sourceediting-200803242140.tar.xz  webtools.sourceediting-200803242140.zip  nitind16 years
v200803171751webtools.sourceediting-200803171751.tar.gz  webtools.sourceediting-200803171751.tar.xz  webtools.sourceediting-200803171751.zip  nitind17 years
v200803171750webtools.sourceediting-200803171750.tar.gz  webtools.sourceediting-200803171750.tar.xz  webtools.sourceediting-200803171750.zip  nitind17 years
v200803140234webtools.sourceediting-200803140234.tar.gz  webtools.sourceediting-200803140234.tar.xz  webtools.sourceediting-200803140234.zip  nitind17 years
v200803122240webtools.sourceediting-200803122240.tar.gz  webtools.sourceediting-200803122240.tar.xz  webtools.sourceediting-200803122240.zip  nitind17 years
v200803122230webtools.sourceediting-200803122230.tar.gz  webtools.sourceediting-200803122230.tar.xz  webtools.sourceediting-200803122230.zip  nitind17 years
v200803111809webtools.sourceediting-200803111809.tar.gz  webtools.sourceediting-200803111809.tar.xz  webtools.sourceediting-200803111809.zip  nitind17 years
v200803111739webtools.sourceediting-200803111739.tar.gz  webtools.sourceediting-200803111739.tar.xz  webtools.sourceediting-200803111739.zip  nitind17 years
v200803111627webtools.sourceediting-200803111627.tar.gz  webtools.sourceediting-200803111627.tar.xz  webtools.sourceediting-200803111627.zip  nitind17 years
v200803102008webtools.sourceediting-200803102008.tar.gz  webtools.sourceediting-200803102008.tar.xz  webtools.sourceediting-200803102008.zip  nitind17 years
v200803102000webtools.sourceediting-200803102000.tar.gz  webtools.sourceediting-200803102000.tar.xz  webtools.sourceediting-200803102000.zip  nitind17 years
v200803091528webtools.sourceediting-200803091528.tar.gz  webtools.sourceediting-200803091528.tar.xz  webtools.sourceediting-200803091528.zip  nitind17 years
v200803060200webtools.sourceediting-200803060200.tar.gz  webtools.sourceediting-200803060200.tar.xz  webtools.sourceediting-200803060200.zip  nitind17 years
v200803052343webtools.sourceediting-200803052343.tar.gz  webtools.sourceediting-200803052343.tar.xz  webtools.sourceediting-200803052343.zip  nitind17 years
v200803041435webtools.sourceediting-200803041435.tar.gz  webtools.sourceediting-200803041435.tar.xz  webtools.sourceediting-200803041435.zip  nitind17 years
v200803032142webtools.sourceediting-200803032142.tar.gz  webtools.sourceediting-200803032142.tar.xz  webtools.sourceediting-200803032142.zip  nitind17 years
v200803032012webtools.sourceediting-200803032012.tar.gz  webtools.sourceediting-200803032012.tar.xz  webtools.sourceediting-200803032012.zip  nitind17 years
v200803032013webtools.sourceediting-200803032013.tar.gz  webtools.sourceediting-200803032013.tar.xz  webtools.sourceediting-200803032013.zip  nitind17 years
v200802280901webtools.sourceediting-200802280901.tar.gz  webtools.sourceediting-200802280901.tar.xz  webtools.sourceediting-200802280901.zip  nitind17 years
v200802280713webtools.sourceediting-200802280713.tar.gz  webtools.sourceediting-200802280713.tar.xz  webtools.sourceediting-200802280713.zip  nitind17 years
v200802280635webtools.sourceediting-200802280635.tar.gz  webtools.sourceediting-200802280635.tar.xz  webtools.sourceediting-200802280635.zip  nitind17 years
v200802280619webtools.sourceediting-200802280619.tar.gz  webtools.sourceediting-200802280619.tar.xz  webtools.sourceediting-200802280619.zip  nitind17 years
v200802252237webtools.sourceediting-200802252237.tar.gz  webtools.sourceediting-200802252237.tar.xz  webtools.sourceediting-200802252237.zip  nitind17 years
v200802251558webtools.sourceediting-200802251558.tar.gz  webtools.sourceediting-200802251558.tar.xz  webtools.sourceediting-200802251558.zip  nitind17 years
v200802272248webtools.sourceediting-200802272248.tar.gz  webtools.sourceediting-200802272248.tar.xz  webtools.sourceediting-200802272248.zip  nitind17 years
v200802132239webtools.sourceediting-200802132239.tar.gz  webtools.sourceediting-200802132239.tar.xz  webtools.sourceediting-200802132239.zip  nitind17 years
v200802151147webtools.sourceediting-200802151147.tar.gz  webtools.sourceediting-200802151147.tar.xz  webtools.sourceediting-200802151147.zip  nitind17 years
v200802150100webtools.sourceediting-200802150100.tar.gz  webtools.sourceediting-200802150100.tar.xz  webtools.sourceediting-200802150100.zip  nitind17 years
R2_0_2webtools.sourceediting-R2_0_2.tar.gz  webtools.sourceediting-R2_0_2.tar.xz  webtools.sourceediting-R2_0_2.zip  nitind17 years
v200802142230webtools.sourceediting-200802142230.tar.gz  webtools.sourceediting-200802142230.tar.xz  webtools.sourceediting-200802142230.zip  nitind17 years
v200802141905webtools.sourceediting-200802141905.tar.gz  webtools.sourceediting-200802141905.tar.xz  webtools.sourceediting-200802141905.zip  nitind17 years
v200802141800webtools.sourceediting-200802141800.tar.gz  webtools.sourceediting-200802141800.tar.xz  webtools.sourceediting-200802141800.zip  nitind17 years
v200802140626webtools.sourceediting-200802140626.tar.gz  webtools.sourceediting-200802140626.tar.xz  webtools.sourceediting-200802140626.zip  nitind17 years
v200802130010webtools.sourceediting-200802130010.tar.gz  webtools.sourceediting-200802130010.tar.xz  webtools.sourceediting-200802130010.zip  nitind17 years
v200802120400webtools.sourceediting-200802120400.tar.gz  webtools.sourceediting-200802120400.tar.xz  webtools.sourceediting-200802120400.zip  nitind17 years
v200802071045webtools.sourceediting-200802071045.tar.gz  webtools.sourceediting-200802071045.tar.xz  webtools.sourceediting-200802071045.zip  nitind17 years
v200702071040webtools.sourceediting-200702071040.tar.gz  webtools.sourceediting-200702071040.tar.xz  webtools.sourceediting-200702071040.zip  nitind17 years
v200802081015webtools.sourceediting-200802081015.tar.gz  webtools.sourceediting-200802081015.tar.xz  webtools.sourceediting-200802081015.zip  nitind17 years
v200802070636webtools.sourceediting-200802070636.tar.gz  webtools.sourceediting-200802070636.tar.xz  webtools.sourceediting-200802070636.zip  nitind17 years
v200802070251webtools.sourceediting-200802070251.tar.gz  webtools.sourceediting-200802070251.tar.xz  webtools.sourceediting-200802070251.zip  nitind17 years
v200802070040webtools.sourceediting-200802070040.tar.gz  webtools.sourceediting-200802070040.tar.xz  webtools.sourceediting-200802070040.zip  nitind17 years
v200802062320webtools.sourceediting-200802062320.tar.gz  webtools.sourceediting-200802062320.tar.xz  webtools.sourceediting-200802062320.zip  nitind17 years
v200805010000webtools.sourceediting-200805010000.tar.gz  webtools.sourceediting-200805010000.tar.xz  webtools.sourceediting-200805010000.zip  nitind17 years
v200802060654webtools.sourceediting-200802060654.tar.gz  webtools.sourceediting-200802060654.tar.xz  webtools.sourceediting-200802060654.zip  nitind17 years
v200802060648webtools.sourceediting-200802060648.tar.gz  webtools.sourceediting-200802060648.tar.xz  webtools.sourceediting-200802060648.zip  nitind17 years
v200802062329webtools.sourceediting-200802062329.tar.gz  webtools.sourceediting-200802062329.tar.xz  webtools.sourceediting-200802062329.zip  nitind17 years
v200802041700webtools.sourceediting-200802041700.tar.gz  webtools.sourceediting-200802041700.tar.xz  webtools.sourceediting-200802041700.zip  nitind17 years
v200802032100webtools.sourceediting-200802032100.tar.gz  webtools.sourceediting-200802032100.tar.xz  webtools.sourceediting-200802032100.zip  nitind17 years
v200801310255webtools.sourceediting-200801310255.tar.gz  webtools.sourceediting-200801310255.tar.xz  webtools.sourceediting-200801310255.zip  nitind17 years
v200801310021webtools.sourceediting-200801310021.tar.gz  webtools.sourceediting-200801310021.tar.xz  webtools.sourceediting-200801310021.zip  nitind17 years
v200801302121webtools.sourceediting-200801302121.tar.gz  webtools.sourceediting-200801302121.tar.xz  webtools.sourceediting-200801302121.zip  nitind17 years
v200801301841webtools.sourceediting-200801301841.tar.gz  webtools.sourceediting-200801301841.tar.xz  webtools.sourceediting-200801301841.zip  nitind17 years
v200801292303webtools.sourceediting-200801292303.tar.gz  webtools.sourceediting-200801292303.tar.xz  webtools.sourceediting-200801292303.zip  nitind17 years
v200801290130webtools.sourceediting-200801290130.tar.gz  webtools.sourceediting-200801290130.tar.xz  webtools.sourceediting-200801290130.zip  nitind17 years
v200801231745webtools.sourceediting-200801231745.tar.gz  webtools.sourceediting-200801231745.tar.xz  webtools.sourceediting-200801231745.zip  nitind17 years
v200801220656webtools.sourceediting-200801220656.tar.gz  webtools.sourceediting-200801220656.tar.xz  webtools.sourceediting-200801220656.zip  nitind17 years
v200801221630webtools.sourceediting-200801221630.tar.gz  webtools.sourceediting-200801221630.tar.xz  webtools.sourceediting-200801221630.zip  nitind17 years
v200801172310webtools.sourceediting-200801172310.tar.gz  webtools.sourceediting-200801172310.tar.xz  webtools.sourceediting-200801172310.zip  nitind17 years
v200801172235webtools.sourceediting-200801172235.tar.gz  webtools.sourceediting-200801172235.tar.xz  webtools.sourceediting-200801172235.zip  nitind17 years
v200801170608webtools.sourceediting-200801170608.tar.gz  webtools.sourceediting-200801170608.tar.xz  webtools.sourceediting-200801170608.zip  nitind17 years
v200801161645webtools.sourceediting-200801161645.tar.gz  webtools.sourceediting-200801161645.tar.xz  webtools.sourceediting-200801161645.zip  nitind17 years
v200801161545webtools.sourceediting-200801161545.tar.gz  webtools.sourceediting-200801161545.tar.xz  webtools.sourceediting-200801161545.zip  nitind17 years
v200801160740webtools.sourceediting-200801160740.tar.gz  webtools.sourceediting-200801160740.tar.xz  webtools.sourceediting-200801160740.zip  nitind17 years
v200801152359webtools.sourceediting-200801152359.tar.gz  webtools.sourceediting-200801152359.tar.xz  webtools.sourceediting-200801152359.zip  nitind17 years
v200801112022webtools.sourceediting-200801112022.tar.gz  webtools.sourceediting-200801112022.tar.xz  webtools.sourceediting-200801112022.zip  nitind17 years
v200801092359webtools.sourceediting-200801092359.tar.gz  webtools.sourceediting-200801092359.tar.xz  webtools.sourceediting-200801092359.zip  nitind17 years
v200809012300-bug158587webtools.sourceediting-200809012300-bug158587.tar.gz  webtools.sourceediting-200809012300-bug158587.tar.xz  webtools.sourceediting-200809012300-bug158587.zip  nitind17 years
v200801092308webtools.sourceediting-200801092308.tar.gz  webtools.sourceediting-200801092308.tar.xz  webtools.sourceediting-200801092308.zip  nitind17 years
v200801092255-bug144544webtools.sourceediting-200801092255-bug144544.tar.gz  webtools.sourceediting-200801092255-bug144544.tar.xz  webtools.sourceediting-200801092255-bug144544.zip  nitind17 years
v200801092212webtools.sourceediting-200801092212.tar.gz  webtools.sourceediting-200801092212.tar.xz  webtools.sourceediting-200801092212.zip  nitind17 years
v200801092144webtools.sourceediting-200801092144.tar.gz  webtools.sourceediting-200801092144.tar.xz  webtools.sourceediting-200801092144.zip  nitind17 years
v200801092102webtools.sourceediting-200801092102.tar.gz  webtools.sourceediting-200801092102.tar.xz  webtools.sourceediting-200801092102.zip  nitind17 years
v200801091900webtools.sourceediting-200801091900.tar.gz  webtools.sourceediting-200801091900.tar.xz  webtools.sourceediting-200801091900.zip  nitind17 years
v200712201805webtools.sourceediting-200712201805.tar.gz  webtools.sourceediting-200712201805.tar.xz  webtools.sourceediting-200712201805.zip  nitind17 years
v200712200547webtools.sourceediting-200712200547.tar.gz  webtools.sourceediting-200712200547.tar.xz  webtools.sourceediting-200712200547.zip  nitind17 years
v200712192359webtools.sourceediting-200712192359.tar.gz  webtools.sourceediting-200712192359.tar.xz  webtools.sourceediting-200712192359.zip  nitind17 years
v200712192326webtools.sourceediting-200712192326.tar.gz  webtools.sourceediting-200712192326.tar.xz  webtools.sourceediting-200712192326.zip  nitind17 years
v200712181901webtools.sourceediting-200712181901.tar.gz  webtools.sourceediting-200712181901.tar.xz  webtools.sourceediting-200712181901.zip  nitind17 years
v200712180452webtools.sourceediting-200712180452.tar.gz  webtools.sourceediting-200712180452.tar.xz  webtools.sourceediting-200712180452.zip  nitind17 years
v200712170344webtools.sourceediting-200712170344.tar.gz  webtools.sourceediting-200712170344.tar.xz  webtools.sourceediting-200712170344.zip  nitind17 years
v200712180301webtools.sourceediting-200712180301.tar.gz  webtools.sourceediting-200712180301.tar.xz  webtools.sourceediting-200712180301.zip  nitind17 years
v200712180253webtools.sourceediting-200712180253.tar.gz  webtools.sourceediting-200712180253.tar.xz  webtools.sourceediting-200712180253.zip  nitind17 years
v200712180303webtools.sourceediting-200712180303.tar.gz  webtools.sourceediting-200712180303.tar.xz  webtools.sourceediting-200712180303.zip  nitind17 years
v200712180216webtools.sourceediting-200712180216.tar.gz  webtools.sourceediting-200712180216.tar.xz  webtools.sourceediting-200712180216.zip  nitind17 years
v200712172347webtools.sourceediting-200712172347.tar.gz  webtools.sourceediting-200712172347.tar.xz  webtools.sourceediting-200712172347.zip  nitind17 years
v200802041949webtools.sourceediting-200802041949.tar.gz  webtools.sourceediting-200802041949.tar.xz  webtools.sourceediting-200802041949.zip  nitind17 years
v200712171755webtools.sourceediting-200712171755.tar.gz  webtools.sourceediting-200712171755.tar.xz  webtools.sourceediting-200712171755.zip  nitind17 years
v200712131812webtools.sourceediting-200712131812.tar.gz  webtools.sourceediting-200712131812.tar.xz  webtools.sourceediting-200712131812.zip  nitind17 years
v200712122210webtools.sourceediting-200712122210.tar.gz  webtools.sourceediting-200712122210.tar.xz  webtools.sourceediting-200712122210.zip  nitind17 years
v200712121400webtools.sourceediting-200712121400.tar.gz  webtools.sourceediting-200712121400.tar.xz  webtools.sourceediting-200712121400.zip  nitind17 years
v200712121343webtools.sourceediting-200712121343.tar.gz  webtools.sourceediting-200712121343.tar.xz  webtools.sourceediting-200712121343.zip  nitind17 years
v200712142230webtools.sourceediting-200712142230.tar.gz  webtools.sourceediting-200712142230.tar.xz  webtools.sourceediting-200712142230.zip  nitind17 years
v200712111734webtools.sourceediting-200712111734.tar.gz  webtools.sourceediting-200712111734.tar.xz  webtools.sourceediting-200712111734.zip  nitind17 years
v200712070630webtools.sourceediting-200712070630.tar.gz  webtools.sourceediting-200712070630.tar.xz  webtools.sourceediting-200712070630.zip  nitind17 years
v200712041741webtools.sourceediting-200712041741.tar.gz  webtools.sourceediting-200712041741.tar.xz  webtools.sourceediting-200712041741.zip  nitind17 years
v200712041730webtools.sourceediting-200712041730.tar.gz  webtools.sourceediting-200712041730.tar.xz  webtools.sourceediting-200712041730.zip  nitind17 years
v200712040145webtools.sourceediting-200712040145.tar.gz  webtools.sourceediting-200712040145.tar.xz  webtools.sourceediting-200712040145.zip  nitind17 years
v200712031745webtools.sourceediting-200712031745.tar.gz  webtools.sourceediting-200712031745.tar.xz  webtools.sourceediting-200712031745.zip  nitind17 years
v200712031330webtools.sourceediting-200712031330.tar.gz  webtools.sourceediting-200712031330.tar.xz  webtools.sourceediting-200712031330.zip  nitind17 years
Root_david_williams_tempBranchwebtools.sourceediting-Root_david_williams_tempBranch.tar.gz  webtools.sourceediting-Root_david_williams_tempBranch.tar.xz  webtools.sourceediting-Root_david_williams_tempBranch.zip  nitind17 years
v200712030300webtools.sourceediting-200712030300.tar.gz  webtools.sourceediting-200712030300.tar.xz  webtools.sourceediting-200712030300.zip  nitind17 years
v200711291031webtools.sourceediting-200711291031.tar.gz  webtools.sourceediting-200711291031.tar.xz  webtools.sourceediting-200711291031.zip  nitind17 years
v200712072133webtools.sourceediting-200712072133.tar.gz  webtools.sourceediting-200712072133.tar.xz  webtools.sourceediting-200712072133.zip  nitind17 years
v200712061132webtools.sourceediting-200712061132.tar.gz  webtools.sourceediting-200712061132.tar.xz  webtools.sourceediting-200712061132.zip  nitind17 years
v200711281603webtools.sourceediting-200711281603.tar.gz  webtools.sourceediting-200711281603.tar.xz  webtools.sourceediting-200711281603.zip  nitind17 years
v200711181616webtools.sourceediting-200711181616.tar.gz  webtools.sourceediting-200711181616.tar.xz  webtools.sourceediting-200711181616.zip  nitind17 years
v200711281408webtools.sourceediting-200711281408.tar.gz  webtools.sourceediting-200711281408.tar.xz  webtools.sourceediting-200711281408.zip  nitind17 years
v200711141738webtools.sourceediting-200711141738.tar.gz  webtools.sourceediting-200711141738.tar.xz  webtools.sourceediting-200711141738.zip  nitind17 years
v200711131723webtools.sourceediting-200711131723.tar.gz  webtools.sourceediting-200711131723.tar.xz  webtools.sourceediting-200711131723.zip  nitind17 years
v200711081012webtools.sourceediting-200711081012.tar.gz  webtools.sourceediting-200711081012.tar.xz  webtools.sourceediting-200711081012.zip  nitind17 years
v200711080220webtools.sourceediting-200711080220.tar.gz  webtools.sourceediting-200711080220.tar.xz  webtools.sourceediting-200711080220.zip  nitind17 years
v200711080150webtools.sourceediting-200711080150.tar.gz  webtools.sourceediting-200711080150.tar.xz  webtools.sourceediting-200711080150.zip  nitind17 years
v200711080100webtools.sourceediting-200711080100.tar.gz  webtools.sourceediting-200711080100.tar.xz  webtools.sourceediting-200711080100.zip  nitind17 years
v200711070038webtools.sourceediting-200711070038.tar.gz  webtools.sourceediting-200711070038.tar.xz  webtools.sourceediting-200711070038.zip  nitind17 years
v200711072335webtools.sourceediting-200711072335.tar.gz  webtools.sourceediting-200711072335.tar.xz  webtools.sourceediting-200711072335.zip  nitind17 years
v200711072050webtools.sourceediting-200711072050.tar.gz  webtools.sourceediting-200711072050.tar.xz  webtools.sourceediting-200711072050.zip  nitind17 years
Root_jsdtDev11082007webtools.sourceediting-Root_jsdtDev11082007.tar.gz  webtools.sourceediting-Root_jsdtDev11082007.tar.xz  webtools.sourceediting-Root_jsdtDev11082007.zip  nitind17 years
Root_M3Candidate11-9-07webtools.sourceediting-Root_M3Candidate11-9-07.tar.gz  webtools.sourceediting-Root_M3Candidate11-9-07.tar.xz  webtools.sourceediting-Root_M3Candidate11-9-07.zip  nitind17 years
v200711080030webtools.sourceediting-200711080030.tar.gz  webtools.sourceediting-200711080030.tar.xz  webtools.sourceediting-200711080030.zip  nitind17 years
v200711071950webtools.sourceediting-200711071950.tar.gz  webtools.sourceediting-200711071950.tar.xz  webtools.sourceediting-200711071950.zip  nitind17 years
v200711071948webtools.sourceediting-200711071948.tar.gz  webtools.sourceediting-200711071948.tar.xz  webtools.sourceediting-200711071948.zip  nitind17 years
v200711071909webtools.sourceediting-200711071909.tar.gz  webtools.sourceediting-200711071909.tar.xz  webtools.sourceediting-200711071909.zip  nitind17 years
v200711071635webtools.sourceediting-200711071635.tar.gz  webtools.sourceediting-200711071635.tar.xz  webtools.sourceediting-200711071635.zip  nitind17 years
v200711062234webtools.sourceediting-200711062234.tar.gz  webtools.sourceediting-200711062234.tar.xz  webtools.sourceediting-200711062234.zip  nitind17 years
v200711062032webtools.sourceediting-200711062032.tar.gz  webtools.sourceediting-200711062032.tar.xz  webtools.sourceediting-200711062032.zip  nitind17 years
v200711061059webtools.sourceediting-200711061059.tar.gz  webtools.sourceediting-200711061059.tar.xz  webtools.sourceediting-200711061059.zip  nitind17 years
v200711061100webtools.sourceediting-200711061100.tar.gz  webtools.sourceediting-200711061100.tar.xz  webtools.sourceediting-200711061100.zip  nitind17 years
v200711060055webtools.sourceediting-200711060055.tar.gz  webtools.sourceediting-200711060055.tar.xz  webtools.sourceediting-200711060055.zip  nitind17 years
v200711052245webtools.sourceediting-200711052245.tar.gz  webtools.sourceediting-200711052245.tar.xz  webtools.sourceediting-200711052245.zip  nitind17 years
v200711052240webtools.sourceediting-200711052240.tar.gz  webtools.sourceediting-200711052240.tar.xz  webtools.sourceediting-200711052240.zip  nitind17 years
v200711030556webtools.sourceediting-200711030556.tar.gz  webtools.sourceediting-200711030556.tar.xz  webtools.sourceediting-200711030556.zip  nitind17 years
v200711051754webtools.sourceediting-200711051754.tar.gz  webtools.sourceediting-200711051754.tar.xz  webtools.sourceediting-200711051754.zip  nitind17 years
v200711012306webtools.sourceediting-200711012306.tar.gz  webtools.sourceediting-200711012306.tar.xz  webtools.sourceediting-200711012306.zip  nitind17 years
v200711012103webtools.sourceediting-200711012103.tar.gz  webtools.sourceediting-200711012103.tar.xz  webtools.sourceediting-200711012103.zip  nitind17 years
v200711010830webtools.sourceediting-200711010830.tar.gz  webtools.sourceediting-200711010830.tar.xz  webtools.sourceediting-200711010830.zip  nitind17 years
v200711010825webtools.sourceediting-200711010825.tar.gz  webtools.sourceediting-200711010825.tar.xz  webtools.sourceediting-200711010825.zip  nitind17 years
v200711010542webtools.sourceediting-200711010542.tar.gz  webtools.sourceediting-200711010542.tar.xz  webtools.sourceediting-200711010542.zip  nitind17 years
v200710312210webtools.sourceediting-200710312210.tar.gz  webtools.sourceediting-200710312210.tar.xz  webtools.sourceediting-200710312210.zip  nitind17 years
v200710312002webtools.sourceediting-200710312002.tar.gz  webtools.sourceediting-200710312002.tar.xz  webtools.sourceediting-200710312002.zip  nitind17 years
v200710311944webtools.sourceediting-200710311944.tar.gz  webtools.sourceediting-200710311944.tar.xz  webtools.sourceediting-200710311944.zip  nitind17 years
v200710311809webtools.sourceediting-200710311809.tar.gz  webtools.sourceediting-200710311809.tar.xz  webtools.sourceediting-200710311809.zip  nitind17 years
v200710311517webtools.sourceediting-200710311517.tar.gz  webtools.sourceediting-200710311517.tar.xz  webtools.sourceediting-200710311517.zip  nitind17 years
v200711071941webtools.sourceediting-200711071941.tar.gz  webtools.sourceediting-200711071941.tar.xz  webtools.sourceediting-200711071941.zip  nitind17 years
v200710302256webtools.sourceediting-200710302256.tar.gz  webtools.sourceediting-200710302256.tar.xz  webtools.sourceediting-200710302256.zip  nitind17 years
v200710302152webtools.sourceediting-200710302152.tar.gz  webtools.sourceediting-200710302152.tar.xz  webtools.sourceediting-200710302152.zip  nitind17 years
v200710301256webtools.sourceediting-200710301256.tar.gz  webtools.sourceediting-200710301256.tar.xz  webtools.sourceediting-200710301256.zip  nitind17 years
v200710301259webtools.sourceediting-200710301259.tar.gz  webtools.sourceediting-200710301259.tar.xz  webtools.sourceediting-200710301259.zip  nitind17 years
v200710301239webtools.sourceediting-200710301239.tar.gz  webtools.sourceediting-200710301239.tar.xz  webtools.sourceediting-200710301239.zip  nitind17 years
v200710300940webtools.sourceediting-200710300940.tar.gz  webtools.sourceediting-200710300940.tar.xz  webtools.sourceediting-200710300940.zip  nitind17 years
v200710291733webtools.sourceediting-200710291733.tar.gz  webtools.sourceediting-200710291733.tar.xz  webtools.sourceediting-200710291733.zip  nitind17 years
v200710291732webtools.sourceediting-200710291732.tar.gz  webtools.sourceediting-200710291732.tar.xz  webtools.sourceediting-200710291732.zip  nitind17 years
v200710291708webtools.sourceediting-200710291708.tar.gz  webtools.sourceediting-200710291708.tar.xz  webtools.sourceediting-200710291708.zip  nitind17 years
v200710272355webtools.sourceediting-200710272355.tar.gz  webtools.sourceediting-200710272355.tar.xz  webtools.sourceediting-200710272355.zip  nitind17 years
Root_R2_0_2_patcheswebtools.sourceediting-Root_R2_0_2_patches.tar.gz  webtools.sourceediting-Root_R2_0_2_patches.tar.xz  webtools.sourceediting-Root_R2_0_2_patches.zip  nitind17 years
v200710272136webtools.sourceediting-200710272136.tar.gz  webtools.sourceediting-200710272136.tar.xz  webtools.sourceediting-200710272136.zip  nitind17 years
v200710270846webtools.sourceediting-200710270846.tar.gz  webtools.sourceediting-200710270846.tar.xz  webtools.sourceediting-200710270846.zip  nitind17 years
v200710270040webtools.sourceediting-200710270040.tar.gz  webtools.sourceediting-200710270040.tar.xz  webtools.sourceediting-200710270040.zip  nitind17 years
Root_R1_5_5_patcheswebtools.sourceediting-Root_R1_5_5_patches.tar.gz  webtools.sourceediting-Root_R1_5_5_patches.tar.xz  webtools.sourceediting-Root_R1_5_5_patches.zip  nitind17 years
Root_R3_0_0_patcheswebtools.sourceediting-Root_R3_0_0_patches.tar.gz  webtools.sourceediting-Root_R3_0_0_patches.tar.xz  webtools.sourceediting-Root_R3_0_0_patches.zip  nitind17 years
v200710260454webtools.sourceediting-200710260454.tar.gz  webtools.sourceediting-200710260454.tar.xz  webtools.sourceediting-200710260454.zip  nitind17 years
v200710251835webtools.sourceediting-200710251835.tar.gz  webtools.sourceediting-200710251835.tar.xz  webtools.sourceediting-200710251835.zip  nitind17 years
v200710251237webtools.sourceediting-200710251237.tar.gz  webtools.sourceediting-200710251237.tar.xz  webtools.sourceediting-200710251237.zip  nitind17 years
v200710250015webtools.sourceediting-200710250015.tar.gz  webtools.sourceediting-200710250015.tar.xz  webtools.sourceediting-200710250015.zip  nitind17 years
v200710242304webtools.sourceediting-200710242304.tar.gz  webtools.sourceediting-200710242304.tar.xz  webtools.sourceediting-200710242304.zip  nitind17 years
v200710242305webtools.sourceediting-200710242305.tar.gz  webtools.sourceediting-200710242305.tar.xz  webtools.sourceediting-200710242305.zip  nitind17 years
v200710250221webtools.sourceediting-200710250221.tar.gz  webtools.sourceediting-200710250221.tar.xz  webtools.sourceediting-200710250221.zip  nitind17 years
v200710241837webtools.sourceediting-200710241837.tar.gz  webtools.sourceediting-200710241837.tar.xz  webtools.sourceediting-200710241837.zip  nitind17 years
v200710241414webtools.sourceediting-200710241414.tar.gz  webtools.sourceediting-200710241414.tar.xz  webtools.sourceediting-200710241414.zip  nitind17 years
v200710240945webtools.sourceediting-200710240945.tar.gz  webtools.sourceediting-200710240945.tar.xz  webtools.sourceediting-200710240945.zip  nitind17 years
v200710192249webtools.sourceediting-200710192249.tar.gz  webtools.sourceediting-200710192249.tar.xz  webtools.sourceediting-200710192249.zip  nitind17 years
v200710191943webtools.sourceediting-200710191943.tar.gz  webtools.sourceediting-200710191943.tar.xz  webtools.sourceediting-200710191943.zip  nitind17 years
v200710191117webtools.sourceediting-200710191117.tar.gz  webtools.sourceediting-200710191117.tar.xz  webtools.sourceediting-200710191117.zip  nitind17 years
v200710171809webtools.sourceediting-200710171809.tar.gz  webtools.sourceediting-200710171809.tar.xz  webtools.sourceediting-200710171809.zip  nitind17 years
v200710171735webtools.sourceediting-200710171735.tar.gz  webtools.sourceediting-200710171735.tar.xz  webtools.sourceediting-200710171735.zip  nitind17 years
v200710171732webtools.sourceediting-200710171732.tar.gz  webtools.sourceediting-200710171732.tar.xz  webtools.sourceediting-200710171732.zip  nitind17 years
v200710230930webtools.sourceediting-200710230930.tar.gz  webtools.sourceediting-200710230930.tar.xz  webtools.sourceediting-200710230930.zip  nitind17 years
v200710161938webtools.sourceediting-200710161938.tar.gz  webtools.sourceediting-200710161938.tar.xz  webtools.sourceediting-200710161938.zip  nitind17 years
v200710172305webtools.sourceediting-200710172305.tar.gz  webtools.sourceediting-200710172305.tar.xz  webtools.sourceediting-200710172305.zip  nitind17 years
v200710152307webtools.sourceediting-200710152307.tar.gz  webtools.sourceediting-200710152307.tar.xz  webtools.sourceediting-200710152307.zip  nitind17 years
v200710152248webtools.sourceediting-200710152248.tar.gz  webtools.sourceediting-200710152248.tar.xz  webtools.sourceediting-200710152248.zip  nitind17 years
v200710152215-bug204618webtools.sourceediting-200710152215-bug204618.tar.gz  webtools.sourceediting-200710152215-bug204618.tar.xz  webtools.sourceediting-200710152215-bug204618.zip  nitind17 years
v200710152126-bug205515webtools.sourceediting-200710152126-bug205515.tar.gz  webtools.sourceediting-200710152126-bug205515.tar.xz  webtools.sourceediting-200710152126-bug205515.zip  nitind17 years
v200710152242webtools.sourceediting-200710152242.tar.gz  webtools.sourceediting-200710152242.tar.xz  webtools.sourceediting-200710152242.zip  nitind17 years
v200710152221webtools.sourceediting-200710152221.tar.gz  webtools.sourceediting-200710152221.tar.xz  webtools.sourceediting-200710152221.zip  nitind17 years
v200710152129webtools.sourceediting-200710152129.tar.gz  webtools.sourceediting-200710152129.tar.xz  webtools.sourceediting-200710152129.zip  nitind17 years
v200710151747webtools.sourceediting-200710151747.tar.gz  webtools.sourceediting-200710151747.tar.xz  webtools.sourceediting-200710151747.zip  nitind17 years
v200710121816webtools.sourceediting-200710121816.tar.gz  webtools.sourceediting-200710121816.tar.xz  webtools.sourceediting-200710121816.zip  nitind17 years
v200710121808webtools.sourceediting-200710121808.tar.gz  webtools.sourceediting-200710121808.tar.xz  webtools.sourceediting-200710121808.zip  nitind17 years
v200710101720webtools.sourceediting-200710101720.tar.gz  webtools.sourceediting-200710101720.tar.xz  webtools.sourceediting-200710101720.zip  nitind17 years
v200710091922webtools.sourceediting-200710091922.tar.gz  webtools.sourceediting-200710091922.tar.xz  webtools.sourceediting-200710091922.zip  nitind17 years
v200710021541webtools.sourceediting-200710021541.tar.gz  webtools.sourceediting-200710021541.tar.xz  webtools.sourceediting-200710021541.zip  nitind17 years
v200710020412webtools.sourceediting-200710020412.tar.gz  webtools.sourceediting-200710020412.tar.xz  webtools.sourceediting-200710020412.zip  nitind17 years
v200710011829webtools.sourceediting-200710011829.tar.gz  webtools.sourceediting-200710011829.tar.xz  webtools.sourceediting-200710011829.zip  nitind17 years
v200710011812webtools.sourceediting-200710011812.tar.gz  webtools.sourceediting-200710011812.tar.xz  webtools.sourceediting-200710011812.zip  nitind17 years
v200710011810webtools.sourceediting-200710011810.tar.gz  webtools.sourceediting-200710011810.tar.xz  webtools.sourceediting-200710011810.zip  nitind17 years
v200710011706webtools.sourceediting-200710011706.tar.gz  webtools.sourceediting-200710011706.tar.xz  webtools.sourceediting-200710011706.zip  nitind17 years
v200710011705webtools.sourceediting-200710011705.tar.gz  webtools.sourceediting-200710011705.tar.xz  webtools.sourceediting-200710011705.zip  nitind17 years
v200709261908webtools.sourceediting-200709261908.tar.gz  webtools.sourceediting-200709261908.tar.xz  webtools.sourceediting-200709261908.zip  nitind17 years
v200709252123webtools.sourceediting-200709252123.tar.gz  webtools.sourceediting-200709252123.tar.xz  webtools.sourceediting-200709252123.zip  nitind17 years
v200709242252webtools.sourceediting-200709242252.tar.gz  webtools.sourceediting-200709242252.tar.xz  webtools.sourceediting-200709242252.zip  nitind17 years
v200709242249-bug202659webtools.sourceediting-200709242249-bug202659.tar.gz  webtools.sourceediting-200709242249-bug202659.tar.xz  webtools.sourceediting-200709242249-bug202659.zip  nitind17 years
v200709241843-bug204218webtools.sourceediting-200709241843-bug204218.tar.gz  webtools.sourceediting-200709241843-bug204218.tar.xz  webtools.sourceediting-200709241843-bug204218.zip  nitind17 years
v200709241646-bug155944webtools.sourceediting-200709241646-bug155944.tar.gz  webtools.sourceediting-200709241646-bug155944.tar.xz  webtools.sourceediting-200709241646-bug155944.zip  nitind17 years
v200709241645-bug148916webtools.sourceediting-200709241645-bug148916.tar.gz  webtools.sourceediting-200709241645-bug148916.tar.xz  webtools.sourceediting-200709241645-bug148916.zip  nitind17 years
v200709201517webtools.sourceediting-200709201517.tar.gz  webtools.sourceediting-200709201517.tar.xz  webtools.sourceediting-200709201517.zip  nitind17 years
v200709201331webtools.sourceediting-200709201331.tar.gz  webtools.sourceediting-200709201331.tar.xz  webtools.sourceediting-200709201331.zip  nitind17 years
R2_0_1webtools.sourceediting-R2_0_1.tar.gz  webtools.sourceediting-R2_0_1.tar.xz  webtools.sourceediting-R2_0_1.zip  nitind17 years
v200709192345webtools.sourceediting-200709192345.tar.gz  webtools.sourceediting-200709192345.tar.xz  webtools.sourceediting-200709192345.zip  nitind17 years
v200709192200webtools.sourceediting-200709192200.tar.gz  webtools.sourceediting-200709192200.tar.xz  webtools.sourceediting-200709192200.zip  nitind17 years
v200709191633webtools.sourceediting-200709191633.tar.gz  webtools.sourceediting-200709191633.tar.xz  webtools.sourceediting-200709191633.zip  nitind17 years
v200709191630-bug148060webtools.sourceediting-200709191630-bug148060.tar.gz  webtools.sourceediting-200709191630-bug148060.tar.xz  webtools.sourceediting-200709191630-bug148060.zip  nitind17 years
v200709181730webtools.sourceediting-200709181730.tar.gz  webtools.sourceediting-200709181730.tar.xz  webtools.sourceediting-200709181730.zip  nitind17 years
v200709191625webtools.sourceediting-200709191625.tar.gz  webtools.sourceediting-200709191625.tar.xz  webtools.sourceediting-200709191625.zip  nitind17 years
v200709191620-bug103870webtools.sourceediting-200709191620-bug103870.tar.gz  webtools.sourceediting-200709191620-bug103870.tar.xz  webtools.sourceediting-200709191620-bug103870.zip  nitind17 years
v200709172057-bug147010webtools.sourceediting-200709172057-bug147010.tar.gz  webtools.sourceediting-200709172057-bug147010.tar.xz  webtools.sourceediting-200709172057-bug147010.zip  nitind17 years
v200709172055-bug86218webtools.sourceediting-200709172055-bug86218.tar.gz  webtools.sourceediting-200709172055-bug86218.tar.xz  webtools.sourceediting-200709172055-bug86218.zip  nitind17 years
v200709171605webtools.sourceediting-200709171605.tar.gz  webtools.sourceediting-200709171605.tar.xz  webtools.sourceediting-200709171605.zip  nitind17 years
v200709171600-bug81751webtools.sourceediting-200709171600-bug81751.tar.gz  webtools.sourceediting-200709171600-bug81751.tar.xz  webtools.sourceediting-200709171600-bug81751.zip  nitind17 years
v200709160320-bug144539webtools.sourceediting-200709160320-bug144539.tar.gz  webtools.sourceediting-200709160320-bug144539.tar.xz  webtools.sourceediting-200709160320-bug144539.zip  nitind17 years
v200709152030webtools.sourceediting-200709152030.tar.gz  webtools.sourceediting-200709152030.tar.xz  webtools.sourceediting-200709152030.zip  nitind17 years
v200709142220webtools.sourceediting-200709142220.tar.gz  webtools.sourceediting-200709142220.tar.xz  webtools.sourceediting-200709142220.zip  nitind17 years
v200709142150-bug193772webtools.sourceediting-200709142150-bug193772.tar.gz  webtools.sourceediting-200709142150-bug193772.tar.xz  webtools.sourceediting-200709142150-bug193772.zip  nitind17 years
v200709141810-bug200062webtools.sourceediting-200709141810-bug200062.tar.gz  webtools.sourceediting-200709141810-bug200062.tar.xz  webtools.sourceediting-200709141810-bug200062.zip  nitind17 years
v200709141600-bug148433webtools.sourceediting-200709141600-bug148433.tar.gz  webtools.sourceediting-200709141600-bug148433.tar.xz  webtools.sourceediting-200709141600-bug148433.zip  nitind17 years
v200709131115webtools.sourceediting-200709131115.tar.gz  webtools.sourceediting-200709131115.tar.xz  webtools.sourceediting-200709131115.zip  nitind17 years
v200709131422webtools.sourceediting-200709131422.tar.gz  webtools.sourceediting-200709131422.tar.xz  webtools.sourceediting-200709131422.zip  nitind17 years
v200709130212webtools.sourceediting-200709130212.tar.gz  webtools.sourceediting-200709130212.tar.xz  webtools.sourceediting-200709130212.zip  nitind17 years
v200709271600webtools.sourceediting-200709271600.tar.gz  webtools.sourceediting-200709271600.tar.xz  webtools.sourceediting-200709271600.zip  nitind17 years
v200709141050webtools.sourceediting-200709141050.tar.gz  webtools.sourceediting-200709141050.tar.xz  webtools.sourceediting-200709141050.zip  nitind17 years
v200709132145webtools.sourceediting-200709132145.tar.gz  webtools.sourceediting-200709132145.tar.xz  webtools.sourceediting-200709132145.zip  nitind17 years
v200709130355webtools.sourceediting-200709130355.tar.gz  webtools.sourceediting-200709130355.tar.xz  webtools.sourceediting-200709130355.zip  nitind17 years
v200709121906webtools.sourceediting-200709121906.tar.gz  webtools.sourceediting-200709121906.tar.xz  webtools.sourceediting-200709121906.zip  nitind17 years
v200709112242webtools.sourceediting-200709112242.tar.gz  webtools.sourceediting-200709112242.tar.xz  webtools.sourceediting-200709112242.zip  nitind17 years
v200709111200webtools.sourceediting-200709111200.tar.gz  webtools.sourceediting-200709111200.tar.xz  webtools.sourceediting-200709111200.zip  nitind17 years
v200709110650webtools.sourceediting-200709110650.tar.gz  webtools.sourceediting-200709110650.tar.xz  webtools.sourceediting-200709110650.zip  nitind17 years
v200709110002webtools.sourceediting-200709110002.tar.gz  webtools.sourceediting-200709110002.tar.xz  webtools.sourceediting-200709110002.zip  nitind17 years
v200709062330webtools.sourceediting-200709062330.tar.gz  webtools.sourceediting-200709062330.tar.xz  webtools.sourceediting-200709062330.zip  nitind17 years
v200709061632webtools.sourceediting-200709061632.tar.gz  webtools.sourceediting-200709061632.tar.xz  webtools.sourceediting-200709061632.zip  nitind17 years
v200709101650webtools.sourceediting-200709101650.tar.gz  webtools.sourceediting-200709101650.tar.xz  webtools.sourceediting-200709101650.zip  nitind17 years
v200709061328webtools.sourceediting-200709061328.tar.gz  webtools.sourceediting-200709061328.tar.xz  webtools.sourceediting-200709061328.zip  nitind17 years
v200709061316webtools.sourceediting-200709061316.tar.gz  webtools.sourceediting-200709061316.tar.xz  webtools.sourceediting-200709061316.zip  nitind17 years
v200709061135webtools.sourceediting-200709061135.tar.gz  webtools.sourceediting-200709061135.tar.xz  webtools.sourceediting-200709061135.zip  nitind17 years
v200709061102webtools.sourceediting-200709061102.tar.gz  webtools.sourceediting-200709061102.tar.xz  webtools.sourceediting-200709061102.zip  nitind17 years
v200709122200webtools.sourceediting-200709122200.tar.gz  webtools.sourceediting-200709122200.tar.xz  webtools.sourceediting-200709122200.zip  nitind17 years
Root_R2_0_maintenancewebtools.sourceediting-Root_R2_0_maintenance.tar.gz  webtools.sourceediting-Root_R2_0_maintenance.tar.xz  webtools.sourceediting-Root_R2_0_maintenance.zip  nitind17 years
v200709060933webtools.sourceediting-200709060933.tar.gz  webtools.sourceediting-200709060933.tar.xz  webtools.sourceediting-200709060933.zip  nitind17 years
v200709060602webtools.sourceediting-200709060602.tar.gz  webtools.sourceediting-200709060602.tar.xz  webtools.sourceediting-200709060602.zip  nitind17 years
v200709060531webtools.sourceediting-200709060531.tar.gz  webtools.sourceediting-200709060531.tar.xz  webtools.sourceediting-200709060531.zip  nitind17 years
v200709042345webtools.sourceediting-200709042345.tar.gz  webtools.sourceediting-200709042345.tar.xz  webtools.sourceediting-200709042345.zip  nitind17 years
v200709042257webtools.sourceediting-200709042257.tar.gz  webtools.sourceediting-200709042257.tar.xz  webtools.sourceediting-200709042257.zip  nitind17 years
v200709042122webtools.sourceediting-200709042122.tar.gz  webtools.sourceediting-200709042122.tar.xz  webtools.sourceediting-200709042122.zip  nitind17 years
v200709030600webtools.sourceediting-200709030600.tar.gz  webtools.sourceediting-200709030600.tar.xz  webtools.sourceediting-200709030600.zip  nitind17 years
v200709030553webtools.sourceediting-200709030553.tar.gz  webtools.sourceediting-200709030553.tar.xz  webtools.sourceediting-200709030553.zip  nitind17 years
v200708311046webtools.sourceediting-200708311046.tar.gz  webtools.sourceediting-200708311046.tar.xz  webtools.sourceediting-200708311046.zip  nitind17 years
v200708311045webtools.sourceediting-200708311045.tar.gz  webtools.sourceediting-200708311045.tar.xz  webtools.sourceediting-200708311045.zip  nitind17 years
v200709051030webtools.sourceediting-200709051030.tar.gz  webtools.sourceediting-200709051030.tar.xz  webtools.sourceediting-200709051030.zip  nitind17 years
v200708301000webtools.sourceediting-200708301000.tar.gz  webtools.sourceediting-200708301000.tar.xz  webtools.sourceediting-200708301000.zip  nitind17 years
v200708300100webtools.sourceediting-200708300100.tar.gz  webtools.sourceediting-200708300100.tar.xz  webtools.sourceediting-200708300100.zip  nitind17 years
v200708292017webtools.sourceediting-200708292017.tar.gz  webtools.sourceediting-200708292017.tar.xz  webtools.sourceediting-200708292017.zip  nitind17 years
v200708292012webtools.sourceediting-200708292012.tar.gz  webtools.sourceediting-200708292012.tar.xz  webtools.sourceediting-200708292012.zip  nitind17 years
v200708272217webtools.sourceediting-200708272217.tar.gz  webtools.sourceediting-200708272217.tar.xz  webtools.sourceediting-200708272217.zip  nitind17 years
v200708281615webtools.sourceediting-200708281615.tar.gz  webtools.sourceediting-200708281615.tar.xz  webtools.sourceediting-200708281615.zip  nitind17 years
v200708242035webtools.sourceediting-200708242035.tar.gz  webtools.sourceediting-200708242035.tar.xz  webtools.sourceediting-200708242035.zip  nitind17 years
v200708241930webtools.sourceediting-200708241930.tar.gz  webtools.sourceediting-200708241930.tar.xz  webtools.sourceediting-200708241930.zip  nitind17 years
v200708241845webtools.sourceediting-200708241845.tar.gz  webtools.sourceediting-200708241845.tar.xz  webtools.sourceediting-200708241845.zip  nitind17 years
v200708160440webtools.sourceediting-200708160440.tar.gz  webtools.sourceediting-200708160440.tar.xz  webtools.sourceediting-200708160440.zip  nitind17 years
v200708090647webtools.sourceediting-200708090647.tar.gz  webtools.sourceediting-200708090647.tar.xz  webtools.sourceediting-200708090647.zip  nitind17 years
v200704111417webtools.sourceediting-200704111417.tar.gz  webtools.sourceediting-200704111417.tar.xz  webtools.sourceediting-200704111417.zip  nitind17 years
v200612200820webtools.sourceediting-200612200820.tar.gz  webtools.sourceediting-200612200820.tar.xz  webtools.sourceediting-200612200820.zip  nitind17 years
v200612052215webtools.sourceediting-200612052215.tar.gz  webtools.sourceediting-200612052215.tar.xz  webtools.sourceediting-200612052215.zip  nitind17 years
R1_5_5webtools.sourceediting-R1_5_5.tar.gz  webtools.sourceediting-R1_5_5.tar.xz  webtools.sourceediting-R1_5_5.zip  nitind17 years
v200708142120webtools.sourceediting-200708142120.tar.gz  webtools.sourceediting-200708142120.tar.xz  webtools.sourceediting-200708142120.zip  nitind17 years
v200708090600webtools.sourceediting-200708090600.tar.gz  webtools.sourceediting-200708090600.tar.xz  webtools.sourceediting-200708090600.zip  nitind17 years
v200708090518webtools.sourceediting-200708090518.tar.gz  webtools.sourceediting-200708090518.tar.xz  webtools.sourceediting-200708090518.zip  nitind17 years
v200708022155webtools.sourceediting-200708022155.tar.gz  webtools.sourceediting-200708022155.tar.xz  webtools.sourceediting-200708022155.zip  nitind17 years
v200709041000webtools.sourceediting-200709041000.tar.gz  webtools.sourceediting-200709041000.tar.xz  webtools.sourceediting-200709041000.zip  nitind17 years
v200709011600webtools.sourceediting-200709011600.tar.gz  webtools.sourceediting-200709011600.tar.xz  webtools.sourceediting-200709011600.zip  nitind17 years
v200708101615webtools.sourceediting-200708101615.tar.gz  webtools.sourceediting-200708101615.tar.xz  webtools.sourceediting-200708101615.zip  nitind17 years
v200708101600webtools.sourceediting-200708101600.tar.gz  webtools.sourceediting-200708101600.tar.xz  webtools.sourceediting-200708101600.zip  nitind17 years
v200708101400webtools.sourceediting-200708101400.tar.gz  webtools.sourceediting-200708101400.tar.xz  webtools.sourceediting-200708101400.zip  nitind17 years
v200708101100webtools.sourceediting-200708101100.tar.gz  webtools.sourceediting-200708101100.tar.xz  webtools.sourceediting-200708101100.zip  nitind17 years
v200708020450webtools.sourceediting-200708020450.tar.gz  webtools.sourceediting-200708020450.tar.xz  webtools.sourceediting-200708020450.zip  nitind17 years
v200708012314webtools.sourceediting-200708012314.tar.gz  webtools.sourceediting-200708012314.tar.xz  webtools.sourceediting-200708012314.zip  nitind17 years
v200708011901webtools.sourceediting-200708011901.tar.gz  webtools.sourceediting-200708011901.tar.xz  webtools.sourceediting-200708011901.zip  nitind17 years
v200707311635webtools.sourceediting-200707311635.tar.gz  webtools.sourceediting-200707311635.tar.xz  webtools.sourceediting-200707311635.zip  nitind17 years
v200707311130webtools.sourceediting-200707311130.tar.gz  webtools.sourceediting-200707311130.tar.xz  webtools.sourceediting-200707311130.zip  nitind17 years
v200707301910webtools.sourceediting-200707301910.tar.gz  webtools.sourceediting-200707301910.tar.xz  webtools.sourceediting-200707301910.zip  nitind17 years
v200707301255webtools.sourceediting-200707301255.tar.gz  webtools.sourceediting-200707301255.tar.xz  webtools.sourceediting-200707301255.zip  nitind17 years
v200707271200webtools.sourceediting-200707271200.tar.gz  webtools.sourceediting-200707271200.tar.xz  webtools.sourceediting-200707271200.zip  nitind17 years
v200707252000webtools.sourceediting-200707252000.tar.gz  webtools.sourceediting-200707252000.tar.xz  webtools.sourceediting-200707252000.zip  nitind17 years
v200707252231webtools.sourceediting-200707252231.tar.gz  webtools.sourceediting-200707252231.tar.xz  webtools.sourceediting-200707252231.zip  nitind17 years
v200707182215webtools.sourceediting-200707182215.tar.gz  webtools.sourceediting-200707182215.tar.xz  webtools.sourceediting-200707182215.zip  nitind17 years
v200707181721webtools.sourceediting-200707181721.tar.gz  webtools.sourceediting-200707181721.tar.xz  webtools.sourceediting-200707181721.zip  nitind17 years
v200707181720webtools.sourceediting-200707181720.tar.gz  webtools.sourceediting-200707181720.tar.xz  webtools.sourceediting-200707181720.zip  nitind17 years
v200707181640webtools.sourceediting-200707181640.tar.gz  webtools.sourceediting-200707181640.tar.xz  webtools.sourceediting-200707181640.zip  nitind17 years
v200707172046webtools.sourceediting-200707172046.tar.gz  webtools.sourceediting-200707172046.tar.xz  webtools.sourceediting-200707172046.zip  nitind17 years
v200707172045webtools.sourceediting-200707172045.tar.gz  webtools.sourceediting-200707172045.tar.xz  webtools.sourceediting-200707172045.zip  nitind17 years
v20070705change01webtools.sourceediting-20070705change01.tar.gz  webtools.sourceediting-20070705change01.tar.xz  webtools.sourceediting-20070705change01.zip  nitind17 years
v200706221355webtools.sourceediting-200706221355.tar.gz  webtools.sourceediting-200706221355.tar.xz  webtools.sourceediting-200706221355.zip  nitind17 years
v200706212223webtools.sourceediting-200706212223.tar.gz  webtools.sourceediting-200706212223.tar.xz  webtools.sourceediting-200706212223.zip  nitind17 years
R2_0_0webtools.sourceediting-R2_0_0.tar.gz  webtools.sourceediting-R2_0_0.tar.xz  webtools.sourceediting-R2_0_0.zip  nitind17 years
v200706192034webtools.sourceediting-200706192034.tar.gz  webtools.sourceediting-200706192034.tar.xz  webtools.sourceediting-200706192034.zip  nitind17 years
v200706182145webtools.sourceediting-200706182145.tar.gz  webtools.sourceediting-200706182145.tar.xz  webtools.sourceediting-200706182145.zip  nitind17 years
v200706131840webtools.sourceediting-200706131840.tar.gz  webtools.sourceediting-200706131840.tar.xz  webtools.sourceediting-200706131840.zip  nitind17 years
v200706120811webtools.sourceediting-200706120811.tar.gz  webtools.sourceediting-200706120811.tar.xz  webtools.sourceediting-200706120811.zip  nitind17 years
v200706111751webtools.sourceediting-200706111751.tar.gz  webtools.sourceediting-200706111751.tar.xz  webtools.sourceediting-200706111751.zip  nitind17 years
v200706110217webtools.sourceediting-200706110217.tar.gz  webtools.sourceediting-200706110217.tar.xz  webtools.sourceediting-200706110217.zip  nitind17 years
v200706071730webtools.sourceediting-200706071730.tar.gz  webtools.sourceediting-200706071730.tar.xz  webtools.sourceediting-200706071730.zip  nitind17 years
v200706042202webtools.sourceediting-200706042202.tar.gz  webtools.sourceediting-200706042202.tar.xz  webtools.sourceediting-200706042202.zip  nitind17 years
v200706041905webtools.sourceediting-200706041905.tar.gz  webtools.sourceediting-200706041905.tar.xz  webtools.sourceediting-200706041905.zip  nitind17 years
v200706040100webtools.sourceediting-200706040100.tar.gz  webtools.sourceediting-200706040100.tar.xz  webtools.sourceediting-200706040100.zip  nitind17 years
v200706040030webtools.sourceediting-200706040030.tar.gz  webtools.sourceediting-200706040030.tar.xz  webtools.sourceediting-200706040030.zip  nitind17 years
v200706032350webtools.sourceediting-200706032350.tar.gz  webtools.sourceediting-200706032350.tar.xz  webtools.sourceediting-200706032350.zip  nitind17 years
v200705311615webtools.sourceediting-200705311615.tar.gz  webtools.sourceediting-200705311615.tar.xz  webtools.sourceediting-200705311615.zip  nitind17 years
v200705310500webtools.sourceediting-200705310500.tar.gz  webtools.sourceediting-200705310500.tar.xz  webtools.sourceediting-200705310500.zip  nitind17 years
v200705302225webtools.sourceediting-200705302225.tar.gz  webtools.sourceediting-200705302225.tar.xz  webtools.sourceediting-200705302225.zip  nitind17 years
v200705302149webtools.sourceediting-200705302149.tar.gz  webtools.sourceediting-200705302149.tar.xz  webtools.sourceediting-200705302149.zip  nitind17 years
v200705252115webtools.sourceediting-200705252115.tar.gz  webtools.sourceediting-200705252115.tar.xz  webtools.sourceediting-200705252115.zip  nitind17 years
v200705241527webtools.sourceediting-200705241527.tar.gz  webtools.sourceediting-200705241527.tar.xz  webtools.sourceediting-200705241527.zip  nitind17 years
v200705240640webtools.sourceediting-200705240640.tar.gz  webtools.sourceediting-200705240640.tar.xz  webtools.sourceediting-200705240640.zip  nitind17 years
v200705240440webtools.sourceediting-200705240440.tar.gz  webtools.sourceediting-200705240440.tar.xz  webtools.sourceediting-200705240440.zip  nitind17 years
v200705240428webtools.sourceediting-200705240428.tar.gz  webtools.sourceediting-200705240428.tar.xz  webtools.sourceediting-200705240428.zip  nitind17 years
v200705240424webtools.sourceediting-200705240424.tar.gz  webtools.sourceediting-200705240424.tar.xz  webtools.sourceediting-200705240424.zip  nitind17 years
v200705231906webtools.sourceediting-200705231906.tar.gz  webtools.sourceediting-200705231906.tar.xz  webtools.sourceediting-200705231906.zip  nitind17 years
v200705212245webtools.sourceediting-200705212245.tar.gz  webtools.sourceediting-200705212245.tar.xz  webtools.sourceediting-200705212245.zip  nitind17 years
v200705211515webtools.sourceediting-200705211515.tar.gz  webtools.sourceediting-200705211515.tar.xz  webtools.sourceediting-200705211515.zip  nitind17 years
v200705211450webtools.sourceediting-200705211450.tar.gz  webtools.sourceediting-200705211450.tar.xz  webtools.sourceediting-200705211450.zip  nitind17 years
v200705210500webtools.sourceediting-200705210500.tar.gz  webtools.sourceediting-200705210500.tar.xz  webtools.sourceediting-200705210500.zip  nitind17 years
v200705200218webtools.sourceediting-200705200218.tar.gz  webtools.sourceediting-200705200218.tar.xz  webtools.sourceediting-200705200218.zip  nitind17 years
v200705200209webtools.sourceediting-200705200209.tar.gz  webtools.sourceediting-200705200209.tar.xz  webtools.sourceediting-200705200209.zip  nitind17 years
v200705200205webtools.sourceediting-200705200205.tar.gz  webtools.sourceediting-200705200205.tar.xz  webtools.sourceediting-200705200205.zip  nitind17 years
v200705181050webtools.sourceediting-200705181050.tar.gz  webtools.sourceediting-200705181050.tar.xz  webtools.sourceediting-200705181050.zip  nitind17 years
v200705172340webtools.sourceediting-200705172340.tar.gz  webtools.sourceediting-200705172340.tar.xz  webtools.sourceediting-200705172340.zip  nitind17 years
v200705171616webtools.sourceediting-200705171616.tar.gz  webtools.sourceediting-200705171616.tar.xz  webtools.sourceediting-200705171616.zip  nitind17 years
v200705161845webtools.sourceediting-200705161845.tar.gz  webtools.sourceediting-200705161845.tar.xz  webtools.sourceediting-200705161845.zip  nitind17 years
v200705150253webtools.sourceediting-200705150253.tar.gz  webtools.sourceediting-200705150253.tar.xz  webtools.sourceediting-200705150253.zip  nitind17 years
v200705150251webtools.sourceediting-200705150251.tar.gz  webtools.sourceediting-200705150251.tar.xz  webtools.sourceediting-200705150251.zip  nitind17 years
v200705141726webtools.sourceediting-200705141726.tar.gz  webtools.sourceediting-200705141726.tar.xz  webtools.sourceediting-200705141726.zip  nitind17 years
v200705141600webtools.sourceediting-200705141600.tar.gz  webtools.sourceediting-200705141600.tar.xz  webtools.sourceediting-200705141600.zip  nitind17 years
v200705141340webtools.sourceediting-200705141340.tar.gz  webtools.sourceediting-200705141340.tar.xz  webtools.sourceediting-200705141340.zip  nitind17 years
v200705092245webtools.sourceediting-200705092245.tar.gz  webtools.sourceediting-200705092245.tar.xz  webtools.sourceediting-200705092245.zip  nitind17 years
v200705082332webtools.sourceediting-200705082332.tar.gz  webtools.sourceediting-200705082332.tar.xz  webtools.sourceediting-200705082332.zip  nitind17 years
v200705081842webtools.sourceediting-200705081842.tar.gz  webtools.sourceediting-200705081842.tar.xz  webtools.sourceediting-200705081842.zip  nitind17 years
v200705092313webtools.sourceediting-200705092313.tar.gz  webtools.sourceediting-200705092313.tar.xz  webtools.sourceediting-200705092313.zip  nitind17 years
v200705071905webtools.sourceediting-200705071905.tar.gz  webtools.sourceediting-200705071905.tar.xz  webtools.sourceediting-200705071905.zip  nitind17 years
v200705030550webtools.sourceediting-200705030550.tar.gz  webtools.sourceediting-200705030550.tar.xz  webtools.sourceediting-200705030550.zip  nitind17 years
v200705030446webtools.sourceediting-200705030446.tar.gz  webtools.sourceediting-200705030446.tar.xz  webtools.sourceediting-200705030446.zip  nitind17 years
v200705030210webtools.sourceediting-200705030210.tar.gz  webtools.sourceediting-200705030210.tar.xz  webtools.sourceediting-200705030210.zip  nitind17 years
v200705022316webtools.sourceediting-200705022316.tar.gz  webtools.sourceediting-200705022316.tar.xz  webtools.sourceediting-200705022316.zip  nitind17 years
v200705022215webtools.sourceediting-200705022215.tar.gz  webtools.sourceediting-200705022215.tar.xz  webtools.sourceediting-200705022215.zip  nitind17 years
v200705021820webtools.sourceediting-200705021820.tar.gz  webtools.sourceediting-200705021820.tar.xz  webtools.sourceediting-200705021820.zip  nitind17 years
v200705021810webtools.sourceediting-200705021810.tar.gz  webtools.sourceediting-200705021810.tar.xz  webtools.sourceediting-200705021810.zip  nitind17 years
v200705021705webtools.sourceediting-200705021705.tar.gz  webtools.sourceediting-200705021705.tar.xz  webtools.sourceediting-200705021705.zip  nitind17 years
v200705020654webtools.sourceediting-200705020654.tar.gz  webtools.sourceediting-200705020654.tar.xz  webtools.sourceediting-200705020654.zip  nitind17 years
v200705020644webtools.sourceediting-200705020644.tar.gz  webtools.sourceediting-200705020644.tar.xz  webtools.sourceediting-200705020644.zip  nitind17 years
v200705012359webtools.sourceediting-200705012359.tar.gz  webtools.sourceediting-200705012359.tar.xz  webtools.sourceediting-200705012359.zip  nitind17 years
v200705012025webtools.sourceediting-200705012025.tar.gz  webtools.sourceediting-200705012025.tar.xz  webtools.sourceediting-200705012025.zip  nitind17 years
v200704301934webtools.sourceediting-200704301934.tar.gz  webtools.sourceediting-200704301934.tar.xz  webtools.sourceediting-200704301934.zip  nitind17 years
v200704281330webtools.sourceediting-200704281330.tar.gz  webtools.sourceediting-200704281330.tar.xz  webtools.sourceediting-200704281330.zip  nitind17 years
v200704280857webtools.sourceediting-200704280857.tar.gz  webtools.sourceediting-200704280857.tar.xz  webtools.sourceediting-200704280857.zip  nitind17 years
v200704280741webtools.sourceediting-200704280741.tar.gz  webtools.sourceediting-200704280741.tar.xz  webtools.sourceediting-200704280741.zip  nitind17 years
v200704280408webtools.sourceediting-200704280408.tar.gz  webtools.sourceediting-200704280408.tar.xz  webtools.sourceediting-200704280408.zip  nitind17 years
v200704260345webtools.sourceediting-200704260345.tar.gz  webtools.sourceediting-200704260345.tar.xz  webtools.sourceediting-200704260345.zip  nitind17 years
R1_5_4webtools.sourceediting-R1_5_4.tar.gz  webtools.sourceediting-R1_5_4.tar.xz  webtools.sourceediting-R1_5_4.zip  nitind17 years
v200704260107webtools.sourceediting-200704260107.tar.gz  webtools.sourceediting-200704260107.tar.xz  webtools.sourceediting-200704260107.zip  nitind17 years
v200704251757webtools.sourceediting-200704251757.tar.gz  webtools.sourceediting-200704251757.tar.xz  webtools.sourceediting-200704251757.zip  nitind17 years
v200705020330webtools.sourceediting-200705020330.tar.gz  webtools.sourceediting-200705020330.tar.xz  webtools.sourceediting-200705020330.zip  nitind17 years
v200704240615webtools.sourceediting-200704240615.tar.gz  webtools.sourceediting-200704240615.tar.xz  webtools.sourceediting-200704240615.zip  nitind17 years
v200704240412webtools.sourceediting-200704240412.tar.gz  webtools.sourceediting-200704240412.tar.xz  webtools.sourceediting-200704240412.zip  nitind17 years
v200704232052webtools.sourceediting-200704232052.tar.gz  webtools.sourceediting-200704232052.tar.xz  webtools.sourceediting-200704232052.zip  nitind17 years
v200704192054webtools.sourceediting-200704192054.tar.gz  webtools.sourceediting-200704192054.tar.xz  webtools.sourceediting-200704192054.zip  nitind17 years
v200704191925webtools.sourceediting-200704191925.tar.gz  webtools.sourceediting-200704191925.tar.xz  webtools.sourceediting-200704191925.zip  nitind17 years
v200704191900webtools.sourceediting-200704191900.tar.gz  webtools.sourceediting-200704191900.tar.xz  webtools.sourceediting-200704191900.zip  nitind17 years
v200704190452webtools.sourceediting-200704190452.tar.gz  webtools.sourceediting-200704190452.tar.xz  webtools.sourceediting-200704190452.zip  nitind17 years
v200704190445webtools.sourceediting-200704190445.tar.gz  webtools.sourceediting-200704190445.tar.xz  webtools.sourceediting-200704190445.zip  nitind17 years
v200704181752webtools.sourceediting-200704181752.tar.gz  webtools.sourceediting-200704181752.tar.xz  webtools.sourceediting-200704181752.zip  nitind17 years
v200704181252webtools.sourceediting-200704181252.tar.gz  webtools.sourceediting-200704181252.tar.xz  webtools.sourceediting-200704181252.zip  nitind17 years
v200704190411webtools.sourceediting-200704190411.tar.gz  webtools.sourceediting-200704190411.tar.xz  webtools.sourceediting-200704190411.zip  nitind17 years
v200704172146webtools.sourceediting-200704172146.tar.gz  webtools.sourceediting-200704172146.tar.xz  webtools.sourceediting-200704172146.zip  nitind17 years
v200704170505webtools.sourceediting-200704170505.tar.gz  webtools.sourceediting-200704170505.tar.xz  webtools.sourceediting-200704170505.zip  nitind17 years
v200704170450webtools.sourceediting-200704170450.tar.gz  webtools.sourceediting-200704170450.tar.xz  webtools.sourceediting-200704170450.zip  nitind17 years
v200704162110webtools.sourceediting-200704162110.tar.gz  webtools.sourceediting-200704162110.tar.xz  webtools.sourceediting-200704162110.zip  nitind17 years
v200704170308webtools.sourceediting-200704170308.tar.gz  webtools.sourceediting-200704170308.tar.xz  webtools.sourceediting-200704170308.zip  nitind17 years
v200704150112webtools.sourceediting-200704150112.tar.gz  webtools.sourceediting-200704150112.tar.xz  webtools.sourceediting-200704150112.zip  nitind17 years
v200704111621webtools.sourceediting-200704111621.tar.gz  webtools.sourceediting-200704111621.tar.xz  webtools.sourceediting-200704111621.zip  nitind17 years
v200704111948webtools.sourceediting-200704111948.tar.gz  webtools.sourceediting-200704111948.tar.xz  webtools.sourceediting-200704111948.zip  nitind17 years
v200704111425webtools.sourceediting-200704111425.tar.gz  webtools.sourceediting-200704111425.tar.xz  webtools.sourceediting-200704111425.zip  nitind17 years
v200704110710webtools.sourceediting-200704110710.tar.gz  webtools.sourceediting-200704110710.tar.xz  webtools.sourceediting-200704110710.zip  nitind17 years
v200704110128webtools.sourceediting-200704110128.tar.gz  webtools.sourceediting-200704110128.tar.xz  webtools.sourceediting-200704110128.zip  nitind17 years
v200704102044webtools.sourceediting-200704102044.tar.gz  webtools.sourceediting-200704102044.tar.xz  webtools.sourceediting-200704102044.zip  nitind17 years
v200704102012webtools.sourceediting-200704102012.tar.gz  webtools.sourceediting-200704102012.tar.xz  webtools.sourceediting-200704102012.zip  nitind17 years
v200704101835webtools.sourceediting-200704101835.tar.gz  webtools.sourceediting-200704101835.tar.xz  webtools.sourceediting-200704101835.zip  nitind17 years
v200704101709webtools.sourceediting-200704101709.tar.gz  webtools.sourceediting-200704101709.tar.xz  webtools.sourceediting-200704101709.zip  nitind17 years
v200704101707webtools.sourceediting-200704101707.tar.gz  webtools.sourceediting-200704101707.tar.xz  webtools.sourceediting-200704101707.zip  nitind17 years
v200704100735webtools.sourceediting-200704100735.tar.gz  webtools.sourceediting-200704100735.tar.xz  webtools.sourceediting-200704100735.zip  nitind17 years
v200704100736webtools.sourceediting-200704100736.tar.gz  webtools.sourceediting-200704100736.tar.xz  webtools.sourceediting-200704100736.zip  nitind17 years
v200704100427webtools.sourceediting-200704100427.tar.gz  webtools.sourceediting-200704100427.tar.xz  webtools.sourceediting-200704100427.zip  nitind17 years
v200704092340webtools.sourceediting-200704092340.tar.gz  webtools.sourceediting-200704092340.tar.xz  webtools.sourceediting-200704092340.zip  nitind17 years
v200704052047webtools.sourceediting-200704052047.tar.gz  webtools.sourceediting-200704052047.tar.xz  webtools.sourceediting-200704052047.zip  nitind17 years
v200704050501webtools.sourceediting-200704050501.tar.gz  webtools.sourceediting-200704050501.tar.xz  webtools.sourceediting-200704050501.zip  nitind17 years
v200704050441webtools.sourceediting-200704050441.tar.gz  webtools.sourceediting-200704050441.tar.xz  webtools.sourceediting-200704050441.zip  nitind17 years
v200704042148webtools.sourceediting-200704042148.tar.gz  webtools.sourceediting-200704042148.tar.xz  webtools.sourceediting-200704042148.zip  nitind17 years
v200704031530webtools.sourceediting-200704031530.tar.gz  webtools.sourceediting-200704031530.tar.xz  webtools.sourceediting-200704031530.zip  nitind17 years
v200704012321webtools.sourceediting-200704012321.tar.gz  webtools.sourceediting-200704012321.tar.xz  webtools.sourceediting-200704012321.zip  nitind17 years
v200704012122webtools.sourceediting-200704012122.tar.gz  webtools.sourceediting-200704012122.tar.xz  webtools.sourceediting-200704012122.zip  nitind17 years
v200703290237webtools.sourceediting-200703290237.tar.gz  webtools.sourceediting-200703290237.tar.xz  webtools.sourceediting-200703290237.zip  nitind17 years
v200703290155webtools.sourceediting-200703290155.tar.gz  webtools.sourceediting-200703290155.tar.xz  webtools.sourceediting-200703290155.zip  nitind17 years
v200703282306webtools.sourceediting-200703282306.tar.gz  webtools.sourceediting-200703282306.tar.xz  webtools.sourceediting-200703282306.zip  nitind17 years
v200703282245webtools.sourceediting-200703282245.tar.gz  webtools.sourceediting-200703282245.tar.xz  webtools.sourceediting-200703282245.zip  nitind17 years
v200703282215webtools.sourceediting-200703282215.tar.gz  webtools.sourceediting-200703282215.tar.xz  webtools.sourceediting-200703282215.zip  nitind17 years
v200703282200webtools.sourceediting-200703282200.tar.gz  webtools.sourceediting-200703282200.tar.xz  webtools.sourceediting-200703282200.zip  nitind17 years
v200703281948webtools.sourceediting-200703281948.tar.gz  webtools.sourceediting-200703281948.tar.xz  webtools.sourceediting-200703281948.zip  nitind17 years
v200703280731webtools.sourceediting-200703280731.tar.gz  webtools.sourceediting-200703280731.tar.xz  webtools.sourceediting-200703280731.zip  nitind17 years
v200703280735webtools.sourceediting-200703280735.tar.gz  webtools.sourceediting-200703280735.tar.xz  webtools.sourceediting-200703280735.zip  nitind17 years
v200703280710webtools.sourceediting-200703280710.tar.gz  webtools.sourceediting-200703280710.tar.xz  webtools.sourceediting-200703280710.zip  nitind17 years
v200703280352webtools.sourceediting-200703280352.tar.gz  webtools.sourceediting-200703280352.tar.xz  webtools.sourceediting-200703280352.zip  nitind17 years
v200703280045webtools.sourceediting-200703280045.tar.gz  webtools.sourceediting-200703280045.tar.xz  webtools.sourceediting-200703280045.zip  nitind17 years
v200703272144webtools.sourceediting-200703272144.tar.gz  webtools.sourceediting-200703272144.tar.xz  webtools.sourceediting-200703272144.zip  nitind17 years
v200703260524webtools.sourceediting-200703260524.tar.gz  webtools.sourceediting-200703260524.tar.xz  webtools.sourceediting-200703260524.zip  nitind17 years
v20070326_0320webtools.sourceediting-20070326_0320.tar.gz  webtools.sourceediting-20070326_0320.tar.xz  webtools.sourceediting-20070326_0320.zip  nitind17 years
v200703241528webtools.sourceediting-200703241528.tar.gz  webtools.sourceediting-200703241528.tar.xz  webtools.sourceediting-200703241528.zip  nitind18 years
v200703241514webtools.sourceediting-200703241514.tar.gz  webtools.sourceediting-200703241514.tar.xz  webtools.sourceediting-200703241514.zip  nitind18 years
v200703240656webtools.sourceediting-200703240656.tar.gz  webtools.sourceediting-200703240656.tar.xz  webtools.sourceediting-200703240656.zip  nitind18 years
v200703231625webtools.sourceediting-200703231625.tar.gz  webtools.sourceediting-200703231625.tar.xz  webtools.sourceediting-200703231625.zip  nitind18 years
v200703210407webtools.sourceediting-200703210407.tar.gz  webtools.sourceediting-200703210407.tar.xz  webtools.sourceediting-200703210407.zip  nitind18 years
v200703191629webtools.sourceediting-200703191629.tar.gz  webtools.sourceediting-200703191629.tar.xz  webtools.sourceediting-200703191629.zip  nitind18 years
v200703162341webtools.sourceediting-200703162341.tar.gz  webtools.sourceediting-200703162341.tar.xz  webtools.sourceediting-200703162341.zip  nitind18 years
v200703162039webtools.sourceediting-200703162039.tar.gz  webtools.sourceediting-200703162039.tar.xz  webtools.sourceediting-200703162039.zip  nitind18 years
v200703150525webtools.sourceediting-200703150525.tar.gz  webtools.sourceediting-200703150525.tar.xz  webtools.sourceediting-200703150525.zip  nitind18 years
v200703142027webtools.sourceediting-200703142027.tar.gz  webtools.sourceediting-200703142027.tar.xz  webtools.sourceediting-200703142027.zip  nitind18 years
v200703141529webtools.sourceediting-200703141529.tar.gz  webtools.sourceediting-200703141529.tar.xz  webtools.sourceediting-200703141529.zip  nitind18 years
v200703141506webtools.sourceediting-200703141506.tar.gz  webtools.sourceediting-200703141506.tar.xz  webtools.sourceediting-200703141506.zip  nitind18 years
v200703140248webtools.sourceediting-200703140248.tar.gz  webtools.sourceediting-200703140248.tar.xz  webtools.sourceediting-200703140248.zip  nitind18 years
v200703131607webtools.sourceediting-200703131607.tar.gz  webtools.sourceediting-200703131607.tar.xz  webtools.sourceediting-200703131607.zip  nitind18 years
v200703121813webtools.sourceediting-200703121813.tar.gz  webtools.sourceediting-200703121813.tar.xz  webtools.sourceediting-200703121813.zip  nitind18 years
v200703072151webtools.sourceediting-200703072151.tar.gz  webtools.sourceediting-200703072151.tar.xz  webtools.sourceediting-200703072151.zip  nitind18 years
v200703071838webtools.sourceediting-200703071838.tar.gz  webtools.sourceediting-200703071838.tar.xz  webtools.sourceediting-200703071838.zip  nitind18 years
v200703070556webtools.sourceediting-200703070556.tar.gz  webtools.sourceediting-200703070556.tar.xz  webtools.sourceediting-200703070556.zip  nitind18 years
v200703052359webtools.sourceediting-200703052359.tar.gz  webtools.sourceediting-200703052359.tar.xz  webtools.sourceediting-200703052359.zip  nitind18 years
v200702282335webtools.sourceediting-200702282335.tar.gz  webtools.sourceediting-200702282335.tar.xz  webtools.sourceediting-200702282335.zip  nitind18 years
v200702262217webtools.sourceediting-200702262217.tar.gz  webtools.sourceediting-200702262217.tar.xz  webtools.sourceediting-200702262217.zip  nitind18 years
v200702262033webtools.sourceediting-200702262033.tar.gz  webtools.sourceediting-200702262033.tar.xz  webtools.sourceediting-200702262033.zip  nitind18 years
v2007022103351webtools.sourceediting-2007022103351.tar.gz  webtools.sourceediting-2007022103351.tar.xz  webtools.sourceediting-2007022103351.zip  nitind18 years
v200702171435webtools.sourceediting-200702171435.tar.gz  webtools.sourceediting-200702171435.tar.xz  webtools.sourceediting-200702171435.zip  nitind18 years
v200702160326webtools.sourceediting-200702160326.tar.gz  webtools.sourceediting-200702160326.tar.xz  webtools.sourceediting-200702160326.zip  nitind18 years
v200702160312webtools.sourceediting-200702160312.tar.gz  webtools.sourceediting-200702160312.tar.xz  webtools.sourceediting-200702160312.zip  nitind18 years
v200702151810webtools.sourceediting-200702151810.tar.gz  webtools.sourceediting-200702151810.tar.xz  webtools.sourceediting-200702151810.zip  nitind18 years
v200702150501webtools.sourceediting-200702150501.tar.gz  webtools.sourceediting-200702150501.tar.xz  webtools.sourceediting-200702150501.zip  nitind18 years
v200702150630webtools.sourceediting-200702150630.tar.gz  webtools.sourceediting-200702150630.tar.xz  webtools.sourceediting-200702150630.zip  nitind18 years
v200702150623webtools.sourceediting-200702150623.tar.gz  webtools.sourceediting-200702150623.tar.xz  webtools.sourceediting-200702150623.zip  nitind18 years
v200702150457webtools.sourceediting-200702150457.tar.gz  webtools.sourceediting-200702150457.tar.xz  webtools.sourceediting-200702150457.zip  nitind18 years
v200702141957webtools.sourceediting-200702141957.tar.gz  webtools.sourceediting-200702141957.tar.xz  webtools.sourceediting-200702141957.zip  nitind18 years
v200702140819webtools.sourceediting-200702140819.tar.gz  webtools.sourceediting-200702140819.tar.xz  webtools.sourceediting-200702140819.zip  nitind18 years
v200702130525webtools.sourceediting-200702130525.tar.gz  webtools.sourceediting-200702130525.tar.xz  webtools.sourceediting-200702130525.zip  nitind18 years
v200702130129webtools.sourceediting-200702130129.tar.gz  webtools.sourceediting-200702130129.tar.xz  webtools.sourceediting-200702130129.zip  nitind18 years
v200702122149webtools.sourceediting-200702122149.tar.gz  webtools.sourceediting-200702122149.tar.xz  webtools.sourceediting-200702122149.zip  nitind18 years
v200702130040webtools.sourceediting-200702130040.tar.gz  webtools.sourceediting-200702130040.tar.xz  webtools.sourceediting-200702130040.zip  nitind18 years
v200702122131webtools.sourceediting-200702122131.tar.gz  webtools.sourceediting-200702122131.tar.xz  webtools.sourceediting-200702122131.zip  nitind18 years
v200702122042webtools.sourceediting-200702122042.tar.gz  webtools.sourceediting-200702122042.tar.xz  webtools.sourceediting-200702122042.zip  nitind18 years
v200702121724webtools.sourceediting-200702121724.tar.gz  webtools.sourceediting-200702121724.tar.xz  webtools.sourceediting-200702121724.zip  nitind18 years
v200702121540webtools.sourceediting-200702121540.tar.gz  webtools.sourceediting-200702121540.tar.xz  webtools.sourceediting-200702121540.zip  nitind18 years
v200702121524webtools.sourceediting-200702121524.tar.gz  webtools.sourceediting-200702121524.tar.xz  webtools.sourceediting-200702121524.zip  nitind18 years
R1_5_3webtools.sourceediting-R1_5_3.tar.gz  webtools.sourceediting-R1_5_3.tar.xz  webtools.sourceediting-R1_5_3.zip  nitind18 years
v200702051837webtools.sourceediting-200702051837.tar.gz  webtools.sourceediting-200702051837.tar.xz  webtools.sourceediting-200702051837.zip  nitind18 years
v200702021602webtools.sourceediting-200702021602.tar.gz  webtools.sourceediting-200702021602.tar.xz  webtools.sourceediting-200702021602.zip  nitind18 years
v200702021750webtools.sourceediting-200702021750.tar.gz  webtools.sourceediting-200702021750.tar.xz  webtools.sourceediting-200702021750.zip  nitind18 years
v200702021717webtools.sourceediting-200702021717.tar.gz  webtools.sourceediting-200702021717.tar.xz  webtools.sourceediting-200702021717.zip  nitind18 years
v200702021100webtools.sourceediting-200702021100.tar.gz  webtools.sourceediting-200702021100.tar.xz  webtools.sourceediting-200702021100.zip  nitind18 years
v200701312359webtools.sourceediting-200701312359.tar.gz  webtools.sourceediting-200701312359.tar.xz  webtools.sourceediting-200701312359.zip  nitind18 years
v200701311634webtools.sourceediting-200701311634.tar.gz  webtools.sourceediting-200701311634.tar.xz  webtools.sourceediting-200701311634.zip  nitind18 years
v200701310556webtools.sourceediting-200701310556.tar.gz  webtools.sourceediting-200701310556.tar.xz  webtools.sourceediting-200701310556.zip  nitind18 years
v200701310555webtools.sourceediting-200701310555.tar.gz  webtools.sourceediting-200701310555.tar.xz  webtools.sourceediting-200701310555.zip  nitind18 years
v200701301158webtools.sourceediting-200701301158.tar.gz  webtools.sourceediting-200701301158.tar.xz  webtools.sourceediting-200701301158.zip  nitind18 years
v200701301833webtools.sourceediting-200701301833.tar.gz  webtools.sourceediting-200701301833.tar.xz  webtools.sourceediting-200701301833.zip  nitind18 years
v200701300430webtools.sourceediting-200701300430.tar.gz  webtools.sourceediting-200701300430.tar.xz  webtools.sourceediting-200701300430.zip  nitind18 years
v200701292141webtools.sourceediting-200701292141.tar.gz  webtools.sourceediting-200701292141.tar.xz  webtools.sourceediting-200701292141.zip  nitind18 years
v200701292058webtools.sourceediting-200701292058.tar.gz  webtools.sourceediting-200701292058.tar.xz  webtools.sourceediting-200701292058.zip  nitind18 years
v200701300459webtools.sourceediting-200701300459.tar.gz  webtools.sourceediting-200701300459.tar.xz  webtools.sourceediting-200701300459.zip  nitind18 years
v200701300434webtools.sourceediting-200701300434.tar.gz  webtools.sourceediting-200701300434.tar.xz  webtools.sourceediting-200701300434.zip  nitind18 years
v200701291713webtools.sourceediting-200701291713.tar.gz  webtools.sourceediting-200701291713.tar.xz  webtools.sourceediting-200701291713.zip  nitind18 years
v200701251933webtools.sourceediting-200701251933.tar.gz  webtools.sourceediting-200701251933.tar.xz  webtools.sourceediting-200701251933.zip  nitind18 years
v200701252330webtools.sourceediting-200701252330.tar.gz  webtools.sourceediting-200701252330.tar.xz  webtools.sourceediting-200701252330.zip  nitind18 years
v200701252050webtools.sourceediting-200701252050.tar.gz  webtools.sourceediting-200701252050.tar.xz  webtools.sourceediting-200701252050.zip  nitind18 years
v200701250458webtools.sourceediting-200701250458.tar.gz  webtools.sourceediting-200701250458.tar.xz  webtools.sourceediting-200701250458.zip  nitind18 years
v200701250243webtools.sourceediting-200701250243.tar.gz  webtools.sourceediting-200701250243.tar.xz  webtools.sourceediting-200701250243.zip  nitind18 years
v200701242116webtools.sourceediting-200701242116.tar.gz  webtools.sourceediting-200701242116.tar.xz  webtools.sourceediting-200701242116.zip  nitind18 years
v200701242051webtools.sourceediting-200701242051.tar.gz  webtools.sourceediting-200701242051.tar.xz  webtools.sourceediting-200701242051.zip  nitind18 years
v200701242115webtools.sourceediting-200701242115.tar.gz  webtools.sourceediting-200701242115.tar.xz  webtools.sourceediting-200701242115.zip  nitind18 years
v200701242035webtools.sourceediting-200701242035.tar.gz  webtools.sourceediting-200701242035.tar.xz  webtools.sourceediting-200701242035.zip  nitind18 years
v200701240141webtools.sourceediting-200701240141.tar.gz  webtools.sourceediting-200701240141.tar.xz  webtools.sourceediting-200701240141.zip  nitind18 years
v200701222134webtools.sourceediting-200701222134.tar.gz  webtools.sourceediting-200701222134.tar.xz  webtools.sourceediting-200701222134.zip  nitind18 years
v200701222130webtools.sourceediting-200701222130.tar.gz  webtools.sourceediting-200701222130.tar.xz  webtools.sourceediting-200701222130.zip  nitind18 years
v200701180845webtools.sourceediting-200701180845.tar.gz  webtools.sourceediting-200701180845.tar.xz  webtools.sourceediting-200701180845.zip  nitind18 years
v200701172042webtools.sourceediting-200701172042.tar.gz  webtools.sourceediting-200701172042.tar.xz  webtools.sourceediting-200701172042.zip  nitind18 years
v200701171931webtools.sourceediting-200701171931.tar.gz  webtools.sourceediting-200701171931.tar.xz  webtools.sourceediting-200701171931.zip  nitind18 years
v200701171849webtools.sourceediting-200701171849.tar.gz  webtools.sourceediting-200701171849.tar.xz  webtools.sourceediting-200701171849.zip  nitind18 years
v200701171839webtools.sourceediting-200701171839.tar.gz  webtools.sourceediting-200701171839.tar.xz  webtools.sourceediting-200701171839.zip  nitind18 years
v200701171831webtools.sourceediting-200701171831.tar.gz  webtools.sourceediting-200701171831.tar.xz  webtools.sourceediting-200701171831.zip  nitind18 years
v200701171733webtools.sourceediting-200701171733.tar.gz  webtools.sourceediting-200701171733.tar.xz  webtools.sourceediting-200701171733.zip  nitind18 years
v200701170611webtools.sourceediting-200701170611.tar.gz  webtools.sourceediting-200701170611.tar.xz  webtools.sourceediting-200701170611.zip  nitind18 years
v200701170637webtools.sourceediting-200701170637.tar.gz  webtools.sourceediting-200701170637.tar.xz  webtools.sourceediting-200701170637.zip  nitind18 years
v200701170115webtools.sourceediting-200701170115.tar.gz  webtools.sourceediting-200701170115.tar.xz  webtools.sourceediting-200701170115.zip  nitind18 years
v200701162251webtools.sourceediting-200701162251.tar.gz  webtools.sourceediting-200701162251.tar.xz  webtools.sourceediting-200701162251.zip  nitind18 years
v200701162130webtools.sourceediting-200701162130.tar.gz  webtools.sourceediting-200701162130.tar.xz  webtools.sourceediting-200701162130.zip  nitind18 years
v200701152437webtools.sourceediting-200701152437.tar.gz  webtools.sourceediting-200701152437.tar.xz  webtools.sourceediting-200701152437.zip  nitind18 years
v200701092033webtools.sourceediting-200701092033.tar.gz  webtools.sourceediting-200701092033.tar.xz  webtools.sourceediting-200701092033.zip  nitind18 years
v200701091958webtools.sourceediting-200701091958.tar.gz  webtools.sourceediting-200701091958.tar.xz  webtools.sourceediting-200701091958.zip  nitind18 years
v200701092052webtools.sourceediting-200701092052.tar.gz  webtools.sourceediting-200701092052.tar.xz  webtools.sourceediting-200701092052.zip  nitind18 years
v200701090103webtools.sourceediting-200701090103.tar.gz  webtools.sourceediting-200701090103.tar.xz  webtools.sourceediting-200701090103.zip  nitind18 years
v200701082340webtools.sourceediting-200701082340.tar.gz  webtools.sourceediting-200701082340.tar.xz  webtools.sourceediting-200701082340.zip  nitind18 years
v200701300431webtools.sourceediting-200701300431.tar.gz  webtools.sourceediting-200701300431.tar.xz  webtools.sourceediting-200701300431.zip  nitind18 years
v200701030250webtools.sourceediting-200701030250.tar.gz  webtools.sourceediting-200701030250.tar.xz  webtools.sourceediting-200701030250.zip  nitind18 years
v200701030107webtools.sourceediting-200701030107.tar.gz  webtools.sourceediting-200701030107.tar.xz  webtools.sourceediting-200701030107.zip  nitind18 years
v200701022245webtools.sourceediting-200701022245.tar.gz  webtools.sourceediting-200701022245.tar.xz  webtools.sourceediting-200701022245.zip  nitind18 years
v200701022055webtools.sourceediting-200701022055.tar.gz  webtools.sourceediting-200701022055.tar.xz  webtools.sourceediting-200701022055.zip  nitind18 years
v200612280403webtools.sourceediting-200612280403.tar.gz  webtools.sourceediting-200612280403.tar.xz  webtools.sourceediting-200612280403.zip  nitind18 years
v200612200806webtools.sourceediting-200612200806.tar.gz  webtools.sourceediting-200612200806.tar.xz  webtools.sourceediting-200612200806.zip  nitind18 years
v200612200800webtools.sourceediting-200612200800.tar.gz  webtools.sourceediting-200612200800.tar.xz  webtools.sourceediting-200612200800.zip  nitind18 years
v200612200750webtools.sourceediting-200612200750.tar.gz  webtools.sourceediting-200612200750.tar.xz  webtools.sourceediting-200612200750.zip  nitind18 years
v200612200737webtools.sourceediting-200612200737.tar.gz  webtools.sourceediting-200612200737.tar.xz  webtools.sourceediting-200612200737.zip  nitind18 years
v200612141813webtools.sourceediting-200612141813.tar.gz  webtools.sourceediting-200612141813.tar.xz  webtools.sourceediting-200612141813.zip  nitind18 years
v200612140003webtools.sourceediting-200612140003.tar.gz  webtools.sourceediting-200612140003.tar.xz  webtools.sourceediting-200612140003.zip  nitind18 years
v200612131416webtools.sourceediting-200612131416.tar.gz  webtools.sourceediting-200612131416.tar.xz  webtools.sourceediting-200612131416.zip  nitind18 years
v200612140053webtools.sourceediting-200612140053.tar.gz  webtools.sourceediting-200612140053.tar.xz  webtools.sourceediting-200612140053.zip  nitind18 years
v200612120330webtools.sourceediting-200612120330.tar.gz  webtools.sourceediting-200612120330.tar.xz  webtools.sourceediting-200612120330.zip  nitind18 years
v200612120245webtools.sourceediting-200612120245.tar.gz  webtools.sourceediting-200612120245.tar.xz  webtools.sourceediting-200612120245.zip  nitind18 years
v200612120122webtools.sourceediting-200612120122.tar.gz  webtools.sourceediting-200612120122.tar.xz  webtools.sourceediting-200612120122.zip  nitind18 years
v200612111819webtools.sourceediting-200612111819.tar.gz  webtools.sourceediting-200612111819.tar.xz  webtools.sourceediting-200612111819.zip  nitind18 years
v200612111818webtools.sourceediting-200612111818.tar.gz  webtools.sourceediting-200612111818.tar.xz  webtools.sourceediting-200612111818.zip  nitind18 years
v200612070145webtools.sourceediting-200612070145.tar.gz  webtools.sourceediting-200612070145.tar.xz  webtools.sourceediting-200612070145.zip  nitind18 years
v200612062150webtools.sourceediting-200612062150.tar.gz  webtools.sourceediting-200612062150.tar.xz  webtools.sourceediting-200612062150.zip  nitind18 years
v200612060532webtools.sourceediting-200612060532.tar.gz  webtools.sourceediting-200612060532.tar.xz  webtools.sourceediting-200612060532.zip  nitind18 years
v200612060029webtools.sourceediting-200612060029.tar.gz  webtools.sourceediting-200612060029.tar.xz  webtools.sourceediting-200612060029.zip  nitind18 years
v200612052225webtools.sourceediting-200612052225.tar.gz  webtools.sourceediting-200612052225.tar.xz  webtools.sourceediting-200612052225.zip  nitind18 years
v200612052150webtools.sourceediting-200612052150.tar.gz  webtools.sourceediting-200612052150.tar.xz  webtools.sourceediting-200612052150.zip  nitind18 years
v200612051615webtools.sourceediting-200612051615.tar.gz  webtools.sourceediting-200612051615.tar.xz  webtools.sourceediting-200612051615.zip  nitind18 years
v200612050550webtools.sourceediting-200612050550.tar.gz  webtools.sourceediting-200612050550.tar.xz  webtools.sourceediting-200612050550.zip  nitind18 years
Root_R1_5_maintenance_patcheswebtools.sourceediting-Root_R1_5_maintenance_patches.tar.gz  webtools.sourceediting-Root_R1_5_maintenance_patches.tar.xz  webtools.sourceediting-Root_R1_5_maintenance_patches.zip  nitind18 years
v200612050505webtools.sourceediting-200612050505.tar.gz  webtools.sourceediting-200612050505.tar.xz  webtools.sourceediting-200612050505.zip  david_williams18 years
v200612050400webtools.sourceediting-200612050400.tar.gz  webtools.sourceediting-200612050400.tar.xz  webtools.sourceediting-200612050400.zip  david_williams18 years
v200611282126webtools.sourceediting-200611282126.tar.gz  webtools.sourceediting-200611282126.tar.xz  webtools.sourceediting-200611282126.zip  nitind18 years
v200611282124webtools.sourceediting-200611282124.tar.gz  webtools.sourceediting-200611282124.tar.xz  webtools.sourceediting-200611282124.zip  nitind18 years
v200611282001webtools.sourceediting-200611282001.tar.gz  webtools.sourceediting-200611282001.tar.xz  webtools.sourceediting-200611282001.zip  nitind18 years
v200611281956webtools.sourceediting-200611281956.tar.gz  webtools.sourceediting-200611281956.tar.xz  webtools.sourceediting-200611281956.zip  nitind18 years
v200611272206webtools.sourceediting-200611272206.tar.gz  webtools.sourceediting-200611272206.tar.xz  webtools.sourceediting-200611272206.zip  nitind18 years
v200611272155webtools.sourceediting-200611272155.tar.gz  webtools.sourceediting-200611272155.tar.xz  webtools.sourceediting-200611272155.zip  nitind18 years
v200611230452webtools.sourceediting-200611230452.tar.gz  webtools.sourceediting-200611230452.tar.xz  webtools.sourceediting-200611230452.zip  nitind18 years
v200611230431webtools.sourceediting-200611230431.tar.gz  webtools.sourceediting-200611230431.tar.xz  webtools.sourceediting-200611230431.zip  nitind18 years
v200611230430webtools.sourceediting-200611230430.tar.gz  webtools.sourceediting-200611230430.tar.xz  webtools.sourceediting-200611230430.zip  nitind18 years
v200611220050webtools.sourceediting-200611220050.tar.gz  webtools.sourceediting-200611220050.tar.xz  webtools.sourceediting-200611220050.zip  nitind18 years
v200611210029webtools.sourceediting-200611210029.tar.gz  webtools.sourceediting-200611210029.tar.xz  webtools.sourceediting-200611210029.zip  nitind18 years
v200611210021webtools.sourceediting-200611210021.tar.gz  webtools.sourceediting-200611210021.tar.xz  webtools.sourceediting-200611210021.zip  nitind18 years
v200611170100webtools.sourceediting-200611170100.tar.gz  webtools.sourceediting-200611170100.tar.xz  webtools.sourceediting-200611170100.zip  nitind18 years
v200611161411webtools.sourceediting-200611161411.tar.gz  webtools.sourceediting-200611161411.tar.xz  webtools.sourceediting-200611161411.zip  nitind18 years
v200611161400webtools.sourceediting-200611161400.tar.gz  webtools.sourceediting-200611161400.tar.xz  webtools.sourceediting-200611161400.zip  nitind18 years
v200611152220webtools.sourceediting-200611152220.tar.gz  webtools.sourceediting-200611152220.tar.xz  webtools.sourceediting-200611152220.zip  nitind18 years
v200611142226webtools.sourceediting-200611142226.tar.gz  webtools.sourceediting-200611142226.tar.xz  webtools.sourceediting-200611142226.zip  nitind18 years
v200611082218webtools.sourceediting-200611082218.tar.gz  webtools.sourceediting-200611082218.tar.xz  webtools.sourceediting-200611082218.zip  nitind18 years
v200611082107webtools.sourceediting-200611082107.tar.gz  webtools.sourceediting-200611082107.tar.xz  webtools.sourceediting-200611082107.zip  nitind18 years
v200611082053webtools.sourceediting-200611082053.tar.gz  webtools.sourceediting-200611082053.tar.xz  webtools.sourceediting-200611082053.zip  nitind18 years
v200611072240webtools.sourceediting-200611072240.tar.gz  webtools.sourceediting-200611072240.tar.xz  webtools.sourceediting-200611072240.zip  nitind18 years
v200611062157webtools.sourceediting-200611062157.tar.gz  webtools.sourceediting-200611062157.tar.xz  webtools.sourceediting-200611062157.zip  nitind18 years
v200611061924webtools.sourceediting-200611061924.tar.gz  webtools.sourceediting-200611061924.tar.xz  webtools.sourceediting-200611061924.zip  nitind18 years
v200611061923webtools.sourceediting-200611061923.tar.gz  webtools.sourceediting-200611061923.tar.xz  webtools.sourceediting-200611061923.zip  nitind18 years
v200611032347webtools.sourceediting-200611032347.tar.gz  webtools.sourceediting-200611032347.tar.xz  webtools.sourceediting-200611032347.zip  nitind18 years
v200611020114webtools.sourceediting-200611020114.tar.gz  webtools.sourceediting-200611020114.tar.xz  webtools.sourceediting-200611020114.zip  nitind18 years
v200610310625webtools.sourceediting-200610310625.tar.gz  webtools.sourceediting-200610310625.tar.xz  webtools.sourceediting-200610310625.zip  nitind18 years
v200610180710webtools.sourceediting-200610180710.tar.gz  webtools.sourceediting-200610180710.tar.xz  webtools.sourceediting-200610180710.zip  nitind18 years
v200610171745webtools.sourceediting-200610171745.tar.gz  webtools.sourceediting-200610171745.tar.xz  webtools.sourceediting-200610171745.zip  nitind18 years
R1_5_2webtools.sourceediting-R1_5_2.tar.gz  webtools.sourceediting-R1_5_2.tar.xz  webtools.sourceediting-R1_5_2.zip  nitind18 years
v200610171640webtools.sourceediting-200610171640.tar.gz  webtools.sourceediting-200610171640.tar.xz  webtools.sourceediting-200610171640.zip  nitind18 years
v200610161913webtools.sourceediting-200610161913.tar.gz  webtools.sourceediting-200610161913.tar.xz  webtools.sourceediting-200610161913.zip  nitind18 years
v200610161850webtools.sourceediting-200610161850.tar.gz  webtools.sourceediting-200610161850.tar.xz  webtools.sourceediting-200610161850.zip  nitind18 years
v200610140800webtools.sourceediting-200610140800.tar.gz  webtools.sourceediting-200610140800.tar.xz  webtools.sourceediting-200610140800.zip  nitind18 years
v200610131944webtools.sourceediting-200610131944.tar.gz  webtools.sourceediting-200610131944.tar.xz  webtools.sourceediting-200610131944.zip  nitind18 years
v200610131943webtools.sourceediting-200610131943.tar.gz  webtools.sourceediting-200610131943.tar.xz  webtools.sourceediting-200610131943.zip  nitind18 years
v200610092248webtools.sourceediting-200610092248.tar.gz  webtools.sourceediting-200610092248.tar.xz  webtools.sourceediting-200610092248.zip  nitind18 years
v200610092225webtools.sourceediting-200610092225.tar.gz  webtools.sourceediting-200610092225.tar.xz  webtools.sourceediting-200610092225.zip  nitind18 years
v200610071830webtools.sourceediting-200610071830.tar.gz  webtools.sourceediting-200610071830.tar.xz  webtools.sourceediting-200610071830.zip  nitind18 years
v200610062035webtools.sourceediting-200610062035.tar.gz  webtools.sourceediting-200610062035.tar.xz  webtools.sourceediting-200610062035.zip  nitind18 years
v200610061825webtools.sourceediting-200610061825.tar.gz  webtools.sourceediting-200610061825.tar.xz  webtools.sourceediting-200610061825.zip  nitind18 years
v200610042315webtools.sourceediting-200610042315.tar.gz  webtools.sourceediting-200610042315.tar.xz  webtools.sourceediting-200610042315.zip  nitind18 years
v200610041528webtools.sourceediting-200610041528.tar.gz  webtools.sourceediting-200610041528.tar.xz  webtools.sourceediting-200610041528.zip  nitind18 years
v200610031800webtools.sourceediting-200610031800.tar.gz  webtools.sourceediting-200610031800.tar.xz  webtools.sourceediting-200610031800.zip  nitind18 years
v200610020355webtools.sourceediting-200610020355.tar.gz  webtools.sourceediting-200610020355.tar.xz  webtools.sourceediting-200610020355.zip  nitind18 years
v200609292330webtools.sourceediting-200609292330.tar.gz  webtools.sourceediting-200609292330.tar.xz  webtools.sourceediting-200609292330.zip  nitind18 years
v200609282230webtools.sourceediting-200609282230.tar.gz  webtools.sourceediting-200609282230.tar.xz  webtools.sourceediting-200609282230.zip  nitind18 years
v200609221505webtools.sourceediting-200609221505.tar.gz  webtools.sourceediting-200609221505.tar.xz  webtools.sourceediting-200609221505.zip  nitind18 years
R1_5_1webtools.sourceediting-R1_5_1.tar.gz  webtools.sourceediting-R1_5_1.tar.xz  webtools.sourceediting-R1_5_1.zip  nitind18 years
v200609221652webtools.sourceediting-200609221652.tar.gz  webtools.sourceediting-200609221652.tar.xz  webtools.sourceediting-200609221652.zip  nitind18 years
v200609221649webtools.sourceediting-200609221649.tar.gz  webtools.sourceediting-200609221649.tar.xz  webtools.sourceediting-200609221649.zip  nitind18 years
v200609201330webtools.sourceediting-200609201330.tar.gz  webtools.sourceediting-200609201330.tar.xz  webtools.sourceediting-200609201330.zip  nitind18 years
v200609210615webtools.sourceediting-200609210615.tar.gz  webtools.sourceediting-200609210615.tar.xz  webtools.sourceediting-200609210615.zip  nitind18 years
v200609210600webtools.sourceediting-200609210600.tar.gz  webtools.sourceediting-200609210600.tar.xz  webtools.sourceediting-200609210600.zip  nitind18 years
v200609211325webtools.sourceediting-200609211325.tar.gz  webtools.sourceediting-200609211325.tar.xz  webtools.sourceediting-200609211325.zip  nitind18 years
v200609200602webtools.sourceediting-200609200602.tar.gz  webtools.sourceediting-200609200602.tar.xz  webtools.sourceediting-200609200602.zip  nitind18 years
v200609200515webtools.sourceediting-200609200515.tar.gz  webtools.sourceediting-200609200515.tar.xz  webtools.sourceediting-200609200515.zip  nitind18 years
v200609191835webtools.sourceediting-200609191835.tar.gz  webtools.sourceediting-200609191835.tar.xz  webtools.sourceediting-200609191835.zip  nitind18 years
v200609191834webtools.sourceediting-200609191834.tar.gz  webtools.sourceediting-200609191834.tar.xz  webtools.sourceediting-200609191834.zip  nitind18 years
v200609191630webtools.sourceediting-200609191630.tar.gz  webtools.sourceediting-200609191630.tar.xz  webtools.sourceediting-200609191630.zip  nitind18 years
v200609191840webtools.sourceediting-200609191840.tar.gz  webtools.sourceediting-200609191840.tar.xz  webtools.sourceediting-200609191840.zip  nitind18 years
v200609191755webtools.sourceediting-200609191755.tar.gz  webtools.sourceediting-200609191755.tar.xz  webtools.sourceediting-200609191755.zip  nitind18 years
v200609191547webtools.sourceediting-200609191547.tar.gz  webtools.sourceediting-200609191547.tar.xz  webtools.sourceediting-200609191547.zip  nitind18 years
v200609191535webtools.sourceediting-200609191535.tar.gz  webtools.sourceediting-200609191535.tar.xz  webtools.sourceediting-200609191535.zip  nitind18 years
v200609191527webtools.sourceediting-200609191527.tar.gz  webtools.sourceediting-200609191527.tar.xz  webtools.sourceediting-200609191527.zip  nitind18 years
v200609191525webtools.sourceediting-200609191525.tar.gz  webtools.sourceediting-200609191525.tar.xz  webtools.sourceediting-200609191525.zip  nitind18 years
v200609191520webtools.sourceediting-200609191520.tar.gz  webtools.sourceediting-200609191520.tar.xz  webtools.sourceediting-200609191520.zip  nitind18 years
v200609190500webtools.sourceediting-200609190500.tar.gz  webtools.sourceediting-200609190500.tar.xz  webtools.sourceediting-200609190500.zip  nitind18 years
v200609182317webtools.sourceediting-200609182317.tar.gz  webtools.sourceediting-200609182317.tar.xz  webtools.sourceediting-200609182317.zip  nitind18 years
v200609182120webtools.sourceediting-200609182120.tar.gz  webtools.sourceediting-200609182120.tar.xz  webtools.sourceediting-200609182120.zip  nitind18 years
v200609182042webtools.sourceediting-200609182042.tar.gz  webtools.sourceediting-200609182042.tar.xz  webtools.sourceediting-200609182042.zip  nitind18 years
v200609182039webtools.sourceediting-200609182039.tar.gz  webtools.sourceediting-200609182039.tar.xz  webtools.sourceediting-200609182039.zip  nitind18 years
v200609182036webtools.sourceediting-200609182036.tar.gz  webtools.sourceediting-200609182036.tar.xz  webtools.sourceediting-200609182036.zip  nitind18 years
v200609182034webtools.sourceediting-200609182034.tar.gz  webtools.sourceediting-200609182034.tar.xz  webtools.sourceediting-200609182034.zip  nitind18 years
Root_tempBug155790webtools.sourceediting-Root_tempBug155790.tar.gz  webtools.sourceediting-Root_tempBug155790.tar.xz  webtools.sourceediting-Root_tempBug155790.zip  nitind18 years
v200609142100webtools.sourceediting-200609142100.tar.gz  webtools.sourceediting-200609142100.tar.xz  webtools.sourceediting-200609142100.zip  nitind18 years
v200609141952webtools.sourceediting-200609141952.tar.gz  webtools.sourceediting-200609141952.tar.xz  webtools.sourceediting-200609141952.zip  nitind18 years
v200609141950webtools.sourceediting-200609141950.tar.gz  webtools.sourceediting-200609141950.tar.xz  webtools.sourceediting-200609141950.zip  nitind18 years
v200609140550webtools.sourceediting-200609140550.tar.gz  webtools.sourceediting-200609140550.tar.xz  webtools.sourceediting-200609140550.zip  nitind18 years
v200609140540webtools.sourceediting-200609140540.tar.gz  webtools.sourceediting-200609140540.tar.xz  webtools.sourceediting-200609140540.zip  nitind18 years
v20060907145webtools.sourceediting-20060907145.tar.gz  webtools.sourceediting-20060907145.tar.xz  webtools.sourceediting-20060907145.zip  nitind18 years
v200609120056webtools.sourceediting-200609120056.tar.gz  webtools.sourceediting-200609120056.tar.xz  webtools.sourceediting-200609120056.zip  nitind18 years
v200609120022webtools.sourceediting-200609120022.tar.gz  webtools.sourceediting-200609120022.tar.xz  webtools.sourceediting-200609120022.zip  nitind18 years
v200611161425webtools.sourceediting-200611161425.tar.gz  webtools.sourceediting-200611161425.tar.xz  webtools.sourceediting-200611161425.zip  nitind18 years
v200609111705webtools.sourceediting-200609111705.tar.gz  webtools.sourceediting-200609111705.tar.xz  webtools.sourceediting-200609111705.zip  nitind18 years
v200609111545webtools.sourceediting-200609111545.tar.gz  webtools.sourceediting-200609111545.tar.xz  webtools.sourceediting-200609111545.zip  nitind18 years
v200609110634webtools.sourceediting-200609110634.tar.gz  webtools.sourceediting-200609110634.tar.xz  webtools.sourceediting-200609110634.zip  nitind18 years
v200609110628webtools.sourceediting-200609110628.tar.gz  webtools.sourceediting-200609110628.tar.xz  webtools.sourceediting-200609110628.zip  nitind18 years
v200609100310webtools.sourceediting-200609100310.tar.gz  webtools.sourceediting-200609100310.tar.xz  webtools.sourceediting-200609100310.zip  nitind18 years
v200609071101webtools.sourceediting-200609071101.tar.gz  webtools.sourceediting-200609071101.tar.xz  webtools.sourceediting-200609071101.zip  nitind18 years
v200609071100webtools.sourceediting-200609071100.tar.gz  webtools.sourceediting-200609071100.tar.xz  webtools.sourceediting-200609071100.zip  nitind18 years
v200609070436webtools.sourceediting-200609070436.tar.gz  webtools.sourceediting-200609070436.tar.xz  webtools.sourceediting-200609070436.zip  nitind18 years
v200609070435webtools.sourceediting-200609070435.tar.gz  webtools.sourceediting-200609070435.tar.xz  webtools.sourceediting-200609070435.zip  nitind18 years
v200609070143webtools.sourceediting-200609070143.tar.gz  webtools.sourceediting-200609070143.tar.xz  webtools.sourceediting-200609070143.zip  nitind18 years
v200609061946webtools.sourceediting-200609061946.tar.gz  webtools.sourceediting-200609061946.tar.xz  webtools.sourceediting-200609061946.zip  nitind18 years
v200609061945webtools.sourceediting-200609061945.tar.gz  webtools.sourceediting-200609061945.tar.xz  webtools.sourceediting-200609061945.zip  nitind18 years
v200609060246webtools.sourceediting-200609060246.tar.gz  webtools.sourceediting-200609060246.tar.xz  webtools.sourceediting-200609060246.zip  nitind18 years
v200609060230webtools.sourceediting-200609060230.tar.gz  webtools.sourceediting-200609060230.tar.xz  webtools.sourceediting-200609060230.zip  nitind18 years
v200609061541webtools.sourceediting-200609061541.tar.gz  webtools.sourceediting-200609061541.tar.xz  webtools.sourceediting-200609061541.zip  nitind18 years
v200609061540webtools.sourceediting-200609061540.tar.gz  webtools.sourceediting-200609061540.tar.xz  webtools.sourceediting-200609061540.zip  nitind18 years
v200609060236webtools.sourceediting-200609060236.tar.gz  webtools.sourceediting-200609060236.tar.xz  webtools.sourceediting-200609060236.zip  nitind18 years
v200608310301webtools.sourceediting-200608310301.tar.gz  webtools.sourceediting-200608310301.tar.xz  webtools.sourceediting-200608310301.zip  nitind18 years
v200608310300webtools.sourceediting-200608310300.tar.gz  webtools.sourceediting-200608310300.tar.xz  webtools.sourceediting-200608310300.zip  nitind18 years
v200608310250webtools.sourceediting-200608310250.tar.gz  webtools.sourceediting-200608310250.tar.xz  webtools.sourceediting-200608310250.zip  nitind18 years
v200608300245webtools.sourceediting-200608300245.tar.gz  webtools.sourceediting-200608300245.tar.xz  webtools.sourceediting-200608300245.zip  nitind18 years
v200608300201webtools.sourceediting-200608300201.tar.gz  webtools.sourceediting-200608300201.tar.xz  webtools.sourceediting-200608300201.zip  nitind18 years
v200608310200webtools.sourceediting-200608310200.tar.gz  webtools.sourceediting-200608310200.tar.xz  webtools.sourceediting-200608310200.zip  nitind18 years
v200609140551webtools.sourceediting-200609140551.tar.gz  webtools.sourceediting-200609140551.tar.xz  webtools.sourceediting-200609140551.zip  nitind18 years
v200609060235webtools.sourceediting-200609060235.tar.gz  webtools.sourceediting-200609060235.tar.xz  webtools.sourceediting-200609060235.zip  nitind18 years
v200608302317webtools.sourceediting-200608302317.tar.gz  webtools.sourceediting-200608302317.tar.xz  webtools.sourceediting-200608302317.zip  nitind18 years
v200608302315webtools.sourceediting-200608302315.tar.gz  webtools.sourceediting-200608302315.tar.xz  webtools.sourceediting-200608302315.zip  nitind18 years
v200608300230webtools.sourceediting-200608300230.tar.gz  webtools.sourceediting-200608300230.tar.xz  webtools.sourceediting-200608300230.zip  nitind18 years
v200608302159webtools.sourceediting-200608302159.tar.gz  webtools.sourceediting-200608302159.tar.xz  webtools.sourceediting-200608302159.zip  nitind18 years
v200608302115webtools.sourceediting-200608302115.tar.gz  webtools.sourceediting-200608302115.tar.xz  webtools.sourceediting-200608302115.zip  nitind18 years
v200608302310webtools.sourceediting-200608302310.tar.gz  webtools.sourceediting-200608302310.tar.xz  webtools.sourceediting-200608302310.zip  nitind18 years
v200608301559webtools.sourceediting-200608301559.tar.gz  webtools.sourceediting-200608301559.tar.xz  webtools.sourceediting-200608301559.zip  nitind18 years
v200608301558webtools.sourceediting-200608301558.tar.gz  webtools.sourceediting-200608301558.tar.xz  webtools.sourceediting-200608301558.zip  nitind18 years
v200608301738webtools.sourceediting-200608301738.tar.gz  webtools.sourceediting-200608301738.tar.xz  webtools.sourceediting-200608301738.zip  nitind18 years
v200608300934webtools.sourceediting-200608300934.tar.gz  webtools.sourceediting-200608300934.tar.xz  webtools.sourceediting-200608300934.zip  nitind18 years
v200608311843webtools.sourceediting-200608311843.tar.gz  webtools.sourceediting-200608311843.tar.xz  webtools.sourceediting-200608311843.zip  nitind18 years
v200608292336webtools.sourceediting-200608292336.tar.gz  webtools.sourceediting-200608292336.tar.xz  webtools.sourceediting-200608292336.zip  nitind18 years
v200608300905webtools.sourceediting-200608300905.tar.gz  webtools.sourceediting-200608300905.tar.xz  webtools.sourceediting-200608300905.zip  nitind18 years
v200608302305webtools.sourceediting-200608302305.tar.gz  webtools.sourceediting-200608302305.tar.xz  webtools.sourceediting-200608302305.zip  nitind18 years
v2006082911824webtools.sourceediting-2006082911824.tar.gz  webtools.sourceediting-2006082911824.tar.xz  webtools.sourceediting-2006082911824.zip  nitind18 years
v2006082911823webtools.sourceediting-2006082911823.tar.gz  webtools.sourceediting-2006082911823.tar.xz  webtools.sourceediting-2006082911823.zip  nitind18 years
v200608291900webtools.sourceediting-200608291900.tar.gz  webtools.sourceediting-200608291900.tar.xz  webtools.sourceediting-200608291900.zip  nitind18 years
v2006082911713webtools.sourceediting-2006082911713.tar.gz  webtools.sourceediting-2006082911713.tar.xz  webtools.sourceediting-2006082911713.zip  nitind18 years
v2006082911711webtools.sourceediting-2006082911711.tar.gz  webtools.sourceediting-2006082911711.tar.xz  webtools.sourceediting-2006082911711.zip  nitind18 years
v200608290040webtools.sourceediting-200608290040.tar.gz  webtools.sourceediting-200608290040.tar.xz  webtools.sourceediting-200608290040.zip  nitind18 years
v200608290034webtools.sourceediting-200608290034.tar.gz  webtools.sourceediting-200608290034.tar.xz  webtools.sourceediting-200608290034.zip  nitind18 years
v200608282329webtools.sourceediting-200608282329.tar.gz  webtools.sourceediting-200608282329.tar.xz  webtools.sourceediting-200608282329.zip  nitind18 years
v200608282328webtools.sourceediting-200608282328.tar.gz  webtools.sourceediting-200608282328.tar.xz  webtools.sourceediting-200608282328.zip  nitind18 years
v200608232334webtools.sourceediting-200608232334.tar.gz  webtools.sourceediting-200608232334.tar.xz  webtools.sourceediting-200608232334.zip  nitind18 years
v200608232329webtools.sourceediting-200608232329.tar.gz  webtools.sourceediting-200608232329.tar.xz  webtools.sourceediting-200608232329.zip  nitind18 years
v200608232324webtools.sourceediting-200608232324.tar.gz  webtools.sourceediting-200608232324.tar.xz  webtools.sourceediting-200608232324.zip  nitind18 years
v200608232322webtools.sourceediting-200608232322.tar.gz  webtools.sourceediting-200608232322.tar.xz  webtools.sourceediting-200608232322.zip  nitind18 years
v200608232024webtools.sourceediting-200608232024.tar.gz  webtools.sourceediting-200608232024.tar.xz  webtools.sourceediting-200608232024.zip  nitind18 years
v200608221321webtools.sourceediting-200608221321.tar.gz  webtools.sourceediting-200608221321.tar.xz  webtools.sourceediting-200608221321.zip  nitind18 years
v200608231821webtools.sourceediting-200608231821.tar.gz  webtools.sourceediting-200608231821.tar.xz  webtools.sourceediting-200608231821.zip  nitind18 years
v200608231820webtools.sourceediting-200608231820.tar.gz  webtools.sourceediting-200608231820.tar.xz  webtools.sourceediting-200608231820.zip  nitind18 years
Root_R1_5_maintenancewebtools.sourceediting-Root_R1_5_maintenance.tar.gz  webtools.sourceediting-Root_R1_5_maintenance.tar.xz  webtools.sourceediting-Root_R1_5_maintenance.zip  nitind18 years
v200608231043webtools.sourceediting-200608231043.tar.gz  webtools.sourceediting-200608231043.tar.xz  webtools.sourceediting-200608231043.zip  nitind18 years
v200608231037webtools.sourceediting-200608231037.tar.gz  webtools.sourceediting-200608231037.tar.xz  webtools.sourceediting-200608231037.zip  nitind18 years
v200608221845webtools.sourceediting-200608221845.tar.gz  webtools.sourceediting-200608221845.tar.xz  webtools.sourceediting-200608221845.zip  nitind18 years
v200608220322webtools.sourceediting-200608220322.tar.gz  webtools.sourceediting-200608220322.tar.xz  webtools.sourceediting-200608220322.zip  nitind18 years
v200608221830webtools.sourceediting-200608221830.tar.gz  webtools.sourceediting-200608221830.tar.xz  webtools.sourceediting-200608221830.zip  nitind18 years
v200608221300webtools.sourceediting-200608221300.tar.gz  webtools.sourceediting-200608221300.tar.xz  webtools.sourceediting-200608221300.zip  nitind18 years
v200608212210webtools.sourceediting-200608212210.tar.gz  webtools.sourceediting-200608212210.tar.xz  webtools.sourceediting-200608212210.zip  nitind18 years
v200608211515webtools.sourceediting-200608211515.tar.gz  webtools.sourceediting-200608211515.tar.xz  webtools.sourceediting-200608211515.zip  nitind18 years
v200608202111webtools.sourceediting-200608202111.tar.gz  webtools.sourceediting-200608202111.tar.xz  webtools.sourceediting-200608202111.zip  nitind18 years
v200608202108webtools.sourceediting-200608202108.tar.gz  webtools.sourceediting-200608202108.tar.xz  webtools.sourceediting-200608202108.zip  nitind18 years
v200608230302webtools.sourceediting-200608230302.tar.gz  webtools.sourceediting-200608230302.tar.xz  webtools.sourceediting-200608230302.zip  nitind18 years
v200608230301webtools.sourceediting-200608230301.tar.gz  webtools.sourceediting-200608230301.tar.xz  webtools.sourceediting-200608230301.zip  nitind18 years
v200608221900webtools.sourceediting-200608221900.tar.gz  webtools.sourceediting-200608221900.tar.xz  webtools.sourceediting-200608221900.zip  nitind18 years
v200608162253webtools.sourceediting-200608162253.tar.gz  webtools.sourceediting-200608162253.tar.xz  webtools.sourceediting-200608162253.zip  nitind18 years
v200608162201webtools.sourceediting-200608162201.tar.gz  webtools.sourceediting-200608162201.tar.xz  webtools.sourceediting-200608162201.zip  nitind18 years
v200608161632webtools.sourceediting-200608161632.tar.gz  webtools.sourceediting-200608161632.tar.xz  webtools.sourceediting-200608161632.zip  nitind18 years
v200608161630webtools.sourceediting-200608161630.tar.gz  webtools.sourceediting-200608161630.tar.xz  webtools.sourceediting-200608161630.zip  nitind18 years
v200608160527webtools.sourceediting-200608160527.tar.gz  webtools.sourceediting-200608160527.tar.xz  webtools.sourceediting-200608160527.zip  nitind18 years
v200608160437webtools.sourceediting-200608160437.tar.gz  webtools.sourceediting-200608160437.tar.xz  webtools.sourceediting-200608160437.zip  nitind18 years
v200608152256webtools.sourceediting-200608152256.tar.gz  webtools.sourceediting-200608152256.tar.xz  webtools.sourceediting-200608152256.zip  nitind18 years
v200608152105webtools.sourceediting-200608152105.tar.gz  webtools.sourceediting-200608152105.tar.xz  webtools.sourceediting-200608152105.zip  nitind18 years
v200608152012webtools.sourceediting-200608152012.tar.gz  webtools.sourceediting-200608152012.tar.xz  webtools.sourceediting-200608152012.zip  nitind18 years
v200608151745webtools.sourceediting-200608151745.tar.gz  webtools.sourceediting-200608151745.tar.xz  webtools.sourceediting-200608151745.zip  nitind18 years
v200608141813webtools.sourceediting-200608141813.tar.gz  webtools.sourceediting-200608141813.tar.xz  webtools.sourceediting-200608141813.zip  nitind18 years
v200608141805webtools.sourceediting-200608141805.tar.gz  webtools.sourceediting-200608141805.tar.xz  webtools.sourceediting-200608141805.zip  nitind18 years
v200608142100webtools.sourceediting-200608142100.tar.gz  webtools.sourceediting-200608142100.tar.xz  webtools.sourceediting-200608142100.zip  nitind18 years
v200608142042webtools.sourceediting-200608142042.tar.gz  webtools.sourceediting-200608142042.tar.xz  webtools.sourceediting-200608142042.zip  nitind18 years
v200608141604webtools.sourceediting-200608141604.tar.gz  webtools.sourceediting-200608141604.tar.xz  webtools.sourceediting-200608141604.zip  nitind18 years
v200608141509webtools.sourceediting-200608141509.tar.gz  webtools.sourceediting-200608141509.tar.xz  webtools.sourceediting-200608141509.zip  nitind18 years
v200608141503webtools.sourceediting-200608141503.tar.gz  webtools.sourceediting-200608141503.tar.xz  webtools.sourceediting-200608141503.zip  nitind18 years
v200608140542webtools.sourceediting-200608140542.tar.gz  webtools.sourceediting-200608140542.tar.xz  webtools.sourceediting-200608140542.zip  nitind18 years
v200608140437webtools.sourceediting-200608140437.tar.gz  webtools.sourceediting-200608140437.tar.xz  webtools.sourceediting-200608140437.zip  nitind18 years
v200608140105webtools.sourceediting-200608140105.tar.gz  webtools.sourceediting-200608140105.tar.xz  webtools.sourceediting-200608140105.zip  nitind18 years
v200608140100webtools.sourceediting-200608140100.tar.gz  webtools.sourceediting-200608140100.tar.xz  webtools.sourceediting-200608140100.zip  nitind18 years
v200608132230webtools.sourceediting-200608132230.tar.gz  webtools.sourceediting-200608132230.tar.xz  webtools.sourceediting-200608132230.zip  nitind18 years
v200608111800webtools.sourceediting-200608111800.tar.gz  webtools.sourceediting-200608111800.tar.xz  webtools.sourceediting-200608111800.zip  nitind18 years
v200608112037webtools.sourceediting-200608112037.tar.gz  webtools.sourceediting-200608112037.tar.xz  webtools.sourceediting-200608112037.zip  nitind18 years
v200608112036webtools.sourceediting-200608112036.tar.gz  webtools.sourceediting-200608112036.tar.xz  webtools.sourceediting-200608112036.zip  nitind18 years
v200608112029webtools.sourceediting-200608112029.tar.gz  webtools.sourceediting-200608112029.tar.xz  webtools.sourceediting-200608112029.zip  nitind18 years
v200608112028webtools.sourceediting-200608112028.tar.gz  webtools.sourceediting-200608112028.tar.xz  webtools.sourceediting-200608112028.zip  nitind18 years
v200608091921webtools.sourceediting-200608091921.tar.gz  webtools.sourceediting-200608091921.tar.xz  webtools.sourceediting-200608091921.zip  nitind18 years
v200608091920webtools.sourceediting-200608091920.tar.gz  webtools.sourceediting-200608091920.tar.xz  webtools.sourceediting-200608091920.zip  nitind18 years
v200608082231webtools.sourceediting-200608082231.tar.gz  webtools.sourceediting-200608082231.tar.xz  webtools.sourceediting-200608082231.zip  nitind18 years
v200608082218webtools.sourceediting-200608082218.tar.gz  webtools.sourceediting-200608082218.tar.xz  webtools.sourceediting-200608082218.zip  nitind18 years
v200608082102webtools.sourceediting-200608082102.tar.gz  webtools.sourceediting-200608082102.tar.xz  webtools.sourceediting-200608082102.zip  nitind18 years
v200608082043webtools.sourceediting-200608082043.tar.gz  webtools.sourceediting-200608082043.tar.xz  webtools.sourceediting-200608082043.zip  nitind18 years
v200608082030webtools.sourceediting-200608082030.tar.gz  webtools.sourceediting-200608082030.tar.xz  webtools.sourceediting-200608082030.zip  nitind18 years
v200608071952webtools.sourceediting-200608071952.tar.gz  webtools.sourceediting-200608071952.tar.xz  webtools.sourceediting-200608071952.zip  nitind18 years
v200608071829webtools.sourceediting-200608071829.tar.gz  webtools.sourceediting-200608071829.tar.xz  webtools.sourceediting-200608071829.zip  nitind18 years
v200608080537webtools.sourceediting-200608080537.tar.gz  webtools.sourceediting-200608080537.tar.xz  webtools.sourceediting-200608080537.zip  nitind18 years
v200608050350webtools.sourceediting-200608050350.tar.gz  webtools.sourceediting-200608050350.tar.xz  webtools.sourceediting-200608050350.zip  nitind18 years
v200608032100webtools.sourceediting-200608032100.tar.gz  webtools.sourceediting-200608032100.tar.xz  webtools.sourceediting-200608032100.zip  nitind18 years
v200608022134webtools.sourceediting-200608022134.tar.gz  webtools.sourceediting-200608022134.tar.xz  webtools.sourceediting-200608022134.zip  nitind18 years
v200608022133webtools.sourceediting-200608022133.tar.gz  webtools.sourceediting-200608022133.tar.xz  webtools.sourceediting-200608022133.zip  nitind18 years
v200608022043webtools.sourceediting-200608022043.tar.gz  webtools.sourceediting-200608022043.tar.xz  webtools.sourceediting-200608022043.zip  nitind18 years
v200608022035webtools.sourceediting-200608022035.tar.gz  webtools.sourceediting-200608022035.tar.xz  webtools.sourceediting-200608022035.zip  nitind18 years
v200608020450webtools.sourceediting-200608020450.tar.gz  webtools.sourceediting-200608020450.tar.xz  webtools.sourceediting-200608020450.zip  nitind18 years
v200608011610webtools.sourceediting-200608011610.tar.gz  webtools.sourceediting-200608011610.tar.xz  webtools.sourceediting-200608011610.zip  nitind18 years
v200608011605webtools.sourceediting-200608011605.tar.gz  webtools.sourceediting-200608011605.tar.xz  webtools.sourceediting-200608011605.zip  nitind18 years
v200608071825webtools.sourceediting-200608071825.tar.gz  webtools.sourceediting-200608071825.tar.xz  webtools.sourceediting-200608071825.zip  nitind18 years
v200608011811webtools.sourceediting-200608011811.tar.gz  webtools.sourceediting-200608011811.tar.xz  webtools.sourceediting-200608011811.zip  nitind18 years
v200608011749webtools.sourceediting-200608011749.tar.gz  webtools.sourceediting-200608011749.tar.xz  webtools.sourceediting-200608011749.zip  nitind18 years
v200608011748webtools.sourceediting-200608011748.tar.gz  webtools.sourceediting-200608011748.tar.xz  webtools.sourceediting-200608011748.zip  nitind18 years
v200608011518webtools.sourceediting-200608011518.tar.gz  webtools.sourceediting-200608011518.tar.xz  webtools.sourceediting-200608011518.zip  nitind18 years
v200607311906webtools.sourceediting-200607311906.tar.gz  webtools.sourceediting-200607311906.tar.xz  webtools.sourceediting-200607311906.zip  nitind18 years
v200607310800webtools.sourceediting-200607310800.tar.gz  webtools.sourceediting-200607310800.tar.xz  webtools.sourceediting-200607310800.zip  nitind18 years
v200607262333webtools.sourceediting-200607262333.tar.gz  webtools.sourceediting-200607262333.tar.xz  webtools.sourceediting-200607262333.zip  nitind18 years
v200607261625webtools.sourceediting-200607261625.tar.gz  webtools.sourceediting-200607261625.tar.xz  webtools.sourceediting-200607261625.zip  nitind18 years
v200607252150webtools.sourceediting-200607252150.tar.gz  webtools.sourceediting-200607252150.tar.xz  webtools.sourceediting-200607252150.zip  nitind18 years
v200607290745webtools.sourceediting-200607290745.tar.gz  webtools.sourceediting-200607290745.tar.xz  webtools.sourceediting-200607290745.zip  nitind18 years
R1_0_3webtools.sourceediting-R1_0_3.tar.gz  webtools.sourceediting-R1_0_3.tar.xz  webtools.sourceediting-R1_0_3.zip  nitind18 years
v200607311518webtools.sourceediting-200607311518.tar.gz  webtools.sourceediting-200607311518.tar.xz  webtools.sourceediting-200607311518.zip  nitind18 years
v200607290505webtools.sourceediting-200607290505.tar.gz  webtools.sourceediting-200607290505.tar.xz  webtools.sourceediting-200607290505.zip  nitind18 years
v200607290305webtools.sourceediting-200607290305.tar.gz  webtools.sourceediting-200607290305.tar.xz  webtools.sourceediting-200607290305.zip  nitind18 years
v200607290300webtools.sourceediting-200607290300.tar.gz  webtools.sourceediting-200607290300.tar.xz  webtools.sourceediting-200607290300.zip  nitind18 years
v200607262348webtools.sourceediting-200607262348.tar.gz  webtools.sourceediting-200607262348.tar.xz  webtools.sourceediting-200607262348.zip  nitind18 years
v200607262104webtools.sourceediting-200607262104.tar.gz  webtools.sourceediting-200607262104.tar.xz  webtools.sourceediting-200607262104.zip  nitind18 years
v200607260437webtools.sourceediting-200607260437.tar.gz  webtools.sourceediting-200607260437.tar.xz  webtools.sourceediting-200607260437.zip  nitind18 years
v200607260430webtools.sourceediting-200607260430.tar.gz  webtools.sourceediting-200607260430.tar.xz  webtools.sourceediting-200607260430.zip  nitind18 years
v200607260550webtools.sourceediting-200607260550.tar.gz  webtools.sourceediting-200607260550.tar.xz  webtools.sourceediting-200607260550.zip  nitind18 years
v200607252155webtools.sourceediting-200607252155.tar.gz  webtools.sourceediting-200607252155.tar.xz  webtools.sourceediting-200607252155.zip  nitind18 years
v200607252057webtools.sourceediting-200607252057.tar.gz  webtools.sourceediting-200607252057.tar.xz  webtools.sourceediting-200607252057.zip  nitind18 years
v200607241719webtools.sourceediting-200607241719.tar.gz  webtools.sourceediting-200607241719.tar.xz  webtools.sourceediting-200607241719.zip  nitind18 years
v200607241622webtools.sourceediting-200607241622.tar.gz  webtools.sourceediting-200607241622.tar.xz  webtools.sourceediting-200607241622.zip  nitind18 years
v200607261500webtools.sourceediting-200607261500.tar.gz  webtools.sourceediting-200607261500.tar.xz  webtools.sourceediting-200607261500.zip  nitind18 years
v200607220700webtools.sourceediting-200607220700.tar.gz  webtools.sourceediting-200607220700.tar.xz  webtools.sourceediting-200607220700.zip  nitind18 years
v200607220430webtools.sourceediting-200607220430.tar.gz  webtools.sourceediting-200607220430.tar.xz  webtools.sourceediting-200607220430.zip  nitind18 years
v200607192017webtools.sourceediting-200607192017.tar.gz  webtools.sourceediting-200607192017.tar.xz  webtools.sourceediting-200607192017.zip  nitind18 years
v200607191717webtools.sourceediting-200607191717.tar.gz  webtools.sourceediting-200607191717.tar.xz  webtools.sourceediting-200607191717.zip  nitind18 years
v200607171645webtools.sourceediting-200607171645.tar.gz  webtools.sourceediting-200607171645.tar.xz  webtools.sourceediting-200607171645.zip  nitind18 years
v200607261848webtools.sourceediting-200607261848.tar.gz  webtools.sourceediting-200607261848.tar.xz  webtools.sourceediting-200607261848.zip  nitind18 years
v200607252200webtools.sourceediting-200607252200.tar.gz  webtools.sourceediting-200607252200.tar.xz  webtools.sourceediting-200607252200.zip  nitind18 years
v200607090811webtools.sourceediting-200607090811.tar.gz  webtools.sourceediting-200607090811.tar.xz  webtools.sourceediting-200607090811.zip  nitind18 years
v200607090815webtools.sourceediting-200607090815.tar.gz  webtools.sourceediting-200607090815.tar.xz  webtools.sourceediting-200607090815.zip  nitind18 years
v200606191900webtools.sourceediting-200606191900.tar.gz  webtools.sourceediting-200606191900.tar.xz  webtools.sourceediting-200606191900.zip  nitind18 years
R1_5_0webtools.sourceediting-R1_5_0.tar.gz  webtools.sourceediting-R1_5_0.tar.xz  webtools.sourceediting-R1_5_0.zip  nitind18 years
v200606191945webtools.sourceediting-200606191945.tar.gz  webtools.sourceediting-200606191945.tar.xz  webtools.sourceediting-200606191945.zip  nitind18 years
v200606150455webtools.sourceediting-200606150455.tar.gz  webtools.sourceediting-200606150455.tar.xz  webtools.sourceediting-200606150455.zip  nitind18 years
v200606142122webtools.sourceediting-200606142122.tar.gz  webtools.sourceediting-200606142122.tar.xz  webtools.sourceediting-200606142122.zip  nitind18 years
v200606142000webtools.sourceediting-200606142000.tar.gz  webtools.sourceediting-200606142000.tar.xz  webtools.sourceediting-200606142000.zip  nitind18 years
v200606141450webtools.sourceediting-200606141450.tar.gz  webtools.sourceediting-200606141450.tar.xz  webtools.sourceediting-200606141450.zip  nitind18 years
v200606141440webtools.sourceediting-200606141440.tar.gz  webtools.sourceediting-200606141440.tar.xz  webtools.sourceediting-200606141440.zip  nitind18 years
v200606131550webtools.sourceediting-200606131550.tar.gz  webtools.sourceediting-200606131550.tar.xz  webtools.sourceediting-200606131550.zip  nitind18 years
v200606130645webtools.sourceediting-200606130645.tar.gz  webtools.sourceediting-200606130645.tar.xz  webtools.sourceediting-200606130645.zip  nitind18 years
v2006061303150645webtools.sourceediting-2006061303150645.tar.gz  webtools.sourceediting-2006061303150645.tar.xz  webtools.sourceediting-2006061303150645.zip  nitind18 years
v200606130315webtools.sourceediting-200606130315.tar.gz  webtools.sourceediting-200606130315.tar.xz  webtools.sourceediting-200606130315.zip  nitind18 years
v200606123140webtools.sourceediting-200606123140.tar.gz  webtools.sourceediting-200606123140.tar.xz  webtools.sourceediting-200606123140.zip  nitind18 years
v200606122245webtools.sourceediting-200606122245.tar.gz  webtools.sourceediting-200606122245.tar.xz  webtools.sourceediting-200606122245.zip  nitind18 years
v200606121646webtools.sourceediting-200606121646.tar.gz  webtools.sourceediting-200606121646.tar.xz  webtools.sourceediting-200606121646.zip  nitind18 years
v200606122240webtools.sourceediting-200606122240.tar.gz  webtools.sourceediting-200606122240.tar.xz  webtools.sourceediting-200606122240.zip  nitind18 years
v200606081956webtools.sourceediting-200606081956.tar.gz  webtools.sourceediting-200606081956.tar.xz  webtools.sourceediting-200606081956.zip  nitind18 years
v200606082040webtools.sourceediting-200606082040.tar.gz  webtools.sourceediting-200606082040.tar.xz  webtools.sourceediting-200606082040.zip  nitind18 years
v200606071115webtools.sourceediting-200606071115.tar.gz  webtools.sourceediting-200606071115.tar.xz  webtools.sourceediting-200606071115.zip  nitind18 years
v200606072030webtools.sourceediting-200606072030.tar.gz  webtools.sourceediting-200606072030.tar.xz  webtools.sourceediting-200606072030.zip  nitind18 years
v200606072007webtools.sourceediting-200606072007.tar.gz  webtools.sourceediting-200606072007.tar.xz  webtools.sourceediting-200606072007.zip  nitind18 years
v200606071530webtools.sourceediting-200606071530.tar.gz  webtools.sourceediting-200606071530.tar.xz  webtools.sourceediting-200606071530.zip  nitind18 years
v200606070623webtools.sourceediting-200606070623.tar.gz  webtools.sourceediting-200606070623.tar.xz  webtools.sourceediting-200606070623.zip  nitind18 years
v200606070555webtools.sourceediting-200606070555.tar.gz  webtools.sourceediting-200606070555.tar.xz  webtools.sourceediting-200606070555.zip  nitind18 years
v200606070406webtools.sourceediting-200606070406.tar.gz  webtools.sourceediting-200606070406.tar.xz  webtools.sourceediting-200606070406.zip  nitind18 years
v200606062104webtools.sourceediting-200606062104.tar.gz  webtools.sourceediting-200606062104.tar.xz  webtools.sourceediting-200606062104.zip  nitind18 years
v200606060628webtools.sourceediting-200606060628.tar.gz  webtools.sourceediting-200606060628.tar.xz  webtools.sourceediting-200606060628.zip  nitind18 years
v200606060306webtools.sourceediting-200606060306.tar.gz  webtools.sourceediting-200606060306.tar.xz  webtools.sourceediting-200606060306.zip  nitind18 years
v200606050645webtools.sourceediting-200606050645.tar.gz  webtools.sourceediting-200606050645.tar.xz  webtools.sourceediting-200606050645.zip  nitind18 years
v200606012209webtools.sourceediting-200606012209.tar.gz  webtools.sourceediting-200606012209.tar.xz  webtools.sourceediting-200606012209.zip  nitind18 years
v200606012139webtools.sourceediting-200606012139.tar.gz  webtools.sourceediting-200606012139.tar.xz  webtools.sourceediting-200606012139.zip  nitind18 years
v200606021812webtools.sourceediting-200606021812.tar.gz  webtools.sourceediting-200606021812.tar.xz  webtools.sourceediting-200606021812.zip  nitind18 years
v200605302315webtools.sourceediting-200605302315.tar.gz  webtools.sourceediting-200605302315.tar.xz  webtools.sourceediting-200605302315.zip  nitind18 years
v200605301759webtools.sourceediting-200605301759.tar.gz  webtools.sourceediting-200605301759.tar.xz  webtools.sourceediting-200605301759.zip  nitind18 years
v200605300748webtools.sourceediting-200605300748.tar.gz  webtools.sourceediting-200605300748.tar.xz  webtools.sourceediting-200605300748.zip  nitind18 years
v200605300742webtools.sourceediting-200605300742.tar.gz  webtools.sourceediting-200605300742.tar.xz  webtools.sourceediting-200605300742.zip  nitind18 years
v200605300630webtools.sourceediting-200605300630.tar.gz  webtools.sourceediting-200605300630.tar.xz  webtools.sourceediting-200605300630.zip  nitind18 years
v200605291327webtools.sourceediting-200605291327.tar.gz  webtools.sourceediting-200605291327.tar.xz  webtools.sourceediting-200605291327.zip  nitind18 years
v200605301325webtools.sourceediting-200605301325.tar.gz  webtools.sourceediting-200605301325.tar.xz  webtools.sourceediting-200605301325.zip  nitind18 years
v200605280845webtools.sourceediting-200605280845.tar.gz  webtools.sourceediting-200605280845.tar.xz  webtools.sourceediting-200605280845.zip  nitind18 years
v200605280701webtools.sourceediting-200605280701.tar.gz  webtools.sourceediting-200605280701.tar.xz  webtools.sourceediting-200605280701.zip  nitind18 years
v200605280942webtools.sourceediting-200605280942.tar.gz  webtools.sourceediting-200605280942.tar.xz  webtools.sourceediting-200605280942.zip  nitind18 years
v200605280700webtools.sourceediting-200605280700.tar.gz  webtools.sourceediting-200605280700.tar.xz  webtools.sourceediting-200605280700.zip  nitind18 years
v200605280829webtools.sourceediting-200605280829.tar.gz  webtools.sourceediting-200605280829.tar.xz  webtools.sourceediting-200605280829.zip  nitind18 years
Root_SSE_Tempwebtools.sourceediting-Root_SSE_Temp.tar.gz  webtools.sourceediting-Root_SSE_Temp.tar.xz  webtools.sourceediting-Root_SSE_Temp.zip  nitind18 years
v200605270830webtools.sourceediting-200605270830.tar.gz  webtools.sourceediting-200605270830.tar.xz  webtools.sourceediting-200605270830.zip  nitind18 years
v200605262231webtools.sourceediting-200605262231.tar.gz  webtools.sourceediting-200605262231.tar.xz  webtools.sourceediting-200605262231.zip  nitind18 years
v200605262050webtools.sourceediting-200605262050.tar.gz  webtools.sourceediting-200605262050.tar.xz  webtools.sourceediting-200605262050.zip  nitind18 years
v200605261502webtools.sourceediting-200605261502.tar.gz  webtools.sourceediting-200605261502.tar.xz  webtools.sourceediting-200605261502.zip  nitind18 years
v200605241023webtools.sourceediting-200605241023.tar.gz  webtools.sourceediting-200605241023.tar.xz  webtools.sourceediting-200605241023.zip  nitind18 years
v200605241019webtools.sourceediting-200605241019.tar.gz  webtools.sourceediting-200605241019.tar.xz  webtools.sourceediting-200605241019.zip  nitind18 years
v200605240721webtools.sourceediting-200605240721.tar.gz  webtools.sourceediting-200605240721.tar.xz  webtools.sourceediting-200605240721.zip  nitind18 years
v200605221910webtools.sourceediting-200605221910.tar.gz  webtools.sourceediting-200605221910.tar.xz  webtools.sourceediting-200605221910.zip  nitind18 years
v200605221450webtools.sourceediting-200605221450.tar.gz  webtools.sourceediting-200605221450.tar.xz  webtools.sourceediting-200605221450.zip  nitind18 years
v200605221438webtools.sourceediting-200605221438.tar.gz  webtools.sourceediting-200605221438.tar.xz  webtools.sourceediting-200605221438.zip  nitind18 years
v200605182145webtools.sourceediting-200605182145.tar.gz  webtools.sourceediting-200605182145.tar.xz  webtools.sourceediting-200605182145.zip  nitind18 years
v200605182006webtools.sourceediting-200605182006.tar.gz  webtools.sourceediting-200605182006.tar.xz  webtools.sourceediting-200605182006.zip  nitind18 years
v200605181657webtools.sourceediting-200605181657.tar.gz  webtools.sourceediting-200605181657.tar.xz  webtools.sourceediting-200605181657.zip  nitind18 years
v200605181647webtools.sourceediting-200605181647.tar.gz  webtools.sourceediting-200605181647.tar.xz  webtools.sourceediting-200605181647.zip  nitind18 years
v200605180455webtools.sourceediting-200605180455.tar.gz  webtools.sourceediting-200605180455.tar.xz  webtools.sourceediting-200605180455.zip  nitind18 years
v200605180530webtools.sourceediting-200605180530.tar.gz  webtools.sourceediting-200605180530.tar.xz  webtools.sourceediting-200605180530.zip  nitind18 years
v200605172418webtools.sourceediting-200605172418.tar.gz  webtools.sourceediting-200605172418.tar.xz  webtools.sourceediting-200605172418.zip  nitind18 years
v200605172416webtools.sourceediting-200605172416.tar.gz  webtools.sourceediting-200605172416.tar.xz  webtools.sourceediting-200605172416.zip  nitind18 years
v200605172229webtools.sourceediting-200605172229.tar.gz  webtools.sourceediting-200605172229.tar.xz  webtools.sourceediting-200605172229.zip  nitind18 years
v200605171636webtools.sourceediting-200605171636.tar.gz  webtools.sourceediting-200605171636.tar.xz  webtools.sourceediting-200605171636.zip  nitind18 years
v200605162416webtools.sourceediting-200605162416.tar.gz  webtools.sourceediting-200605162416.tar.xz  webtools.sourceediting-200605162416.zip  nitind18 years
v200605162335webtools.sourceediting-200605162335.tar.gz  webtools.sourceediting-200605162335.tar.xz  webtools.sourceediting-200605162335.zip  nitind18 years
v200605162138webtools.sourceediting-200605162138.tar.gz  webtools.sourceediting-200605162138.tar.xz  webtools.sourceediting-200605162138.zip  nitind18 years
v200605161621webtools.sourceediting-200605161621.tar.gz  webtools.sourceediting-200605161621.tar.xz  webtools.sourceediting-200605161621.zip  nitind18 years
v200605152323webtools.sourceediting-200605152323.tar.gz  webtools.sourceediting-200605152323.tar.xz  webtools.sourceediting-200605152323.zip  nitind18 years
v200605152219webtools.sourceediting-200605152219.tar.gz  webtools.sourceediting-200605152219.tar.xz  webtools.sourceediting-200605152219.zip  nitind18 years
v200605152316webtools.sourceediting-200605152316.tar.gz  webtools.sourceediting-200605152316.tar.xz  webtools.sourceediting-200605152316.zip  nitind18 years
v200605151929webtools.sourceediting-200605151929.tar.gz  webtools.sourceediting-200605151929.tar.xz  webtools.sourceediting-200605151929.zip  nitind18 years
v200605151622webtools.sourceediting-200605151622.tar.gz  webtools.sourceediting-200605151622.tar.xz  webtools.sourceediting-200605151622.zip  nitind18 years
v200605140430webtools.sourceediting-200605140430.tar.gz  webtools.sourceediting-200605140430.tar.xz  webtools.sourceediting-200605140430.zip  nitind18 years
v200605131944webtools.sourceediting-200605131944.tar.gz  webtools.sourceediting-200605131944.tar.xz  webtools.sourceediting-200605131944.zip  nitind18 years
v200605120714webtools.sourceediting-200605120714.tar.gz  webtools.sourceediting-200605120714.tar.xz  webtools.sourceediting-200605120714.zip  nitind18 years
v200605120709webtools.sourceediting-200605120709.tar.gz  webtools.sourceediting-200605120709.tar.xz  webtools.sourceediting-200605120709.zip  nitind18 years
v200605111628webtools.sourceediting-200605111628.tar.gz  webtools.sourceediting-200605111628.tar.xz  webtools.sourceediting-200605111628.zip  nitind18 years
v200605110640webtools.sourceediting-200605110640.tar.gz  webtools.sourceediting-200605110640.tar.xz  webtools.sourceediting-200605110640.zip  nitind18 years
v200605102030webtools.sourceediting-200605102030.tar.gz  webtools.sourceediting-200605102030.tar.xz  webtools.sourceediting-200605102030.zip  nitind18 years
v200605101850webtools.sourceediting-200605101850.tar.gz  webtools.sourceediting-200605101850.tar.xz  webtools.sourceediting-200605101850.zip  nitind18 years
v200605101830webtools.sourceediting-200605101830.tar.gz  webtools.sourceediting-200605101830.tar.xz  webtools.sourceediting-200605101830.zip  nitind18 years
v200605101715webtools.sourceediting-200605101715.tar.gz  webtools.sourceediting-200605101715.tar.xz  webtools.sourceediting-200605101715.zip  nitind18 years
v200605101630webtools.sourceediting-200605101630.tar.gz  webtools.sourceediting-200605101630.tar.xz  webtools.sourceediting-200605101630.zip  nitind18 years
v200605101726webtools.sourceediting-200605101726.tar.gz  webtools.sourceediting-200605101726.tar.xz  webtools.sourceediting-200605101726.zip  nitind18 years
v200605101832webtools.sourceediting-200605101832.tar.gz  webtools.sourceediting-200605101832.tar.xz  webtools.sourceediting-200605101832.zip  nitind18 years
v200605100909webtools.sourceediting-200605100909.tar.gz  webtools.sourceediting-200605100909.tar.xz  webtools.sourceediting-200605100909.zip  nitind18 years
v200605100843_sse_tempwebtools.sourceediting-200605100843_sse_temp.tar.gz  webtools.sourceediting-200605100843_sse_temp.tar.xz  webtools.sourceediting-200605100843_sse_temp.zip  nitind18 years
v200605100843webtools.sourceediting-200605100843.tar.gz  webtools.sourceediting-200605100843.tar.xz  webtools.sourceediting-200605100843.zip  nitind18 years
v200605100738webtools.sourceediting-200605100738.tar.gz  webtools.sourceediting-200605100738.tar.xz  webtools.sourceediting-200605100738.zip  nitind18 years
v200605100405webtools.sourceediting-200605100405.tar.gz  webtools.sourceediting-200605100405.tar.xz  webtools.sourceediting-200605100405.zip  nitind18 years
v2006050100030webtools.sourceediting-2006050100030.tar.gz  webtools.sourceediting-2006050100030.tar.xz  webtools.sourceediting-2006050100030.zip  nitind18 years
v200605091618webtools.sourceediting-200605091618.tar.gz  webtools.sourceediting-200605091618.tar.xz  webtools.sourceediting-200605091618.zip  nitind18 years
v200605090642webtools.sourceediting-200605090642.tar.gz  webtools.sourceediting-200605090642.tar.xz  webtools.sourceediting-200605090642.zip  nitind18 years
v200605090620webtools.sourceediting-200605090620.tar.gz  webtools.sourceediting-200605090620.tar.xz  webtools.sourceediting-200605090620.zip  nitind18 years
v200605181650webtools.sourceediting-200605181650.tar.gz  webtools.sourceediting-200605181650.tar.xz  webtools.sourceediting-200605181650.zip  nitind18 years
v200605070230webtools.sourceediting-200605070230.tar.gz  webtools.sourceediting-200605070230.tar.xz  webtools.sourceediting-200605070230.zip  nitind18 years
v200605070721webtools.sourceediting-200605070721.tar.gz  webtools.sourceediting-200605070721.tar.xz  webtools.sourceediting-200605070721.zip  nitind18 years
v200605061437webtools.sourceediting-200605061437.tar.gz  webtools.sourceediting-200605061437.tar.xz  webtools.sourceediting-200605061437.zip  nitind18 years
v200605041940webtools.sourceediting-200605041940.tar.gz  webtools.sourceediting-200605041940.tar.xz  webtools.sourceediting-200605041940.zip  nitind18 years
v200605100619webtools.sourceediting-200605100619.tar.gz  webtools.sourceediting-200605100619.tar.xz  webtools.sourceediting-200605100619.zip  nitind18 years
v200605040603webtools.sourceediting-200605040603.tar.gz  webtools.sourceediting-200605040603.tar.xz  webtools.sourceediting-200605040603.zip  nitind18 years
v200605040552webtools.sourceediting-200605040552.tar.gz  webtools.sourceediting-200605040552.tar.xz  webtools.sourceediting-200605040552.zip  nitind18 years
v200605040144webtools.sourceediting-200605040144.tar.gz  webtools.sourceediting-200605040144.tar.xz  webtools.sourceediting-200605040144.zip  nitind18 years
v200605040131webtools.sourceediting-200605040131.tar.gz  webtools.sourceediting-200605040131.tar.xz  webtools.sourceediting-200605040131.zip  nitind18 years
v200605040115webtools.sourceediting-200605040115.tar.gz  webtools.sourceediting-200605040115.tar.xz  webtools.sourceediting-200605040115.zip  nitind18 years
v200605040108webtools.sourceediting-200605040108.tar.gz  webtools.sourceediting-200605040108.tar.xz  webtools.sourceediting-200605040108.zip  nitind18 years
v200605031953webtools.sourceediting-200605031953.tar.gz  webtools.sourceediting-200605031953.tar.xz  webtools.sourceediting-200605031953.zip  nitind18 years
v200605030800webtools.sourceediting-200605030800.tar.gz  webtools.sourceediting-200605030800.tar.xz  webtools.sourceediting-200605030800.zip  nitind18 years
v200605022355webtools.sourceediting-200605022355.tar.gz  webtools.sourceediting-200605022355.tar.xz  webtools.sourceediting-200605022355.zip  nitind18 years
v200605022326webtools.sourceediting-200605022326.tar.gz  webtools.sourceediting-200605022326.tar.xz  webtools.sourceediting-200605022326.zip  nitind18 years
v200605022200webtools.sourceediting-200605022200.tar.gz  webtools.sourceediting-200605022200.tar.xz  webtools.sourceediting-200605022200.zip  nitind18 years
v200605020740webtools.sourceediting-200605020740.tar.gz  webtools.sourceediting-200605020740.tar.xz  webtools.sourceediting-200605020740.zip  nitind18 years
v200605020530webtools.sourceediting-200605020530.tar.gz  webtools.sourceediting-200605020530.tar.xz  webtools.sourceediting-200605020530.zip  nitind18 years
v200605012227webtools.sourceediting-200605012227.tar.gz  webtools.sourceediting-200605012227.tar.xz  webtools.sourceediting-200605012227.zip  nitind18 years
v200605012020webtools.sourceediting-200605012020.tar.gz  webtools.sourceediting-200605012020.tar.xz  webtools.sourceediting-200605012020.zip  nitind18 years
v200605011804webtools.sourceediting-200605011804.tar.gz  webtools.sourceediting-200605011804.tar.xz  webtools.sourceediting-200605011804.zip  nitind18 years
v200605020545webtools.sourceediting-200605020545.tar.gz  webtools.sourceediting-200605020545.tar.xz  webtools.sourceediting-200605020545.zip  nitind18 years
v200604282352webtools.sourceediting-200604282352.tar.gz  webtools.sourceediting-200604282352.tar.xz  webtools.sourceediting-200604282352.zip  nitind18 years
v200604282349webtools.sourceediting-200604282349.tar.gz  webtools.sourceediting-200604282349.tar.xz  webtools.sourceediting-200604282349.zip  nitind18 years
v200604262354webtools.sourceediting-200604262354.tar.gz  webtools.sourceediting-200604262354.tar.xz  webtools.sourceediting-200604262354.zip  nitind18 years
v200604262341webtools.sourceediting-200604262341.tar.gz  webtools.sourceediting-200604262341.tar.xz  webtools.sourceediting-200604262341.zip  nitind18 years
v200604251835webtools.sourceediting-200604251835.tar.gz  webtools.sourceediting-200604251835.tar.xz  webtools.sourceediting-200604251835.zip  nitind18 years
v200604242014webtools.sourceediting-200604242014.tar.gz  webtools.sourceediting-200604242014.tar.xz  webtools.sourceediting-200604242014.zip  nitind18 years
v200604230525webtools.sourceediting-200604230525.tar.gz  webtools.sourceediting-200604230525.tar.xz  webtools.sourceediting-200604230525.zip  nitind18 years
v200604221909webtools.sourceediting-200604221909.tar.gz  webtools.sourceediting-200604221909.tar.xz  webtools.sourceediting-200604221909.zip  nitind18 years
v200604202050webtools.sourceediting-200604202050.tar.gz  webtools.sourceediting-200604202050.tar.xz  webtools.sourceediting-200604202050.zip  nitind18 years
v200604201945webtools.sourceediting-200604201945.tar.gz  webtools.sourceediting-200604201945.tar.xz  webtools.sourceediting-200604201945.zip  nitind18 years
v200604190014webtools.sourceediting-200604190014.tar.gz  webtools.sourceediting-200604190014.tar.xz  webtools.sourceediting-200604190014.zip  nitind18 years
v200604191632webtools.sourceediting-200604191632.tar.gz  webtools.sourceediting-200604191632.tar.xz  webtools.sourceediting-200604191632.zip  nitind18 years
v200604191521webtools.sourceediting-200604191521.tar.gz  webtools.sourceediting-200604191521.tar.xz  webtools.sourceediting-200604191521.zip  nitind18 years
v200604191746webtools.sourceediting-200604191746.tar.gz  webtools.sourceediting-200604191746.tar.xz  webtools.sourceediting-200604191746.zip  nitind18 years
v200604191015webtools.sourceediting-200604191015.tar.gz  webtools.sourceediting-200604191015.tar.xz  webtools.sourceediting-200604191015.zip  nitind18 years
v200604182349webtools.sourceediting-200604182349.tar.gz  webtools.sourceediting-200604182349.tar.xz  webtools.sourceediting-200604182349.zip  nitind18 years
v200604181942webtools.sourceediting-200604181942.tar.gz  webtools.sourceediting-200604181942.tar.xz  webtools.sourceediting-200604181942.zip  nitind18 years
v200604181842webtools.sourceediting-200604181842.tar.gz  webtools.sourceediting-200604181842.tar.xz  webtools.sourceediting-200604181842.zip  nitind18 years
v200604181102webtools.sourceediting-200604181102.tar.gz  webtools.sourceediting-200604181102.tar.xz  webtools.sourceediting-200604181102.zip  nitind18 years
v200604181416webtools.sourceediting-200604181416.tar.gz  webtools.sourceediting-200604181416.tar.xz  webtools.sourceediting-200604181416.zip  nitind18 years
v200604180614webtools.sourceediting-200604180614.tar.gz  webtools.sourceediting-200604180614.tar.xz  webtools.sourceediting-200604180614.zip  nitind18 years
v200604171617webtools.sourceediting-200604171617.tar.gz  webtools.sourceediting-200604171617.tar.xz  webtools.sourceediting-200604171617.zip  nitind18 years
v200604171829webtools.sourceediting-200604171829.tar.gz  webtools.sourceediting-200604171829.tar.xz  webtools.sourceediting-200604171829.zip  nitind18 years
v200604171817webtools.sourceediting-200604171817.tar.gz  webtools.sourceediting-200604171817.tar.xz  webtools.sourceediting-200604171817.zip  nitind18 years
v200604170700webtools.sourceediting-200604170700.tar.gz  webtools.sourceediting-200604170700.tar.xz  webtools.sourceediting-200604170700.zip  nitind18 years
v200604170430webtools.sourceediting-200604170430.tar.gz  webtools.sourceediting-200604170430.tar.xz  webtools.sourceediting-200604170430.zip  nitind18 years
v200604280000webtools.sourceediting-200604280000.tar.gz  webtools.sourceediting-200604280000.tar.xz  webtools.sourceediting-200604280000.zip  nitind18 years
v200604160100webtools.sourceediting-200604160100.tar.gz  webtools.sourceediting-200604160100.tar.xz  webtools.sourceediting-200604160100.zip  nitind18 years
R1_0_2webtools.sourceediting-R1_0_2.tar.gz  webtools.sourceediting-R1_0_2.tar.xz  webtools.sourceediting-R1_0_2.zip  nitind18 years
v200604140115webtools.sourceediting-200604140115.tar.gz  webtools.sourceediting-200604140115.tar.xz  webtools.sourceediting-200604140115.zip  nitind18 years
v200604131104webtools.sourceediting-200604131104.tar.gz  webtools.sourceediting-200604131104.tar.xz  webtools.sourceediting-200604131104.zip  nitind18 years
v200604131333webtools.sourceediting-200604131333.tar.gz  webtools.sourceediting-200604131333.tar.xz  webtools.sourceediting-200604131333.zip  nitind18 years
v200604130316webtools.sourceediting-200604130316.tar.gz  webtools.sourceediting-200604130316.tar.xz  webtools.sourceediting-200604130316.zip  nitind18 years
v200604130531webtools.sourceediting-200604130531.tar.gz  webtools.sourceediting-200604130531.tar.xz  webtools.sourceediting-200604130531.zip  nitind18 years
v200604130521webtools.sourceediting-200604130521.tar.gz  webtools.sourceediting-200604130521.tar.xz  webtools.sourceediting-200604130521.zip  nitind18 years
v200604130525webtools.sourceediting-200604130525.tar.gz  webtools.sourceediting-200604130525.tar.xz  webtools.sourceediting-200604130525.zip  nitind18 years
v200604122107webtools.sourceediting-200604122107.tar.gz  webtools.sourceediting-200604122107.tar.xz  webtools.sourceediting-200604122107.zip  nitind18 years
v200604121537webtools.sourceediting-200604121537.tar.gz  webtools.sourceediting-200604121537.tar.xz  webtools.sourceediting-200604121537.zip  nitind18 years
v200604111717webtools.sourceediting-200604111717.tar.gz  webtools.sourceediting-200604111717.tar.xz  webtools.sourceediting-200604111717.zip  nitind18 years
v200604112330webtools.sourceediting-200604112330.tar.gz  webtools.sourceediting-200604112330.tar.xz  webtools.sourceediting-200604112330.zip  nitind18 years
v200604112005webtools.sourceediting-200604112005.tar.gz  webtools.sourceediting-200604112005.tar.xz  webtools.sourceediting-200604112005.zip  nitind18 years
v200604111350webtools.sourceediting-200604111350.tar.gz  webtools.sourceediting-200604111350.tar.xz  webtools.sourceediting-200604111350.zip  nitind18 years
v200604111241webtools.sourceediting-200604111241.tar.gz  webtools.sourceediting-200604111241.tar.xz  webtools.sourceediting-200604111241.zip  nitind18 years
v200604111641webtools.sourceediting-200604111641.tar.gz  webtools.sourceediting-200604111641.tar.xz  webtools.sourceediting-200604111641.zip  nitind18 years
v200604101803webtools.sourceediting-200604101803.tar.gz  webtools.sourceediting-200604101803.tar.xz  webtools.sourceediting-200604101803.zip  nitind18 years
v200604101507webtools.sourceediting-200604101507.tar.gz  webtools.sourceediting-200604101507.tar.xz  webtools.sourceediting-200604101507.zip  nitind18 years
v200604080524webtools.sourceediting-200604080524.tar.gz  webtools.sourceediting-200604080524.tar.xz  webtools.sourceediting-200604080524.zip  nitind18 years
v200604111302webtools.sourceediting-200604111302.tar.gz  webtools.sourceediting-200604111302.tar.xz  webtools.sourceediting-200604111302.zip  nitind18 years
v200604060600webtools.sourceediting-200604060600.tar.gz  webtools.sourceediting-200604060600.tar.xz  webtools.sourceediting-200604060600.zip  nitind18 years
v200604052200webtools.sourceediting-200604052200.tar.gz  webtools.sourceediting-200604052200.tar.xz  webtools.sourceediting-200604052200.zip  nitind18 years
v200604051419webtools.sourceediting-200604051419.tar.gz  webtools.sourceediting-200604051419.tar.xz  webtools.sourceediting-200604051419.zip  nitind18 years
v200604051225webtools.sourceediting-200604051225.tar.gz  webtools.sourceediting-200604051225.tar.xz  webtools.sourceediting-200604051225.zip  nitind18 years
v200604050855webtools.sourceediting-200604050855.tar.gz  webtools.sourceediting-200604050855.tar.xz  webtools.sourceediting-200604050855.zip  nitind18 years
v200604050423webtools.sourceediting-200604050423.tar.gz  webtools.sourceediting-200604050423.tar.xz  webtools.sourceediting-200604050423.zip  nitind18 years
v200604050351webtools.sourceediting-200604050351.tar.gz  webtools.sourceediting-200604050351.tar.xz  webtools.sourceediting-200604050351.zip  nitind18 years
v200604050350webtools.sourceediting-200604050350.tar.gz  webtools.sourceediting-200604050350.tar.xz  webtools.sourceediting-200604050350.zip  nitind18 years
v200604040845webtools.sourceediting-200604040845.tar.gz  webtools.sourceediting-200604040845.tar.xz  webtools.sourceediting-200604040845.zip  nitind18 years
v200604040750webtools.sourceediting-200604040750.tar.gz  webtools.sourceediting-200604040750.tar.xz  webtools.sourceediting-200604040750.zip  nitind18 years
v200604040720webtools.sourceediting-200604040720.tar.gz  webtools.sourceediting-200604040720.tar.xz  webtools.sourceediting-200604040720.zip  nitind18 years
v200604040625webtools.sourceediting-200604040625.tar.gz  webtools.sourceediting-200604040625.tar.xz  webtools.sourceediting-200604040625.zip  nitind18 years
v200604040555webtools.sourceediting-200604040555.tar.gz  webtools.sourceediting-200604040555.tar.xz  webtools.sourceediting-200604040555.zip  nitind18 years
v200604031911webtools.sourceediting-200604031911.tar.gz  webtools.sourceediting-200604031911.tar.xz  webtools.sourceediting-200604031911.zip  nitind18 years
v200604022030webtools.sourceediting-200604022030.tar.gz  webtools.sourceediting-200604022030.tar.xz  webtools.sourceediting-200604022030.zip  nitind18 years
v200603300331webtools.sourceediting-200603300331.tar.gz  webtools.sourceediting-200603300331.tar.xz  webtools.sourceediting-200603300331.zip  nitind18 years
v200603300330webtools.sourceediting-200603300330.tar.gz  webtools.sourceediting-200603300330.tar.xz  webtools.sourceediting-200603300330.zip  nitind18 years
v200603291537webtools.sourceediting-200603291537.tar.gz  webtools.sourceediting-200603291537.tar.xz  webtools.sourceediting-200603291537.zip  nitind18 years
v200603291942webtools.sourceediting-200603291942.tar.gz  webtools.sourceediting-200603291942.tar.xz  webtools.sourceediting-200603291942.zip  nitind18 years
v200603291830webtools.sourceediting-200603291830.tar.gz  webtools.sourceediting-200603291830.tar.xz  webtools.sourceediting-200603291830.zip  nitind18 years
v200603291117webtools.sourceediting-200603291117.tar.gz  webtools.sourceediting-200603291117.tar.xz  webtools.sourceediting-200603291117.zip  nitind18 years
v200603282306webtools.sourceediting-200603282306.tar.gz  webtools.sourceediting-200603282306.tar.xz  webtools.sourceediting-200603282306.zip  nitind18 years
v200603282202postmergewebtools.sourceediting-200603282202postmerge.tar.gz  webtools.sourceediting-200603282202postmerge.tar.xz  webtools.sourceediting-200603282202postmerge.zip  nitind18 years
v200603282200premergewebtools.sourceediting-200603282200premerge.tar.gz  webtools.sourceediting-200603282200premerge.tar.xz  webtools.sourceediting-200603282200premerge.zip  nitind18 years
v200603280540webtools.sourceediting-200603280540.tar.gz  webtools.sourceediting-200603280540.tar.xz  webtools.sourceediting-200603280540.zip  nitind18 years
v200603271839webtools.sourceediting-200603271839.tar.gz  webtools.sourceediting-200603271839.tar.xz  webtools.sourceediting-200603271839.zip  nitind18 years
v200603282201premergeHeadwebtools.sourceediting-200603282201premergeHead.tar.gz  webtools.sourceediting-200603282201premergeHead.tar.xz  webtools.sourceediting-200603282201premergeHead.zip  nitind18 years
v200603270200webtools.sourceediting-200603270200.tar.gz  webtools.sourceediting-200603270200.tar.xz  webtools.sourceediting-200603270200.zip  nitind18 years
v200603231444webtools.sourceediting-200603231444.tar.gz  webtools.sourceediting-200603231444.tar.xz  webtools.sourceediting-200603231444.zip  nitind19 years
v200603270807webtools.sourceediting-200603270807.tar.gz  webtools.sourceediting-200603270807.tar.xz  webtools.sourceediting-200603270807.zip  nitind19 years
v200603221150webtools.sourceediting-200603221150.tar.gz  webtools.sourceediting-200603221150.tar.xz  webtools.sourceediting-200603221150.zip  nitind19 years
v200603160820webtools.sourceediting-200603160820.tar.gz  webtools.sourceediting-200603160820.tar.xz  webtools.sourceediting-200603160820.zip  nitind19 years
v200603160600webtools.sourceediting-200603160600.tar.gz  webtools.sourceediting-200603160600.tar.xz  webtools.sourceediting-200603160600.zip  nitind19 years
v200603150657webtools.sourceediting-200603150657.tar.gz  webtools.sourceediting-200603150657.tar.xz  webtools.sourceediting-200603150657.zip  nitind19 years
v200603142327webtools.sourceediting-200603142327.tar.gz  webtools.sourceediting-200603142327.tar.xz  webtools.sourceediting-200603142327.zip  nitind19 years
v200603141932webtools.sourceediting-200603141932.tar.gz  webtools.sourceediting-200603141932.tar.xz  webtools.sourceediting-200603141932.zip  nitind19 years
v200603141929webtools.sourceediting-200603141929.tar.gz  webtools.sourceediting-200603141929.tar.xz  webtools.sourceediting-200603141929.zip  nitind19 years
v200603141907webtools.sourceediting-200603141907.tar.gz  webtools.sourceediting-200603141907.tar.xz  webtools.sourceediting-200603141907.zip  nitind19 years
v200603140704webtools.sourceediting-200603140704.tar.gz  webtools.sourceediting-200603140704.tar.xz  webtools.sourceediting-200603140704.zip  nitind19 years
v200603191053webtools.sourceediting-200603191053.tar.gz  webtools.sourceediting-200603191053.tar.xz  webtools.sourceediting-200603191053.zip  nitind19 years
v200603130800webtools.sourceediting-200603130800.tar.gz  webtools.sourceediting-200603130800.tar.xz  webtools.sourceediting-200603130800.zip  nitind19 years
v200603101432webtools.sourceediting-200603101432.tar.gz  webtools.sourceediting-200603101432.tar.xz  webtools.sourceediting-200603101432.zip  nitind19 years
v200603081111webtools.sourceediting-200603081111.tar.gz  webtools.sourceediting-200603081111.tar.xz  webtools.sourceediting-200603081111.zip  nitind19 years
v20060308_0654webtools.sourceediting-20060308_0654.tar.gz  webtools.sourceediting-20060308_0654.tar.xz  webtools.sourceediting-20060308_0654.zip  nitind19 years
v1_5_branchwebtools.sourceediting-1_5_branch.tar.gz  webtools.sourceediting-1_5_branch.tar.xz  webtools.sourceediting-1_5_branch.zip  nitind19 years
v200603071921webtools.sourceediting-200603071921.tar.gz  webtools.sourceediting-200603071921.tar.xz  webtools.sourceediting-200603071921.zip  nitind19 years
v200603071519webtools.sourceediting-200603071519.tar.gz  webtools.sourceediting-200603071519.tar.xz  webtools.sourceediting-200603071519.zip  nitind19 years
v200603061631webtools.sourceediting-200603061631.tar.gz  webtools.sourceediting-200603061631.tar.xz  webtools.sourceediting-200603061631.zip  nitind19 years
v200603042000webtools.sourceediting-200603042000.tar.gz  webtools.sourceediting-200603042000.tar.xz  webtools.sourceediting-200603042000.zip  nitind19 years
v200603040700webtools.sourceediting-200603040700.tar.gz  webtools.sourceediting-200603040700.tar.xz  webtools.sourceediting-200603040700.zip  nitind19 years
v200603040530webtools.sourceediting-200603040530.tar.gz  webtools.sourceediting-200603040530.tar.xz  webtools.sourceediting-200603040530.zip  nitind19 years
v200603022200webtools.sourceediting-200603022200.tar.gz  webtools.sourceediting-200603022200.tar.xz  webtools.sourceediting-200603022200.zip  nitind19 years
v200603020600webtools.sourceediting-200603020600.tar.gz  webtools.sourceediting-200603020600.tar.xz  webtools.sourceediting-200603020600.zip  nitind19 years
v200603020540webtools.sourceediting-200603020540.tar.gz  webtools.sourceediting-200603020540.tar.xz  webtools.sourceediting-200603020540.zip  nitind19 years
v200603012030webtools.sourceediting-200603012030.tar.gz  webtools.sourceediting-200603012030.tar.xz  webtools.sourceediting-200603012030.zip  nitind19 years
v200603011340webtools.sourceediting-200603011340.tar.gz  webtools.sourceediting-200603011340.tar.xz  webtools.sourceediting-200603011340.zip  nitind19 years
v200603011330webtools.sourceediting-200603011330.tar.gz  webtools.sourceediting-200603011330.tar.xz  webtools.sourceediting-200603011330.zip  nitind19 years
v200602290145webtools.sourceediting-200602290145.tar.gz  webtools.sourceediting-200602290145.tar.xz  webtools.sourceediting-200602290145.zip  nitind19 years
v200602282047webtools.sourceediting-200602282047.tar.gz  webtools.sourceediting-200602282047.tar.xz  webtools.sourceediting-200602282047.zip  nitind19 years
v200602282046webtools.sourceediting-200602282046.tar.gz  webtools.sourceediting-200602282046.tar.xz  webtools.sourceediting-200602282046.zip  nitind19 years
v200602280450webtools.sourceediting-200602280450.tar.gz  webtools.sourceediting-200602280450.tar.xz  webtools.sourceediting-200602280450.zip  nitind19 years
v200602272137webtools.sourceediting-200602272137.tar.gz  webtools.sourceediting-200602272137.tar.xz  webtools.sourceediting-200602272137.zip  nitind19 years
v200602270930webtools.sourceediting-200602270930.tar.gz  webtools.sourceediting-200602270930.tar.xz  webtools.sourceediting-200602270930.zip  nitind19 years
v200602231611webtools.sourceediting-200602231611.tar.gz  webtools.sourceediting-200602231611.tar.xz  webtools.sourceediting-200602231611.zip  nitind19 years
v200602230908webtools.sourceediting-200602230908.tar.gz  webtools.sourceediting-200602230908.tar.xz  webtools.sourceediting-200602230908.zip  nitind19 years
v200602230803webtools.sourceediting-200602230803.tar.gz  webtools.sourceediting-200602230803.tar.xz  webtools.sourceediting-200602230803.zip  nitind19 years
v20060223_0715webtools.sourceediting-20060223_0715.tar.gz  webtools.sourceediting-20060223_0715.tar.xz  webtools.sourceediting-20060223_0715.zip  nitind19 years
v200602230511webtools.sourceediting-200602230511.tar.gz  webtools.sourceediting-200602230511.tar.xz  webtools.sourceediting-200602230511.zip  nitind19 years
v200602201922webtools.sourceediting-200602201922.tar.gz  webtools.sourceediting-200602201922.tar.xz  webtools.sourceediting-200602201922.zip  nitind19 years
v200602202018webtools.sourceediting-200602202018.tar.gz  webtools.sourceediting-200602202018.tar.xz  webtools.sourceediting-200602202018.zip  nitind19 years
v200602201608webtools.sourceediting-200602201608.tar.gz  webtools.sourceediting-200602201608.tar.xz  webtools.sourceediting-200602201608.zip  nitind19 years
v200602261840webtools.sourceediting-200602261840.tar.gz  webtools.sourceediting-200602261840.tar.xz  webtools.sourceediting-200602261840.zip  nitind19 years
v200602171941webtools.sourceediting-200602171941.tar.gz  webtools.sourceediting-200602171941.tar.xz  webtools.sourceediting-200602171941.zip  nitind19 years
v200602170527webtools.sourceediting-200602170527.tar.gz  webtools.sourceediting-200602170527.tar.xz  webtools.sourceediting-200602170527.zip  nitind19 years
v2006021502002350webtools.sourceediting-2006021502002350.tar.gz  webtools.sourceediting-2006021502002350.tar.xz  webtools.sourceediting-2006021502002350.zip  nitind19 years
R1_0_1webtools.sourceediting-R1_0_1.tar.gz  webtools.sourceediting-R1_0_1.tar.xz  webtools.sourceediting-R1_0_1.zip  nitind19 years
v200602152203webtools.sourceediting-200602152203.tar.gz  webtools.sourceediting-200602152203.tar.xz  webtools.sourceediting-200602152203.zip  nitind19 years
v20060215_1026webtools.sourceediting-20060215_1026.tar.gz  webtools.sourceediting-20060215_1026.tar.xz  webtools.sourceediting-20060215_1026.zip  nitind19 years
v200602151556webtools.sourceediting-200602151556.tar.gz  webtools.sourceediting-200602151556.tar.xz  webtools.sourceediting-200602151556.zip  nitind19 years
v20060215_1025webtools.sourceediting-20060215_1025.tar.gz  webtools.sourceediting-20060215_1025.tar.xz  webtools.sourceediting-20060215_1025.zip  nitind19 years
v20060215_1022webtools.sourceediting-20060215_1022.tar.gz  webtools.sourceediting-20060215_1022.tar.xz  webtools.sourceediting-20060215_1022.zip  nitind19 years
v200602151554webtools.sourceediting-200602151554.tar.gz  webtools.sourceediting-200602151554.tar.xz  webtools.sourceediting-200602151554.zip  nitind19 years
v200602151515webtools.sourceediting-200602151515.tar.gz  webtools.sourceediting-200602151515.tar.xz  webtools.sourceediting-200602151515.zip  nitind19 years
v200602150230webtools.sourceediting-200602150230.tar.gz  webtools.sourceediting-200602150230.tar.xz  webtools.sourceediting-200602150230.zip  nitind19 years
v200602150215webtools.sourceediting-200602150215.tar.gz  webtools.sourceediting-200602150215.tar.xz  webtools.sourceediting-200602150215.zip  nitind19 years
v200602151552webtools.sourceediting-200602151552.tar.gz  webtools.sourceediting-200602151552.tar.xz  webtools.sourceediting-200602151552.zip  nitind19 years
v200602150130webtools.sourceediting-200602150130.tar.gz  webtools.sourceediting-200602150130.tar.xz  webtools.sourceediting-200602150130.zip  nitind19 years
v20060214_1615webtools.sourceediting-20060214_1615.tar.gz  webtools.sourceediting-20060214_1615.tar.xz  webtools.sourceediting-20060214_1615.zip  nitind19 years
v20060214_1544webtools.sourceediting-20060214_1544.tar.gz  webtools.sourceediting-20060214_1544.tar.xz  webtools.sourceediting-20060214_1544.zip  nitind19 years
v200602131830webtools.sourceediting-200602131830.tar.gz  webtools.sourceediting-200602131830.tar.xz  webtools.sourceediting-200602131830.zip  nitind19 years
v200602131325webtools.sourceediting-200602131325.tar.gz  webtools.sourceediting-200602131325.tar.xz  webtools.sourceediting-200602131325.zip  nitind19 years
v200602130705webtools.sourceediting-200602130705.tar.gz  webtools.sourceediting-200602130705.tar.xz  webtools.sourceediting-200602130705.zip  nitind19 years
v200602130700webtools.sourceediting-200602130700.tar.gz  webtools.sourceediting-200602130700.tar.xz  webtools.sourceediting-200602130700.zip  nitind19 years
v200602130215webtools.sourceediting-200602130215.tar.gz  webtools.sourceediting-200602130215.tar.xz  webtools.sourceediting-200602130215.zip  nitind19 years
v200602130145webtools.sourceediting-200602130145.tar.gz  webtools.sourceediting-200602130145.tar.xz  webtools.sourceediting-200602130145.zip  nitind19 years
v200602120800webtools.sourceediting-200602120800.tar.gz  webtools.sourceediting-200602120800.tar.xz  webtools.sourceediting-200602120800.zip  nitind19 years
v20060210_0939webtools.sourceediting-20060210_0939.tar.gz  webtools.sourceediting-20060210_0939.tar.xz  webtools.sourceediting-20060210_0939.zip  nitind19 years
v20060209_1711webtools.sourceediting-20060209_1711.tar.gz  webtools.sourceediting-20060209_1711.tar.xz  webtools.sourceediting-20060209_1711.zip  nitind19 years
v20060209_1426webtools.sourceediting-20060209_1426.tar.gz  webtools.sourceediting-20060209_1426.tar.xz  webtools.sourceediting-20060209_1426.zip  nitind19 years
v20060209_0600webtools.sourceediting-20060209_0600.tar.gz  webtools.sourceediting-20060209_0600.tar.xz  webtools.sourceediting-20060209_0600.zip  nitind19 years
v200602081600webtools.sourceediting-200602081600.tar.gz  webtools.sourceediting-200602081600.tar.xz  webtools.sourceediting-200602081600.zip  nitind19 years
v200602060100webtools.sourceediting-200602060100.tar.gz  webtools.sourceediting-200602060100.tar.xz  webtools.sourceediting-200602060100.zip  nitind19 years
v200602052115webtools.sourceediting-200602052115.tar.gz  webtools.sourceediting-200602052115.tar.xz  webtools.sourceediting-200602052115.zip  nitind19 years
v200602050740webtools.sourceediting-200602050740.tar.gz  webtools.sourceediting-200602050740.tar.xz  webtools.sourceediting-200602050740.zip  nitind19 years
v200602050640webtools.sourceediting-200602050640.tar.gz  webtools.sourceediting-200602050640.tar.xz  webtools.sourceediting-200602050640.zip  nitind19 years
v200602050611webtools.sourceediting-200602050611.tar.gz  webtools.sourceediting-200602050611.tar.xz  webtools.sourceediting-200602050611.zip  nitind19 years
v200602050610webtools.sourceediting-200602050610.tar.gz  webtools.sourceediting-200602050610.tar.xz  webtools.sourceediting-200602050610.zip  nitind19 years
v200602050425webtools.sourceediting-200602050425.tar.gz  webtools.sourceediting-200602050425.tar.xz  webtools.sourceediting-200602050425.zip  nitind19 years
v200602042210webtools.sourceediting-200602042210.tar.gz  webtools.sourceediting-200602042210.tar.xz  webtools.sourceediting-200602042210.zip  nitind19 years
v20060203_1657webtools.sourceediting-20060203_1657.tar.gz  webtools.sourceediting-20060203_1657.tar.xz  webtools.sourceediting-20060203_1657.zip  nitind19 years
v20060203_1633webtools.sourceediting-20060203_1633.tar.gz  webtools.sourceediting-20060203_1633.tar.xz  webtools.sourceediting-20060203_1633.zip  nitind19 years
v200602062130webtools.sourceediting-200602062130.tar.gz  webtools.sourceediting-200602062130.tar.xz  webtools.sourceediting-200602062130.zip  nitind19 years
v200602041933webtools.sourceediting-200602041933.tar.gz  webtools.sourceediting-200602041933.tar.xz  webtools.sourceediting-200602041933.zip  nitind19 years
v20060202_2021webtools.sourceediting-20060202_2021.tar.gz  webtools.sourceediting-20060202_2021.tar.xz  webtools.sourceediting-20060202_2021.zip  nitind19 years
v20060202_0815webtools.sourceediting-20060202_0815.tar.gz  webtools.sourceediting-20060202_0815.tar.xz  webtools.sourceediting-20060202_0815.zip  nitind19 years
v20060202_0245webtools.sourceediting-20060202_0245.tar.gz  webtools.sourceediting-20060202_0245.tar.xz  webtools.sourceediting-20060202_0245.zip  nitind19 years
v200602020245webtools.sourceediting-200602020245.tar.gz  webtools.sourceediting-200602020245.tar.xz  webtools.sourceediting-200602020245.zip  nitind19 years
v20060131_0805webtools.sourceediting-20060131_0805.tar.gz  webtools.sourceediting-20060131_0805.tar.xz  webtools.sourceediting-20060131_0805.zip  nitind19 years
v200602062135webtools.sourceediting-200602062135.tar.gz  webtools.sourceediting-200602062135.tar.xz  webtools.sourceediting-200602062135.zip  nitind19 years
v20060131_0640webtools.sourceediting-20060131_0640.tar.gz  webtools.sourceediting-20060131_0640.tar.xz  webtools.sourceediting-20060131_0640.zip  nitind19 years
v20060131_0635webtools.sourceediting-20060131_0635.tar.gz  webtools.sourceediting-20060131_0635.tar.xz  webtools.sourceediting-20060131_0635.zip  nitind19 years
v20060201_0630webtools.sourceediting-20060201_0630.tar.gz  webtools.sourceediting-20060201_0630.tar.xz  webtools.sourceediting-20060201_0630.zip  nitind19 years
v20060201_0622webtools.sourceediting-20060201_0622.tar.gz  webtools.sourceediting-20060201_0622.tar.xz  webtools.sourceediting-20060201_0622.zip  nitind19 years
v200602140549webtools.sourceediting-200602140549.tar.gz  webtools.sourceediting-200602140549.tar.xz  webtools.sourceediting-200602140549.zip  nitind19 years
v200602140544webtools.sourceediting-200602140544.tar.gz  webtools.sourceediting-200602140544.tar.xz  webtools.sourceediting-200602140544.zip  nitind19 years
v20060131_0530webtools.sourceediting-20060131_0530.tar.gz  webtools.sourceediting-20060131_0530.tar.xz  webtools.sourceediting-20060131_0530.zip  nitind19 years
v20060131_0520webtools.sourceediting-20060131_0520.tar.gz  webtools.sourceediting-20060131_0520.tar.xz  webtools.sourceediting-20060131_0520.zip  nitind19 years
v20060131_0000webtools.sourceediting-20060131_0000.tar.gz  webtools.sourceediting-20060131_0000.tar.xz  webtools.sourceediting-20060131_0000.zip  nitind19 years
v20060130_2307webtools.sourceediting-20060130_2307.tar.gz  webtools.sourceediting-20060130_2307.tar.xz  webtools.sourceediting-20060130_2307.zip  nitind19 years
v20060130_2034webtools.sourceediting-20060130_2034.tar.gz  webtools.sourceediting-20060130_2034.tar.xz  webtools.sourceediting-20060130_2034.zip  nitind19 years
v200602060215webtools.sourceediting-200602060215.tar.gz  webtools.sourceediting-200602060215.tar.xz  webtools.sourceediting-200602060215.zip  nitind19 years
v20060130_1915webtools.sourceediting-20060130_1915.tar.gz  webtools.sourceediting-20060130_1915.tar.xz  webtools.sourceediting-20060130_1915.zip  nitind19 years
v20060130_0741webtools.sourceediting-20060130_0741.tar.gz  webtools.sourceediting-20060130_0741.tar.xz  webtools.sourceediting-20060130_0741.zip  nitind19 years
v200602061610webtools.sourceediting-200602061610.tar.gz  webtools.sourceediting-200602061610.tar.xz  webtools.sourceediting-200602061610.zip  nitind19 years
v20060130_1800webtools.sourceediting-20060130_1800.tar.gz  webtools.sourceediting-20060130_1800.tar.xz  webtools.sourceediting-20060130_1800.zip  nitind19 years
v20060128_0245webtools.sourceediting-20060128_0245.tar.gz  webtools.sourceediting-20060128_0245.tar.xz  webtools.sourceediting-20060128_0245.zip  nitind19 years
v200602140539webtools.sourceediting-200602140539.tar.gz  webtools.sourceediting-200602140539.tar.xz  webtools.sourceediting-200602140539.zip  nitind19 years
v200602140535webtools.sourceediting-200602140535.tar.gz  webtools.sourceediting-200602140535.tar.xz  webtools.sourceediting-200602140535.zip  nitind19 years
v20060128_0226webtools.sourceediting-20060128_0226.tar.gz  webtools.sourceediting-20060128_0226.tar.xz  webtools.sourceediting-20060128_0226.zip  nitind19 years
v20060128_0223webtools.sourceediting-20060128_0223.tar.gz  webtools.sourceediting-20060128_0223.tar.xz  webtools.sourceediting-20060128_0223.zip  nitind19 years
v200602130315webtools.sourceediting-200602130315.tar.gz  webtools.sourceediting-200602130315.tar.xz  webtools.sourceediting-200602130315.zip  nitind19 years
v200602130310webtools.sourceediting-200602130310.tar.gz  webtools.sourceediting-200602130310.tar.xz  webtools.sourceediting-200602130310.zip  nitind19 years
v20060128_0215webtools.sourceediting-20060128_0215.tar.gz  webtools.sourceediting-20060128_0215.tar.xz  webtools.sourceediting-20060128_0215.zip  nitind19 years
v20060128_0211webtools.sourceediting-20060128_0211.tar.gz  webtools.sourceediting-20060128_0211.tar.xz  webtools.sourceediting-20060128_0211.zip  nitind19 years
v20060128_0203webtools.sourceediting-20060128_0203.tar.gz  webtools.sourceediting-20060128_0203.tar.xz  webtools.sourceediting-20060128_0203.zip  nitind19 years
v20060131_0815webtools.sourceediting-20060131_0815.tar.gz  webtools.sourceediting-20060131_0815.tar.xz  webtools.sourceediting-20060131_0815.zip  nitind19 years
v20060128_0545webtools.sourceediting-20060128_0545.tar.gz  webtools.sourceediting-20060128_0545.tar.xz  webtools.sourceediting-20060128_0545.zip  nitind19 years
v20060128_0540webtools.sourceediting-20060128_0540.tar.gz  webtools.sourceediting-20060128_0540.tar.xz  webtools.sourceediting-20060128_0540.zip  nitind19 years
v20060127_1700webtools.sourceediting-20060127_1700.tar.gz  webtools.sourceediting-20060127_1700.tar.xz  webtools.sourceediting-20060127_1700.zip  nitind19 years
v20060127_1445webtools.sourceediting-20060127_1445.tar.gz  webtools.sourceediting-20060127_1445.tar.xz  webtools.sourceediting-20060127_1445.zip  nitind19 years
v20060127_1443webtools.sourceediting-20060127_1443.tar.gz  webtools.sourceediting-20060127_1443.tar.xz  webtools.sourceediting-20060127_1443.zip  nitind19 years
v20060126_1840webtools.sourceediting-20060126_1840.tar.gz  webtools.sourceediting-20060126_1840.tar.xz  webtools.sourceediting-20060126_1840.zip  nitind19 years
v20060126_0047webtools.sourceediting-20060126_0047.tar.gz  webtools.sourceediting-20060126_0047.tar.xz  webtools.sourceediting-20060126_0047.zip  nitind19 years
v20060126_0045webtools.sourceediting-20060126_0045.tar.gz  webtools.sourceediting-20060126_0045.tar.xz  webtools.sourceediting-20060126_0045.zip  nitind19 years
v20060124_2310webtools.sourceediting-20060124_2310.tar.gz  webtools.sourceediting-20060124_2310.tar.xz  webtools.sourceediting-20060124_2310.zip  nitind19 years
v20060123_1800webtools.sourceediting-20060123_1800.tar.gz  webtools.sourceediting-20060123_1800.tar.xz  webtools.sourceediting-20060123_1800.zip  nitind19 years
v20060123_1755webtools.sourceediting-20060123_1755.tar.gz  webtools.sourceediting-20060123_1755.tar.xz  webtools.sourceediting-20060123_1755.zip  nitind19 years
v20060123_1350webtools.sourceediting-20060123_1350.tar.gz  webtools.sourceediting-20060123_1350.tar.xz  webtools.sourceediting-20060123_1350.zip  nitind19 years
v20060123_1205webtools.sourceediting-20060123_1205.tar.gz  webtools.sourceediting-20060123_1205.tar.xz  webtools.sourceediting-20060123_1205.zip  nitind19 years
v20060123_0355webtools.sourceediting-20060123_0355.tar.gz  webtools.sourceediting-20060123_0355.tar.xz  webtools.sourceediting-20060123_0355.zip  nitind19 years
Root_R1_0_maintenancewebtools.sourceediting-Root_R1_0_maintenance.tar.gz  webtools.sourceediting-Root_R1_0_maintenance.tar.xz  webtools.sourceediting-Root_R1_0_maintenance.zip  nitind19 years
v20060123_0320webtools.sourceediting-20060123_0320.tar.gz  webtools.sourceediting-20060123_0320.tar.xz  webtools.sourceediting-20060123_0320.zip  nitind19 years
v20060123_0315webtools.sourceediting-20060123_0315.tar.gz  webtools.sourceediting-20060123_0315.tar.xz  webtools.sourceediting-20060123_0315.zip  nitind19 years
v20060123_0245webtools.sourceediting-20060123_0245.tar.gz  webtools.sourceediting-20060123_0245.tar.xz  webtools.sourceediting-20060123_0245.zip  nitind19 years
v20060123_0230webtools.sourceediting-20060123_0230.tar.gz  webtools.sourceediting-20060123_0230.tar.xz  webtools.sourceediting-20060123_0230.zip  nitind19 years
v20060123_0129webtools.sourceediting-20060123_0129.tar.gz  webtools.sourceediting-20060123_0129.tar.xz  webtools.sourceediting-20060123_0129.zip  nitind19 years
v20060123_0125webtools.sourceediting-20060123_0125.tar.gz  webtools.sourceediting-20060123_0125.tar.xz  webtools.sourceediting-20060123_0125.zip  nitind19 years
v20060123_0055webtools.sourceediting-20060123_0055.tar.gz  webtools.sourceediting-20060123_0055.tar.xz  webtools.sourceediting-20060123_0055.zip  nitind19 years
v20050119_1845webtools.sourceediting-20050119_1845.tar.gz  webtools.sourceediting-20050119_1845.tar.xz  webtools.sourceediting-20050119_1845.zip  nitind19 years
v20050119_1840webtools.sourceediting-20050119_1840.tar.gz  webtools.sourceediting-20050119_1840.tar.xz  webtools.sourceediting-20050119_1840.zip  nitind19 years
v20060119_1822webtools.sourceediting-20060119_1822.tar.gz  webtools.sourceediting-20060119_1822.tar.xz  webtools.sourceediting-20060119_1822.zip  nitind19 years
v20060119_1820webtools.sourceediting-20060119_1820.tar.gz  webtools.sourceediting-20060119_1820.tar.xz  webtools.sourceediting-20060119_1820.zip  nitind19 years
v20060123_1230webtools.sourceediting-20060123_1230.tar.gz  webtools.sourceediting-20060123_1230.tar.xz  webtools.sourceediting-20060123_1230.zip  nitind19 years
v20060116_1811webtools.sourceediting-20060116_1811.tar.gz  webtools.sourceediting-20060116_1811.tar.xz  webtools.sourceediting-20060116_1811.zip  nitind19 years
v20060116_1528webtools.sourceediting-20060116_1528.tar.gz  webtools.sourceediting-20060116_1528.tar.xz  webtools.sourceediting-20060116_1528.zip  nitind19 years
v20050116_1415webtools.sourceediting-20050116_1415.tar.gz  webtools.sourceediting-20050116_1415.tar.xz  webtools.sourceediting-20050116_1415.zip  nitind19 years
v20060116_0130webtools.sourceediting-20060116_0130.tar.gz  webtools.sourceediting-20060116_0130.tar.xz  webtools.sourceediting-20060116_0130.zip  nitind19 years
v20060116_0112webtools.sourceediting-20060116_0112.tar.gz  webtools.sourceediting-20060116_0112.tar.xz  webtools.sourceediting-20060116_0112.zip  nitind19 years
v20060115_2230webtools.sourceediting-20060115_2230.tar.gz  webtools.sourceediting-20060115_2230.tar.xz  webtools.sourceediting-20060115_2230.zip  nitind19 years
v20060112_1430webtools.sourceediting-20060112_1430.tar.gz  webtools.sourceediting-20060112_1430.tar.xz  webtools.sourceediting-20060112_1430.zip  nitind19 years
v20060112_1345webtools.sourceediting-20060112_1345.tar.gz  webtools.sourceediting-20060112_1345.tar.xz  webtools.sourceediting-20060112_1345.zip  nitind19 years
v20060112_0400webtools.sourceediting-20060112_0400.tar.gz  webtools.sourceediting-20060112_0400.tar.xz  webtools.sourceediting-20060112_0400.zip  nitind19 years
v20060116_2005webtools.sourceediting-20060116_2005.tar.gz  webtools.sourceediting-20060116_2005.tar.xz  webtools.sourceediting-20060116_2005.zip  nitind19 years
v20060112_0325webtools.sourceediting-20060112_0325.tar.gz  webtools.sourceediting-20060112_0325.tar.xz  webtools.sourceediting-20060112_0325.zip  nitind19 years
v20050111_1922webtools.sourceediting-20050111_1922.tar.gz  webtools.sourceediting-20050111_1922.tar.xz  webtools.sourceediting-20050111_1922.zip  nitind19 years
v20060112_0300webtools.sourceediting-20060112_0300.tar.gz  webtools.sourceediting-20060112_0300.tar.xz  webtools.sourceediting-20060112_0300.zip  nitind19 years
v20050111_1500webtools.sourceediting-v20050111_1500.tar.gz  webtools.sourceediting-v20050111_1500.tar.xz  webtools.sourceediting-v20050111_1500.zip  nitind19 years
V20050111_1500webtools.sourceediting-V20050111_1500.tar.gz  webtools.sourceediting-V20050111_1500.tar.xz  webtools.sourceediting-V20050111_1500.zip  nitind19 years
v20060111_1532webtools.sourceediting-20060111_1532.tar.gz  webtools.sourceediting-20060111_1532.tar.xz  webtools.sourceediting-20060111_1532.zip  nitind19 years
v20060111_0015webtools.sourceediting-20060111_0015.tar.gz  webtools.sourceediting-20060111_0015.tar.xz  webtools.sourceediting-20060111_0015.zip  nitind19 years
R1_0_0webtools.sourceediting-R1_0_0.tar.gz  webtools.sourceediting-R1_0_0.tar.xz  webtools.sourceediting-R1_0_0.zip  nitind19 years
v20060111_0010webtools.sourceediting-20060111_0010.tar.gz  webtools.sourceediting-20060111_0010.tar.xz  webtools.sourceediting-20060111_0010.zip  nitind19 years
v20051215_1950webtools.sourceediting-20051215_1950.tar.gz  webtools.sourceediting-20051215_1950.tar.xz  webtools.sourceediting-20051215_1950.zip  nitind19 years
v20051210_0100webtools.sourceediting-20051210_0100.tar.gz  webtools.sourceediting-20051210_0100.tar.xz  webtools.sourceediting-20051210_0100.zip  nitind19 years
v20051209_1800webtools.sourceediting-20051209_1800.tar.gz  webtools.sourceediting-20051209_1800.tar.xz  webtools.sourceediting-20051209_1800.zip  nitind19 years
v20051207_1755webtools.sourceediting-20051207_1755.tar.gz  webtools.sourceediting-20051207_1755.tar.xz  webtools.sourceediting-20051207_1755.zip  nitind19 years
v20051207_1750webtools.sourceediting-20051207_1750.tar.gz  webtools.sourceediting-20051207_1750.tar.xz  webtools.sourceediting-20051207_1750.zip  nitind19 years
v20051208_1025webtools.sourceediting-20051208_1025.tar.gz  webtools.sourceediting-20051208_1025.tar.xz  webtools.sourceediting-20051208_1025.zip  nitind19 years
v20051207_2145webtools.sourceediting-20051207_2145.tar.gz  webtools.sourceediting-20051207_2145.tar.xz  webtools.sourceediting-20051207_2145.zip  nitind19 years
v20051207_1430webtools.sourceediting-20051207_1430.tar.gz  webtools.sourceediting-20051207_1430.tar.xz  webtools.sourceediting-20051207_1430.zip  nitind19 years
v20051207_1418webtools.sourceediting-20051207_1418.tar.gz  webtools.sourceediting-20051207_1418.tar.xz  webtools.sourceediting-20051207_1418.zip  nitind19 years
v20051207_1050webtools.sourceediting-20051207_1050.tar.gz  webtools.sourceediting-20051207_1050.tar.xz  webtools.sourceediting-20051207_1050.zip  nitind19 years
v20051207_1045webtools.sourceediting-20051207_1045.tar.gz  webtools.sourceediting-20051207_1045.tar.xz  webtools.sourceediting-20051207_1045.zip  nitind19 years
v20051207_1025webtools.sourceediting-20051207_1025.tar.gz  webtools.sourceediting-20051207_1025.tar.xz  webtools.sourceediting-20051207_1025.zip  nitind19 years
v20051207_0315webtools.sourceediting-20051207_0315.tar.gz  webtools.sourceediting-20051207_0315.tar.xz  webtools.sourceediting-20051207_0315.zip  nitind19 years
v20051207_0250webtools.sourceediting-20051207_0250.tar.gz  webtools.sourceediting-20051207_0250.tar.xz  webtools.sourceediting-20051207_0250.zip  nitind19 years
v20051207_0040webtools.sourceediting-20051207_0040.tar.gz  webtools.sourceediting-20051207_0040.tar.xz  webtools.sourceediting-20051207_0040.zip  nitind19 years
v20051207_0041webtools.sourceediting-20051207_0041.tar.gz  webtools.sourceediting-20051207_0041.tar.xz  webtools.sourceediting-20051207_0041.zip  nitind19 years
v20051207_0042webtools.sourceediting-20051207_0042.tar.gz  webtools.sourceediting-20051207_0042.tar.xz  webtools.sourceediting-20051207_0042.zip  nitind19 years
v20051206_1727webtools.sourceediting-20051206_1727.tar.gz  webtools.sourceediting-20051206_1727.tar.xz  webtools.sourceediting-20051206_1727.zip  nitind19 years
v20051206_1721webtools.sourceediting-20051206_1721.tar.gz  webtools.sourceediting-20051206_1721.tar.xz  webtools.sourceediting-20051206_1721.zip  nitind19 years
v20051206_1556webtools.sourceediting-20051206_1556.tar.gz  webtools.sourceediting-20051206_1556.tar.xz  webtools.sourceediting-20051206_1556.zip  nitind19 years
v20051206_0345webtools.sourceediting-20051206_0345.tar.gz  webtools.sourceediting-20051206_0345.tar.xz  webtools.sourceediting-20051206_0345.zip  nitind19 years
v20051206_0245webtools.sourceediting-20051206_0245.tar.gz  webtools.sourceediting-20051206_0245.tar.xz  webtools.sourceediting-20051206_0245.zip  nitind19 years
v20051205_1604webtools.sourceediting-20051205_1604.tar.gz  webtools.sourceediting-20051205_1604.tar.xz  webtools.sourceediting-20051205_1604.zip  nitind19 years
v20051205_1539webtools.sourceediting-20051205_1539.tar.gz  webtools.sourceediting-20051205_1539.tar.xz  webtools.sourceediting-20051205_1539.zip  nitind19 years
v20051205_1110webtools.sourceediting-20051205_1110.tar.gz  webtools.sourceediting-20051205_1110.tar.xz  webtools.sourceediting-20051205_1110.zip  nitind19 years
v20051201_1727webtools.sourceediting-20051201_1727.tar.gz  webtools.sourceediting-20051201_1727.tar.xz  webtools.sourceediting-20051201_1727.zip  nitind19 years
v20051130_1730webtools.sourceediting-20051130_1730.tar.gz  webtools.sourceediting-20051130_1730.tar.xz  webtools.sourceediting-20051130_1730.zip  nitind19 years
v20051130_1545webtools.sourceediting-20051130_1545.tar.gz  webtools.sourceediting-20051130_1545.tar.xz  webtools.sourceediting-20051130_1545.zip  nitind19 years
v20051130_1724webtools.sourceediting-20051130_1724.tar.gz  webtools.sourceediting-20051130_1724.tar.xz  webtools.sourceediting-20051130_1724.zip  nitind19 years
v20051130_2130webtools.sourceediting-20051130_2130.tar.gz  webtools.sourceediting-20051130_2130.tar.xz  webtools.sourceediting-20051130_2130.zip  nitind19 years
v20051130_1320webtools.sourceediting-20051130_1320.tar.gz  webtools.sourceediting-20051130_1320.tar.xz  webtools.sourceediting-20051130_1320.zip  nitind19 years
v20051130_1300webtools.sourceediting-20051130_1300.tar.gz  webtools.sourceediting-20051130_1300.tar.xz  webtools.sourceediting-20051130_1300.zip  nitind19 years
v20051129_2330webtools.sourceediting-20051129_2330.tar.gz  webtools.sourceediting-20051129_2330.tar.xz  webtools.sourceediting-20051129_2330.zip  nitind19 years
v20052911_2135webtools.sourceediting-20052911_2135.tar.gz  webtools.sourceediting-20052911_2135.tar.xz  webtools.sourceediting-20052911_2135.zip  nitind19 years
v20051129_1835webtools.sourceediting-20051129_1835.tar.gz  webtools.sourceediting-20051129_1835.tar.xz  webtools.sourceediting-20051129_1835.zip  nitind19 years
v20051129_1730webtools.sourceediting-20051129_1730.tar.gz  webtools.sourceediting-20051129_1730.tar.xz  webtools.sourceediting-20051129_1730.zip  nitind19 years
v20051129_1620webtools.sourceediting-20051129_1620.tar.gz  webtools.sourceediting-20051129_1620.tar.xz  webtools.sourceediting-20051129_1620.zip  nitind19 years
v20051129_1615webtools.sourceediting-20051129_1615.tar.gz  webtools.sourceediting-20051129_1615.tar.xz  webtools.sourceediting-20051129_1615.zip  nitind19 years
v20051129_1554webtools.sourceediting-20051129_1554.tar.gz  webtools.sourceediting-20051129_1554.tar.xz  webtools.sourceediting-20051129_1554.zip  nitind19 years
v20051129_1107webtools.sourceediting-20051129_1107.tar.gz  webtools.sourceediting-20051129_1107.tar.xz  webtools.sourceediting-20051129_1107.zip  nitind19 years
v20051129_0031webtools.sourceediting-20051129_0031.tar.gz  webtools.sourceediting-20051129_0031.tar.xz  webtools.sourceediting-20051129_0031.zip  nitind19 years
v20051129_0030webtools.sourceediting-20051129_0030.tar.gz  webtools.sourceediting-20051129_0030.tar.xz  webtools.sourceediting-20051129_0030.zip  nitind19 years
v20051123_2237webtools.sourceediting-20051123_2237.tar.gz  webtools.sourceediting-20051123_2237.tar.xz  webtools.sourceediting-20051123_2237.zip  nitind19 years
v20051122_0007webtools.sourceediting-20051122_0007.tar.gz  webtools.sourceediting-20051122_0007.tar.xz  webtools.sourceediting-20051122_0007.zip  nitind19 years
v20051122_0256webtools.sourceediting-20051122_0256.tar.gz  webtools.sourceediting-20051122_0256.tar.xz  webtools.sourceediting-20051122_0256.zip  nitind19 years
v20051121_1105webtools.sourceediting-20051121_1105.tar.gz  webtools.sourceediting-20051121_1105.tar.xz  webtools.sourceediting-20051121_1105.zip  nitind19 years
v20051119_2145webtools.sourceediting-20051119_2145.tar.gz  webtools.sourceediting-20051119_2145.tar.xz  webtools.sourceediting-20051119_2145.zip  nitind19 years
v20051120_2000webtools.sourceediting-20051120_2000.tar.gz  webtools.sourceediting-20051120_2000.tar.xz  webtools.sourceediting-20051120_2000.zip  nitind19 years
v20051119_2030webtools.sourceediting-20051119_2030.tar.gz  webtools.sourceediting-20051119_2030.tar.xz  webtools.sourceediting-20051119_2030.zip  nitind19 years
v20051119_1158webtools.sourceediting-20051119_1158.tar.gz  webtools.sourceediting-20051119_1158.tar.xz  webtools.sourceediting-20051119_1158.zip  nitind19 years
v20051207_1540webtools.sourceediting-20051207_1540.tar.gz  webtools.sourceediting-20051207_1540.tar.xz  webtools.sourceediting-20051207_1540.zip  nitind19 years
v20051116_0230webtools.sourceediting-20051116_0230.tar.gz  webtools.sourceediting-20051116_0230.tar.xz  webtools.sourceediting-20051116_0230.zip  nitind19 years
v20051116_0200webtools.sourceediting-20051116_0200.tar.gz  webtools.sourceediting-20051116_0200.tar.xz  webtools.sourceediting-20051116_0200.zip  nitind19 years
v20051115_1102webtools.sourceediting-20051115_1102.tar.gz  webtools.sourceediting-20051115_1102.tar.xz  webtools.sourceediting-20051115_1102.zip  nitind19 years
v20051113_2250webtools.sourceediting-20051113_2250.tar.gz  webtools.sourceediting-20051113_2250.tar.xz  webtools.sourceediting-20051113_2250.zip  nitind19 years
v20051113_2220webtools.sourceediting-20051113_2220.tar.gz  webtools.sourceediting-20051113_2220.tar.xz  webtools.sourceediting-20051113_2220.zip  nitind19 years
v20051113_2200webtools.sourceediting-20051113_2200.tar.gz  webtools.sourceediting-20051113_2200.tar.xz  webtools.sourceediting-20051113_2200.zip  nitind19 years
v20051113_2150webtools.sourceediting-20051113_2150.tar.gz  webtools.sourceediting-20051113_2150.tar.xz  webtools.sourceediting-20051113_2150.zip  nitind19 years
v20051112_0717webtools.sourceediting-20051112_0717.tar.gz  webtools.sourceediting-20051112_0717.tar.xz  webtools.sourceediting-20051112_0717.zip  nitind19 years
v20051111_0253webtools.sourceediting-20051111_0253.tar.gz  webtools.sourceediting-20051111_0253.tar.xz  webtools.sourceediting-20051111_0253.zip  nitind19 years
v20051110_2010webtools.sourceediting-20051110_2010.tar.gz  webtools.sourceediting-20051110_2010.tar.xz  webtools.sourceediting-20051110_2010.zip  nitind19 years
v20051110_1930webtools.sourceediting-20051110_1930.tar.gz  webtools.sourceediting-20051110_1930.tar.xz  webtools.sourceediting-20051110_1930.zip  nitind19 years
v20051110_1550webtools.sourceediting-20051110_1550.tar.gz  webtools.sourceediting-20051110_1550.tar.xz  webtools.sourceediting-20051110_1550.zip  nitind19 years
v20051110_0600webtools.sourceediting-20051110_0600.tar.gz  webtools.sourceediting-20051110_0600.tar.xz  webtools.sourceediting-20051110_0600.zip  nitind19 years
v20051110_0145webtools.sourceediting-20051110_0145.tar.gz  webtools.sourceediting-20051110_0145.tar.xz  webtools.sourceediting-20051110_0145.zip  nitind19 years
v20051109_1820webtools.sourceediting-20051109_1820.tar.gz  webtools.sourceediting-20051109_1820.tar.xz  webtools.sourceediting-20051109_1820.zip  nitind19 years
v20051109_1800webtools.sourceediting-20051109_1800.tar.gz  webtools.sourceediting-20051109_1800.tar.xz  webtools.sourceediting-20051109_1800.zip  nitind19 years
v20051109_1740webtools.sourceediting-20051109_1740.tar.gz  webtools.sourceediting-20051109_1740.tar.xz  webtools.sourceediting-20051109_1740.zip  nitind19 years
v20051109_1730webtools.sourceediting-20051109_1730.tar.gz  webtools.sourceediting-20051109_1730.tar.xz  webtools.sourceediting-20051109_1730.zip  nitind19 years
v20051109_1715webtools.sourceediting-20051109_1715.tar.gz  webtools.sourceediting-20051109_1715.tar.xz  webtools.sourceediting-20051109_1715.zip  nitind19 years
v20051109_1118webtools.sourceediting-20051109_1118.tar.gz  webtools.sourceediting-20051109_1118.tar.xz  webtools.sourceediting-20051109_1118.zip  nitind19 years
v20051109_1059webtools.sourceediting-20051109_1059.tar.gz  webtools.sourceediting-20051109_1059.tar.xz  webtools.sourceediting-20051109_1059.zip  nitind19 years
v20051109_1530webtools.sourceediting-20051109_1530.tar.gz  webtools.sourceediting-20051109_1530.tar.xz  webtools.sourceediting-20051109_1530.zip  nitind19 years
v20051107_1409webtools.sourceediting-20051107_1409.tar.gz  webtools.sourceediting-20051107_1409.tar.xz  webtools.sourceediting-20051107_1409.zip  nitind19 years
v20051107_0030webtools.sourceediting-20051107_0030.tar.gz  webtools.sourceediting-20051107_0030.tar.xz  webtools.sourceediting-20051107_0030.zip  nitind19 years
v20051107_1110webtools.sourceediting-20051107_1110.tar.gz  webtools.sourceediting-20051107_1110.tar.xz  webtools.sourceediting-20051107_1110.zip  nitind19 years
v20051102_2130webtools.sourceediting-20051102_2130.tar.gz  webtools.sourceediting-20051102_2130.tar.xz  webtools.sourceediting-20051102_2130.zip  nitind19 years
v20051102_1925webtools.sourceediting-20051102_1925.tar.gz  webtools.sourceediting-20051102_1925.tar.xz  webtools.sourceediting-20051102_1925.zip  nitind19 years
v20051102_1855webtools.sourceediting-20051102_1855.tar.gz  webtools.sourceediting-20051102_1855.tar.xz  webtools.sourceediting-20051102_1855.zip  nitind19 years
v20051102_0615webtools.sourceediting-20051102_0615.tar.gz  webtools.sourceediting-20051102_0615.tar.xz  webtools.sourceediting-20051102_0615.zip  nitind19 years
v20051102_1452webtools.sourceediting-20051102_1452.tar.gz  webtools.sourceediting-20051102_1452.tar.xz  webtools.sourceediting-20051102_1452.zip  nitind19 years
v20051102_1415webtools.sourceediting-20051102_1415.tar.gz  webtools.sourceediting-20051102_1415.tar.xz  webtools.sourceediting-20051102_1415.zip  nitind19 years
v20051102_1103webtools.sourceediting-20051102_1103.tar.gz  webtools.sourceediting-20051102_1103.tar.xz  webtools.sourceediting-20051102_1103.zip  nitind19 years
v20051102_0920webtools.sourceediting-20051102_0920.tar.gz  webtools.sourceediting-20051102_0920.tar.xz  webtools.sourceediting-20051102_0920.zip  nitind19 years
v20051102_0220webtools.sourceediting-20051102_0220.tar.gz  webtools.sourceediting-20051102_0220.tar.xz  webtools.sourceediting-20051102_0220.zip  nitind19 years
v20051102_0010webtools.sourceediting-20051102_0010.tar.gz  webtools.sourceediting-20051102_0010.tar.xz  webtools.sourceediting-20051102_0010.zip  nitind19 years
v20051101_2235webtools.sourceediting-20051101_2235.tar.gz  webtools.sourceediting-20051101_2235.tar.xz  webtools.sourceediting-20051101_2235.zip  nitind19 years
v20051101_1450webtools.sourceediting-20051101_1450.tar.gz  webtools.sourceediting-20051101_1450.tar.xz  webtools.sourceediting-20051101_1450.zip  nitind19 years
v20051101_1150webtools.sourceediting-20051101_1150.tar.gz  webtools.sourceediting-20051101_1150.tar.xz  webtools.sourceediting-20051101_1150.zip  nitind19 years
v20051101_1400webtools.sourceediting-20051101_1400.tar.gz  webtools.sourceediting-20051101_1400.tar.xz  webtools.sourceediting-20051101_1400.zip  nitind19 years
v20051031_1827webtools.sourceediting-20051031_1827.tar.gz  webtools.sourceediting-20051031_1827.tar.xz  webtools.sourceediting-20051031_1827.zip  nitind19 years
v20051101_1430webtools.sourceediting-20051101_1430.tar.gz  webtools.sourceediting-20051101_1430.tar.xz  webtools.sourceediting-20051101_1430.zip  nitind19 years
v20051025_1750webtools.sourceediting-20051025_1750.tar.gz  webtools.sourceediting-20051025_1750.tar.xz  webtools.sourceediting-20051025_1750.zip  nitind19 years
v20051025_1740webtools.sourceediting-20051025_1740.tar.gz  webtools.sourceediting-20051025_1740.tar.xz  webtools.sourceediting-20051025_1740.zip  nitind19 years
v20051019_2350webtools.sourceediting-20051019_2350.tar.gz  webtools.sourceediting-20051019_2350.tar.xz  webtools.sourceediting-20051019_2350.zip  nitind19 years
v20051019_2153webtools.sourceediting-20051019_2153.tar.gz  webtools.sourceediting-20051019_2153.tar.xz  webtools.sourceediting-20051019_2153.zip  nitind19 years
v20051017_1100webtools.sourceediting-20051017_1100.tar.gz  webtools.sourceediting-20051017_1100.tar.xz  webtools.sourceediting-20051017_1100.zip  nitind19 years
v20051016_2155webtools.sourceediting-20051016_2155.tar.gz  webtools.sourceediting-20051016_2155.tar.xz  webtools.sourceediting-20051016_2155.zip  nitind19 years
v20051016_2150webtools.sourceediting-20051016_2150.tar.gz  webtools.sourceediting-20051016_2150.tar.xz  webtools.sourceediting-20051016_2150.zip  nitind19 years
v20051113webtools.sourceediting-20051113.tar.gz  webtools.sourceediting-20051113.tar.xz  webtools.sourceediting-20051113.zip  nitind19 years
v20051013_0910webtools.sourceediting-20051013_0910.tar.gz  webtools.sourceediting-20051013_0910.tar.xz  webtools.sourceediting-20051013_0910.zip  nitind19 years
v20051013_0400webtools.sourceediting-20051013_0400.tar.gz  webtools.sourceediting-20051013_0400.tar.xz  webtools.sourceediting-20051013_0400.zip  nitind19 years
v20051013_0310webtools.sourceediting-20051013_0310.tar.gz  webtools.sourceediting-20051013_0310.tar.xz  webtools.sourceediting-20051013_0310.zip  nitind19 years
v20051013_0120webtools.sourceediting-20051013_0120.tar.gz  webtools.sourceediting-20051013_0120.tar.xz  webtools.sourceediting-20051013_0120.zip  nitind19 years
v20051013_0100webtools.sourceediting-20051013_0100.tar.gz  webtools.sourceediting-20051013_0100.tar.xz  webtools.sourceediting-20051013_0100.zip  nitind19 years
v20051011_2300webtools.sourceediting-20051011_2300.tar.gz  webtools.sourceediting-20051011_2300.tar.xz  webtools.sourceediting-20051011_2300.zip  nitind19 years
v20051010_0414webtools.sourceediting-20051010_0414.tar.gz  webtools.sourceediting-20051010_0414.tar.xz  webtools.sourceediting-20051010_0414.zip  nitind19 years
v20051009_1115webtools.sourceediting-20051009_1115.tar.gz  webtools.sourceediting-20051009_1115.tar.xz  webtools.sourceediting-20051009_1115.zip  nitind19 years
v20051004_0330webtools.sourceediting-20051004_0330.tar.gz  webtools.sourceediting-20051004_0330.tar.xz  webtools.sourceediting-20051004_0330.zip  nitind19 years
v20051003_1846webtools.sourceediting-20051003_1846.tar.gz  webtools.sourceediting-20051003_1846.tar.xz  webtools.sourceediting-20051003_1846.zip  nitind19 years
v20051003_1400webtools.sourceediting-20051003_1400.tar.gz  webtools.sourceediting-20051003_1400.tar.xz  webtools.sourceediting-20051003_1400.zip  nitind19 years
v20051002_2100webtools.sourceediting-20051002_2100.tar.gz  webtools.sourceediting-20051002_2100.tar.xz  webtools.sourceediting-20051002_2100.zip  nitind19 years
v20051002_1951webtools.sourceediting-20051002_1951.tar.gz  webtools.sourceediting-20051002_1951.tar.xz  webtools.sourceediting-20051002_1951.zip  nitind19 years
v20051001_1922webtools.sourceediting-20051001_1922.tar.gz  webtools.sourceediting-20051001_1922.tar.xz  webtools.sourceediting-20051001_1922.zip  nitind19 years
v20051001_1900webtools.sourceediting-20051001_1900.tar.gz  webtools.sourceediting-20051001_1900.tar.xz  webtools.sourceediting-20051001_1900.zip  nitind19 years
v20051001_1315webtools.sourceediting-20051001_1315.tar.gz  webtools.sourceediting-20051001_1315.tar.xz  webtools.sourceediting-20051001_1315.zip  nitind19 years
v20051001_0430webtools.sourceediting-20051001_0430.tar.gz  webtools.sourceediting-20051001_0430.tar.xz  webtools.sourceediting-20051001_0430.zip  nitind19 years
v20051001_0422webtools.sourceediting-20051001_0422.tar.gz  webtools.sourceediting-20051001_0422.tar.xz  webtools.sourceediting-20051001_0422.zip  nitind19 years
v20050928_2330webtools.sourceediting-20050928_2330.tar.gz  webtools.sourceediting-20050928_2330.tar.xz  webtools.sourceediting-20050928_2330.zip  nitind19 years
v20050926_1029webtools.sourceediting-20050926_1029.tar.gz  webtools.sourceediting-20050926_1029.tar.xz  webtools.sourceediting-20050926_1029.zip  nitind19 years
v20050926_1025webtools.sourceediting-20050926_1025.tar.gz  webtools.sourceediting-20050926_1025.tar.xz  webtools.sourceediting-20050926_1025.zip  nitind19 years
v20050920_1710webtools.sourceediting-20050920_1710.tar.gz  webtools.sourceediting-20050920_1710.tar.xz  webtools.sourceediting-20050920_1710.zip  nitind19 years
v20050920_1555webtools.sourceediting-20050920_1555.tar.gz  webtools.sourceediting-20050920_1555.tar.xz  webtools.sourceediting-20050920_1555.zip  nitind19 years
v20050920_1515webtools.sourceediting-20050920_1515.tar.gz  webtools.sourceediting-20050920_1515.tar.xz  webtools.sourceediting-20050920_1515.zip  nitind19 years
v20050920_1540webtools.sourceediting-20050920_1540.tar.gz  webtools.sourceediting-20050920_1540.tar.xz  webtools.sourceediting-20050920_1540.zip  nitind19 years
v20050920_1445webtools.sourceediting-20050920_1445.tar.gz  webtools.sourceediting-20050920_1445.tar.xz  webtools.sourceediting-20050920_1445.zip  nitind19 years
v20050920_1210webtools.sourceediting-20050920_1210.tar.gz  webtools.sourceediting-20050920_1210.tar.xz  webtools.sourceediting-20050920_1210.zip  nitind19 years
v20050920_0200webtools.sourceediting-20050920_0200.tar.gz  webtools.sourceediting-20050920_0200.tar.xz  webtools.sourceediting-20050920_0200.zip  nitind19 years
v20050915_1610webtools.sourceediting-20050915_1610.tar.gz  webtools.sourceediting-20050915_1610.tar.xz  webtools.sourceediting-20050915_1610.zip  nitind19 years
v20050915_0900webtools.sourceediting-20050915_0900.tar.gz  webtools.sourceediting-20050915_0900.tar.xz  webtools.sourceediting-20050915_0900.zip  nitind19 years
v20050914_1930webtools.sourceediting-20050914_1930.tar.gz  webtools.sourceediting-20050914_1930.tar.xz  webtools.sourceediting-20050914_1930.zip  nitind19 years
v20050914_0200webtools.sourceediting-20050914_0200.tar.gz  webtools.sourceediting-20050914_0200.tar.xz  webtools.sourceediting-20050914_0200.zip  nitind19 years
v20050914_0230webtools.sourceediting-20050914_0230.tar.gz  webtools.sourceediting-20050914_0230.tar.xz  webtools.sourceediting-20050914_0230.zip  nitind19 years
v20050914_0100webtools.sourceediting-20050914_0100.tar.gz  webtools.sourceediting-20050914_0100.tar.xz  webtools.sourceediting-20050914_0100.zip  nitind19 years
v20050913_2345webtools.sourceediting-20050913_2345.tar.gz  webtools.sourceediting-20050913_2345.tar.xz  webtools.sourceediting-20050913_2345.zip  nitind19 years
v20050913_2300webtools.sourceediting-20050913_2300.tar.gz  webtools.sourceediting-20050913_2300.tar.xz  webtools.sourceediting-20050913_2300.zip  nitind19 years
v20050913_1500webtools.sourceediting-20050913_1500.tar.gz  webtools.sourceediting-20050913_1500.tar.xz  webtools.sourceediting-20050913_1500.zip  nitind19 years
v20050913_1311webtools.sourceediting-20050913_1311.tar.gz  webtools.sourceediting-20050913_1311.tar.xz  webtools.sourceediting-20050913_1311.zip  nitind19 years
v20050913_1835webtools.sourceediting-20050913_1835.tar.gz  webtools.sourceediting-20050913_1835.tar.xz  webtools.sourceediting-20050913_1835.zip  nitind19 years
v20050912_1830webtools.sourceediting-20050912_1830.tar.gz  webtools.sourceediting-20050912_1830.tar.xz  webtools.sourceediting-20050912_1830.zip  nitind19 years
v20050908_1327webtools.sourceediting-20050908_1327.tar.gz  webtools.sourceediting-20050908_1327.tar.xz  webtools.sourceediting-20050908_1327.zip  nitind19 years
v20050908_0033webtools.sourceediting-20050908_0033.tar.gz  webtools.sourceediting-20050908_0033.tar.xz  webtools.sourceediting-20050908_0033.zip  nitind19 years
v20050906_1555webtools.sourceediting-20050906_1555.tar.gz  webtools.sourceediting-20050906_1555.tar.xz  webtools.sourceediting-20050906_1555.zip  nitind19 years
v20050907_1815webtools.sourceediting-20050907_1815.tar.gz  webtools.sourceediting-20050907_1815.tar.xz  webtools.sourceediting-20050907_1815.zip  nitind19 years
v20050831_1220webtools.sourceediting-20050831_1220.tar.gz  webtools.sourceediting-20050831_1220.tar.xz  webtools.sourceediting-20050831_1220.zip  nitind19 years
v20050830_0045webtools.sourceediting-20050830_0045.tar.gz  webtools.sourceediting-20050830_0045.tar.xz  webtools.sourceediting-20050830_0045.zip  nitind19 years
v20050829_1001webtools.sourceediting-20050829_1001.tar.gz  webtools.sourceediting-20050829_1001.tar.xz  webtools.sourceediting-20050829_1001.zip  nitind19 years
v20050827_0130webtools.sourceediting-20050827_0130.tar.gz  webtools.sourceediting-20050827_0130.tar.xz  webtools.sourceediting-20050827_0130.zip  nitind19 years
v20050823_1018webtools.sourceediting-20050823_1018.tar.gz  webtools.sourceediting-20050823_1018.tar.xz  webtools.sourceediting-20050823_1018.zip  nitind19 years
v20050823_2350webtools.sourceediting-20050823_2350.tar.gz  webtools.sourceediting-20050823_2350.tar.xz  webtools.sourceediting-20050823_2350.zip  nitind19 years
v20050823_0954webtools.sourceediting-20050823_0954.tar.gz  webtools.sourceediting-20050823_0954.tar.xz  webtools.sourceediting-20050823_0954.zip  nitind19 years
v20050811_0400webtools.sourceediting-20050811_0400.tar.gz  webtools.sourceediting-20050811_0400.tar.xz  webtools.sourceediting-20050811_0400.zip  nitind19 years
v20050810_1628webtools.sourceediting-20050810_1628.tar.gz  webtools.sourceediting-20050810_1628.tar.xz  webtools.sourceediting-20050810_1628.zip  nitind19 years
v20050809_1825webtools.sourceediting-20050809_1825.tar.gz  webtools.sourceediting-20050809_1825.tar.xz  webtools.sourceediting-20050809_1825.zip  nitind19 years
v20050809_1430webtools.sourceediting-20050809_1430.tar.gz  webtools.sourceediting-20050809_1430.tar.xz  webtools.sourceediting-20050809_1430.zip  nitind19 years
v20050809_1427webtools.sourceediting-20050809_1427.tar.gz  webtools.sourceediting-20050809_1427.tar.xz  webtools.sourceediting-20050809_1427.zip  nitind19 years
v20050809_1424webtools.sourceediting-20050809_1424.tar.gz  webtools.sourceediting-20050809_1424.tar.xz  webtools.sourceediting-20050809_1424.zip  nitind19 years
v20050809_1253webtools.sourceediting-20050809_1253.tar.gz  webtools.sourceediting-20050809_1253.tar.xz  webtools.sourceediting-20050809_1253.zip  nitind19 years
v20050809_1227webtools.sourceediting-20050809_1227.tar.gz  webtools.sourceediting-20050809_1227.tar.xz  webtools.sourceediting-20050809_1227.zip  nitind19 years
v20050809_1035webtools.sourceediting-20050809_1035.tar.gz  webtools.sourceediting-20050809_1035.tar.xz  webtools.sourceediting-20050809_1035.zip  nitind19 years
v20050728_1830webtools.sourceediting-20050728_1830.tar.gz  webtools.sourceediting-20050728_1830.tar.xz  webtools.sourceediting-20050728_1830.zip  nitind19 years
v20050728_0150webtools.sourceediting-20050728_0150.tar.gz  webtools.sourceediting-20050728_0150.tar.xz  webtools.sourceediting-20050728_0150.zip  nitind19 years
v20050726_2340webtools.sourceediting-20050726_2340.tar.gz  webtools.sourceediting-20050726_2340.tar.xz  webtools.sourceediting-20050726_2340.zip  nitind19 years
R0_7webtools.sourceediting-R0_7.tar.gz  webtools.sourceediting-R0_7.tar.xz  webtools.sourceediting-R0_7.zip  nitind19 years
v20050726_1400webtools.sourceediting-20050726_1400.tar.gz  webtools.sourceediting-20050726_1400.tar.xz  webtools.sourceediting-20050726_1400.zip  nitind19 years
v20050726_1210webtools.sourceediting-20050726_1210.tar.gz  webtools.sourceediting-20050726_1210.tar.xz  webtools.sourceediting-20050726_1210.zip  nitind19 years
v20050725_2255webtools.sourceediting-20050725_2255.tar.gz  webtools.sourceediting-20050725_2255.tar.xz  webtools.sourceediting-20050725_2255.zip  nitind19 years
v20050724_2000webtools.sourceediting-20050724_2000.tar.gz  webtools.sourceediting-20050724_2000.tar.xz  webtools.sourceediting-20050724_2000.zip  nitind19 years
v20050721_1735webtools.sourceediting-20050721_1735.tar.gz  webtools.sourceediting-20050721_1735.tar.xz  webtools.sourceediting-20050721_1735.zip  nitind19 years
v20050721_1723webtools.sourceediting-20050721_1723.tar.gz  webtools.sourceediting-20050721_1723.tar.xz  webtools.sourceediting-20050721_1723.zip  nitind19 years
v20050721_1713webtools.sourceediting-20050721_1713.tar.gz  webtools.sourceediting-20050721_1713.tar.xz  webtools.sourceediting-20050721_1713.zip  nitind19 years
v20050721_1523webtools.sourceediting-20050721_1523.tar.gz  webtools.sourceediting-20050721_1523.tar.xz  webtools.sourceediting-20050721_1523.zip  nitind19 years
v20050721_0145webtools.sourceediting-20050721_0145.tar.gz  webtools.sourceediting-20050721_0145.tar.xz  webtools.sourceediting-20050721_0145.zip  nitind19 years
v20050720_2150webtools.sourceediting-20050720_2150.tar.gz  webtools.sourceediting-20050720_2150.tar.xz  webtools.sourceediting-20050720_2150.zip  nitind19 years
v20050720_2040webtools.sourceediting-20050720_2040.tar.gz  webtools.sourceediting-20050720_2040.tar.xz  webtools.sourceediting-20050720_2040.zip  nitind19 years
v20050720_0403webtools.sourceediting-20050720_0403.tar.gz  webtools.sourceediting-20050720_0403.tar.xz  webtools.sourceediting-20050720_0403.zip  nitind19 years
v20050720_0346webtools.sourceediting-20050720_0346.tar.gz  webtools.sourceediting-20050720_0346.tar.xz  webtools.sourceediting-20050720_0346.zip  nitind19 years
v20050720_0342webtools.sourceediting-20050720_0342.tar.gz  webtools.sourceediting-20050720_0342.tar.xz  webtools.sourceediting-20050720_0342.zip  nitind19 years
v20050719_1900webtools.sourceediting-20050719_1900.tar.gz  webtools.sourceediting-20050719_1900.tar.xz  webtools.sourceediting-20050719_1900.zip  nitind19 years
v20050719_0007webtools.sourceediting-20050719_0007.tar.gz  webtools.sourceediting-20050719_0007.tar.xz  webtools.sourceediting-20050719_0007.zip  nitind19 years
v20050718_0250webtools.sourceediting-20050718_0250.tar.gz  webtools.sourceediting-20050718_0250.tar.xz  webtools.sourceediting-20050718_0250.zip  nitind19 years
v20050718_0153webtools.sourceediting-20050718_0153.tar.gz  webtools.sourceediting-20050718_0153.tar.xz  webtools.sourceediting-20050718_0153.zip  nitind19 years
v20050718_0143webtools.sourceediting-20050718_0143.tar.gz  webtools.sourceediting-20050718_0143.tar.xz  webtools.sourceediting-20050718_0143.zip  nitind19 years
v20050721_1725webtools.sourceediting-20050721_1725.tar.gz  webtools.sourceediting-20050721_1725.tar.xz  webtools.sourceediting-20050721_1725.zip  nitind19 years
v20050714_1835webtools.sourceediting-20050714_1835.tar.gz  webtools.sourceediting-20050714_1835.tar.xz  webtools.sourceediting-20050714_1835.zip  nitind19 years
v20050712_2012webtools.sourceediting-20050712_2012.tar.gz  webtools.sourceediting-20050712_2012.tar.xz  webtools.sourceediting-20050712_2012.zip  nitind19 years
v20050712_1810webtools.sourceediting-20050712_1810.tar.gz  webtools.sourceediting-20050712_1810.tar.xz  webtools.sourceediting-20050712_1810.zip  nitind19 years
v20050712_1542webtools.sourceediting-20050712_1542.tar.gz  webtools.sourceediting-20050712_1542.tar.xz  webtools.sourceediting-20050712_1542.zip  nitind19 years
v20050712_1815webtools.sourceediting-20050712_1815.tar.gz  webtools.sourceediting-20050712_1815.tar.xz  webtools.sourceediting-20050712_1815.zip  nitind19 years
v20050711_2240webtools.sourceediting-20050711_2240.tar.gz  webtools.sourceediting-20050711_2240.tar.xz  webtools.sourceediting-20050711_2240.zip  nitind19 years
v20050711_1815webtools.sourceediting-20050711_1815.tar.gz  webtools.sourceediting-20050711_1815.tar.xz  webtools.sourceediting-20050711_1815.zip  nitind19 years
v20050712_1300webtools.sourceediting-20050712_1300.tar.gz  webtools.sourceediting-20050712_1300.tar.xz  webtools.sourceediting-20050712_1300.zip  nitind19 years
v20050711_1621webtools.sourceediting-20050711_1621.tar.gz  webtools.sourceediting-20050711_1621.tar.xz  webtools.sourceediting-20050711_1621.zip  nitind19 years
v20050711_1615webtools.sourceediting-20050711_1615.tar.gz  webtools.sourceediting-20050711_1615.tar.xz  webtools.sourceediting-20050711_1615.zip  nitind19 years
v20050711_1505webtools.sourceediting-20050711_1505.tar.gz  webtools.sourceediting-20050711_1505.tar.xz  webtools.sourceediting-20050711_1505.zip  nitind19 years
v20050709_2300webtools.sourceediting-20050709_2300.tar.gz  webtools.sourceediting-20050709_2300.tar.xz  webtools.sourceediting-20050709_2300.zip  nitind19 years
v20050709_0125webtools.sourceediting-20050709_0125.tar.gz  webtools.sourceediting-20050709_0125.tar.xz  webtools.sourceediting-20050709_0125.zip  nitind19 years
v20050709_0036webtools.sourceediting-20050709_0036.tar.gz  webtools.sourceediting-20050709_0036.tar.xz  webtools.sourceediting-20050709_0036.zip  nitind19 years
v20050708_2210webtools.sourceediting-20050708_2210.tar.gz  webtools.sourceediting-20050708_2210.tar.xz  webtools.sourceediting-20050708_2210.zip  nitind19 years
v20050708_1725webtools.sourceediting-20050708_1725.tar.gz  webtools.sourceediting-20050708_1725.tar.xz  webtools.sourceediting-20050708_1725.zip  nitind19 years
v20050707_2200webtools.sourceediting-20050707_2200.tar.gz  webtools.sourceediting-20050707_2200.tar.xz  webtools.sourceediting-20050707_2200.zip  nitind19 years
v20050705_1904webtools.sourceediting-20050705_1904.tar.gz  webtools.sourceediting-20050705_1904.tar.xz  webtools.sourceediting-20050705_1904.zip  nitind19 years
v20050705_1650webtools.sourceediting-20050705_1650.tar.gz  webtools.sourceediting-20050705_1650.tar.xz  webtools.sourceediting-20050705_1650.zip  nitind19 years
v20050705_1635webtools.sourceediting-20050705_1635.tar.gz  webtools.sourceediting-20050705_1635.tar.xz  webtools.sourceediting-20050705_1635.zip  nitind19 years
v20050705_1525webtools.sourceediting-20050705_1525.tar.gz  webtools.sourceediting-20050705_1525.tar.xz  webtools.sourceediting-20050705_1525.zip  nitind19 years
v20050705_0300webtools.sourceediting-20050705_0300.tar.gz  webtools.sourceediting-20050705_0300.tar.xz  webtools.sourceediting-20050705_0300.zip  nitind19 years
v20050630_0010webtools.sourceediting-20050630_0010.tar.gz  webtools.sourceediting-20050630_0010.tar.xz  webtools.sourceediting-20050630_0010.zip  nitind19 years
v20050629_2030webtools.sourceediting-20050629_2030.tar.gz  webtools.sourceediting-20050629_2030.tar.xz  webtools.sourceediting-20050629_2030.zip  nitind19 years
v20050629_1907webtools.sourceediting-20050629_1907.tar.gz  webtools.sourceediting-20050629_1907.tar.xz  webtools.sourceediting-20050629_1907.zip  nitind19 years
v20050629_1739webtools.sourceediting-20050629_1739.tar.gz  webtools.sourceediting-20050629_1739.tar.xz  webtools.sourceediting-20050629_1739.zip  nitind19 years
v20050628_1805webtools.sourceediting-20050628_1805.tar.gz  webtools.sourceediting-20050628_1805.tar.xz  webtools.sourceediting-20050628_1805.zip  nitind19 years
v20050628_0440webtools.sourceediting-20050628_0440.tar.gz  webtools.sourceediting-20050628_0440.tar.xz  webtools.sourceediting-20050628_0440.zip  nitind19 years
v20050627_2222webtools.sourceediting-20050627_2222.tar.gz  webtools.sourceediting-20050627_2222.tar.xz  webtools.sourceediting-20050627_2222.zip  nitind19 years
v20050627_1430webtools.sourceediting-20050627_1430.tar.gz  webtools.sourceediting-20050627_1430.tar.xz  webtools.sourceediting-20050627_1430.zip  nitind19 years
v20050627_0210webtools.sourceediting-20050627_0210.tar.gz  webtools.sourceediting-20050627_0210.tar.xz  webtools.sourceediting-20050627_0210.zip  nitind19 years
v20050626_0025webtools.sourceediting-20050626_0025.tar.gz  webtools.sourceediting-20050626_0025.tar.xz  webtools.sourceediting-20050626_0025.zip  nitind19 years
v20050627_0100webtools.sourceediting-20050627_0100.tar.gz  webtools.sourceediting-20050627_0100.tar.xz  webtools.sourceediting-20050627_0100.zip  nitind19 years
v20050623_1547webtools.sourceediting-20050623_1547.tar.gz  webtools.sourceediting-20050623_1547.tar.xz  webtools.sourceediting-20050623_1547.zip  nitind19 years
v20050623_1536webtools.sourceediting-20050623_1536.tar.gz  webtools.sourceediting-20050623_1536.tar.xz  webtools.sourceediting-20050623_1536.zip  nitind19 years
v20050622_0030webtools.sourceediting-20050622_0030.tar.gz  webtools.sourceediting-20050622_0030.tar.xz  webtools.sourceediting-20050622_0030.zip  nitind19 years
v20050622_1648webtools.sourceediting-20050622_1648.tar.gz  webtools.sourceediting-20050622_1648.tar.xz  webtools.sourceediting-20050622_1648.zip  nitind19 years
v20050622_1640webtools.sourceediting-20050622_1640.tar.gz  webtools.sourceediting-20050622_1640.tar.xz  webtools.sourceediting-20050622_1640.zip  nitind19 years
v20050622_1045webtools.sourceediting-20050622_1045.tar.gz  webtools.sourceediting-20050622_1045.tar.xz  webtools.sourceediting-20050622_1045.zip  nitind19 years
v20050620_1740webtools.sourceediting-20050620_1740.tar.gz  webtools.sourceediting-20050620_1740.tar.xz  webtools.sourceediting-20050620_1740.zip  nitind19 years
v20050620_2200webtools.sourceediting-20050620_2200.tar.gz  webtools.sourceediting-20050620_2200.tar.xz  webtools.sourceediting-20050620_2200.zip  nitind19 years
v20050620_1650webtools.sourceediting-20050620_1650.tar.gz  webtools.sourceediting-20050620_1650.tar.xz  webtools.sourceediting-20050620_1650.zip  nitind19 years
v20050616_1805webtools.sourceediting-20050616_1805.tar.gz  webtools.sourceediting-20050616_1805.tar.xz  webtools.sourceediting-20050616_1805.zip  nitind19 years
v20050616_1750webtools.sourceediting-20050616_1750.tar.gz  webtools.sourceediting-20050616_1750.tar.xz  webtools.sourceediting-20050616_1750.zip  nitind19 years
v20050616_1550webtools.sourceediting-20050616_1550.tar.gz  webtools.sourceediting-20050616_1550.tar.xz  webtools.sourceediting-20050616_1550.zip  nitind19 years
v20050616_0210webtools.sourceediting-20050616_0210.tar.gz  webtools.sourceediting-20050616_0210.tar.xz  webtools.sourceediting-20050616_0210.zip  nitind19 years
v20050616_0252webtools.sourceediting-20050616_0252.tar.gz  webtools.sourceediting-20050616_0252.tar.xz  webtools.sourceediting-20050616_0252.zip  nitind19 years
v20050616_0200webtools.sourceediting-20050616_0200.tar.gz  webtools.sourceediting-20050616_0200.tar.xz  webtools.sourceediting-20050616_0200.zip  nitind19 years
v20050615_1630webtools.sourceediting-20050615_1630.tar.gz  webtools.sourceediting-20050615_1630.tar.xz  webtools.sourceediting-20050615_1630.zip  nitind19 years
v20050615_1615webtools.sourceediting-20050615_1615.tar.gz  webtools.sourceediting-20050615_1615.tar.xz  webtools.sourceediting-20050615_1615.zip  nitind19 years
v20050615_1015webtools.sourceediting-20050615_1015.tar.gz  webtools.sourceediting-20050615_1015.tar.xz  webtools.sourceediting-20050615_1015.zip  nitind19 years
v20050615_0842webtools.sourceediting-20050615_0842.tar.gz  webtools.sourceediting-20050615_0842.tar.xz  webtools.sourceediting-20050615_0842.zip  nitind19 years
v20060615_0200webtools.sourceediting-20060615_0200.tar.gz  webtools.sourceediting-20060615_0200.tar.xz  webtools.sourceediting-20060615_0200.zip  nitind19 years
v20050614_2350webtools.sourceediting-20050614_2350.tar.gz  webtools.sourceediting-20050614_2350.tar.xz  webtools.sourceediting-20050614_2350.zip  nitind19 years
v20050614_0020webtools.sourceediting-20050614_0020.tar.gz  webtools.sourceediting-20050614_0020.tar.xz  webtools.sourceediting-20050614_0020.zip  nitind19 years
v20050615_1206webtools.sourceediting-20050615_1206.tar.gz  webtools.sourceediting-20050615_1206.tar.xz  webtools.sourceediting-20050615_1206.zip  nitind19 years
v20050613_1715webtools.sourceediting-20050613_1715.tar.gz  webtools.sourceediting-20050613_1715.tar.xz  webtools.sourceediting-20050613_1715.zip  nitind19 years
v20050611_0054webtools.sourceediting-20050611_0054.tar.gz  webtools.sourceediting-20050611_0054.tar.xz  webtools.sourceediting-20050611_0054.zip  nitind19 years
v20050608_2140webtools.sourceediting-20050608_2140.tar.gz  webtools.sourceediting-20050608_2140.tar.xz  webtools.sourceediting-20050608_2140.zip  nitind19 years
v20050608_1535webtools.sourceediting-20050608_1535.tar.gz  webtools.sourceediting-20050608_1535.tar.xz  webtools.sourceediting-20050608_1535.zip  nitind19 years
v20050608_0830webtools.sourceediting-20050608_0830.tar.gz  webtools.sourceediting-20050608_0830.tar.xz  webtools.sourceediting-20050608_0830.zip  nitind19 years
v20050607_2350webtools.sourceediting-20050607_2350.tar.gz  webtools.sourceediting-20050607_2350.tar.xz  webtools.sourceediting-20050607_2350.zip  nitind19 years
v20050607_0050webtools.sourceediting-20050607_0050.tar.gz  webtools.sourceediting-20050607_0050.tar.xz  webtools.sourceediting-20050607_0050.zip  nitind19 years
v20050607webtools.sourceediting-20050607.tar.gz  webtools.sourceediting-20050607.tar.xz  webtools.sourceediting-20050607.zip  nitind19 years
v20050606_1915webtools.sourceediting-20050606_1915.tar.gz  webtools.sourceediting-20050606_1915.tar.xz  webtools.sourceediting-20050606_1915.zip  nitind19 years
v20060606_1506webtools.sourceediting-20060606_1506.tar.gz  webtools.sourceediting-20060606_1506.tar.xz  webtools.sourceediting-20060606_1506.zip  nitind19 years
v20050606_1352webtools.sourceediting-20050606_1352.tar.gz  webtools.sourceediting-20050606_1352.tar.xz  webtools.sourceediting-20050606_1352.zip  nitind19 years
v20050606_1405webtools.sourceediting-20050606_1405.tar.gz  webtools.sourceediting-20050606_1405.tar.xz  webtools.sourceediting-20050606_1405.zip  nitind19 years
v20050606_1238webtools.sourceediting-20050606_1238.tar.gz  webtools.sourceediting-20050606_1238.tar.xz  webtools.sourceediting-20050606_1238.zip  nitind19 years
v20050603_0530webtools.sourceediting-20050603_0530.tar.gz  webtools.sourceediting-20050603_0530.tar.xz  webtools.sourceediting-20050603_0530.zip  nitind19 years
v20050602_2300webtools.sourceediting-20050602_2300.tar.gz  webtools.sourceediting-20050602_2300.tar.xz  webtools.sourceediting-20050602_2300.zip  nitind19 years
v20050602_1845webtools.sourceediting-20050602_1845.tar.gz  webtools.sourceediting-20050602_1845.tar.xz  webtools.sourceediting-20050602_1845.zip  nitind19 years
v20050602_1855webtools.sourceediting-20050602_1855.tar.gz  webtools.sourceediting-20050602_1855.tar.xz  webtools.sourceediting-20050602_1855.zip  nitind19 years
v20050602-2340webtools.sourceediting-20050602-2340.tar.gz  webtools.sourceediting-20050602-2340.tar.xz  webtools.sourceediting-20050602-2340.zip  nitind19 years
v20050601_0945webtools.sourceediting-20050601_0945.tar.gz  webtools.sourceediting-20050601_0945.tar.xz  webtools.sourceediting-20050601_0945.zip  nitind19 years
v20050601_0930webtools.sourceediting-20050601_0930.tar.gz  webtools.sourceediting-20050601_0930.tar.xz  webtools.sourceediting-20050601_0930.zip  nitind19 years
v20050601_00830webtools.sourceediting-20050601_00830.tar.gz  webtools.sourceediting-20050601_00830.tar.xz  webtools.sourceediting-20050601_00830.zip  nitind19 years
v20050601_0215webtools.sourceediting-20050601_0215.tar.gz  webtools.sourceediting-20050601_0215.tar.xz  webtools.sourceediting-20050601_0215.zip  nitind19 years
v20050531_2255webtools.sourceediting-20050531_2255.tar.gz  webtools.sourceediting-20050531_2255.tar.xz  webtools.sourceediting-20050531_2255.zip  nitind19 years
v20050531_1430webtools.sourceediting-20050531_1430.tar.gz  webtools.sourceediting-20050531_1430.tar.xz  webtools.sourceediting-20050531_1430.zip  nitind19 years
v20050530_2045webtools.sourceediting-20050530_2045.tar.gz  webtools.sourceediting-20050530_2045.tar.xz  webtools.sourceediting-20050530_2045.zip  nitind19 years
v20050526_0400webtools.sourceediting-20050526_0400.tar.gz  webtools.sourceediting-20050526_0400.tar.xz  webtools.sourceediting-20050526_0400.zip  nitind19 years
v20050526_0210webtools.sourceediting-20050526_0210.tar.gz  webtools.sourceediting-20050526_0210.tar.xz  webtools.sourceediting-20050526_0210.zip  nitind19 years
v20050525_2045webtools.sourceediting-20050525_2045.tar.gz  webtools.sourceediting-20050525_2045.tar.xz  webtools.sourceediting-20050525_2045.zip  nitind19 years
v20050525_1730webtools.sourceediting-20050525_1730.tar.gz  webtools.sourceediting-20050525_1730.tar.xz  webtools.sourceediting-20050525_1730.zip  nitind19 years
v20050525_1430webtools.sourceediting-20050525_1430.tar.gz  webtools.sourceediting-20050525_1430.tar.xz  webtools.sourceediting-20050525_1430.zip  nitind19 years
v20050524_1445webtools.sourceediting-20050524_1445.tar.gz  webtools.sourceediting-20050524_1445.tar.xz  webtools.sourceediting-20050524_1445.zip  nitind19 years
v20050525_oldCatalogwebtools.sourceediting-20050525_oldCatalog.tar.gz  webtools.sourceediting-20050525_oldCatalog.tar.xz  webtools.sourceediting-20050525_oldCatalog.zip  nitind19 years
v20050519_1335webtools.sourceediting-20050519_1335.tar.gz  webtools.sourceediting-20050519_1335.tar.xz  webtools.sourceediting-20050519_1335.zip  nitind19 years
v20050518_1534webtools.sourceediting-20050518_1534.tar.gz  webtools.sourceediting-20050518_1534.tar.xz  webtools.sourceediting-20050518_1534.zip  nitind19 years
v20050517_1510webtools.sourceediting-20050517_1510.tar.gz  webtools.sourceediting-20050517_1510.tar.xz  webtools.sourceediting-20050517_1510.zip  nitind19 years
v20050513_0130webtools.sourceediting-20050513_0130.tar.gz  webtools.sourceediting-20050513_0130.tar.xz  webtools.sourceediting-20050513_0130.zip  nitind19 years
v20050512_1130webtools.sourceediting-20050512_1130.tar.gz  webtools.sourceediting-20050512_1130.tar.xz  webtools.sourceediting-20050512_1130.zip  nitind19 years
v20050512_1045webtools.sourceediting-20050512_1045.tar.gz  webtools.sourceediting-20050512_1045.tar.xz  webtools.sourceediting-20050512_1045.zip  nitind19 years
v20050511_1809webtools.sourceediting-20050511_1809.tar.gz  webtools.sourceediting-20050511_1809.tar.xz  webtools.sourceediting-20050511_1809.zip  nitind19 years
v20050511_1754webtools.sourceediting-20050511_1754.tar.gz  webtools.sourceediting-20050511_1754.tar.xz  webtools.sourceediting-20050511_1754.zip  nitind19 years
v20050511_2356webtools.sourceediting-20050511_2356.tar.gz  webtools.sourceediting-20050511_2356.tar.xz  webtools.sourceediting-20050511_2356.zip  nitind19 years
v20050511_0200webtools.sourceediting-20050511_0200.tar.gz  webtools.sourceediting-20050511_0200.tar.xz  webtools.sourceediting-20050511_0200.zip  nitind19 years
v20050509_1443webtools.sourceediting-20050509_1443.tar.gz  webtools.sourceediting-20050509_1443.tar.xz  webtools.sourceediting-20050509_1443.zip  nitind19 years
v20050505_0200webtools.sourceediting-20050505_0200.tar.gz  webtools.sourceediting-20050505_0200.tar.xz  webtools.sourceediting-20050505_0200.zip  nitind19 years
v20050505webtools.sourceediting-20050505.tar.gz  webtools.sourceediting-20050505.tar.xz  webtools.sourceediting-20050505.zip  nitind19 years
v20050503_0115webtools.sourceediting-20050503_0115.tar.gz  webtools.sourceediting-20050503_0115.tar.xz  webtools.sourceediting-20050503_0115.zip  nitind19 years
v20050428_1521webtools.sourceediting-20050428_1521.tar.gz  webtools.sourceediting-20050428_1521.tar.xz  webtools.sourceediting-20050428_1521.zip  nitind19 years
v20050421_2211webtools.sourceediting-20050421_2211.tar.gz  webtools.sourceediting-20050421_2211.tar.xz  webtools.sourceediting-20050421_2211.zip  nitind19 years
v20050422_0100webtools.sourceediting-20050422_0100.tar.gz  webtools.sourceediting-20050422_0100.tar.xz  webtools.sourceediting-20050422_0100.zip  nitind19 years
v20050420_1101webtools.sourceediting-20050420_1101.tar.gz  webtools.sourceediting-20050420_1101.tar.xz  webtools.sourceediting-20050420_1101.zip  nitind19 years
v20050420_0430webtools.sourceediting-20050420_0430.tar.gz  webtools.sourceediting-20050420_0430.tar.xz  webtools.sourceediting-20050420_0430.zip  nitind19 years
v20050419_1630webtools.sourceediting-20050419_1630.tar.gz  webtools.sourceediting-20050419_1630.tar.xz  webtools.sourceediting-20050419_1630.zip  nitind19 years
v20050419_1431webtools.sourceediting-20050419_1431.tar.gz  webtools.sourceediting-20050419_1431.tar.xz  webtools.sourceediting-20050419_1431.zip  nitind19 years
v20050418_2340webtools.sourceediting-20050418_2340.tar.gz  webtools.sourceediting-20050418_2340.tar.xz  webtools.sourceediting-20050418_2340.zip  nitind19 years
v20050418_1337webtools.sourceediting-20050418_1337.tar.gz  webtools.sourceediting-20050418_1337.tar.xz  webtools.sourceediting-20050418_1337.zip  nitind19 years
v20050418_1524webtools.sourceediting-20050418_1524.tar.gz  webtools.sourceediting-20050418_1524.tar.xz  webtools.sourceediting-20050418_1524.zip  nitind19 years
v20050418_1245webtools.sourceediting-20050418_1245.tar.gz  webtools.sourceediting-20050418_1245.tar.xz  webtools.sourceediting-20050418_1245.zip  nitind19 years
v20050418_0130pwebtools.sourceediting-20050418_0130p.tar.gz  webtools.sourceediting-20050418_0130p.tar.xz  webtools.sourceediting-20050418_0130p.zip  nitind19 years
v20050418_0115webtools.sourceediting-20050418_0115.tar.gz  webtools.sourceediting-20050418_0115.tar.xz  webtools.sourceediting-20050418_0115.zip  nitind19 years
v20050417_1830webtools.sourceediting-20050417_1830.tar.gz  webtools.sourceediting-20050417_1830.tar.xz  webtools.sourceediting-20050417_1830.zip  nitind19 years
v20050417webtools.sourceediting-20050417.tar.gz  webtools.sourceediting-20050417.tar.xz  webtools.sourceediting-20050417.zip  nitind19 years
v20050415_2115webtools.sourceediting-20050415_2115.tar.gz  webtools.sourceediting-20050415_2115.tar.xz  webtools.sourceediting-20050415_2115.zip  nitind19 years
v20050415_2000webtools.sourceediting-20050415_2000.tar.gz  webtools.sourceediting-20050415_2000.tar.xz  webtools.sourceediting-20050415_2000.zip  nitind19 years
v20050414_1015webtools.sourceediting-20050414_1015.tar.gz  webtools.sourceediting-20050414_1015.tar.xz  webtools.sourceediting-20050414_1015.zip  nitind19 years
v20050413_2100webtools.sourceediting-20050413_2100.tar.gz  webtools.sourceediting-20050413_2100.tar.xz  webtools.sourceediting-20050413_2100.zip  nitind19 years
v20050413_1845webtools.sourceediting-20050413_1845.tar.gz  webtools.sourceediting-20050413_1845.tar.xz  webtools.sourceediting-20050413_1845.zip  nitind19 years
v20050413_1805webtools.sourceediting-20050413_1805.tar.gz  webtools.sourceediting-20050413_1805.tar.xz  webtools.sourceediting-20050413_1805.zip  nitind19 years
v20050413_1525webtools.sourceediting-20050413_1525.tar.gz  webtools.sourceediting-20050413_1525.tar.xz  webtools.sourceediting-20050413_1525.zip  nitind19 years
v20050413_1310webtools.sourceediting-20050413_1310.tar.gz  webtools.sourceediting-20050413_1310.tar.xz  webtools.sourceediting-20050413_1310.zip  nitind19 years
v20050413_1200webtools.sourceediting-20050413_1200.tar.gz  webtools.sourceediting-20050413_1200.tar.xz  webtools.sourceediting-20050413_1200.zip  nitind19 years
v20050413_1130webtools.sourceediting-20050413_1130.tar.gz  webtools.sourceediting-20050413_1130.tar.xz  webtools.sourceediting-20050413_1130.zip  nitind19 years
v20050413_1045webtools.sourceediting-20050413_1045.tar.gz  webtools.sourceediting-20050413_1045.tar.xz  webtools.sourceediting-20050413_1045.zip  nitind19 years
v20050413_1030webtools.sourceediting-20050413_1030.tar.gz  webtools.sourceediting-20050413_1030.tar.xz  webtools.sourceediting-20050413_1030.zip  nitind19 years
v20050413_0200webtools.sourceediting-20050413_0200.tar.gz  webtools.sourceediting-20050413_0200.tar.xz  webtools.sourceediting-20050413_0200.zip  nitind19 years
v20050412_2359webtools.sourceediting-20050412_2359.tar.gz  webtools.sourceediting-20050412_2359.tar.xz  webtools.sourceediting-20050412_2359.zip  nitind19 years
v20050412_2255webtools.sourceediting-20050412_2255.tar.gz  webtools.sourceediting-20050412_2255.tar.xz  webtools.sourceediting-20050412_2255.zip  nitind19 years
v20050412_2240webtools.sourceediting-20050412_2240.tar.gz  webtools.sourceediting-20050412_2240.tar.xz  webtools.sourceediting-20050412_2240.zip  nitind19 years
v20050412_1407webtools.sourceediting-20050412_1407.tar.gz  webtools.sourceediting-20050412_1407.tar.xz  webtools.sourceediting-20050412_1407.zip  nitind19 years
v20050412_0825webtools.sourceediting-20050412_0825.tar.gz  webtools.sourceediting-20050412_0825.tar.xz  webtools.sourceediting-20050412_0825.zip  nitind19 years
v20050412_0245webtools.sourceediting-20050412_0245.tar.gz  webtools.sourceediting-20050412_0245.tar.xz  webtools.sourceediting-20050412_0245.zip  nitind19 years
v20050411_1745webtools.sourceediting-20050411_1745.tar.gz  webtools.sourceediting-20050411_1745.tar.xz  webtools.sourceediting-20050411_1745.zip  nitind19 years
v20050405_2147webtools.sourceediting-20050405_2147.tar.gz  webtools.sourceediting-20050405_2147.tar.xz  webtools.sourceediting-20050405_2147.zip  nitind19 years
v20050412_1300webtools.sourceediting-20050412_1300.tar.gz  webtools.sourceediting-20050412_1300.tar.xz  webtools.sourceediting-20050412_1300.zip  nitind19 years
v20050405_1010webtools.sourceediting-20050405_1010.tar.gz  webtools.sourceediting-20050405_1010.tar.xz  webtools.sourceediting-20050405_1010.zip  nitind19 years
v20050405_0240webtools.sourceediting-20050405_0240.tar.gz  webtools.sourceediting-20050405_0240.tar.xz  webtools.sourceediting-20050405_0240.zip  nitind19 years
v20050404_2315webtools.sourceediting-20050404_2315.tar.gz  webtools.sourceediting-20050404_2315.tar.xz  webtools.sourceediting-20050404_2315.zip  nitind19 years
v20050330_2000webtools.sourceediting-20050330_2000.tar.gz  webtools.sourceediting-20050330_2000.tar.xz  webtools.sourceediting-20050330_2000.zip  nitind19 years
v20050330_1840webtools.sourceediting-20050330_1840.tar.gz  webtools.sourceediting-20050330_1840.tar.xz  webtools.sourceediting-20050330_1840.zip  nitind19 years
v20050330_1600webtools.sourceediting-20050330_1600.tar.gz  webtools.sourceediting-20050330_1600.tar.xz  webtools.sourceediting-20050330_1600.zip  nitind19 years
v20050330_0200webtools.sourceediting-20050330_0200.tar.gz  webtools.sourceediting-20050330_0200.tar.xz  webtools.sourceediting-20050330_0200.zip  nitind19 years
v20050329_2345webtools.sourceediting-20050329_2345.tar.gz  webtools.sourceediting-20050329_2345.tar.xz  webtools.sourceediting-20050329_2345.zip  nitind19 years
v20050329_2030webtools.sourceediting-20050329_2030.tar.gz  webtools.sourceediting-20050329_2030.tar.xz  webtools.sourceediting-20050329_2030.zip  nitind19 years
v20050329_1700webtools.sourceediting-20050329_1700.tar.gz  webtools.sourceediting-20050329_1700.tar.xz  webtools.sourceediting-20050329_1700.zip  nitind19 years
v20050329_1930webtools.sourceediting-20050329_1930.tar.gz  webtools.sourceediting-20050329_1930.tar.xz  webtools.sourceediting-20050329_1930.zip  nitind19 years
v20050329_1830webtools.sourceediting-20050329_1830.tar.gz  webtools.sourceediting-20050329_1830.tar.xz  webtools.sourceediting-20050329_1830.zip  nitind19 years
v20050329_1200webtools.sourceediting-20050329_1200.tar.gz  webtools.sourceediting-20050329_1200.tar.xz  webtools.sourceediting-20050329_1200.zip  nitind19 years
v20050325_1655webtools.sourceediting-20050325_1655.tar.gz  webtools.sourceediting-20050325_1655.tar.xz  webtools.sourceediting-20050325_1655.zip  nitind20 years
v20050323_1635webtools.sourceediting-20050323_1635.tar.gz  webtools.sourceediting-20050323_1635.tar.xz  webtools.sourceediting-20050323_1635.zip  nitind20 years
v20050323_0200webtools.sourceediting-20050323_0200.tar.gz  webtools.sourceediting-20050323_0200.tar.xz  webtools.sourceediting-20050323_0200.zip  nitind20 years
v20050322_0240webtools.sourceediting-20050322_0240.tar.gz  webtools.sourceediting-20050322_0240.tar.xz  webtools.sourceediting-20050322_0240.zip  nitind20 years
v20050322_0230webtools.sourceediting-20050322_0230.tar.gz  webtools.sourceediting-20050322_0230.tar.xz  webtools.sourceediting-20050322_0230.zip  nitind20 years
v20050321_1745webtools.sourceediting-20050321_1745.tar.gz  webtools.sourceediting-20050321_1745.tar.xz  webtools.sourceediting-20050321_1745.zip  nitind20 years
v20050321_1420webtools.sourceediting-20050321_1420.tar.gz  webtools.sourceediting-20050321_1420.tar.xz  webtools.sourceediting-20050321_1420.zip  nitind20 years
v20050320_1700webtools.sourceediting-20050320_1700.tar.gz  webtools.sourceediting-20050320_1700.tar.xz  webtools.sourceediting-20050320_1700.zip  nitind20 years
v20050318_2145webtools.sourceediting-20050318_2145.tar.gz  webtools.sourceediting-20050318_2145.tar.xz  webtools.sourceediting-20050318_2145.zip  nitind20 years
v20050318_1500webtools.sourceediting-20050318_1500.tar.gz  webtools.sourceediting-20050318_1500.tar.xz  webtools.sourceediting-20050318_1500.zip  nitind20 years
v20050316_1305webtools.sourceediting-20050316_1305.tar.gz  webtools.sourceediting-20050316_1305.tar.xz  webtools.sourceediting-20050316_1305.zip  nitind20 years
v20050315_1300webtools.sourceediting-20050315_1300.tar.gz  webtools.sourceediting-20050315_1300.tar.xz  webtools.sourceediting-20050315_1300.zip  nitind20 years
v20050315_0953webtools.sourceediting-20050315_0953.tar.gz  webtools.sourceediting-20050315_0953.tar.xz  webtools.sourceediting-20050315_0953.zip  nitind20 years
v20050315_0145webtools.sourceediting-20050315_0145.tar.gz  webtools.sourceediting-20050315_0145.tar.xz  webtools.sourceediting-20050315_0145.zip  nitind20 years
v20050314_2140webtools.sourceediting-20050314_2140.tar.gz  webtools.sourceediting-20050314_2140.tar.xz  webtools.sourceediting-20050314_2140.zip  nitind20 years
v20050314_1815webtools.sourceediting-20050314_1815.tar.gz  webtools.sourceediting-20050314_1815.tar.xz  webtools.sourceediting-20050314_1815.zip  nitind20 years
v20050314_1803webtools.sourceediting-20050314_1803.tar.gz  webtools.sourceediting-20050314_1803.tar.xz  webtools.sourceediting-20050314_1803.zip  nitind20 years
v20050314_1735webtools.sourceediting-20050314_1735.tar.gz  webtools.sourceediting-20050314_1735.tar.xz  webtools.sourceediting-20050314_1735.zip  nitind20 years
v20050314_1230webtools.sourceediting-20050314_1230.tar.gz  webtools.sourceediting-20050314_1230.tar.xz  webtools.sourceediting-20050314_1230.zip  nitind20 years
Root_SSETempBranch_20050313webtools.sourceediting-Root_SSETempBranch_20050313.tar.gz  webtools.sourceediting-Root_SSETempBranch_20050313.tar.xz  webtools.sourceediting-Root_SSETempBranch_20050313.zip  nitind20 years
Root_SSETempBranchwebtools.sourceediting-Root_SSETempBranch.tar.gz  webtools.sourceediting-Root_SSETempBranch.tar.xz  webtools.sourceediting-Root_SSETempBranch.zip  nitind20 years
v20050307_2215webtools.sourceediting-20050307_2215.tar.gz  webtools.sourceediting-20050307_2215.tar.xz  webtools.sourceediting-20050307_2215.zip  nitind20 years
v20050225_1500webtools.sourceediting-20050225_1500.tar.gz  webtools.sourceediting-20050225_1500.tar.xz  webtools.sourceediting-20050225_1500.zip  nitind20 years
v20050223_1130webtools.sourceediting-20050223_1130.tar.gz  webtools.sourceediting-20050223_1130.tar.xz  webtools.sourceediting-20050223_1130.zip  nitind20 years
v20050223_1931webtools.sourceediting-20050223_1931.tar.gz  webtools.sourceediting-20050223_1931.tar.xz  webtools.sourceediting-20050223_1931.zip  nitind20 years
v20050223_1930webtools.sourceediting-20050223_1930.tar.gz  webtools.sourceediting-20050223_1930.tar.xz  webtools.sourceediting-20050223_1930.zip  nitind20 years
v20050223_1700webtools.sourceediting-20050223_1700.tar.gz  webtools.sourceediting-20050223_1700.tar.xz  webtools.sourceediting-20050223_1700.zip  nitind20 years
v20050223_1620webtools.sourceediting-20050223_1620.tar.gz  webtools.sourceediting-20050223_1620.tar.xz  webtools.sourceediting-20050223_1620.zip  nitind20 years
v20050223_1330webtools.sourceediting-20050223_1330.tar.gz  webtools.sourceediting-20050223_1330.tar.xz  webtools.sourceediting-20050223_1330.zip  nitind20 years
v20050223_1145webtools.sourceediting-20050223_1145.tar.gz  webtools.sourceediting-20050223_1145.tar.xz  webtools.sourceediting-20050223_1145.zip  nitind20 years
v20050223_0955webtools.sourceediting-20050223_0955.tar.gz  webtools.sourceediting-20050223_0955.tar.xz  webtools.sourceediting-20050223_0955.zip  nitind20 years
v20050222_2252webtools.sourceediting-20050222_2252.tar.gz  webtools.sourceediting-20050222_2252.tar.xz  webtools.sourceediting-20050222_2252.zip  nitind20 years
v20050222_1545webtools.sourceediting-20050222_1545.tar.gz  webtools.sourceediting-20050222_1545.tar.xz  webtools.sourceediting-20050222_1545.zip  nitind20 years
v20050222webtools.sourceediting-20050222.tar.gz  webtools.sourceediting-20050222.tar.xz  webtools.sourceediting-20050222.zip  nitind20 years
v20050221_1845webtools.sourceediting-20050221_1845.tar.gz  webtools.sourceediting-20050221_1845.tar.xz  webtools.sourceediting-20050221_1845.zip  nitind20 years
v20050219_1230webtools.sourceediting-20050219_1230.tar.gz  webtools.sourceediting-20050219_1230.tar.xz  webtools.sourceediting-20050219_1230.zip  nitind20 years
v20050222_1700webtools.sourceediting-20050222_1700.tar.gz  webtools.sourceediting-20050222_1700.tar.xz  webtools.sourceediting-20050222_1700.zip  nitind20 years
v20050218_1605webtools.sourceediting-20050218_1605.tar.gz  webtools.sourceediting-20050218_1605.tar.xz  webtools.sourceediting-20050218_1605.zip  nitind20 years
v20050218_0200webtools.sourceediting-20050218_0200.tar.gz  webtools.sourceediting-20050218_0200.tar.xz  webtools.sourceediting-20050218_0200.zip  nitind20 years
v20050218_0015webtools.sourceediting-20050218_0015.tar.gz  webtools.sourceediting-20050218_0015.tar.xz  webtools.sourceediting-20050218_0015.zip  nitind20 years
v20050218_0010webtools.sourceediting-20050218_0010.tar.gz  webtools.sourceediting-20050218_0010.tar.xz  webtools.sourceediting-20050218_0010.zip  nitind20 years
v20050217_1930webtools.sourceediting-20050217_1930.tar.gz  webtools.sourceediting-20050217_1930.tar.xz  webtools.sourceediting-20050217_1930.zip  nitind20 years
v20050217_2200webtools.sourceediting-20050217_2200.tar.gz  webtools.sourceediting-20050217_2200.tar.xz  webtools.sourceediting-20050217_2200.zip  nitind20 years
v20050217_1915webtools.sourceediting-20050217_1915.tar.gz  webtools.sourceediting-20050217_1915.tar.xz  webtools.sourceediting-20050217_1915.zip  nitind20 years
v20050217_1503webtools.sourceediting-20050217_1503.tar.gz  webtools.sourceediting-20050217_1503.tar.xz  webtools.sourceediting-20050217_1503.zip  nitind20 years
v20050217_1900webtools.sourceediting-20050217_1900.tar.gz  webtools.sourceediting-20050217_1900.tar.xz  webtools.sourceediting-20050217_1900.zip  nitind20 years
v20050216_2000webtools.sourceediting-20050216_2000.tar.gz  webtools.sourceediting-20050216_2000.tar.xz  webtools.sourceediting-20050216_2000.zip  nitind20 years
v20050216_1915webtools.sourceediting-20050216_1915.tar.gz  webtools.sourceediting-20050216_1915.tar.xz  webtools.sourceediting-20050216_1915.zip  nitind20 years
v20050216_1530webtools.sourceediting-20050216_1530.tar.gz  webtools.sourceediting-20050216_1530.tar.xz  webtools.sourceediting-20050216_1530.zip  nitind20 years
v20050215_1740webtools.sourceediting-20050215_1740.tar.gz  webtools.sourceediting-20050215_1740.tar.xz  webtools.sourceediting-20050215_1740.zip  nitind20 years
v20050210webtools.sourceediting-20050210.tar.gz  webtools.sourceediting-20050210.tar.xz  webtools.sourceediting-20050210.zip  nitind20 years
v20050209_2350webtools.sourceediting-20050209_2350.tar.gz  webtools.sourceediting-20050209_2350.tar.xz  webtools.sourceediting-20050209_2350.zip  nitind20 years
v20050209_1945webtools.sourceediting-20050209_1945.tar.gz  webtools.sourceediting-20050209_1945.tar.xz  webtools.sourceediting-20050209_1945.zip  nitind20 years
v20050203_2000webtools.sourceediting-20050203_2000.tar.gz  webtools.sourceediting-20050203_2000.tar.xz  webtools.sourceediting-20050203_2000.zip  nitind20 years
I20050210webtools.sourceediting-I20050210.tar.gz  webtools.sourceediting-I20050210.tar.xz  webtools.sourceediting-I20050210.zip  nitind20 years
v20050203_0915webtools.sourceediting-20050203_0915.tar.gz  webtools.sourceediting-20050203_0915.tar.xz  webtools.sourceediting-20050203_0915.zip  nitind20 years
v20050203_0020webtools.sourceediting-20050203_0020.tar.gz  webtools.sourceediting-20050203_0020.tar.xz  webtools.sourceediting-20050203_0020.zip  nitind20 years
v20050202_1155webtools.sourceediting-20050202_1155.tar.gz  webtools.sourceediting-20050202_1155.tar.xz  webtools.sourceediting-20050202_1155.zip  nitind20 years
v20050202_0140webtools.sourceediting-20050202_0140.tar.gz  webtools.sourceediting-20050202_0140.tar.xz  webtools.sourceediting-20050202_0140.zip  nitind20 years
v20050127_0155webtools.sourceediting-20050127_0155.tar.gz  webtools.sourceediting-20050127_0155.tar.xz  webtools.sourceediting-20050127_0155.zip  nitind20 years
v20050124_2315webtools.sourceediting-20050124_2315.tar.gz  webtools.sourceediting-20050124_2315.tar.xz  webtools.sourceediting-20050124_2315.zip  nitind20 years
v20050120_1820webtools.sourceediting-20050120_1820.tar.gz  webtools.sourceediting-20050120_1820.tar.xz  webtools.sourceediting-20050120_1820.zip  nitind20 years
v20050119_2240webtools.sourceediting-20050119_2240.tar.gz  webtools.sourceediting-20050119_2240.tar.xz  webtools.sourceediting-20050119_2240.zip  nitind20 years
v20050119_0900webtools.sourceediting-20050119_0900.tar.gz  webtools.sourceediting-20050119_0900.tar.xz  webtools.sourceediting-20050119_0900.zip  nitind20 years
v20050112_1640webtools.sourceediting-20050112_1640.tar.gz  webtools.sourceediting-20050112_1640.tar.xz  webtools.sourceediting-20050112_1640.zip  nitind20 years
v20050112_1017webtools.sourceediting-20050112_1017.tar.gz  webtools.sourceediting-20050112_1017.tar.xz  webtools.sourceediting-20050112_1017.zip  nitind20 years
v20050106_1045webtools.sourceediting-20050106_1045.tar.gz  webtools.sourceediting-20050106_1045.tar.xz  webtools.sourceediting-20050106_1045.zip  nitind20 years
v20050105_0005webtools.sourceediting-20050105_0005.tar.gz  webtools.sourceediting-20050105_0005.tar.xz  webtools.sourceediting-20050105_0005.zip  nitind20 years
v20041230_0620webtools.sourceediting-20041230_0620.tar.gz  webtools.sourceediting-20041230_0620.tar.xz  webtools.sourceediting-20041230_0620.zip  nitind20 years
v20041230_0535webtools.sourceediting-20041230_0535.tar.gz  webtools.sourceediting-20041230_0535.tar.xz  webtools.sourceediting-20041230_0535.zip  nitind20 years
v20041229_1850webtools.sourceediting-20041229_1850.tar.gz  webtools.sourceediting-20041229_1850.tar.xz  webtools.sourceediting-20041229_1850.zip  nitind20 years
v20041222_1230webtools.sourceediting-20041222_1230.tar.gz  webtools.sourceediting-20041222_1230.tar.xz  webtools.sourceediting-20041222_1230.zip  nitind20 years
v20041222_0209webtools.sourceediting-20041222_0209.tar.gz  webtools.sourceediting-20041222_0209.tar.xz  webtools.sourceediting-20041222_0209.zip  nitind20 years
v20041221_2345webtools.sourceediting-20041221_2345.tar.gz  webtools.sourceediting-20041221_2345.tar.xz  webtools.sourceediting-20041221_2345.zip  nitind20 years
v20041221_1842webtools.sourceediting-20041221_1842.tar.gz  webtools.sourceediting-20041221_1842.tar.xz  webtools.sourceediting-20041221_1842.zip  nitind20 years
v20041221_1609webtools.sourceediting-20041221_1609.tar.gz  webtools.sourceediting-20041221_1609.tar.xz  webtools.sourceediting-20041221_1609.zip  nitind20 years
v20041221_1510webtools.sourceediting-20041221_1510.tar.gz  webtools.sourceediting-20041221_1510.tar.xz  webtools.sourceediting-20041221_1510.zip  nitind20 years
v20041220_2102webtools.sourceediting-20041220_2102.tar.gz  webtools.sourceediting-20041220_2102.tar.xz  webtools.sourceediting-20041220_2102.zip  nitind20 years
v20041217_0700webtools.sourceediting-20041217_0700.tar.gz  webtools.sourceediting-20041217_0700.tar.xz  webtools.sourceediting-20041217_0700.zip  nitind20 years
v20041217_0640webtools.sourceediting-20041217_0640.tar.gz  webtools.sourceediting-20041217_0640.tar.xz  webtools.sourceediting-20041217_0640.zip  nitind20 years
v20041216_1940webtools.sourceediting-20041216_1940.tar.gz  webtools.sourceediting-20041216_1940.tar.xz  webtools.sourceediting-20041216_1940.zip  nitind20 years
v20041216_0750webtools.sourceediting-20041216_0750.tar.gz  webtools.sourceediting-20041216_0750.tar.xz  webtools.sourceediting-20041216_0750.zip  nitind20 years
v20041216_0740webtools.sourceediting-20041216_0740.tar.gz  webtools.sourceediting-20041216_0740.tar.xz  webtools.sourceediting-20041216_0740.zip  nitind20 years
v20041216_0600webtools.sourceediting-20041216_0600.tar.gz  webtools.sourceediting-20041216_0600.tar.xz  webtools.sourceediting-20041216_0600.zip  nitind20 years
v20041215_2350webtools.sourceediting-20041215_2350.tar.gz  webtools.sourceediting-20041215_2350.tar.xz  webtools.sourceediting-20041215_2350.zip  nitind20 years
v20041214webtools.sourceediting-20041214.tar.gz  webtools.sourceediting-20041214.tar.xz  webtools.sourceediting-20041214.zip  nitind20 years
v20041216_0005webtools.sourceediting-20041216_0005.tar.gz  webtools.sourceediting-20041216_0005.tar.xz  webtools.sourceediting-20041216_0005.zip  nitind20 years
v20041213_1535webtools.sourceediting-20041213_1535.tar.gz  webtools.sourceediting-20041213_1535.tar.xz  webtools.sourceediting-20041213_1535.zip  nitind20 years
v20041213_1420webtools.sourceediting-20041213_1420.tar.gz  webtools.sourceediting-20041213_1420.tar.xz  webtools.sourceediting-20041213_1420.zip  nitind20 years
v20041213_1410webtools.sourceediting-20041213_1410.tar.gz  webtools.sourceediting-20041213_1410.tar.xz  webtools.sourceediting-20041213_1410.zip  nitind20 years
v20041213_0022webtools.sourceediting-20041213_0022.tar.gz  webtools.sourceediting-20041213_0022.tar.xz  webtools.sourceediting-20041213_0022.zip  nitind20 years
v20041212_2150webtools.sourceediting-20041212_2150.tar.gz  webtools.sourceediting-20041212_2150.tar.xz  webtools.sourceediting-20041212_2150.zip  nitind20 years
v20041212_2215webtools.sourceediting-20041212_2215.tar.gz  webtools.sourceediting-20041212_2215.tar.xz  webtools.sourceediting-20041212_2215.zip  nitind20 years
v20041212_1430webtools.sourceediting-20041212_1430.tar.gz  webtools.sourceediting-20041212_1430.tar.xz  webtools.sourceediting-20041212_1430.zip  nitind20 years
v20041210_1825webtools.sourceediting-20041210_1825.tar.gz  webtools.sourceediting-20041210_1825.tar.xz  webtools.sourceediting-20041210_1825.zip  nitind20 years
v20041210_0400webtools.sourceediting-20041210_0400.tar.gz  webtools.sourceediting-20041210_0400.tar.xz  webtools.sourceediting-20041210_0400.zip  nitind20 years
v20041210_0220webtools.sourceediting-20041210_0220.tar.gz  webtools.sourceediting-20041210_0220.tar.xz  webtools.sourceediting-20041210_0220.zip  nitind20 years
v20041209webtools.sourceediting-20041209.tar.gz  webtools.sourceediting-20041209.tar.xz  webtools.sourceediting-20041209.zip  nitind20 years
v20041209_0040webtools.sourceediting-20041209_0040.tar.gz  webtools.sourceediting-20041209_0040.tar.xz  webtools.sourceediting-20041209_0040.zip  nitind20 years
v20041209_0030webtools.sourceediting-20041209_0030.tar.gz  webtools.sourceediting-20041209_0030.tar.xz  webtools.sourceediting-20041209_0030.zip  nitind20 years
v20041209_0015webtools.sourceediting-20041209_0015.tar.gz  webtools.sourceediting-20041209_0015.tar.xz  webtools.sourceediting-20041209_0015.zip  nitind20 years
v20041208_1840webtools.sourceediting-20041208_1840.tar.gz  webtools.sourceediting-20041208_1840.tar.xz  webtools.sourceediting-20041208_1840.zip  nitind20 years
v20041207_2300webtools.sourceediting-20041207_2300.tar.gz  webtools.sourceediting-20041207_2300.tar.xz  webtools.sourceediting-20041207_2300.zip  nitind20 years
v20041207_1525webtools.sourceediting-20041207_1525.tar.gz  webtools.sourceediting-20041207_1525.tar.xz  webtools.sourceediting-20041207_1525.zip  nitind20 years
v20041207_0234webtools.sourceediting-20041207_0234.tar.gz  webtools.sourceediting-20041207_0234.tar.xz  webtools.sourceediting-20041207_0234.zip  nitind20 years
v20041207_0230webtools.sourceediting-20041207_0230.tar.gz  webtools.sourceediting-20041207_0230.tar.xz  webtools.sourceediting-20041207_0230.zip  nitind20 years
v20041130_2230webtools.sourceediting-20041130_2230.tar.gz  webtools.sourceediting-20041130_2230.tar.xz  webtools.sourceediting-20041130_2230.zip  nitind20 years
v20041125webtools.sourceediting-20041125.tar.gz  webtools.sourceediting-20041125.tar.xz  webtools.sourceediting-20041125.zip  nitind20 years
v20041124_2115webtools.sourceediting-20041124_2115.tar.gz  webtools.sourceediting-20041124_2115.tar.xz  webtools.sourceediting-20041124_2115.zip  nitind20 years
v20041124webtools.sourceediting-20041124.tar.gz  webtools.sourceediting-20041124.tar.xz  webtools.sourceediting-20041124.zip  nitind20 years
v20041124_1315webtools.sourceediting-20041124_1315.tar.gz  webtools.sourceediting-20041124_1315.tar.xz  webtools.sourceediting-20041124_1315.zip  nitind20 years
v20041123_2330webtools.sourceediting-20041123_2330.tar.gz  webtools.sourceediting-20041123_2330.tar.xz  webtools.sourceediting-20041123_2330.zip  nitind20 years
v20041123_2226webtools.sourceediting-20041123_2226.tar.gz  webtools.sourceediting-20041123_2226.tar.xz  webtools.sourceediting-20041123_2226.zip  nitind20 years
v20041123_2342webtools.sourceediting-20041123_2342.tar.gz  webtools.sourceediting-20041123_2342.tar.xz  webtools.sourceediting-20041123_2342.zip  nitind20 years
v20041123webtools.sourceediting-20041123.tar.gz  webtools.sourceediting-20041123.tar.xz  webtools.sourceediting-20041123.zip  nitind20 years
v20041121_0020webtools.sourceediting-20041121_0020.tar.gz  webtools.sourceediting-20041121_0020.tar.xz  webtools.sourceediting-20041121_0020.zip  nitind20 years
v20041120_1300webtools.sourceediting-20041120_1300.tar.gz  webtools.sourceediting-20041120_1300.tar.xz  webtools.sourceediting-20041120_1300.zip  nitind20 years
v20041120_1320webtools.sourceediting-20041120_1320.tar.gz  webtools.sourceediting-20041120_1320.tar.xz  webtools.sourceediting-20041120_1320.zip  nitind20 years
v20041119_2340webtools.sourceediting-20041119_2340.tar.gz  webtools.sourceediting-20041119_2340.tar.xz  webtools.sourceediting-20041119_2340.zip  nitind20 years
v20041119_2315webtools.sourceediting-20041119_2315.tar.gz  webtools.sourceediting-20041119_2315.tar.xz  webtools.sourceediting-20041119_2315.zip  nitind20 years
v20041119webtools.sourceediting-20041119.tar.gz  webtools.sourceediting-20041119.tar.xz  webtools.sourceediting-20041119.zip  nitind20 years
v20041118_1805webtools.sourceediting-20041118_1805.tar.gz  webtools.sourceediting-20041118_1805.tar.xz  webtools.sourceediting-20041118_1805.zip  nitind20 years
v20041117_1740webtools.sourceediting-20041117_1740.tar.gz  webtools.sourceediting-20041117_1740.tar.xz  webtools.sourceediting-20041117_1740.zip  nitind20 years
v20041117webtools.sourceediting-20041117.tar.gz  webtools.sourceediting-20041117.tar.xz  webtools.sourceediting-20041117.zip  csalter20 years
v20041112webtools.sourceediting-20041112.tar.gz  webtools.sourceediting-20041112.tar.xz  webtools.sourceediting-20041112.zip  david_williams20 years
v20041014webtools.sourceediting-20041014.tar.gz  webtools.sourceediting-20041014.tar.xz  webtools.sourceediting-20041014.zip  bfreeman20 years

Back to the top

div class='del'>- " void fooMemberMember() {\n" +
- " MemberOfCUMA m = \n" +
- " new MemberOfCUMA(); \n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " Membe }\n" +
- " void foobar() {\n" +
- " new Member().}\n" +
- " class Member2 {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- "}\n";
-
- String testName = "<complete on object creation type>";
- String completeBehind = "MemberOfCU";
- String expectedCompletionNodeToString = "<CompleteOnType:MemberOfCU>";
- String completionIdentifier = "MemberOfCU";
- String expectedReplacedSource = "MemberOfCUMA";
- int cursorLocation = str.indexOf("MemberOfCUMA();") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MA {\n" +
- " class Member extends java.util.Vector {\n" +
- " class MemberMember {\n" +
- " MemberMember() {\n" +
- " }\n" +
- " void fooMemberMember() {\n" +
- " MemberOfCUMA m = new <CompleteOnType:MemberOfCU>();\n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " MemberMember2() {\n" +
- " }\n" +
- " }\n" +
- " Member() {\n" +
- " }\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " public MA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void foobar() {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- " MemberOfCUMA() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMA_3() {
- String str =
- "package p; \n" +
- "public class MA {\n" +
- " class Member\n" +
- " extends java.util.Vector {\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " class MemberMember {\n" +
- " void fooMemberMember() {\n" +
- " MemberOfCUMA m = \n" +
- " new MemberOfCUMA(); \n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " Membe }\n" +
- " void foobar() {\n" +
- " new Member().}\n" +
- " class Member2 {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new Member().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Member().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MA {\n" +
- " class Member extends java.util.Vector {\n" +
- " class MemberMember {\n" +
- " MemberMember() {\n" +
- " }\n" +
- " void fooMemberMember() {\n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " MemberMember2() {\n" +
- " }\n" +
- " }\n" +
- " Member() {\n" +
- " }\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " public MA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void foobar() {\n" +
- " <CompleteOnMemberAccess:new Member().>;\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- " MemberOfCUMA() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMB_1FHSLMQ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLMQ\n" +
- " */\n" +
- "public class MB {\n" +
- " void foo() {\n" +
- " try {\n" +
- " System.out.println(\"\");\n" +
- " } catch (Exception eFirst) {\n" +
- " e } catch (Exception eSecond) {\n" +
- " e }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable name into catch block>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MB {\n" +
- " public MB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception eFirst;\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMB_1FHSLMQ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLMQ\n" +
- " */\n" +
- "public class MB {\n" +
- " void foo() {\n" +
- " try {\n" +
- " System.out.println(\"\");\n" +
- " } catch (Exeption eFirst) {\n" +
- " e } catch (Exception eSecond) {\n" +
- " e }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable name into catch block>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MB {\n" +
- " public MB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception eSecond;\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMC_1FJ8D9Z() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ8D9Z\n" +
- " */\n" +
- "public class MC {\n" +
- " p2.X someField;\n" +
- " public void foo() {\n" +
- " new p2.X(\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on object creation argument>";
- String completeBehind = "new p2.X(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new p2.X()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MC {\n" +
- " p2.X someField;\n" +
- " public MC() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " <CompleteOnAllocationExpression:new p2.X()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testN() {
- String str =
- "package p; \n" +
- "public class N extends p.M {\n" +
- " void foo() {\n" +
- " class MLocal\n" +
- " extends Schmurz {\n" +
- " void foo() {\n" +
- " }\n" +
- " int field1;\n" +
- " class MLocalMember\n" +
- " extends myInnerC {\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " new M }\n" +
- " }\n" +
- " class MLocalMember2 {\n" +
- " void fooMyInnerC() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on object creation type>";
- String completeBehind = "new M";
- String expectedCompletionNodeToString = "<CompleteOnType:M>";
- String completionIdentifier = "M";
- String expectedReplacedSource = "M";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class N extends p.M {\n" +
- " public N() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class MLocal extends Schmurz {\n" +
- " class MLocalMember extends myInnerC {\n" +
- " MLocalMember() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " new <CompleteOnType:M>();\n" +
- " }\n" +
- " }\n" +
- " class MLocalMember2 {\n" +
- " MLocalMember2() {\n" +
- " }\n" +
- " void fooMyInnerC() {\n" +
- " }\n" +
- " }\n" +
- " int field1;\n" +
- " MLocal() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNA_1() {
- String str =
- "package p; \n" +
- "class NException2\n" +
- " extends NoClassDefFoundError {\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public DA foo() {\n" +
- " }\n" +
- " public int foufou;\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- "}\n" +
- "public class NA\n" +
- " extends NException2\n" +
- " implements N {\n" +
- " DA fieldB;\n" +
- " class freak {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " local.fieldC.foo();\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- String testName = "<complete on local variable name>";
- String completeBehind = "l";
- String expectedCompletionNodeToString = "<CompleteOnName:l>";
- String completionIdentifier = "l";
- String expectedReplacedSource = "local";
- int cursorLocation = str.indexOf("local.") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class NException2 extends NoClassDefFoundError {\n" +
- " NException2() {\n" +
- " }\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public int foufou;\n" +
- " DAB() {\n" +
- " }\n" +
- " public DA foo() {\n" +
- " }\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- " DANA() {\n" +
- " }\n" +
- "}\n" +
- "public class NA extends NException2 implements N {\n" +
- " class freak {\n" +
- " freak() {\n" +
- " }\n" +
- " }\n" +
- " DA fieldB;\n" +
- " public NA() {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " <CompleteOnName:l>;\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNA_2() {
- String str =
- "package p; \n" +
- "class NException2\n" +
- " extends NoClassDefFoundError {\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public DA foo() {\n" +
- " }\n" +
- " public int foufou;\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- "}\n" +
- "public class NA\n" +
- " extends NException2\n" +
- " implements N {\n" +
- " DA fieldB;\n" +
- " class freak {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " local.fieldC.foo();\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable>";
- String completeBehind = "local.f";
- String expectedCompletionNodeToString = "<CompleteOnName:local.f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "local.fieldC";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class NException2 extends NoClassDefFoundError {\n" +
- " NException2() {\n" +
- " }\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public int foufou;\n" +
- " DAB() {\n" +
- " }\n" +
- " public DA foo() {\n" +
- " }\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- " DANA() {\n" +
- " }\n" +
- "}\n" +
- "public class NA extends NException2 implements N {\n" +
- " class freak {\n" +
- " freak() {\n" +
- " }\n" +
- " }\n" +
- " DA fieldB;\n" +
- " public NA() {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " <CompleteOnName:local.f>;\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNA_3() {
- String str =
- "package p; \n" +
- "class NException2\n" +
- " extends NoClassDefFoundError {\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public DA foo() {\n" +
- " }\n" +
- " public int foufou;\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- "}\n" +
- "public class NA\n" +
- " extends NException2\n" +
- " implements N {\n" +
- " DA fieldB;\n" +
- " class freak {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " local.fieldC.foo();\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable>";
- String completeBehind = "local.fieldC.";
- String expectedCompletionNodeToString = "<CompleteOnName:local.fieldC.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "local.fieldC.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class NException2 extends NoClassDefFoundError {\n" +
- " NException2() {\n" +
- " }\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public int foufou;\n" +
- " DAB() {\n" +
- " }\n" +
- " public DA foo() {\n" +
- " }\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- " DANA() {\n" +
- " }\n" +
- "}\n" +
- "public class NA extends NException2 implements N {\n" +
- " class freak {\n" +
- " freak() {\n" +
- " }\n" +
- " }\n" +
- " DA fieldB;\n" +
- " public NA() {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " <CompleteOnName:local.fieldC.>;\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNB() {
- String str =
- "package p; \n" +
- "public class NB {\n" +
- " void foo() {\n" +
- " int iOutside;\n" +
- " if (i != 0) {\n" +
- " for (int i = 10; --i >= 0;)\n" +
- " unit[i].parseMethod(\n" +
- " parser, \n" +
- " unit); \n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on variable name into for statement>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = "<CompleteOnName:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "i";
- int cursorLocation = str.indexOf("i >=") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class NB {\n" +
- " public NB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int iOutside;\n" +
- " {\n" +
- " int i;\n" +
- " -- <CompleteOnName:i>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNC_1FJ8D9Z() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ8D9Z\n" +
- " */\n" +
- "public class NC {\n" +
- " String s = new String(\n";
-
- String testName = "<complete on field intializer into corrupted class declaration>";
- String completeBehind = "new String(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new String()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class NC {\n" +
- " String s = <CompleteOnAllocationExpression:new String()>;\n" +
- " public NC() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testO_1FG1YU0() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YU0\n" +
- " */\n" +
- "public class O\n" +
- " extends java.util.Vector {\n" +
- " void bar(boolean bbbb) {\n" +
- " this.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicit this>";
- String completeBehind = "this.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "this.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class O extends java.util.Vector {\n" +
- " public O() {\n" +
- " }\n" +
- " void bar(boolean bbbb) {\n" +
- " <CompleteOnMemberAccess:this.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOA_1() {
- String str =
- "package p; \n" +
- "public class OA {\n" +
- " void proc() {\n" +
- " int[] a = new int[10];\n" +
- " Object b = a;\n" +
- " Class c = a.getClass();\n" +
- " String s = a.toString();\n" +
- " boolean l = a.equals(b);\n" +
- " int h = a.hashCode();\n" +
- " try {\n" +
- " a.wait();\n" +
- " a.wait(3);\n" +
- " a.wait(4, 5);\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " a.notify();\n" +
- " a.notifyAll();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "a.n";
- String expectedCompletionNodeToString = "<CompleteOnName:a.n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "a.notify";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OA {\n" +
- " public OA() {\n" +
- " }\n" +
- " void proc() {\n" +
- " int[] a;\n" +
- " Object b;\n" +
- " Class c;\n" +
- " String s;\n" +
- " boolean l;\n" +
- " int h;\n" +
- " <CompleteOnName:a.n>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOA_2() {
- String str =
- "package p; \n" +
- "public class OA {\n" +
- " void proc() {\n" +
- " int[] a = new int[10];\n" +
- " Object b = a;\n" +
- " Class c = a.getClass();\n" +
- " String s = a.toString();\n" +
- " boolean l = a.equals(b);\n" +
- " int h = a.hashCode();\n" +
- " try {\n" +
- " a.wait();\n" +
- " a.wait(3);\n" +
- " a.wait(4, 5);\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " a.notify();\n" +
- " a.notifyAll();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "a.w";
- String expectedCompletionNodeToString = "<CompleteOnName:a.w>";
- String completionIdentifier = "w";
- String expectedReplacedSource = "a.wait";
- int cursorLocation = str.indexOf("a.wait(4, 5)") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OA {\n" +
- " public OA() {\n" +
- " }\n" +
- " void proc() {\n" +
- " int[] a;\n" +
- " Object b;\n" +
- " Class c;\n" +
- " String s;\n" +
- " boolean l;\n" +
- " int h;\n" +
- " {\n" +
- " <CompleteOnName:a.w>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOB_1() {
- String str =
- "package p; \n" +
- "public class OB {\n" +
- " void foo() {\n" +
- " label : while (true) {\n" +
- " System.out.println(\"\");\n" +
- " break label;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on keyword>";
- String completeBehind = "b";
- String expectedCompletionNodeToString = "<CompleteOnName:b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "break";
- int cursorLocation = str.indexOf("break") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OB {\n" +
- " public OB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:b>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOB_2() {
- String str =
- "package p; \n" +
- "public class OB {\n" +
- " void foo() {\n" +
- " label : while (true) {\n" +
- " System.out.println(\"\");\n" +
- " break label;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on label name>";
- String completeBehind = "l";
- String expectedCompletionNodeToString = "<CompleteOnName:l>";
- String completionIdentifier = "l";
- String expectedReplacedSource = "label";
- int cursorLocation = str.indexOf("label") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OB {\n" +
- " public OB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:l>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOC_1FM7J7F() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FM7J7F\n" +
- " */\n" +
- "class OC {\n" +
- " String s = new String(\n" +
- "}\n";
-
- String testName = "<complete on field initializer>";
- String completeBehind = "new String(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new String()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class OC {\n" +
- " String s = <CompleteOnAllocationExpression:new String()>;\n" +
- " OC() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testP_1FG1YU0() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YU0\n" +
- " */\n" +
- "public class P {\n" +
- " {\n" +
- " void bar() {\n" +
- " f }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class P {\n" +
- " {\n" +
- " }\n" +
- " public P() {\n" +
- " }\n" +
- " void bar() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testPA_1() {
- String str =
- "package p; \n" +
- "class PAHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " static int i = 1;\n" +
- " int neuneu1() {\n" +
- " return 0;\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class PA\n" +
- " extends PAHelper {\n" +
- " void foo() {\n" +
- " B[] b = \n" +
- " new java.lang.Number[]; \n" +
- " java.lang.Short s;\n" +
- " // b[1].;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "b[1].";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testPA_2() {
- String str =
- "package p; \n" +
- "class PAHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " static int i = 1;\n" +
- " int neuneu1() {\n" +
- " return 0;\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class PA\n" +
- " extends PAHelper {\n" +
- " void foo() {\n" +
- " B[] b = \n" +
- " new java.lang.Number[]; \n" +
- " java.lang.Short s;\n" +
- " // b[1].;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on new keyword>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "new";
- int cursorLocation = str.indexOf("new ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class PAHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static int i;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " PAHelper() {\n" +
- " }\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " int neuneu1() {\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class PA extends PAHelper {\n" +
- " public PA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " B[] b = <CompleteOnName:n>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testPB() {
- String str =
- "package p; \n" +
- "public class PB {\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " void foo() {\n" +
- " }\n" +
- " class LocalMember1 {\n" +
- " void foo() {\n" +
- " class LocalMemberLocal {\n" +
- " void foo() {\n" +
- " f\n"+
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class LocalMember2 {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into nested local type>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class PB {\n" +
- " public PB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " class LocalMember1 {\n" +
- " LocalMember1() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class LocalMemberLocal {\n" +
- " LocalMemberLocal() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class LocalMember2 {\n" +
- " LocalMember2() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " Local() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testPC_1FSU4EF() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSU4EF\n" +
- " */\n" +
- "import java.util.Vector;\n" +
- "public class PC {\n" +
- " void foo() {\n" +
- " class Inner {\n" +
- " Vector v = new Vector();\n" +
- " void foo() {\n" +
- " Vector v = new Vector();\n" +
- " v.addElement();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into local type>";
- String completeBehind = "v.a";
- String expectedCompletionNodeToString = "<CompleteOnName:v.a>";
- String completionIdentifier = "a";
- String expectedReplacedSource = "v.addElement";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import java.util.Vector;\n" +
- "public class PC {\n" +
- " public PC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class Inner {\n" +
- " Vector v;\n" +
- " Inner() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Vector v;\n" +
- " <CompleteOnName:v.a>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQ_1FG1YU0() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YU0\n" +
- " */\n" +
- "public class Q {\n" +
- " void bar(boolean bbbb) {\n" +
- " this.}\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "this.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "this.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class Q {\n" +
- " public Q() {\n" +
- " }\n" +
- " void bar(boolean bbbb) {\n" +
- " <CompleteOnMemberAccess:this.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_1() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "new QAHelper().new Y().m";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QAHelper().new Y().m>";
- String completionIdentifier = "m";
- String expectedReplacedSource = "main";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " <CompleteOnMemberAccess:new QAHelper().new Y().m>;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_2() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new QAHelper().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QAHelper().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " <CompleteOnMemberAccess:new QAHelper().>;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_3() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new QAHelper().new Y().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QAHelper().new Y().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " <CompleteOnMemberAccess:new QAHelper().new Y().>;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_4() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new QA().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QA().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " <CompleteOnMemberAccess:new QA().>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQB_1FIK820() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FIK820\n" +
- " */\n" +
- "public class QB {\n" +
- " void foo() {\n" +
- " {\n" +
- " }\n" +
- " .}\n" +
- "}\n";
-
- String testName = "<complete on block (no answers wanted)>";
- String completeBehind = ".";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(".}") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class QB {\n" +
- " public QB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testR_1FGD31E() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGD31E\n" +
- " */\n" +
- "public class R {\n" +
- " void moo() {\n" +
- " b }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "b";
- String expectedCompletionNodeToString = "<CompleteOnName:b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "b";
- int cursorLocation = str.indexOf("b }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class R {\n" +
- " public R() {\n" +
- " }\n" +
- " void moo() {\n" +
- " <CompleteOnName:b>;\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRA_1() {
- String str =
- "package p; \n" +
- "public class RA extends A {\n" +
- " private int f = 5;\n" +
- " int i(int k) {\n" +
- " }\n" +
- " class B extends I {\n" +
- " void foo();\n" +
- " class C extends Z {\n" +
- " }\n" +
- " final int fo;\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- " static {\n" +
- " this.ff = 5;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on incorrect this call>";
- String completeBehind = "t";
- String expectedCompletionNodeToString = "<CompleteOnName:t>";
- String completionIdentifier = "t";
- String expectedReplacedSource = "this";
- int cursorLocation = str.indexOf("this.ff") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RA extends A {\n" +
- " class B extends I {\n" +
- " class C extends Z {\n" +
- " C() {\n" +
- " }\n" +
- " }\n" +
- " final int fo;\n" +
- " B() {\n" +
- " }\n" +
- " void foo();\n" +
- " }\n" +
- " private int f;\n" +
- " static {\n" +
- " <CompleteOnName:t>;\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public RA() {\n" +
- " }\n" +
- " int i(int k) {\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRA_2() {
- String str =
- "package p; \n" +
- "public class RA extends A {\n" +
- " private int f = 5;\n" +
- " int i(int k) {\n" +
- " }\n" +
- " class B extends I {\n" +
- " void foo();\n" +
- " class C extends Z {\n" +
- " }\n" +
- " final int fo;\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- " static {\n" +
- " this.ff = 5;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on t>";
- String completeBehind = "t";
- String expectedCompletionNodeToString = "<CompleteOnName:t>";
- String completionIdentifier = "t";
- String expectedReplacedSource = "this";
- int cursorLocation = str.indexOf("this") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RA extends A {\n" +
- " class B extends I {\n" +
- " class C extends Z {\n" +
- " C() {\n" +
- " }\n" +
- " }\n" +
- " final int fo;\n" +
- " B() {\n" +
- " }\n" +
- " void foo();\n" +
- " }\n" +
- " private int f;\n" +
- " static {\n" +
- " <CompleteOnName:t>;\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public RA() {\n" +
- " }\n" +
- " int i(int k) {\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRA_3() {
- String str =
- "package p; \n" +
- "public class RA extends A {\n" +
- " private int f = 5;\n" +
- " int i(int k) {\n" +
- " }\n" +
- " class B extends I {\n" +
- " void foo();\n" +
- " class C extends Z {\n" +
- " }\n" +
- " final int fo;\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- " static {\n" +
- " this.ff = 5;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on exception type>";
- String completeBehind = "Exc";
- String expectedCompletionNodeToString = "<CompleteOnException:Exc>";
- String completionIdentifier = "Exc";
- String expectedReplacedSource = "Exc";
- int cursorLocation = str.indexOf("Exc {") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RA extends A {\n" +
- " class B extends I {\n" +
- " class C extends Z {\n" +
- " C() {\n" +
- " }\n" +
- " }\n" +
- " final int fo;\n" +
- " B() {\n" +
- " }\n" +
- " void foo();\n" +
- " }\n" +
- " private int f;\n" +
- " static {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public RA() {\n" +
- " }\n" +
- " int i(int k) {\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, <CompleteOnException:Exc> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRB_1FI74S3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FI74S3\n" +
- " */\n" +
- "public class RB {\n" +
- " int[] table;\n" +
- " void foo() {\n" +
- " int x = table.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of arry>";
- String completeBehind = "table.";
- String expectedCompletionNodeToString = "<CompleteOnName:table.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "table.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RB {\n" +
- " int[] table;\n" +
- " public RB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = <CompleteOnName:table.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testS_1FGF64P_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class S {\n" +
- " {\n" +
- " new Y()..}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on incorrect call>";
- String completeBehind = "new Y()..";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class S {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- " }\n" +
- " public S() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testS_1FGF64P_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class S {\n" +
- " {\n" +
- " new Y()..}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new Y().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Y().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class S {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " <CompleteOnMemberAccess:new Y().>;\n" +
- " }\n" +
- " public S() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testS_1FGF64P_3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class S {\n" +
- " {\n" +
- " new Y()..}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on incorrect call>";
- String completeBehind = "new Y()..";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class S {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- " }\n" +
- " public S() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testSA() {
- String str =
- "package p; \n" +
- "public class SA {\n" +
- " public sy void foo() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method modifier>";
- String completeBehind = "sy";
- String expectedCompletionNodeToString = "<CompleteOnType:sy>";
- String completionIdentifier = "sy";
- String expectedReplacedSource = "sy";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class SA {\n" +
- " <CompleteOnType:sy>;\n" +
- " public SA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testSB_1FILFDG() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FILFDG\n" +
- " */\n" +
- "public class SB {\n" +
- " public void foo() {\n" +
- " String s = \"hello\n" +
- " int}\n" +
- "}\n";
-
- String testName = "<complete on field declaration type>";
- String completeBehind = "int";
- String expectedCompletionNodeToString = "<CompleteOnName:int>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class SB {\n" +
- " public SB() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " String s;\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testT_1FGF64P() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class T {\n" +
- " {\n" +
- " new Y().}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on object creation>";
- String completeBehind = "new Y().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Y().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class T {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " <CompleteOnMemberAccess:new Y().>;\n" +
- " }\n" +
- " public T() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTA_1FHISJJ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class TA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on array intializer value>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "null";
- int cursorLocation = str.indexOf("null, ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TA {\n" +
- " public TA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items = {<CompleteOnName:n>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTA_1FHISJJ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class TA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array intializer>";
- String completeBehind =
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TA {\n" +
- " public TA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items;\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTA_1FHISJJ_3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class TA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "items.";
- String expectedCompletionNodeToString = "<CompleteOnName:items.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "items.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TA {\n" +
- " public TA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items;\n" +
- " <CompleteOnName:items.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTB_1FHSLMQ() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLMQ\n" +
- " */\n" +
- "public class TB {\n" +
- " void foo() {\n" +
- " if (true)\n" +
- " System.out.println(\"\");\n" +
- " e }\n" +
- "}\n";
-
- String testName = "<complete on else keyword>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TB {\n" +
- " public TB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testU_1FGGUME() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGGUME\n" +
- " */\n" +
- "public class U {\n" +
- " public static final int Source = \n" +
- " 5; \n" +
- "}\n";
-
- String testName = "<complete on digit>";
- String completeBehind = "5";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_NUMBER);
- }
-}
-public void testUA_1FHISJJ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class UA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " new String[] {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on array initializer>";
- String completeBehind =
- "new String[] {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String[]{\"Mark unublishable\", null, \"Properties...\"}.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class UA {\n" +
- " public UA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items = <CompleteOnMemberAccess:new String[]{\"Mark unublishable\", null, \"Properties...\"}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testUA_1FHISJJ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class UA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " new String[] {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "items.";
- String expectedCompletionNodeToString = "<CompleteOnName:items.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "items.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class UA {\n" +
- " public UA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items;\n" +
- " <CompleteOnName:items.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testUB_1FSBZ02() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSBZ02\n" +
- " */\n" +
- "class UB {\n" +
- " void bar() {\n" +
- " }\n" +
- " class UBMember {\n" +
- " void bar2() {\n" +
- " }\n" +
- " void foo() {\n" +
- " b\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on keyword>";
- String completeBehind = "b";
- String expectedCompletionNodeToString = "<CompleteOnName:b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "b";
- int cursorLocation = str.indexOf("b\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class UB {\n" +
- " class UBMember {\n" +
- " UBMember() {\n" +
- " }\n" +
- " void bar2() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:b>;\n" +
- " }\n" +
- " }\n" +
- " UB() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testV_1FGGUOO_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGGUOO\n" +
- " */\n" +
- "public class V i java\n" +
- " .io\n" +
- " .Serializable {\n" +
- "}\n";
-
- String testName = "<complete on implements keyword>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "i";
- int cursorLocation = str.indexOf("i java") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class V extends <CompleteOnKeyword:i> {\n" +
- " {\n" +
- " }\n" +
- " public V() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testV_1FGGUOO_2() {
- String str =
- "package x.y.z; \n" +
- "/**\n" +
- " * 1FGGUOO\n" +
- " */\n" +
- "public class V implements java.io.Serializable {\n" +
- "}\n";
-
- String testName = "<complete on package>";
- String completeBehind = "y";
- String expectedCompletionNodeToString = "<CompleteOnPackage:x.y>";
- String completionIdentifier = "y";
- String expectedReplacedSource =
- "x.y.z";
- int cursorLocation = str.indexOf("y") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package <CompleteOnPackage:x.y>;\n" +
- "public class V implements java.io.Serializable {\n" +
- " public V() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVA_1FHISJJ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class VA {\n" +
- " void foo() {\n" +
- " Object item = new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " .;\n" +
- " item.}\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration>";
- String completeBehind =
- "new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " .";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VA {\n" +
- " public VA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object item = <CompleteOnMemberAccess:new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVA_1FHISJJ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class VA {\n" +
- " void foo() {\n" +
- " Object item = new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " .;\n" +
- " item.}\n" +
- "}\n";
-
- String testName = "<complete on local variable>";
- String completeBehind = "item.";
- String expectedCompletionNodeToString = "<CompleteOnName:item.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "item.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VA {\n" +
- " public VA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object item;\n" +
- " <CompleteOnName:item.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVB_1() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable name into anonymous declaration>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "v";
- int cursorLocation = str.indexOf("v }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111;\n" +
- " <CompleteOnName:v>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// TODO excluded test (completion on field access on anonymous inner class with syntax error)
-public void _testVB_2() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration>";
- String completeBehind =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- String expectedCompletionNodeToString =
- "<CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVB_3() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on constructor>";
- String completeBehind = "new java.io.File(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new java.io.File()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnAllocationExpression:new java.io.File()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// TODO excluded test (completion on field access on anonymous inner class with syntax error)
-public void _testVB_4() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration with dummy spaces>";
- String completeBehind =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .";
- String expectedCompletionNodeToString =
- "<CompleteOnName:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// TODO excluded test (completion on field access on anonymous inner class with syntax error)
-public void _testVB_5() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration with trailing semi-colon>";
- String completeBehind =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- String expectedCompletionNodeToString =
- "<CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testW_1FGGUS4() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGGUS4\n" +
- " */\n" +
- "public class W {\n" +
- " public static final int LA = \n" +
- " 1; \n" +
- " public static final int LAB = \n" +
- " 2; \n" +
- " public static final int LABO = \n" +
- " 4; \n" +
- " public int produceDebugAttributes = \n" +
- " LABO; \n" +
- "}\n";
-
- String testName = "<complete on field initializer>";
- String completeBehind = "L";
- String expectedCompletionNodeToString = "<CompleteOnName:L>";
- String completionIdentifier = "L";
- String expectedReplacedSource = "LABO";
- int cursorLocation = str.indexOf("LABO;") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class W {\n" +
- " public static final int LA;\n" +
- " public static final int LAB;\n" +
- " public static final int LABO;\n" +
- " public int produceDebugAttributes = <CompleteOnName:L>;\n" +
- " public W() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testWA_1() {
- String str =
- "package p; \n" +
- "public class WA {\n" +
- " void foo() {\n" +
- " int value = 10;\n" +
- " v int[] tab = new int[value];\n" +
- " }\n";
-
- String testName = "<complete on array size value>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "value";
- int cursorLocation = str.indexOf("value];") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class WA {\n" +
- " public WA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int value;\n" +
- " int[] tab = new int[<CompleteOnName:v>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testWA_2() {
- String str =
- "package p; \n" +
- "public class WA {\n" +
- " void foo() {\n" +
- " int value = 10;\n" +
- " v int[] tab = new int[value];\n" +
- " }\n";
-
- String testName = "<complete on corrupter local variable declaration>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "v";
- int cursorLocation = str.indexOf("v int[]") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class WA {\n" +
- " public WA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int value;\n" +
- " <CompleteOnName:v>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testWB_1FI313C() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FI313C\n" +
- " */\n" +
- "class WBHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " static int i = d;\n" +
- " int neuneu1() {\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class WB\n" +
- " extends WBHelper {\n" +
- " void foo() {\n" +
- " BIJOUR[] b = \n" +
- " new java.lang.Number[]; \n" +
- " java.lang.Short s;\n" +
- " b[1].}\n" +
- " B() {\n" +
- " }\n" +
- " B(int) {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array element>";
- String completeBehind = "b[1].";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:b[1].>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class WBHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static int i;\n" +
- " WBHelper() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " int neuneu1() {\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class WB extends WBHelper {\n" +
- " public WB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " BIJOUR[] b;\n" +
- " java.lang.Short s;\n" +
- " <CompleteOnMemberAccess:b[1].>;\n" +
- " }\n" +
- " B() {\n" +
- " }\n" +
- " B() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_1() {
- String str =
- "package p; \n" +
- "import p2.Y; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new Y[] {\n" +
- " new Y(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on argument of anonymous type declaration>";
- String completeBehind = "t";
- String expectedCompletionNodeToString = "<CompleteOnName:t>";
- String completionIdentifier = "t";
- String expectedReplacedSource = "this";
- int cursorLocation = str.indexOf("this, ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " new Y(\"debug.vars\", <CompleteOnName:t>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_2() {
- String str =
- "package p; \n" +
- "import p2.YZA; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new YZA[] {\n" +
- " new YZA(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration into a return statement>";
- String completeBehind = "Y";
- String expectedCompletionNodeToString = "<CompleteOnType:Y>";
- String completionIdentifier = "Y";
- String expectedReplacedSource = "YZA";
- int cursorLocation = str.indexOf("YZA[]") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.YZA;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " return new <CompleteOnType:Y>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_3() {
- String str =
- "package p; \n" +
- "import p2.YZA; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new YZA[] {\n" +
- " new YZA(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration nested into an array initializer>";
- String completeBehind = "Y";
- String expectedCompletionNodeToString = "<CompleteOnType:Y>";
- String completionIdentifier = "Y";
- String expectedReplacedSource = "YZA";
- int cursorLocation = str.indexOf("YZA(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.YZA;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " new YZA[]{new <CompleteOnType:Y>()};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_4() {
- String str =
- "package p; \n" +
- "import p2.Y; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new Y[] {\n" +
- " new Y(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into array intializer>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "new";
- int cursorLocation = str.indexOf("new Y(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " new Y[]{<CompleteOnName:n>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGPE8E() {
- String str =
- "package p; \n" +
- "import p2.Y; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new Y[] {\n" +
- " new Y(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into return statement>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "new";
- int cursorLocation = str.indexOf("new Y[]") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " return <CompleteOnName:n>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// Disabled since javadoc completion has been implemented
-public void _testXA_1FGGUQF_1FHSL8H_1() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */\n" +
- " foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "int.";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int.\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXA_1FGGUQF_1FHSL8H_2() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */\n" +
- " foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXA_1FGGUQF_1FHSL8H_3() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */ foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int */") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXA_1FGGUQF_1FHSL8H_4() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */ foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int */ foo()") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXB_1FIYM5I_1() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicit this access>";
- String completeBehind = "this.s";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.s>";
- String completionIdentifier = "s";
- String expectedReplacedSource = "this.separator";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.s>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testXB_1FIYM5I_2() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicitly accessed field>";
- String completeBehind = "this.separator.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.separator.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.separator.>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testXB_1FIYM5I_3() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicit this access>";
- String completeBehind = "this.b";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "this.bar";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.b>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testXB_1FIYM5I_4() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicitly accessed method>";
- String completeBehind = "this.bar().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.bar().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.bar().>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testY_1FGPESI() {
- String str =
- "package p; \n" +
- "import p2.; \n" +
- "/**\n" +
- " * 1FGPESI\n" +
- " */\n" +
- "public class Y {\n" +
- "}\n";
-
- String testName = "<complete on imports>";
- String completeBehind = "p2.";
- String expectedCompletionNodeToString = "<CompleteOnImport:p2.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "p2.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:p2.>;\n" +
- "public class Y {\n" +
- " public Y() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testYA_1FGRIUH() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGRIUH\n" +
- " */\n" +
- "public class YA\n" +
- " extends YASecondTopLevel {\n" +
- " void eFoo() {\n" +
- " }\n" +
- " class YAMember {\n" +
- " void eFoo() {\n" +
- " }\n" +
- " void eBar() {\n" +
- " e }\n" +
- " }\n" +
- "}\n" +
- "class YASecondTopLevel {\n" +
- " public boolean equals(YA yaya) {\n" +
- " return true;\n" +
- " }\n" +
- " public eFoo() {\n" +
- " }\n" +
- " public void eFooBar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class YA extends YASecondTopLevel {\n" +
- " class YAMember {\n" +
- " YAMember() {\n" +
- " }\n" +
- " void eFoo() {\n" +
- " }\n" +
- " void eBar() {\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- " public YA() {\n" +
- " }\n" +
- " void eFoo() {\n" +
- " }\n" +
- "}\n" +
- "class YASecondTopLevel {\n" +
- " YASecondTopLevel() {\n" +
- " }\n" +
- " public boolean equals(YA yaya) {\n" +
- " }\n" +
- " public eFoo() {\n" +
- " }\n" +
- " public void eFooBar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testYB_1FJ4D46_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ4D46\n" +
- " */\n" +
- "public class YB {\n" +
- " void foo() {\n" +
- " new String(\"asdf\".getBytes()).}\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new String(\"asdf\".getBytes()).";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String(\"asdf\".getBytes()).>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class YB {\n" +
- " public YB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new String(\"asdf\".getBytes()).>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZ_1FGPF3D_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGPF3D\n" +
- " */\n" +
- "public class Z imp Pro.Sev, \n" +
- " Bla.Blo {\n" +
- "}\n";
-
- String testName = "<complete on implements keyword>";
- String completeBehind = "imp";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:imp>";
- String completionIdentifier = "imp";
- String expectedReplacedSource = "imp";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class Z extends <CompleteOnKeyword:imp> {\n" +
- " {\n" +
- " }\n" +
- " public Z() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZ_1FGPF3D_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGPF3D\n" +
- " */\n" +
- "public class Z implements Pro.Sev, \n" +
- " Bla.Blo {\n" +
- "}\n";
-
- String testName = "<complete on implented interface>";
- String completeBehind = "P";
- String expectedCompletionNodeToString = "<CompleteOnInterface:P>";
- String completionIdentifier = "P";
- String expectedReplacedSource = "Pro";
- int cursorLocation = str.indexOf("Pro.Sev") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class Z implements <CompleteOnInterface:P>, Bla.Blo {\n" +
- " public Z() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZA_1() {
- String str =
- "package p; \n" +
- "import java.util.Vector;\n";
-
- String testName = "<complete on import keyword>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "import";
- int cursorLocation = str.indexOf("import") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:i>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZA_2() {
- String str =
- "package p; \n" +
- "import java.util.Vector;\n";
-
- String testName = "<complete on imported package>";
- String completeBehind = "jav";
- String expectedCompletionNodeToString = "<CompleteOnImport:jav>";
- String completionIdentifier = "jav";
- String expectedReplacedSource = "java.util.Vector";
- int cursorLocation = str.indexOf("java.util.Vector") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:jav>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZA_3() {
- String str =
- "package p; \n" +
- "import java.util.Vector;\n";
-
- String testName = "<complete on imported type>";
- String completeBehind = "java.util.V";
- String expectedCompletionNodeToString = "<CompleteOnImport:java.util.V>";
- String completionIdentifier = "V";
- String expectedReplacedSource = "java.util.Vector";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:java.util.V>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZB_1FJ4D46_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ4D46\n" +
- " */\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " File file = \n" +
- " new File(\"d:\\\\314\"); \n" +
- " CRC32 crc = new CRC32();\n" +
- " file.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable>";
- String completeBehind = "file.";
- String expectedCompletionNodeToString = "<CompleteOnName:file.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "file.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public ZB() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " File file;\n" +
- " CRC32 crc;\n" +
- " <CompleteOnName:file.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZB_1FJ4D46_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ4D46\n" +
- " */\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " File file = \n" +
- " new File(\"d:\\\\314\"); \n" +
- " CRC32 crc = new CRC32();\n" +
- " file.}\n" +
- "}\n";
-
- String testName = "<complete on local variable type>";
- String completeBehind = "CRC";
- String expectedCompletionNodeToString = "<CompleteOnName:CRC>";
- String completionIdentifier = "CRC";
- String expectedReplacedSource = "CRC32";
- int cursorLocation = str.indexOf("CRC32 crc") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public ZB() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " File file;\n" +
- " <CompleteOnName:CRC>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in initializer
- */
-public void test001(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int v1;\n" +
- " {\n" +
- " Obj\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete in initializer>";
- String completeBehind = "Obj";
- String expectedCompletionNodeToString = "<CompleteOnName:Obj>";
- String completionIdentifier = "Obj";
- String expectedReplacedSource = "Obj";
- int cursorLocation = str.indexOf("Obj") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int v1;\n" +
- " {\n" +
- " <CompleteOnName:Obj>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete after initializer
- */
-public void test002(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int v1;\n" +
- " {\n" +
- " int v2\n" +
- " }\n" +
- " Obj" +
- " }\n" +
- "}\n";
-
- String testName = "<complete after initializer>";
- String completeBehind = "Obj";
- String expectedCompletionNodeToString = "<CompleteOnName:Obj>";
- String completionIdentifier = "Obj";
- String expectedReplacedSource = "Obj";
- int cursorLocation = str.indexOf("Obj") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int v1;\n" +
- " <CompleteOnName:Obj>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in initializer
- */
-public void test003(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int v1;\n" +
- " {\n" +
- " this.\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete in initializer>";
- String completeBehind = "this.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "this.";
- int cursorLocation = str.indexOf("this.") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int v1;\n" +
- " {\n" +
- " <CompleteOnMemberAccess:this.>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-/**
- * Complete in switch
- */
-public void test004(){
- String str =
- "public class X {\n" +
- " final static int ZZZ = 1;\n"+
- " void foo(){\n" +
- " switch(2)\n" +
- " case 0 + ZZZ :\n" +
- " case 1 + ZZZ :\n" +
- " bar(ZZZ)\n" +
- " }\n" +
- " void bar(int y) {}\n"+
- "}\n";
-
- String testName = "<complete in switch>";
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompleteOnName:ZZZ>";
- String completionIdentifier = "ZZZ";
- String expectedReplacedSource = "ZZZ";
- int cursorLocation = str.lastIndexOf("ZZZ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " static final int ZZZ;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " bar(<CompleteOnName:ZZZ>);\n" +
- " }\n" +
- " void bar(int y) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in method type.
- */
-public void test005(){
- String str =
- "public class X {\n" +
- " clon foo(){\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete in method type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " <CompleteOnType:clon>\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in method type.
- */
-public void test006(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " foo();\n" +
- "}\n";
-
- String testName = "<complete in method type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- " foo();\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in field type.
- */
-public void test007(){
- String str =
- "public class X {\n" +
- " clon x;\n" +
- "}\n";
-
- String testName = "<complete in field type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in field type.
- */
-public void test008(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " x;\n" +
- "}\n";
-
- String testName = "<complete in field type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in field type.
- */
-public void test009(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " x y;\n" +
- "}\n";
-
- String testName = "<complete in field tpye>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " x y;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in method type.
- */
-public void test010(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " x y(){}\n" +
- "}\n";
-
- String testName = "<complete in method type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- " x y() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=25233
- */
-public void test011(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " new Object[]{\n" +
- " bar(zzz)\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 25233>";
- String completeBehind = "zzz";
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- int cursorLocation = str.lastIndexOf("zzz") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=27370
- */
-public void test012(){
- String str =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " Object o = new ZZZ\n" +
- "}\n";
-
- String testName = "<bug 27370>";
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompleteOnType:ZZZ>";
- String completionIdentifier = "ZZZ";
- String expectedReplacedSource = "ZZZ";
- int cursorLocation = str.lastIndexOf("ZZZ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " Object o = new <CompleteOnType:ZZZ>();\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=27735
- */
-public void test013(){
- String str =
- "public class Bar {\n" +
- " #\n" +
- " Bar foo1 = new Bar(){};\n" +
- " {int i;}\n" +
- " synchronized void foo3() {}\n" +
- " zzz\n" +
- "}\n";
-
- String testName = "<bug 27735>";
- String completeBehind = "zzz";
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- int cursorLocation = str.lastIndexOf("zzz") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " Bar foo1;\n" +
- " {\n" +
- " }\n" +
- " <CompleteOnType:zzz>;\n" +
- " public Bar() {\n" +
- " }\n" +
- " synchronized void foo3() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=27941
- */
-public void test014(){
- String str =
- "public class Bar {\n" +
- " void foo() {\n" +
- " String s = \"a\" + \"b\";\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 27941>";
- String completeBehind = "zzz";
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- int cursorLocation = str.lastIndexOf("zzz") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " public Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " String s;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=39502
- */
-public void test015(){
- String str =
- "public class Bar {\n" +
- " void foo() {\n" +
- " Object o = new Object[]{};\n" +
- " foo();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 39502>";
- String completeBehind = "foo(";
- String expectedCompletionNodeToString = "<CompleteOnMessageSend:foo()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "foo(";
- int cursorLocation = str.lastIndexOf("foo(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " public Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnMessageSend:foo()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=39502
- */
-public void test016(){
- String str =
- "public class Bar {\n" +
- " void foo() {\n" +
- " Object o = new Object[0];\n" +
- " foo();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 39502>";
- String completeBehind = "foo(";
- String expectedCompletionNodeToString = "<CompleteOnMessageSend:foo()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "foo(";
- int cursorLocation = str.lastIndexOf("foo(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " public Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnMessageSend:foo()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void test017(){
- String str =
- "public class Bar {\n" +
- " String s;\n" +
- " /**/\n" +
- "}\n";
-
- String testName = "";
- String completeBehind = "/**/";
- String expectedCompletionNodeToString = "<CompleteOnType:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.lastIndexOf("/**/") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " String s;\n" +
- " <CompleteOnType:>;\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void testRECOVERY001() {
- String str =
- "var foo;\n" +
- "if (f) {\n";
-
- String testName = "<complete on name inside if>";
- String completeBehind = "(f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "var foo;\n" +
- "if (<CompleteOnName:f>)\n" +
- "\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest2.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest2.java
deleted file mode 100644
index 866e47b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest2.java
+++ /dev/null
@@ -1,9671 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-public class CompletionParserTest2 extends AbstractCompletionTest {
-public CompletionParserTest2(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(CompletionParserTest2.class);
-}
-public void test0001(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0002(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0003(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0004(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0005(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0006(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0007(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0008(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0009(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0010(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0011(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0012(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0013(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0014(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0015(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0016(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0017(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0018(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0019(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = bar(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0020(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0021(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0022(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = bar(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0023(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0024(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0025(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0026(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0027(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0028(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new X(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0029(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0030(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0031(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0032(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0033(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0034(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0035(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0036(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0037(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0038(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0039(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0040(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0041(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0042(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0043(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-
-public void test0044(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-
-public void test0045(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-
-public void test0046(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-
-public void test0047(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-
-public void test0048(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0049(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0050(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0051(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0052(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0053(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0054(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0055(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0056(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0057(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0058(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0059(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0060(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0061(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0062(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0063(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0064(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0065(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0066(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0067(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0068(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0069(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0070(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0071(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0072(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0073(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0074(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0075(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0076(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " int o = new int[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0077(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0078(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0079(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0080(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0081(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o = new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0082(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " int o = new int[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0083(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0084(){
-
-
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0085(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " X o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0086(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " X o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0087(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0088(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " X o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0089(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0090(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0091(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0092(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0093(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0094(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0095(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0096(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0097(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "o = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0098(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "o = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0099(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0100(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0101(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0102(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0103(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0104(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0105(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 1 + zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (1 + <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0106(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 1 + (zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (1 + <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0107(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 0;\n" +
- " int y = 1 + x;\n" +
- " zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x;\n" +
- " int y;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0108(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = -zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (- <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0109(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = -(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (- <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0110(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 0;\n" +
- " int y = -x;\n" +
- " zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x;\n" +
- " int y;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0111(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " if(1 == zzz) {}\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (1 == <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0112(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " if(1 == (zzz)) {}\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (1 == <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0113(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(Object x){\n" +
- " if(x instanceof ZZZ) {}\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ZZZ";
- int cursorLocation = str.indexOf("ZZZ") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo(Object x) {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:ZZZ>";
- expectedParentNodeToString = "(x instanceof <CompleteOnType:ZZZ>)";
- completionIdentifier = "ZZZ";
- expectedReplacedSource = "ZZZ";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo(Object x) {\n" +
- " (x instanceof <CompleteOnType:ZZZ>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0114(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a == b ? zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "c = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " c = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0115(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b;\n" +
- " a == b ? zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0116(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a == b ? a : zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "c = ((a == b) ? a : <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " c = ((a == b) ? a : <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0117(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a == b ? a : (zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "c = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " c = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0118(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a# == b ? a : zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0119(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " switch(1) {\n" +
- " case zzz\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString =
- "switch (1) {\n" +
- "case <CompleteOnName:zzz> : ;\n" +
- "}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " switch (1) {\n" +
- " case <CompleteOnName:zzz> : ;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0120(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " switch(1) {\n" +
- " case Something :\n" +
- " case zzz\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString =
- "switch (1) {\n" +
- "case Something : ;\n" +
- "case <CompleteOnName:zzz> : ;\n" +
- "}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " switch (1) {\n" +
- " case Something : ;\n" +
- " case <CompleteOnName:zzz> : ;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0121(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " tab[zzz]\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "tab[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " tab[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0122(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " tab[].zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:tab[].zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "tab[].zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnClassLiteralAccess:tab[].zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0123(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " tab[0].zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnMemberAccess:tab[0].zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:tab[0].zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0124(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " foo()[zzz]\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "foo()[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " foo()[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0125(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " foo()[].zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0126(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " foo()[1].zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnMemberAccess:foo()[1].zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:foo()[1].zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0127(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " if (zzz() == null) bar = null;\n" +
- " }\n" +
- " Object o = new O();\n" +
- "}\n";
-
- String completeBehind = "O";
- int cursorLocation = str.lastIndexOf("O") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:O>";
- String expectedParentNodeToString = "Object o = new <CompleteOnType:O>();";
- String completionIdentifier = "O";
- String expectedReplacedSource = "O";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " Object o = new <CompleteOnType:O>();\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0128(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " a[zzz\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "a[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " a[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0129(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " Object local;\n" +
- " double bar;\n" +
- " for(;;) {\n" +
- " bar = (double)0;\n" +
- " }\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object local;\n" +
- " double bar;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
- */
-public void test0130(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " A.B c = null;\n" +
- " zzz();\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz(";
- int cursorLocation = str.indexOf("zzz(") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz()>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "zzz(";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " A.B c;\n" +
- " <CompleteOnMessageSend:zzz()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
- */
-public void test0131(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " try {\n" +
- " } catch(A.B e) {\n" +
- " zzz();\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz(";
- int cursorLocation = str.indexOf("zzz(") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz()>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "zzz(";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " A.B e;\n" +
- " <CompleteOnMessageSend:zzz()>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44647
- */
-public void test0132(){
- String str =
- "public class A\n" +
- "{\n" +
- " public A(final String str1, final String str2)\n" +
- " {\n" +
- " \n" +
- " }\n" +
- " \n" +
- " private A[] methodA(final String str1, final String str2)\n" +
- " {\n" +
- " return new A[]\n" +
- " {\n" +
- " new A(str1, str2)\n" +
- " {\n" +
- " //initialiser!\n" +
- " {\n" +
- " methodA(\"1\", \"2\");\n" +
- " }\n" +
- " },\n" +
- " new A(\"hello\".c) //<--------code complete to \"hello\".concat()\n" +
- " };\n" +
- " \n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "\"2\");";
- int cursorLocation = str.indexOf("\"2\");") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class A {\n" +
- " public A(final String str1, final String str2) {\n" +
- " }\n" +
- " private A[] methodA(final String str1, final String str2) {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "";
- expectedUnitDisplayString =
- "public class A {\n" +
- " public A(final String str1, final String str2) {\n" +
- " }\n" +
- " private A[] methodA(final String str1, final String str2) {\n" +
- " new A(str1, str2) {\n" +
- " {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46470
- */
-public void test0133(){
- String str =
- "public class X {\n" +
- " int x;\n" +
- " void foo() {\n" +
- " switch(x){\n" +
- " case 0:\n" +
- " break;\n" +
- " }\n" +
- " bar\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "bar";
- int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " int x;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bar>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bar";
- expectedReplacedSource = "bar";
- expectedUnitDisplayString =
- "public class X {\n" +
- " int x;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:bar>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=43212
- */
-public void test0134(){
- String str =
- "public class X {\n" +
- " Object o = new Object() {\n" +
- " void foo() {\n" +
- " try {\n" +
- " } catch(Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- "}\n";
-
-
- String completeBehind = "e.";
- int cursorLocation = str.indexOf("e.") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompleteOnName:e.>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "";
- String expectedReplacedSource = "e.";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " Object o = new Object() {\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception e;\n" +
- " <CompleteOnName:e.>;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=43212
- */
-public void test0135(){
- String str =
- "public class X {\n" +
- " void bar(){\n" +
- " #\n" +
- " class Inner {\n" +
- " void foo() {\n" +
- " try {\n" +
- " } catch(Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "e.";
- int cursorLocation = str.indexOf("e.") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:e.>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "e.";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " class Inner {\n" +
- " Inner() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception e;\n" +
- " <CompleteOnName:e.>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48070
- */
-public void test0136(){
- String str =
- "public class X {\n" +
- " void bar(){\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "ba";
- int cursorLocation = str.indexOf("ba") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompletionOnMethodName:void ba()>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ba";
- String expectedReplacedSource = "bar()";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " <CompletionOnMethodName:void ba()>\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=53624
- */
-public void test0137(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " new Object(){\n" +
- " void bar(){\n" +
- " super.zzz();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "zzz(";
- int cursorLocation = str.indexOf("zzz(") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnMessageSend:super.zzz()>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "zzz(";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " <CompleteOnMessageSend:super.zzz()>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=41395
- */
-public void test0138(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " new Y() {\n" +
- " public void bar() {\n" +
- " switch (zzz){\n" +
- " case 1 :\n" +
- " };\n" +
- " }\n" +
- " new Z() {\n" +
- " public void toto() { \n" +
- " }\n" +
- " });\n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "to";
- int cursorLocation = str.indexOf("to") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnFieldName:void to>;";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "to";
- expectedReplacedSource = "toto";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " new Y() {\n" +
- " public void bar() {\n" +
- " new Z() {\n" +
- " <CompleteOnFieldName:void to>;\n" +
- " {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0139(){
- String str =
- "public class X extends Z. # {\n" +
- "}";
-
-
- String completeBehind = "Z.";
- int cursorLocation = str.indexOf("Z.") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompleteOnClass:Z.>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "";
- String expectedReplacedSource = "Z.";
- String expectedUnitDisplayString =
- "public class X extends <CompleteOnClass:Z.> {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n"
- ;
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=32061
- */
-public void test0140(){
- String str =
- "public class X {\n" +
- " public void baz() {\n" +
- " new Object() {\n" +
- " public void bar() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " private Object var = new Object() {\n" +
- " public void foo(Object e) {\n" +
- " e.\n" +
- " }\n" +
- " };\n" +
- "}";
-
-
- String completeBehind = "e.";
- int cursorLocation = str.indexOf("e.") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompleteOnName:e.>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "";
- String expectedReplacedSource = "e.";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " private Object var = new Object() {\n" +
- " public void foo(Object e) {\n" +
- " <CompleteOnName:e.>;\n" +
- " }\n" +
- " };\n" +
- " public X() {\n" +
- " }\n" +
- " public void baz() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=32061
- */
-public void test0141(){
- String str =
- "public class X {\n" +
- " Object var1 = new Object() {};\n" +
- " void bar() {\n" +
- " new Object() {};\n" +
- " bar();\n" +
- " }\n" +
- " Object var2 = new \n" +
- "}";
-
-
- String completeBehind = "var2 = new ";
- int cursorLocation = str.indexOf("var2 = new ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompleteOnType:>";
- String expectedParentNodeToString = "Object var2 = new <CompleteOnType:>();";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " Object var1;\n" +
- " Object var2 = new <CompleteOnType:>();\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=39499
- */
-public void test0142(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " bar(new Object(){\n" +
- " public void toto() {\n" +
- " if(a instanceof Object) {}\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "instanceof";
- int cursorLocation = str.indexOf("instanceof") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:instanceof>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "instanceof";
- expectedReplacedSource = "instanceof";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " new Object() {\n" +
- " public void toto() {\n" +
- " <CompleteOnKeyword:instanceof>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
- */
-public void test0143(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " Object o =(int) tmp;\n" +
- " bar\n" +
- " }\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "bar";
- int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bar>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bar";
- expectedReplacedSource = "bar";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:bar>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
- */
-public void test0144(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " Object o =(int[]) tmp;\n" +
- " bar\n" +
- " }\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "bar";
- int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bar>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bar";
- expectedReplacedSource = "bar";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:bar>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
- */
-public void test0145(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " Object o =(X) tmp;\n" +
- " bar\n" +
- " }\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "bar";
- int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bar>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bar";
- expectedReplacedSource = "bar";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:bar>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
- */
-public void test0146(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " Object o =(X[]) tmp;\n" +
- " bar\n" +
- " }\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "bar";
- int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bar>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bar";
- expectedReplacedSource = "bar";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:bar>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=72352
- */
-public void test0147(){
- String str =
- "public class Test {\n" +
- " Object m;\n" +
- " String[] values = (String[]) m;\n" +
- " lo\n" +
- " }";
-
- String completeBehind = "lo";
- int cursorLocation = str.indexOf("lo") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompleteOnType:lo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "lo";
- String expectedReplacedSource = "lo";
- String expectedUnitDisplayString =
- "public class Test {\n" +
- " Object m;\n" +
- " String[] values;\n" +
- " <CompleteOnType:lo>;\n" +
- " public Test() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83236
- */
-public void test0148(){
- String str =
- "public class Test {\n" +
- " Boolean\n" +
- " * some text <b>bold<i>both</i></b>\n" +
- " */\n" +
- " public void foo(String s) {\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "Boolean";
- int cursorLocation = str.indexOf("Boolean") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompleteOnType:Boolean>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "Boolean";
- String expectedReplacedSource = "Boolean";
- String expectedUnitDisplayString =
- "public class Test {\n" +
- " <CompleteOnType:Boolean>;\n" +
- " some text;\n" +
- " bold<i> both;\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo(String s) {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
- */
-public void test0149(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " new Object(){\n" +
- " void bar(){\n" +
- " if((titi & (ZZ\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "ZZ";
- int cursorLocation = str.indexOf("ZZ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ZZ";
- String expectedReplacedSource = "ZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
- expectedParentNodeToString = "(titi & <CompleteOnName:ZZ>)";
- completionIdentifier = "ZZ";
- expectedReplacedSource = "ZZ";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " (titi & <CompleteOnName:ZZ>);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
- */
-public void test0150(){
- String str =
- "public class X{\n" +
- " public void foo() {\n" +
- " if((titi & (ZZ\n" +
- "}\n" +
- "\n";
-
-
- String completeBehind = "ZZ";
- int cursorLocation = str.indexOf("ZZ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ZZ";
- String expectedReplacedSource = "ZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
- expectedParentNodeToString = "(titi & <CompleteOnName:ZZ>)";
- completionIdentifier = "ZZ";
- expectedReplacedSource = "ZZ";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " (titi & <CompleteOnName:ZZ>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=92451
- */
-public void test0151(){
- String str =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " java.util.List elements = null;\n" +
- " new Test(Test.toStrings((Test[])elements.toArray(new Test[0])));\n" +
- " //code assist fails on this line\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "";
- int cursorLocation = str.indexOf(" //code assis") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " java.util.List elements;\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=98115
- */
-public void test0152(){
- String str =
- "public class X {\n" +
- " Object var = new Object() {\n" +
- " void bar() {\n" +
- " int i = 0;\n" +
- " }\n" +
- " void foo() {\n" +
- " zzz\n" +
- " }\n" +
- " };\n" +
- "}\n";
-
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " Object var = new Object() {\n" +
- " void bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " };\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
- */
-public void test0153(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " label1 : for(;;) {\n" +
- " break lab\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "break <CompleteOnLabel:lab>;";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "lab";
- expectedReplacedSource = "lab";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " break <CompleteOnLabel:lab>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
- */
-public void test0154(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " label1 : for(;;) {\n" +
- " break lab\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "break <CompleteOnLabel:lab>;";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "lab";
- expectedReplacedSource = "lab";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " break <CompleteOnLabel:lab>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
- */
-public void test0155(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " label1 : for(;;) {\n" +
- " continue lab\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "lab";
- expectedReplacedSource = "lab";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " continue <CompleteOnLabel:lab>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
- */
-public void test0156(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " label1 : for(;;) {\n" +
- " continue lab\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "lab";
- expectedReplacedSource = "lab";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " continue <CompleteOnLabel:lab>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
- */
-public void test0157(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " label1 : for(;;) {\n" +
- " class X {\n" +
- " void foo() {\n" +
- " label2 : for(;;) foo();\n" +
- " }\n" +
- " }\n" +
- " continue lab\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "lab";
- expectedReplacedSource = "lab";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " continue <CompleteOnLabel:lab>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
- */
-public void test0158(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " label1 : for(;;) {\n" +
- " class X {\n" +
- " void foo() {\n" +
- " label2 : for(;;) {\n" +
- " continue lab\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
-
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "lab";
- expectedReplacedSource = "lab";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " continue <CompleteOnLabel:lab>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0159() {
-
- String str =
- "public class X {\n" +
- " String s = \"ZZZZZ\";\n" +
- "}\n";
-
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompletionOnString:\"ZZZ\">";
- String completionIdentifier = "ZZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " String s = <CompletionOnString:\"ZZZ\">;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "\"ZZZZZ\"";
- String testName = "<complete inside a string literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test0160() {
-
- String str =
- "public class X {\n" +
- " String s = \\u0022ZZ\\u005AZZ\\u0022;\n" +
- "}\n";
-
- String completeBehind = "ZZ\\u005A";
- String expectedCompletionNodeToString = "<CompletionOnString:\"ZZZ\">";
- String completionIdentifier = "ZZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " String s = <CompletionOnString:\"ZZZ\">;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "\\u0022ZZ\\u005AZZ\\u0022";
- String testName = "<complete inside a string literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test0161() {
-
- String str =
- "public class X {\n" +
- " String s = \"AAAAA\" + \"ZZZZZ\";\n" +
- "}\n";
-
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompletionOnString:\"ZZZ\">";
- String completionIdentifier = "ZZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " String s = (\"AAAAA\" + <CompletionOnString:\"ZZZ\">);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "\"ZZZZZ\"";
- String testName = "<complete inside a string literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test0162() {
-
- String str =
- "public class X {\n" +
- " String s = \"ZZZZZ\n" +
- "}\n";
-
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompletionOnString:\"ZZZ\">";
- String completionIdentifier = "ZZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " String s = <CompletionOnString:\"ZZZ\">;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "\"ZZZZZ";
- String testName = "<complete inside a string literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test0163() {
-
- String str =
- "public class X {\n" +
- " String s = \"ZZZZZ";
-
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompletionOnString:\"ZZZ\">";
- String completionIdentifier = "ZZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " String s = <CompletionOnString:\"ZZZ\">;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "\"ZZZZZ";
- String testName = "<complete inside a string literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test0164() {
-
- String str =
- "public class X {\n" +
- " String s = \"\\u005AZZZZ\\u000D\\u0022" +
- "}\n";
-
- String completeBehind = "\\u005AZZ";
- String expectedCompletionNodeToString = "<CompletionOnString:\"ZZZ\">";
- String completionIdentifier = "ZZZ";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " String s = <CompletionOnString:\"ZZZ\">;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "\"\\u005AZZZZ";
- String testName = "<complete inside a string literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122755
-public void test0165() {
-
- String str =
- "public class X {\n" +
- " void foo() {" +
- " /**" +
- " *" +
- " */." +
- " }" +
- "}\n";
-
- String completeBehind = "/.";
- int cursorLocation = str.lastIndexOf("/.") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137623
-public void test0166() {
-
- String str =
- "public class X {\n" +
- " public boolean foo() {\n" +
- " if(this.equals(null))\n" +
- " {\n" +
- " (zzz==int.\n" +
- " }\n" +
- " }" +
- "}\n";
-
- String completeBehind = "int.";
- int cursorLocation = str.lastIndexOf("int.") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:int.>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "";
- expectedReplacedSource = "int.";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " <CompleteOnClassLiteralAccess:int.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void test0167() {
-
- String str =
- "public class X {\n" +
- " public boolean foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IllegalAccessException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n";
-
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
- expectedParentNodeToString =
- "try \n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- "catch (IllegalAccessException e) {\n" +
- " }\n" +
- "catch (<CompleteOnException:IZZ> ) {\n" +
- " }";
- completionIdentifier = "IZZ";
- expectedReplacedSource = "IZZ";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " try \n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IllegalAccessException e) {\n" +
- " }\n" +
- " catch (<CompleteOnException:IZZ> ) {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void test0168() {
-
- String str =
- "public class X {\n" +
- " public boolean foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IllegalAccessException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ\n" +
- " }" +
- "}\n";
-
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
- expectedParentNodeToString =
- "try \n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- "catch (IllegalAccessException e) {\n" +
- " }\n" +
- "catch (<CompleteOnException:IZZ> ) {\n" +
- " }";
- completionIdentifier = "IZZ";
- expectedReplacedSource = "IZZ";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " try \n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IllegalAccessException e) {\n" +
- " }\n" +
- " catch (<CompleteOnException:IZZ> ) {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void test0169() {
-
- String str =
- "public class X {\n" +
- " public boolean foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IllegalAccessException e) {\n" +
- " bar()\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n";
-
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "IZZ";
- expectedReplacedSource = "IZZ";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " <CompleteOnException:IZZ>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void test0170() {
-
- String str =
- "public class X {\n" +
- " public boolean foo() {\n" +
- " #\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IllegalAccessException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n";
-
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "IZZ";
- expectedReplacedSource = "IZZ";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " <CompleteOnException:IZZ>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void test0171() {
-
- String str =
- "public class X {\n" +
- " public boolean foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n";
-
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
- expectedParentNodeToString =
- "try \n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- "catch (<CompleteOnException:IZZ> ) {\n" +
- " }"
-;
- completionIdentifier = "IZZ";
- expectedReplacedSource = "IZZ";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public boolean foo() {\n" +
- " try \n" +
- " {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (<CompleteOnException:IZZ> ) {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTestKeyword.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTestKeyword.java
deleted file mode 100644
index 5a4cc80..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTestKeyword.java
+++ /dev/null
@@ -1,15538 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-public class CompletionParserTestKeyword extends AbstractCompletionTest {
-public CompletionParserTestKeyword(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(CompletionParserTestKeyword.class);
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0001(){
- String str =
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0002(){
- String str =
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0003(){
- String str =
- "package p;\n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0004(){
- String str =
- "package p;\n" +
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0005(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0006(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0007(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "public abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0008(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "public abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0009(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "abstract abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0010(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "abstract abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0011(){
- String str =
- "package p;\n" +
- "import \n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnImport:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0012(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "public class X {}\n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0013(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "public class X {}\n" +
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0014(){
- String str =
- "package p;\n" +
- "import yyy;\n" +
- "final abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0015(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0016(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " abst zzz\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0017(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " public abst zzz\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0018(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " final abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0019(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " abstract abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0020(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " static abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0021(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " abst\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:abst>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "abst";
- expectedReplacedSource = "abst";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:abst>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0022(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " abst zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:abst>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "abst";
- expectedReplacedSource = "abst";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:abst>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'break' keyword.
- */
-public void test0023(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bre\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bre>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bre";
- expectedReplacedSource = "bre";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:bre>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'break' keyword.
- */
-public void test0024(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " for(int i; i < 10; i++) {\n" +
- " bre\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bre>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bre";
- expectedReplacedSource = "bre";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " <CompleteOnName:bre>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'case' keyword.
- */
-public void test0025(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " cas\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cas>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cas";
- expectedReplacedSource = "cas";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cas>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'case' keyword.
- */
-public void test0026(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " switch(0) {\n" +
- " cas\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:cas>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cas";
- expectedReplacedSource = "cas";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:cas>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'catch' keyword.
- */
-public void test0027(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " cat\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cat>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cat";
- expectedReplacedSource = "cat";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cat>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'catch' keyword.
- */
-public void test0028(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " try {\n" +
- " } cat\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:cat>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cat";
- expectedReplacedSource = "cat";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:cat>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0029(){
- String str =
- "cla";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0030(){
- String str =
- "public cla";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0031(){
- String str =
- "public final cla";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0032(){
- String str =
- "public final cla X";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0033(){
- String str =
- "public class X {\n" +
- " cla\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0034(){
- String str =
- "public class X {\n" +
- " public cla\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0035(){
- String str =
- "public class X {\n" +
- " public final cla\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0036(){
- String str =
- "public class X {\n" +
- " public final cla Y\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0037(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " cla\n" +
- " }\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cla>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cla";
- expectedReplacedSource = "cla";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cla>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0038(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " final cla\n" +
- " }\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cla>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cla";
- expectedReplacedSource = "cla";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cla>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0039(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " final cla Y\n" +
- " }\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cla>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cla";
- expectedReplacedSource = "cla";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cla>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'continue' keyword.
- */
-public void test0040(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " con\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "con";
- int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:con>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "con";
- expectedReplacedSource = "con";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:con>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'continue' keyword.
- */
-public void test0041(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " for(int i; i < 5; i++) {\n" +
- " con\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "con";
- int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:con>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "con";
- expectedReplacedSource = "con";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " <CompleteOnName:con>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'default' keyword.
- */
-public void test0042(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " def\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:def>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "def";
- expectedReplacedSource = "def";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:def>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'default' keyword.
- */
-public void test0043(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " switch(0) {\n" +
- " case 1 : break;\n" +
- " def\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:def>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "def";
- expectedReplacedSource = "def";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:def>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'do' keyword.
- */
-public void test0044(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " do\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:do>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "do";
- expectedReplacedSource = "do";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:do>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'else' keyword.
- */
-public void test0045(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " els\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:els>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "els";
- expectedReplacedSource = "els";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:els>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'else' keyword.
- */
-public void test0046(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " if(true) {\n" +
- " } els\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:els>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "els";
- expectedReplacedSource = "els";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:els>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0047(){
- String str =
- "ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:ext>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0048(){
- String str =
- "X ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0049(){
- String str =
- "ext Y";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:ext>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0050(){
- String str =
- "class X ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0051(){
- String str =
- "class X ext Y";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0052(){
- String str =
- "class X ext Y {";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0053(){
- String str =
- "class X extends Y ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0054(){
- String str =
- "class X implements Y ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X implements Y {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0055(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0056(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " try {" +
- " } fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'for' keyword.
- */
-public void test0057(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " for" +
- " }\n" +
- "}\n";
-
- String completeBehind = "for";
- int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:for>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "for";
- expectedReplacedSource = "for";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:for>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'if' keyword.
- */
-public void test0058(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " if" +
- " }\n" +
- "}\n";
-
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:if>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "if";
- expectedReplacedSource = "if";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:if>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'switch' keyword.
- */
-public void test0059(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " swi" +
- " }\n" +
- "}\n";
-
- String completeBehind = "swi";
- int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:swi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "swi";
- expectedReplacedSource = "swi";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:swi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0060(){
- String str =
- "impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impl>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0061(){
- String str =
- "X impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0062(){
- String str =
- "impl Y";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impl>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0063(){
- String str =
- "class X impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0064(){
- String str =
- "class X impl Y";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0065(){
- String str =
- "class X impl Y {";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0066(){
- String str =
- "class X extends Y impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0067(){
- String str =
- "class X implements Y impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X implements Y {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0068(){
- String str =
- "impo";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0069(){
- String str =
- "package p;\n" +
- "impo";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0070(){
- String str =
- "package p;\n" +
- "import p2.Y;\n" +
- "impo";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0071(){
- String str =
- "impo p2.Y";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0072(){
- String str =
- "int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0073(){
- String str =
- "public int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0074(){
- String str =
- "public abstract int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0075(){
- String str =
- "public abstract int X";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0076(){
- String str =
- "public class X {\n" +
- " int\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0077(){
- String str =
- "public class X {\n" +
- " public int\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0078(){
- String str =
- "public class X {\n" +
- " public abstract int\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0079(){
- String str =
- "public class X {\n" +
- " public abstract int Y\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0080(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " int\n" +
- " }\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:int>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "int";
- expectedReplacedSource = "int";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0081(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " abstract int\n" +
- " }\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:int>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "int";
- expectedReplacedSource = "int";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0082(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " abstract int Y\n" +
- " }\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:int>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "int";
- expectedReplacedSource = "int";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0083(){
- String str =
- "public final int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0084(){
- String str =
- "public final int X";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0085(){
- String str =
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0086(){
- String str =
- "pac p";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0087(){
- String str =
- "package p;" +
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0088(){
- String str =
- "import p;" +
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import p;\n" +
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0089(){
- String str =
- "class X {}" +
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pac>;\n" +
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'return' keyword.
- */
-public void test0090(){
- String str =
- "public class X {\n" +
- " int foo() {\n" +
- " ret\n" +
- " }\n" +
- "}";
-
- String completeBehind = "ret";
- int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ret>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ret";
- expectedReplacedSource = "ret";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <CompleteOnName:ret>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'throw' keyword.
- */
-public void test0091(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:thr>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "thr";
- expectedReplacedSource = "thr";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:thr>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'try' keyword.
- */
-public void test0092(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " try\n" +
- " }\n" +
- "}";
-
- String completeBehind = "try";
- int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:try>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "try";
- expectedReplacedSource = "try";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:try>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'try' keyword.
- */
-public void test0093(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(try\n" +
- " }\n" +
- "}";
-
- String completeBehind = "try";
- int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:try>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "try";
- expectedReplacedSource = "try";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:try>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'do' keyword.
- */
-public void test0094(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(do\n" +
- " }\n" +
- "}";
-
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:do>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "do";
- expectedReplacedSource = "do";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:do>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'for' keyword.
- */
-public void test0095(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(for\n" +
- " }\n" +
- "}";
-
- String completeBehind = "for";
- int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:for>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "for";
- expectedReplacedSource = "for";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:for>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'if' keyword.
- */
-public void test0096(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(if\n" +
- " }\n" +
- "}";
-
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:if>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "if";
- expectedReplacedSource = "if";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:if>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'switch' keyword.
- */
-public void test0097(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(swi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "swi";
- int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:swi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "swi";
- expectedReplacedSource = "swi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:swi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'new' keyword.
- */
-public void test0098(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " new\n" +
- " }\n" +
- "}";
-
- String completeBehind = "new";
- int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:new>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "new";
- expectedReplacedSource = "new";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:new>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'new' keyword.
- */
-public void test0099(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " new X\n" +
- " }\n" +
- "}";
-
- String completeBehind = "new";
- int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:new>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "new";
- expectedReplacedSource = "new";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:new>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'new' keyword.
- */
-public void test0100(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " new X()\n" +
- " }\n" +
- "}";
-
- String completeBehind = "new";
- int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:new>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "new";
- expectedReplacedSource = "new";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:new>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0101(){
- String str =
- "public class X {\n" +
- " void foo() thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0102(){
- String str =
- "public class X {\n" +
- " void foo() thr {\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0103(){
- String str =
- "public class X {\n" +
- " void foo() thr E {\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0104(){
- String str =
- "public class X {\n" +
- " void foo() throws E thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws E {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0105(){
- String str =
- "public class X {\n" +
- " X() thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " X() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0106(){
- String str =
- "public class X {\n" +
- " int foo()[] thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int[] foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'while' keyword.
- */
-public void test0107(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " whi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "whi";
- int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:whi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "whi";
- expectedReplacedSource = "whi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:whi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'while' keyword.
- */
-public void test0108(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(whi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "whi";
- int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:whi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "whi";
- expectedReplacedSource = "whi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:whi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'assert' keyword.
- */
-public void test0109(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " ass\n" +
- " }\n" +
- "}";
-
- String completeBehind = "ass";
- int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ass>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ass";
- expectedReplacedSource = "ass";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:ass>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'assert' keyword.
- */
-public void test0110(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(ass\n" +
- " }\n" +
- "}";
-
- String completeBehind = "ass";
- int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ass>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ass";
- expectedReplacedSource = "ass";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:ass>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0111(){
- String str =
- "fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0112(){
- String str =
- "public fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0113(){
- String str =
- "fin zzz";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0114(){
- String str =
- "final fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0115(){
- String str =
- "abstract fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0116(){
- String str =
- "public fin class X {}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n" +
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0117(){
- String str =
- "public class X {\n" +
- " fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0118(){
- String str =
- "public class X {\n" +
- " public fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0119(){
- String str =
- "public class X {\n" +
- " fin zzz\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0120(){
- String str =
- "public class X {\n" +
- " final fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0121(){
- String str =
- "public class X {\n" +
- " abstract fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0122(){
- String str =
- "public class X {\n" +
- " nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0123(){
- String str =
- "public class X {\n" +
- " public nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0124(){
- String str =
- "public class X {\n" +
- " transient nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0125(){
- String str =
- "public class X {\n" +
- " transient nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0126(){
- String str =
- "public class X {\n" +
- " volatile nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0127(){
- String str =
- "public class X {\n" +
- " str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0128(){
- String str =
- "public class X {\n" +
- " public str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0129(){
- String str =
- "public class X {\n" +
- " transient str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0130(){
- String str =
- "public class X {\n" +
- " transient str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0131(){
- String str =
- "public class X {\n" +
- " volatile str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0132(){
- String str =
- "public class X {\n" +
- " vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0133(){
- String str =
- "public class X {\n" +
- " public vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0134(){
- String str =
- "public class X {\n" +
- " transient vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0135(){
- String str =
- "public class X {\n" +
- " volatile vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0136(){
- String str =
- "public class X {\n" +
- " native vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0137(){
- String str =
- "public class X {\n" +
- " tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0138(){
- String str =
- "public class X {\n" +
- " public tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0139(){
- String str =
- "public class X {\n" +
- " transient tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0140(){
- String str =
- "public class X {\n" +
- " volatile tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0141(){
- String str =
- "public class X {\n" +
- " native tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0142(){
- String str =
- "public class X {\n" +
- " syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0143(){
- String str =
- "public class X {\n" +
- " public syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0144(){
- String str =
- "public class X {\n" +
- " transient syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0145(){
- String str =
- "public class X {\n" +
- " transient syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0146(){
- String str =
- "public class X {\n" +
- " volatile syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0147(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " syn\n" +
- " }\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:syn>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "syn";
- expectedReplacedSource = "syn";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:syn>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0148(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " if(syn\n" +
- " }\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:syn>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "syn";
- expectedReplacedSource = "syn";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:syn>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'static' keyword.
- */
-public void test0149(){
- String str =
- "public class X {\n" +
- " sta\n" +
- "}";
-
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:sta>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "sta";
- String expectedReplacedSource = "sta";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:sta>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'static' keyword.
- */
-public void test0150(){
- String str =
- "public class X {\n" +
- " public sta\n" +
- "}";
-
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:sta>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "sta";
- String expectedReplacedSource = "sta";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:sta>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0151(){
- String str =
- "pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0152(){
- String str =
- "final pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0153(){
- String str =
- "public pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0154(){
- String str =
- "private pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0155(){
- String str =
- "public class X{}\n" +
- "pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0156(){
- String str =
- "public class X{\n" +
- " pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0157(){
- String str =
- "public class X{\n" +
- " public pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0158(){
- String str =
- "public class X{\n" +
- " private pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0159(){
- String str =
- "public class X{\n" +
- " protected pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0160(){
- String str =
- "public class X{\n" +
- " abstract pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0161(){
- String str =
- "pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0162(){
- String str =
- "final pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0163(){
- String str =
- "public pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0164(){
- String str =
- "private pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0165(){
- String str =
- "public class X{}\n" +
- "pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0166(){
- String str =
- "public class X{\n" +
- " pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0167(){
- String str =
- "public class X{\n" +
- " public pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0168(){
- String str =
- "public class X{\n" +
- " private pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0169(){
- String str =
- "public class X{\n" +
- " protected pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0170(){
- String str =
- "public class X{\n" +
- " abstract pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0171(){
- String str =
- "pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0172(){
- String str =
- "final pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0173(){
- String str =
- "public pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0174(){
- String str =
- "private pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0175(){
- String str =
- "public class X{}\n" +
- "pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0176(){
- String str =
- "public class X{\n" +
- " pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0177(){
- String str =
- "public class X{\n" +
- " public pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0178(){
- String str =
- "public class X{\n" +
- " private pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0179(){
- String str =
- "public class X{\n" +
- " protected pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0180(){
- String str =
- "public class X{\n" +
- " abstract pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'super' keyword.
- */
-public void test0181(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " sup\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:sup>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "sup";
- expectedReplacedSource = "sup";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:sup>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'this' keyword.
- */
-public void test0182(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " thi\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:thi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "thi";
- expectedReplacedSource = "thi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:thi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'true' keyword.
- */
-public void test0183(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " tru\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "tru";
- int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:tru>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "tru";
- expectedReplacedSource = "tru";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:tru>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'false' keyword.
- */
-public void test0184(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " fal\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fal";
- int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fal>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fal";
- expectedReplacedSource = "fal";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fal>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'null' keyword.
- */
-public void test0185(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " nul\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "nul";
- int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:nul>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "nul";
- expectedReplacedSource = "nul";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:nul>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'instanceof' keyword.
- */
-public void test0186(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " if(zzz ins\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:ins>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ins";
- expectedReplacedSource = "ins";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:ins>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'instanceof' keyword.
- */
-public void test0187(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " ins\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ins>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ins";
- expectedReplacedSource = "ins";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:ins>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'instanceof' keyword.
- */
-public void test0188(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " if(zzz zzz ins\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ins>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ins";
- expectedReplacedSource = "ins";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " zzz zzz;\n" +
- " <CompleteOnName:ins>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'while' keyword.
- */
-public void test0189(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " do{\n" +
- " } whi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "whi";
- int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:whi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "whi";
- expectedReplacedSource = "whi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:whi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'catch' keyword.
- */
-public void test0190(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " try {\n" +
- " } catch(E e) {\n" +
- " } cat\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cat>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cat";
- expectedReplacedSource = "cat";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cat>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0191(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " try {" +
- " } catch(E e) {" +
- " } fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0192(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " try {" +
- " } finally {" +
- " } fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'this' keyword.
- */
-public void test0193(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " X.thi\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:X.thi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "thi";
- expectedReplacedSource = "X.thi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:X.thi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/*
- * Test for 'abstract' keyword.
- */
-public void test0194(){
- String str =
- "#\n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0195(){
- String str =
- "#\n" +
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0196(){
- String str =
- "#\n" +
- "package p;\n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0197(){
- String str =
- "#\n" +
- "package p;\n" +
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0198(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0199(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0200(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "public abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0201(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "public abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0202(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "abstract abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0203(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "abstract abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0204(){
- String str =
- "#\n" +
- "package p;\n" +
- "import \n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnImport:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0205(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "public class X {}\n" +
- "abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0206(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "public class X {}\n" +
- "abst zzz";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0207(){
- String str =
- "#\n" +
- "package p;\n" +
- "import yyy;\n" +
- "final abst";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import yyy;\n" +
- "import <CompleteOnKeyword:abst>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0208(){
- String str =
- "#\n" +
- "package p;\n" +
- "public class X {\n" +
- " abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0209(){
- String str =
- "#\n" +
- "package p;\n" +
- "public class X {\n" +
- " abst zzz\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0210(){
- String str =
- "#\n" +
- "package p;\n" +
- "public class X {\n" +
- " public abst zzz\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0211(){
- String str =
- "#\n" +
- "package p;\n" +
- "public class X {\n" +
- " final abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0212(){
- String str =
- "#\n" +
- "package p;\n" +
- "public class X {\n" +
- " abstract abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0213(){
- String str =
- "#\n" +
- "package p;\n" +
- "public class X {\n" +
- " static abst\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:abst>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "abst";
- String expectedReplacedSource = "abst";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " <CompleteOnType:abst>;\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0214(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " abst\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:abst>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "abst";
- expectedReplacedSource = "abst";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:abst>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'abstract' keyword.
- */
-public void test0216(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " abst zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "abst";
- int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:abst>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "abst";
- expectedReplacedSource = "abst";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:abst>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'break' keyword.
- */
-public void test0217(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " bre\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bre>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bre";
- expectedReplacedSource = "bre";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:bre>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'break' keyword.
- */
-public void test0218(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " for(int i; i < 10; i++) {\n" +
- " bre\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:bre>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "bre";
- expectedReplacedSource = "bre";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " <CompleteOnName:bre>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'case' keyword.
- */
-public void test0219(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " cas\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cas>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cas";
- expectedReplacedSource = "cas";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cas>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'case' keyword.
- */
-public void test0220(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " switch(0) {\n" +
- " cas\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:cas>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cas";
- expectedReplacedSource = "cas";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnKeyword:cas>;\n" +
- " }\n"+
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'catch' keyword.
- */
-public void test0221(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " cat\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cat>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cat";
- expectedReplacedSource = "cat";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cat>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'catch' keyword.
- */
-public void test0222(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " try {\n" +
- " } cat\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:cat>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cat";
- expectedReplacedSource = "cat";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:cat>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0223(){
- String str =
- "#\n" +
- "cla";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0224(){
- String str =
- "#\n" +
- "public cla";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0225(){
- String str =
- "#\n" +
- "public final cla";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0226(){
- String str =
- "#\n" +
- "public final cla X";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:cla>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0227(){
- String str =
- "#\n" +
- "public class X {\n" +
- " cla\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0228(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public cla\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0229(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public final cla\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0230(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public final cla Y\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:cla>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "cla";
- String expectedReplacedSource = "cla";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:cla>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0231(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " cla\n" +
- " }\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cla>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cla";
- expectedReplacedSource = "cla";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cla>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0232(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " final cla\n" +
- " }\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cla>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cla";
- expectedReplacedSource = "cla";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cla>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'class' keyword.
- */
-public void test0233(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " final cla Y\n" +
- " }\n" +
- "}";
-
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cla>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cla";
- expectedReplacedSource = "cla";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cla>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'continue' keyword.
- */
-public void test0234(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " con\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "con";
- int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:con>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "con";
- expectedReplacedSource = "con";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:con>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'continue' keyword.
- */
-public void test0235(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " for(int i; i < 5; i++) {\n" +
- " con\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "con";
- int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:con>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "con";
- expectedReplacedSource = "con";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " <CompleteOnName:con>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'default' keyword.
- */
-public void test0236(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " def\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:def>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "def";
- expectedReplacedSource = "def";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:def>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'default' keyword.
- */
-public void test0237(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " switch(0) {\n" +
- " case 1 : break;\n" +
- " def\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:def>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "def";
- expectedReplacedSource = "def";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:def>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'do' keyword.
- */
-public void test0238(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " do\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:do>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "do";
- expectedReplacedSource = "do";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:do>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'else' keyword.
- */
-public void test0239(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " els\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:els>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "els";
- expectedReplacedSource = "els";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:els>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'else' keyword.
- */
-public void test0240(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " if(true) {\n" +
- " } els\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:els>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "els";
- expectedReplacedSource = "els";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:els>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0241(){
- String str =
- "#\n" +
- "ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:ext>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0242(){
- String str =
- "#\n" +
- "X ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0243(){
- String str =
- "#\n" +
- "ext Y";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:ext>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0244(){
- String str =
- "#\n" +
- "class X ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0245(){
- String str =
- "#\n" +
- "class X ext Y";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0246(){
- String str =
- "#\n" +
- "class X ext Y {";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0247(){
- String str =
- "#\n" +
- "class X extends Y ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:ext> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'extends' keyword.
- */
-public void test0248(){
- String str =
- "#\n" +
- "class X implements Y ext";
-
- String completeBehind = "ext";
- int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "ext";
- String expectedReplacedSource = "ext";
- String expectedUnitDisplayString =
- "class X implements Y {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0249(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0250(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " try {" +
- " } fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'for' keyword.
- */
-public void test0251(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " for" +
- " }\n" +
- "}\n";
-
- String completeBehind = "for";
- int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:for>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "for";
- expectedReplacedSource = "for";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:for>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'if' keyword.
- */
-public void test0252(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " if" +
- " }\n" +
- "}\n";
-
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:if>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "if";
- expectedReplacedSource = "if";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:if>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'switch' keyword.
- */
-public void test0253(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " swi" +
- " }\n" +
- "}\n";
-
- String completeBehind = "swi";
- int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:swi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "swi";
- expectedReplacedSource = "swi";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:swi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0254(){
- String str =
- "#\n" +
- "impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impl>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0255(){
- String str =
- "#\n" +
- "X impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0256(){
- String str =
- "#\n" +
- "impl Y";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impl>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0257(){
- String str =
- "#\n" +
- "class X impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0258(){
- String str =
- "#\n" +
- "class X impl Y";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0259(){
- String str =
- "#\n" +
- "class X impl Y {";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0260(){
- String str =
- "#\n" +
- "class X extends Y impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnKeyword:impl> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'implements' keyword.
- */
-public void test0261(){
- String str =
- "#\n" +
- "class X implements Y impl";
-
- String completeBehind = "impl";
- int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impl";
- String expectedReplacedSource = "impl";
- String expectedUnitDisplayString =
- "class X implements Y {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0262(){
- String str =
- "#\n" +
- "impo";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0263(){
- String str =
- "#\n" +
- "package p;\n" +
- "impo";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0264(){
- String str =
- "#\n" +
- "package p;\n" +
- "import p2.Y;\n" +
- "impo";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'import' keyword.
- */
-public void test0265(){
- String str =
- "#\n" +
- "impo p2.Y";
-
- String completeBehind = "impo";
- int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "impo";
- String expectedReplacedSource = "impo";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:impo>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0266(){
- String str =
- "#\n" +
- "int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0267(){
- String str =
- "#\n" +
- "public int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0268(){
- String str =
- "#\n" +
- "public abstract int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0269(){
- String str =
- "#\n" +
- "public abstract int X";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0270(){
- String str =
- "#\n" +
- "public class X {\n" +
- " int\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0271(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public int\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0272(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public abstract int\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0273(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public abstract int Y\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:int>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:int>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0274(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " int\n" +
- " }\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:int>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "int";
- expectedReplacedSource = "int";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0275(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " abstract int\n" +
- " }\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:int>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "int";
- expectedReplacedSource = "int";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0276(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " abstract int Y\n" +
- " }\n" +
- "}";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:int>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "int";
- expectedReplacedSource = "int";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0277(){
- String str =
- "#\n" +
- "public final int";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'interface' keyword.
- */
-public void test0278(){
- String str =
- "#\n" +
- "public final int X";
-
- String completeBehind = "int";
- int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:int>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:int>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0279(){
- String str =
- "#\n" +
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0280(){
- String str =
- "#\n" +
- "pac p";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0281(){
- String str =
- "#\n" +
- "package p;" +
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0282(){
- String str =
- "#\n" +
- "import p;" +
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import p;\n" +
- "import <CompleteOnKeyword:pac>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'package' keyword.
- */
-public void test0283(){
- String str =
- "#\n" +
- "class X {}" +
- "pac";
-
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pac";
- String expectedReplacedSource = "pac";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pac>;\n" +
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'return' keyword.
- */
-public void test0284(){
- String str =
- "public class X {\n" +
- " int foo() {\n" +
- " #\n" +
- " ret\n" +
- " }\n" +
- "}";
-
- String completeBehind = "ret";
- int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ret>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ret";
- expectedReplacedSource = "ret";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " <CompleteOnName:ret>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'throw' keyword.
- */
-public void test0285(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:thr>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "thr";
- expectedReplacedSource = "thr";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:thr>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'try' keyword.
- */
-public void test0286(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " try\n" +
- " }\n" +
- "}";
-
- String completeBehind = "try";
- int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:try>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "try";
- expectedReplacedSource = "try";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:try>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'try' keyword.
- */
-public void test0287(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(try\n" +
- " }\n" +
- "}";
-
- String completeBehind = "try";
- int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:try>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "try";
- expectedReplacedSource = "try";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:try>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'do' keyword.
- */
-public void test0288(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(do\n" +
- " }\n" +
- "}";
-
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:do>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "do";
- expectedReplacedSource = "do";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:do>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'for' keyword.
- */
-public void test0289(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(for\n" +
- " }\n" +
- "}";
-
- String completeBehind = "for";
- int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:for>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "for";
- expectedReplacedSource = "for";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:for>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'if' keyword.
- */
-public void test0290(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(if\n" +
- " }\n" +
- "}";
-
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:if>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "if";
- expectedReplacedSource = "if";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:if>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'switch' keyword.
- */
-public void test0291(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(swi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "swi";
- int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:swi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "swi";
- expectedReplacedSource = "swi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:swi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'new' keyword.
- */
-public void test0292(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " new\n" +
- " }\n" +
- "}";
-
- String completeBehind = "new";
- int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:new>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "new";
- expectedReplacedSource = "new";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:new>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'new' keyword.
- */
-public void test0293(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " new X\n" +
- " }\n" +
- "}";
-
- String completeBehind = "new";
- int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:new>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "new";
- expectedReplacedSource = "new";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:new>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'new' keyword.
- */
-public void test0294(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " new X()\n" +
- " }\n" +
- "}";
-
- String completeBehind = "new";
- int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:new>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "new";
- expectedReplacedSource = "new";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:new>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0295(){
- String str =
- "#\n" +
- "public class X {\n" +
- " void foo() thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0296(){
- String str =
- "#\n" +
- "public class X {\n" +
- " void foo() thr {\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0297(){
- String str =
- "#\n" +
- "public class X {\n" +
- " void foo() thr E {\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0298(){
- String str =
- "#\n" +
- "public class X {\n" +
- " void foo() throws E thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() throws E {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0299(){
- String str =
- "#\n" +
- "public class X {\n" +
- " X() thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " X() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'throws' keyword.
- */
-public void test0300(){
- String str =
- "#\n" +
- "public class X {\n" +
- " int foo()[] thr\n" +
- " }\n" +
- "}";
-
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "thr";
- String expectedReplacedSource = "thr";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int[] foo() throws <CompleteOnKeyword:thr> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'while' keyword.
- */
-public void test0301(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " whi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "whi";
- int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:whi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "whi";
- expectedReplacedSource = "whi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:whi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'while' keyword.
- */
-public void test0302(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(whi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "whi";
- int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:whi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "whi";
- expectedReplacedSource = "whi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:whi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'assert' keyword.
- */
-public void test0303(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " ass\n" +
- " }\n" +
- "}";
-
- String completeBehind = "ass";
- int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ass>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ass";
- expectedReplacedSource = "ass";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:ass>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'assert' keyword.
- */
-public void test0304(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(ass\n" +
- " }\n" +
- "}";
-
- String completeBehind = "ass";
- int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ass>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ass";
- expectedReplacedSource = "ass";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:ass>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0305(){
- String str =
- "#\n" +
- "fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0306(){
- String str =
- "#\n" +
- "public fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0307(){
- String str =
- "#\n" +
- "fin zzz";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0308(){
- String str =
- "#\n" +
- "final fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0309(){
- String str =
- "#\n" +
- "abstract fin";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0310(){
- String str =
- "#\n" +
- "public fin class X {}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:fin>;\n" +
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0311(){
- String str =
- "#\n" +
- "public class X {\n" +
- " fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0312(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0313(){
- String str =
- "#\n" +
- "public class X {\n" +
- " fin zzz\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>;";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0314(){
- String str =
- "#\n" +
- "public class X {\n" +
- " final fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'final' keyword.
- */
-public void test0315(){
- String str =
- "#\n" +
- "public class X {\n" +
- " abstract fin\n" +
- "}";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:fin>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "fin";
- String expectedReplacedSource = "fin";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:fin>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0316(){
- String str =
- "#\n" +
- "public class X {\n" +
- " nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0317(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0318(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0319(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'native' keyword.
- */
-public void test0320(){
- String str =
- "#\n" +
- "public class X {\n" +
- " volatile nat\n" +
- "}";
-
- String completeBehind = "nat";
- int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:nat>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "nat";
- String expectedReplacedSource = "nat";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:nat>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0321(){
- String str =
- "#\n" +
- "public class X {\n" +
- " str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0322(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0323(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0324(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'strictfp' keyword.
- */
-public void test0325(){
- String str =
- "#\n" +
- "public class X {\n" +
- " volatile str\n" +
- "}";
-
- String completeBehind = "str";
- int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:str>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "str";
- String expectedReplacedSource = "str";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:str>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0326(){
- String str =
- "#\n" +
- "public class X {\n" +
- " vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0327(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0328(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0329(){
- String str =
- "#\n" +
- "public class X {\n" +
- " volatile vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'volatile' keyword.
- */
-public void test0330(){
- String str =
- "#\n" +
- "public class X {\n" +
- " native vol\n" +
- "}";
-
- String completeBehind = "vol";
- int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:vol>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "vol";
- String expectedReplacedSource = "vol";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:vol>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0331(){
- String str =
- "#\n" +
- "public class X {\n" +
- " tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0332(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0333(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0334(){
- String str =
- "#\n" +
- "public class X {\n" +
- " volatile tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'transient' keyword.
- */
-public void test0335(){
- String str =
- "#\n" +
- "public class X {\n" +
- " native tra\n" +
- "}";
-
- String completeBehind = "tra";
- int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:tra>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "tra";
- String expectedReplacedSource = "tra";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:tra>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0336(){
- String str =
- "#\n" +
- "public class X {\n" +
- " syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0337(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0338(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0339(){
- String str =
- "#\n" +
- "public class X {\n" +
- " transient syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0340(){
- String str =
- "#\n" +
- "public class X {\n" +
- " volatile syn\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:syn>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "syn";
- String expectedReplacedSource = "syn";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:syn>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0341(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " syn\n" +
- " }\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:syn>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "syn";
- expectedReplacedSource = "syn";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:syn>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'synchronized' keyword.
- */
-public void test0342(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " if(syn\n" +
- " }\n" +
- "}";
-
- String completeBehind = "syn";
- int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:syn>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "syn";
- expectedReplacedSource = "syn";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:syn>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'static' keyword.
- */
-public void test0343(){
- String str =
- "#\n" +
- "public class X {\n" +
- " sta\n" +
- "}";
-
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:sta>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "sta";
- String expectedReplacedSource = "sta";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:sta>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'static' keyword.
- */
-public void test0344(){
- String str =
- "#\n" +
- "public class X {\n" +
- " public sta\n" +
- "}";
-
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:sta>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "sta";
- String expectedReplacedSource = "sta";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:sta>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0345(){
- String str =
- "#\n" +
- "pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0346(){
- String str =
- "#\n" +
- "final pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0347(){
- String str =
- "#\n" +
- "public pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0348(){
- String str =
- "#\n" +
- "private pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0349(){
- String str =
- "#\n" +
- "public class X{}\n" +
- "pub";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pub>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0350(){
- String str =
- "#\n" +
- "public class X{\n" +
- " pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0351(){
- String str =
- "#\n" +
- "public class X{\n" +
- " public pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0352(){
- String str =
- "#\n" +
- "public class X{\n" +
- " private pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0353(){
- String str =
- "#\n" +
- "public class X{\n" +
- " protected pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'public' keyword.
- */
-public void test0354(){
- String str =
- "#\n" +
- "public class X{\n" +
- " abstract pub\n" +
- "}";
-
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pub>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pub";
- String expectedReplacedSource = "pub";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pub>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0355(){
- String str =
- "#\n" +
- "pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0356(){
- String str =
- "#\n" +
- "final pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0357(){
- String str =
- "#\n" +
- "public pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0358(){
- String str =
- "#\n" +
- "private pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0359(){
- String str =
- "#\n" +
- "public class X{}\n" +
- "pro";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pro>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0360(){
- String str =
- "#\n" +
- "public class X{\n" +
- " pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0361(){
- String str =
- "#\n" +
- "public class X{\n" +
- " public pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0362(){
- String str =
- "#\n" +
- "public class X{\n" +
- " private pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0363(){
- String str =
- "#\n" +
- "public class X{\n" +
- " protected pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'protected' keyword.
- */
-public void test0364(){
- String str =
- "#\n" +
- "public class X{\n" +
- " abstract pro\n" +
- "}";
-
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pro>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pro";
- String expectedReplacedSource = "pro";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pro>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0365(){
- String str =
- "#\n" +
- "pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0366(){
- String str =
- "#\n" +
- "final pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0367(){
- String str =
- "#\n" +
- "public pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0368(){
- String str =
- "#\n" +
- "private pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0369(){
- String str =
- "#\n" +
- "public class X{}\n" +
- "pri";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "import <CompleteOnKeyword:pri>;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0370(){
- String str =
- "#\n" +
- "public class X{\n" +
- " pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0371(){
- String str =
- "#\n" +
- "public class X{\n" +
- " public pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0372(){
- String str =
- "#\n" +
- "public class X{\n" +
- " private pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0373(){
- String str =
- "#\n" +
- "public class X{\n" +
- " protected pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'private' keyword.
- */
-public void test0374(){
- String str =
- "#\n" +
- "public class X{\n" +
- " abstract pri\n" +
- "}";
-
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:pri>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "pri";
- String expectedReplacedSource = "pri";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:pri>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-/*
- * Test for 'super' keyword.
- */
-public void test0375(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " sup\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:sup>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "sup";
- expectedReplacedSource = "sup";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:sup>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'this' keyword.
- */
-public void test0376(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " thi\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:thi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "thi";
- expectedReplacedSource = "thi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:thi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'true' keyword.
- */
-public void test0377(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " tru\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "tru";
- int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:tru>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "tru";
- expectedReplacedSource = "tru";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:tru>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'false' keyword.
- */
-public void test0378(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " fal\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fal";
- int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fal>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fal";
- expectedReplacedSource = "fal";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fal>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'null' keyword.
- */
-public void test0379(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " nul\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "nul";
- int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:nul>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "nul";
- expectedReplacedSource = "nul";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:nul>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'instanceof' keyword.
- */
-public void test0380(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " if(zzz ins\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:ins>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ins";
- expectedReplacedSource = "ins";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:ins>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'instanceof' keyword.
- */
-public void test0381(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " ins\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ins>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ins";
- expectedReplacedSource = "ins";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:ins>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'instanceof' keyword.
- */
-public void test0382(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " if(zzz zzz ins\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:ins>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "ins";
- expectedReplacedSource = "ins";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " zzz zzz;\n" +
- " <CompleteOnName:ins>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'while' keyword.
- */
-public void test0384(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " do{\n" +
- " } whi\n" +
- " }\n" +
- "}";
-
- String completeBehind = "whi";
- int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnKeyword:whi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "whi";
- expectedReplacedSource = "whi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:whi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'catch' keyword.
- */
-public void test0385(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " try {\n" +
- " } catch(E e) {\n" +
- " } cat\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:cat>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "cat";
- expectedReplacedSource = "cat";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:cat>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0386(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " try {" +
- " } catch(E e) {" +
- " } fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'finally' keyword.
- */
-public void test0387(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " try {" +
- " } finally {" +
- " } fin" +
- " }\n" +
- "}\n";
-
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:fin>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "fin";
- expectedReplacedSource = "fin";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:fin>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-/*
- * Test for 'this' keyword.
- */
-public void test0388(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " X.thi\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:X.thi>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "thi";
- expectedReplacedSource = "X.thi";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:X.thi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionRecoveryTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionRecoveryTest.java
deleted file mode 100644
index b0ce013..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionRecoveryTest.java
+++ /dev/null
@@ -1,1031 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-public class CompletionRecoveryTest extends AbstractCompletionTest {
-public CompletionRecoveryTest(String testName){
- super(testName);
-}
-static {
-// TESTS_NUMBERS = new int[] { 22 };
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(CompletionRecoveryTest.class);
-}
-/*
- * Complete on variable behind ill-formed declaration
- */
-public void test01() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException { \n" +
- " int foo(){ \n" +
- " String str = ; \n" +
- " str. \n";
-
- String completeBehind = "str.";
- String expectedCompletionNodeToString = "<CompleteOnName:str.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " String str;\n" +
- " <CompleteOnName:str.>;\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "str.";
- String testName = "<complete on variable behind ill-formed declaration>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on variable behind ill-formed declaration and nested block
- */
-public void test02() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException { \n" +
- " int foo(){ \n" +
- " String str = ; \n" +
- " { \n" +
- " int i; \n" +
- " str. \n";
-
- String completeBehind = "str.";
- String expectedCompletionNodeToString = "<CompleteOnName:str.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " String str;\n" +
- " {\n" +
- " int i;\n" +
- " <CompleteOnName:str.>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "str.";
- String testName = "<complete on variable behind ill-formed declaration and nested block>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on variable behind ill-formed declaration and inside local type field initialization
- */
-public void test03() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException { \n" +
- " int foo(){ \n" +
- " final String str = ; \n" +
- " class L { \n" +
- " int i = str \n";
-
- String completeBehind = "i = str";
- String expectedCompletionNodeToString = "<CompleteOnName:str>";
- String completionIdentifier = "str";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " final String str;\n" +
- " class L {\n" +
- " int i = <CompleteOnName:str>;\n" +
- " L() {\n" +
- " super();\n" + // could be optimized out
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "str";
- String testName = "<complete on variable behind ill-formed declaration and inside local type field initialization>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on variable behind closed scope
- */
-public void test04() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends \n" +
- " int foo(String str) \n" +
- " String variable = ; \n" +
- " { \n" +
- " String variableNotInScope; \n" +
- " } \n" +
- " foo(varia \n";
-
- String completeBehind = "foo(var";
- String expectedCompletionNodeToString = "<CompleteOnName:var>";
- String completionIdentifier = "var";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo(String str) {\n" +
- " String variable;\n" +
- " foo(<CompleteOnName:var>);\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "varia";
- String testName = "<complete on variable behind closed scope>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on variable str with sibling method stringAppend()
- */
-public void test05() {
-
- String str =
- "import java.io.*; \n"+
- " \n"+
- "public class X extends \n"+
- " int foo(String str) \n"+
- " String str = ; \n"+
- " { \n"+
- " String strNotInScope; \n"+
- " } \n"+
- " class L { \n"+
- " int bar(){ \n"+
- " foo(str \n"+
- " void stringAppend(String s1, String s2) \n";
-
- String completeBehind = "foo(str";
- String expectedCompletionNodeToString = "<CompleteOnName:str>";
- String completionIdentifier = "str";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo(String str) {\n" +
- " String str;\n" +
- " class L {\n" +
- " L() {\n" +
- " }\n" +
- " int bar() {\n" +
- " foo(<CompleteOnName:str>);\n" +
- " }\n" +
- " void stringAppend(String s1, String s2) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "str";
- String testName = "<complete on variable str with sibling method stringAppend()>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on variable str with sibling method stringAppend(), eliminating
- * uninteresting method bodies
- */
-public void test06() {
-
- String str =
- "import java.io.*; \n"+
- " \n"+
- "public class X extends \n"+
- " int foo(String str) \n"+
- " String str = ; \n"+
- " { \n"+
- " String strNotInScope; \n"+
- " } \n"+
- " class L { \n"+
- " int notInterestingBody(){ \n"+
- " System.out.println(); \n"+
- " } \n"+
- " int bar(){ \n"+
- " foo(str \n"+
- " void stringAppend(String s1, String s2) \n";
-
- String completeBehind = "foo(str";
- String expectedCompletionNodeToString = "<CompleteOnName:str>";
- String completionIdentifier = "str";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo(String str) {\n" +
- " String str;\n" +
- " class L {\n" +
- " L() {\n" +
- " }\n" +
- " int notInterestingBody() {\n" +
- " }\n" +
- " int bar() {\n" +
- " foo(<CompleteOnName:str>);\n" +
- " }\n" +
- " void stringAppend(String s1, String s2) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedReplacedSource = "str";
- String testName = "<complete on variable eliminating other uninteresting method bodies>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on new keyword
- */
-public void test07(){
-
- String str =
- "import java.io.* \n" +
- " \n" +
- "public class X extends IOException { \n" +
- " int foo() { \n" +
- " X x = new X( \n" +
- "} \n";
-
- String completeBehind = "= n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " X x = <CompleteOnName:n>;\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "new";
- String testName = "<complete on new keyword>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on field type in anonymous type.
- */
-public void test08() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "package test;\n" +
- "import java.util.Vector;\n" +
- "public class VA {\n" +
- " Object o1 = new Object() {\n" +
- " V\n" +
- " void foo2() {\n" +
- " int i = 1;\n" +
- " }\n" +
- " };\n" +
- " String s2;\n" +
- " void bar() {\n" +
- " }\n" +
- " void foo() { \n" +
- " new String[] {}..equals()\n" +
- " }\n" +
- "}\n",
- // completeBehind:
- " V",
- // expectedCompletionNodeToString:
- "<CompleteOnType:V>",
- // expectedUnitDisplayString:
- "package test;\n" +
- "import java.util.Vector;\n" +
- "public class VA {\n" +
- " Object o1 = new Object() {\n" +
- " <CompleteOnType:V>;\n" +
- " void foo2() {\n" +
- " }\n" +
- " };\n" +
- " String s2;\n" +
- " public VA() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "V",
- // expectedReplacedSource:
- "V",
- // test name
- "<completion on field type in anonymous type>"
- );
-}
-/*
- * Complete on argument name
- */
-public void test09() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "package pack; \n"+
- "class A { \n"+
- " \n"+
- " public static void main(String[] argv \n"+
- " new Member().f \n"+
- " ; \n"+
- " } \n"+
- " class Member { \n"+
- " int foo() \n"+
- " } \n"+
- " } \n"+
- "}; \n",
- // completeBehind:
- "argv",
- // expectedCompletionNodeToString:
- "<CompleteOnArgumentName:String[] argv>",
- // expectedUnitDisplayString:
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " }\n" +
- " public static void main(<CompleteOnArgumentName:String[] argv>) {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "argv",
- // expectedReplacedSource:
- "argv",
- // test name
- "<completion on argument name>"
- );
-}
-/*
- * Complete on argument name
- */
-public void test10() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "package pack; \n"+
- "class A { \n"+
- " \n"+
- " public static void main(String[] argv \n"+
- " new Member().f \n"+
- " ; \n"+
- " } \n"+
- " class Member { \n"+
- " int foo() \n"+
- " } \n"+
- " } \n"+
- "}; \n",
- // completeBehind:
- "argv",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " }\n" +
- " public static void main(<CompleteOnArgumentName:String[] argv>) {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<completion on argument name>"
- );
-}
-/*
- * Complete inside method with incomplete signature
- */
-public void test11() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "package pack; \n"+
- "class A { \n"+
- " \n"+
- " public static void main(String[] argv \n"+
- " new Member().f \n"+
- " ; \n"+
- " } \n"+
- " class Member { \n"+
- " int foo() \n"+
- " } \n"+
- " } \n"+
- "}; \n",
- // completeBehind:
- "new Member().f",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:new Member().f>",
- // expectedUnitDisplayString:
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " <CompleteOnMemberAccess:new Member().f>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "f",
- // expectedReplacedSource:
- "f",
- // test name
- "<complete inside method with incomplete signature>"
- );
-}
-/*
- * Complete on argument name with class decl later on
- */
-public void test12() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class DD { \n"+
- " public static void main(String[] argv \n"+
- " \n"+
- "class D { \n"+
- " \n"+
- " int i; \n"+
- " class Mem1 {} \n"+
- " int dumb(String s) \n"+
- " int dumb(float fNum, double dNum) { \n"+
- " dumb(\"world\", i); \n"+
- " \n"+
- " if (i == 0) { \n"+
- " class Local { \n"+
- " \n"+
- " int hello() \n",
- // completeBehind:
- "argv",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class DD {\n" +
- " DD() {\n" +
- " }\n" +
- " public static void main(<CompleteOnArgumentName:String[] argv>) {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on argument name with class decl later on>"
- );
-}
-/*
- * Complete behind array type
- */
-public void test13() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class C { \n"+
- " void test() { \n"+
- " String[]. \n"+
- " } \n"+
- "} \n",
- // completeBehind:
- "String[].",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:String[].>",
- // expectedUnitDisplayString:
- "class C {\n" +
- " C() {\n" +
- " }\n" +
- " void test() {\n" +
- " <CompleteOnClassLiteralAccess:String[].>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "String[].",
- // test name
- "<complete behind array type>"
- );
-}
-/*
- * Complete inside array type
- */
-public void test14() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "public class B { \n"+
- " class Member {} \n"+
- " \n"+
- " int[] j; \n",
- // completeBehind:
- "int[",
- // expectedCompletionNodeToString:
- NONE,
- // expectedUnitDisplayString:
- "public class B {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " }\n" +
- " public B() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- NONE,
- // test name
- "<complete inside array type>"
- );
-}
-/*
- * Complete inside array type
- */
-public void test15() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "public class B { \n"+
- " class Member {} \n"+
- " \n"+
- " int[ \n",
- // completeBehind:
- "int[",
- // expectedCompletionNodeToString:
- NONE,
- // expectedUnitDisplayString:
- "public class B {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " }\n" +
- " public B() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- NONE,
- // test name
- "<complete inside array type>"
- );
-}
-/*
- * Complete behind invalid array type
- */
-public void test16() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "public class B { \n"+
- " class Member {} \n"+
- " \n"+
- " int[ \n"+
- " Obje \n",
- // completeBehind:
- "Obje",
- // expectedCompletionNodeToString:
- "<CompleteOnType:Obje>",
- // expectedUnitDisplayString:
- "public class B {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " }\n" +
- " <CompleteOnType:Obje>;\n" +
- " public B() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "Obje",
- // expectedReplacedSource:
- "Obje",
- // test name
- "<complete behind invalid array type>"
- );
-}
-/*
- * Complete behind invalid base type
- */
-public void test17() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class D { \n" +
- " class Member {} \n" +
- " \n" +
- " void test() { \n" +
- " int. \n" +
- " test(); \n" +
- " } \n",
- // completeBehind:
- "int.",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:int.>",
- // expectedUnitDisplayString:
- "class D {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " }\n" +
- " D() {\n" +
- " }\n" +
- " void test() {\n" +
- " <CompleteOnClassLiteralAccess:int.>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "int.",
- // test name
- "<complete behind invalid base type>"
- );
-}
-/*
- * Complete behind incomplete local method header
- */
-public void test18() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class E { \n"+
- " int bar() { \n"+
- " class Local { \n"+
- " int hello() { \n",
- // completeBehind:
- "hello()",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class E {\n" +
- " E() {\n" +
- " }\n" +
- " int bar() {\n" +
- " class Local {\n" +
- " Local() {\n" +
- " }\n" +
- " int hello() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete behind incomplete local method header>"
- );
-}
-/*
- * Complete behind catch variable
- */
-public void test19() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Test { \n" +
- " void foo() { \n" +
- " try { \n" +
- " } catch (Exception e) { \n" +
- " } \n" +
- " e \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "\n\t\te",
- // expectedCompletionNodeToString:
- "<CompleteOnName:e>",
- // expectedUnitDisplayString:
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "e",
- // expectedReplacedSource:
- "e",
- // test name
- "<complete behind catch variable>"
- );
-}
-/*
- * Complete on catch variable
- */
-public void test20() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Test { \n" +
- " void foo() { \n" +
- " try { \n" +
- " } catch (Exception e) { \n" +
- " e \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "\n\t\t\te",
- // expectedCompletionNodeToString:
- "<CompleteOnName:e>",
- // expectedUnitDisplayString:
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception e;\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "e",
- // expectedReplacedSource:
- "e",
- // test name
- "<complete on catch variable>"
- );
-}
-/*
- * Complete on catch variable after syntax error
- */
-public void test21() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Test { \n" +
- " void foo() { \n" +
- " try { \n" +
- " bar \n" +
- " } catch (Exception e) { \n" +
- " e \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "\n\t\t\te",
- // expectedCompletionNodeToString:
- "<CompleteOnName:e>",
- // expectedUnitDisplayString:
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception e;\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- "}\n"
- ,
- // expectedCompletionIdentifier:
- "e",
- // expectedReplacedSource:
- "e",
- // test name
- "<complete on catch variable after syntax error>"
- );
-}
-/*
- * Complete on constructor type name
- * 1G1HF7P: ITPCOM:WIN98 - CodeAssist may not work in constructor signature
- */
-public void test22() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "public class SomeType {\n" +
- " public SomeType(int i){}\n" +
- "}\n" +
- "\n" +
- "class SomeOtherType extends SomeType {\n" +
- " SomeOtherType(int i){\n" +
- " super(i);\n" +
- " }\n" +
- "}\n",
- // completeBehind:
- " SomeOther",
- // expectedCompletionNodeToString:
- "<CompleteOnType:SomeOther>",
- // expectedUnitDisplayString:
- "public class SomeType {\n" +
- " public SomeType(int i) {\n" +
- " }\n" +
- "}\n" +
- "class SomeOtherType extends SomeType {\n" +
- " <CompleteOnType:SomeOther>;\n" +
- " int i;\n" +
- " {\n" +
- " }\n" +
- " SomeOtherType() {\n" +
- " }\n" +
- "}\n"
- ,
- // expectedCompletionIdentifier:
- "SomeOther",
- // expectedReplacedSource:
- "SomeOtherType",
- // test name
- "<complete on constructor type name>"
- );
-}
-/**
- * Complete in initializer in recovery mode
- */
-public void test23() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "package p;\n" +
- "public class X {\n" +
- " void foo(){)\n" +
- " {\n" +
- " Obj\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // completeBehind:
- "Obj",
- // expectedCompletionNodeToString:
- "<CompleteOnName:Obj>",
- // expectedUnitDisplayString:
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:Obj>;\n" +
- " }\n" +
- " }\n" +
- "}\n"
- ,
- // expectedCompletionIdentifier:
- "Obj",
- // expectedReplacedSource:
- "Obj",
- // test name
- "<complete in initializer>"
- );
-}
-/**
- * Complete after initializer in recovery mode
- */
-public void test24() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "package p;\n" +
- "public class X {\n" +
- " void foo(){)\n" +
- " int v1;\n" +
- " {\n" +
- " int v2\n" +
- " }\n" +
- " Obj" +
- " }\n" +
- "}\n",
- // completeBehind:
- "Obj",
- // expectedCompletionNodeToString:
- "<CompleteOnName:Obj>",
- // expectedUnitDisplayString:
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int v1;\n" +
- " <CompleteOnName:Obj>;\n" +
- " }\n" +
- "}\n"
- ,
- // expectedCompletionIdentifier:
- "Obj",
- // expectedReplacedSource:
- "Obj",
- // test name
- "<complete after initializer>"
- );
-}
-/**
- * Complete after dot, before a number .<|>12
- */
-public void test25() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " this.12\n" +
- " }\n" +
- "}\n",
- // completeBehind:
- "this.",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:this.>",
- // expectedUnitDisplayString:
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:this.>;\n" +
- " }\n" +
- "}\n"
- ,
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "this.",
- // test name
- "<complete after dot number>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
deleted file mode 100644
index c384268..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java
+++ /dev/null
@@ -1,2375 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest;
-
-public class ComplianceDiagnoseTest extends AbstractRegressionTest {
- public ComplianceDiagnoseTest(String name) {
- super(name);
- }
-// Static initializer to specify tests subset using TESTS_* static variables
-// All specified tests which does not belong to the class are skipped...
-//static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 50 };
-// TESTS_RANGE = new int[] { 21, 50 };
-//}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-public static Class testClass() {
- return ComplianceDiagnoseTest.class;
-}
-public void runComplianceParserTest(
- String[] testFiles,
- String expected13ProblemLog,
- String expected14ProblemLog,
- String expected15ProblemLog){
- if(COMPLIANCE_1_3.equals(this.complianceLevel)) {
- this.runNegativeTest(testFiles, expected13ProblemLog);
- } else if(COMPLIANCE_1_4.equals(this.complianceLevel)) {
- this.runNegativeTest(testFiles, expected14ProblemLog);
- } else if(this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
- this.runNegativeTest(testFiles, expected15ProblemLog);
- }
-}
-public void test0001() {
- String[] testFiles = new String[] {
- "X.java",
- "import static aaa.BBB.*;\n" +
- "public class X {\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.BBB.*;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static aaa.BBB.*;\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.BBB.*;\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0002() {
- String[] testFiles = new String[] {
- "X.java",
- "import static aaa.BBB.CCC;\n" +
- "public class X {\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.BBB.CCC;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static aaa.BBB.CCC;\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.BBB.CCC;\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0003() {
- String[] testFiles = new String[] {
- "X.java",
- "public enum X {\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public enum X {\n" +
- " ^^^^\n" +
- "Syntax error on token \"enum\", interface expected\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0004() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(){\n" +
- " for(String o: c) {\n" +
- " }\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(String o: c) {\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, \'for each\' statements are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " for(String o: c) {\n" +
- " ^\n" +
- "c cannot be resolved\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(String o: c) {\n" +
- " ^\n" +
- "c cannot be resolved\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0005() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Z ... arg){\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(Z ... arg){\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(Z ... arg){\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(Z ... arg){\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0006() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X <T1 extends String, T2> extends Y {\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0007() {
- String[] testFiles = new String[] {
- "X.java",
- "public interface X <T1 extends String, T2> extends Y {\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public interface X <T1 extends String, T2> extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public interface X <T1 extends String, T2> extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " public interface X <T1 extends String, T2> extends Y {\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public interface X <T1 extends String, T2> extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0008() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public <T1 extends String, T2> int foo(){\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String, T2> int foo(){\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public <T1 extends String, T2> int foo(){\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String, T2> int foo(){\n" +
- " ^^^^^\n" +
- "This method must return a result of type int\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0009() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public <T1 extends String, T2> X(){\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String, T2> X(){\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public <T1 extends String, T2> X(){\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0010() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " Z<Y1, Y2> var;\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y1 cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y1 cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0011() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public X(){\n" +
- " <Y1, Y2>this(null);\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " <Y1, Y2>this(null);\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <Y1, Y2>this(null);\n" +
- " ^^\n" +
- "Y1 cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " <Y1, Y2>this(null);\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " <Y1, Y2>this(null);\n" +
- " ^^\n" +
- "Y1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <Y1, Y2>this(null);\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0012() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " assert true;\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " assert true;\n" +
- " ^^^^^^\n" +
- "\'assert\' should not be used as an identifier, since it is a reserved keyword from source level 1.4 on\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " assert true;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"assert\", AssignmentOperator expected after this token\n" +
- "----------\n";
- String expected14ProblemLog =
- "";
-
- String expected15ProblemLog =
- expected14ProblemLog;
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0013() {
- String[] testFiles = new String[] {
- "X.java",
- "import static aaa.*\n" +
- "public class X {\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.*\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static aaa.*\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " import static aaa.*\n" +
- " ^\n" +
- "Syntax error on token \"*\", ; expected after this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.*\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static aaa.*\n" +
- " ^\n" +
- "Syntax error on token \"*\", ; expected after this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0014() {
- String[] testFiles = new String[] {
- "X.java",
- "public enum X \n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public enum X \n" +
- "}\n" +
- " ^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public enum X \n" +
- " ^\n" +
- "Syntax error on token \"X\", { expected after this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0015() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(){\n" +
- " for(String o: c) {\n" +
- " #\n" +
- " }\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(String o: c) {\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, \'for each\' statements are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0016() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Z ... arg){\n" +
- " }\n" +
- " #\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(Z ... arg){\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(Z ... arg){\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(Z ... arg){\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0017() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X <T1 extends String, T2> extends Y {\n" +
- " #\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2> extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0018() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public <T1 extends String, T2> int foo(){\n" +
- " }\n" +
- " #\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String, T2> int foo(){\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public <T1 extends String, T2> int foo(){\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0019() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " Z<Y1, Y2> var;\n" +
- " #\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y1 cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 3)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y1 cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " Z<Y1, Y2> var;\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0020() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " assert true;\n" +
- " #\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " assert true;\n" +
- " ^^^^^^\n" +
- "\'assert\' should not be used as an identifier, since it is a reserved keyword from source level 1.4 on\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " assert true;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"assert\", AssignmentOperator expected after this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n";
-
- String expected15ProblemLog =
- expected14ProblemLog;
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-//TODO (david) suspicious behavior
-public void test0021() {
- String[] testFiles = new String[] {
- "X.java",
- "import staic aaa.*;\n" +
- "public class X {\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import staic aaa.*;\n" +
- " ^^^^^\n" +
- "The import staic cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import staic aaa.*;\n" +
- " ^^^\n" +
- "Syntax error on token \"aaa\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import staic aaa.*;\n" +
- " ^^^^^\n" +
- "Syntax error on token \"staic\", static expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import staic aaa.*;\n" +
- " ^^^^^\n" +
- "The import staic cannot be resolved\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-//TODO (david) suspicious behavior
-public void test0022() {
- String[] testFiles = new String[] {
- "X.java",
- "import static aaa.*.*;\n" +
- "public class X {\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.*.*;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static aaa.*.*;\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " import static aaa.*.*;\n" +
- " ^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static aaa.*.*;\n" +
- " ^^^\n" +
- "The import aaa cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static aaa.*.*;\n" +
- " ^\n" +
- "Syntax error on token \"*\", Identifier expected\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0023() {
- String[] testFiles = new String[] {
- "X.java",
- "import static for;\n" +
- "public class X {\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static for;\n" +
- " ^^^^^^^^^^\n" +
- "Syntax error on tokens, Name expected instead\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static for;\n" +
- " ^^^\n" +
- "Syntax error on token \"for\", Identifier expected\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-
-//TODO (david) reenable once bug is fixed
-public void _test0024() {
- String[] testFiles = new String[] {
- "X.java",
- "import static {aaa};\n" +
- "public class X {\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static {aaa};\n" +
- " ^^^^^^^^^^^^\n" +
- "Syntax error on tokens, Name expected instead\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static {aaa};\n" +
- " ^^^^^\n" +
- "Syntax error on tokens, Name expected instead\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0025() {
- String[] testFiles = new String[] {
- "X.java",
- "static aaa.*;\n" +
- "public class X {\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " static aaa.*;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"static\", import expected\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " static aaa.*;\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"static\", import expected before this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0026() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(){\n" +
- " for(Object o ? c){\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(Object o ? c){\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"Object\", ( expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " for(Object o ? c){\n" +
- " ^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " for(Object o ? c){\n" +
- " ^\n" +
- "Syntax error, insert \"AssignmentOperator Expression\" to complete Assignment\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 3)\n" +
- " for(Object o ? c){\n" +
- " ^\n" +
- "Syntax error, insert \"; ; ) Statement\" to complete BlockStatements\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(Object o ? c){\n" +
- " ^\n" +
- "Syntax error on token \"?\", : expected\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0027() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(){\n" +
- " for(Object o : switch){\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(Object o : switch){\n" +
- " ^\n" +
- "Syntax error, insert \"; ; ) Statement\" to complete BlockStatements\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for(Object o : switch){\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"switch\", invalid Expression\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0028() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(int ... ){\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int ... ){\n" +
- " ^^^\n" +
- "Syntax error on token \"...\", invalid VariableDeclaratorId\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int ... ){\n" +
- " ^^^\n" +
- "Syntax error on token \"...\", VariableDeclaratorId expected after this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0029() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(int ... for){\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int ... for){\n" +
- " ^^^^^^^\n" +
- "Syntax error on tokens, VariableDeclaratorId expected instead\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int ... for){\n" +
- " ^^^\n" +
- "Syntax error on token \"for\", invalid VariableDeclaratorId\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0030() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(int .. aaa){\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int .. aaa){\n" +
- " ^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int .. aaa){\n" +
- " ^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0031() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(int ... aaa bbb){\n" +
- " }\n" +
- "}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int ... aaa bbb){\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " void foo(int ... aaa bbb){\n" +
- " ^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X {\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(int ... aaa bbb){\n" +
- " ^^^\n" +
- "Syntax error on token \"bbb\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0032() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X <T1 extends String, T2 extends Y {\n" +
- " \n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2 extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2 extends Y {\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2 extends Y {\n" +
- " ^\n" +
- "Syntax error, insert \">\" to complete ReferenceType1\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends String, T2 extends Y {\n" +
- " ^\n" +
- "Y cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0033() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X T1 extends String, T2> extends Y {\n" +
- " \n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X T1 extends String, T2> extends Y {\n" +
- " ^^\n" +
- "Syntax error on token \"T1\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X T1 extends String, T2> extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X T1 extends String, T2> extends Y {\n" +
- " ^\n" +
- "Syntax error on token \"X\", < expected after this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0034() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X <T1 extnds String, T2> extends Y {\n" +
- " \n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extnds String, T2> extends Y {\n" +
- " ^\n" +
- "Syntax error on token \"<\", { expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extnds String, T2> extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, InterfaceHeaderName expected instead\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extnds String, T2> extends Y {\n" +
- " ^^^^^^\n" +
- "extnds cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extnds String, T2> extends Y {\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"String\", delete this token\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 3)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extnds String, T2> extends Y {\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"extnds\", extends expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extnds String, T2> extends Y {\n" +
- " ^^^^^^\n" +
- "extnds cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0035() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X <T1 extends for, T2> extends Y {\n" +
- " \n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends for, T2> extends Y {\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X <T1 extends for, T2> extends Y {\n" +
- " ^^^\n" +
- "Syntax error on token \"for\", invalid ReferenceType\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0036() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public <T1 extends String, T2> foo(){\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String, T2> foo(){\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String, T2> foo(){\n" +
- " ^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public <T1 extends String, T2> foo(){\n" +
- " ^^^^^^\n" +
- "The type parameter T1 should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String, T2> foo(){\n" +
- " ^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0037() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public <T1 extnds String, T2> int foo(){\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extnds String, T2> int foo(){\n" +
- " ^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <T1 extnds String, T2> int foo(){\n" +
- " ^^\n" +
- "T1 cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " public <T1 extnds String, T2> int foo(){\n" +
- " ^\n" +
- "Syntax error on token \">\", ; expected\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extnds String, T2> int foo(){\n" +
- " ^^\n" +
- "T1 cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <T1 extnds String, T2> int foo(){\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"extnds\", extends expected\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0038() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public <T1 extends String T2> int foo(){\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String T2> int foo(){\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String T2> int foo(){\n" +
- " ^\n" +
- "Syntax error on token \">\", ; expected\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T1 extends String T2> int foo(){\n" +
- " ^^\n" +
- "Syntax error on token \"T2\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0039() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " Z Y1, Y2> var;\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z Y1, Y2> var;\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z Y1, Y2> var;\n" +
- " ^\n" +
- "Syntax error on token \">\", , expected\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z Y1, Y2> var;\n" +
- " ^\n" +
- "Z cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z Y1, Y2> var;\n" +
- " ^\n" +
- "Syntax error on token \">\", , expected\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0040() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " Z <Y1, Y2 var;\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z <Y1, Y2 var;\n" +
- " ^^^^^^^\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z <Y1, Y2 var;\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z <Y1, Y2 var;\n" +
- " ^^\n" +
- "Syntax error, insert \">\" to complete ReferenceType1\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " Z <Y1, Y2 var;\n" +
- " ^^\n" +
- "Y2 cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0041() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " Z <Y1, for Y2> var;\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z <Y1, for Y2> var;\n" +
- " ^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Z <Y1, for Y2> var;\n" +
- " ^^^\n" +
- "Syntax error on token \"for\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0042() {
- String[] testFiles = new String[] {
- "X.java",
- "void ___eval() {\n" +
- " new Runnable() {\n" +
- " int ___run() throws Throwable {\n" +
- " return blah;\n" +
- " }\n" +
- " private String blarg;\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- "public class X {\n" +
- " private static int x;\n" +
- " private String blah;\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void hello() {\n" +
- " }\n" +
- " public boolean blah() {\n" +
- " return false;\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", @ expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^\n" +
- "Syntax error on token \")\", delete this token\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " };\n" +
- " ^\n" +
- "Syntax error on token \"}\", { expected\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MemberValueArrayInitializer\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \")\" to complete Modifiers\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"enum Identifier\" to complete EnumHeader\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"EnumBody\" to complete JavaScriptUnit\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=72942
- */
-public void test0043() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- "}\n" +
- "public static void foo(){}\n" +
- "\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public static void foo(){}\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- expected13ProblemLog;
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=62472
- */
-public void test0044() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public <T> X(T t){\n" +
- " System.out.println(t);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " class Local extends X {\n" +
- " Local() {\n" +
- " <String>super(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- " new Local();\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public <T> X(T t){\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public <T> X(T t){\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " <String>super(\"SUCCESS\");\n" +
- " ^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " <String>super(\"SUCCESS\");\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " <String>super(\"SUCCESS\");\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The constructor X(String) is undefined\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=62472
- */
-public void test0045() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(){\n" +
- " }\n" +
- " }\n" +
- " public void bar() {\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- expected13ProblemLog;
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74519
- */
-public void test0046() {
- String[] testFiles = new String[] {
- "X.java",
- "public @interface X {\n" +
- " String annName();\n" +
- "}"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public @interface X {\n" +
- " ^\n" +
- "Syntax error, annotation declarations are only available if source level is 5.0\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog = "";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74519
- */
-public void test0047() {
- String[] testFiles = new String[] {
- "A.java",
- "public @interface A {}",
- "X.java",
- "@A public class X {\n" +
- "}"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in A.java (at line 1)\n" +
- " public @interface A {}\n" +
- " ^\n" +
- "Syntax error, annotation declarations are only available if source level is 5.0\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @A public class X {\n" +
- " ^^\n" +
- "Syntax error, annotations are only available if source level is 5.0\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog = "";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0048() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X ... arg[]){\n" +
- " }\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(X ... arg[]){\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(X ... arg[]){\n" +
- " ^^^\n" +
- "Extended dimensions are illegal for a variable argument\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0049() {
- String[] testFiles = new String[] {
- "X.java",
- "@interface MyAnn {\n" +
- " String value1() default \"\";\n" +
- " String value2();\n" +
- "}\n" +
- "class ZZZ {} \n" +
- "public @MyAnn(\"\",\"\") class Test { \n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " @interface MyAnn {\n" +
- " ^^^^^\n" +
- "Syntax error, annotation declarations are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public @MyAnn(\"\",\"\") class Test { \n" +
- " ^^\n" +
- "Syntax error, insert \")\" to complete Modifier\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public @MyAnn(\"\",\"\") class Test { \n" +
- " ^\n" +
- "Syntax error on token \",\", / expected\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0050() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(List<String>... args) {}\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(List<String>... args) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(List<String>... args) {}\n" +
- " ^^^^\n" +
- "List cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " void foo(List<String>... args) {}\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(List<String>... args) {}\n" +
- " ^^^^\n" +
- "List cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-public void test0051() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(java.util.List2<String>... args) {}\n" +
- "}\n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(java.util.List2<String>... args) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void foo(java.util.List2<String>... args) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "java.util.List2 cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " void foo(java.util.List2<String>... args) {}\n" +
- " ^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(java.util.List2<String>... args) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "java.util.List2 cannot be resolved to a type\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=154811
-public void test0052() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " void foo1() {\n" +
- " class Y {\n" +
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- " class Z<T> { \n" +
- " }\n" +
- " }\n" +
- "} \n"
- };
-
- String expected13ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void foo2() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", new expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " class Z<T> { \n" +
- " ^^^^^\n" +
- "Syntax error on token \"class\", invalid AssignmentOperator\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class Z<T> { \n" +
- " ^\n" +
- "Syntax error on token \">\", ; expected\n" +
- "----------\n";
- String expected14ProblemLog =
- expected13ProblemLog;
-
- String expected15ProblemLog =
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " void foo2() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", new expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete Statement\n" +
- "----------\n";
-
- runComplianceParserTest(
- testFiles,
- expected13ProblemLog,
- expected14ProblemLog,
- expected15ProblemLog
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietCompletionTest.java
deleted file mode 100644
index ed93f7f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietCompletionTest.java
+++ /dev/null
@@ -1,2033 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.codeassist.complete.InvalidCursorLocation;
-
-public class DietCompletionTest extends AbstractCompletionTest {
-public DietCompletionTest(String testName){
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(DietCompletionTest.class);
-}
-/*
- * Complete on superclass
- */
-public void test01() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException { \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnClass:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:IOEx> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOException";
- String testName = "<complete on superclass>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on superinterface
- */
-public void test02() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException implements Serializable { \n" +
- " int foo(){} \n" +
- "} \n";
-
- String completeBehind = "Seria";
- String expectedCompletionNodeToString = "<CompleteOnInterface:Seria>";
- String completionIdentifier = "Seria";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException implements <CompleteOnInterface:Seria> {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "Serializable";
- String testName = "<complete on superinterface>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on qualified superclass
- */
-public void test03() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends java.io.IOException { \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnClass:java.io.IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:java.io.IOEx> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.IOException";
- String testName = "<complete on qualified superclass>";
-
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-
-}
-/*
- * Complete on qualified superinterface
- */
-public void test04() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException implements java.io.Serializable { \n" +
- "} \n";
-
- String completeBehind = "Seria";
- String expectedCompletionNodeToString = "<CompleteOnInterface:java.io.Seria>";
- String completionIdentifier = "Seria";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException implements <CompleteOnInterface:java.io.Seria> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.Serializable";
- String testName = "<complete on qualified superinterface>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on incomplete superclass
- */
-public void test05() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOEx { \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnClass:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:IOEx> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete on incomplete superclass>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on incomplete superinterface
- */
-public void test06() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException implements Seria { \n" +
- "} \n";
-
- String completeBehind = "Seria";
- String expectedCompletionNodeToString = "<CompleteOnInterface:Seria>";
- String completionIdentifier = "Seria";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException implements <CompleteOnInterface:Seria> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "Seria";
- String testName = "<complete on incomplete superinterface>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on incomplete qualified superclass
- */
-public void test07() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends java.io.IOEx { \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnClass:java.io.IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString = "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:java.io.IOEx> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.IOEx";
- String testName = "<complete on incomplete qualified superclass>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on incomplete qualified superinterface
- */
-public void test08() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException implements java.io.Seria { \n" +
- "} \n";
-
- String completeBehind = "Seria";
- String expectedCompletionNodeToString = "<CompleteOnInterface:java.io.Seria>";
- String completionIdentifier = "Seria";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException implements <CompleteOnInterface:java.io.Seria> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.Seria";
- String testName = "<complete on incomplete qualified superinterface>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete inside qualified superclass
- */
-public void test09() {
-
- String str =
- " \n" +
- "public class X extends java.io.IOException { \n" +
- "} \n";
-
- String completeBehind = ".io";
- String expectedCompletionNodeToString = "<CompleteOnClass:java.io>";
- String completionIdentifier = "io";
- String expectedUnitDisplayString =
- "public class X extends <CompleteOnClass:java.io> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.IOException";
- String testName = "<complete inside qualified superclass>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete inside qualified superinterface
- */
-public void test10() {
-
- String str =
- "public class X extends IOException implements java.io.Serializable { \n" +
- "} \n";
-
- String completeBehind = ".io";
- String expectedCompletionNodeToString = "<CompleteOnInterface:java.io>";
- String completionIdentifier = "io";
- String expectedUnitDisplayString =
- "public class X extends IOException implements <CompleteOnInterface:java.io> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.Serializable";
- String testName = "<complete inside qualified superinterface>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete inside qualified superclass ending with dot
- */
-public void test11() {
-
- String str =
- " \n" +
- "public class X extends java.io. { \n" +
- "} \n";
-
- String completeBehind = ".io.";
- String expectedCompletionNodeToString = "<CompleteOnClass:java.io.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "public class X extends <CompleteOnClass:java.io.> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.";
- String testName = "<complete inside qualified superclass ending with dot>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete inside qualified superinterface ending with dot
- */
-public void test12() {
-
- String str =
- "public class X extends IOException implements java.io. { \n" +
- "} \n";
-
- String completeBehind = ".io.";
- String expectedCompletionNodeToString = "<CompleteOnInterface:java.io.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "public class X extends IOException implements <CompleteOnInterface:java.io.> {\n" +
- " public X() {\n" +
-
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.";
- String testName = "<complete inside qualified superinterface ending with dot>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on empty superclass
- */
-public void test13() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends { \n" +
- "} \n";
-
- String completeBehind = "extends ";
- String expectedCompletionNodeToString = "<CompleteOnClass:>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "";
- String testName = "<complete on empty superclass>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on empty superinterface
- */
-public void test14() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException implements { \n" +
- "} \n";
-
- String completeBehind = "implements ";
- String expectedCompletionNodeToString = "<CompleteOnInterface:>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends IOException implements <CompleteOnInterface:> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "";
- String testName = "<complete on empty superinterface>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on empty superclass followed by identifier
- */
-public void test15() {
-
- String str =
- "public class X extends java.io. IOException { \n" +
- "} \n";
-
- String completeBehind = "java.io.";
- String expectedCompletionNodeToString = "<CompleteOnClass:java.io.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "public class X extends <CompleteOnClass:java.io.> {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.";
- String testName = "<complete on empty superclass followed by identifier>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on keyword extends
- */
-public void test16() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends { \n" +
- "} \n";
-
- String completeBehind = "extends";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:extends>";
- String completionIdentifier = "extends";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnKeyword:extends> {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "extends";
- String testName = "<complete on keyword extends>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in keyword extends
- */
-public void test17() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X ext { \n" +
- "} \n";
-
- String completeBehind = "ext";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
- String completionIdentifier = "ext";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnKeyword:ext> {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "ext";
- String testName = "<complete in keyword extends>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in field type
- */
-public void test18() {
-
- String str =
- "class X { \n" +
- " \n" +
- " IOException x; \n" +
- "} \n";
-
- String completeBehind = "IO";
- String expectedCompletionNodeToString = "<CompleteOnType:IO>;";
- String completionIdentifier = "IO";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:IO>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOException";
- String testName = "<complete in field type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete at beginning of field type
- */
-public void test19() {
-
- String str =
- "class X { \n" +
- " \n" +
- " final IOException x; \n" +
- "} \n";
-
- String completeBehind = "final ";
- String expectedCompletionNodeToString = "<CompleteOnType:>;";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOException";
- String testName = "<complete at beginning of field type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete at beginning of superclass
- */
-public void test20() {
-
- String str =
- "class X extends IOException { \n" +
- " \n" +
- "} \n";
-
- String completeBehind = "extends ";
- String expectedCompletionNodeToString = "<CompleteOnClass:>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "class X extends <CompleteOnClass:> {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOException";
- String testName = "<complete at beginning of superclass>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in return type
- */
-public void test21() {
-
- String str =
- "class X { \n" +
- " IOEx \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in return type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in argument type
- */
-public void test22() {
-
- String str =
- "class X { \n" +
- " int foo(IOEx \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in argument type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in return type
- */
-public void test23() {
-
- String str =
- "class X { \n" +
- " IOEx \n" +
- " \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in return type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in argument type (no closing brace for type)
- */
-public void test24() {
-
- String str =
- "class X { \n" +
- " int foo(IOEx \n" +
- " \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
-
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in argument type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in return type with modifiers
- */
-public void test25() {
-
- String str =
- "class X { \n" +
- " public final IOEx \n" +
- " \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in return type with modifiers>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in field initialization
- */
-public void test26() {
-
- String str =
- "class X { \n" +
- " public final int x = IOEx \n" +
- " \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnName:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " public final int x = <CompleteOnName:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in field initialization>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in nth argument type
- */
-public void test27() {
-
- String str =
- "class X { \n" +
- " int foo(AA a, BB b, IOEx \n" +
- " \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- " int foo(AA a, BB b) {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in nth argument type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in nth argument qualified type
- */
-public void test28() {
-
- String str =
- "class X { \n" +
- " int foo(AA a, BB b, java.io.IOEx \n" +
- " \n";
-
- String completeBehind = ".io.";
- String expectedCompletionNodeToString = "<CompleteOnType:java.io.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "class X {\n" +
- " <CompleteOnType:java.io.>;\n" +
- " X() {\n" +
- " }\n" +
- " int foo(AA a, BB b) {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.IOEx";
- String testName = "<complete in nth argument qualified type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in nth thrown exception qualified type
- */
-public void test29() {
-
- String str =
- "class X { \n" +
- " public int foo(AA a, BB b) throws AA, java.io.IOEx \n" +
- " \n";
-
- String completeBehind = ".io";
- String expectedCompletionNodeToString = "<CompleteOnException:java.io>";
- String completionIdentifier = "io";
- String expectedUnitDisplayString =
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " public int foo(AA a, BB b) throws AA, <CompleteOnException:java.io> {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.IOEx";
- String testName = "<complete in nth thrown exception qualified type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in completed argument
- */
-public void test30() {
-
- String str =
- "class X { \n" +
- " public int foo(AA a, java.io.BB b) \n" +
- " \n";
-
- String completeBehind = "io.";
- String expectedCompletionNodeToString = "<CompleteOnType:java.io.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " public int foo(AA a, <CompleteOnType:java.io.> b) {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.io.BB";
- String testName = "<complete in in completed argument>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Negative test: no diet completion in allocation expression
- */
-public void test31() {
-
- String str =
- "class Bar { \n"+
- " void foo() { \n"+
- " new X().zzz(); \n"+
- " } \n"+
- "}\n";
-
- String completeBehind = "new X";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = NONE;
- String expectedUnitDisplayString =
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = null;
- String testName = "<no diet completion in allocation expression>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Completion in package statement
- */
-public void test32() {
-
- String str =
- "package x.abc \n"+
- "import x.util.*; \n"+
- "import x.*; \n"+
- "class X extends util{ \n"+
- " X(){} \n"+
- " X(int a, int b){} \n"+
- "} \n";
-
- String completeBehind = "x.ab";
- String expectedCompletionNodeToString = "<CompleteOnPackage:x.ab>";
- String completionIdentifier = "ab";
- String expectedUnitDisplayString =
- "package <CompleteOnPackage:x.ab>;\n" +
- "import x.util.*;\n" +
- "import x.*;\n" +
- "class X extends util {\n" +
- " X() {\n" +
- " }\n" +
- " X(int a, int b) {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "x.abc";
- String testName = "<complete in package statement>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Completion in import statement
- */
-public void test33() {
-
- String str =
- "package x.abc; \n"+
- "import x.util \n"+
- "import x.*; \n"+
- "class X extends util{ \n"+
- " X(){} \n"+
- " X(int a, int b){} \n"+
- "} \n";
-
- String completeBehind = "x.util";
- String expectedCompletionNodeToString = "<CompleteOnImport:x.util>";
- String completionIdentifier = "util";
- String expectedUnitDisplayString =
- "package x.abc;\n" +
- "import <CompleteOnImport:x.util>;\n" +
- "import x.*;\n" +
- "class X extends util {\n" +
- " X() {\n" +
- " }\n" +
- " X(int a, int b) {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "x.util";
- String testName = "<complete in import statement>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on superclass behind a unicode
- *
- * -- compute the unicode representation for a given string --
- [ String str = "IOEx";
- StringBuffer buffer = new StringBuffer("\"");
- for (int i = 0; i < str.length(); i++){
- String hex = Integer.toHexString(str.charAt(i));
- buffer.append("\\u0000".substring(0, 6-hex.length()));
- buffer.append(hex);
- }
- buffer.append("\"");
- buffer.toString()
- ]
- */
-public void test34() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOE\\u0078ception { \n" +
- "} \n";
-
- String completeBehind = "IOE\\u0078";
- String expectedCompletionNodeToString = "<CompleteOnClass:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:IOEx> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOE\\u0078ception";
- String testName = "<complete on superclass behind a unicode>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test34a() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOException { \n" +
- "} \n";
-
- String completeBehind = "IOE";
- String expectedCompletionNodeToString = "<CompleteOnClass:IOE>";
- String completionIdentifier = "IOE";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:IOE> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOException";
- String testName = "<complete on superclass before a unicode>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test34b() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOE\\u0078c\\u0065ption { \n" +
- "} \n";
-
- String completeBehind = "IOE\\u0078c\\u0065p";
- String expectedCompletionNodeToString = "<CompleteOnClass:IOExcep>";
- String completionIdentifier = "IOExcep";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:IOExcep> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOE\\u0078c\\u0065ption";
- String testName = "<complete on superclass behind a unicode>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void test34c() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X \\u0065xt\\u0065nds IOE\\u0078c\\u0065ption { \n" +
- "} \n";
-
- String completeBehind = "IOE\\u0078c\\u0065p";
- String expectedCompletionNodeToString = "<CompleteOnClass:IOExcep>";
- String completionIdentifier = "IOExcep";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X extends <CompleteOnClass:IOExcep> {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOE\\u0078c\\u0065ption";
- String testName = "<complete on superclass behind a unicode>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Invalid completion inside a unicode
- *
- * -- compute the unicode representation for a given string --
- [ String str = "IOEx";
- StringBuffer buffer = new StringBuffer("\"");
- for (int i = 0; i < str.length(); i++){
- String hex = Integer.toHexString(str.charAt(i));
- buffer.append("\\u0000".substring(0, 6-hex.length()));
- buffer.append(hex);
- }
- buffer.append("\"");
- buffer.toString()
- ]
- */
-public void test35() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends IOE\\u0078ception { \n" +
- "} \n";
-
- String completeBehind = "IOE\\u00";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = NONE;
- String expectedUnitDisplayString = "";
- String expectedReplacedSource = NONE;
- String testName = "<complete inside unicode>";
-
- try {
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_UNICODE);
- }
-}
-/*
- * Invalid completion inside a comment
- *
- */
-public void test36() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends /*IOException*/ { \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = NONE;
- String expectedUnitDisplayString = "";
- String expectedReplacedSource = NONE;
- String testName = "<complete inside comment>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- try {
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-/*
- * Invalid completion inside a string literal
- *
- */
-public void test37() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X { \n" +
- " String s = \"IOException\"; \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompletionOnString:\"IOEx\">";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X {\n" +
- " String s = <CompletionOnString:\"IOEx\">;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "\"IOException\"";
- String testName = "<complete inside a string literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Invalid completion inside a number literal
- *
- */
-public void test38() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X { \n" +
- " int s = 12345678; \n" +
- "} \n";
-
- String completeBehind = "1234";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = NONE;
- String expectedUnitDisplayString = "";
- String expectedReplacedSource = NONE;
- String testName = "<complete inside a number literal>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- try{
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_NUMBER);
- }
-}
-/*
- * Completion in import statement at the end of the unit
- */
-public void test39() {
-
- String str =
- "package x.abc; \n"+
- "import x.util";
-
- String completeBehind = "x.util";
- String expectedCompletionNodeToString = "<CompleteOnImport:x.util>";
- String completionIdentifier = "util";
- String expectedUnitDisplayString =
- "package x.abc;\n" +
- "import <CompleteOnImport:x.util>;\n";
- String expectedReplacedSource = "x.util";
- String testName = "<complete in import statement at the end of the unit>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Completion in import statement at the end of the unit (qualified empty name)
- */
-public void test40() {
-
- String str =
- "package a.b; \n"+
- "import java.";
-
- String completeBehind = "java.";
- String expectedCompletionNodeToString = "<CompleteOnImport:java.>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "package a.b;\n" +
- "import <CompleteOnImport:java.>;\n";
- String expectedReplacedSource = "java.";
- String testName = "<complete in import statement at the end of the unit>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Should not find any diet completion
- */
-public void test41() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X extends \n" +
- " int foo(String str) \n" +
- " String variable = ; \n" +
- " { \n" +
- " String variableNotInScope; \n" +
- " } \n" +
- " foo(varia \n";
-
- String completeBehind = "foo(var";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "var";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo(String str) {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "varia";
- String testName = "<should not find diet completion>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on array type with prefix dimensions
- */
-public void test42() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X { \n" +
- " int[] foo(String str) \n";
-
- String completeBehind = "int";
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String completionIdentifier = "int";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " <CompleteOnType:int>\n" +
- "}\n";
- String expectedReplacedSource = "int";
- String testName = "<completion on array type with prefix dimensions>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on array type with postfix dimensions
- */
-public void test43() {
-
- String str =
- "import java.io.*; \n" +
- " \n" +
- "public class X { \n" +
- " int foo(String str) [] \n";
-
- String completeBehind = "int";
- String expectedCompletionNodeToString = "<CompleteOnType:int>";
- String completionIdentifier = "int";
- String expectedUnitDisplayString =
- "import java.io.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " <CompleteOnType:int>\n" +
- "}\n";
- String expectedReplacedSource = "int";
- String testName = "<completion on array type with postfix dimensions>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in return type behind other member
- */
-public void test44() {
-
- String str =
- "class X { \n" +
- " int i; \n" +
- " IOEx \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " int i;\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in return type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in return type behind other member
- */
-public void test45() {
-
- String str =
- "class X { \n" +
- " int i; \n" +
- " public IOEx \n" +
- "} \n";
-
- String completeBehind = "IOEx";
- String expectedCompletionNodeToString = "<CompleteOnType:IOEx>";
- String completionIdentifier = "IOEx";
- String expectedUnitDisplayString =
- "class X {\n" +
- " int i;\n" +
- " <CompleteOnType:IOEx>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "IOEx";
- String testName = "<complete in return type>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on name in field initializer
- */
-public void test46() {
-
- String str =
- "class X { \n" +
- " String s = \"hello\"; \n" +
- " int f = s. \n" +
- "} \n";
-
- String completeBehind = "= s";
- String expectedCompletionNodeToString = "<CompleteOnName:s>";
- String completionIdentifier = "s";
- String expectedUnitDisplayString =
- "class X {\n" +
- " String s;\n" +
- " int f = <CompleteOnName:s>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "s";
- String testName = "<complete on name in field initializer>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete in field initializer in innner class
- */
-public void test47() {
-
- String str =
- "class X { \n" +
- " class Y { \n" +
- " Object[] f = { this.foo } \n" +
- " Object foo(){ return this; } \n" +
- "} \n";
-
- String completeBehind = "this.foo";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.foo>";
- String completionIdentifier = "foo";
- String expectedUnitDisplayString =
- "class X {\n" +
- " class Y {\n" +
- " Object[] f = {<CompleteOnMemberAccess:this.foo>};\n" +
- " Y() {\n" +
- " }\n" +
- " Object foo() {\n" +
- " }\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "this.foo";
- String testName = "<complete in field initializer in inner class>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Should not find fake field of type <CompleteOnType:f>
- */
-public void test48() {
-
- String str =
- "package pack; \n"+
- "class A { \n"+
- " \n"+
- " public static void main(String[] argv) \n"+
- " new Member().f \n"+
- " ; \n"+
- " } \n"+
- " class Member { \n"+
- " int foo() \n"+
- " } \n"+
- " } \n"+
- "}; \n";
-
- String completeBehind = "new Member().f";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "f";
- String expectedUnitDisplayString =
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " }\n" +
- "}\n";
-
- String expectedReplacedSource = "f";
- String testName = "<should not find fake field of type f>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Completion in middle of package import statement
- */
-public void test49() {
-
- String str =
- "import java.lang.reflect.*; \n"+
- "class X { \n"+
- "} \n";
-
- String completeBehind = "java.la";
- String expectedCompletionNodeToString = "<CompleteOnImport:java.la>";
- String completionIdentifier = "la";
- String expectedUnitDisplayString =
- "import <CompleteOnImport:java.la>;\n" +
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "java.lang.reflect";
- String testName = "<complete in middle of package import statement>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on instance creation in field initializer.
- */
-public void test50() {
-
- String str =
- "class X { \n" +
- " String s = \"hello\"; \n" +
- " Object o = new Xyz(); \n" +
- "} \n";
-
- String completeBehind = "new X";
- String expectedCompletionNodeToString = "<CompleteOnType:X>";
- String completionIdentifier = "X";
- String expectedUnitDisplayString =
- "class X {\n" +
- " String s;\n" +
- " Object o = new <CompleteOnType:X>();\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "Xyz";
- String testName = "<complete on instance creation in field initializer>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on member access in field initializer.
- */
-public void test51() {
-
- String str =
- "class X { \n" +
- " String s = \"hello\"; \n" +
- " Object o = fred().xyz; \n" +
- "} \n";
-
- String completeBehind = "fred().x";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:fred().x>";
- String completionIdentifier = "x";
- String expectedUnitDisplayString =
- "class X {\n" +
- " String s;\n" +
- " Object o = <CompleteOnMemberAccess:fred().x>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "xyz";
- String testName = "<complete on member access in field initializer>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on class literal access in field initializer.
- */
-public void test52() {
-
- String str =
- "class X { \n" +
- " String s = \"hello\"; \n" +
- " Class c = int[].class; \n" +
- "} \n";
-
- String completeBehind = "int[].c";
- String expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:int[].c>";
- String completionIdentifier = "c";
- String expectedUnitDisplayString =
- "class X {\n" +
- " String s;\n" +
- " Class c = <CompleteOnClassLiteralAccess:int[].c>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "int[].class";
- String testName = "<complete on class literal access in field initializer>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on method invocation in field initializer.
- */
-public void test53() {
-
- String str =
- "class X { \n" +
- " String s = \"hello\"; \n" +
- " Object o = s.concat(); \n" +
- "} \n";
-
- String completeBehind = "s.concat(";
- String expectedCompletionNodeToString = "<CompleteOnMessageSend:s.concat()>";
- String completionIdentifier = "";
- String expectedUnitDisplayString =
- "class X {\n" +
- " String s;\n" +
- " Object o = <CompleteOnMessageSend:s.concat()>;\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "concat(";
- String testName = "<complete on method invocation in field initializer>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Should not find fake field of type <CompleteOnType:f>
- */
-public void test54() {
-
- String str =
- "package pack; \n"+
- "class A { \n"+
- " \n"+
- " public static void main(String[] argv \n"+
- " new Member().f \n"+
- " ; \n"+
- " } \n"+
- " class Member { \n"+
- " int foo() \n"+
- " } \n"+
- " } \n"+
- "}; \n";
-
- String completeBehind = "new Member().f";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "f";
- String expectedUnitDisplayString =
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " }\n" +
- "}\n";
-
- String expectedReplacedSource = "f";
- String testName = "<should not find fake field of type f>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Complete on anonymous type in field initializer.
- */
-public void test55() {
-
- String str =
- "class X { \n" +
- " Object o = new Object(){ \n" +
- " void foo(){ \n" +
- " String x = \"\"; \n" +
- " x.index \n" +
- " } \n" +
- " \n" +
- " void bar(){ \n" +
- " String y = \"\"; \n" +
- " } \n" +
- " }; \n" +
- "} \n";
-
- String completeBehind = "x.index";
- String expectedCompletionNodeToString = "<CompleteOnName:x.index>";
- String completionIdentifier = "index";
- String expectedUnitDisplayString =
- "class X {\n" +
- " Object o = new Object() {\n" +
- " void foo() {\n" +
- " String x;\n" +
- " <CompleteOnName:x.index>;\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "x.index";
- String testName = "<complete on anonymous type in field initializer>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- this.checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietRecoveryTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietRecoveryTest.java
deleted file mode 100644
index 344e6f0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietRecoveryTest.java
+++ /dev/null
@@ -1,7680 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Locale;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionParser;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.SourceElementParser;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-public class DietRecoveryTest extends AbstractCompilerTest {
- public static boolean optimizeStringLiterals = false;
- public static long sourceLevel = ClassFileConstants.JDK1_3; //$NON-NLS-1$
-static {
-// TESTS_NUMBERS = new int[] { 113 };
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(DietRecoveryTest.class);
-}
-
-public DietRecoveryTest(String testName){
- super(testName);
-}
-
-public void checkParse(
- char[] source,
- String expectedDietUnitToString,
- String expectedDietPlusBodyUnitToString,
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- String expectedFullUnitToString,
- String expectedCompletionDietUnitToString, String testName) {
-
- /* using regular parser in DIET mode */
- {
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit diet structure" + testName,
- expectedDietUnitToString,
- computedUnitToString);
- }
- /* using regular parser in DIET mode + getMethodBodies */
- {
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
- parser.setMethodsFullRecovery(false);
- parser.setStatementsRecovery(false);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit diet structure" + testName,
- expectedDietUnitToString,
- computedUnitToString);
- if (computedUnit.types != null) {
- for (int i = computedUnit.types.length; --i >= 0;){
- computedUnit.types[i].parseMethod(parser, computedUnit);
- }
- }
- computedUnitToString = computedUnit.toString();
- if (!expectedDietPlusBodyUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
-
- assertEquals(
- "Invalid unit diet+body structure" + testName,
- expectedDietPlusBodyUnitToString,
- computedUnitToString);
- }
- /* using regular parser in DIET mode + getMethodBodies + statements recovery */
- {
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
- parser.setMethodsFullRecovery(true);
- parser.setStatementsRecovery(true);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit diet structure" + testName,
- expectedDietUnitToString,
- computedUnitToString);
- if (computedUnit.types != null) {
- for (int i = computedUnit.types.length; --i >= 0;){
- computedUnit.types[i].parseMethod(parser, computedUnit);
- }
- }
- computedUnitToString = computedUnit.toString();
- if (!expectedDietPlusBodyPlusStatementsRecoveryUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
-
- assertEquals(
- "Invalid unit diet+body structure with statements recovery" + testName,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- computedUnitToString);
- }
- /* using regular parser in FULL mode */
- {
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.parse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedFullUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit full structure" + testName,
- expectedFullUnitToString,
- computedUnitToString);
-
- }
- /* using source element parser in DIET mode */
- {
- SourceElementParser parser =
- new SourceElementParser(
- new TestSourceElementRequestor(),
- new DefaultProblemFactory(Locale.getDefault()),
- new CompilerOptions(getCompilerOptions()),
- false/*don't record local declarations*/,
- true/*optimize string literals*/);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid source element diet structure" + testName,
- expectedDietUnitToString,
- computedUnitToString);
- }
- /* using source element parser in FULL mode */
- {
- SourceElementParser parser =
- new SourceElementParser(
- new TestSourceElementRequestor(),
- new DefaultProblemFactory(Locale.getDefault()),
- new CompilerOptions(getCompilerOptions()),
- false/*don't record local declarations*/,
- true/*optimize string literals*/);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.parse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedFullUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid source element full structure" + testName,
- expectedFullUnitToString,
- computedUnitToString);
- }
- /* using completion parser in DIET mode */
- {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- CompletionParser parser =
- new CompletionParser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- options,
- new DefaultProblemFactory(Locale.getDefault())));
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult, Integer.MAX_VALUE);
- String computedUnitToString = computedUnit.toString();
- if (!expectedCompletionDietUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid completion diet structure" + testName,
- expectedCompletionDietUnitToString,
- computedUnitToString);
- }
-}
-/*
- * Should treat variables 'h' and 'i' as fields since 'public'.
- */
-public void test01() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<promote local vars into fields>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should filter out local type altogether
- */
-public void test02() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " class L { \n"
- + " void baz(){} \n"
- + " } \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class L {\n" +
- " L() {\n" +
- " super();\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<filter out local type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should still be finding last method (#baz)
- */
-
-public void test03() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<should find last method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should finding 5 fields.
- */
-
-public void test04() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " X x; \n"
- + " Object a, b = null; \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " X x;\n" +
- " Object a;\n" +
- " Object b = null;\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " X x;\n" +
- " Object a;\n" +
- " Object b = null;\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " X x;\n" +
- " Object a;\n" +
- " Object b;\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<five fields>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Diet parse thinks it is successful - no recovery
- */
-
-public void test05() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " void baz(){} \n"
- + " } \n"
- + " \n"
- + " void bar(){ \n"
- + " } \n"
- + " void truc(){ \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new baz() {\n" +
- " };\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<diet was successful>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Recovery will not restart from scratch, and miss some signatures (#baz())
- */
-
-public void test06() {
-
- String s =
- "import java.lang.*; \n"
- + " \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " void baz(){} \n"
- + " } \n"
- + " \n"
- + " void bar(){ \n"
- + " } \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "import java.lang.*;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "import java.lang.*;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<will not miss nested method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Attaching orphan methods and fields
- */
-
-public void test07() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n"
- + " void bar(){ \n"
- + " } \n"
- + " int x; \n"
- + " void baz(){ \n"
- + " } \n"
- + " int y; \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<attaching orphans>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Properly attaching fields/methods to member type
- */
-
-public void test08() {
-
- String s =
- "public class X { \n"
- + " class Y { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " public int h; \n"
- + " public int[] i = {0, 1}; \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<attaching to member type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Properly attaching fields/methods to enclosing type
- */
-
-public void test09() {
-
- String s =
- "public class X { \n"
- + " class Y { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " public int h; \n"
- + " public int[] i = {0, 1}; \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<attaching to enclosing type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Properly attaching fields/methods to member type in presence of missing
- * member type opening brace (Y) (and array initializer for (i)).
- */
-
-public void test10() {
-
- String s =
- "public class X { \n"
- + " class Y \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " public int h; \n"
- + " public int[] i = {0, 1}; \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<missing brace + array initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Attaching orphan methods and fields, by counting brackets
- * variable 'x' should be eliminated (looks like a local variable)
- */
-
-public void test11() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n"
- + " void bar(){ \n"
- + " int x; \n"
- + " void baz(){ \n"
- + " } \n"
- + " int y; \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " int y;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " int x;\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<attaching orphans with missing brackets>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Attaching orphan methods and fields, by counting brackets
- * variable 'x' should NOT be eliminated given it looks like a field
- */
-
-public void test12() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n"
- + " void bar(){ \n"
- + " public int x; \n"
- + " void baz(){ \n"
- + " } \n"
- + " int y; \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<attaching orphans with missing brackets 2>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString ,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should still recover incomplete type signature (missing superclass)
- */
-
-public void test13() {
-
- String s =
- "public class X extends { \n"
- + " void foo() { \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<invalid type header>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should still recover incomplete method signature (missing opening brace)
- */
-
-public void test14() {
-
- String s =
- "public class X extends Thread { \n"
- + " void foo() \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X extends Thread {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X extends Thread {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<method header missing opening brace>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should still recover incomplete method signature (missing thrown exceptions)
- */
-
-public void test15() {
-
- String s =
- "public class X extends Thread { \n"
- + " void foo() throws \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X extends Thread {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X extends Thread {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X extends Thread {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " ;\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<method header missing thrown exceptions>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should still recover incomplete type signature (missing superinterfaces)
- */
-
-public void test16() {
-
- String s =
- "public class X implements \n"
- + " void foo() \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<type header missing superinterfaces>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should still recover incomplete type signature (missing superinterfaces)
- */
-
-public void test17() {
-
- String s =
- "public class X implements Y, \n"
- + " void foo() \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X implements Y {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X implements Y {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<type header missing superinterfaces 2>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find member type behind incomplete enclosing type header
- */
-
-public void test18() {
-
- String s =
- "public class X implements \n"
- + " class Y { \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<member type behind incomplete enclosing type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find member type when missing opening brace
- */
-
-public void test19() {
-
- String s =
- "public class X \n"
- + " class Y { \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n"+
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<member type when missing opening brace>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not find fieldX signature behind missing brace
- */
-
-public void test20() {
-
- String s =
- "public class X \n"
- + " fieldX; \n"
- + " class Y { \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n"+
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<no field behind missing brace>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find Y as member type
- */
-
-public void test21() {
-
- String s =
- "public class X \n"
- + " fieldX; \n"
- + " class Y \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n"+
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find Y as member type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should filter out incomplete local type
- */
-
-public void test22() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " class L extends { \n" +
- " public int l; \n" +
- " void baz(){} \n" +
- " } \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class L {\n" +
- " public int l;\n" +
- " L() {\n" +
- " super();\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should filter out incomplete local type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should filter out incomplete local type and method signature
- */
-
-public void test23() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " class L extends { \n" +
- " public int l; \n" +
- " void baz() throws {} \n" +
- " } \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class L {\n" +
- " public int l;\n" +
- " L() {\n" +
- " super();\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should filter out incomplete local type/method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should filter out anonymous type
- */
-
-public void test24() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " new X(){ \n" +
- " void baz() {} \n" +
- " }.baz(); \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new X() {\n" +
- " void baz() {\n" +
- " }\n" +
- "}.baz();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should filter out incomplete anonymous type/method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should filter out incomplete anonymous type
- */
-
-public void test25() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " new X(){ \n" +
- " void baz() {} \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new X() {\n" +
- " public int h;\n" +
- " void baz() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should filter out incomplete anonymous type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should filter out incomplete anonymous method
- */
-
-public void test26() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " new X(){ \n" +
- " void baz() \n" +
- " } \n" +
- " } \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should filter out incomplete anonymous method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should filter out incomplete local type and local var h
- */
-
-public void test27() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " class L extends { \n" +
- " public int l; \n" +
- " void baz(){} \n" +
- " } \n" +
- " \n" +
- " int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class L {\n" +
- " public int l;\n" +
- " L() {\n" +
- " super();\n" +
- " }\n" +
- " void baz() {\n" +
- " }\n" +
- " }\n" +
- " int h;\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should filter incomplete local type L and variable h>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find <y> as a field in Y
- */
-
-public void test28() {
-
- String s =
- "public class X { \n" +
- " int x; \n" +
- " \n" +
- " int foo(){ } \n" +
- " \n" +
- " class Y { \n" +
- " int y; \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " int y;\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " int x;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " int y;\n" +
- " Y() {\n" +
- " super();\n"+
- " }\n" +
- " }\n" +
- " int x;\n" +
- " public X() {\n" +
- " super();\n"+
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find <y> as a field in Y>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find <y> as a field in X
- */
-
-public void test29() {
-
- String s =
- "public class X { \n" +
- " int x; \n" +
- " \n" +
- " int foo(){ } \n" +
- " \n" +
- " class Y { \n" +
- "} \n" +
- " int y; \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find <y> as a field in X>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find <y> as a field in X
- */
-
-public void test30() {
-
- String s =
- "public class X { \n" +
- " int x; \n" +
- " \n" +
- " int foo(){ } \n" +
- " \n" +
- " class Y \n" +
- "} \n" +
- " int y; \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find <y> as a field in X>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should recover from partial method header foo()
- */
-
-public void test31() {
-
- String s =
- "package a; \n"+
- "import java.lang.*; \n"+
- "import java.util.*; \n"+
- " \n"+
- "public class X { \n"+
- " void foo() \n"+
- " System.out.println(); \n"+
- " \n"+
- " public int h; \n"+
- " public int[] i = { 0, 1 }; \n"+
- " \n"+
- " void bar(){ \n"+
- " void truc(){ \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i = {0, 1};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "package a;\n" +
- "import java.lang.*;\n" +
- "import java.util.*;\n" +
- "public class X {\n" +
- " public int h;\n" +
- " public int[] i;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void truc() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<should recover from partial method header>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should recover from method with missing argument names
- */
-
-public void test32() {
-
- String s =
- "public class WB2 { \n"+
- " public void foo(java.util.Locale, java.util.Vector) { \n"+
- " int i; \n"+
- " if(i instanceof O) { \n"+
- " } \n"+
- " String s = \"hello\"; \n"+
- " s. \n"+
- " } \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class WB2 {\n" +
- " public WB2() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class WB2 {\n" +
- " public WB2() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString;
- if(COMPLIANCE_1_3.equals(this.complianceLevel) ||
- COMPLIANCE_1_4.equals(this.complianceLevel)) {
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class WB2 {\n" +
- " public WB2() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " java.util.Locale.java.util.Vector $missing$;\n" +
- " }\n" +
- "}\n";
- } else {
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- expectedDietPlusBodyUnitToString;
- }
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should recover from method with missing argument names>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not find message with no argument as a constructor
- */
-
-public void test33() {
-
- String s =
- "public class X { \n"+
- " void hello() \n"+
- " public X(int i) \n"+
- " void foo() { \n"+
- " System.out.println(); \n"+
- " \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " void hello() {\n" +
- " }\n" +
- " public X(int i) {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " void hello() {\n" +
- " }\n" +
- " public X(int i) {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not find message with no argument as a constructor>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not find allocation as a constructor
- */
-
-public void test34() {
-
- String s =
- "public class X { \n"+
- " void hello() \n"+
- " public X(int i) \n"+
- " static void foo() { \n"+
- " X x; \n"+
- " x = new X(23); \n"+
- " System.out.println(); \n"+
- " \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " void hello() {\n" +
- " }\n" +
- " public X(int i) {\n" +
- " }\n" +
- " static void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " void hello() {\n" +
- " }\n" +
- " public X(int i) {\n" +
- " super();\n" +
- " }\n" +
- " static void foo() {\n" +
- " X x;\n" +
- " x = new X(23);\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not find allocation as a constructor>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Incomplete field header
- */
-
-public void test35() {
-
- String s =
- "public class X { \n" +
- " int x \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " int x;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " int x;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<incomplete field header>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Incomplete multiple field headers
- */
-
-public void test36() {
-
- String s =
- "public class X { \n" +
- " int x, y \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " int x;\n" +
- " int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<incomplete multiple field headers>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Field header with started string initializer
- */
-
-public void test37() {
-
- String s =
- "public class X { \n" +
- " String s = \" \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " String s;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " String s;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<field header with started string initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Field header with started string initializer combined with incomplete superinterface
- */
-
-public void test38() {
-
- String s =
- "public class X implements Y, { \n" +
- " String s = \" \n";
-
- String expectedDietUnitToString =
- "public class X implements Y {\n" +
- " String s;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X implements Y {\n" +
- " String s;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<field header and incomplete superinterface>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Field signature behind keyword implements
- */
-
-public void test39() {
-
- String s =
- "public class X implements \n"+
- "int x \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " int x;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " int x;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<field signature behind keyword implements>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Field type read as interface
- */
-
-public void test40() {
-
- String s =
- "public class X implements Y, \n" +
- " String s = \" \n";
-
- String expectedDietUnitToString =
- "public class X implements Y, String {\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X implements Y, String {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<field type read as interface>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Contiguous headers (checking checkpoint positions)
- */
-
-public void test41() {
-
- String s =
- "public class X public int foo(int bar(static String s";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " static String s;\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public int foo() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " static String s;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public int foo() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<contiguous headers>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Contiguous headers without comma (checking checkpoint positions)
- */
-
-public void test42() {
-
- String s =
- "public class X public int foo(int x, int bar public String s;";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public String s;\n" +
- " public X() {\n" +
- " }\n" +
- " public int foo(int x, int bar) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public String s;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public int foo(int x, int bar) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<contiguous headers without comma>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Contiguous headers without comma (checking checkpoint positions)
- */
-
-public void test43() {
-
- String s =
- "public class X \n" +
- " public int foo( \n" +
- " int bar( \n" +
- " static String s, int x \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " static String s;\n" +
- " int x;\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public int foo() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " static String s;\n" +
- " int x;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public int foo() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<contiguous headers without comma>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find static field <x>
- */
-
-public void test44() {
-
- String s =
- "class X { \n" +
- " String s; \n" +
- " \n" +
- " public void foo( \n" +
- " static int x \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " String s;\n" +
- " static int x;\n" +
- " X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " String s;\n" +
- " static int x;\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find static field x>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Missing string literal quote inside method
- */
-
-public void test45() {
-
- String s =
- "public class X { \n"+
- " int foo(){ \n"+
- " String s = \" \n"+
- " } \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<missing string literal quote inside method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Detecting member type closing when missing brackets
- */
-
-public void test46() {
-
- String s =
- "class X \n"+
- " String s = \"class y \n"+
- " class Member \n"+
- " int foo() \n"+
- " public int x; \n"+
- " } \n"+
- " int bar() \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " class Member {\n" +
- " public int x;\n" +
- " Member() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " String s;\n" +
- " X() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " class Member {\n" +
- " public int x;\n" +
- " Member() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " String s;\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<detecting member type closing when missing brackets>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated method arguments
- */
-
-public void test47() {
-
- String s =
-
- "class X { \n" +
- " int foo(AA a, BB b, IOEx \n" +
- " \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " int foo(AA a, BB b) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo(AA a, BB b) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated method arguments>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated literal string in method body
- */
-
-public void test48() {
-
- String s =
- "public class X { \n"+
- " final static int foo(){ \n"+
- " return \"1; \n"+
- " } \n"+
- " public static void main(String argv[]){ \n"+
- " foo(); \n"+
- " } \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " static final int foo() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " }\n" +
- "}\n";
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " static final int foo() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " foo();\n" +
- " }\n" +
- "}\n";
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated literal string in method body>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated initializer with local declaration
- */
-
-public void test49() {
-
- String s =
- "public class X { \n"+
- " { \n"+
- " int x; \n"+
- " \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated initializer with local declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated if statement
- */
-
-public void test50() {
-
- String s =
- "public class X { \n"+
- " int foo(){ \n"+
- " if(true){ \n"+
- " int x; \n"+
- " \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " if (true)\n" +
- " {\n" +
- " int x;\n" +
- " }\n" +
- " else\n" +
- " ;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated if statement>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated nested block with local declaration
- */
-
-public void test51() {
-
- String s =
- "public class X { \n"+
- " int foo(){ \n"+
- " { \n"+
- " int x; \n"+
- " \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " {\n" +
- " int x;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated nested block with local declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated nested block with field declaration
- */
-
-public void test52() {
-
- String s =
- "public class X { \n"+
- " int foo(){ \n"+
- " { \n"+
- " public int x; \n"+
- " \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public int x;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public int x;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated nested block with field declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated initializer with field declaration
- */
-
-public void test53() {
-
- String s =
- "public class X { \n"+
- " { \n"+
- " public int x; \n"+
- " \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public int x;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public int x;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated initializer with field declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Invalid class name
- */
-
-public void test54() {
-
- String s =
- "package p; \n"+
- "public class ZPro.Sev.Blo { \n"+
- "void ThisIsADummyMethodThatIsCreatedOnlyForThePurposesOfTheCompletionEngine() { \n"+
- " System.out.println(this.getClass()); \n"+
- "} \n"+
- " // COMMENT \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "package p;\n" +
- "public class ZPro {\n" +
- " {\n" +
- " }\n" +
- " public ZPro() {\n" +
- " }\n" +
- " void ThisIsADummyMethodThatIsCreatedOnlyForThePurposesOfTheCompletionEngine() {\n" +
- " }\n" +
- "}\n";
- String expectedDietPlusBodyUnitToString =
- "package p;\n" +
- "public class ZPro {\n" +
- " {\n" +
- " }\n" +
- " public ZPro() {\n" +
- " super();\n" +
- " }\n" +
- " void ThisIsADummyMethodThatIsCreatedOnlyForThePurposesOfTheCompletionEngine() {\n" +
- " System.out.println(this.getClass());\n" +
- " }\n" +
- "}\n";
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<Invalid class name>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated static initializer with field declaration
- */
-
-public void test55() {
-
- String s =
- "public class X { \n"+
- " static { \n"+
- " public int x; \n"+
- " \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unterminated static initializer with field declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Multiple initializers combined with array initializer
- */
-
-public void test56() {
-
- String s =
- "public class X \n"+
- " static int zz \n"+
- " { \n"+
- " } \n"+
- " static { \n"+
- " public int x; \n"+
- " int[] y = { 0, 1}; \n"+
- " { \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " static int zz;\n" +
- " {\n" +
- " }\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " int[] y = {0, 1};\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " static int zz;\n" +
- " {\n" +
- " }\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " int[] y = {0, 1};\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " static int zz;\n" +
- " {\n" +
- " }\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " int[] y;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<multiple initializers combined with array initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Combination of unterminated methods and fields
- */
-
-public void test57() {
-
- String s =
- "class X \n"+
- " void foo(){ \n"+
- " { \n"+
- " public static int x; \n"+
- " void bar() \n"+
- " } \n"+
- " int y; \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " public static int x;\n" +
- " int y;\n" +
- " X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " public static int x;\n" +
- " int y;\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<combination of unterminated methods and fields>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Illegal unicode inside method body
- */
-
-public void test58() {
-
- String s =
- "package p; \n"+
- " \n"+
- "class A { \n"+
- " void bar() { \n"+
- " String s = \"\\u000D\"; \n"+
- " } \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "package p;\n" +
- "class A {\n" +
- " A() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package p;\n" +
- "class A {\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<illegal unicode inside method body>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Extra identifier in type signature
- */
-
-public void test59() {
-
- String s =
- "public class X extends java.io.IOException IOException { \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "public class X extends java.io.IOException {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X extends java.io.IOException {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<extra identifier in type signature>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Extra identifier in method signature
- */
-
-public void test60() {
-
- String s =
- "public class X extends java.io.IOException { \n" +
- " int foo() ExtraIdentifier { \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "public class X extends java.io.IOException {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X extends java.io.IOException {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<extra identifier in method signature>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Extra identifier behind thrown exception
- */
-
-public void test61() {
-
- String s =
- "public class X extends { \n" +
- " int foo() throws IOException ExtraIdentifier { \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() throws IOException {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() throws IOException {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<extra identifier behind thrown exception>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unterminated array initializer
- */
-
-public void test62() {
-
- String s =
- "class X { \n"+
- " class Y \n"+
- " public String s; \n"+
- " int foo(){ \n"+
- " return 1; \n"+
- " static int y = {; \n"+ // can only be an initializer since type is not array one
- " } \n"+
- " public int i = 0; \n"+
- " \n"+
- " int baz() \n"+
- " \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " class Y {\n" +
- " public String s;\n" +
- " static int y;\n" +
- " {\n" +
- " }\n" +
- " public int i = 0;\n" +
- " Y() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " int baz() {\n" +
- " }\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " class Y {\n" +
- " public String s;\n" +
- " static int y;\n" +
- " {\n" +
- " ;\n" +
- " }\n" +
- " public int i = 0;\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " return 1;\n" +
- " }\n" +
- " int baz() {\n" +
- " }\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "class X {\n" +
- " class Y {\n" +
- " public String s;\n" +
- " static int y;\n" +
- " {\n" +
- " }\n" +
- " public int i;\n" +
- " Y() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " int baz() {\n" +
- " }\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<unterminated array initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Initializer behind array initializer
- */
-
-public void test63() {
-
- String s =
- "class X { \n"+
- " int x[] = {0, 1} \n"+
- " { \n"+
- " } \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " int[] x = {0, 1};\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " int[] x = {0, 1};\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "class X {\n" +
- " int[] x;\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<initializer behind array initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Initializers mixed with fields
- */
-
-public void test64() {
-
- String s =
- "public class X \n"+
- " int[] x = { 0, 1}; \n"+
- " static int zz \n"+
- " { \n"+
- " } \n"+
- " static { \n"+
- " public int x; \n"+
- " { \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " int[] x = {0, 1};\n" +
- " static int zz;\n" +
- " {\n" +
- " }\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " int[] x = {0, 1};\n" +
- " static int zz;\n" +
- " {\n" +
- " }\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " int[] x;\n" +
- " static int zz;\n" +
- " {\n" +
- " }\n" +
- " static {\n" +
- " }\n" +
- " public int x;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<initializers mixed with fields>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find method behind some()
- */
-
-public void test65() {
-
- String s =
- "import java.lang.*; \n" +
- " \n" +
- "public class Hanoi { \n" +
- "private Post[] posts; \n" +
- "public static void main (String args[]) { \n" +
- "} \n" +
- "public void some(){ \n" +
- " \n" +
- "private void moveDisk (Post source, Post destination) { \n" +
- "} \n" +
- "protected void reportMove (Post source, Post destination) { \n" +
- "} \n" +
- "private void reset () { \n" +
- "} \n" +
- "public void solve () { \n" +
- "} \n" +
- "private void solve (int depth, Post start, Post free, Post end) { \n" +
- "} \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "import java.lang.*;\n" +
- "public class Hanoi {\n" +
- " private Post[] posts;\n" +
- " public Hanoi() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void some() {\n" +
- " }\n" +
- " private void moveDisk(Post source, Post destination) {\n" +
- " }\n" +
- " protected void reportMove(Post source, Post destination) {\n" +
- " }\n" +
- " private void reset() {\n" +
- " }\n" +
- " public void solve() {\n" +
- " }\n" +
- " private void solve(int depth, Post start, Post free, Post end) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "import java.lang.*;\n" +
- "public class Hanoi {\n" +
- " private Post[] posts;\n" +
- " public Hanoi() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void some() {\n" +
- " }\n" +
- " private void moveDisk(Post source, Post destination) {\n" +
- " }\n" +
- " protected void reportMove(Post source, Post destination) {\n" +
- " }\n" +
- " private void reset() {\n" +
- " }\n" +
- " public void solve() {\n" +
- " }\n" +
- " private void solve(int depth, Post start, Post free, Post end) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find method behind some()>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should detect X(int) as a method with no return type
- */
-
-public void test66() {
-
- String s =
- "class X { \n"+
- " class Y { \n"+
- " X(int i){} \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " X(int i) {\n" +
- " }\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " X(int i) {\n" +
- " }\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should detect X(int) as a method with no return type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should detect orphan X(int) as a constructor
- */
-
-public void test67() {
-
- String s =
- "class X { \n"+
- " class Y { \n"+
- " } \n"+
- "} \n"+
- " X(int i){ \n"+
- " } \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " X(int i) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " X(int i) {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should detect orphan X(int) as a constructor>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Empty unit
- */
-
-public void test68() {
-
- String s = "";
-
- String expectedDietUnitToString = "";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<empty unit>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unit reduced to a method declaration
- */
-
-public void test69() {
-
- String s =
- " int foo(){ \n" +
- " System.out.println(); \n" +
- " } \n";
-
- String expectedDietUnitToString = "";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unit reduced to a method declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unit reduced to a constructor declaration
- */
-
-public void test70() {
-
- String s =
- " X(){ \n" +
- " System.out.println(); \n" +
- " } \n";
-
- String expectedDietUnitToString = "";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unit reduced to a constructor declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unit reduced to a field declaration
- */
-
-public void test71() {
-
- String s =
- " String str = new String();";
-
- String expectedDietUnitToString = "";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unit reduced to a field declaration>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Unit reduced to a field declaration with array initializer
- */
-
-public void test72() {
-
- String s =
- " String[] str = { \"hello\" };";
-
- String expectedDietUnitToString = "";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<unit reduced to a field declaration with array initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not pick-up any constructor with no arg
- */
-
-public void test73() {
-
- String s =
- " class X { \n" +
- " X(int i){} \n" +
- " int foo(){ \n" +
- " new X( \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " X(int i) {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " X(int i) {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "class X {\n" +
- " X(int i) {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " new X();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not pick-up any constructor with no arg>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not detect any field
- */
-
-public void test74() {
-
- String s =
- "package pack; \n" +
- " \n" +
- "class A extends IOException { \n" +
- " \n" +
- " S{ \n" +
- " int x; \n" +
- " } \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package pack;\n" +
- "class A extends IOException {\n" +
- " {\n" +
- " }\n" +
- " A() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package pack;\n" +
- "class A extends IOException {\n" +
- " {\n" +
- " int x;\n" +
- " }\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not detect any field>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Bunch of syntax errors
- */
-
-public void test75() {
-
- String s =
- "package ZKentTest;\n"+
- "\n"+
- "import java.awt.color.*;\n"+
- "\n"+
- "public class A {\n"+
- " A foo(int i) { return this; }\n"+
- " int[] ii = {0, 1clone()\n"+
- "\n"+
- " int bar() {\n"+
- " class Local {\n"+
- " int hello(){\n"+
- " fo\n"+
- " }\n"+
- " int world()\n"+
- " }\n"+
- " void foo() {\n"+
- " ba \n";
-
- String expectedDietUnitToString =
- "package ZKentTest;\n" +
- "import java.awt.color.*;\n" +
- "public class A {\n" +
- " int[] ii;\n" +
- " public A() {\n" +
- " }\n" +
- " A foo(int i) {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package ZKentTest;\n" +
- "import java.awt.color.*;\n" +
- "public class A {\n" +
- " int[] ii;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " A foo(int i) {\n" +
- " return this;\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package ZKentTest;\n" +
- "import java.awt.color.*;\n" +
- "public class A {\n" +
- " int[] ii;\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " A foo(int i) {\n" +
- " return this;\n" +
- " }\n" +
- " int bar() {\n" +
- " class Local {\n" +
- " Local() {\n" +
- " super();\n" +
- " }\n" +
- " int hello() {\n" +
- " fo = $missing$;\n" +
- " }\n" +
- " int world() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " int hello;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "package ZKentTest;\n" +
- "import java.awt.color.*;\n" +
- "public class A {\n" +
- " int[] ii;\n" +
- " public A() {\n" +
- " }\n" +
- " A foo(int i) {\n" +
- " }\n" +
- " clone() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bunch of syntax errors>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find Member as a member type
- */
-
-public void test76() {
-
- String s =
- "package pack; \n"+
- "class A { \n"+
- " \n"+
- " public static void main(String[] argv) \n"+
- " new Member().f \n"+
- " ; \n"+
- " } \n"+
- " class Member { \n"+
- " int foo() \n"+
- " } \n"+
- " } \n"+
- "}; \n";
-
- String expectedDietUnitToString =
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package pack;\n" +
- "class A {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " }\n" +
- " A() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " new Member().f = $missing$;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find Member as a member type>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not recover duplicate field numberOfDisks
- */
-
-public void test77() {
-
- String s =
- "package p; \n"+
- " \n"+
- "import java.lang.*; \n"+
- " \n"+
- "class IncompleteHanoi { \n"+
- "private Post[] posts; \n"+
- "private int numberOfDisks; \n"+
- " \n"+
- "public Hanoi (int numberOfDisks) { \n"+
- " this.numberOfDisks = numberOfDisks; \n"+
- "'' this.posts = new Post[3]; \n"+
- " String[] postNames = new String[]{\"Left\", \"Middle\", \"Right\"}; \n"+
- " \n"+
- " for (int i = 0; i < 3; ++i) \n"+
- " this.posts[i] = new Post(postNames[i], numberOfDisks); \n"+
- "} \n"+
- " \n"+
- "private void solve (int depth, Post start, Post free, Post end) { \n"+
- " if (depth == 1) \n"+
- " moveDisk(start, end); \n"+
- " else if (depth > 1) { \n"+
- " sol \n";
-
- String expectedDietUnitToString =
- "package p;\n" +
- "import java.lang.*;\n" +
- "class IncompleteHanoi {\n" +
- " private Post[] posts;\n" +
- " private int numberOfDisks;\n" +
- " IncompleteHanoi() {\n" +
- " }\n" +
- " public Hanoi(int numberOfDisks) {\n" +
- " }\n" +
- " private void solve(int depth, Post start, Post free, Post end) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package p;\n" +
- "import java.lang.*;\n" +
- "class IncompleteHanoi {\n" +
- " private Post[] posts;\n" +
- " private int numberOfDisks;\n" +
- " IncompleteHanoi() {\n" +
- " super();\n" +
- " }\n" +
- " public Hanoi(int numberOfDisks) {\n" +
- " }\n" +
- " private void solve(int depth, Post start, Post free, Post end) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "package p;\n" +
- "import java.lang.*;\n" +
- "class IncompleteHanoi {\n" +
- " private Post[] posts;\n" +
- " private int numberOfDisks;\n" +
- " IncompleteHanoi() {\n" +
- " super();\n" +
- " }\n" +
- " public Hanoi(int numberOfDisks) {\n" +
- " }\n" +
- " private void solve(int depth, Post start, Post free, Post end) {\n" +
- " if ((depth == 1))\n" +
- " moveDisk(start, end);\n" +
- " else\n" +
- " if ((depth > 1))\n" +
- " {\n" +
- " sol = $missing$;\n" +
- " }\n" +
- " else\n" +
- " ;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not recover duplicate field numberOfDisks>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not detect a field v (1/2)
- */
-
-public void test78() {
-
- String s =
- "class X { \n" +
- " int foo(){ \n" +
- " Vector v = new Vector(); \n" +
- " s \n" +
- " v.addElement( \n" +
- " } \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " Vector v = new Vector();\n" +
- " s v;\n" +
- " addElement();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not detect a field v>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not detect a field v (2/2)
- */
-
-public void test79() {
-
- String s =
- "class X { \n" +
- " int foo(){ \n" +
- " Vector v = new Vector(); \n" +
- " public s v.addElement( \n" +
- " } \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " Vector v = new Vector();\n" +
- " public s v;\n" +
- " addElement();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not detect a field v>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not detect a method bar
- */
-
-public void test80() {
-
- String s =
- "class X { \n" +
- " int test(){ \n" +
- " int[] i; \n" +
- " i \n" +
- " // some comment \n" +
- " bar(1); \n" +
- " } \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " int test() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int test() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "class X {\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " int test() {\n" +
- " int[] i;\n" +
- " i bar = 1;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not detect a method bar>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not pick-up any constructor with no arg
- */
-
-public void test81() {
-
- String s =
- " class X { \n" +
- " X(int i){} \n" +
- " int foo(){ \n" +
- " X(12) \n";
-
- String expectedDietUnitToString =
- "class X {\n" +
- " X(int i) {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " X(int i) {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "class X {\n" +
- " X(int i) {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " X(12);\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not pick-up any constructor with no arg>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not promote message sending as a method
- */
-
-public void test82() {
-
- String s =
- "public class A { \n"+
- " \n"+
- " void foo() \n"+
- " if (true) { \n"+
- " } else { \n"+
- " Bar s; \n"+
- " s.fred(); \n"+
- " } \n"+
- " } \n"+
- "} \n";
- String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " if (true)\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " {\n" +
- " Bar s;\n" +
- " s.fred();\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not promote message sending as a method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should not promote message sending as a method 2
- */
-
-public void test83() {
-
- String s =
- "public class A { \n"+
- " \n"+
- " void foo() if (true) { \n"+
- " } else { \n"+
- " Bar s; \n"+
- " s.fred(); \n"+
- " } \n"+
- " } \n"+
- "} \n";
- String expectedDietUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " if (true)\n" +
- " {\n" +
- " }\n" +
- " else\n" +
- " {\n" +
- " Bar s;\n" +
- " s.fred();\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should not promote message sending as a method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find a static initializer
- */
-
-public void test84() {
-
- String s =
- "public class A extends \n" +
- " \n" +
- " static { \n" +
- "} \n";
- String expectedDietUnitToString =
- "public class A {\n" +
- " static {\n" +
- " }\n" +
- " public A() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " static {\n" +
- " }\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find a static initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find a static initializer
- */
-
-public void test85() {
-
- String s =
- "public class A \n" +
- " \n" +
- " static { \n" +
- "} \n";
- String expectedDietUnitToString =
- "public class A {\n" +
- " static {\n" +
- " }\n" +
- " public A() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " static {\n" +
- " }\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find a static initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find an initializer
- */
-
-public void test86() {
-
- String s =
- "public class A \n" +
- " \n" +
- " int \n" +
- " { \n" +
- "} \n";
- String expectedDietUnitToString =
- "public class A {\n" +
- " {\n" +
- " }\n" +
- " public A() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " {\n" +
- " }\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find an initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Should find an initializer
- */
-
-public void test87() {
-
- String s =
- "public class A \n" +
- " \n" +
- " int x; \n" +
- " { \n" +
- " int y; \n" +
- "} \n";
- String expectedDietUnitToString =
- "public class A {\n" +
- " int x;\n" +
- " {\n" +
- " }\n" +
- " public A() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class A {\n" +
- " int x;\n" +
- " {\n" +
- " int y;\n" +
- " }\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<should find an initializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FVRQG0: ITPCOM:WINNT - NullPointerException in recovery mode
- */
-
-public void test88() {
-
- String s =
- "package p1; \n" +
- " \n" +
- "public class X { \n" +
- " int foo(String s, int x) \n" +
- " public int y = new X() { \n" +
- " \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "package p1;\n" +
- "public class X {\n" +
- " public int y;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo(String s, int x) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "package p1;\n" +
- "public class X {\n" +
- " public int y;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " int foo(String s, int x) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "package p1;\n" +
- "public class X {\n" +
- " public int y;\n" +
- " public X() {\n" +
- " }\n" +
- " int foo(String s, int x) {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<1FVRQG0: ITPCOM:WINNT - NullPointerException in recovery mode>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FVRN9V: ITPJCORE:WIN98 - Internal builder error compiling servlet
- */
-
-public void test89() {
-
- String s =
- "import javax.servlet.*; \n" +
- "import javax.servlet.http.*; \n" +
- " \n" +
- "public class Servlet1 extends HttpServlet { \n" +
- " protected (HttpServletRequest req, HttpServletResponse resp) { \n" +
- " } \n" +
- "} \n";
-
- String expectedDietUnitToString =
- "import javax.servlet.*;\n" +
- "import javax.servlet.http.*;\n" +
- "public class Servlet1 extends HttpServlet {\n" +
- " HttpServletRequest req;\n" +
- " HttpServletRequest HttpServletResponse;\n" +
- " {\n" +
- " }\n" +
- " public Servlet1() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "import javax.servlet.*;\n" +
- "import javax.servlet.http.*;\n" +
- "public class Servlet1 extends HttpServlet {\n" +
- " HttpServletRequest req;\n" +
- " HttpServletRequest HttpServletResponse;\n" +
- " {\n" +
- " }\n" +
- " public Servlet1() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FVRN9V: ITPJCORE:WIN98 - Internal builder error compiling servlet>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FVXQZ4: ITPCOM:WIN98 - Walkback during parsing recovery
- */
-
-public void test90() {
-
- String s =
- "public class Test { \n"+
- " \n"+
- " int x; \n"+
- " int foo( \n"+
- " int bar( \n"+
- " baz(A a \n"+
- "} \n";
- String expectedDietUnitToString =
- "public class Test {\n" +
- " int x;\n" +
- " public Test() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- " baz(A a) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class Test {\n" +
- " int x;\n" +
- " public Test() {\n" +
- " super();\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- " baz(A a) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FVXQZ4: ITPCOM:WIN98 - Walkback during parsing recovery>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FVXWKI: ITPCOM:WIN98 - Walkback when parsing a bogus interface
- */
-
-public void test91() {
-
- String s =
- "public interface Fred { \n" +
- " void foo(); \n" +
- " void bar(); \n" +
- " public fred(X x, int y); \n" +
- "} \n";
- String expectedDietUnitToString =
- "public interface Fred {\n" +
- " void foo();\n" +
- " void bar();\n" +
- " public fred(X x, int y);\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FVXWKI: ITPCOM:WIN98 - Walkback when parsing a bogus interface>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * Variation on 1FVXWKI: ITPCOM:WIN98 - Walkback when parsing a bogus interface
- */
-
-public void test92() {
- String s =
- "public interface Test { \n"+
- " void foo(); \n"+
- " \n"+
- " public fred(Fred x, int y); \n"+
- "} \n";
- String expectedDietUnitToString =
- "public interface Test {\n" +
- " void foo();\n" +
- " public fred(Fred x, int y);\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FVXWKI: ITPCOM:WIN98 - Walkback when parsing a bogus interface>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FW5A4E: ITPCOM:WIN98 - Walkback reconciling
- */
-
-public void test93() {
- String s =
- "class X{ \n" +
- " int foo() \n" +
- " static { } \n" +
- "} \n";
- String expectedDietUnitToString =
- "class X {\n" +
- " static {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " static {\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FW5A4E: ITPCOM:WIN98 - Walkback reconciling>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FW3663: ITPCOM:WIN98 - Outline - does not show method #fred()
- */
-
-public void test94() {
- String s =
- "public class X { \n" +
- " int[] array; \n" +
- " \n" +
- "void foo() { \n" +
- " bar(this.array.length, 10, fred( \n" +
- " \n" +
- "int fred( \n" +
- "} \n";
- String expectedDietUnitToString =
- "public class X {\n" +
- " int[] array;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " int fred() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " int[] array;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " int fred() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " int[] array;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " bar(this.array.length, 10, fred());\n" +
- " }\n" +
- " int fred() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FW3663: ITPCOM:WIN98 - Outline - does not show method #fred()>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FW6M5M: ITPJUI:ALL - NPE in SourceElementParser
- */
-
-public void test95() {
- String s =
- "public interface IP { \n"+
- " public static toString() { \n"+
- " } \n"+
- "} \n";
- String expectedDietUnitToString =
- "public interface IP {\n" +
- " public static toString() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString = expectedDietUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FW6M5M: ITPJUI:ALL - NPE in SourceElementParser>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * 1FWHXX7: ITPCOM:WINNT - ClassCastException compiling invalid import
- */
-
-public void test96() {
- String s =
- "import ;\n"+
- "class X {\n"+
- " int foo(){\n"+
- " System.out.println();\n"+
- " }\n"+
- " static {\n"+
- " int i = j;\n"+
- " }\n"+
- "}\n";
- String expectedDietUnitToString =
- "class X {\n" +
- " static {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " static {\n" +
- " int i = j;\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<1FWHXX7: ITPCOM:WINNT - ClassCastException compiling invalid import>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * variation on 1FWHXX7: ITPCOM:WINNT - ClassCastException compiling invalid import
- */
-
-public void test97() {
- String s =
- "import ;\n"+
- "class X {\n"+
- " int foo(){\n"+
- " System.out.println();\n"+
- " }\n"+
- " static {\n"+
- " }\n"+
- "}\n";
- String expectedDietUnitToString =
- "class X {\n" +
- " static {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " }\n" +
- "}\n";
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " static {\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " int foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<variation on 1FWHXX7: ITPCOM:WINNT - ClassCastException compiling invalid import>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=9084
- */
-
-public void test98() {
-
- String s =
- "public class A { \n"+
- " class Platform { \n"+
- " public static void run(Runnable r) { \n"+
- " } \n"+
- " } \n"+
- " Object [] array = null; \n"+
- " for (int nX = 0; nX < array.length; nX ++) { \n"+
- " final String part = \"\"; \n"+
- " final String sel = \"\"; \n"+
- " Object l = null; \n"+
- " if ((part != null && sel != null) || l instanceof String) { \n"+
- " Platform.run(new Runnable() { \n"+
- " public void run() { \n"+
- " } \n"+
- " public void handleException(Throwable e) { \n"+
- " } \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class A {\n"+
- " class Platform {\n"+
- " Platform() {\n"+
- " }\n"+
- " public static void run(Runnable r) {\n"+
- " }\n"+
- " }\n"+
- " Object[] array = null;\n"+
- " int nX = 0;\n"+
- " {\n"+
- " }\n"+
- " public A() {\n"+
- " }\n"+
- "}\n";
-
-
- String expectedDietPlusBodyUnitToString = "public class A {\n"+
- " class Platform {\n"+
- " Platform() {\n"+
- " super();\n"+
- " }\n"+
- " public static void run(Runnable r) {\n"+
- " }\n"+
- " }\n"+
- " Object[] array = null;\n"+
- " int nX = 0;\n"+
- " {\n"+
- " final String part = \"\";\n"+
- " final String sel = \"\";\n"+
- " Object l = null;\n"+
- " if ((((part != null) && (sel != null)) || (l instanceof String)))\n"+
- " {\n"+
- " Platform.run(new Runnable() {\n"+
- " public void run() {\n"+
- " }\n"+
- " public void handleException(Throwable e) {\n"+
- " }\n"+
- "});\n"+
- " }\n"+
- " }\n"+
- " public A() {\n"+
- " super();\n"+
- " }\n"+
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class A {\n"+
- " class Platform {\n"+
- " Platform() {\n"+
- " }\n"+
- " public static void run(Runnable r) {\n"+
- " }\n"+
- " }\n"+
- " Object[] array;\n"+
- " int nX;\n"+
- " {\n"+
- " }\n"+
- " public A() {\n"+
- " }\n"+
- "}\n";
-
- String testName = "<check for null inside RecoveredInitializer>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-
-public void test99() {
- String s =
- "import ;\n"+
- "class X {\n"+
- "}\n"+
- "- public void addThreadFilter(IJavaThread thread) - restricts breakpoint to \n"+
- "given thread and any other previously specified threads\n"+
- "- public void removeThreadFilter(IJavaThread thread)- removes the given thread \n"+
- "restriction (will need to re-create breakpoint request as JDI does not support \n"+
- "the removal of thread filters)\n"+
- "- public IJavaThread[] getThreadFilters() - return the set of threads this \n"+
- "breakpoint is currently restricted to\n";
- String expectedDietUnitToString =
- "class X {\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " }\n" +
- " public void addThreadFilter(IJavaThread thread) {\n" +
- " }\n" +
- " public void removeThreadFilter(IJavaThread thread) {\n" +
- " }\n" +
- " public IJavaThread[] getThreadFilters() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "class X {\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " public void addThreadFilter(IJavaThread thread) {\n" +
- " }\n" +
- " public void removeThreadFilter(IJavaThread thread) {\n" +
- " }\n" +
- " public IJavaThread[] getThreadFilters() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "class X {\n" +
- " {\n" +
- " }\n" +
- " X() {\n" +
- " super();\n" +
- " }\n" +
- " public void addThreadFilter(IJavaThread thread) {\n" +
- " restricts breakpoint;\n" +
- " given thread;\n" +
- " any other;\n" +
- " specified = $missing$;\n" +
- " }\n" +
- " public void removeThreadFilter(IJavaThread thread) {\n" +
- " removes the;\n" +
- " thread restriction;\n" +
- " will need = (re - create);\n" +
- " request as;\n" +
- " does not;\n" +
- " the removal;\n" +
- " thread = $missing$;\n" +
- " }\n" +
- " public IJavaThread[] getThreadFilters() {\n" +
- " return the;\n" +
- " of threads;\n" +
- " breakpoint is;\n" +
- " restricted to;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<9101 - Parse error while typing in Java editor>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test100() {
- String s =
- "public class Bug {\n" +
- " static boolean bold = false;\n" +
- "public static void main(String arguments[]) {\n" +
- " Shell shell = new Shell(SWT.MENU | SWT.RESIZE | SWT.TITLE | SWT.H_SCROLL);\n" +
- " StyledText text = new StyledText(shell, SWT.WRAP); \n" +
- " shell.addListener(SWT.Resize, new Listener() {\n" +
- " public void handleEvent(Event e) {\n" +
- " text.setBounds(shell.getClientArea()); \n" +
- " } \n" +
- " }); \n" +
- " shell.addListener(SWT.KeyDown, bew Listener () {\n" +
- " public void handleEvent(Event e) {\n" +
- " bold = !bold;\n" +
- " }\n" +
- " }); \n" +
- " text.addLineStyleListener(new LineStyleListener() { \n" +
- " public void lineGetStyle(LineStyleEvent event) {\n" +
- " }\n" +
- " });\n" +
- "}\n" +
- "}\n";
-
- String expectedDietUnitToString =
- "public class Bug {\n" +
- " static boolean bold = false;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bug() {\n" +
- " }\n" +
- " public static void main(String[] arguments) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class Bug {\n" +
- " static boolean bold = false;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bug() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] arguments) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class Bug {\n" +
- " static boolean bold = false;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bug() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] arguments) {\n" +
- " Shell shell = new Shell((((SWT.MENU | SWT.RESIZE) | SWT.TITLE) | SWT.H_SCROLL));\n" +
- " StyledText text = new StyledText(shell, SWT.WRAP);\n" +
- " shell.addListener(SWT.Resize, new Listener() {\n" +
- " public void handleEvent(Event e) {\n" +
- " text.setBounds(shell.getClientArea());\n" +
- " }\n" +
- "});\n" +
- " shell.addListener(SWT.KeyDown, new Listener() {\n" +
- " public void handleEvent(Event e) {\n" +
- " bold = (! bold);\n" +
- " }\n" +
- "});\n" +
- " text.addLineStyleListener(new LineStyleListener() {\n" +
- " public void lineGetStyle(LineStyleEvent event) {\n" +
- " }\n" +
- "});\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- "public class Bug {\n" +
- " static boolean bold = false;\n" +
- " public Bug() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public static void main(String[] arguments) {\n" +
- " }\n" +
- " bew Listener() {\n" +
- " }\n" +
- " public void handleEvent(Event e) {\n" +
- " }\n" +
- "}\n";
-
- String expectedCompletionDietUnitToString =
- "public class Bug {\n" +
- " static boolean bold;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bug() {\n" +
- " }\n" +
- " public static void main(String[] arguments) {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<10616 - local type outside method>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void _test101() {
- String s =
- "public class X { \n"+
- " Object foo(Stack<X> s) { \n"+
- " } \n"+
- " List<T> bar(int pos, T x1, T x2, List<T> l) { \n"+
- " } \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " Object foo() {\n" +
- " }\n" +
- " bar(int pos, T x1, T x2) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " Object foo() {\n" +
- " }\n" +
- " bar(int pos, T x1, T x2) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<12387 out of memory with generics>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test102() {
- String s =
- "void ___eval() { \n"+
- "new Runnable(){ \n"+
- "void ___run() throws Throwable { \n"+
- "return blah; \n"+
- "} \n"+
- "private String blarg; \n"+
- "public void run (){ \n"+
- " class Local { \n" +
- " void baz() { \n"+
- " } \n" +
- " } \n"+
- "} \n"+
- "} \n"+
- ";} \n"+
- "public class Hello{ \n"+
- "private static int x; \n"+
- "private String blah; \n"+
- "public static void main (String[] args){ \n"+
- "} \n"+
- "public void hello (){ \n"+
- "} \n"+
- "public boolean blah (){ \n"+
- "return false;} \n"+
- "public void foo (){ \n"+
- "} \n"+
- "} \n";
-
- String expectedDietUnitToString =
- "public class Hello {\n" +
- " private static int x;\n" +
- " private String blah;\n" +
- " public Hello() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void hello() {\n" +
- " }\n" +
- " public boolean blah() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n" ;
-
- String expectedDietPlusBodyUnitToString =
- "public class Hello {\n" +
- " private static int x;\n" +
- " private String blah;\n" +
- " public Hello() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void hello() {\n" +
- " }\n" +
- " public boolean blah() {\n" +
- " return false;\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<12454 - handling toplevel anonymous>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test103() {
- String s =
- "public class X{ \n"+
- " void foo(int x, int y, void z";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " void z;\n" +
- " public X() {\n" +
- " }\n" +
- " void foo(int x, int y) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " void z;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo(int x, int y) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<14038 - third argument type is void>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test104() {
- String s =
- "public class P#AField {\n" +
- " public void setP#A(String P#A) {\n" +
- " this.P#A = P#A;\n" +
- " }\n" +
- "}";
-
- String expectedDietUnitToString =
- "public class P {\n" +
- " {\n" +
- " }\n" +
- " public void setP;\n" +
- " public P() {\n" +
- " }\n" +
- " A(String P) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class P {\n" +
- " {\n" +
- " }\n" +
- " public void setP;\n" +
- " public P() {\n" +
- " super();\n" +
- " }\n" +
- " A(String P) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString = expectedDietUnitToString;
-
- String testName = "<16126>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test105() {
- String s =
- "public class X {\n" +
- " static int foo(int[] a, int[] b) {\n" +
- " return 0;\n" +
- " }\n" +
- " static int B =\n" +
- " foo(\n" +
- " new int[]{0, 0},\n" +
- " new int[]{0, 0}\n" +
- " );\n" +
- " #\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " static int B = foo(new int[]{0, 0}, new int[]{0, 0});\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " static int foo(int[] a, int[] b) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " static int B = foo(new int[]{0, 0}, new int[]{0, 0});\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " static int foo(int[] a, int[] b) {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " static int B;\n" +
- " {\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " static int foo(int[] a, int[] b) {\n" +
- " }\n" +
- "}\n";
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test106() {
- String s =
- "public class X {\n" +
- " clon\n" +
- " foo();\n" +
- "}\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " clon foo();\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " clon foo();\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietPlusBodyUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " clon foo();\n" +
- "}\n";
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test107() {
- String s =
- "public class X {\n" +
- " int[] a = new int[]{0, 0}, b = new int[]{0, 0};\n" +
- " #\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " int[] a = new int[]{0, 0};\n" +
- " int[] b = new int[]{0, 0};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " int[] a = new int[]{0, 0};\n" +
- " int[] b = new int[]{0, 0};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " int[] a;\n" +
- " int[] b;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test108() {
- String s =
- "public class X {\n" +
- " int a = new int[]{0, 0}, b = new int[]{0, 0};\n" +
- " #\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " int a = new int[]{0, 0};\n" +
- " int b = new int[]{0, 0};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " int a = new int[]{0, 0};\n" +
- " int b = new int[]{0, 0};\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " int a;\n" +
- " {\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test109() {
- String s =
- "public class X {\n" +
- " Object o = new Object() {\n" +
- " void foo() {\n" +
- " try {\n" +
- " } catch(Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- "}";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " Object o;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " Object o;\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " Object o;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test110() {
- String s =
- "public class X {\n" +
- " void bar(){\n" +
- " #\n" +
- " class Inner {\n" +
- " void foo() {\n" +
- " try {\n" +
- " } catch(Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " class Inner {\n" +
- " Inner() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " try \n" +
- " {\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-public void test111() {
- String s =
- "public class X {\n" +
- " void bar(){\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100797
-public void test112() {
- String s =
- "public class X {\n"+
- " public void foo()\n"+
- " try { \n"+
- " } catch (Exception e) {\n"+
- " bar(\"blabla\");\n"+
- " throw new Exception(prefix \"bloblo\");\n"+
- " }\n"+
- " }\n"+
- "}\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " try \n" +
- " {\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " bar(\"blabla\");\n" +
- " throw new Exception(prefix);\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=111618
-public void test113() {
- String s =
- "public class X {\n"+
- " public void foo(Object[] tab)\n"+
- " for (Object o : tab) {\n"+
- " o.toString();\n"+
- " }\n"+
- " }\n"+
- "}\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo(Object[] tab) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo(Object[] tab) {\n" +
- " for (Object o : tab) \n" +
- " {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=129142
-public void test114() {
- String s =
- "public class X {\n"+
- " public void foo() {\n"+
- " int int;\n"+
- " }\n"+
- "}\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " public void foo() {\n" +
- " int $missing$;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339
-public void test115() {
- String s =
- "public interface Test {\n"+
- " public void myMethod()\n"+
- "}\n";
-
- String expectedDietUnitToString =
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339
-public void test116() {
- String s =
- "public interface Test {\n"+
- " public void myMethod()\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietUnitToString =
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=154811
-public void test117() {
- String s =
- "public class X {\n" +
- " void foo1() {\n" +
- " class Y {\n" +
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- " class Z<T> { \n" +
- " }\n" +
- " }\n" +
- "} \n";
-
- String expectedDietUnitToString = null;
- String expectedDietPlusBodyUnitToString = null;
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString = null;
- String expectedFullUnitToString = null;
- String expectedCompletionDietUnitToString = null;
-
-
- if(COMPLIANCE_1_3.equals(this.complianceLevel) ||
- COMPLIANCE_1_4.equals(this.complianceLevel)) {
-
- expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- "}\n";
-
- expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- "}\n";
-
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo1() {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " class Z<T> {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- expectedFullUnitToString =
- "public class X {\n" +
- " class Z<T> {\n" +
- " Z() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- "}\n";
-
- expectedCompletionDietUnitToString =
- expectedDietUnitToString;
- } else if(this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
-
- expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- "}\n";
-
- expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- "}\n";
-
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo1() {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " new foo2() {\n" +
- " };\n" +
- " class Z<T> {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- expectedFullUnitToString =
- "public class X {\n" +
- " class Z<T> {\n" +
- " Z() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- "}\n";
-
- expectedCompletionDietUnitToString =
- expectedDietUnitToString;
- }
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=154811
-public void test117_2() {
- String s =
- "public class X {\n" +
- " void foo1() {\n" +
- " class Y {\n" +
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- " class Z { \n" +
- " }\n" +
- " }\n" +
- "} \n";
-
- String expectedDietUnitToString = null;
- String expectedDietPlusBodyUnitToString = null;
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString = null;
- String expectedFullUnitToString = null;
- String expectedCompletionDietUnitToString = null;
-
- expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- "}\n";
-
- expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- "}\n";
-
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo1() {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " new foo2() {\n" +
- " };\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- expectedFullUnitToString =
- "public class X {\n" +
- " class Z {\n" +
- " Z() {\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- "}\n";
-
- expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=162056
-public void test118() {
- String s =
- "interface Irrelevant {}\n"+
- "interface I {\n"+
- " Object foo(Number n);\n"+
- "}\n"+
- "interface J extends I {\n"+
- " String foo(Number n);\n"+
- "}\n"+
- "interface K {\n"+
- " Object foo(Number n);\n"+
- "}\n"+
- "public class {\n"+
- " void foo() {\n"+
- "\n"+
- " }\n"+
- "} \n";
-
- String expectedDietUnitToString =
- "interface Irrelevant {\n" +
- "}\n" +
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " String foo(Number n);\n" +
- "}\n" +
- "interface K {\n" +
- " Object foo(Number n);\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "interface Irrelevant {\n" +
- "}\n" +
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " String foo(Number n);\n" +
- "}\n" +
- "interface K {\n" +
- " Object foo(Number n);\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=162056
-public void test119() {
- String s =
- "interface Irrelevant {}\n"+
- "interface I {\n"+
- " Object foo(Number n);\n"+
- "}\n"+
- "interface J extends I {\n"+
- " String foo(Number n);\n"+
- "}\n"+
- "abstract class K {\n"+
- " abstract Object foo(Number n);\n"+
- "}\n"+
- "public class {\n"+
- " void foo() {\n"+
- "\n"+
- " }\n"+
- "} \n";
-
- String expectedDietUnitToString =
- "interface Irrelevant {\n" +
- "}\n" +
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " String foo(Number n);\n" +
- "}\n" +
- "abstract class K {\n" +
- " {\n" +
- " }\n" +
- " K() {\n" +
- " }\n" +
- " abstract Object foo(Number n);\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "interface Irrelevant {\n" +
- "}\n" +
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " String foo(Number n);\n" +
- "}\n" +
- "abstract class K {\n" +
- " {\n" +
- " }\n" +
- " K() {\n" +
- " super();\n" +
- " }\n" +
- " abstract Object foo(Number n);\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140980
-public void test120() {
- String s =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " try {\n" +
- " System.out.println(); \n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " class Z {}\n" +
- " }\n" +
- "}\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " try \n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " }\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140980
-public void test121() {
- String s =
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " try {\n" +
- " System.out.println(); \n" +
- " } catch (Exception e) {\n" +
- " class Z {}\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedDietUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " try \n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140980
-public void test122() {
- String s =
- "public class Test\n" +
- "{\n" +
- " public void func1()\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " catch ( Exception exception)\n" +
- " {\n" +
- " exception.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " class Clazz\n" +
- " {\n" +
- " }\n" +
- "}\n" +
- "\n";
-
- String expectedDietUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void func1() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " super();\n" +
- " }\n" +
- " public void func1() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " super();\n" +
- " }\n" +
- " public void func1() {\n" +
- " try \n" +
- " {\n" +
- " }\n" +
- " catch (Exception exception) {\n" +
- " exception.printStackTrace();\n" +
- " }\n" +
- " class Clazz {\n" +
- " Clazz() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140980
-public void test123() {
- String s =
- "public class SwitchBug {\n" +
- " void aMethod() {\n" +
- " int i=0;\n" +
- " try {\n" +
- " switch( i ) {\n" +
- " } catch( Exception ex ) {\n" +
- " }\n" +
- " }\n" +
- " class Nested {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietUnitToString =
- "public class SwitchBug {\n" +
- " public SwitchBug() {\n" +
- " }\n" +
- " void aMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class SwitchBug {\n" +
- " public SwitchBug() {\n" +
- " super();\n" +
- " }\n" +
- " void aMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class SwitchBug {\n" +
- " public SwitchBug() {\n" +
- " super();\n" +
- " }\n" +
- " void aMethod() {\n" +
- " int i = 0;\n" +
- " try \n" +
- " {\n" +
- " switch (i) {\n" +
- " }\n" +
- " }\n" +
- " catch (Exception ex) {\n" +
- " }\n" +
- " class Nested {\n" +
- " Nested() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString = expectedDietUnitToString;
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test foreach toString";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=157570
-public void test124() {
- String s =
- "public class Test {\n" +
- " void aMethod() {\n" +
- " public static void m1()\n" +
- " {\n" +
- " int a;\n" +
- " int b;\n" +
- " }\n" +
- " public static void m2()\n" +
- " {\n" +
- " int c;\n" +
- " int d;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedDietUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " void aMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " super();\n" +
- " }\n" +
- " void aMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyPlusStatementsRecoveryUnitToString = null;
- if(COMPLIANCE_1_3.equals(this.complianceLevel) ||
- COMPLIANCE_1_4.equals(this.complianceLevel)) {
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " super();\n" +
- " }\n" +
- " void aMethod() {\n" +
- " m1();\n" +
- " {\n" +
- " int a;\n" +
- " int b;\n" +
- " }\n" +
- " m2();\n" +
- " {\n" +
- " int c;\n" +
- " int d;\n" +
- " }\n" +
- " }\n" +
- "}\n";
- } else {
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " super();\n" +
- " }\n" +
- " void aMethod() {\n" +
- " public static @m1() enum $missing$ {\n" +
- " public $missing$() {\n" +
- " super();\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- }
-
- String expectedFullUnitToString =
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " void aMethod() {\n" +
- " }\n" +
- " public static void m1() {\n" +
- " }\n" +
- " public static void m2() {\n" +
- " }\n" +
- "}\n";
-
- String expectedCompletionDietUnitToString =
- expectedDietUnitToString;
-
- String testName = "test";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyPlusStatementsRecoveryUnitToString,
- expectedFullUnitToString,
- expectedCompletionDietUnitToString, testName);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java
deleted file mode 100644
index 3e75351..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Locale;
-
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblem;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-public class DualParseSyntaxErrorTest extends AbstractCompilerTest {
- public static boolean optimizeStringLiterals = false;
- public static long sourceLevel = ClassFileConstants.JDK1_3; //$NON-NLS-1$
-
-public DualParseSyntaxErrorTest(String testName){
- super(testName);
-}
-public void checkParse(
- char[] source,
- String expectedSyntaxErrorDiagnosis,
- String testName) {
-
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- if (computedUnit.types != null) {
- for (int i = computedUnit.types.length; --i >= 0;){
- computedUnit.types[i].parseMethod(parser, computedUnit);
- }
- }
-
- StringBuffer buffer = new StringBuffer(100);
- if (compilationResult.hasProblems() || compilationResult.hasTasks()) {
- CategorizedProblem[] problems = compilationResult.getAllProblems();
- int count = problems.length;
- int problemCount = 0;
- char[] unitSource = compilationResult.compilationUnit.getContents();
- for (int i = 0; i < count; i++) {
- if (problems[i] != null) {
- if (problemCount == 0)
- buffer.append("----------\n");
- problemCount++;
- buffer.append(problemCount + (problems[i].isError() ? ". ERROR" : ". WARNING"));
- buffer.append(" in " + new String(problems[i].getOriginatingFileName()).replace('/', '\\'));
- try {
- buffer.append(((DefaultProblem)problems[i]).errorReportSource(unitSource));
- buffer.append("\n");
- buffer.append(problems[i].getMessage());
- buffer.append("\n");
- } catch (Exception e) {
- StringWriter stringWriter = new StringWriter();
- e.printStackTrace(new PrintWriter(stringWriter));
- buffer.append(stringWriter.getBuffer());
- }
- buffer.append("----------\n");
- }
- }
- }
- String computedSyntaxErrorDiagnosis = buffer.toString();
- if(!Util.convertToIndependantLineDelimiter(expectedSyntaxErrorDiagnosis)
- .equals(Util.convertToIndependantLineDelimiter(computedSyntaxErrorDiagnosis))) {
- System.out.println(Util.displayString(computedSyntaxErrorDiagnosis));
- }
- assertEquals(
- "Invalid syntax error diagnosis" + testName,
- Util.convertToIndependantLineDelimiter(expectedSyntaxErrorDiagnosis),
- Util.convertToIndependantLineDelimiter(computedSyntaxErrorDiagnosis));
-}
-
-public void test01() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " fX = 0; \n"+
- " } \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "";
-
- String testName = "<test1>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test02() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " fX = 0; \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test2> (at line 4)\n" +
- " fX = 0; \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n";
-
- String testName = "<test2>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test03() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() \n"+
- " fX = 0; \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test3> (at line 3)\n" +
- " void foo() \n" +
- " ^\n" +
- "Syntax error on token \")\", { expected after this token\n" +
- "----------\n" +
- "2. ERROR in <test3> (at line 4)\n" +
- " fX = 0; \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n";
-
- String testName = "<test3>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test04() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() \n"+
- " fX = 0; \n"+
- " } \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test4> (at line 3)\n" +
- " void foo() \n" +
- " ^\n" +
- "Syntax error on token \")\", { expected after this token\n" +
- "----------\n";
-
- String testName = "<test4>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test05() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " if(true){ \n"+
- " } \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test5> (at line 4)\n" +
- " if(true){ \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete Statement\n" +
- "----------\n";
-
- String testName = "<test5>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test06() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " if(true){ \n"+
- " } \n"+
- " //comment \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test6> (at line 4)\n" +
- " if(true){ \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete Statement\n" +
- "----------\n";
-
- String testName = "<test6>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test07() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " if(true){ \n"+
- " } \n"+
- " System.out.println(); \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test7> (at line 6)\n" +
- " System.out.println(); \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n";
-
- String testName = "<test7>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test08() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " if(true){ \n"+
- " } \n"+
- " public int bar; \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test8> (at line 4)\n" +
- " if(true){ \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete Statement\n" +
- "----------\n";
-
- String testName = "<test8>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test09() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " if(true){ \n"+
- " } \n"+
- " //comment \n"+
- " public int bar; \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test9> (at line 4)\n" +
- " if(true){ \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete Statement\n" +
- "----------\n";
-
- String testName = "<test9>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-public void test10() {
-
- String s =
- "public class X { \n"+
- " int fX; \n"+
- " void foo() { \n"+
- " if(true){ \n"+
- " } \n"+
- " System.out.println(); \n"+
- " public int bar; \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <test10> (at line 6)\n" +
- " System.out.println(); \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n";
-
- String testName = "<test10>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java
deleted file mode 100644
index 174f94f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be an ExplicitConstructorInvocation
- * or inside an ExplicitConstructorInvocation
- */
-public class ExplicitConstructorInvocationCompletionTest extends AbstractCompletionTest {
-public ExplicitConstructorInvocationCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(ExplicitConstructorInvocationCompletionTest.class);
-}
-/*
- * Completion on a qualified 'super' constructor invocation.
- *
- * ie. ExplicitConstructorInvocation ::= Primary '.' 'super' '(' ArgumentListopt ')' ';'
- */
-public void testPrimarySuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar(Bar x) { \n" +
- " primary().super(1, 2, i); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "super(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnExplicitConstructorCall:primary().super(1, 2)>;",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar(Bar x) {\n" +
- " <CompleteOnExplicitConstructorCall:primary().super(1, 2)>;\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on explicit constructor invocation primary super>"
- );
-}
-/*
- * Completion on a qualified 'this' constructor invocation.
- *
- * ie. ExplicitConstructorInvocation ::= Primary '.' 'this' '(' ArgumentListopt ')' ';'
- */
-public void testPrimaryThis() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar(Bar x) { \n" +
- " primary().this(1, 2, i); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "this(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnExplicitConstructorCall:primary().this(1, 2)>;",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar(Bar x) {\n" +
- " <CompleteOnExplicitConstructorCall:primary().this(1, 2)>;\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on explicit constructor invocation primary this>"
- );
-}
-/*
- * Completion on a 'super' constructor invocation.
- *
- * ie. ExplicitConstructorInvocation ::= 'super' '(' ArgumentListopt ')' ';'
- */
-public void testSuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " super(1, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "super(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnExplicitConstructorCall:super(1, 2)>;",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " <CompleteOnExplicitConstructorCall:super(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<completion on 'super' constructor invocation>"
- );
-}
-/*
- * Completion on a 'this' constructor invocation.
- *
- * ie. ExplicitConstructorInvocation ::= 'this' '(' ArgumentListopt ')' ';'
- */
-public void testThis() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " this(1, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "this(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnExplicitConstructorCall:this(1, 2)>;",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " <CompleteOnExplicitConstructorCall:this(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<completion on 'this' constructor invocation>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= Name '.' 'super' '(' <ArgumentListopt> ')' ';'
- */
-public void testWrapperNameSuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.super(fred().xyz); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred().x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " super(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on wrapper name super>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= Name '.' 'this' '(' <ArgumentListopt> ')' ';'
- */
-public void testWrapperNameThis() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.this(fred().xyz); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred().x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " this(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on wrapper name this>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= Primary '.' 'this' '(' <ArgumentListopt> ')' ';'
- */
-public void testWrapperPrimarySuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar(Bar x) { \n" +
- " primary().super(fred().xyz); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred().x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar(Bar x) {\n" +
- " super(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on wrapper primary super>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= 'super' '(' <ArgumentListopt> ')' ';'
- */
-public void testWrapperSuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " super(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " super(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on wrapper super>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= 'this' '(' <ArgumentListopt> ')' ';'
- */
-public void testWrapperThis() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " this(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " this(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on wrapper this>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java
deleted file mode 100644
index 541b7f2..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-/**
- * Selection is expected to be wrapped with an explicit constructor invocation.
- */
-public class ExplicitConstructorInvocationSelectionTest extends AbstractSelectionTest {
-public ExplicitConstructorInvocationSelectionTest(String testName) {
- super(testName);
-}
-/*
- * ExplicitConstructorInvocation ::= Name '.' 'super' '(' <ArgumentListopt> ')' ';'
- */
-public void testNameSuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.super(fred()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // selectionStartBehind:
- "Bar.super(",
- // selectionEndBehind:
- "fred",
- // expectedSelectionNodeToString:
- "<SelectOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " super(<SelectOnMessageSend:fred()>);\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedSelectionIdentifier:
- "fred",
- // expectedReplacedSource:
- "fred()",
- // testName:
- "<select on explicit constructor invocation name super>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= Name '.' 'this' '(' <ArgumentListopt> ')' ';'
- */
-public void testNameThis() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.this(fred()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // selectionStartBehind:
- "Bar.this(",
- // selectionEndBehind:
- "fred",
- // expectedSelectionNodeToString:
- "<SelectOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " this(<SelectOnMessageSend:fred()>);\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedSelectionIdentifier:
- "fred",
- // expectedReplacedSource:
- "fred()",
- // testName:
- "<select on explicit constructor invocation name this>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= Primary '.' 'this' '(' <ArgumentListopt> ')' ';'
- */
-public void testPrimarySuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " InnerBar(Bar x) { \n" +
- " } \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar(Bar x) { \n" +
- " primary().super(fred()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // selectionStartBehind:
- "super(",
- // selectionEndBehind:
- "fred",
- // expectedSelectionNodeToString:
- "<SelectOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " InnerBar(Bar x) {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar(Bar x) {\n" +
- " super(<SelectOnMessageSend:fred()>);\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedSelectionIdentifier:
- "fred",
- // expectedReplacedSource:
- "fred()",
- // testName:
- "<select on explicit constructor invocation primary super>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= 'super' '(' <ArgumentListopt> ')' ';'
- */
-public void testSuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " super(fred()); \n" +
- " } \n" +
- "} \n",
- // selectionStartBehind:
- "super(",
- // selectionEndBehind:
- "fred",
- // expectedSelectionNodeToString:
- "<SelectOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " super(<SelectOnMessageSend:fred()>);\n" +
- " }\n" +
- "}\n",
- // expectedSelectionIdentifier:
- "fred",
- // expectedReplacedSource:
- "fred()",
- // testName:
- "<select on explicit constructor invocation super>"
- );
-}
-/*
- * ExplicitConstructorInvocation ::= 'this' '(' <ArgumentListopt> ')' ';'
- */
-public void testThis() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " this(fred()); \n" +
- " } \n" +
- "} \n",
- // selectionStartBehind:
- "this(",
- // selectionEndBehind:
- "fred",
- // expectedSelectionNodeToString:
- "<SelectOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " this(<SelectOnMessageSend:fred()>);\n" +
- " }\n" +
- "}\n",
- // expectedSelectionIdentifier:
- "fred",
- // expectedReplacedSource:
- "fred()",
- // testName:
- "<select on explicit constructor invocation this>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/FieldAccessCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/FieldAccessCompletionTest.java
deleted file mode 100644
index f02fb25..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/FieldAccessCompletionTest.java
+++ /dev/null
@@ -1,2424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be a FieldAccess.
- */
-public class FieldAccessCompletionTest extends AbstractCompletionTest {
-public FieldAccessCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(FieldAccessCompletionTest.class);
-}
-/*
- * AdditiveExpression ::= AdditiveExpression '-' <MultiplicativeExpression>
- */
-public void testAdditiveExpressionMinus() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return 1 - fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " (1 - <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on additive expression minus>"
- );
-}
-/*
- * AdditiveExpression ::= AdditiveExpression '+' <MultiplicativeExpression>
- */
-public void testAdditiveExpressionPlus() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return 1 + fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " (1 + <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on additive expression plus>"
- );
-}
-/*
- * AndExpression ::= AndExpression '&' <EqualityExpression>
- */
-public void testAndExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return isTrue & fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (isTrue & <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // expectedReplacedSource:
- "<complete on and expression>"
- );
-}
-/*
- * ArgumentList ::= ArgumentList ',' <Expression>
- */
-public void testArgumentList() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " bizz(1, \"2\", fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " bizz(1, \"2\", <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on argument list>"
- );
-}
-/*
- * ArrayAccess ::= Name '[' <Expression> ']'
- */
-public void testArrayAccess() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return v[fred().xyz]; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " v[<CompleteOnMemberAccess:fred().x>];\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on array access>"
- );
-}
-/*
- * ArrayAccess ::= PrimaryNoNewArray '[' <Expression> ']'
- */
-public void testArrayAccessPrimaryNoNewArray() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return buzz()[fred().xyz]; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " buzz()[<CompleteOnMemberAccess:fred().x>];\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on array access primary no new array>"
- );
-}
-/*
- * ArrayInitializer ::= '{' <VariableInitializers> '}'
- */
-public void testArrayInitializer() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int[] i = new int[] {fred().xyz} \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int[] i = new int[]{<CompleteOnMemberAccess:fred().x>};\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on array initializer>"
- );
-}
-/*
- * ArrayInitializer ::= '{' <VariableInitializers> , '}'
- */
-public void testArrayInitializerComma() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int[] i = new int[] {fred().xyz,} \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int[] i = new int[]{<CompleteOnMemberAccess:fred().x>};\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on array initializer comma>"
- );
-}
-/*
- * Assignment ::= LeftHandSide AssignmentOperator <AssignmentExpression>
- */
-public void testAssignment() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " i = fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on assignment>"
- );
-}
-/*
- * Block ::= OpenBlock '{' <BlockStatementsopt> '}'
- */
-public void testBlock() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " try { \n" +
- " fred().xyz = new Foo(); \n" +
- " } catch (Exception e) {} \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on block>"
- );
-}
-/*
- * BlockStatements ::= BlockStatements <BlockStatement>
- */
-public void testBlockStatements() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on block statements>"
- );
-}
-/*
- * ConstructorBody ::= NestedMethod '{' ExplicitConstructorInvocation <BlockStatements> '}'
- */
-public void testBlockStatementsInConstructorBody() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " super(); \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " super();\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on block statements in constructor body>"
- );
-}
-/*
- * BlockStatements ::= BlockStatements <BlockStatement>
- *
- * in a non static initializer.
- */
-public void testBlockStatementsInInitializer() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " { \n" +
- " int i = 0; \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " {\n" +
- " int i;\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on block statements in initializer>"
- );
-}
-/*
- * BlockStatements ::= BlockStatements <BlockStatement>
- *
- * in a static initializer.
- */
-public void testBlockStatementsInStaticInitializer() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static { \n" +
- " int i = 0; \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " static {\n" +
- " int i;\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on block statements in static initializer>"
- );
-}
-/*
- * CastExpression ::= PushLPAREN <Expression> PushRPAREN UnaryExpressionNotPlusMinus
- *
- * NB: Valid syntaxically but not semantically
- */
-public void testCastExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar foo() { \n" +
- " return (fred().xyz)buzz(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " Bar foo() {\n" +
- " return <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on cast expression>"
- );
-}
-/*
- * CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN <UnaryExpression>
- * or
- * CastExpression ::= PushLPAREN Name Dims PushRPAREN <UnaryExpressionNotPlusMinus>
- * or
- * CastExpression ::= PushLPAREN Expression PushRPAREN <UnaryExpressionNotPlusMinus>
- */
-public void testCastExpressionUnaryExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar foo() { \n" +
- " return (Bar)(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " Bar foo() {\n" +
- " (Bar) <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on cast expression unary expression>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= 'new' ClassType '(' <ArgumentListopt> ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new Bar(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Bar(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on class instance creation expression>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionName() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " Bar.new Bar(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Bar.new Bar(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on class instance creation expression name>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' <ArgumentListopt> ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionPrimary() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " bizz().new Bar(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " bizz().new Bar(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on class instance creation expression primary>"
- );
-}
-/*
- * ConditionalAndExpression ::= ConditionalAndExpression '&&' <InclusiveOrExpression>
- */
-public void testConditionalAndExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return isTrue && fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (isTrue && <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on conditional and expression>"
- );
-}
-/*
- * ConditionalExpression ::= ConditionalOrExpression '?' <Expression> ':' ConditionalExpression
- */
-public void testConditionalExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar foo() { \n" +
- " return fred().xyz == null ? null : new Bar(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " Bar foo() {\n" +
- " return <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on conditional expression>"
- );
-}
-/*
- * ConditionalExpression ::= ConditionalOrExpression '?' Expression ':' <ConditionalExpression>
- */
-public void testConditionalExpressionConditionalExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return isTrue ? true : fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (isTrue ? true : <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on conditional expression conditional expression>"
- );
-}
-/*
- * ConditionalOrExpression ::= ConditionalOrExpression '||' <ConditionalAndExpression>
- */
-public void testConditionalOrExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return isTrue || fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (isTrue || <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on conditional or expression>"
- );
-}
-/*
- * ConstructorBody ::= NestedMethod '{' <BlockStatementsopt> '}'
- */
-public void testConstructorBody() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " super();\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on constructor body>"
- );
-}
-/*
- * DimWithOrWithOutExpr ::= '[' <Expression> ']'
- */
-public void testDimWithOrWithOutExpr() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int[] v = new int[fred().xyz]; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int[] v = new int[<CompleteOnMemberAccess:fred().x>];\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on dim with or without expr>"
- );
-}
-/*
- * DoStatement ::= 'do' Statement 'while' '(' <Expression> ')' ';'
- */
-public void testDoExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " do \n" +
- " System.out.println(); \n" +
- " while (fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on do expression>"
- );
-}
-/*
- * DoStatement ::= 'do' <Statement> 'while' '(' Expression ')' ';'
- */
-public void testDoStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " do \n" +
- " fred().xyz = new Foo(); \n" +
- " while (true); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on do statement>"
- );
-}
-/*
- * EqualityExpression ::= EqualityExpression '==' <RelationalExpression>
- */
-public void testEqualityExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return 1 == fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (1 == <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on equality expression>"
- );
-}
-/*
- * EqualityExpression ::= EqualityExpression '!=' <RelationalExpression>
- */
-public void testEqualityExpressionNot() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return 1 != fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (1 != <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on equality expression not>"
- );
-}
-/*
- * ExclusiveOrExpression ::= ExclusiveOrExpression '^' <AndExpression>
- */
-public void testExclusiveOrExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return isTrue ^ fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (isTrue ^ <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on exclusive or expression>"
- );
-}
-/*
- * ConstructorBody ::= NestedMethod '{' <ExplicitConstructorInvocation> '}'
- * or
- * ConstructorBody ::= NestedMethod '{' <ExplicitConstructorInvocation> BlockStatements '}'
- */
-public void testExplicitConstructorInvocationInConstructorBody() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.x.x.super(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "Bar.x.x",
- // expectedCompletionNodeToString:
- "<CompleteOnName:Bar.x.x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " public InnerBar() {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " super();\n" +
- " <CompleteOnName:Bar.x.x>;\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "Bar.x.x",
- // test name
- "<complete on explicit constructor invocation in constructor body>"
- );
-}
-/*
- * ForStatement ::= 'for' '(' <ForInitopt> ';' Expressionopt ';' ForUpdateopt ')' Statement
- * or
- * ForStatementNoShortIf ::= 'for' '(' <ForInitopt> ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf
- */
-public void testForInit() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " for (int i = fred().xyz; i < 2; i++) \n" +
- " System.out.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on for init>"
- );
-}
-/*
- * ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' <Statement>
- * or
- * ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' <StatementNoShortIf>
- */
-public void testForStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " for (int i = 0; i < 2; i++) \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on for statement>"
- );
-}
-/*
- * ForStatement ::= 'for' '(' ForInitopt ';' <Expressionopt> ';' ForUpdateopt ')' Statement
- * or
- * ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' <Expressionopt> ';' ForUpdateopt ')' StatementNoShortIf
- */
-public void testForStatementExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " for (int i = 0; fred().xyz > i; i++) \n" +
- " Systemout.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on for statement expression>"
- );
-}
-/*
- * ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' <ForUpdateopt> ')' Statement
- * or
- * ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' <ForUpdateopt> ')' StatementNoShortIf
- */
-public void testForUpdate() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " for (int i = 0; i < 2; i+= fred().xyz) \n" +
- " System.out.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " i += <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on for update>"
- );
-}
-/*
- * IfThenStatement ::= 'if' '(' <Expression> ')' Statement
- */
-public void testIfExpresionThen() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (fred().xyz) \n" +
- " System.out.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on \"if expression then\">"
- );
-}
-/*
- * IfThenElseStatement ::= 'if' '(' <Expression> ')' StatementNoShortIf 'else' Statement
- * or
- * IfThenElseStatementNoShortIf ::= 'if' '(' <Expression> ')' StatementNoShortIf 'else' StatementNoShortIf
- */
-public void testIfExpresionThenElse() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (fred().xyz) \n" +
- " System.out.println(); \n" +
- " else \n" +
- " System.out.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on \"if expression then else\">"
- );
-}
-/*
- * IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' <Statement>
- * or
- * IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' <StatementNoShortIf>
- */
-public void testIfThenElseStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (false) \n" +
- " System.out.println(); \n" +
- " else \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on \"if then else\" statement>"
- );
-}
-/*
- * IfThenStatement ::= 'if' '(' Expression ')' <Statement>
- */
-public void testIfThenStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (true) \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on \"if then\" statement>"
- );
-}
-/*
- * IfThenStatementElse ::= 'if' '(' Expression ')' <StatementNoShortIf> 'else' Statement
- * or
- * IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' <StatementNoShortIf> 'else' StatementNoShortIf
- */
-public void testIfThenStatementElse() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (true) \n" +
- " fred().xyz = new Foo(); \n" +
- " else \n" +
- " System.out.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on \"if then statement else\">"
- );
-}
-/*
- * InclusiveOrExpression ::= InclusiveOrExpression '|' <ExclusiveOrExpression>
- */
-public void testInclusiveOrExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return isTrue | fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (isTrue | <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on inclusive or expression>"
- );
-}
-/*
- * LabeledStatement ::= 'Identifier' ':' <Statement>
- * or
- * LabeledStatementNoShortIf ::= 'Identifier' ':' <StatementNoShortIf>
- */
-public void testLabeledStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " fredCall: fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // expectedLabels:
- new String[] {"fredCall"},
- // test name
- "<complete on labeled statement>"
- );
-}
-/*
- * MethodBody ::= NestedMethod '{' <BlockStatementsopt> '}'
- */
-public void testMethodBody() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on method body>"
- );
-}
-/*
- * FunctionInvocation ::= Name '(' <ArgumentListopt> ')'
- */
-public void testMethodInvocation() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " bizz(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " bizz(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on method invocation>"
- );
-}
-/*
- * FunctionInvocation ::= Primary '.' 'Identifier' '(' <ArgumentListopt> ')'
- */
-public void testMethodInvocationPrimary() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " buzz().bizz(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " buzz().bizz(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on method invocation primary>"
- );
-}
-/*
- * FunctionInvocation ::= 'super' '.' 'Identifier' '(' <ArgumentListopt> ')'
- */
-public void testMethodInvocationSuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " super.bizz(fred().xyz); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " super.bizz(<CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on method invocation super>"
- );
-}
-/*
- * MultiplicativeExpression ::= MultiplicativeExpression '/' <UnaryExpression>
- */
-public void testMultiplicativeExpressiondDivision() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " double foo() { \n" +
- " return 2 / fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " double foo() {\n" +
- " (2 / <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on multiplicative expression division>"
- );
-}
-/*
- * MultiplicativeExpression ::= MultiplicativeExpression '*' <UnaryExpression>
- */
-public void testMultiplicativeExpressionMultiplication() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return 2 * fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " (2 * <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on multiplicative expression multiplication>"
- );
-}
-/*
- * MultiplicativeExpression ::= MultiplicativeExpression '%' <UnaryExpression>
- */
-public void testMultiplicativeExpressionRemainder() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return 2 % fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " (2 % <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on multiplicative expression remainder>"
- );
-}
-/*
- * PreDecrementExpression ::= '--' PushPosition <UnaryExpression>
- */
-public void testPreIncrementExpressionMinusMinus() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " -- fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " -- <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on pre increment expression minus minus>"
- );
-}
-/*
- * PreIncrementExpression ::= '++' PushPosition <UnaryExpression>
- */
-public void testPreIncrementExpressionPlusPlus() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " ++ fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " ++ <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on pre increment expression plus plus>"
- );
-}
-/*
- * PrimaryNoNewArray ::= PushLPAREN <Expression> PushRPAREN
- */
-public void testPrimaryNoNewArray() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " (fred().xyz).zzz(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on primary no new array>"
- );
-}
-/*
- * RelationalExpression ::= RelationalExpression '>' <ShiftExpression>
- */
-public void testRelationalExpressionGreaterThan() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return 1 > fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (1 > <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on relational expression greater than>"
- );
-}
-/*
- * RelationalExpression ::= RelationalExpression '>=' <ShiftExpression>
- */
-public void testRelationalExpressionGreaterThanOrEquals() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return 1 >= fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (1 >= <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on relational expression greater than or equal>"
- );
-}
-/*
- * RelationalExpression ::= RelationalExpression '<' <ShiftExpression>
- */
-public void testRelationalExpressionLessThan() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return 1 < fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (1 < <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on relational expression less than>"
- );
-}
-/*
- * RelationalExpression ::= RelationalExpression '<=' <ShiftExpression>
- */
-public void testRelationalExpressionLessThanOrEqual() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return 1 <= fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (1 <= <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on relational expression less than or equal>"
- );
-}
-/*
- * ReturnStatement ::= 'return' <Expressionopt> ';
- */
-public void testReturnStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " return <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on return statement>"
- );
-}
-/*
- * ShiftExpression ::= ShiftExpression '<<' <AdditiveExpression>
- */
-public void testShiftExpressionLeft() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return i << fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " (i << <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on shift expression left>"
- );
-}
-/*
- * ShiftExpression ::= ShiftExpression '>>' <AdditiveExpression>
- */
-public void testShiftExpressionRight() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return i >> fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " (i >> <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on shift expression right>"
- );
-}
-/*
- * ShiftExpression ::= ShiftExpression '>>>' <AdditiveExpression>
- */
-public void testShiftExpressionRightUnSigned() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " int foo() { \n" +
- " return i >>> fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " int foo() {\n" +
- " (i >>> <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on shift expression right unsigned>"
- );
-}
-/*
- * StatementExpressionList ::= StatementExpressionList ',' <StatementExpression>
- */
-public void testStatementExpressionList() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " for (int i = 0, length = fred().xyz; i < 2; i++) \n" +
- " System.out.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " int length = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on statement expression list>"
- );
-}
-/*
- * SwitchBlockStatement ::= SwitchLabels <BlockStatements>
- */
-public void testSwitchBlockStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " switch (i) { \n" +
- " case 0: fred().xyz = new Foo(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on switch block statement>"
- );
-}
-/*
- * SwitchStatement ::= 'switch' OpenBlock '(' <Expression> ')' SwitchBlock
- */
-public void testSwitchExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " switch (fred().xyz) { \n" +
- " case 0: System.out.println(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on switch expression>"
- );
-}
-/*
- * SwitchLabel ::= 'case' <ConstantExpression> ':'
- */
-public void testSwitchLabel() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " switch (i) { \n" +
- " case fred().xyz: System.out.println(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " switch (i) {\n" +
- " case <CompleteOnMemberAccess:fred().x> : ;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on switch label>"
- );
-}
-/*
- * SynchronizedStatement ::= OnlySynchronized '(' <Expression> ')' Block
- */
-public void testSynchronizedStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " synchronized (fred().xyz) { \n" +
- " System.out.println(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on synchronized expression>"
- );
-}
-/*
- * ThrowStatement ::= 'throw' <Expression> ';'
- */
-public void testThrowExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " throw fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on throw expression>"
- );
-}
-/*
- * UnaryExpressionNotPlusMinus ::= '~' PushPosition <UnaryExpression>
- */
-public void testUnaryExpressionBitwiseComplement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " i = ~ fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (~ <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on unary expression bitwise complement>"
- );
-}
-/*
- * UnaryExpressionNotPlusMinus ::= '!' PushPosition <UnaryExpression>
- */
-public void testUnaryExpressionLogicalComplement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " i = ! fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (! <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on unary expression logical complement>"
- );
-}
-/*
- * UnaryExpression ::= '-' PushPosition <UnaryExpression>
- */
-public void testUnaryExpressionMinus() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " i = - fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (- <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on unary expression minus>"
- );
-}
-/*
- * UnaryExpression ::= '+' PushPosition <UnaryExpression>
- */
-public void testUnaryExpressionPlus() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " i = + fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (+ <CompleteOnMemberAccess:fred().x>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on unary expression plus>"
- );
-}
-/*
- * VariableDeclarator ::= VariableDeclaratorId EnterField '=' ForceNoDiet <VariableInitializer> RestoreDiet ExitField
- */
-public void testVariableDeclarator() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on variable declarator>"
- );
-}
-/*
- * VariableInitializers ::= VariableInitializers ',' <VariableInitializer>
- */
-public void testVariableInitializers() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0, j = fred().xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " int j = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on variable initializers>"
- );
-}
-/*
- * WhileStatement ::= 'while' '(' <Expression> ')' Statement
- * or
- * WhileStatementNoShortIf ::= 'while' '(' <Expression> ')' StatementNoShortIf
- */
-public void testWhileExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " while (fred().xyz) \n" +
- " System.out.println(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on while expresion>"
- );
-}
-/*
- * WhileStatement ::= 'while' '(' Expression ')' <Statement>
- * or
- * WhileStatementNoShortIf ::= 'while' '(' Expression ')' <StatementNoShortIf>
- */
-public void testWhileStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " while (true) \n" +
- " fred().xyz = new Foo(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on while statement>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/InMemoryNameEnvironment.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/InMemoryNameEnvironment.java
deleted file mode 100644
index bfeb591..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/InMemoryNameEnvironment.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.env.*;
-import org.eclipse.wst.jsdt.internal.compiler.impl.ITypeRequestor;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.internal.compiler.util.HashtableOfObject;
-
-public class InMemoryNameEnvironment implements INameEnvironment {
- INameEnvironment[] classLibs;
- HashtableOfObject compilationUnits = new HashtableOfObject();
-public InMemoryNameEnvironment(String[] compilationUnits, INameEnvironment[] classLibs) {
- this.classLibs = classLibs;
- for (int i = 0, length = compilationUnits.length - 1; i < length; i += 2) {
- String fileName = compilationUnits[i];
- char[] contents = compilationUnits[i + 1].toCharArray();
- String dirName = "";
- int lastSlash = -1;
- if ((lastSlash = fileName.lastIndexOf('/')) != -1) {
- dirName = fileName.substring(0, lastSlash);
- }
- char[] packageName = dirName.replace('/', '.').toCharArray();
- char[] cuName = fileName.substring(lastSlash == -1 ? 0 : lastSlash + 1, fileName.length() - 5).toCharArray(); // remove ".java"
- HashtableOfObject cus = (HashtableOfObject)this.compilationUnits.get(packageName);
- if (cus == null) {
- cus = new HashtableOfObject();
- this.compilationUnits.put(packageName, cus);
- }
- CompilationUnit unit = new CompilationUnit(contents, fileName, null);
- cus.put(cuName, unit);
- }
-}
-public NameEnvironmentAnswer findType(char[][] compoundTypeName, ITypeRequestor requestor) {
- return findType(
- compoundTypeName[compoundTypeName.length - 1],
- CharOperation.subarray(compoundTypeName, 0, compoundTypeName.length - 1),requestor);
-}
-public NameEnvironmentAnswer findBinding(char[] typeName, char[][] packageName, int type, ITypeRequestor requestor, boolean returnMultiple, String excludePath) {
- HashtableOfObject cus = (HashtableOfObject)this.compilationUnits.get(CharOperation.concatWith(packageName, '.'));
- if (cus == null) {
- return this.findTypeFromClassLibs(typeName, packageName,type,requestor);
- }
- CompilationUnit unit = (CompilationUnit)cus.get(typeName);
- if (unit == null) {
- return this.findTypeFromClassLibs(typeName, packageName,type,requestor);
- }
- return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
-}
-
-public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName, ITypeRequestor requestor) {
- return findBinding(typeName, packageName, Binding.TYPE|Binding.PACKAGE,requestor, false, null);
-// HashtableOfObject cus = (HashtableOfObject)this.compilationUnits.get(CharOperation.concatWith(packageName, '.'));
-// if (cus == null) {
-// return this.findTypeFromClassLibs(typeName, packageName);
-// }
-// JavaScriptUnit unit = (JavaScriptUnit)cus.get(typeName);
-// if (unit == null) {
-// return this.findTypeFromClassLibs(typeName, packageName);
-// }
-// return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
-}
-private NameEnvironmentAnswer findTypeFromClassLibs(char[] typeName, char[][] packageName, int type, ITypeRequestor requestor) {
- for (int i = 0; i < this.classLibs.length; i++) {
- NameEnvironmentAnswer answer = this.classLibs[i].findBinding(typeName, packageName, type,requestor, false, null);
- if (answer != null) {
- return answer;
- }
- }
- return null;
-}
-public boolean isPackage(char[][] parentPackageName, char[] packageName) {
- char[] pkg = CharOperation.concatWith(parentPackageName, packageName, '.');
- return
- this.compilationUnits.get(pkg) != null ||
- this.isPackageFromClassLibs(parentPackageName, packageName);
-}
-public boolean isPackageFromClassLibs(char[][] parentPackageName, char[] packageName) {
- for (int i = 0; i < this.classLibs.length; i++) {
- if (this.classLibs[i].isPackage(parentPackageName, packageName)) {
- return true;
- }
- }
- return false;
-}
-public void cleanup() {
- for (int i = 0, max = this.classLibs.length; i < max; i++) {
- this.classLibs[i].cleanup();
- }
- this.compilationUnits = new HashtableOfObject();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/InnerTypeCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/InnerTypeCompletionTest.java
deleted file mode 100644
index 6ff33c9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/InnerTypeCompletionTest.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be in an inner type
- */
-public class InnerTypeCompletionTest extends AbstractCompletionTest {
-public InnerTypeCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(InnerTypeCompletionTest.class);
-}
-/*
- * Test completion in the first method of an anonymous inner class
- */
-public void testAnonymousFirstMethod() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " Object o = new Object() { \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " void fuzz() { \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " new Object() {\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " void fuzz() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in anonymous inner class in first method>"
- );
-}
-/*
- * Test completion in anonymous inner class with no statement defined before.
- */
-public void testAnonymousNoStatementBefore() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " Object o = new Object() { \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " new Object() {\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in anonymous inner class with no statement before>"
- );
-}
-/*
- * Test completion in anonymous inner class with one field defined before
- * the method containing the completion.
- */
-public void testAnonymousOneFieldBefore() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " Object o = new Object() { \n" +
- " int field = 1; \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " new Object() {\n" +
- " int field;\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in anonymous inner class with one field before>"
- );
-}
-/*
- * Test completion in anonymous inner class with one statement defined before.
- */
-public void testAnonymousOneStatementBefore() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 1; \n" +
- " Object o = new Object() { \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " Object o;\n" +
- " new Object() {\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in anonymous inner class with one statement before>"
- );
-}
-/*
- * Test completion in the second method of an anonymous inner class
- */
-public void testAnonymousSecondMethod() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " Object o = new Object() { \n" +
- " void fuzz() { \n" +
- " } \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " new Object() {\n" +
- " void fuzz() {\n" +
- " }\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in anonymous inner class in second method>"
- );
-}
-/*
- * Test completion in the first method of a local type declaration
- */
-public void testLocalTypeFirstMethod() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " class InnerBar { \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " void fuzz() { \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class InnerBar {\n" +
- " InnerBar() {\n" +
- " }\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " void fuzz() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in local type declaration in first method>"
- );
-}
-/*
- * Test completion in local type declaration with no statement defined before.
- */
-public void testLocalTypeNoStatementBefore() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " class InnerBar { \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class InnerBar {\n" +
- " InnerBar() {\n" +
- " }\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in local type declaration with no statement before>"
- );
-}
-/*
- * Test completion in local type declaration with one field defined before
- * the method containing the completion.
- */
-public void testLocalTypeOneFieldBefore() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " class InnerBar { \n" +
- " int field = 1; \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class InnerBar {\n" +
- " int field;\n" +
- " InnerBar() {\n" +
- " }\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in local type declaration with one field before>"
- );
-}
-/*
- * Test completion in local type declaration with one statement defined before.
- */
-public void testLocalTypeOneStatementBefore() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 1; \n" +
- " class InnerBar { \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " class InnerBar {\n" +
- " InnerBar() {\n" +
- " }\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in local type declaration with 1 statement before>"
- );
-}
-/*
- * Test completion in the second method of a local type declaration
- */
-public void testLocalTypeSecondMethod() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " class InnerBar { \n" +
- " void fuzz() { \n" +
- " } \n" +
- " void buzz() { \n" +
- " int i = fred().xyz; \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:fred().x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class InnerBar {\n" +
- " InnerBar() {\n" +
- " }\n" +
- " void fuzz() {\n" +
- " }\n" +
- " void buzz() {\n" +
- " int i = <CompleteOnMemberAccess:fred().x>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete in local type declaration in second method>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/JavadocCompletionParserTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
deleted file mode 100644
index 809ee43..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
+++ /dev/null
@@ -1,545 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionJavadoc;
-import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnJavadocTag;
-import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionParser;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.parser.JavadocTagConstants;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-public class JavadocCompletionParserTest extends AbstractCompletionTest implements JavadocTagConstants {
- public static int INLINE_ALL_TAGS_LENGTH = 0;
- public static int BLOCK_ALL_TAGS_LENGTH = 0;
- static {
- for (int i=0; i<INLINE_TAGS_LENGTH; i++) {
- INLINE_ALL_TAGS_LENGTH += INLINE_TAGS[i].length;
- }
- for (int i=0; i<BLOCK_TAGS_LENGTH; i++) {
- BLOCK_ALL_TAGS_LENGTH += BLOCK_TAGS[i].length;
- }
- }
-
- CompletionJavadoc javadoc;
- String sourceLevel;
-
-public JavadocCompletionParserTest(String testName) {
- super(testName);
-}
-
-static {
- // org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine.DEBUG = true;
-// TESTS_NUMBERS = new int[] { 8 };
-// TESTS_RANGE = new int[] { 20, -1 };
-}
-
-public static Test suite() {
- return buildAllCompliancesTestSuite(JavadocCompletionParserTest.class);
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.test.performance.PerformanceTestCase#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- this.sourceLevel = null;
-}
-
-protected void assertCompletionNodeResult(String source, String expected) {
- ASTNode completionNode = this.javadoc.getCompletionNode();
- assertNotNull("Javadoc should have a completion node!!!", completionNode);
- String actual = this.javadoc.getCompletionNode().toString();
- if (!expected.equals(actual)) {
- System.out.println("********************************************************************************");
- System.out.print(getName());
- System.out.println(" expect following result:");
- String toDisplay = new String(org.eclipse.wst.jsdt.core.tests.util.Util.displayString(new String(actual), 2).toCharArray());
- System.out.println(toDisplay);
- System.out.println("--------------------------------------------------------------------------------");
- System.out.println(source);
- }
- assertEquals(
- "Completion node is not correct!",
- expected,
- actual
- );
-}
-protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- if (this.sourceLevel == null) {
- return options;
- }
- options.put(CompilerOptions.OPTION_Source, this.sourceLevel);
- return options;
-}
-protected void verifyCompletionInJavadoc(String source, String after) {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- CompletionParser parser = new CompletionParser(new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- options,
- new DefaultProblemFactory(Locale.getDefault())));
-
- ICompilationUnit sourceUnit = new CompilationUnit(source.toCharArray(), "Test.java", null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- int cursorLocation = source.indexOf(after) + after.length() - 1;
- parser.dietParse(sourceUnit, compilationResult, cursorLocation);
-
- assertNotNull("Parser should have an assist node parent", parser.assistNodeParent);
- assertEquals("Expecting completion in javadoc!", CompletionJavadoc.class, parser.assistNodeParent.getClass());
- this.javadoc = (CompletionJavadoc) parser.assistNodeParent;
-}
-
-protected void verifyCompletionOnJavadocTag(char[] tag, char[][] expectedTags, boolean inline) {
- assertTrue("Invalid javadoc completion node!", this.javadoc.getCompletionNode() instanceof CompletionOnJavadocTag);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- StringBuffer expected = new StringBuffer("<CompleteOnJavadocTag:");
- if (inline) expected.append('{');
- expected.append('@');
- if (tag != null) expected.append(tag);
- if (inline) expected.append('}');
- if (expectedTags != null) {
- expected.append("\npossible tags:");
- int length = expectedTags.length;
- for (int i=0; i<length; i++) {
- expected.append("\n - ");
- expected.append(expectedTags[i]);
- }
- expected.append('\n');
- }
- expected.append(">");
- if (expectedTags == null) {
- assertEquals("Invalid completion tag", expected.toString(), completionTag.toString());
- } else {
- String completionTagString = completionTag.toString();
- StringTokenizer completionTagTokenizer = new StringTokenizer(completionTagString, "\n");
- StringBuffer completionTagBuffer = new StringBuffer(completionTagString.length());
- boolean possibleLine = false, newLine = false;
- while (completionTagTokenizer.hasMoreTokens()) {
- String line = completionTagTokenizer.nextToken();
- if (line.startsWith("possible")) {
- if (!possibleLine) {
- possibleLine = true;
- completionTagBuffer.append("\npossible tags:");
- }
- } else {
- if (newLine) completionTagBuffer.append('\n');
- completionTagBuffer.append(line);
- }
- newLine = true;
- }
- assertEquals("Invalid completion tag", expected.toString(), completionTagBuffer.toString());
- }
-}
-
-protected void verifyAllTagsCompletion() {
- char[][] allTags = {
- // Block tags
- TAG_AUTHOR, TAG_DEPRECATED, TAG_EXCEPTION, TAG_PARAM, TAG_RETURN, TAG_SEE, TAG_VERSION,
- TAG_SINCE,
-// TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD ,
- TAG_THROWS,
- // Inline tags
- TAG_LINK
- };
- verifyCompletionOnJavadocTag(null, allTags, false);
-}
-
-/**
- * @tests Test completions for javadoc tag names
- */
-public void test001() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@");
- verifyAllTagsCompletion();
-}
-
-public void test002() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion on impossible tag name:\n" +
- " * @none\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@none");
- verifyCompletionOnJavadocTag("none".toCharArray(), null, false);
-}
-
-public void test003() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion on one letter:\n" +
- " * @v\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@v");
- char[][] allTags = this.complianceLevel.equals(COMPLIANCE_1_3)
- ? new char[][] { TAG_VERSION }
- : new char[][] { TAG_VERSION };
- verifyCompletionOnJavadocTag(new char[] { 'v' }, allTags, false);
-}
-
-public void test004() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion with several letters:\n" +
- " * @deprec\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@deprec");
- verifyCompletionOnJavadocTag("deprec".toCharArray(), new char[][] { TAG_DEPRECATED }, false);
-}
-
-public void test005() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion on full tag name:\n" +
- " * @link\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@link");
- char[][] allTags = this.complianceLevel.equals(COMPLIANCE_1_3)
- ? new char[][] { TAG_LINK }
- : new char[][] { TAG_LINK };
- verifyCompletionOnJavadocTag("link".toCharArray(), allTags, false);
-}
-
-public void test006() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion on empty tag name @ but inside text\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@");
- char[][] allTags = {
- TAG_LINK
- };
- verifyCompletionOnJavadocTag(null, allTags, false);
-}
-
-public void test007() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion on :\n" +
- " * @\n" +
- " * - with following lines:\n" +
- " * + \"@ {@link }\"\n" +
- " * + \"@ {@linkplain }\"\n" +
- " * + \"@ {@literal }\"\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@");
- verifyAllTagsCompletion();
-}
-/**
- * @bug [javadoc][assist] @linkplain no longer proposed when 1.4 compliance is used
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=123096"
- */
-public void test008() {
- this.sourceLevel = CompilerOptions.VERSION_1_3;
- String source = "package javadoc;\n" +
- "/**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@");
- verifyAllTagsCompletion();
-}
-
-/**
- * @tests Tests to verify completion node flags
- * @bug 113506: [javadoc][assist] No tag proposals when there is a prefix on a line
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=113506"
- */
-public void test010() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @see \n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@see ");
- assertCompletionNodeResult(source,
- "<CompletionOnJavadocSingleTypeReference:\n" +
- " infos:formal reference\n" +
- ">"
- );
-}
-
-public void test011() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@link }\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@link ");
- assertCompletionNodeResult(source,
- "<CompletionOnJavadocSingleTypeReference:\n" +
- " infos:formal reference\n" +
- ">"
- );
-}
-public void test012() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @see Str\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "Str");
- assertCompletionNodeResult(source,
- "<CompletionOnJavadocSingleTypeReference:Str\n" +
- " infos:formal reference\n" +
- ">"
- );
-}
-
-public void test013() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@link Str}\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "Str");
- assertCompletionNodeResult(source,
- "<CompletionOnJavadocSingleTypeReference:Str\n" +
- " infos:formal reference\n" +
- ">"
- );
-}
-public void test014() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @see String Subclass of Obj\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "Obj");
- assertCompletionNodeResult(source,
- "<CompletionOnJavadocSingleTypeReference:Obj\n" +
- " infos:text\n" +
- ">"
- );
-}
-
-public void test015() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@link String Subclass of Obj}\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "Obj");
- assertCompletionNodeResult(source,
- "<CompletionOnJavadocSingleTypeReference:Obj\n" +
- " infos:formal reference\n" +
- ">"
- );
-}
-
-/**
- * @test Bug 113469: CompletionOnJavadocTag token is not correct
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=113649"
- */
-public void test020() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @see\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@s");
- verifyCompletionOnJavadocTag("s".toCharArray(), new char[][] { TAG_SEE, TAG_SINCE/*, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD*/ }, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- assertEquals("Invalid tag start position", 24, completionTag.tagSourceStart);
- assertEquals("Invalid tag end position", 28, completionTag.tagSourceEnd+1);
-}
-
-public void test021() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @see\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@se");
- verifyCompletionOnJavadocTag("se".toCharArray(), new char[][] { TAG_SEE/*, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD */}, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- assertEquals("Invalid tag start position", 24, completionTag.tagSourceStart);
- assertEquals("Invalid tag end position", 28, completionTag.tagSourceEnd+1);
-}
-
-public void test022() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @see\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "@see");
- verifyCompletionOnJavadocTag("see".toCharArray(), new char[][] { TAG_SEE }, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- assertEquals("Invalid tag start position", 24, completionTag.tagSourceStart);
- assertEquals("Invalid tag end position", 28, completionTag.tagSourceEnd+1);
-}
-
-public void test023() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @ebj-tag\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "ebj");
- verifyCompletionOnJavadocTag("ebj".toCharArray(), null, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- assertEquals("Invalid tag start position", 24, completionTag.tagSourceStart);
- assertEquals("Invalid tag end position", 32, completionTag.tagSourceEnd+1);
-}
-
-public void test024() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * @ebj-tag\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "tag");
- verifyCompletionOnJavadocTag("ebj-tag".toCharArray(), null, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- assertEquals("Invalid tag start position", 24, completionTag.tagSourceStart);
- assertEquals("Invalid tag end position", 32, completionTag.tagSourceEnd+1);
-}
-
-/**
- * @test Bug 114091: [assist][javadoc] eternal loop
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=114091"
- */
-public void test025() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@</code>\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "{@");
- char[][] allTags = {
- TAG_LINK
- };
- verifyCompletionOnJavadocTag("".toCharArray(), allTags, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- int start = source.indexOf("{@");
- assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
- int end = source.indexOf('>');
- assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
-}
-
-public void test026() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@li</code>\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "{@li");
- char[][] allTags = complianceLevel.equals(COMPLIANCE_1_3)
- ? new char[][] { TAG_LINK }
- : (complianceLevel.equals(COMPLIANCE_1_4)
- ? new char[][] { TAG_LINK}
- : new char[][] { TAG_LINK });
- verifyCompletionOnJavadocTag("li".toCharArray(), allTags, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- int start = source.indexOf("{@");
- assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
- int end = source.indexOf('>');
- assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
-}
-
-public void test027() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@link</code>\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "{@link");
- char[][] allTags = complianceLevel.equals(COMPLIANCE_1_3)
- ? new char[][] { TAG_LINK }
- : new char[][] { TAG_LINK };
- verifyCompletionOnJavadocTag("link".toCharArray(), allTags, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- int start = source.indexOf("{@");
- assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
- int end = source.indexOf('>');
- assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
-}
-public void test028() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@|\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "{@");
- char[][] allTags = {
- TAG_LINK
- };
- verifyCompletionOnJavadocTag("".toCharArray(), allTags, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- int start = source.indexOf("{@");
- assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
- int end = source.indexOf('|');
- assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
-}
-
-public void test029() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@li/\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "{@li");
- char[][] allTags = complianceLevel.equals(COMPLIANCE_1_3)
- ? new char[][] { TAG_LINK }
- : (complianceLevel.equals(COMPLIANCE_1_4)
- ? new char[][] { TAG_LINK }
- : new char[][] { TAG_LINK });
- verifyCompletionOnJavadocTag("li".toCharArray(), allTags, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- int start = source.indexOf("{@");
- assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
- int end = source.indexOf("/\n");
- assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
-}
-
-public void test030() {
- String source = "package javadoc;\n" +
- "/**\n" +
- " * {@link+\n" +
- " */\n" +
- "public class Test {}\n";
- verifyCompletionInJavadoc(source, "{@link");
- char[][] allTags = complianceLevel.equals(COMPLIANCE_1_3)
- ? new char[][] { TAG_LINK }
- : new char[][] { TAG_LINK };
- verifyCompletionOnJavadocTag("link".toCharArray(), allTags, false);
- CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
- int start = source.indexOf("{@");
- assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
- int end = source.indexOf('+');
- assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/LabelStatementCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/LabelStatementCompletionTest.java
deleted file mode 100644
index 5745f15..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/LabelStatementCompletionTest.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be in a LabeledStatement.
- */
-public class LabelStatementCompletionTest extends AbstractCompletionTest {
-public LabelStatementCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(LabelStatementCompletionTest.class);
-}
-/*
- * Completion inside an inner class defined inside a labeled statement.
- */
-public void test1FTEO9L() {
- String cu =
- "package p; \n" +
- " \n" +
- "class CCHelper { \n" +
- " class Member1 { \n" +
- " } \n" +
- " class Member2 { \n" +
- " } \n" +
- " void foo() { \n" +
- " } \n" +
- "} \n" +
- " \n" +
- "public class CC { \n" +
- " void foo() { \n" +
- " new CCHelper() \n" +
- " .new CCHelper() \n" +
- " .new M \n" +
- " } \n" +
- "} \n";
- // first case
- this.runTestCheckMethodParse(
- // compilationUnit:
- cu,
- // completeBehind:
- " .n",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:new CCHelper().n>",
- // expectedUnitDisplayString:
- "package p;\n" +
- "class CCHelper {\n" +
- " class Member1 {\n" +
- " Member1() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " CCHelper() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class CC {\n" +
- " public CC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new CCHelper().n>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "n",
- // expectedReplacedSource:
- "new",
- // test name
- "<regression test 1FTEO9L (first case)>"
- );
- // second case
- this.runTestCheckMethodParse(
- // compilationUnit:
- cu,
- // completeBehind:
- " .new CC",
- // expectedCompletionNodeToString:
- "<CompleteOnType:CC>",
- // expectedUnitDisplayString:
- "package p;\n" +
- "class CCHelper {\n" +
- " class Member1 {\n" +
- " Member1() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " CCHelper() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class CC {\n" +
- " public CC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new CCHelper().new <CompleteOnType:CC>();\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "CC",
- // expectedReplacedSource:
- "CCHelper",
- // test name
- "<regression test 1FTEO9L (second case)>"
- );
- // third case
- this.runTestCheckMethodParse(
- // compilationUnit:
- cu,
- // completeBehind:
- " .new CCHelper() \n" +
- " .n",
- // expectedCompletionNodeToString:
- "<CompleteOnMemberAccess:new CCHelper().new CCHelper().n>",
- // expectedUnitDisplayString:
- "package p;\n" +
- "class CCHelper {\n" +
- " class Member1 {\n" +
- " Member1() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " CCHelper() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class CC {\n" +
- " public CC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new CCHelper().new CCHelper().n>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "n",
- // expectedReplacedSource:
- "new",
- // test name
- "<regression test 1FTEO9L (third case)>"
- );
- // fourth case
- this.runTestCheckMethodParse(
- // compilationUnit:
- cu,
- // completeBehind:
- " .new CCHelper() \n" +
- " .new M",
- // expectedCompletionNodeToString:
- "<CompleteOnType:M>",
- // expectedUnitDisplayString:
- "package p;\n" +
- "class CCHelper {\n" +
- " class Member1 {\n" +
- " Member1() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " CCHelper() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class CC {\n" +
- " public CC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new CCHelper().new CCHelper().new <CompleteOnType:M>();\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "M",
- // expectedReplacedSource:
- "M",
- // test name
- "<regression test 1FTEO9L (fourth case)>"
- );
-}
-/*
- * Completion inside a case that has an identifier as its constant expression.
- */
-public void testInCaseWithIdentifier() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " label1: { \n" +
- " switch (i) { \n" +
- " case a: label2: X o = new Object(); \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "X",
- // expectedLabels:
- new String[] {"label1", "label2"},
- // test name
- "<complete in case with identifier>"
- );
-}
-/*
- * Completion inside a case that has a number as its constant expression.
- */
-public void testInCaseWithNumberConstant() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " label1: { \n" +
- " switch (i) { \n" +
- " case 1: label2: X o = new Object(); \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "X",
- // expectedLabels:
- new String[] {"label1", "label2"},
- // test name
- "<complete in case with number>"
- );
-}
-/*
- * Completion inside an inner class defined inside a labeled statement.
- */
-public void testInLabeledInnerClass() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " label1: { \n" +
- " Object o = new Object() { \n" +
- " void fred() { \n" +
- " label2: { \n" +
- " X o = new Object(); \n" +
- " } \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Object o;\n" +
- " new Object() {\n" +
- " void fred() {\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "X",
- // expectedLabels:
- new String[] {"label2"},
- // test name
- "<complete in labeled inner class>"
- );
-}
-/*
- * Completion inside an inner class defined inside a labeled statement with a syntax error
- * just before the labeled statement.
- */
-public void testInLabeledInnerClassWithErrorBefore() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i == 2; \n" +
- " label1: { \n" +
- " Object o = new Object() { \n" +
- " void fred() { \n" +
- " label2: { \n" +
- " X o = new Object(); \n" +
- " } \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " Object o;\n" +
- " new Object() {\n" +
- " void fred() {\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "X",
- // expectedLabels:
- new String[] {"label2"},
- // test name
- "<complete in labeled inner class with syntax error before>"
- );
-}
-/*
- * Completion inside a labeled statement one level deep.
- */
-public void testOneLevelDeep() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " label1: X o = new Object(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "X",
- // expectedLabels:
- new String[] {"label1"},
- // test name
- "<complete in one level deep>"
- );
-}
-/*
- * Completion inside a labeled statement which is the second one in the method.
- */
-public void testSecondLabel() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " label1: buzz(); \n" +
- " label2: X o = new Object(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "X",
- // expectedLabels:
- new String[] {"label2"},
- // test name
- "<complete in second labeled statement>"
- );
-}
-/*
- * Completion inside a labeled statement two level deep.
- */
-public void testTwoLevelDeep() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " label1: { \n" +
- " label2: X o = new Object(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "X",
- // expectedLabels:
- new String[] {"label1", "label2"},
- // test name
- "<complete in two level deep>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java
deleted file mode 100644
index e96a683..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java
+++ /dev/null
@@ -1,863 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be a FunctionInvocation.
- */
-public class MethodInvocationCompletionTest extends AbstractCompletionTest {
-public MethodInvocationCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(MethodInvocationCompletionTest.class);
-}
-/*
- * Completion with no receiver inside a for statement.
- */
-public void test1FVVWS8_1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " for (int i = 10; i > 0; --i) \n" +
- " fred( \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnMessageSend:fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<1FVVWS8_1>"
- );
-}
-/*
- * Completion with no receiver inside an if statement.
- */
-public void test1FVVWS8_2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " if (true) \n" +
- " fred( \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<1FVVWS8_2>"
- );
-}
-/*
- * Completion with no receiver inside a for statement
- * and after a field access.
- */
-public void test1FW2ZTB_1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " int[] array; \n" +
- " void foo() { \n" +
- " for (int i = this.array.length; i > 0; --i) \n" +
- " fred( \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " int[] array;\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnMessageSend:fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<1FW2ZTB_1"
- );
-}
-/*
- * Completion with no receiver inside another message send
- * and after a field access in a previous argument.
- */
-public void test1FW2ZTB_2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " int[] array; \n" +
- " void foo() { \n" +
- " bar(this.array.length, 10, fred( \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " int[] array;\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<1FW2ZTB_2"
- );
-}
-/*
- * Complete on method invocation with expression receiver
- * inside another invocation with no receiver.
- */
-public void test1FW35YZ_1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " bar(primary().fred( \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:primary().fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:primary().fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<1FW35YZ_1>"
- );
-}
-/*
- * Complete on qualified allocation expression
- * inside an invocation with no receiver.
- */
-public void test1FW35YZ_2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " bar(primary().new X( \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X(",
- // expectedCompletionNodeToString:
- "<CompleteOnQualifiedAllocationExpression:primary().new X()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnQualifiedAllocationExpression:primary().new X()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<1FW35YZ_2>"
- );
-}
-/*
- * Completion with primary receiver.
- */
-public void test1FWYBKF() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " this.x.bar( \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "bar(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:this.x.bar()>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:this.x.bar()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "bar(",
- // test name
- "<1FWYBKF>"
- );
-}
-/*
- * Completion just after a parameter which is a message send.
- */
-public void test1GAJBUQ() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " x.y.Z.fred(buzz()); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(buzz()",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:x.y.Z.fred(buzz())>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:x.y.Z.fred(buzz())>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(buzz()",
- // test name
- "<1GAJBUQ>"
- );
-}
-/*
- * Completion just before the second parameter, the first parameter being an empty
- * anonymous class.
- */
-public void testAfterEmptyAnonymous() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred(new Runnable() {}, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(new Runnable() {}, ",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:this.fred(new Runnable() {\n})>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:this.fred(new Runnable() {\n" +
- "})>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(new Runnable() {}, ",
- // test name
- "<completion just before second parameter, the first parameter being an empty anonymous class>"
- );
-}
-/*
- * Completion just after the first parameter.
- */
-public void testAfterFirstParameter() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred(\"abc\" , 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(\"abc\" ",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:this.fred(\"abc\")>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:this.fred(\"abc\")>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(\"abc\" ",
- // test name
- "<completion just after first parameter>"
- );
-}
-/*
- * Completion just before the first parameter.
- */
-public void testBeforeFirstParameter() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred(1, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:this.fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:this.fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<completion just before first parameter>"
- );
-}
-/*
- * Completion just before the last parameter.
- */
-public void testBeforeLastParameter() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred(1, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:this.fred(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:this.fred(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(1, 2,",
- // test name
- "<completion just before last parameter>"
- );
-}
-/*
- * Completion just before the second parameter.
- */
-public void testBeforeSecondParameter() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred(1, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(1, ",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:this.fred(1)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:this.fred(1)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(1, ",
- // test name
- "<completion just before second parameter>"
- );
-}
-/*
- * Completion on empty name inside the expression of the first parameter.
- */
-public void testEmptyInFirstParameter() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred(\"abc\" + , 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(\"abc\" +",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (\"abc\" + <CompleteOnName:>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<completion empty in first parameter>"
- );
-}
-/*
- * Completion inside the expression of the first parameter.
- */
-public void testInFirstParameter() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred(\"abc\" + bizz, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(\"abc\" + bi",
- // expectedCompletionNodeToString:
- "<CompleteOnName:bi>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (\"abc\" + <CompleteOnName:bi>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "bi",
- // expectedReplacedSource:
- "bizz",
- // test name
- "<completion inside first parameter>"
- );
-}
-/*
- * Completion inside an if statement.
- */
-public void testInIfStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " if (true) { \n" +
- " bar.fred(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:bar.fred()>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnMessageSend:bar.fred()>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<completion inside a if statement>"
- );
-}
-/*
- * Completion in labeled method invocation with expression receiver.
- */
-public void testLabeledWithExpressionReceiver() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " label1: bar().fred(1, 2, o); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:bar().fred(1, 2)>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:bar().fred(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(1, 2,",
- // expectedLabels:
- new String[] {"label1"},
- // test name
- "<completion in labeled method invocation with expression receiver>"
- );
-}
-/*
- * Completion in labeled method invocation without receiver.
- */
-public void testLabeledWithoutReceiver() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " label1: fred(1, 2, o); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:fred(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:fred(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(1, 2,",
- // expectedLabels:
- new String[] {"label1"},
- // test name
- "<completion in labeled method invocation without receiver>"
- );
-}
-/*
- * FunctionInvocation ::= Name '(' ArgumentListopt ')'
- */
-public void testNoReceiver() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " fred(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<completion on method invocation with no receiver>"
- );
-}
-/*
- * Completion just before the first parameter with a space after the open parenthesis.
- */
-public void testSpaceThenFirstParameter() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " this.fred( 1, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred( ",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:this.fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:this.fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred( ",
- // test name
- "<completion just before first parameter with a space after open parenthesis>"
- );
-}
-/*
- * FunctionInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')'
- */
-public void testSuper() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " super.fred(1, 2, i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:super.fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:super.fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<completion on super method invocation>"
- );
-}
-/*
- * Complete on method invocation with expression receiver.
- */
-public void testWithExpressionReceiver() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " bar().fred(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:bar().fred()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:bar().fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // test name
- "<completion on method invocation with expression receiver>"
- );
-}
-/*
- * Completion with a name receiver.
- */
-public void testWithNameReceiver() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " Vector v = new Vector(); \n" +
- " v.addElement(\"1\"); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "addElement(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:v.addElement()>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Vector v;\n" +
- " <CompleteOnMessageSend:v.addElement()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "addElement(",
- // test name
- "<completion with name receiver>"
- );
-}
-/*
- * Completion with a name receiver after conditional expression.
- */
-public void testWithNameReceiverAfterConditionalExpression() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " buzz.test(cond ? max : min); \n" +
- " bar.fred(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred(",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:bar.fred()>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMessageSend:bar.fred()>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(",
- // expectedLabels:
- new String[] {},
- // test name
- "<completion with name receiver after conditional expression>"
- );
-}
-/*
- * Completion with a name receiver and 2 arguments.
- */
-public void testWithNameReceiverAndTwoArgs() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " X x = new X(); \n" +
- " x.fred(1, 2, o); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x.fred(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:x.fred(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X x;\n" +
- " <CompleteOnMessageSend:x.fred(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(1, 2,",
- // test name
- "<completion with name receiver and 2 arguments>"
- );
-}
-/*
- * Completion with a qualified name receiver.
- */
-public void testWithQualifiedNameReceiver() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " X x = new X(); \n" +
- " y.x.fred(1, 2, o); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x.fred(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnMessageSend:y.x.fred(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X x;\n" +
- " <CompleteOnMessageSend:y.x.fred(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "fred(1, 2,",
- // test name
- "<completion with qualified name receiver>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/NameReferenceCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/NameReferenceCompletionTest.java
deleted file mode 100644
index ffb632c..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/NameReferenceCompletionTest.java
+++ /dev/null
@@ -1,923 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be a name reference.
- */
-public class NameReferenceCompletionTest extends AbstractCompletionTest {
-public NameReferenceCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(NameReferenceCompletionTest.class);
-}
-/*
- * Regression test for 1FTZ849.
- * The instance creation before the completion is not properly closed, and thus
- * the completion parser used to think the completion was on a type.
- */
-public void test1FTZ849() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " X o = new X; \n" +
- " fred.xyz; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "fred.x",
- // expectedCompletionNodeToString:
- "<CompleteOnName:fred.x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X o;\n" +
- " <CompleteOnName:fred.x>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "fred.xyz",
- // test name
- "<1FTZ849>"
- );
-}
-/*
- * Completion in a field initializer with no syntax error.
- */
-public void test1FUUP73() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "public class A { \n" +
- " String s = \"hello\"; \n" +
- " Object o = s.concat(\"boo\"); \n",
- // completeBehind:
- "Object o = s",
- // expectedCompletionNodeToString:
- "<CompleteOnName:s>",
- // expectedUnitDisplayString:
- "public class A {\n" +
- " String s;\n" +
- " Object o = <CompleteOnName:s>;\n" +
- " public A() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "s",
- // expectedReplacedSource:
- "s",
- // test name
- "<1FUUP73>"
- );
- this.runTestCheckDietParse(
- // compilationUnit:
- "public class A { \n" +
- " String s = \"hello\"; \n" +
- " Object o = s.concat(\"boo\"); \n",
- // completeBehind:
- "Object o = s.c",
- // expectedCompletionNodeToString:
- "<CompleteOnName:s.c>",
- // expectedUnitDisplayString:
- "public class A {\n" +
- " String s;\n" +
- " Object o = <CompleteOnName:s.c>;\n" +
- " public A() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "c",
- // expectedReplacedSource:
- "s.concat",
- // test name
- "<1FUUP73>"
- );
-}
-/*
- * Regression test for 1FVRQQA.
- */
-public void test1FVRQQA_1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " Enumeration e = null; \n" +
- " e.to \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "e.to",
- // expectedCompletionNodeToString:
- "<CompleteOnName:e.to>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Enumeration e;\n" +
- " <CompleteOnName:e.to>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "to",
- // expectedReplacedSource:
- "e.to",
- // test name
- "<1FVRQQA_1>"
- );
-}
-/*
- * Regression test for 1FVRQQA.
- */
-public void test1FVRQQA_2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " for (Enumeration e = getSomeEnumeration(); e.has \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "e.has",
- // expectedCompletionNodeToString:
- "<CompleteOnName:e.has>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Enumeration e;\n" +
- " <CompleteOnName:e.has>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "has",
- // expectedReplacedSource:
- "e.has",
- // test name
- "<1FVRQQA_2>"
- );
-}
-/*
- * Regression test for 1FVT66Q.
- */
-public void test1FVT66Q_1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "package test; \n" +
- " \n" +
- "public class Test { \n" +
- " public void foo() { \n" +
- " final int codeAssistTarget= 3; \n" +
- " \n" +
- " Thread t= new Thread() { \n" +
- " public void run() { \n" +
- " codeAss \n" +
- " } \n" +
- " }; \n" +
- " codeA \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- " codeAss",
- // expectedCompletionNodeToString:
- "<CompleteOnName:codeAss>",
- // expectedUnitDisplayString:
- "package test;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " final int codeAssistTarget;\n" +
- " Thread t;\n" +
- " new Thread() {\n" +
- " public void run() {\n" +
- " <CompleteOnName:codeAss>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "codeAss",
- // expectedReplacedSource:
- "codeAss",
- // test name
- "<1FVT66Q_1>"
- );
-}
-/*
- * Regression test for 1FVT66Q.
- */
-public void test1FVT66Q_2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "package test; \n" +
- " \n" +
- "public class Test { \n" +
- " public void foo() { \n" +
- " final int codeAssistTarget= 3; \n" +
- " \n" +
- " Thread t= new Thread() { \n" +
- " public void run() { \n" +
- " codeAss \n" +
- " } \n" +
- " }; \n" +
- " codeA \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "\n codeA",
- // expectedCompletionNodeToString:
- "<CompleteOnName:codeA>",
- // expectedUnitDisplayString:
- "package test;\n" +
- "public class Test {\n" +
- " public Test() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " final int codeAssistTarget;\n" +
- " Thread t;\n" +
- " <CompleteOnName:codeA>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "codeA",
- // expectedReplacedSource:
- "codeA",
- // test name
- "<1FVT66Q_2>"
- );
-}
-/*
- * Regression test for 1G8DE30.
- */
-public void test1G8DE30() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new Runnable() { \n" +
- " public void run() { \n" +
- " Bar \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "public void run() { \n ",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Runnable() {\n" +
- " public void run() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<1G8DE30>"
- );
-}
-/*
- * Completion on an empty name reference.
- */
-public void testEmptyNameReference() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "int i = 0; \n ",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on empty name reference>"
- );
-}
-/*
- * Completion on an empty name reference after a cast.
- */
-public void testEmptyNameReferenceAfterCast() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " X x = (X) \n" +
- " \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "(X)",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X x = (X) <CompleteOnName:>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on empty name reference after cast>"
- );
-}
-/*
- * Completion on an empty name reference after + operator.
- */
-public void testEmptyNameReferenceAfterPlus() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " 1 + \n" +
- " \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "1 +",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on empty name reference after + operator>"
- );
-}
-/*
- * Completion on an empty name reference in an array dimension.
- */
-public void testEmptyNameReferenceInArrayDim() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " int[] \n" +
- " \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "int[",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on empty name reference in array dim>"
- );
-}
-/*
- * Completion on an empty name reference in inner class.
- */
-public void testEmptyNameReferenceInInnerClass() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " class Y { \n" +
- " void bar() { \n" +
- " \n" +
- " } \n" +
- " } \n" +
- " \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "\n ",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void bar() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on empty name reference in inner class>"
- );
-}
-/*
- * Completion in the statement following an if expression.
- */
-public void testInIfThenStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (bar()) \n" +
- " \n" +
- " \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "\n ",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete in if then statement>"
- );
-}
-/*
- * Completion on a name reference inside an inner class in a field initializer.
- */
-public void testInnerClassFieldInitializer() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " Object o = new Object() { \n" +
- " void foo() { \n" +
- " xyz \n" +
- " } \n" +
- " }; \n" +
- "} \n",
- // completeBehind:
- "xyz",
- // expectedCompletionNodeToString:
- "<CompleteOnName:xyz>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Object o = new Object() {\n" +
- " void foo() {\n" +
- " <CompleteOnName:xyz>;\n" +
- " }\n" +
- " };\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "xyz",
- // expectedReplacedSource:
- "xyz",
- // test name
- "<complete on name reference in inner class in field initializer>"
- );
-}
-/*
- * Completion on an empty name reference inside an invocation in a field initializer.
- */
-public void testInvocationFieldInitializer() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " String s = fred(1 + ); \n" +
- " void foo() { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "(1 + ",
- // expectedCompletionNodeToString:
- "<CompleteOnName:>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " String s = (1 + <CompleteOnName:>);\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on empty name reference in invocation in field initializer>"
- );
-}
-/*
- * Completion inside an anonymous inner class which is
- * inside a method invocation with receiver.
- */
-public void testMethodInvocationAnonymousInnerClass() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " primary().bizz( \n" +
- " new X() { \n" +
- " void fuzz() { \n" +
- " x.y.z \n" +
- " } \n" +
- " } \n" +
- " ); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x.",
- // expectedCompletionNodeToString:
- "<CompleteOnName:x.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new X() {\n" +
- " void fuzz() {\n" +
- " <CompleteOnName:x.>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "x.",
- // test name
- "<complete inside anonymous inner class inside method invocation 1>"
- );
-}
-/*
- * Completion on a qualified name reference, where the cursor is in the
- * first type reference.
- */
-public void testQualifiedNameReferenceShrinkAll() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " a.b.c.Xxx o = new Y(i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- " a",
- // expectedCompletionNodeToString:
- "<CompleteOnName:a>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnName:a>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "a",
- // expectedReplacedSource:
- "a",
- // test name
- "<complete on qualified name reference (shrink all)>"
- );
-}
-/*
- * Completion on a qualified name reference, where the cursor is right after the first dot.
- */
-public void testQualifiedNameReferenceShrinkAllButOne() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.x.x.super(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "Bar.",
- // expectedCompletionNodeToString:
- "<CompleteOnName:Bar.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " public InnerBar() {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " super();\n" +
- " <CompleteOnName:Bar.>;\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "Bar.",
- // test name
- "<complete on qualified name reference (shrink all but one)>"
- );
-}
-/*
- * Completion on a qualified name reference, where the cursor is right after the first dot.
- */
-public void testQualifiedNameReferenceShrinkAllButOne2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " a.b.c.X o = new Y(i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- " a.",
- // expectedCompletionNodeToString:
- "<CompleteOnName:a.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnName:a.>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "a.",
- // test name
- "<complete on qualified name reference (shrink all but one) 2>"
- );
-}
-/*
- * Completion on a qualified name reference,where the cursor is right after the end
- * of the last name reference.
- */
-public void testQualifiedNameReferenceShrinkNone() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.x.x.super(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "Bar.x.x",
- // expectedCompletionNodeToString:
- "<CompleteOnName:Bar.x.x>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " public InnerBar() {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " super();\n" +
- " <CompleteOnName:Bar.x.x>;\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "x",
- // expectedReplacedSource:
- "Bar.x.x",
- // test name
- "<complete on qualified name reference (shrink none)>"
- );
-}
-/*
- * Completion on a qualified name reference, where the cursor is right after the end
- * of the last type reference.
- */
-public void testQualifiedNameReferenceShrinkNone2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " a.b.c.Xxx o = new Y(i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:a.b.c.X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnName:a.b.c.X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "a.b.c.Xxx",
- // test name
- "<complete on qualified name reference (shrink none) 2>"
- );
-}
-/*
- * Completion on a qualified name reference, where the cursor is right after the
- * last dot.
- */
-public void testQualifiedNameReferenceShrinkOne() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " static Bar x; \n" +
- " public class InnerBar { \n" +
- " } \n" +
- " public class SubInnerBar extends InnerBar { \n" +
- " SubInnerBar() { \n" +
- " Bar.x.x.super(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "Bar.x.",
- // expectedCompletionNodeToString:
- "<CompleteOnName:Bar.x.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " public class InnerBar {\n" +
- " public InnerBar() {\n" +
- " }\n" +
- " }\n" +
- " public class SubInnerBar extends InnerBar {\n" +
- " SubInnerBar() {\n" +
- " super();\n" +
- " <CompleteOnName:Bar.x.>;\n" +
- " }\n" +
- " }\n" +
- " static Bar x;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "Bar.x.",
- // test name
- "<complete on qualified name reference (shrink one)>"
- );
-}
-/*
- * Completion on a qualified name reference, where the cursor is right after the
- * last dot.
- */
-public void testQualifiedNameReferenceShrinkOne2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " a.b.c.X o = new Y(i); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "a.b.c.",
- // expectedCompletionNodeToString:
- "<CompleteOnName:a.b.c.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnName:a.b.c.>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "a.b.c.",
- // test name
- "<complete on qualified name reference (shrink one) 2>"
- );
-}
-/*
- * Completion on a qualified name reference that contains a unicode.
- */
-public void testUnicode() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class X { \n" +
- " void foo() { \n" +
- " bar.\\u005ax \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x",
- // expectedCompletionNodeToString:
- "<CompleteOnName:bar.Zx>",
- // expectedUnitDisplayString:
- "class X {\n" +
- " X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:bar.Zx>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "Zx",
- // expectedReplacedSource:
- "bar.\\u005ax",
- // test name
- "<complete on unicode>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java
deleted file mode 100644
index 2d80c97..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java
+++ /dev/null
@@ -1,693 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class ParserTest extends AbstractRegressionTest {
-static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 18 };
-// TESTS_RANGE = new int[] { 11, -1 };
-}
-public ParserTest(String name) {
- super(name);
-}
-public void test001() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(){\n" +
- " throws\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " throws\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"throws\", delete this token\n" +
- "----------\n"
- );
-}
-public void test002() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(){\n" +
- " throws new\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " throws new\n" +
- " ^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n"
- );
-}
-public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(){\n" +
- " throws new X\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " throws new X\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"throws\", throw expected\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 2)\n" +
- " throws new X\n" +
- " ^\n" +
- "Syntax error, unexpected end of method\n" +
- "----------\n"
- );
-}
-//public void test004() {
-// this.runNegativeTest(
-// new String[] {
-// "X.js",
-// "public class X {\n" +
-// " {\n" +
-// " throws\n" +
-// " }\n" +
-// "}\n"
-// },
-// "----------\n" +
-// "1. ERROR in X.js (at line 3)\n" +
-// " throws\n" +
-// " ^^^^^^\n" +
-// "Syntax error on token \"throws\", delete this token\n" +
-// "----------\n"
-// );
-//}
-//public void test005() {
-// this.runNegativeTest(
-// new String[] {
-// "X.js",
-// "public class X {\n" +
-// " {\n" +
-// " throws new\n" +
-// " }\n" +
-// "}\n"
-// },
-// "----------\n" +
-// "1. ERROR in X.js (at line 3)\n" +
-// " throws new\n" +
-// " ^^^^^^^^^^\n" +
-// "Syntax error on tokens, delete these tokens\n" +
-// "----------\n"
-// );
-//}
-public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " {\n" +
- " throws new X\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 3)\n" +
- " throws new X\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"throws\", throw expected\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " throws new X\n" +
- " ^\n" +
- "Syntax error, unexpected end of initializer\n" +
- "----------\n"
- );
-}
-//public void test007() {
-// this.runNegativeTest(
-// new String[] {
-// "X.js",
-// "public class X {\n" +
-// " void foo()throw {\n" +
-// " }\n" +
-// "}\n"
-// },
-// "----------\n" +
-// "1. ERROR in X.js (at line 1)\n" +
-// " public class X {\n" +
-// " ^\n" +
-// "Syntax error, insert \"}\" to complete ClassBody\n" +
-// "----------\n" +
-// "2. ERROR in X.js (at line 2)\n" +
-// " void foo()throw {\n" +
-// " ^^^^^\n" +
-// "Syntax error on token \"throw\", { expected\n" +
-// "----------\n"
-// );
-//}
-//public void test008() {
-// this.runNegativeTest(
-// new String[] {
-// "X.js",
-// "public class X {\n" +
-// " void foo()throw E {\n" +
-// " }\n" +
-// "}\n"
-// },
-// "----------\n" +
-// "1. ERROR in X.js (at line 1)\n" +
-// " public class X {\n" +
-// " ^\n" +
-// "Syntax error, insert \"}\" to complete ClassBody\n" +
-// "----------\n" +
-// "2. ERROR in X.js (at line 2)\n" +
-// " void foo()throw E {\n" +
-// " ^^^^^\n" +
-// "Syntax error on token \"throw\", throws expected\n" +
-// "----------\n" +
-// "3. ERROR in X.js (at line 4)\n" +
-// " }\n" +
-// " ^\n" +
-// "Syntax error on token \"}\", delete this token\n" +
-// "----------\n"
-// );
-//}
-public void test009() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(){\n" +
- " throws e\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " throws e\n" +
- " ^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n"
- );
-}
-//public void test010() {
-// this.runNegativeTest(
-// new String[] {
-// "X.js",
-// "public class X {\n" +
-// " void foo(){\n" +
-// " throws e;\n" +
-// " }\n" +
-// "}\n"
-// },
-// "----------\n" +
-// "1. ERROR in X.js (at line 3)\n" +
-// " throws e;\n" +
-// " ^^^^^^\n" +
-// "Syntax error on token \"throws\", throw expected\n" +
-// "----------\n"
-// );
-//}
-//public void test011() {
-// this.runNegativeTest(
-// new String[] {
-// "X.js",
-// "public class X {\n" +
-// " public void foo(X, Object o, String s) {\n" +
-// " }\n" +
-// " public void bar(){}\n" +
-// "}\n"
-// },
-// "----------\n" +
-// "1. ERROR in X.js (at line 2)\n" +
-// " public void foo(X, Object o, String s) {\n" +
-// " ^\n" +
-// "Syntax error on token \",\", . expected\n" +
-// "----------\n"
-// );
-//}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40681
- */
-public void test012() {
- Hashtable nls = new Hashtable();
- nls.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo() {\n" +
- " \"foo\".equals(\"bar\");\n" +
- " ;\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " \"foo\".equals(\"bar\");\n" +
- " ^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 2)\n" +
- " \"foo\".equals(\"bar\");\n" +
- " ^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- nls // custom options
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40681
- */
-public void test013() {
- Hashtable nls = new Hashtable();
- nls.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo() {\n" +
- " \"foo\".equals(\"bar\");\n" +
- " //;\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " \"foo\".equals(\"bar\");\n" +
- " ^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 2)\n" +
- " \"foo\".equals(\"bar\");\n" +
- " ^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- nls // custom options
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47227
- */
-//public void test014() {
-// this.runNegativeTest(
-// new String[] {
-// "X.js",
-// "public class X {\n" +
-// " public void foo() { \n" +
-// " import java.lang.*;\n" +
-// " } \n" +
-// "}\n"
-// },
-// "----------\n" +
-// "1. ERROR in X.js (at line 3)\n" +
-// " import java.lang.*;\n" +
-// " ^^^^^^\n" +
-// "Syntax error on token \"import\", delete this token\n" +
-// "----------\n" +
-// "2. ERROR in X.js (at line 3)\n" +
-// " import java.lang.*;\n" +
-// " ^^^^^^^^^^^^^^^^^\n" +
-// "Syntax error on token(s), misplaced construct(s)\n" +
-// "----------\n"
-// );
-//}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60848
- */
-public void _test015() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo() {\n" +
- "// some code\n" +
- "}\n" +
- "/*\n" +
- "// some comments\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 4)\n" +
- " /*\n" +
- "// some comments\n" +
- "\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Unexpected end of comment\n" +
- "----------\n"
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60848
- */
-public void test016() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo() {\n" +
- " var s = \""
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = \"\n" +
- " ^\n" +
- "String literal is not properly closed by a double-quote\n" +
- "----------\n"
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60848
- */
-public void test017() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo() {\n" +
- " var c = '"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var c = \'\n" +
- " ^\n" +
- "Invalid character constant\n" +
- "----------\n"
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60848
- */
-public void test018() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo() {\n" +
- " var c = '\\u0"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var c = \'\\u0\n" +
- " ^^^\n" +
- "Invalid unicode\n" +
- "----------\n"
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=12287
- */
-public void test019() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function doit() {\n" +
- " var foo = null;\n" +
- " foo[0] = \n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 3)\n" +
- " foo[0] = \n" +
- " ^\n" +
- "Syntax error, insert \"AssignmentOperator Expression\" to complete Assignment\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " foo[0] = \n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete Statement\n" +
- "----------\n"
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=38895
- */
-public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main( args) {\n" +
- " }\n" +
- " function newLibraryEntry() {\n" +
-
- " if (sourceAttachmentPath != null) {\n" +
- " if (sourceAttachmentPath.isEmpty()) { && !\n" +
- "sourceAttachmentPath.isAbsolute()) {\n" +
- " foo();\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " function foo() {\n" +
- " }\n" +
- " function bar() {\n" +
- " }\n" +
- ""
- },
- "----------\n" +
- "1. ERROR in X.js (at line 5)\n" +
- " if (sourceAttachmentPath.isEmpty()) { && !\n" +
- " ^^\n" +
- "Syntax error on token \"&&\", invalid (\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 6)\n" +
- " sourceAttachmentPath.isAbsolute()) {\n" +
- " ^\n" +
- "Syntax error on token \"{\", invalid AssignmentOperator\n" +
- "----------\n"
- );
-}
-public void test021() {
- StringBuffer buffer = new StringBuffer();
-// buffer.append("public class X {\n");
- for (int i = 0; i < 1000; i++) {
- buffer.append("\tvar field_" + i + " = 0; \n");
- }
- for (int i = 0; i < 1000; i++) {
- if (i == 0)
- buffer.append("\tfunction method_" + i + "() { /* default */ } \n");
- else
- buffer.append("\tfunction method_" + i + "() { method_" + (i - 1) + "() \n");
- }
-// buffer.append("}\n");
-
- Hashtable options = new Hashtable();
- options.put(CompilerOptions.OPTION_MaxProblemPerUnit, "10");
- this.runNegativeTest(
- new String[] {
- "X.js",
- buffer.toString()
- },
- "----------\n" +
- "1. ERROR in X.js (at line 1002)\n" +
- " void method_1() { method_0() \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 1002)\n" +
- " void method_1() { method_0() \n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n" +
- "3. ERROR in X.js (at line 1003)\n" +
- " void method_2() { method_1() \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n" +
- "4. ERROR in X.js (at line 1003)\n" +
- " void method_2() { method_1() \n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n" +
- "5. ERROR in X.js (at line 1004)\n" +
- " void method_3() { method_2() \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n" +
- "6. ERROR in X.js (at line 1004)\n" +
- " void method_3() { method_2() \n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n" +
- "7. ERROR in X.js (at line 1005)\n" +
- " void method_4() { method_3() \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n" +
- "8. ERROR in X.js (at line 1005)\n" +
- " void method_4() { method_3() \n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n" +
- "9. ERROR in X.js (at line 1006)\n" +
- " void method_5() { method_4() \n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MethodBody\n" +
- "----------\n" +
- "10. ERROR in X.js (at line 2001)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- options // custom options
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=156119
- */
-public void test022() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- "interface X {\n" +
- " int f= 1;;\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " int f= 1;;\n" +
- " ^\n" +
- "Unnecessary semicolon\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- options // custom options
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=156119
- */
-public void test023() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- "class X {\n" +
- " int f= 1;;\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " int f= 1;;\n" +
- " ^\n" +
- "Unnecessary semicolon\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- options // custom options
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=156119
- */
-public void test024() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- "interface X {\n" +
- " int f= 1;\\u003B\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " int f= 1;\\u003B\n" +
- " ^^^^^^\n" +
- "Unnecessary semicolon\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- options // custom options
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=160337
- */
-public void test025() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n" +
- " static class Y {\n" +
- " public void foo(int i) {}\n" +
- " }\n" +
- " static Y FakeInvocationSite = new Y(){\n" +
- " public void foo(int i) {}\n" +
- " };\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 3)\n" +
- " public void foo(int i) {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 6)\n" +
- " public void foo(int i) {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- options // custom options
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=160337
- */
-public void test026() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n" +
- " static class Y {\n" +
- " public void foo(int i) {}\n" +
- " }\n" +
- " static Y FakeInvocationSite = new Y(){\n" +
- " public void foo(int i) {\n" +
- " class A {\n" +
- " A() {}\n" +
- " public void bar() {}\n" +
- " }\n" +
- " new A().bar();\n" +
- " }\n" +
- " };\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 3)\n" +
- " public void foo(int i) {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 8)\n" +
- " A() {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n" +
- "3. ERROR in X.js (at line 9)\n" +
- " public void bar() {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n",
- null, // custom classpath
- true, // flush previous output dir content
- options // custom options
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java
deleted file mode 100644
index bc4427a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java
+++ /dev/null
@@ -1,1553 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be a ReferenceType.
- */
-public class ReferenceTypeCompletionTest extends AbstractCompletionTest {
-public ReferenceTypeCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(ReferenceTypeCompletionTest.class);
-}
-/*
- * Regression test for 1FTZCIG.
- */
-public void test1FTZCIG() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new X() { \n" +
- " protected void bar() { \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "p",
- // expectedCompletionNodeToString:
- "<CompleteOnType:p>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new X() {\n" +
- " <CompleteOnType:p>;\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "p",
- // expectedReplacedSource:
- "protected",
- // test name
- "<1FTZCIG>"
- );
-}
-/*
- * Block ::= OpenBlock '{' <BlockStatementsopt> '}'
- */
-public void testBlock() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " try { \n" +
- " Xxx o = new Y(); \n" +
- " } catch (Exception e) { \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on block>"
- );
-}
-/*
- * BlockStatements ::= BlockStatements <BlockStatement>
- */
-public void testBlockStatements() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " Xxx o = new Y(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on block statements>"
- );
-}
-/*
- * CatchClause ::= 'catch' '(' <FormalParameter> ')' Block
- */
-public void testCatchClause1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " try { \n" +
- " fred(); \n" +
- " } catch (Xxx e) { \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnException:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " try \n" +
- " {\n" +
- " fred();\n" +
- " }\n" +
- " catch (<CompleteOnException:X> ) {\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on catch clause 1>"
- );
-}
-/*
- * CatchClause ::= 'catch' '(' <FormalParameter> ')' Block
- */
-public void testCatchClause2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " try { \n" +
- " fred(); \n" +
- " } catch (final Xxx e) { \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnException:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " try \n" +
- " {\n" +
- " fred();\n" +
- " }\n" +
- " catch (<CompleteOnException:X> ) {\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on catch clause 2>"
- );
-}
-/*
- * CatchClause ::= 'catch' '(' <FormalParameter> ')' Block
- */
-public void testCatchClause3() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " try { \n" +
- " fred(); \n" +
- " } catch (x.y.Xxx e) { \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "x.y.X",
- // expectedCompletionNodeToString:
- "<CompleteOnException:x.y.X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " try \n" +
- " {\n" +
- " fred();\n" +
- " }\n" +
- " catch (<CompleteOnException:x.y.X> ) {\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "x.y.Xxx",
- // test name
- "<complete on catch clause 3>"
- );
-}
-/*
- * ClassBody ::= '{' <ClassBodyDeclarationsopt> '}'
- */
-public void testClassBody() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " Xxx foo() { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " <CompleteOnType:X>\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class body>"
- );
-}
-/*
- * ClassBodyDeclarations ::= ClassBodyDeclarations <ClassBodyDeclaration>
- */
-public void testClassBodyDeclarations() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " int i = 0; \n" +
- " Xxx foo() { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " int i;\n" +
- " Bar() {\n" +
- " }\n" +
- " <CompleteOnType:X>\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class body declarations>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= 'new' <ClassType> '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpression1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new Xxx().zzz(); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new <CompleteOnType:X>();\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression 1>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= 'new' <ClassType> '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpression2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new Y(new Xxx()).zzz(); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Y(new <CompleteOnType:X>());\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression 2>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= 'new' <ClassType> '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpression3() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new Y(1, true, new Xxx()).zzz(); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Y(1, true, new <CompleteOnType:X>());\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression 3>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= 'new' <ClassType> '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpression4() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " fred().new Y(new Xxx()).zzz(); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " fred().new Y(new <CompleteOnType:X>());\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression 4>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionName1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " static Bar baz; \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " Bar.baz.new Xxx(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Bar.baz.new <CompleteOnType:X>();\n" +
- " }\n" +
- " }\n" +
- " static Bar baz;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with name 1>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionName2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " static Bar baz; \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " new Y(Bar.baz.new Xxx()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Y(Bar.baz.new <CompleteOnType:X>());\n" +
- " }\n" +
- " }\n" +
- " static Bar baz;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with name 2>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionName3() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " static Bar baz; \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " new Y(1, true, Bar.baz.new Xxx()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Y(1, true, Bar.baz.new <CompleteOnType:X>());\n" +
- " }\n" +
- " }\n" +
- " static Bar baz;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with name 3>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionName4() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " static Bar baz; \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " fred().new Y(Bar.baz.new Xxx()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " fred().new Y(Bar.baz.new <CompleteOnType:X>());\n" +
- " }\n" +
- " }\n" +
- " static Bar baz;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with name 4>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionPrimary1() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " new Bar().new Xxx(); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Bar().new <CompleteOnType:X>();\n" +
- " }\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with primary 1>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionPrimary2() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " new Y(new Bar().new Xxx()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Y(new Bar().new <CompleteOnType:X>());\n" +
- " }\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with primary 2>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionPrimary3() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " fred().new Y(new Bar().new Xxx()); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " fred().new Y(new Bar().new <CompleteOnType:X>());\n" +
- " }\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with primary 3>"
- );
-}
-/*
- * ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testClassInstanceCreationExpressionPrimary4() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "public class Bar { \n" +
- " public class X { \n" +
- " void foo() { \n" +
- " new Y(1, true, new Bar().new Xxx());\n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "new X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "public class Bar {\n" +
- " public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new Y(1, true, new Bar().new <CompleteOnType:X>());\n" +
- " }\n" +
- " }\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class instance creation expression with primary 4>"
- );
-}
-/*
- * ClassTypeList ::= ClassTypeList ',' <ClassTypeElt>
- */
-public void testClassTypeList() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() throws Exception, Xxx { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnException:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() throws Exception, <CompleteOnException:X> {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on class type list>"
- );
-}
-/*
- * ConstructorBody ::= NestedMethod '{' <BlockStatementsopt> '}'
- */
-public void testConstructorBody() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar() { \n" +
- " Xxx o = new Y(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " super();\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on constructor body>"
- );
-}
-/*
- * ConstructorDeclarator ::= 'Identifier' '(' <FormalParameterListopt> ')'
- */
-public void testConstructorDeclarator() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " Bar(Xxx o) { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar(<CompleteOnType:X> o) {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on constructor declarator>"
- );
-}
-/*
- * The reference type is burried in several blocks
- */
-public void testDeepReference() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (a == 2) { \n" +
- " } \n" +
- " try { \n" +
- " } finally { \n" +
- " if (1 == fgh) { \n" +
- " Xxx o = null; \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on deep type>"
- );
-}
-/*
- * Super ::= 'extends' <ClassType>
- */
-public void testExtendsClass() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar extends Xxx { \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnClass:X>",
- // expectedUnitDisplayString:
- "class Bar extends <CompleteOnClass:X> {\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on extends>"
- );
-}
-/*
- * ExtendsInterfaces ::= 'extends' <InterfaceTypeList>
- */
-public void testExtendsInterface() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "interface Bar extends Xxx { \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnInterface:X>",
- // expectedUnitDisplayString:
- "interface Bar extends <CompleteOnInterface:X> {\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on extends>"
- );
-}
-/*
- * FieldDeclaration ::= Modifiersopt <Type> VariableDeclarators ';'
- * where Modifiersopt is not empty
- */
-public void testFieldDeclarationWithModifiers() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " public final Xxx foo; \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>;",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " <CompleteOnType:X>;\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on field declaration with modifiers>"
- );
-}
-/*
- * FieldDeclaration ::= Modifiersopt <Type> VariableDeclarators ';'
- * where Modifiersopt is empty
- */
-public void testFieldDeclarationWithoutModifiers() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " Xxx foo; \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>;",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " <CompleteOnType:X>;\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on field declaration without modifiers>"
- );
-}
-/*
- * FormalParameter ::= Modifiers <Type> VariableDeclaratorId
- */
-public void testFormalParameter() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo(final Xxx x) { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo(final <CompleteOnType:X> x) {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on formal parameter>"
- );
-}
-/*
- * FormalParameterList ::= FormalParameterList ',' <FormalParameter>
- */
-public void testFormalParameterList() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo(int i, final Object o, Xxx x) {\n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo(int i, final Object o, <CompleteOnType:X> x) {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on formal parameter list>"
- );
-}
-/*
- * ForStatement ::= 'for' '(' <ForInitopt> ';' Expressionopt ';' ForUpdateopt ')' Statement
- * or
- * ForStatementNoShortIf ::= 'for' '(' <ForInitopt> ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf
- */
-public void testForStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " for (Xxx o = new Y(); o.size() < 10; ) {\n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on for statement>"
- );
-}
-/*
- * Interfaces ::= 'implements' <InterfaceTypeList>
- */
-public void testImplements() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar implements Xxx { \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnInterface:X>",
- // expectedUnitDisplayString:
- "class Bar implements <CompleteOnInterface:X> {\n" +
- " Bar() {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on implements>"
- );
-}
-/*
- * RelationalExpression ::= RelationalExpression 'instanceof' <ReferenceType>
- */
-public void testInstanceOf() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " boolean foo() { \n" +
- " return this instanceof Xxx; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " boolean foo() {\n" +
- " (this instanceof <CompleteOnType:X>);\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on instanceof>"
- );
-}
-/*
- * InterfaceBody ::= '{' <InterfaceMemberDeclarationsopt> '}'
- */
-public void testInterfaceBody() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "interface Bar { \n" +
- " Xxx foo(); \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "interface Bar {\n" +
- " <CompleteOnType:X>\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on interface body>"
- );
-}
-/*
- * InterfaceMemberDeclarations ::= InterfaceMemberDeclarations <InterfaceMemberDeclaration>
- */
-public void testInterfaceMemberDeclarations() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "interface Bar { \n" +
- " int CONSTANT = 0; \n" +
- " Xxx foo(); \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "interface Bar {\n" +
- " int CONSTANT;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " <CompleteOnType:X>\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on interface member declarations>"
- );
-}
-/*
- * InterfaceTypeList ::= InterfaceTypeList ',' <InterfaceType>
- */
-public void testInterfaceTypeList() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "interface Bar extends Comparable, Xxx { \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnInterface:X>",
- // expectedUnitDisplayString:
- "interface Bar extends Comparable, <CompleteOnInterface:X> {\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on interface list>"
- );
-}
-/*
- * LocalVariableDeclaration ::= Modifiers <Type> VariableDeclarators
- */
-public void testLocalVariableDeclaration() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " final Xxx o = new Y(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on local variable declaration>"
- );
-}
-/*
- * MethodBody ::= NestedMethod '{' <BlockStatementsopt> '}'
- */
-public void testMethodBody() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " Xxx o = new Y(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on method body>"
- );
-}
-/*
- * MethodDeclarator ::= 'Identifier' '(' <FormalParameterListopt> ')' Dimsopt
- */
-public void testMethodDeclarator() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo(Xxx o) { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo(<CompleteOnType:X> o) {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on method declarator>"
- );
-}
-/*
- * MethodHeader ::= Modifiersopt <Type> MethodDeclarator Throwsopt
- * where Modifiersopt is not empty
- */
-public void testMethodHeaderWithModifiers() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " public static Xxx foo() { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " <CompleteOnType:X>\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on method header with modifiers>"
- );
-}
-/*
- * MethodHeader ::= Modifiersopt <Type> MethodDeclarator Throwsopt
- * where Modifiersopt is empty
- */
-public void testMethodHeaderWithoutModifiers() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " Xxx foo() { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " <CompleteOnType:X>\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on method header without modifiers>"
- );
-}
-/*
- * Completion on a qualified type reference, where the cursor is in the
- * first type reference.
- */
-public void testQualifiedTypeReferenceShrinkAll() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " new a.b.c.Xxx(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- " new a",
- // expectedCompletionNodeToString:
- "<CompleteOnType:a>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " new <CompleteOnType:a>();\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "a",
- // expectedReplacedSource:
- "a",
- // test name
- "<complete on qualified type reference (shrink all)>"
- );
-}
-/*
- * Completion on a qualified type reference, where the cursor is right after the first dot.
- */
-public void testQualifiedTypeReferenceShrinkAllButOne() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " new a.b.c.Xxx(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "a.",
- // expectedCompletionNodeToString:
- "<CompleteOnType:a.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " new <CompleteOnType:a.>();\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "a.",
- // test name
- "<complete on qualified type reference (shrink all but one)>"
- );
-}
-/*
- * Completion on a qualified type reference, where the cursor is right after the end
- * of the last type reference.
- */
-public void testQualifiedTypeReferenceShrinkNone() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " new a.b.c.Xxx(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnType:a.b.c.X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " new <CompleteOnType:a.b.c.X>();\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "a.b.c.Xxx",
- // test name
- "<complete on qualified type reference (shrink none)>"
- );
-}
-/*
- * Completion on a qualified type reference, where the cursor is right after the
- * last dot.
- */
-public void testQualifiedTypeReferenceShrinkOne() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 0; \n" +
- " new a.b.c.Xxx(); \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "a.b.c.",
- // expectedCompletionNodeToString:
- "<CompleteOnType:a.b.c.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " new <CompleteOnType:a.b.c.>();\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "a.b.c.",
- // test name
- "<complete on qualified type reference (shrink one)>"
- );
-}
-/*
- * SwitchBlockStatement ::= SwitchLabels <BlockStatements>
- */
-public void testSwitchBlockStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int i = 1; \n" +
- " switch (i) { \n" +
- " case 1: \n" +
- " Xxx o = fred(i); \n" +
- " break; \n" +
- " default: \n" +
- " } \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnName:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int i;\n" +
- " {\n" +
- " <CompleteOnName:X>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on switch block statement>"
- );
-}
-/*
- * Throws ::= 'throws' <ClassTypeList>
- */
-public void testThrows() {
- this.runTestCheckDietParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() throws Xxx { \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "X",
- // expectedCompletionNodeToString:
- "<CompleteOnException:X>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() throws <CompleteOnException:X> {\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "X",
- // expectedReplacedSource:
- "Xxx",
- // test name
- "<complete on throws>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/RunCompletionParserTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/RunCompletionParserTests.java
deleted file mode 100644
index 0c7d6d9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/RunCompletionParserTests.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class RunCompletionParserTests extends junit.framework.TestCase {
-
- public final static List TEST_CLASSES = new ArrayList();
- public final static List TEST_CLASSES_1_5 = new ArrayList();
- static {
- TEST_CLASSES.add(AllocationExpressionCompletionTest.class);
- TEST_CLASSES.add(CompletionParserTest.class);
- TEST_CLASSES.add(CompletionParserTest2.class);
- TEST_CLASSES.add(CompletionParserTestKeyword.class);
- TEST_CLASSES.add(CompletionRecoveryTest.class);
- TEST_CLASSES.add(FieldAccessCompletionTest.class);
- TEST_CLASSES.add(JavadocCompletionParserTest.class);
- TEST_CLASSES.add(LabelStatementCompletionTest.class);
- TEST_CLASSES.add(MethodInvocationCompletionTest.class);
- TEST_CLASSES.add(NameReferenceCompletionTest.class);
-
- }
-
- public RunCompletionParserTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- ArrayList testClasses = new ArrayList();
-
- testClasses.addAll(RunCompletionParserTests.TEST_CLASSES);
-
- TestSuite all = new TestSuite(TestAll.class.getName());
- int possibleComplianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_3) != 0) {
- ArrayList tests_1_3 = (ArrayList)testClasses.clone();
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_3, tests_1_3));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- ArrayList tests_1_4 = (ArrayList)testClasses.clone();
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_4, tests_1_4));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- ArrayList tests_1_5 = (ArrayList)testClasses.clone();
- tests_1_5.addAll(TEST_CLASSES_1_5);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_5, tests_1_5));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_6) != 0) {
- ArrayList tests_1_6 = (ArrayList)testClasses.clone();
- tests_1_6.addAll(TEST_CLASSES_1_5);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_6, tests_1_6));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_7) != 0) {
- ArrayList tests_1_7 = (ArrayList)testClasses.clone();
- tests_1_7.addAll(TEST_CLASSES_1_5);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_7, tests_1_7));
- }
-
-
- return all;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionJavadocTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionJavadocTest.java
deleted file mode 100644
index 3bc19ba..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionJavadocTest.java
+++ /dev/null
@@ -1,865 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Locale;
-
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.codeassist.select.SelectionJavadoc;
-import org.eclipse.wst.jsdt.internal.codeassist.select.SelectionParser;
-import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ConstructorDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-import junit.framework.Test;
-
-/**
- * Class to test selection in Javadoc comments.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=54968"
- */
-public class SelectionJavadocTest extends AbstractSelectionTest {
-
- String source;
- StringBuffer result;
- ICompilationUnit unit;
-
- public SelectionJavadocTest(String testName) {
- super(testName);
- }
-
- static {
-// TESTS_NUMBERS = new int[] { 9, 10 };
-// TESTS_RANGE = new int[] { 26, -1 };
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(SelectionJavadocTest.class);
- }
-
- class SelectionVisitor extends ASTVisitor {
-
- public boolean visit(ConstructorDeclaration constructor, ClassScope scope) {
- if (constructor.javadoc != null) {
- assertTrue("Invalid type for Javadoc on " + constructor, constructor.javadoc instanceof SelectionJavadoc);
- SelectionJavadocTest.this.result.append(constructor.javadoc.toString());
- }
- return super.visit(constructor, scope);
- }
-
- public boolean visit(FieldDeclaration field, MethodScope scope) {
- if (field.javadoc != null) {
- assertTrue("Invalid type for Javadoc on " + field, field.javadoc instanceof SelectionJavadoc);
- SelectionJavadocTest.this.result.append(field.javadoc.toString());
- }
- return super.visit(field, scope);
- }
-
- public boolean visit(MethodDeclaration method, Scope scope) {
- if (method.javadoc != null) {
- assertTrue("Invalid type for Javadoc on " + method, method.javadoc instanceof SelectionJavadoc);
- SelectionJavadocTest.this.result.append(method.javadoc.toString());
- }
- return super.visit(method, scope);
- }
-
- public boolean visit(TypeDeclaration type, BlockScope scope) {
- if (type.javadoc != null) {
- assertTrue("Invalid type for Javadoc on " + type, type.javadoc instanceof SelectionJavadoc);
- SelectionJavadocTest.this.result.append(type.javadoc.toString());
- }
- return super.visit(type, scope);
- }
-
- public boolean visit(TypeDeclaration type, ClassScope scope) {
- if (type.javadoc != null) {
- assertTrue("Invalid type for Javadoc on " + type, type.javadoc instanceof SelectionJavadoc);
- SelectionJavadocTest.this.result.append(type.javadoc.toString());
- }
- return super.visit(type, scope);
- }
-
- public boolean visit(TypeDeclaration type, CompilationUnitScope scope) {
- if (type.javadoc != null) {
- assertTrue("Invalid type for Javadoc on " + type, type.javadoc instanceof SelectionJavadoc);
- SelectionJavadocTest.this.result.append(type.javadoc.toString());
- }
- return super.visit(type, scope);
- }
- }
-
- protected void assertValid(String expected) {
- String actual = this.result.toString();
- if (!actual.equals(expected)) {
- System.out.println("Expected result for test "+testName()+":");
- System.out.println(Util.displayString(actual, 3));
- System.out.println(" source: [");
- System.out.print(Util.indentString(this.source, 2));
- System.out.println("]\n");
- assertEquals("Invalid selection node", expected, actual);
- }
- }
- protected void setUp() throws Exception {
- super.setUp();
- this.unit = null;
- }
-
- void setUnit(String name, String source) {
- this.source = source;
- this.unit = new CompilationUnit(source.toCharArray(), name, null);
- this.result = new StringBuffer();
- }
-
- /*
- * Parse a method with selectionNode check
- */
- protected void findJavadoc(String selection) {
- findJavadoc(selection, 1);
- }
-
- protected void findJavadoc(String selection, int occurences) {
-
- // Verify unit
- assertNotNull("Missing compilation unit!", this.unit);
-
- // Get selection start and end
- int selectionStart = source.indexOf(selection);
- int length = selection.length();
- int selectionEnd = selectionStart + length - 1;
- for (int i = 1; i < occurences; i++) {
- selectionStart = source.indexOf(selection, selectionEnd);
- selectionEnd = selectionStart + length - 1;
- }
-
- // Parse unit
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- SelectionParser parser = new SelectionParser(new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- options,
- new DefaultProblemFactory(Locale.getDefault())));
- CompilationUnitDeclaration unitDecl = parser.dietParse(this.unit, new CompilationResult(this.unit, 0, 0, 0), selectionStart, selectionEnd);
- parser.getMethodBodies(unitDecl);
-
- // Visit compilation unit declaration to find javadoc
- unitDecl.traverse(new SelectionVisitor(), unitDecl.scope);
- }
-
- public void test01() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /** @see #foo() */\n" +
- " void bar() {\n" +
- " foo();\n" +
- " }\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("foo");
- assertValid("/**<SelectOnMethod:#foo()>*/\n");
- }
-
- public void test02() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /** {@link #foo() foo} */\n" +
- " void bar() {\n" +
- " foo();\n" +
- " }\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("foo");
- assertValid("/**<SelectOnMethod:#foo()>*/\n");
- }
-
- public void test03() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /** @see Test */\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("Test", 2);
- assertValid("/**<SelectOnType:Test>*/\n");
- }
-
- public void test04() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /** Javadoc {@link Test} */\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("Test", 2);
- assertValid("/**<SelectOnType:Test>*/\n");
- }
-
- public void test05() {
- setUnit("Test.java",
- "public class Test {\n" +
- " int field;\n" +
- " /** @see #field */\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("field", 2);
- assertValid("/**<SelectOnField:#field>*/\n");
- }
-
- public void test06() {
- setUnit("Test.java",
- "public class Test {\n" +
- " int field;\n" +
- " /**{@link #field}*/\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("field", 2);
- assertValid("/**<SelectOnField:#field>*/\n");
- }
-
- public void test07() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /**\n" +
- " * @see Test#field\n" +
- " * @see #foo(int, String)\n" +
- " * @see Test#foo(int, String)\n" +
- " */\n" +
- " void bar() {\n" +
- " foo(0, \"\");\n" +
- " }\n" +
- " int field;\n" +
- " void foo(int x, String s) {}\n" +
- "}\n"
- );
- findJavadoc("foo");
- findJavadoc("String");
- findJavadoc("Test", 2);
- findJavadoc("foo", 2);
- findJavadoc("String", 2);
- findJavadoc("Test", 3);
- findJavadoc("field");
- assertValid(
- "/**<SelectOnMethod:#foo(int , String )>*/\n" +
- "/**<SelectOnType:String>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnMethod:Test#foo(int , String )>*/\n" +
- "/**<SelectOnType:String>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnField:Test#field>*/\n"
- );
- }
-
- public void test08() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /**\n" +
- " * First {@link #foo(int, String)}\n" +
- " * Second {@link Test#foo(int, String) method foo}\n" +
- " * Third {@link Test#field field}\n" +
- " */\n" +
- " void bar() {\n" +
- " foo(0, \"\");\n" +
- " }\n" +
- " int field;\n" +
- " void foo(int x, String s) {}\n" +
- "}\n"
- );
- findJavadoc("foo");
- findJavadoc("String");
- findJavadoc("Test", 2);
- findJavadoc("foo", 2);
- findJavadoc("String", 2);
- findJavadoc("Test", 3);
- findJavadoc("field");
- assertValid(
- "/**<SelectOnMethod:#foo(int , String )>*/\n" +
- "/**<SelectOnType:String>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnMethod:Test#foo(int , String )>*/\n" +
- "/**<SelectOnType:String>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnField:Test#field>*/\n"
- );
- }
-
- public void test09() {
- setUnit("test/junit/Test.java",
- "package test.junit;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see test.junit.Test\n" +
- " * @see test.junit.Test#field\n" +
- " * @see test.junit.Test#foo(Object[] array)\n" +
- " */\n" +
- " void bar() {\n" +
- " foo(null);\n" +
- " }\n" +
- " int field;\n" +
- " void foo(Object[] array) {}\n" +
- "}\n"
- );
- findJavadoc("test", 2);
- findJavadoc("junit", 2);
- findJavadoc("Test", 2);
- findJavadoc("test", 3);
- findJavadoc("junit", 3);
- findJavadoc("Test", 3);
- findJavadoc("field");
- findJavadoc("test", 4);
- findJavadoc("junit", 4);
- findJavadoc("Test", 4);
- findJavadoc("foo");
- findJavadoc("Object");
- findJavadoc("array");
- assertValid(
- "/**<SelectOnType:test>*/\n" +
- "/**<SelectOnType:test.junit>*/\n" +
- "/**<SelectOnType:test.junit.Test>*/\n" +
- "/**<SelectOnType:test>*/\n" +
- "/**<SelectOnType:test.junit>*/\n" +
- "/**<SelectOnType:test.junit.Test>*/\n" +
- "/**<SelectOnField:test.junit.Test#field>*/\n" +
- "/**<SelectOnType:test>*/\n" +
- "/**<SelectOnType:test.junit>*/\n" +
- "/**<SelectOnType:test.junit.Test>*/\n" +
- "/**<SelectOnMethod:test.junit.Test#foo(Object[] array)>*/\n" +
- "/**<SelectOnType:Object>*/\n" +
- "/**\n" +
- " */\n"
- );
- }
-
- public void test10() {
- setUnit("test/junit/Test.java",
- "package test.junit;\n" +
- "public class Test {\n" +
- " /** Javadoc {@linkplain test.junit.Test}\n" +
- " * {@linkplain test.junit.Test#field field}\n" +
- " * last line {@linkplain test.junit.Test#foo(Object[] array) foo(Object[])}\n" +
- " */\n" +
- " void bar() {\n" +
- " foo(null);\n" +
- " }\n" +
- " int field;\n" +
- " void foo(Object[] array) {}\n" +
- "}\n"
- );
- findJavadoc("test", 2);
- findJavadoc("junit", 2);
- findJavadoc("Test", 2);
- findJavadoc("test", 3);
- findJavadoc("junit", 3);
- findJavadoc("Test", 3);
- findJavadoc("field");
- findJavadoc("test", 4);
- findJavadoc("junit", 4);
- findJavadoc("Test", 4);
- findJavadoc("foo");
- findJavadoc("Object");
- findJavadoc("array");
- assertValid(
- "/**<SelectOnType:test>*/\n" +
- "/**<SelectOnType:test.junit>*/\n" +
- "/**<SelectOnType:test.junit.Test>*/\n" +
- "/**<SelectOnType:test>*/\n" +
- "/**<SelectOnType:test.junit>*/\n" +
- "/**<SelectOnType:test.junit.Test>*/\n" +
- "/**<SelectOnField:test.junit.Test#field>*/\n" +
- "/**<SelectOnType:test>*/\n" +
- "/**<SelectOnType:test.junit>*/\n" +
- "/**<SelectOnType:test.junit.Test>*/\n" +
- "/**<SelectOnMethod:test.junit.Test#foo(Object[] array)>*/\n" +
- "/**<SelectOnType:Object>*/\n" +
- "/**\n" +
- " */\n"
- );
- }
-
- public void test11() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /**\n" +
- " * @throws RuntimeException runtime exception\n" +
- " * @throws InterruptedException interrupted exception\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("RuntimeException");
- findJavadoc("InterruptedException");
- assertValid(
- "/**<SelectOnType:RuntimeException>*/\n" +
- "/**<SelectOnType:InterruptedException>*/\n"
- );
- }
-
- public void test12() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /**\n" +
- " * @exception RuntimeException runtime exception\n" +
- " * @exception InterruptedException interrupted exception\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- );
- findJavadoc("RuntimeException");
- findJavadoc("InterruptedException");
- assertValid(
- "/**<SelectOnType:RuntimeException>*/\n" +
- "/**<SelectOnType:InterruptedException>*/\n"
- );
- }
-
- public void test13() {
- setUnit("Test.java",
- "public class Test {\n" +
- " /**\n" +
- " * @param xxx integer param\n" +
- " * @param str string param\n" +
- " */\n" +
- " void foo(int xxx, String str) {}\n" +
- "}\n"
- );
- findJavadoc("xxx");
- findJavadoc("str");
- assertValid(
- "/**<SelectOnLocalVariable:xxx>*/\n" +
- "/**<SelectOnLocalVariable:str>*/\n"
- );
- }
-
- public void test14() {
- setUnit("Test.java",
- "/**\n" +
- " * Javadoc of {@link Test}\n" +
- " * @see Field#foo\n" +
- " */\n" +
- "public class Test {}\n" +
- "/**\n" +
- " * Javadoc on {@link Field} to test selection in javadoc field references\n" +
- " * @see #foo\n" +
- " */\n" +
- "class Field {\n" +
- " /**\n" +
- " * Javadoc on {@link #foo} to test selection in javadoc field references\n" +
- " * @see #foo\n" +
- " * @see Field#foo\n" +
- " */\n" +
- " int foo;\n" +
- "}\n"
- );
- findJavadoc("Field");
- findJavadoc("foo");
- findJavadoc("Field", 2);
- findJavadoc("foo", 2);
- findJavadoc("foo", 3);
- findJavadoc("foo", 4);
- findJavadoc("Field", 4);
- findJavadoc("foo", 5);
- assertValid(
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n" +
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:#foo>*/\n" +
- "/**<SelectOnField:#foo>*/\n" +
- "/**<SelectOnField:#foo>*/\n" +
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n"
- );
- }
-
- public void test15() {
- setUnit("Test.java",
- "/**\n" +
- " * Javadoc of {@link Test}\n" +
- " * @see Method#foo(int, String)\n" +
- " */\n" +
- "public class Test {}\n" +
- "/**\n" +
- " * Javadoc on {@link Method} to test selection in javadoc method references\n" +
- " * @see #foo(int, String)\n" +
- " */\n" +
- "class Method {\n" +
- " /**\n" +
- " * Javadoc on {@link #foo(int,String)} to test selection in javadoc method references\n" +
- " * @see #foo(int, String)\n" +
- " * @see Method#foo(int, String)\n" +
- " */\n" +
- " void bar() {}\n" +
- " /**\n" +
- " * Method with parameter and throws clause to test selection in javadoc\n" +
- " * @param xxx TODO\n" +
- " * @param str TODO\n" +
- " * @throws RuntimeException blabla\n" +
- " * @throws InterruptedException bloblo\n" +
- " */\n" +
- " void foo(int xxx, String str) throws RuntimeException, InterruptedException {}\n" +
- "}\n"
- );
- findJavadoc("Method");
- findJavadoc("foo");
- findJavadoc("Method", 2);
- findJavadoc("foo", 2);
- findJavadoc("foo", 3);
- findJavadoc("foo", 4);
- findJavadoc("Method", 4);
- findJavadoc("foo", 5);
- findJavadoc("xxx");
- findJavadoc("str");
- findJavadoc("RuntimeException");
- findJavadoc("InterruptedException");
- assertValid(
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo(int , String )>*/\n" +
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:#foo(int , String )>*/\n" +
- "/**<SelectOnMethod:#foo(int , String )>*/\n" +
- "/**<SelectOnMethod:#foo(int , String )>*/\n" +
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo(int , String )>*/\n" +
- "/**<SelectOnLocalVariable:xxx>*/\n" +
- "/**<SelectOnLocalVariable:str>*/\n" +
- "/**<SelectOnType:RuntimeException>*/\n" +
- "/**<SelectOnType:InterruptedException>*/\n"
- );
- }
-
- public void test16() {
- setUnit("Test.java",
- "/**\n" +
- " * Javadoc of {@link Test}\n" +
- " * @see Other\n" +
- " */\n" +
- "public class Test {}\n" +
- "/**\n" +
- " * Javadoc of {@link Other}\n" +
- " * @see Test\n" +
- " */\n" +
- "class Other {}\n"
- );
- findJavadoc("Test");
- findJavadoc("Other");
- findJavadoc("Test", 3);
- findJavadoc("Other", 2);
- assertValid(
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Other>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Other>*/\n"
- );
- }
-
- public void test17() {
- setUnit("Test.java",
- "/**\n" +
- " * @see Test.Field#foo\n" +
- " */\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Field#foo\n" +
- " */\n" +
- " class Field {\n" +
- " /**\n" +
- " * @see #foo\n" +
- " * @see Field#foo\n" +
- " * @see Test.Field#foo\n" +
- " */\n" +
- " int foo;\n" +
- " }\n" +
- "}\n"
- );
- findJavadoc("Test");
- findJavadoc("Field");
- findJavadoc("foo");
- findJavadoc("Field", 2);
- findJavadoc("foo", 2);
- findJavadoc("foo", 3);
- findJavadoc("Field", 4);
- findJavadoc("foo", 4);
- findJavadoc("Test", 3);
- findJavadoc("Field", 5);
- findJavadoc("foo", 5);
- assertValid(
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Test.Field>*/\n" +
- "/**<SelectOnField:Test.Field#foo>*/\n" +
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n" +
- "/**<SelectOnField:#foo>*/\n" +
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Test.Field>*/\n" +
- "/**<SelectOnField:Test.Field#foo>*/\n"
- );
- }
-
- public void test18() {
- setUnit("Test.java",
- "/**\n" +
- " * @see Test.Method#foo()\n" +
- " */\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Method#foo()\n" +
- " */\n" +
- " class Method {\n" +
- " /**\n" +
- " * @see #foo()\n" +
- " * @see Method#foo()\n" +
- " * @see Test.Method#foo()\n" +
- " */\n" +
- " void foo() {}\n" +
- " }\n" +
- "}"
- );
- findJavadoc("Test");
- findJavadoc("Method");
- findJavadoc("foo");
- findJavadoc("Method", 2);
- findJavadoc("foo", 2);
- findJavadoc("foo", 3);
- findJavadoc("Method", 4);
- findJavadoc("foo", 4);
- findJavadoc("Test", 3);
- findJavadoc("Method", 5);
- findJavadoc("foo", 5);
- assertValid(
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Test.Method>*/\n" +
- "/**<SelectOnMethod:Test.Method#foo()>*/\n" +
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo()>*/\n" +
- "/**<SelectOnMethod:#foo()>*/\n" +
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo()>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Test.Method>*/\n" +
- "/**<SelectOnMethod:Test.Method#foo()>*/\n"
- );
- }
-
- public void test19() {
- setUnit("Test.java",
- "/**\n" +
- " * @see Test.Other\n" +
- " */\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Test\n" +
- " * @see Other\n" +
- " * @see Test.Other\n" +
- " */\n" +
- " class Other {}\n" +
- "}"
- );
- findJavadoc("Test");
- findJavadoc("Other");
- findJavadoc("Test", 3);
- findJavadoc("Other", 2);
- findJavadoc("Test", 4);
- findJavadoc("Other", 3);
- assertValid(
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Test.Other>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Other>*/\n" +
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Test.Other>*/\n"
- );
- }
-
- public void test20() {
- setUnit("Test.java",
- "public class Test {\n" +
- " void bar() {\n" +
- " /**\n" +
- " * @see Field#foo\n" +
- " */\n" +
- " class Field {\n" +
- " /**\n" +
- " * @see #foo\n" +
- " * @see Field#foo\n" +
- " */\n" +
- " int foo;\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- findJavadoc("Field");
- findJavadoc("foo");
- findJavadoc("foo", 2);
- findJavadoc("Field", 3);
- findJavadoc("foo", 3);
- assertValid(
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n" +
- "/**<SelectOnField:#foo>*/\n" +
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n"
- );
- }
-
- public void test21() {
- setUnit("Test.java",
- "public class Test {\n" +
- " void bar() {\n" +
- " /**\n" +
- " * @see Method#foo()\n" +
- " */\n" +
- " class Method {\n" +
- " /**\n" +
- " * @see #foo()\n" +
- " * @see Method#foo()\n" +
- " */\n" +
- " void foo() {}\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- findJavadoc("Method");
- findJavadoc("foo");
- findJavadoc("foo", 2);
- findJavadoc("Method", 3);
- findJavadoc("foo", 3);
- assertValid(
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo()>*/\n" +
- "/**<SelectOnMethod:#foo()>*/\n" +
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo()>*/\n"
- );
- }
-
- public void test22() {
- setUnit("Test.java",
- "public class Test {\n" +
- " void bar() {\n" +
- " /**\n" +
- " * @see Test\n" +
- " * @see Other\n" +
- " */\n" +
- " class Other {}\n" +
- " }\n" +
- "}"
- );
- findJavadoc("Test", 2);
- findJavadoc("Other");
- assertValid(
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Other>*/\n"
- );
- }
-
- public void test23() {
- setUnit("Test.java",
- "public class Test {\n" +
- " void bar() {\n" +
- " new Object() {\n" +
- " /**\n" +
- " * @see Field#foo\n" +
- " */\n" +
- " class Field {\n" +
- " /**\n" +
- " * @see #foo\n" +
- " * @see Field#foo\n" +
- " */\n" +
- " int foo;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n"
- );
- findJavadoc("Field");
- findJavadoc("foo");
- findJavadoc("foo", 2);
- findJavadoc("Field", 3);
- findJavadoc("foo", 3);
- assertValid(
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n" +
- "/**<SelectOnField:#foo>*/\n" +
- "/**<SelectOnType:Field>*/\n" +
- "/**<SelectOnField:Field#foo>*/\n"
- );
- }
-
- public void test24() {
- setUnit("Test.java",
- "public class Test {\n" +
- " void bar() {\n" +
- " new Object() {\n" +
- " /**\n" +
- " * @see Method#foo()\n" +
- " */\n" +
- " class Method {\n" +
- " /**\n" +
- " * @see #foo()\n" +
- " * @see Method#foo()\n" +
- " */\n" +
- " void foo() {}\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- findJavadoc("Method");
- findJavadoc("foo");
- findJavadoc("foo", 2);
- findJavadoc("Method", 3);
- findJavadoc("foo", 3);
- assertValid(
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo()>*/\n" +
- "/**<SelectOnMethod:#foo()>*/\n" +
- "/**<SelectOnType:Method>*/\n" +
- "/**<SelectOnMethod:Method#foo()>*/\n"
- );
- }
-
- public void test25() {
- setUnit("Test.java",
- "public class Test {\n" +
- " void bar() {\n" +
- " new Object() {\n" +
- " /**\n" +
- " * @see Test\n" +
- " * @see Other\n" +
- " */\n" +
- " class Other {}\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- findJavadoc("Test", 2);
- findJavadoc("Other");
- assertValid(
- "/**<SelectOnType:Test>*/\n" +
- "/**<SelectOnType:Other>*/\n"
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest.java
deleted file mode 100644
index 3ac33c8..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest.java
+++ /dev/null
@@ -1,2579 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-public class SelectionTest extends AbstractSelectionTest {
-static {
-// TESTS_NUMBERS = new int[] { 53 };
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(SelectionTest.class);
-}
-
-public SelectionTest(String testName) {
- super(testName);
-}
-/*
- * Select superclass
- */
-public void test00() {
-
- String str =
- " var i=foo(); \n" +
- "";
-
- String selectionStartBehind = "=";
- String selectionEndBehind = "foo";
-
- String expectedCompletionNodeToString = "<SelectOnMessageSend:foo()>";
- String completionIdentifier = "foo";
- String expectedUnitDisplayString =
- "var i = <SelectOnMessageSend:foo()>;\n" +
- "" +
- "";
- String expectedReplacedSource = "foo()";
- String testName = "<select message send>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-public void test01() {
-
- String str =
- " var i=bb.foo(); \n" +
- "";
-
- String selectionStartBehind = "bb.";
- String selectionEndBehind = "foo";
-
- String expectedCompletionNodeToString = "<SelectOnMessageSend:bb.foo()>";
- String completionIdentifier = "foo";
- String expectedUnitDisplayString =
- "var i = <SelectOnMessageSend:bb.foo()>;\n" +
- "" +
- "";
- String expectedReplacedSource = "bb.foo()";
- String testName = "<select message send>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-///*
-// * Select superclass
-// */
-//public void test01() {
-//
-// String str =
-// "import java.io.*; \n" +
-// " \n" +
-// "public class X extends IOException { \n" +
-// "} \n";
-//
-// String selectionStartBehind = "extends ";
-// String selectionEndBehind = "IOException";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:IOException>";
-// String completionIdentifier = "IOException";
-// String expectedUnitDisplayString =
-// "import java.io.*;\n" +
-// "public class X extends <SelectOnType:IOException> {\n" +
-// " public X() {\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "IOException";
-// String testName = "<select superclass>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select superinterface
- */
-//public void test02() {
-//
-// String str =
-// "import java.io.*; \n" +
-// " \n" +
-// "public class X extends IOException implements Serializable { \n" +
-// " int foo(){} \n" +
-// "} \n";
-//
-// String selectionStartBehind = "implements ";
-// String selectionEndBehind = "Serializable";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Serializable>";
-// String completionIdentifier = "Serializable";
-// String expectedUnitDisplayString =
-// "import java.io.*;\n" +
-// "public class X extends IOException implements <SelectOnType:Serializable> {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "Serializable";
-// String testName = "<select superinterface>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-///*
-// * Select qualified superclass
-// */
-//public void test03() {
-//
-// String str =
-// "public class X extends java.io.IOException { \n" +
-// "} \n";
-//
-// String selectionStartBehind = "java.io.";
-// String selectionEndBehind = "IOException";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:java.io.IOException>";
-// String completionIdentifier = "IOException";
-// String expectedUnitDisplayString =
-// "public class X extends <SelectOnType:java.io.IOException> {\n" +
-// " public X() {\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "java.io.IOException";
-// String testName = "<select qualified superclass>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-///*
-// * Select package from qualified superclass
-// */
-//public void test04() {
-//
-// String str =
-// "public class X extends java.io.IOException { \n" +
-// "} \n";
-//
-// String selectionStartBehind = "java.";
-// String selectionEndBehind = "java.io";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:java.io>";
-// String completionIdentifier = "io";
-// String expectedUnitDisplayString =
-// "public class X extends <SelectOnType:java.io> {\n" +
-// " public X() {\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "java.io.IOException";
-// String testName = "<select package from qualified superclass>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select message send
- */
-public void test05() {
-
- String str =
- " function foo(){ \n" +
- " System.out.println(\"hello\"); \n";
-
- String selectionStartBehind = "System.out.";
- String selectionEndBehind = "println";
-
- String expectedCompletionNodeToString = "<SelectOnMessageSend:System.out.println(\"hello\")>";
- String completionIdentifier = "println";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
- "}\n" +
- "";
- String expectedReplacedSource = "System.out.println(\"hello\")";
- String testName = "<select message send>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void test05b() {
-
- String str =
- " System.out.println(\"hello\"); \n";
-
- String selectionStartBehind = "System.out.";
- String selectionEndBehind = "println";
-
- String expectedCompletionNodeToString = "<SelectOnMessageSend:System.out.println(\"hello\")>";
- String completionIdentifier = "println";
- String expectedUnitDisplayString =
- "<SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
- "";
- String expectedReplacedSource = "System.out.println(\"hello\")";
- String testName = "<select message send>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-/*
- * Select message send with recovery before
- */
-public void test06() {
-
- String str =
- " function foo(){ \n" +
- " System.out.println(\"hello\"); \n";
-
- String selectionStartBehind = "System.out.";
- String selectionEndBehind = "println";
-
- String expectedCompletionNodeToString = "<SelectOnMessageSend:System.out.println(\"hello\")>";
- String completionIdentifier = "println";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <SelectOnMessageSend:System.out.println(\"hello\")>;\n" +
- "}\n" +
- "";
- String expectedReplacedSource = "System.out.println(\"hello\")";
- String testName = "<select message send with recovery before>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select message send with sibling method
- */
-public void test07() {
-
- String str =
- " function foo(){ \n" +
- " this.bar(\"hello\"); \n" +
- " function bar( s){ \n" +
- " return s.length(); \n" +
- " } \n" +
- "";
-
- String selectionStartBehind = "this.";
- String selectionEndBehind = "this.bar";
-
- String expectedCompletionNodeToString = "<SelectOnMessageSend:this.bar(\"hello\")>";
- String completionIdentifier = "bar";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <SelectOnMessageSend:this.bar(\"hello\")>;\n" +
- "}\n" +
- "function bar(s) {\n" +
- "}\n" +
- "";
- String expectedReplacedSource = "this.bar(\"hello\")";
- String testName = "<select message send with sibling method>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select field reference
- */
-public void test08() {
-
- String str =
- " var num = 0; \n" +
- " function foo(){ \n" +
- " var j = this.num; \n" +
- "";
-
- String selectionStartBehind = "this.";
- String selectionEndBehind = "this.num";
-
- String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.num>";
- String completionIdentifier = "num";
- String expectedUnitDisplayString =
- "var num;\n" +
- "function foo() {\n" +
- " var j = <SelectionOnFieldReference:this.num>;\n" +
- "}\n" +
- "";
- String expectedReplacedSource = "this.num";
- String testName = "<select field reference>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select field reference with syntax errors
- */
-public void test09() {
-
- String str =
- " var num \n" +
- " function foo(){ \n" +
- " var j = this.num; \n" +
- "} \n";
-
- String selectionStartBehind = "this.";
- String selectionEndBehind = "this.num";
-
- String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.num>";
- String completionIdentifier = "num";
- String expectedUnitDisplayString =
- "var num;\n" +
- "function foo() {\n" +
- " var j = <SelectionOnFieldReference:this.num>;\n" +
- "}\n";
- String expectedReplacedSource = "this.num";
- String testName = "<select field reference with syntax errors>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select field reference inside message receiver
- */
-public void test10() {
-
- String str =
- " var x; \n" +
- " function foo(){ \n" +
- " var j = this.x.foo(); \n" +
- "} \n";
-
- String selectionStartBehind = "this.";
- String selectionEndBehind = "this.x";
-
- String expectedCompletionNodeToString = "<SelectionOnFieldReference:this.x>";
- String completionIdentifier = "x";
- String expectedUnitDisplayString =
- "var x;\n" +
- "function foo() {\n" +
- " var j = <SelectionOnFieldReference:this.x>.foo();\n" +
- "}\n";
- String expectedReplacedSource = "this.x";
- String testName = "<select field reference inside message receiver>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select allocation
- */
-public void test11() {
-
- String str =
- " function X(i){} \n" +
- " function foo(){ \n" +
- " var j = 0; \n" +
- " var x = new X(j); \n" +
- "} \n";
-
- String selectionStartBehind = "new ";
- String selectionEndBehind = "new X";
-
- String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new X(j)>";
- String completionIdentifier = "X";
- String expectedUnitDisplayString =
- "function X(i) {\n" +
- " }\n" +
- "function foo() {\n" +
- " var j;\n" +
- " var x = <SelectOnAllocationExpression:new X(j)>;\n" +
- "}\n";
- String expectedReplacedSource = "new X(j)";
- String testName = "<select allocation>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select qualified allocation
- */
-//public void test12() {
-//
-// String str =
-// "public class X { \n" +
-// " class Y { \n" +
-// " Y(int i){} \n" +
-// " } \n" +
-// " X(int i){} \n" +
-// " int foo(){ \n" +
-// " int j = 0; \n" +
-// " X x = new X(j); \n" +
-// " x.new Y(1); \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "x.new ";
-// String selectionEndBehind = "x.new Y";
-//
-// String expectedCompletionNodeToString = "<SelectOnQualifiedAllocationExpression:x.new Y(1)>";
-// String completionIdentifier = "Y";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " class Y {\n" +
-// " Y(int i) {\n" +
-// " }\n" +
-// " }\n" +
-// " X(int i) {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " int j;\n" +
-// " X x;\n" +
-// " <SelectOnQualifiedAllocationExpression:x.new Y(1)>;\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "x.new Y(1)";
-// String testName = "<select qualified allocation>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select qualified name reference receiver
- */
-public void test13() {
-
- String str =
- " function foo(){ \n" +
- " java.lang.System.out.println(); \n" +
- "} \n";
-
- String selectionStartBehind = "java.lang.";
- String selectionEndBehind = "java.lang.System";
-
- String expectedCompletionNodeToString = "<SelectOnName:java.lang.System>";
- String completionIdentifier = "System";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <SelectOnName:java.lang.System>;\n" +
- "}\n";
- String expectedReplacedSource = "java.lang.System.out";
- String testName = "<select qualified name receiver>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select qualified name reference
- */
-public void test14() {
-
- String str =
- " int foo(){ \n" +
- " var sys = java.lang.System; \n" +
- "} \n";
-
- String selectionStartBehind = "java.lang.";
- String selectionEndBehind = "java.lang.System";
-
- String expectedCompletionNodeToString = "<SelectOnName:java.lang.System>";
- String completionIdentifier = "System";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var sys = <SelectOnName:java.lang.System>;\n" +
- "}\n";
- String expectedReplacedSource = "java.lang.System";
- String testName = "<select qualified name>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-///*
-// * Select variable type with modifier
-// */
-//public void test15() {
-//
-// String str =
-// "public class X { \n" +
-// " int foo(){ \n" +
-// " final System sys = null; \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "final ";
-// String selectionEndBehind = "final System";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:System>";
-// String completionIdentifier = "System";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " final <SelectOnType:System> sys;\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "System";
-// String testName = "<select variable type with modifier>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select variable type
- */
-//public void test16() {
-//
-// String str =
-// "public class X { \n" +
-// " int foo(){ \n" +
-// " System sys = null; \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "\n ";
-// String selectionEndBehind = "\n System";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:System>";
-// String completionIdentifier = "System";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " <SelectOnType:System> sys;\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "System";
-// String testName = "<select variable type>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select name
- */
-public void test17() {
-
- String str =
- "function foo(){ \n" +
- " System \n" +
- "} \n";
-
- String selectionStartBehind = "\n ";
- String selectionEndBehind = "\n System";
-
- String expectedCompletionNodeToString = "<SelectOnName:System>";
- String completionIdentifier = "System";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <SelectOnName:System>;\n" +
- "}\n";
-
- String expectedReplacedSource = "System";
- String testName = "<select name>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Select anonymous type
- */
-//public void test18() {
-//
-// String str =
-// "public class X { \n" +
-// " int foo(){ \n" +
-// " new Object(){ \n" +
-// " int bar(){} \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "new ";
-// String selectionEndBehind = "new Object";
-//
-// String expectedCompletionNodeToString =
-// "<SelectOnAllocationExpression:new Object() {\n" +
-// " () {\n" +
-// " super();\n" +
-// " }\n" +
-// "}>";
-// String completionIdentifier = "Object";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " <SelectOnAllocationExpression:new Object() {\n" +
-// " () {\n" +
-// " super();\n" +
-// " }\n" +
-// " }>;\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "new Object()";
-// String testName = "<select anonymous type>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select cast type
- */
-//public void test19() {
-//
-// String str =
-// "public class X { \n" +
-// " Object foo(){ \n" +
-// " return (Object) this; \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "return (";
-// String selectionEndBehind = "return (Object";
-//
-// String expectedCompletionNodeToString = "<SelectOnName:Object>";
-// String completionIdentifier = "Object";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " Object foo() {\n" +
-// " <SelectOnName:Object>;\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "Object";
-// String testName = "<select cast type>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select package
- */
-//public void test20() {
-//
-// String str =
-// "package x.y.other; \n" +
-// "public class X { \n" +
-// " int foo(){ \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "x.";
-// String selectionEndBehind = "x.y";
-//
-// String expectedCompletionNodeToString = "<SelectOnPackage:x.y>";
-// String completionIdentifier = "y";
-// String expectedUnitDisplayString =
-// "package <SelectOnPackage:x.y>;\n" +
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "x.y.other";
-// String testName = "<select package>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-///*
-// * Select import
-// */
-//public void test21() {
-//
-// String str =
-// "import x.y.Other; \n" +
-// "public class X { \n" +
-// " int foo(){ \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "y.";
-// String selectionEndBehind = "y.Other";
-//
-// String expectedCompletionNodeToString = "<SelectOnImport:x.y.Other>";
-// String completionIdentifier = "Other";
-// String expectedUnitDisplayString =
-// "import <SelectOnImport:x.y.Other>;\n" +
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "x.y.Other";
-// String testName = "<select import>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-///*
-// * Select import on demand
-// */
-//public void test22() {
-//
-// String str =
-// "import x.y.other.*; \n" +
-// "public class X { \n" +
-// " int foo(){ \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "y.";
-// String selectionEndBehind = "y.other";
-//
-// String expectedCompletionNodeToString = "<SelectOnImport:x.y.other>";
-// String completionIdentifier = "other";
-// String expectedUnitDisplayString =
-// "import <SelectOnImport:x.y.other>;\n" +
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "x.y.other";
-// String testName = "<select import on demand>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select array initializer type
- */
-public void test23() {
-
- String str =
- "public class X { \n" +
- " int foo(){ \n" +
- " String[] p = new String[]{\"Left\"};\n" +
-// " } \n" +
- " } \n" +
- "} \n";
-
- String selectionStartBehind = "new ";
- String selectionEndBehind = "new String";
- String expectedCompletionNodeToString = "<SelectOnType:String>";
- String completionIdentifier = "String";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " int foo() {\n" +
- " String[] p = <SelectOnType:String>;\n" +
- " }\n" +
- "}\n";
-
- String expectedReplacedSource = "String";
- String testName = "<select array initializer type>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-///*
-// * Select nested type superclass with syntax error behind
-// */
-//public void test24() {
-//
-// String str =
-// "public class G { \n" +
-// " void foo() { \n" +
-// " class X { \n" +
-// " class Y extends G { \n" +
-// " int foo() \n" +
-// " } \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "extends ";
-// String selectionEndBehind = "extends G";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:G>";
-//
-// String completionIdentifier = "G";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " public G() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " class X {\n" +
-// " class Y extends <SelectOnType:G> {\n" +
-// " Y() {\n" +
-// " }\n" +
-// " int foo() {\n" +
-// " }\n" +
-// " }\n" +
-// " X() {\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "G";
-// String testName = "<select nested type superclass>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select super
- */
-//public void test25() {
-//
-// String str =
-// "public class G { \n" +
-// " Object foo() { \n" +
-// " return super.foo(); \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "return ";
-// String selectionEndBehind = "return super";
-//
-// String expectedCompletionNodeToString = "<SelectOnSuper:super>";
-//
-// String completionIdentifier = "super";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " public G() {\n" +
-// " }\n" +
-// " Object foo() {\n" +
-// " <SelectOnSuper:super>;\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "super";
-// String testName = "<select super>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select qualified super
- */
-//public void test26() {
-//
-// String str =
-// "public class G { \n" +
-// " Object foo() { \n" +
-// " new X(){ \n" +
-// " Object bar(){ \n" +
-// " return G.super.foo(); \n" +
-// " } \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "G.";
-// String selectionEndBehind = "G.super";
-//
-// String expectedCompletionNodeToString = "<SelectOnQualifiedSuper:G.super>";
-//
-// String completionIdentifier = "super";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " public G() {\n" +
-// " }\n" +
-// " Object foo() {\n" +
-// " new X() {\n" +
-// " () {\n" +
-// " }\n" +
-// " Object bar() {\n" +
-// " <SelectOnQualifiedSuper:G.super>;\n" +
-// " }\n" +
-// " };\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "G.super";
-// String testName = "<select qualified super>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select super constructor call
- */
-//public void test27() {
-//
-// String str =
-// "public class G { \n" +
-// " G() { \n" +
-// " super(); \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "\n\t\t";
-// String selectionEndBehind = "super";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:super()>;";
-//
-// String completionIdentifier = "super";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " G() {\n" +
-// " <SelectOnExplicitConstructorCall:super()>;\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "super()";
-// String testName = "<select super constructor call>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select qualified super constructor call
- */
-//public void test28() {
-//
-// String str =
-// "public class G { \n" +
-// " class M {} \n" +
-// " static Object foo() { \n" +
-// " class X extends M { \n" +
-// " X (){ \n" +
-// " new G().super(); \n" +
-// " } \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "new G().";
-// String selectionEndBehind = "new G().super";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().super()>;";
-//
-// String completionIdentifier = "super";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " class M {\n" +
-// " M() {\n" +
-// " }\n" +
-// " }\n" +
-// " public G() {\n" +
-// " }\n" +
-// " static Object foo() {\n" +
-// " class X extends M {\n" +
-// " X() {\n" +
-// " <SelectOnExplicitConstructorCall:new G().super()>;\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "new G().super()";
-// String testName = "<select qualified super constructor call>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select qualified super constructor call with arguments
- */
-//public void test29() {
-//
-// String str =
-// "public class G { \n" +
-// " class M {} \n" +
-// " static Object foo() { \n" +
-// " class X extends M { \n" +
-// " X (){ \n" +
-// " new G().super(23 + \"hello\"); \n" +
-// " } \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "new G().";
-// String selectionEndBehind = "new G().super";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().super((23 + \"hello\"))>;";
-//
-// String completionIdentifier = "super";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " class M {\n" +
-// " M() {\n" +
-// " }\n" +
-// " }\n" +
-// " public G() {\n" +
-// " }\n" +
-// " static Object foo() {\n" +
-// " class X extends M {\n" +
-// " X() {\n" +
-// " <SelectOnExplicitConstructorCall:new G().super((23 + \"hello\"))>;\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "new G().super(23 + \"hello\")";
-// String testName = "<select qualified super constructor call with arguments>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Select super constructor call with arguments
- */
-//public void test30() {
-//
-// String str =
-// "public class G { \n" +
-// " G() { \n" +
-// " super(new G()); \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "\n\t\t";
-// String selectionEndBehind = "super";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:super(new G())>;";
-//
-// String completionIdentifier = "super";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " G() {\n" +
-// " <SelectOnExplicitConstructorCall:super(new G())>;\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "super(new G())";
-// String testName = "<select super constructor call with arguments>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Regression test for 1FVQ0LK
- */
-//public void test31() {
-//
-// String str =
-// "class X { \n" +
-// " Y f; \n" +
-// " void foo() { \n" +
-// " new Bar(fred()); \n" +
-// " Z z= new Z(); \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "\n\t";
-// String selectionEndBehind = "Y";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Y>";
-//
-// String completionIdentifier = "Y";
-// String expectedUnitDisplayString =
-// "class X {\n" +
-// " <SelectOnType:Y> f;\n" +
-// " X() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "Y";
-// String testName = "<regression test for 1FVQ0LK>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Regression test for 1FWT4AJ: ITPCOM:WIN98 - SelectionParser produces duplicate type declaration
- */
-public void test32() {
-
- String str =
- "function containsPhrase(){ \n"+
- " var currentChar = \"hello\".toLowerCase() \n"+
- "} \n";
-
- String selectionStartBehind = "\"hello\".";
- String selectionEndBehind = "\"hello\".toLowerCase";
-
- String expectedCompletionNodeToString = "<SelectOnMessageSend:\"hello\".toLowerCase()>";
-
- String completionIdentifier = "toLowerCase";
- String expectedUnitDisplayString =
- "function containsPhrase() {\n" +
- " var currentChar = <SelectOnMessageSend:\"hello\".toLowerCase()>;\n" +
- "}\n";
-
- String expectedReplacedSource = "\"hello\".toLowerCase()";
- String testName = "<1FWT4AJ: ITPCOM:WIN98 - SelectionParser produces duplicate type declaration>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * Regression test for 1G4CLZM: ITPJUI:WINNT - 'Import Selection' - Set not found
- */
-//public void test33() {
-//
-// String str =
-// " import java.util.AbstractMap; \n"+
-// " public class c4 extends AbstractMap { \n"+
-// " /** \n"+
-// " * @see AbstractMap#entrySet \n"+
-// " */ \n"+
-// " public Set entrySet() { \n"+
-// " return null; \n"+
-// " } \n"+
-// " } \n";
-//
-// String selectionStartBehind = "\n\t\tpublic ";
-// String selectionEndBehind = "public Set";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Set>";
-//
-// String completionIdentifier = "Set";
-// String expectedUnitDisplayString =
-// "import java.util.AbstractMap;\n" +
-// "public class c4 extends AbstractMap {\n" +
-// " public c4() {\n" +
-// " }\n" +
-// " public <SelectOnType:Set> entrySet() {\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "Set";
-// String testName = "<1G4CLZM: ITPJUI:WINNT - 'Import Selection' - Set not found>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * Regression test for 1GB99S3: ITPJUI:WINNT - SH: NPE in editor while getting hover help
- */
-public void test34() {
-
- String str =
- "function foo() { \n"+
- " var array = new Object(); \n"+
- " return array.length; \n"+
- "} \n";
-
- String selectionStartBehind = "\n\t\treturn ";
- String selectionEndBehind = "array.length";
-
- String expectedCompletionNodeToString = NONE;
-
- String completionIdentifier = NONE;
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var array;\n" +
- " return array.length;\n" +
- "}\n";
-
- String expectedReplacedSource = NONE;
- String testName = "<1GB99S3: ITPJUI:WINNT - SH: NPE in editor while getting hover help>";
-
- int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
- int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-/*
- * Select this constructor call
- */
-//public void test35() {
-//
-// String str =
-// "public class G { \n" +
-// " G() { \n" +
-// " } \n" +
-// " G(int x) { \n" +
-// " this(); \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "\n\t\t";
-// String selectionEndBehind = "this";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:this()>;";
-//
-// String completionIdentifier = "this";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " G() {\n" +
-// " }\n" +
-// " G(int x) {\n" +
-// " <SelectOnExplicitConstructorCall:this()>;\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "this()";
-// String testName = "<select this constructor call>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//
-///*
-// * Select qualified this constructor call
-// */
-//public void test36() {
-//
-// String str =
-// "public class G { \n" +
-// " static Object foo() { \n" +
-// " class X { \n" +
-// " X (){ \n" +
-// " } \n" +
-// " X (int x){ \n" +
-// " new G().this(); \n" +
-// " } \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "new G().";
-// String selectionEndBehind = "new G().this";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().this()>;";
-//
-// String completionIdentifier = "this";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " public G() {\n" +
-// " }\n" +
-// " static Object foo() {\n" +
-// " class X {\n" +
-// " X() {\n" +
-// " super();\n"+
-// " }\n" +
-// " X(int x) {\n" +
-// " <SelectOnExplicitConstructorCall:new G().this()>;\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "new G().this()";
-// String testName = "<select qualified this constructor call>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-///*
-// * Select qualified this constructor call with arguments
-// */
-//public void test37() {
-//
-// String str =
-// "public class G { \n" +
-// " static Object foo() { \n" +
-// " class X { \n" +
-// " X (){ \n" +
-// " } \n" +
-// " X (int x){ \n" +
-// " new G().this(23 + \"hello\"); \n" +
-// " } \n" +
-// " } \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "new G().";
-// String selectionEndBehind = "new G().this";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:new G().this((23 + \"hello\"))>;";
-//
-// String completionIdentifier = "this";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " public G() {\n" +
-// " }\n" +
-// " static Object foo() {\n" +
-// " class X {\n" +
-// " X() {\n" +
-// " super();\n"+
-// " }\n" +
-// " X(int x) {\n" +
-// " <SelectOnExplicitConstructorCall:new G().this((23 + \"hello\"))>;\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "new G().this(23 + \"hello\")";
-// String testName = "<select qualified this constructor call with arguments>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-///*
-// * Select this constructor call with arguments
-// */
-//public void test38() {
-//
-// String str =
-// "public class G { \n" +
-// " G() { \n" +
-// " this(new G()); \n" +
-// " } \n" +
-// "} \n";
-//
-// String selectionStartBehind = "\n\t\t";
-// String selectionEndBehind = "this";
-//
-// String expectedCompletionNodeToString = "<SelectOnExplicitConstructorCall:this(new G())>;";
-//
-// String completionIdentifier = "this";
-// String expectedUnitDisplayString =
-// "public class G {\n" +
-// " G() {\n" +
-// " <SelectOnExplicitConstructorCall:this(new G())>;\n" +
-// " }\n" +
-// "}\n";
-//
-// String expectedReplacedSource = "this(new G())";
-// String testName = "<select this constructor call with arguments>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-///*
-// * bugs 3293 search does not work in inner class (1GEUQHJ)
-// */
-//public void test39() {
-//
-// String str =
-// "public class X { \n" +
-// " Object hello = new Object(){ \n" +
-// " public void foo(String s){ \n" +
-// " s.length(); \n" +
-// " } \n" +
-// " }; \n" +
-// "} \n";
-//
-// String selectionStartBehind = "s.";
-// String selectionEndBehind = "length";
-//
-// String expectedCompletionNodeToString = "<SelectOnMessageSend:s.length()>";
-//
-// String completionIdentifier = "length";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " Object hello = new Object() {\n" +
-// " public void foo(String s) {\n" +
-// " <SelectOnMessageSend:s.length()>;\n" +
-// " }\n" +
-// " };\n" +
-// " public X() {\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "s.length()";
-// String testName = "<select message send in anonymous class>";
-//
-// int selectionStart = str.indexOf(selectionStartBehind) + selectionStartBehind.length();
-// int selectionEnd = str.indexOf(selectionEndBehind) + selectionEndBehind.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-
-///*
-// * bugs 3229 OpenOnSelection - strange behaviour of code resolve (1GAVL08)
-// */
-//public void test40() {
-//
-// String str =
-// "public class X { \n" +
-// " Object \n" +
-// "} \n";
-//
-// String selection = "Object";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Object>";
-//
-// String completionIdentifier = "Object";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " <SelectOnType:Object>;\n" +
-// " public X() {\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "Object";
-// String testName = "<select fake field>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs 11475 selection on local name.
- */
-public void test41() {
-
- String str =
- "function foo(){ \n" +
- " var vari; \n" +
- "} \n";
-
- String selection = "vari";
-
- String expectedCompletionNodeToString = "<SelectionOnLocalName:vari>;";
-
- String completionIdentifier = "vari";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <SelectionOnLocalName:vari>;\n" +
- "}\n";
- String expectedReplacedSource = "vari";
- String testName = "<select local name>";
-
- int selectionStart = str.indexOf(selection);
- int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * bugs 11475 selection on argument name.
- */
-public void test42() {
-
- String str =
- " function foo(vari){ \n" +
- "} \n";
-
- String selection = "vari";
-
- String expectedCompletionNodeToString = "<SelectionOnArgumentName:vari>";
-
- String completionIdentifier = "vari";
- String expectedUnitDisplayString =
- "function foo(<SelectionOnArgumentName:vari>) {\n" +
- "}\n";
- String expectedReplacedSource = "vari";
- String testName = "<select argument name>";
-
- int selectionStart = str.indexOf(selection);
- int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
- this.checkDietParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-///*
-// * bugs 11475 selection on argument name inside catch statement.
-// */
-//public void test43() {
-//
-// String str =
-// "public class X { \n" +
-// " public void foo(){ \n" +
-// " try{ \n" +
-// " }catch(Object var){}\n" +
-// " } \n" +
-// "} \n";
-//
-// String selection = "var";
-//
-// String expectedCompletionNodeToString = "<SelectionOnArgumentName:Object var>";
-//
-// String completionIdentifier = "var";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " public void foo() {\n" +
-// " <SelectionOnArgumentName:Object var>;\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "var";
-// String testName = "<select argument name inside catch statement>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs 15430
- */
-//public void test44() {
-//
-// String str =
-// "public class X { \n" +
-// " String x = super.foo() \n" +
-// "} \n";
-//
-// String selection = "super";
-//
-// String expectedCompletionNodeToString = "<SelectOnSuper:super>";
-//
-// String completionIdentifier = "super";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " String x = <SelectOnSuper:super>;\n" +
-// " public X() {\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "super";
-// String testName = "<select super in field initializer>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs 14468
- */
-//public void test45() {
-//
-// String str =
-// "public class X { \n" +
-// " void foo() {\n" +
-// " if(x instanceof Object){\n" +
-// " }\n" +
-// " } \n" +
-// "} \n";
-//
-// String selection = "Object";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Object>";
-//
-// String completionIdentifier = "Object";
-// String expectedUnitDisplayString =
-// "public class X {\n"+
-// " public X() {\n"+
-// " }\n"+
-// " void foo() {\n"+
-// " <SelectOnType:Object>;\n"+
-// " }\n"+
-// "}\n";
-// String expectedReplacedSource = "Object";
-// String testName = "<select inside instanceof statement>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-
-/*
- * bugs 14468
- */
-//public void test46() {
-//
-// String str =
-// "public class X { \n" +
-// " void foo() {\n" +
-// " y = x instanceof Object;\n" +
-// " } \n" +
-// "} \n";
-//
-// String selection = "Object";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Object>";
-//
-// String completionIdentifier = "Object";
-// String expectedUnitDisplayString =
-// "public class X {\n"+
-// " public X() {\n"+
-// " }\n"+
-// " void foo() {\n"+
-// " <SelectOnType:Object>;\n"+
-// " }\n"+
-// "}\n";
-// String expectedReplacedSource = "Object";
-// String testName = "<select inside instanceof statement>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs 14468
- */
-//public void test47() {
-//
-// String str =
-// "public class X { \n" +
-// " void foo() {\n" +
-// " boolean y = x instanceof Object;\n" +
-// " } \n" +
-// "} \n";
-//
-// String selection = "Object";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Object>";
-//
-// String completionIdentifier = "Object";
-// String expectedUnitDisplayString =
-// "public class X {\n"+
-// " public X() {\n"+
-// " }\n"+
-// " void foo() {\n"+
-// " boolean y = <SelectOnType:Object>;\n"+
-// " }\n"+
-// "}\n";
-// String expectedReplacedSource = "Object";
-// String testName = "<select inside instanceof statement>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs 14468
- */
-//public void test48() {
-//
-// String str =
-// "public class X { \n" +
-// " boolean y = x instanceof Object;\n" +
-// "} \n";
-//
-// String selection = "Object";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Object>";
-//
-// String completionIdentifier = "Object";
-// String expectedUnitDisplayString =
-// "public class X {\n"+
-// " boolean y = <SelectOnType:Object>;\n"+
-// " public X() {\n"+
-// " }\n"+
-// "}\n";
-// String expectedReplacedSource = "Object";
-// String testName = "<select inside instanceof statement>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkDietParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs 28064
- */
-public void test49() {
-
- String str =
- "var x = new X();\n" +
- " \n";
-
- String selection = "X";
-
- String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new X()>"
- ;
-
- String completionIdentifier = "X";
- String expectedUnitDisplayString =
- "var x = <SelectOnAllocationExpression:new X()>\n" +
- "\n";
- String expectedReplacedSource = "new X()";
- String testName = "<select anonymous type>";
-
- int selectionStart = str.lastIndexOf(selection);
- int selectionEnd = str.lastIndexOf(selection) + selection.length() - 1;
-
- this.checkDietParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/*
- * bugs https://bugs.eclipse.org/bugs/show_bug.cgi?id=52422
- */
-//public void test50() {
-//
-// String str =
-// " void foo() {\n" +
-// " new Object(){\n" +
-// " void bar(){\n" +
-// " bar2();\n" +
-// " }\n" +
-// " void bar2() {\n" +
-// " }\n" +
-// " }\n" +
-// "} \n";
-//
-// String selection = "bar2";
-//
-// String expectedCompletionNodeToString = "<SelectOnMessageSend:bar2()>";
-//
-// String completionIdentifier = "bar2";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new Object() {\n" +
-// " () {\n" +
-// " }\n" +
-// " void bar() {\n" +
-// " <SelectOnMessageSend:bar2()>;\n" +
-// " }\n" +
-// " void bar2() {\n" +
-// " }\n" +
-// " };\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "bar2()";
-// String testName = "<select inside anonymous type>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs https://bugs.eclipse.org/bugs/show_bug.cgi?id=52422
- */
-//public void test51() {
-//
-// String str =
-// "public class X { \n" +
-// " void foo() {\n" +
-// " new Object(){\n" +
-// " void foo0(){\n" +
-// " new Object(){\n" +
-// " void bar(){\n" +
-// " bar2();\n" +
-// " }\n" +
-// " void bar2() {\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "} \n";
-//
-// String selection = "bar2";
-//
-// String expectedCompletionNodeToString = "<SelectOnMessageSend:bar2()>";
-//
-// String completionIdentifier = "bar2";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new Object() {\n" +
-// " () {\n" +
-// " }\n" +
-// " void foo0() {\n" +
-// " new Object() {\n" +
-// " () {\n" +
-// " }\n" +
-// " void bar() {\n" +
-// " <SelectOnMessageSend:bar2()>;\n" +
-// " }\n" +
-// " void bar2() {\n" +
-// " }\n" +
-// " };\n" +
-// " }\n" +
-// " };\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "bar2()";
-// String testName = "<select inside anonymous type>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-/*
- * bugs https://bugs.eclipse.org/bugs/show_bug.cgi?id=52422
- */
-//public void test52() {
-//
-// String str =
-// "public class X { \n" +
-// " void foo() {\n" +
-// " new Object(){\n" +
-// " void foo0(){\n" +
-// " new Object(){\n" +
-// " void bar(){\n" +
-// " bar2();\n" +
-// " }\n" +
-//
-// " }\n" +
-// " }\n" +
-// " void bar2() {\n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "} \n";
-//
-// String selection = "bar2";
-//
-// String expectedCompletionNodeToString = "<SelectOnMessageSend:bar2()>";
-//
-// String completionIdentifier = "bar2";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new Object() {\n" +
-// " () {\n" +
-// " }\n" +
-// " void foo0() {\n" +
-// " new Object() {\n" +
-// " () {\n" +
-// " }\n" +
-// " void bar() {\n" +
-// " <SelectOnMessageSend:bar2()>;\n" +
-// " }\n" +
-// " };\n" +
-// " }\n" +
-// " void bar2() {\n" +
-// " }\n" +
-// " };\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "bar2()";
-// String testName = "<select inside anonymous type>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void test53() {
-//
-// String str =
-// "public class X { \n" +
-// " void foo(String[] stringArray) {\n" +
-// " for(String string2 : stringArray);\n" +
-// " }\n" +
-// "} \n";
-//
-// String selection = "string2";
-//
-// String expectedCompletionNodeToString = "<SelectionOnLocalName:String string2>;";
-//
-// String completionIdentifier = "string2";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " void foo(String[] stringArray) {\n" +
-// " for (<SelectionOnLocalName:String string2> : stringArray) \n" +
-// " ;\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "string2";
-// String testName = "<select>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84001
-//public void test54() {
-//
-// String str =
-// "public class X { \n" +
-// " void foo() {\n" +
-// " new Test.Sub();\n" +
-// " }\n" +
-// "} \n";
-//
-// String selection = "Test";
-//
-// String expectedCompletionNodeToString = "<SelectOnType:Test>";
-//
-// String completionIdentifier = "Test";
-// String expectedUnitDisplayString =
-// "public class X {\n" +
-// " public X() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new <SelectOnType:Test>();\n" +
-// " }\n" +
-// "}\n";
-// String expectedReplacedSource = "Test";
-// String testName = "<select>";
-//
-// int selectionStart = str.indexOf(selection);
-// int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-//
-// this.checkMethodParse(
-// str.toCharArray(),
-// selectionStart,
-// selectionEnd,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84001
-public void test55() {
-
- String str =
- "function foo() {\n" +
- " new Test.Sub();\n" +
- "} \n";
-
- String selection = "Sub";
-
- String expectedCompletionNodeToString = "<SelectOnAllocationExpression:new Test.Sub()>";
-
- String completionIdentifier = "Sub";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <SelectOnAllocationExpression:new Test.Sub()>;\n" +
- "}\n";
- String expectedReplacedSource = "new Test.Sub()";
- String testName = "<select>";
-
- int selectionStart = str.indexOf(selection);
- int selectionEnd = str.indexOf(selection) + selection.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-static final String RESOLVE_LOCAL_NAME=
- "function foo(){\n" +
- "var var1 = new Object();\n" +
- "var var2 = 1;\n" +
- "var1.toString();\n" +
- "var2++;\n" +
- "if (var2 == 3) {\n" +
- " var var3 = var1;\n" +
- " var3.hashCode();\n" +
- "} else {\n" +
- " var var3 = new Object();\n" +
- " var3.toString();\n" +
- "}\n" +
- "var var4 = 1;\n" +
- "\n" +
- "}\n" ;
-
-public void test56() {
-
- String str =RESOLVE_LOCAL_NAME;
-
- String startString = "var1.toString();";
- String selection = "var1";
-
- String expectedCompletionNodeToString = "<SelectOnName:var1>";
-
- String completionIdentifier = "var1";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var var1;\n" +
- " var var2;\n" +
- " <SelectOnName:var1>;\n" +
- " {\n" +
- " var var3;\n" +
- " }\n" +
- " {\n" +
- " var var3;\n" +
- " }\n" +
- " var var4;\n" +
- "}\n";
-
- String expectedReplacedSource = "var1";
- String testName = "<select>";
-
- int selectionStart = str.indexOf(startString);
- int selectionEnd = selectionStart + selection.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-
-public void test57() {
-
- String str ="YAHOO.widget.Slider = function (sElementId, sGroup, oThumb, sType) {\n"+
- "if (sElementId) {\n"+
- "}\n"+
- "};\n";
-
- String startString = "sElementId)";
- String selection = "sElementId";
-
- String expectedCompletionNodeToString = "<SelectOnName:sElementId>";
-
- String completionIdentifier = "sElementId";
- String expectedUnitDisplayString =
- "YAHOO.widget.Slider = function (sElementId, sGroup, oThumb, sType) {\n"+
- " if (<SelectOnName:sElementId>)\n {\n"+
- " }\n"+
- "};\n";
-
-
- String expectedReplacedSource = "sElementId";
- String testName = "<select>";
-
- int selectionStart = str.indexOf(startString);
- int selectionEnd = selectionStart + selection.length() - 1;
-
- this.checkMethodParse(
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest2.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest2.java
deleted file mode 100644
index 8ca4666..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest2.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Locale;
-
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.internal.codeassist.select.SelectionParser;
-import org.eclipse.wst.jsdt.internal.codeassist.select.SelectionScanner;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.Initializer;
-import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-public class SelectionTest2 extends AbstractSelectionTest {
-
-public SelectionTest2(String testName) {
- super(testName);
-}
-boolean thereWasAnNPE = false;
-private class SpecialSelectionParser extends SelectionParser {
- public SpecialSelectionParser(ProblemReporter problemReporter) {
- super(problemReporter);
- }
- public void doNPEInParser(){
- this.stack = null;
- }
-}
-
- SpecialSelectionParser createParser(){
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- SpecialSelectionParser parser =
- new SpecialSelectionParser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- options,
- new DefaultProblemFactory(Locale.getDefault())));
- return parser;
-}
-void checkMethodParse(
- SelectionParser parser,
- char[] source,
- int selectionStart,
- int selectionEnd,
- String expectedSelection,
- String expectedUnitToString,
- String expectedSelectionIdentifier,
- String expectedSelectedSource,
-
- String testName) {
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration unit = parser.dietParse(sourceUnit, compilationResult, selectionStart, selectionEnd);
-
- ASTNode foundMethod = null;
- if (unit.types != null) {
- for (int i = 0; i < unit.types.length; i++) {
- TypeDeclaration type = unit.types[i];
- ASTNode method = findMethod(type, selectionStart);
- if (method != null) {
- foundMethod = method;
- break;
- }
- }
- }
- assertTrue("no method found at cursor location", foundMethod != null);
- if (foundMethod instanceof AbstractMethodDeclaration) {
- parser.parseBlockStatements((AbstractMethodDeclaration)foundMethod, unit);
- } else {
- TypeDeclaration type = (TypeDeclaration)foundMethod;
- if (type.fields != null) {
- for (int i = 0; i < type.fields.length; i++) {
- FieldDeclaration field = type.fields[i];
- if (field instanceof Initializer && field.sourceStart <= selectionStart && selectionStart <= field.sourceEnd) {
- parser.parseBlockStatements((Initializer)field, type, unit);
- break;
- }
- }
- }
- }
-
- String computedUnitToString = unit.toString();
- //System.out.println(computedUnitToString);
- //System.out.println(Util.displayString(computedUnitToString));
- //System.out.println(expectedUnitToString);
-
- String computedCompletion = parser.assistNode == null
- ? NONE
- : parser.assistNode.toString();
- assertEquals(
- "invalid selection node-" + testName,
- expectedSelection,
- computedCompletion);
-
- assertEquals(
- "invalid selection location-"+testName,
- expectedUnitToString,
- computedUnitToString);
-
- if (expectedSelectionIdentifier != null){
- char[] chars = ((SelectionScanner)parser.scanner).selectionIdentifier;
- String computedSelectionIdentifier = chars == null ? NONE : new String(chars);
- assertEquals(
- "invalid selection identifier-" + testName,
- expectedSelectionIdentifier,
- computedSelectionIdentifier);
- }
- if (expectedSelectedSource != null){
- char[] chars = null;
- if (parser.assistNode != null){
- chars = CharOperation.subarray(
- parser.scanner.source,
- parser.assistNode.sourceStart,
- parser.assistNode.sourceEnd + 1);
- } else {
- if (parser.assistIdentifier() != null){
- if (((SelectionScanner)parser.scanner).selectionEnd
- >= ((SelectionScanner)parser.scanner).selectionStart){
- chars = CharOperation.subarray(
- parser.scanner.source,
- ((SelectionScanner)parser.scanner).selectionStart,
- ((SelectionScanner)parser.scanner).selectionEnd + 1);
- }
- }
- }
- String computedReplacedSource = chars == null ? NONE : new String(chars);
- assertEquals(
- "invalid replaced source-" + testName,
- expectedSelectedSource,
- computedReplacedSource);
- }
-}
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=30946
- */
-public void testBug30946() {
- final SpecialSelectionParser parser = createParser();
- Thread query = new Thread(
- new Runnable(){
- public void run(){
- String str =
- "public class A {\n" +
- " void foo() {\n" +
- " if (true) {\n" +
- " if()\n" +
- " switch (1) {\n" +
- " case A.B:\n" +
- " C d= (C) s;\n" +
- " here\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}n";
-
- String selection = "here";
-
- String expectedCompletionNodeToString = "<SelectOnName:here>";
-
- String completionIdentifier = "here";
- String expectedUnitDisplayString =
- "public class A {\n" +
- " public A() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " {\n" +
- " C d;\n" +
- " <SelectOnName:here>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "here";
- String testName = "<inifinite loop test>";
-
- int selectionStart = str.lastIndexOf(selection);
- int selectionEnd = str.lastIndexOf(selection) + selection.length() - 1;
-
- try {
- SelectionTest2.this.checkMethodParse(
- parser,
- str.toCharArray(),
- selectionStart,
- selectionEnd,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- } catch (NullPointerException e) {
- SelectionTest2.this.thereWasAnNPE = true;
- }
- }
- });
-
- query.start();
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- }
- // force parser to stop
- parser.doNPEInParser();
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- }
- assertTrue("there is an infinite loop", !thereWasAnNPE);
-
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SingleCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SingleCompletionTest.java
deleted file mode 100644
index afccb6a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SingleCompletionTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.lang.reflect.InvocationTargetException;
-
-import junit.framework.TestCase;
-
-/**
- * Only 1 test should be in this class
- */
-public class SingleCompletionTest extends AbstractCompletionTest {
-/**
- * SingleCompletionTest constructor comment.
- * @param testName java.lang.String
- */
-public SingleCompletionTest(String testName) {
- super(testName);
-}
-private void run(Class testClass, String methodName) {
- try {
- java.lang.reflect.Constructor constructor = testClass.getDeclaredConstructor(new Class[] {String.class});
- TestCase test = (TestCase)constructor.newInstance(new Object[] {"single completion test"});
- java.lang.reflect.Method method = testClass.getDeclaredMethod(methodName, new Class[] {});
- method.invoke(test, new Object[] {});
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- Throwable target = e.getTargetException();
- if (target instanceof RuntimeException) {
- throw (RuntimeException)target;
- }
- if (target instanceof Error) {
- throw (Error)target;
- }
- throw new Error(target.getMessage());
- }
-}
-/*
- * The test.
- */
-public void test() {
- run(NameReferenceCompletionTest.class, "testMethodInvocationAnonymousInnerClass2");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceElementParserTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceElementParserTest.java
deleted file mode 100644
index feafab8..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceElementParserTest.java
+++ /dev/null
@@ -1,5261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Locale;
-
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.internal.compiler.ISourceElementRequestor;
-import org.eclipse.wst.jsdt.internal.compiler.SourceElementParser;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-
-public class SourceElementParserTest extends AbstractCompilerTest implements ISourceElementRequestor {
- private SourceUnit currentUnit;
- private SourceType currentType;
- private SourceMethod currentMethod;
- private SourceField currentField;
- private SourceInitializer currentInitializer;
- private char[] source;
- private SourcePackage currentPackage;
- private SourceImport[] currentImports;
- private int numberOfImports;
-public SourceElementParserTest(String testName) {
- super(testName);
-}
-public SourceElementParserTest(String testName, char[] source) {
- super(testName);
- this.source = source;
-}
-/**
- * acceptConstructorReference method comment.
- */
-public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
- if (currentMethod == null) {
- if (currentType != null) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(typeName).append("(").append(argCount).append(")\n");
- currentType.setDefaultConstructor(buffer.toString());
- }
- return;
- }
- if (currentMethod.isConstructor()) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(typeName).append("(").append(argCount).append(")\n");
- currentMethod.setExplicitConstructorCall(buffer.toString());
- } else {
- if (currentType != null) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(typeName).append("(").append(argCount).append(")\n");
- currentType.setDefaultConstructor(buffer.toString());
- }
- }
-}
-/**
- * acceptFieldReference method comment.
- */
-public void acceptFieldReference(char[] fieldName, int sourcePosition) {}
-/**
- * acceptImport method comment.
- */
-public void acceptImport(
- int declarationStart,
- int declarationEnd,
- char[][] tokens,
- boolean onDemand) {
-
- addImport(
- new SourceImport(declarationStart, declarationEnd, CharOperation.concatWith(tokens, '.'), onDemand, source));
-}
-/**
- * acceptLineSeparatorPositions method comment.
- */
-public void acceptLineSeparatorPositions(int[] positions) {}
-/**
- * acceptMethodReference method comment.
- */
-public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition) {}
-/**
- * acceptPackage method comment.
- */
-public void acceptPackage(
- int declarationStart,
- int declarationEnd,
- char[] name) {
-
- currentPackage =
- new SourcePackage(declarationStart, declarationEnd, name, source);
-}
-/**
- * acceptProblem method comment.
- */
-public void acceptProblem(CategorizedProblem problem) {}
-/**
- * acceptTypeReference method comment.
- */
-public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {}
-/**
- * acceptTypeReference method comment.
- */
-public void acceptTypeReference(char[] typeName, int sourcePosition) {}
-/**
- * acceptUnknownReference method comment.
- */
-public void acceptUnknownReference(char[][] name, int sourceStart, int sourceEnd) {}
-/**
- * acceptUnknownReference method comment.
- */
-public void acceptUnknownReference(char[] name, int sourcePosition) {}
-protected void addImport(SourceImport sourceImport) {
- if (currentImports == null) {
- currentImports = new SourceImport[4];
- }
-
- if (numberOfImports == currentImports.length) {
- System.arraycopy(
- currentImports,
- 0,
- currentImports = new SourceImport[numberOfImports * 2],
- 0,
- numberOfImports);
- }
- currentImports[numberOfImports++] = sourceImport;
-}
-public void dietParse(String s, String testName) {
- this.dietParse(s, testName, false);
-}
-public void dietParse(String s, String testName, boolean recordLocalDeclaration) {
-
-
- this.source = s.toCharArray();
- reset();
- SourceElementParser parser =
- new SourceElementParser(
- this,
- new DefaultProblemFactory(Locale.getDefault()),
- new CompilerOptions(getCompilerOptions()),
- recordLocalDeclaration/*don't record local declarations*/,
- true/*optimize string literals*/);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
-
- parser.parseCompilationUnit(sourceUnit, false);
-
-}
-public static String displayModifiers(int modifiers) {
- StringBuffer buffer = new StringBuffer();
-
- if ((modifiers & ClassFileConstants.AccPublic) != 0)
- buffer.append("public ");
- if ((modifiers & ClassFileConstants.AccProtected) != 0)
- buffer.append("protected ");
- if ((modifiers & ClassFileConstants.AccPrivate) != 0)
- buffer.append("private ");
- if ((modifiers & ClassFileConstants.AccFinal) != 0)
- buffer.append("final ");
- if ((modifiers & ClassFileConstants.AccStatic) != 0)
- buffer.append("static ");
- if ((modifiers & ClassFileConstants.AccAbstract) != 0)
- buffer.append("abstract ");
- if ((modifiers & ClassFileConstants.AccNative) != 0)
- buffer.append("native ");
- return buffer.toString();
-}
-public void enterType(TypeInfo typeInfo) {
- if (currentType == null) {
- // top level type
- currentType =
- new SourceType(
- null,
- typeInfo.declarationStart,
- typeInfo.modifiers,
- typeInfo.name,
- typeInfo.nameSourceStart,
- typeInfo.nameSourceEnd,
- typeInfo.superclass,
- source);
- currentType.setPackage(currentPackage);
- setImports();
- } else {
- // member type
- SourceType memberType;
- currentType.addMemberType(
- memberType =
- new SourceType(
- currentType.getName(),
- typeInfo.declarationStart,
- typeInfo.modifiers,
- typeInfo.name,
- typeInfo.nameSourceStart,
- typeInfo.nameSourceEnd,
- typeInfo.superclass,
- source));
- memberType.parent = currentType;
- currentType = memberType;
- }
-}
-public void enterCompilationUnit() {
- currentUnit=new SourceUnit();
-}
-public void enterConstructor(MethodInfo methodInfo) {
- enterAbtractMethod(methodInfo);
-}
-public void enterField(FieldInfo fieldInfo) {
- if (currentType!=null)
- {
-
- currentType.addField(
- currentField =
- new SourceField(
- fieldInfo.declarationStart,
- fieldInfo.modifiers,
- fieldInfo.type,
- fieldInfo.name,
- fieldInfo.nameSourceStart,
- fieldInfo.nameSourceEnd,
- source));
- }else{
- currentUnit.addField(
- currentField =
- new SourceField(
- fieldInfo.declarationStart,
- fieldInfo.modifiers,
- fieldInfo.type,
- fieldInfo.name,
- fieldInfo.nameSourceStart,
- fieldInfo.nameSourceEnd,
- source));
-
-
- }
-}
-public void enterInitializer(int declarationSourceStart, int modifiers) {
- currentType.addField(
- currentInitializer = new SourceInitializer(
- declarationSourceStart,
- modifiers));
-}
-public void exitInitializer(int declarationSourceEnd) {
- currentInitializer.setDeclarationSourceEnd(declarationSourceEnd);
-}
-public void enterMethod(MethodInfo methodInfo) {
- enterAbtractMethod(methodInfo);
-}
-protected void enterAbtractMethod(MethodInfo methodInfo) {
- if (currentMethod!=null)
- {
- SourceMethod memberMethod;
- currentMethod.addMemberMethod(
- memberMethod =
- new SourceMethod(
- methodInfo.declarationStart,
- methodInfo.modifiers,
- methodInfo.returnType,
- methodInfo.name, // null for constructors
- methodInfo.nameSourceStart,
- methodInfo.nameSourceEnd,
- methodInfo.parameterTypes,
- methodInfo.parameterNames,
- source));
- memberMethod.parent = currentMethod;
- currentMethod = memberMethod;
-
- }
- else if (currentType!=null)
- {
- currentType.addMethod(
- currentMethod =
- new SourceMethod(
- methodInfo.declarationStart,
- methodInfo.modifiers,
- methodInfo.returnType,
- methodInfo.name, // null for constructors
- methodInfo.nameSourceStart,
- methodInfo.nameSourceEnd,
- methodInfo.parameterTypes,
- methodInfo.parameterNames,
- source));
-
- }
- else
- {
- currentUnit.addMethod(
- currentMethod =
- new SourceMethod(
- methodInfo.declarationStart,
- methodInfo.modifiers,
- methodInfo.returnType,
- methodInfo.name, // null for constructors
- methodInfo.nameSourceStart,
- methodInfo.nameSourceEnd,
- methodInfo.parameterTypes,
- methodInfo.parameterNames,
- source));
-
- }
-}
-public void exitType(int declarationEnd) {
- currentType.setDeclarationSourceEnd(declarationEnd);
- if (currentType.parent != null) {
- currentType = currentType.parent;
- }
-}
-public void exitCompilationUnit(int declarationEnd) {}
-public void exitConstructor(int declarationEnd) {
- exitAbstractMethod(declarationEnd);
-}
-public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) {
- currentField.setDeclarationSourceEnd(declarationEnd);
-}
-public void exitMethod(int declarationEnd, int defaultValueStart, int defaultValueEnd) {
- exitAbstractMethod(declarationEnd);
-}
-protected void exitAbstractMethod(int declarationEnd) {
- currentMethod.setDeclarationSourceEnd(declarationEnd);
- currentMethod=currentMethod.parent;
-}
-public void fullParse(String s, String testName) {
- this.fullParse(s, testName, false);
-}
-public void fullParse(String s, String testName, boolean recordLocalDeclaration) {
- this.source = s.toCharArray();
- reset();
- SourceElementParser parser =
- new SourceElementParser(
- this, new DefaultProblemFactory(Locale.getDefault()),
- new CompilerOptions(getCompilerOptions()),
- recordLocalDeclaration/*don't record local declarations*/,
- true/*optimize string literals*/);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
-
- parser.parseCompilationUnit(sourceUnit, true);
-}
-public void reset() {
- currentType = null;
- currentUnit = null;
- currentMethod = null;
- currentField = null;
- currentPackage = null;
- currentImports = null;
- numberOfImports = 0;
-}
-public void setImports() {
- if (currentImports == null)
- return;
- if (numberOfImports != currentImports.length) {
- System.arraycopy(
- currentImports,
- 0,
- currentImports = new SourceImport[numberOfImports],
- 0,
- numberOfImports);
- }
- currentType.setImports(currentImports);
-}
-//public void test00() {
-//
-// String s =
-// "i=0;"
-// + "\n";
-//
-// String expectedUnitToString =
-// "i=0;\n"
-// + " ";
-//
-// String testName = "test00: full parse";
-// fullParse(s,testName);
-////
-//// assertEquals(
-//// "Invalid class declarationSourceStart ",
-//// 52,
-//// currentType.getDeclarationSourceStart());
-////
-//// assertEquals(
-//// "Invalid class declarationSourceEnd ",
-//// 178,
-//// currentType.getDeclarationSourceEnd());
-////
-//// SourceField[] fields = currentType.getFields();
-//// assertTrue(" invalid fields ", fields != null);
-//// assertEquals("Invalid fields length ", 2, fields.length);
-////
-//// assertEquals("Invalid declaration source start for field h", 105, fields[0].getDeclarationSourceStart());
-//// assertEquals("Invalid declaration source end for field h", 117, fields[0].getDeclarationSourceEnd());
-////
-//// assertEquals("Invalid declaration source start for field i", 119, fields[1].getDeclarationSourceStart());
-//// assertEquals("Invalid declaration source end for field i", 144, fields[1].getDeclarationSourceEnd());
-////
-//// SourceMethod[] methods = currentType.getMethods();
-//// assertTrue(" invalid methods ", methods != null);
-//// assertEquals("Invalid methods length ", 3, methods.length);
-////
-//// assertEquals("Invalid declaration source start for method foo", 69, methods[0].getDeclarationSourceStart());
-//// assertEquals("Invalid declaration source end for method foo", 103, methods[0].getDeclarationSourceEnd());
-////
-//// assertEquals("Invalid declaration source start for method bare", 147, methods[1].getDeclarationSourceStart());
-//// assertEquals("Invalid declaration source end for method bare", 163, methods[1].getDeclarationSourceEnd());
-////
-//// assertEquals("Invalid declaration source start for method truc", 164, methods[2].getDeclarationSourceStart());
-//// assertEquals("Invalid declaration source end for method truc", 177, methods[2].getDeclarationSourceEnd());
-////
-//// assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-////
-//// assertEquals(" Invalid actual name for method bare", "bar" + "\\" + "u0065", methods[1].getActualName());
-//
-// assertEquals(
-// "Invalid source " + testName,
-// expectedUnitToString,
-// currentUnit.toString());
-//}
-
-public void test01() {
-
- String s =
- "function foo() {\n"
- + "System.out.println();\n"
- + "}\n"
- + "var h;\n"
- + "var i ;\n"
- + "\n"
- + "function bar" + "\\" + "u0065(){}\n"
- + "function truc(){}\n"
- + "\n";
-
- String expectedUnitToString =
- "\tvar h;\n"
- + "\tvar i;\n"
- + "\tfunction foo() {}\n"
- + "\tfunction bare() {}\n"
- + "\tfunction truc() {}\n"
- + "";
-
- String testName = "test01: full parse";
- fullParse(s,testName);
-
- currentUnit.toString();
- SourceField[] fields = currentUnit.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 41, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h",46 , fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 48, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 54, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentUnit.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 0, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 39, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bare", 57, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bare", 78, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 80, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 96, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bare", "bar" + "\\" + "u0065", methods[1].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentUnit.toString());
-}
-
-
-public void test02() {
-
- String s =
- "/** javadoc comment */\n"
- + "function ss()"
- + "\n";
-
- String expectedUnitToString =
- "\tfunction ss() {}\n"
- + "";
-
- String testName = "test02: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentUnit.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentUnit.toString());
-}
-public void test03() {
-
- String s =
- "function X() {\n"
- + " this.h=1;\n"
- + " this.i=[];\n"
- + "}\n"
- + "function X_foo() {\n"
- + "}\n"
- + "X.prototype.foo=X_foo;\n"
- + "";
-
- String expectedUnitToString =
- "class X extends Object {\n"
- + " var h;\n"
- + " var i;\n"
- + " function foo() {}\n"
- + " function X() {}\n"
- + "}"
- + "";
-
- String testName = "test03: diet parse";
- dietParse(s,testName);
-
-// assertEquals(
-// "Invalid class declarationSourceStart ",
-// 52,
-// currentType.getDeclarationSourceStart());
-//
-// assertEquals(
-// "Invalid class declarationSourceEnd ",
-// 178,
-// currentType.getDeclarationSourceEnd());
-//
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 2, fields.length);
-
-// assertEquals("Invalid declaration source start for field h", 105, fields[0].getDeclarationSourceStart());
-// assertEquals("Invalid declaration source end for field h", 117, fields[0].getDeclarationSourceEnd());
-//
-// assertEquals("Invalid declaration source start for field i", 119, fields[1].getDeclarationSourceStart());
-// assertEquals("Invalid declaration source end for field i", 144, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 2, methods.length);
-
-// assertEquals("Invalid declaration source start for method foo", 69, methods[0].getDeclarationSourceStart());
-// assertEquals("Invalid declaration source end for method foo", 103, methods[0].getDeclarationSourceEnd());
-//
-// assertEquals("Invalid declaration source start for method bar", 147, methods[1].getDeclarationSourceStart());
-// assertEquals("Invalid declaration source end for method bar", 163, methods[1].getDeclarationSourceEnd());
-//
-// assertEquals("Invalid declaration source start for method truc", 164, methods[2].getDeclarationSourceStart());
-// assertEquals("Invalid declaration source end for method truc", 177, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "X_foo", methods[0].getActualName());
- assertEquals(" Invalid name for method foo", "foo", new String(methods[0].getSelector()));
-
-// assertEquals(" Invalid actual name for method bare", "bar" + "\\" + "u0065", methods[1].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test04() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " class L { \n"
- + " void baz(){} \n"
- + " } \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tpublic int h;\n"
- + "\tpublic int[] i;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
- String testName = "test04: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 89,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 372,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 248, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 260, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 271, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 296, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 115, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 222, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 317, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 337, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 339, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 360, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test05() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " class L { \n"
- + " void baz(){} \n"
- + " } \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tpublic int h;\n"
- + "\tpublic int[] i;\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test05: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 89,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 372,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 248, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 260, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 271, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 296, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 115, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 222, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 317, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 337, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 339, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 360, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test06() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " X x; \n"
- + " Object a, b = null; \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tX x;\n"
- + "\tObject a;\n"
- + "\tObject b;\n"
- + "\tpublic int h;\n"
- + "\tpublic int[] i;\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test06: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 89,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 347,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 5, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 115, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 118, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field a", 131, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field a", 139, fields[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field b", 131, fields[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field b", 149, fields[2].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field h", 223, fields[3].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 235, fields[3].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 246, fields[4].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 271, fields[4].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 159, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 221, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 292, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 312, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 314, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 335, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test07() {
-
- String s =
- "package a; \n"
- + "import java.lang.*; \n"
- + "import java.util.*; \n"
- + " \n"
- + "public class X { \n"
- + " X x; \n"
- + " Object a, b = null; \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " \n"
- + " public int h; \n"
- + " public int[] i = { 0, 1 }; \n"
- + " \n"
- + " void bar(){ \n"
- + " void truc(){ \n"
- + "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tX x;\n"
- + "\tObject a;\n"
- + "\tObject b;\n"
- + "\tpublic int h;\n"
- + "\tpublic int[] i;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test07: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 89,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 347,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 5, fields.length);
-
- assertEquals("Invalid declaration source start for field xh", 115, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 118, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field a", 131, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field a", 139, fields[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field b", 131, fields[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field b", 149, fields[2].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field h", 223, fields[3].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 235, fields[3].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 246, fields[4].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 271, fields[4].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 159, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 221, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 292, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 312, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 314, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 335, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test08() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " void baz(){} \n"
- + " } \n"
- + " \n"
- + " void bar(){ \n"
- + " } \n"
- + " void truc(){ \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test08: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 198,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 100, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 127, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 149, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 163, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 185, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test09() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " void baz(){} \n"
- + " } \n"
- + " \n"
- + " void bar(){ \n"
- + " } \n"
- + " void truc(){ \n"
- + " } \n"
- + "} \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test09: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 198,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 100, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 127, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 149, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 163, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 185, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test10() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " void baz(){} \n"
- + " } \n"
- + " /** comment \n"
- + " * \n"
- + " * \n"
- + " */ \n"
- + " \n"
- + " void bar(){ \n"
- + " } \n"
- + " void truc(){ \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test10: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 415,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 100, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 114, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 366, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 380, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 402, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test11() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " void baz(){} \n"
- + " /** comment \n"
- + " * \n"
- + " * \n"
- + " */ \n"
- + " int[][] j[] = null, k; // comment \n"
- + " \n"
- + " void bar(){ \n"
- + " } \n"
- + " void truc(){ \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint[][][] j;\n"
- + "\tint[][] k;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid baz() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test11: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 449,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
-
- assertEquals("Invalid declaration source start for field j", 102, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field j", 305, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field k", 102, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field k", 308, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 4, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 76, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 79, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 90, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 378, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 400, methods[2].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 414, methods[3].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 436, methods[3].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[2].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[3].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test12() {
-
- String s =
- "import java.util.Enumeration;\n"
- + "import java.util.Hashtable;"
- + "\n"
- + "/** comment */\n"
- + "public class A2 {\n"
- + " void foo() {\n"
- + " System.out.println();\n"
- + " void baz(){}\n"
- + " /** comment\n"
- + " *\n"
- + " *\n"
- + " */\n"
- + " static { } // comment\n"
- + " \n"
- + "\n"
- + " void bar(){\n"
- + " }\n"
- + " void truc(){\n"
- + " }\n"
- + "}\n";
-
- String expectedUnitToString =
- "import java.util.Enumeration;\n"
- + "import java.util.Hashtable;\n"
- + "public class A2 {\n"
- + "\tstatic {}\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid baz() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test12: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 58,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 231,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for initializer", 145, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 181, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 4, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 92, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 128, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 131, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 142, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 183, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 212, methods[2].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 215, methods[3].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 229, methods[3].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[2].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[3].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test13() {
-
- String s =
- "import java.util.Enumeration;\n"
- + "import java.util.Hashtable;\n"
- + "\n"
- + "public class A2 {\n"
- + " void foo() {\n"
- + " System.out.println();\n"
- + " void baz(){}\n"
- + " static { }\n"
- + " \n"
- + "\n"
- + " void bar(){\n"
- + " }\n"
- + " void truc(){\n"
- + " }\n"
- + "}\n";
-
- String expectedUnitToString =
- "import java.util.Enumeration;\n"
- + "import java.util.Hashtable;\n"
- + "public class A2 {\n"
- + "\tstatic {}\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid baz() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
- String testName = "test13: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 59,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 180,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
-
- assertEquals(" invalid fields length", 1, fields.length);
-
- assertEquals("Invalid declaration source start for initializer", 132, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 141, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 4, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 78, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 114, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 117, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 128, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 148, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 161, methods[2].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 164, methods[3].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 178, methods[3].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[2].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[3].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test14() {
-
- String s =
- "import java.util.Enumeration;\n"
- + "import java.util.Hashtable;\n"
- + "\n"
- + "public class A2 {\n"
- + " void foo() {\n"
- + " System.out.println();\n"
- + " void baz(){}\n"
- + " static { }\n"
- + " }\n"
- + "\n"
- + " void bar(){\n"
- + " }\n"
- + " void truc(){\n"
- + " }\n"
- + "}\n";
-
- String expectedUnitToString =
- "import java.util.Enumeration;\n"
- + "import java.util.Hashtable;\n"
- + "public class A2 {\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test14: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 59,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 180,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("Invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 78, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 144, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 148, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 161, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 164, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 178, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test15() {
-
- String s =
- "public class X { \n"
- + " class Y { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " public int h; \n"
- + " public int[] i = {0, 1}; \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tpublic int h;\n"
- + "\t\tpublic int[] i;\n"
- + "\t\tjava.lang.Object(0)\n"
- + "\t\tvoid foo() {}\n"
- + "\t\tvoid bar() {}\n"
- + "\t\tvoid baz() {}\n"
- + "\t}\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test15: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 227,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals(" invalid members length ", 1, members.length);
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 117, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 129, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 140, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 163, fields[1].getDeclarationSourceEnd());
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 48, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 103, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 171, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 191, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 193, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 215, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[2].getActualName());
-
- SourceType member = members[0];
- assertEquals(
- "Invalid class declarationSourceStart ",
- 26,
- member.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 227,
- member.getDeclarationSourceEnd());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test16() {
-
- String s =
- "public class X { \n"
- + " class Y { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " public int h; \n"
- + " public int[] i = {0, 1}; \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tpublic int h;\n"
- + "\t\tpublic int[] i;\n"
- + "\t\tvoid foo() {}\n"
- + "\t\tvoid bar() {}\n"
- + "\t\tvoid baz() {}\n"
- + "\t}\n"
- + "}";
-
- String testName = "test16: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 227,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals(" invalid members length ", 1, members.length);
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 117, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 129, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 140, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 163, fields[1].getDeclarationSourceEnd());
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid methods length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 48, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 103, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 171, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 191, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 193, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 215, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[2].getActualName());
-
- SourceType member = members[0];
- assertEquals(
- "Invalid class declarationSourceStart ",
- 26,
- member.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 227,
- member.getDeclarationSourceEnd());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test17() {
-
- String s =
- "public class X { \n"
- + " class Y { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " public int h; \n"
- + " public int[] i = {0, 1}; \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tjava.lang.Object(0)\n"
- + "\t\tvoid foo() {}\n"
- + "\t}\n"
- + "\tpublic int h;\n"
- + "\tpublic int[] i;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid bar() {}\n"
- + "\tvoid baz() {}\n"
- + "}";
-
- String testName = "test17: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 241,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 131, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 143, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 154, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 177, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method bar", 185, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 205, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 207, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 229, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals(" invalid members length ", 1, members.length);
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields == null);
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid methods length ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 48, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 103, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType member = members[0];
- assertEquals(
- "Invalid class declarationSourceStart ",
- 26,
- member.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 117,
- member.getDeclarationSourceEnd());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test18() {
-
- String s =
- "public class X { \n"
- + " class Y { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " public int h; \n"
- + " public int[] i = {0, 1}; \n"
- + " void bar(){ \n"
- + " void baz(){ \n"
- + " } \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tvoid foo() {}\n"
- + "\t}\n"
- + "\tpublic int h;\n"
- + "\tpublic int[] i;\n"
- + "\tvoid bar() {}\n"
- + "\tvoid baz() {}\n"
- + "}";
-
- String testName = "test18: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 241,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 131, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 143, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 154, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 177, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method bar", 185, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 205, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 207, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 229, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals(" invalid members length ", 1, members.length);
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields == null);
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid methods length ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 48, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 103, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType member = members[0];
- assertEquals(
- "Invalid class declarationSourceStart ",
- 26,
- member.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 117,
- member.getDeclarationSourceEnd());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test19() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n"
- + " void bar(){ \n"
- + " int x; \n"
- + " void baz(){ \n"
- + " } \n"
- + " int y; \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\t{}\n"
- + "\tint y;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid baz() {}\n"
- + "}";
-
- String testName = "test19: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 197,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for initializer", 90, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 90, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field y", 181, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 186, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 26, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 77, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 104, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 143, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 145, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 167, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test20() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n"
- + " void bar(){ \n"
- + " public int x; \n"
- + " void baz(){ \n"
- + " } \n"
- + " int y; \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\t{}\n"
- + "\tpublic int x;\n"
- + "\tint y;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid baz() {}\n"
- + "}";
-
- String testName = "test20: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 201,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 3, fields.length);
-
- assertEquals("Invalid declaration source start for initializer", 90, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 90, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field x", 126, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 138, fields[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field y", 185, fields[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 190, fields[2].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 26, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 77, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 104, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 124, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 149, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 171, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test21() {
-
- String s =
- "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n"
- + " void bar(){ \n"
- + " public int x; \n"
- + " void baz(){ \n"
- + " } \n"
- + " int y; \n";
-
-
- String expectedUnitToString =
- "public class X {\n"
- + "\t{}\n"
- + "\tpublic int x;\n"
- + "\tint y;\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid baz() {}\n"
- + "}";
-
- String testName = "test21: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 201,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 3, fields.length);
-
- assertEquals("Invalid declaration source start for initializer", 90, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 90, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field x", 126, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 138, fields[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field y", 185, fields[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 190, fields[2].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 26, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 77, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 104, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 124, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method baz", 149, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method baz", 171, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method baz", "baz", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test22() {
-
- String s =
- "public class X extends { \n"
- + " void foo() { \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "}";
-
- String testName = "test22: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 67,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 32, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 54, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test23() {
-
- String s =
- "public class X extends Thread { \n"
- + " void foo() throws \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X extends Thread {\n"
- + "\tThread(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "}";
-
- String testName = "test23: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 98,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 37, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 61, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 63, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 85, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test24() {
-
- String s =
- "public class X implements \n"
- + " void foo() \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "}";
-
- String testName = "test24: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 91,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 34, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 54, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 56, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 78, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test25() {
-
- String s =
- "public class X implements Y, \n"
- + " void foo() \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X implements Y, {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "}";
-
- String testName = "test25: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 92,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" invalid fields length ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 35, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 55, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 57, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 79, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test26() {
-
- String s =
- "public class X implements \n"
- + " class Y { \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tjava.lang.Object(0)\n"
- + "\t\tvoid bar() {}\n"
- + "\t}\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test26: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 102,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals(" contains one member ", 1, members.length);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 34,
- members[0].getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 90,
- members[0].getDeclarationSourceEnd());
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one method ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method bar", 56, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 77, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[0].getActualName());
-
- members = members[0].getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test27() {
-
- String s =
- "public class X \n"
- + " fieldX; \n"
- + " class Y { \n"
- + " void bar() \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tjava.lang.Object(0)\n"
- + "\t\tvoid bar() {}\n"
- + "\t}\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test27: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 113,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals(" contains one member ", 1, members.length);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 45,
- members[0].getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 101,
- members[0].getDeclarationSourceEnd());
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one method ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method bar", 67, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 88, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[0].getActualName());
-
- members = members[0].getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test28() {
-
- String s =
- "public class X \n"
- + " fieldX; \n"
- + " class Y \n"
- + " } \n"
- + "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tjava.lang.Object(0)\n"
- + "\t}\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test28: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 78,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals(" contains one member ", 1, members.length);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 45,
- members[0].getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 65,
- members[0].getDeclarationSourceEnd());
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- members = members[0].getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test29() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " class L extends { \n" +
- " public int l; \n" +
- " void baz(){} \n" +
- " } \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tpublic int h;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test29: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 88,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 357,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 276, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 288, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains 3 methods ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 114, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 250, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 312, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 332, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 334, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 355, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test30() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " class L extends { \n" +
- " public int l; \n" +
- " void baz(){} \n" +
- " } \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tpublic int h;\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test30: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 88,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 357,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 276, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 288, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains 3 methods ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 114, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 250, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 312, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 332, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 334, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 355, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test31() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " new X(){ \n" +
- " void baz() {} \n" +
- " }.baz(); \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tpublic int h;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test31: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 89,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 334,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 253, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 265, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains 3 methods ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 115, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 251, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 289, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 309, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 311, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 332, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test32() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " new X(){ \n" +
- " void baz() {} \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "}";
-
- String testName = "test32: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 89,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 315,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one methods ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 115, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 315, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test33() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " new X(){ \n" +
- " void baz() {} \n" +
- " \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tvoid foo() {}\n"
- + "}";
-
- String testName = "test33: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 89,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 315,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one methods ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 115, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 315, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test34() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " new X(){ \n" +
- " void baz() \n" +
- " } \n" +
- " } \n" +
- " public int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tpublic int h;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test34: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 88,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 342,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field h", 250, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field h", 262, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains 3 methods ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 114, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 236, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 286, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 306, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 308, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 329, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test35() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " class L extends { \n" +
- " public int l; \n" +
- " void baz(){} \n" +
- " } \n" +
- " \n" +
- " int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test35: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 76,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 309,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains 3 methods ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 99, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 260, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 262, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 279, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 281, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 299, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test36() {
-
- String s =
- "package a; \n" +
- "import java.lang.*; \n" +
- "import java.util.*; \n" +
- " \n" +
- "public class X { \n" +
- " void foo() { \n" +
- " System.out.println(); \n" +
- " \n" +
- " class L extends { \n" +
- " public int l; \n" +
- " void baz(){} \n" +
- " } \n" +
- " \n" +
- " int h; \n" +
- " \n" +
- " void bar(){ \n" +
- " void truc(){ \n" +
- "} \n";
-
- String expectedUnitToString =
- "package a;\n"
- + "import java.lang.*;\n"
- + "import java.util.*;\n"
- + "public class X {\n"
- + "\tvoid foo() {}\n"
- + "\tvoid bar() {}\n"
- + "\tvoid truc() {}\n"
- + "}";
-
- String testName = "test36: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 76,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 309,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains 3 methods ", 3, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 99, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 260, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 262, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 279, methods[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method truc", 281, methods[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method truc", 299, methods[2].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- assertEquals(" Invalid actual name for method truc", "truc", methods[2].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test37() {
-
- String s =
- "public class X { \n" +
- " int x; \n" +
- " \n" +
- " int foo(){ } \n" +
- " \n" +
- " class Y { \n" +
- " int y; \n" +
- "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tint y;\n"
- + "\t\tjava.lang.Object(0)\n"
- + "\t}\n"
- + "\tint x;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test37: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 112,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 23, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 28, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one methods ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 46, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 57, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals("contains one member ", 1, members.length);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 73,
- members[0].getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 104,
- members[0].getDeclarationSourceEnd());
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field y", 92, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 97, fields[0].getDeclarationSourceEnd());
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test38() {
-
- String s =
- "public class X { \n" +
- " int x; \n" +
- " \n" +
- " int foo(){ } \n" +
- " \n" +
- " class Y { \n" +
- " int y; \n" +
- "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tint y;\n"
- + "\t}\n"
- + "\tint x;\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test38: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 112,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 23, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 28, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one methods ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 46, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 57, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals("contains one member ", 1, members.length);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 73,
- members[0].getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 104,
- members[0].getDeclarationSourceEnd());
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field y", 92, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 97, fields[0].getDeclarationSourceEnd());
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test39() {
-
- String s =
- "public class X { \n" +
- " int x; \n" +
- " \n" +
- " int foo(){ } \n" +
- " \n" +
- " class Y \n" +
- "} \n" +
- " int y; \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t\tjava.lang.Object(0)\n"
- + "\t}\n"
- + "\tint x;\n"
- + "\tint y;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test39: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 109,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 23, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 28, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field y", 98, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 103, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one methods ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 46, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 57, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals("contains one member ", 1, members.length);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 73,
- members[0].getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 87,
- members[0].getDeclarationSourceEnd());
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields == null);
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test40() {
-
- String s =
- "public class X { \n" +
- " int x; \n" +
- " \n" +
- " int foo(){ } \n" +
- " \n" +
- " class Y \n" +
- "} \n" +
- " int y; \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tclass Y {\n"
- + "\t}\n"
- + "\tint x;\n"
- + "\tint y;\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test40: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 109,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("contains one field ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 23, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 28, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field y", 98, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 103, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one methods ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 46, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 57, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members != null);
- assertEquals("contains one member ", 1, members.length);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 73,
- members[0].getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 87,
- members[0].getDeclarationSourceEnd());
-
- fields = members[0].getFields();
- assertTrue(" invalid fields ", fields == null);
-
- methods = members[0].getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test41() {
-
- String s =
- "public class X { \n"+
- " void hell" + "\\" + "u006f()\n"+
- " static void foo() { \n"+
- " X x; \n"+
- " x = new X(23); \n"+
- " System.out.println(); \n"+
- " \n"+
- "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tvoid hello() {}\n"
- + "\tstatic void foo() {}\n"
- + "}";
-
- String testName = "test41: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 139,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals(" contains one methods ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method hello", 22, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method hello", 39, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method foo", 41, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 130, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method hello", "hell" + "\\" + "u006f", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test42() {
-
- String s =
- "public class X { \n" +
- " int x \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test42: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 29,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" contains one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 20, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 24, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test43() {
-
- String s =
- "public class X { \n" +
- " int x \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "}";
-
- String testName = "test43: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 29,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" contains one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 20, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 24, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test44() {
-
- String s =
- "public class X { \n" +
- " int x, y \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "\tint y;\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test44: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 31,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" contains one field", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 20, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 25, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field y", 20, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 27, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test45() {
-
- String s =
- "public class X { \n" +
- " int x, y \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "\tint y;\n"
- + "}";
-
- String testName = "test45: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 31,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" contains one field", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 20, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 25, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field y", 20, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 27, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test46() {
-
- String s =
- "public class X { \n" +
- " String s = \" \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tString s;\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test46: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 34,
- currentType.getDeclarationSourceEnd());
-
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" contains one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 20, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 34, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test47() {
-
- String s =
- "public class X { \n" +
- " String s = \" \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tString s;\n"
- + "}";
-
- String testName = "test47: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 34,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" contains one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 20, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 34, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test48() {
-
- String s =
- "public class X implements Y, \n" +
- " String s = \" \n";
-
- String expectedUnitToString =
- "public class X implements Y, String, {\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test48: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 50,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test49() {
-
- String s =
- "public class X implements Y, \n" +
- " String s = \" \n";
-
- String expectedUnitToString =
- "public class X implements Y, String, {\n"
- + "}";
-
- String testName = "test49: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 50,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test50() {
-
- String s =
- "public class X implements \n"+
- "int x \n"+
- "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test50: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 42,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 29, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 33, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test51() {
-
- String s =
- "public class X implements \n"+
- "int x \n"+
- "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "}";
-
- String testName = "test51: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 42,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 29, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 33, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test52() {
-
- String s =
- "public class X public int foo(int bar(static String s";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tstatic String s;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tpublic int foo() {}\n"
- + "\tint bar() {}\n"
- + "}";
-
- String testName = "test52: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 52,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 38, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 52, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
-
- assertEquals("Invalid declaration source start for method foo", 15, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 29, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 30, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 37, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test53() {
-
- String s =
- "public class X public int foo(int x, int bar public String s;";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tpublic String s;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tpublic int foo(int x, int bar, ) {}\n"
- + "}";
-
- String testName = "test53: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 60,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 45, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 60, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has one method ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 15, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 44, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test54() {
-
- String s =
- "public class X \n" +
- " public int foo( \n" +
- " int bar( \n" +
- " static String s, int x \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tstatic String s;\n"
- + "\tint x;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tpublic int foo() {}\n"
- + "\tint bar() {}\n"
- + "}";
-
- String testName = "test54: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 78,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has 2 fields ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 55, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 70, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field x", 72, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 76, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has 2 methods ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 20, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 38, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 40, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 52, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test55() {
-
- String s =
- "public class X \n" +
- " public int foo( \n" +
- " int bar( \n" +
- " static String s, int x \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tstatic String s;\n"
- + "\tint x;\n"
- + "\tpublic int foo() {}\n"
- + "\tint bar() {}\n"
- + "}";
-
- String testName = "test55: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 78,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has 2 fields ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 55, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 70, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field x", 72, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 76, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has 2 methods ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 20, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 38, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method bar", 40, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method bar", 52, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method bar", "bar", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test56() {
-
- String s =
- "class X { \n" +
- " String s; \n" +
- " \n" +
- " public void foo( \n" +
- " static int x \n" +
- "} \n";
-
-
- String expectedUnitToString =
- "class X {\n"
- + "\tString s;\n"
- + "\tstatic int x;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tpublic void foo() {}\n"
- + "}";
-
- String testName = "test56: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 75,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has 2 fields ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 16, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 24, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field x", 60, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 71, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has 1 method ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 39, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 57, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test57() {
-
- String s =
- "class X { \n" +
- " String s; \n" +
- " \n" +
- " public void foo( \n" +
- " static int x \n" +
- "} \n";
-
-
- String expectedUnitToString =
- "class X {\n"
- + "\tString s;\n"
- + "\tstatic int x;\n"
- + "\tpublic void foo() {}\n"
- + "}";
-
- String testName = "test57: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 75,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has 2 fields ", 2, fields.length);
-
- assertEquals("Invalid declaration source start for field s", 16, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field s", 24, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field x", 60, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 71, fields[1].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has 1 method ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 39, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 57, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test58() {
-
- String s =
- "public class X { \n"+
- " int foo(){ \n"+
- " String s = \" \n"+
- " } \n"+
- "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test58: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 62,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has 1 method ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 21, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 54, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test59() {
-
- String s =
-
- "class X { \n" +
- " int foo(AA a, BB b, IOEx \n" +
- " \n";
-
- String expectedUnitToString =
- "class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tint foo(AA a, BB b, ) {}\n"
- + "}";
-
- String testName = "test59: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 60,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has 1 method ", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 20, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 60, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test60() {
-
- String s =
- "public class X { \n"+
- " final static int foo(){ \n"+
- " return \"1; \n"+
- " } \n"+
- " public static void main(String argv[]){ \n"+
- " foo(); \n"+
- " } \n"+
- "} \n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tfinal static int foo() {}\n"
- + "\tpublic static void main(String[] argv, ) {}\n"
- + "}";
-
- String testName = "test60: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 161,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has 1 method ", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 25, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 75, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method main", 89, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method main", 148, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method main", "main", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test61() {
-
- String s =
- "public class X { \n"+
- " { \n"+
- " int x;";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\t{}\n"
- + "\tjava.lang.Object(0)\n"
- + "}";
-
- String testName = "test61: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 47,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
-
- assertEquals("Invalid declaration source start for initializer", 25, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 47, fields[0].getDeclarationSourceEnd());
-
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test62() {
-
- String s =
- "public class X { \n"+
- " int foo(){ \n"+
- " if(true){ \n"+
- " int x;";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tjava.lang.Object(0)\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test62: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 78,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has one method", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 78, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test63() {
-
- String s =
- "public class X { \n"+
- " int foo(){} \n"+
- "} \n"+
- "int x;\n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "\tjava.lang.Object(0)\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test63: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 66,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 60, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 65, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has one method", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 37, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test64() {
-
- String s =
- "public class X { \n"+
- " int foo(){} \n"+
- "} \n"+
- "int x;\n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tint x;\n"
- + "\tint foo() {}\n"
- + "}";
-
- String testName = "test64: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 66,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field x", 60, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field x", 65, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has one method", 1, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 37, methods[0].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test65() {
-
- String s =
- "public class X { \n"+
- " int foo(){} \n"+
- "} \n"+
- "int x();\n";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\t{}\n"
- + "\tint foo() {}\n"
- + "\tint x() {}\n"
- + "}";
-
- String testName = "test65: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 68,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for initializer", 47, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 47, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has two methods", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 37, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method x", 60, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method x", 67, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test66() {
-
- String s =
- "public interface X { \n"+
- " int foo() {}; \n"+
- "} \n"+
- "int x();\n";
-
- String expectedUnitToString =
- "public interface X {\n"
- + "\t{}\n"
- + "\tint foo() {}\n"
- + "\tint x() {}\n"
- + "}";
-
- String testName = "test66: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 72,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals(" invalid fields length ", 1, fields.length);
-
- assertEquals("Invalid declaration source start for initializer", 51, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 51, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has two methods", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 30, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 41, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method x", 64, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method x", 71, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test67() {
-
- String s =
- "public interface X { \n"+
- " int foo() {}; \n"+
- " int x(); \n"+
- "}";
-
- String expectedUnitToString =
- "public interface X {\n"
- + "\tint foo() {}\n"
- + "\tint x() {}\n"
- + "}";
-
- String testName = "test67: diet parse";
- dietParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 71,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has two methods", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 30, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 41, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method x", 54, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method x", 61, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test68() {
-
- String s =
- "public interface X { \n"+
- " int foo() {}; \n"+
- " int x(); \n"+
- "}";
-
- String expectedUnitToString =
- "public interface X {\n"
- + "\tint foo() {}\n"
- + "\tint x() {}\n"
- + "}";
-
- String testName = "test68: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 71,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has two methods", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 30, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 41, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method x", 54, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method x", 61, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test69() {
-
- String s =
- "public interface X { \n"+
- "float y; \n"+
- " int foo() ; \n"+
- " int x(); \n"+
- "}";
-
- String expectedUnitToString =
- "public interface X {\n"
- + "\tfloat y;\n"
- + "\tint foo() {}\n"
- + "\tint x() {}\n"
- + "}";
-
- String testName = "test69: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 87,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field y", 27, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field y", 34, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has two methods", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 48, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 58, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method x", 70, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method x", 77, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test70() {
-
- String s =
- "public interface X { \n"+
- " int foo(); \n"+
- " int x(); \n"+
- "}";
-
- String expectedUnitToString =
- "public interface X {\n"
- + "\tint foo() {}\n"
- + "\tint x() {}\n"
- + "}";
-
- String testName = "test70: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 69,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields == null);
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has two methods", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 30, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 39, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method x", 52, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method x", 59, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test71() {
-
- String s =
- "public interface X { \n"+
- " int[] i = ; \n"+
- " int foo() {} \n"+
- " int x(); \n"+
- "}";
-
- String expectedUnitToString =
- "public interface X {\n"
- + "\tint[] i;\n"
- + "\tint foo() {}\n"
- + "\tint x() {}\n"
- + "}";
-
- String testName = "test71: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 93,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue(" invalid fields ", fields != null);
- assertEquals("has one field", 1, fields.length);
-
- assertEquals("Invalid declaration source start for field i", 30, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field i", 49, fields[0].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods != null);
- assertEquals("has two methods", 2, methods.length);
-
- assertEquals("Invalid declaration source start for method foo", 53, methods[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method foo", 64, methods[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for method x", 76, methods[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for method x", 83, methods[1].getDeclarationSourceEnd());
-
- assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName());
-
- assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName());
-
- SourceType[] members = currentType.getMemberTypes();
- assertTrue(" invalid members ", members == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test72() {
-
- String s =
- "public class X { \n"+
- " X() { \n" +
- " this(); \n" +
- " } \n" +
- "}";
-
- String expectedUnitToString =
- "public class X {\n"
- + "\tX() {\n"
- + "\t\tX(0)\n"
- + "\t}\n"
- + "}";
-
- String testName = "test72: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test73() {
-
- String s =
- "public class X extends Toto { \n"+
- " X() { \n" +
- " this(); \n" +
- " } \n" +
- " X(int i) { \n" +
- " super(); \n" +
- " } \n" +
- " X() { \n" +
- " this(0); \n" +
- " } \n" +
- "}";
-
- String expectedUnitToString =
- "public class X extends Toto {\n"
- + "\tX() {\n"
- + "\t\tX(0)\n"
- + "\t}\n"
- + "\tX(int i, ) {\n"
- + "\t\tToto(0)\n"
- + "\t}\n"
- + "\tX() {\n"
- + "\t\tX(1)\n"
- + "\t}\n"
- + "}";
-
- String testName = "test73: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test74() {
-
- String s =
- "public class X extends Toto { \n"+
- " class Y extends Throwable { \n" +
- " } \n" +
- " X() { \n" +
- " this(); \n" +
- " } \n" +
- " X(int i) { \n" +
- " super(); \n" +
- " } \n" +
- " X() { \n" +
- " this(0); \n" +
- " } \n" +
- " public Object foo(int i) { \n" +
- " return new Object() {}; \n" +
- " } \n" +
- "}";
-
- String expectedUnitToString =
- "public class X extends Toto {\n"
- + "\tclass Y extends Throwable {\n"
- + "\t\tThrowable(0)\n"
- + "\t}\n"
- + "\tX() {\n"
- + "\t\tX(0)\n"
- + "\t}\n"
- + "\tX(int i, ) {\n"
- + "\t\tToto(0)\n"
- + "\t}\n"
- + "\tX() {\n"
- + "\t\tX(1)\n"
- + "\t}\n"
- + "\tpublic Object foo(int i, ) {}\n"
- + "}";
-
- String testName = "test74: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-/*
- * bugs 16126
- */
-public void test75() {
- String s =
- "public class P#AField {\n" +
- " public void setP#A(String P#A) {\n" +
- " this.P#A = P#A;\n" +
- " }\n" +
- "}";
-
- String expectedUnitToString =
- "public class P {\n" +
- " {}\n" +
- " public void setP;\n" +
- " java.lang.Object(0)\n" +
- " A(String P, ) {}\n" +
- "}";
-
- String testName = "test75: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-public void test76() {
-
- String s =
- "class X {\n" +
- " public static int j = 0;\n" +
- " /* static */ {\n" +
- " }" +
- " public static int i = 9;\n" +
- "}\n";
-
- String expectedUnitToString =
- "class X {\n" +
- " public static int j;\n" +
- " {}\n" +
- " public static int i;\n" +
- " java.lang.Object(0)\n" +
- "}";
-
- String testName = "test76: full parse";
- fullParse(s,testName);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentType.getDeclarationSourceStart());
-
- assertEquals(
- "Invalid class declarationSourceEnd ",
- 84,
- currentType.getDeclarationSourceEnd());
-
- SourceField[] fields = currentType.getFields();
- assertTrue("invalid fields ", fields != null);
- assertEquals("Invalid fields length ", 3, fields.length);
-
- assertEquals("Invalid declaration source start for field j", 12, fields[0].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for field j", 35, fields[0].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for initializer", 39, fields[1].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end for initializer", 56, fields[1].getDeclarationSourceEnd());
-
- assertEquals("Invalid declaration source start for field i", 59, fields[2].getDeclarationSourceStart());
- assertEquals("Invalid declaration source end field i", 82, fields[2].getDeclarationSourceEnd());
-
- SourceMethod[] methods = currentType.getMethods();
- assertTrue(" invalid methods ", methods == null);
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-/**
- * Bug 99662:[1.5] JavaModel returns inexistent IType for package-info ICompilationUnits
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=99662"
- *
- */
-public void testBug99662() {
-
- String s =
- "@Deprecated\n" +
- "package p;\n";
-
- String testName = "package-info.java";
- fullParse(s,testName);
-
- assertNull("package-info.java file should not have ANY type!", this.currentType);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167357
-public void _test77() {
-
- String s =
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " String s = null;\n" +
- " {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}";
-
- String expectedUnitToString =
- "public class X implements Y, String, {\n"
- + "}";
-
- String testName = "test77: diet parse";
- dietParse(s,testName, true);
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=167357
-public void _test78() {
- String s =
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " String s = null;\n" +
- " {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}";
-
- String expectedUnitToString =
- "public class X implements Y, String, {\n"
- + "}";
-
- String testName = "test78: full parse";
- fullParse(s,testName, true);
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=167357
-public void _test79() {
-
- String s =
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " String s = null;\n" +
- " }\n" +
- " }\n" +
- "}";
-
- String expectedUnitToString =
- "public class X implements Y, String, {\n"
- + "}";
-
- String testName = "test79: diet parse";
- dietParse(s,testName, true);
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=167357
-public void _test80() {
-
- String s =
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " String s = null;\n" +
- " }\n" +
- " }\n" +
- "}";
-
- String expectedUnitToString =
- "public class X implements Y, String, {\n"
- + "}";
-
- String testName = "test80: full parse";
- fullParse(s,testName, true);
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentType.toString());
-}
-
-
-public void testInnerMethod01() {
-
- String s =
- "function ss() {\n"
- + "function ins() {}\n"
- + "}\n"
- + "\n";
-
- String expectedUnitToString =
- "\tfunction ss() {\n"
- + "\t\tfunction ins() {}\n"
- + "\t}"
- + "\n";
-
- String testName = "testInnerMethod01";
- fullParse(s,testName,true);
-
- assertEquals(
- "Invalid class declarationSourceStart ",
- 0,
- currentUnit.getDeclarationSourceStart());
-
-// assertEquals(
-// "Invalid class declarationSourceEnd ",
-// 40,
-// currentUnit.getDeclarationSourceEnd());
-
- assertEquals(
- "Invalid source " + testName,
- expectedUnitToString,
- currentUnit.toString());
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceField.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceField.java
deleted file mode 100644
index e14ed1e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceField.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.env.ISourceField;
-
-public class SourceField implements ISourceField {
- protected int modifiers;
- protected char[] typeName;
- protected char[] name;
- protected int declarationStart;
- protected int declarationEnd;
- protected int nameSourceStart;
- protected int nameSourceEnd;
- protected char[] source;
-public SourceField(
- int declarationStart,
- int modifiers,
- char[] typeName,
- char[] name,
- int nameSourceStart,
- int nameSourceEnd,
- char[] source) {
-
- this.declarationStart = declarationStart;
- this.modifiers = modifiers;
- this.typeName = typeName;
- this.name = name;
- this.nameSourceStart = nameSourceStart;
- this.nameSourceEnd = nameSourceEnd;
- this.source = source;
-}
-public String displayModifiers() {
- StringBuffer buffer = new StringBuffer();
-
- if (this.modifiers == 0)
- return null;
- if ((this.modifiers & ClassFileConstants.AccPublic) != 0)
- buffer.append("public ");
- if ((this.modifiers & ClassFileConstants.AccProtected) != 0)
- buffer.append("protected ");
- if ((this.modifiers & ClassFileConstants.AccPrivate) != 0)
- buffer.append("private ");
- if ((this.modifiers & ClassFileConstants.AccFinal) != 0)
- buffer.append("final ");
- if ((this.modifiers & ClassFileConstants.AccStatic) != 0)
- buffer.append("static ");
- if ((this.modifiers & ClassFileConstants.AccAbstract) != 0)
- buffer.append("abstract ");
- if ((this.modifiers & ClassFileConstants.AccNative) != 0)
- buffer.append("native ");
- return buffer.toString();
-}
-public String getActualName() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(source, nameSourceStart, nameSourceEnd - nameSourceStart + 1);
- return buffer.toString();
-}
-public int getDeclarationSourceEnd() {
- return declarationEnd;
-}
-public int getDeclarationSourceStart() {
- return declarationStart;
-}
-public char[] getInitializationSource() {
- return null;
-}
-public int getModifiers() {
- return modifiers;
-}
-public char[] getName() {
- return name;
-}
-public int getNameSourceEnd() {
- return nameSourceEnd;
-}
-public int getNameSourceStart() {
- return nameSourceStart;
-}
-public char[] getTypeName() {
- return typeName;
-}
-protected void setDeclarationSourceEnd(int position) {
- declarationEnd = position;
-}
-public String tabString(int tab) {
- /*slow code*/
-
- String s = "";
- for (int i = tab; i > 0; i--)
- s = s + "\t";
- return s;
-}
-public String toString() {
- return toString(0);
-}
-public String toString(int tab) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(tabString(tab));
- String displayModifiers = displayModifiers();
- if (displayModifiers != null) {
- buffer.append(displayModifiers);
- }
- buffer.append("var ");
-// if (typeName!=null)
-// {
-// buffer.append(typeName).append(" ");
-// }
- buffer.append(name);
- buffer.append(";");
- return buffer.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceImport.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceImport.java
deleted file mode 100644
index 220f078..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceImport.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-public class SourceImport {
- int declarationSourceStart;
- int declarationSourceEnd;
- char[] name;
- boolean onDemand;
- char[] source;
-/**
- * @param declarationSourceStart int
- * @param declarationSourceEnd int
- * @param name char[]
- * @param onDemand boolean
- */
-public SourceImport(
- int declarationSourceStart,
- int declarationSourceEnd,
- char[] name,
- boolean onDemand,
- char[] source) {
-
- this.declarationSourceStart = declarationSourceStart;
- this.declarationSourceEnd = declarationSourceEnd;
- this.name = name;
- this.onDemand = onDemand;
- this.source = source;
-}
-/**
- *
- * @return java.lang.String
- */
-public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer
- .append(
- source,
- declarationSourceStart,
- declarationSourceEnd - declarationSourceStart + 1)
- .append("\n");
- return buffer.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceInitializer.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceInitializer.java
deleted file mode 100644
index 8fd619e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceInitializer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-
-public class SourceInitializer extends SourceField {
-public SourceInitializer(
- int declarationStart,
- int modifiers) {
- super(declarationStart, modifiers, null, null, -1, -1, null);
-}
-
-public void setDeclarationSourceEnd(int declarationSourceEnd) {
- this.declarationEnd = declarationSourceEnd;
-}
-
-public String toString(int tab) {
- if (modifiers == ClassFileConstants.AccStatic) {
- return tabString(tab) + "static {}";
- }
- return tabString(tab) + "{}";
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceMethod.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceMethod.java
deleted file mode 100644
index a910ebd..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceMethod.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.env.ISourceMethod;
-
-public class SourceMethod implements ISourceMethod {
- private int modifiers;
- private int declarationStart;
- private int declarationEnd;
- private char[] returnTypeName;
- private char[] selector;
- private int nameSourceStart;
- private int nameSourceEnd;
- private char[][] argumentTypeNames;
- private char[][] argumentNames;
- private char[] source;
- private String explicitConstructorCall;
- private int numberOfMemberMethods;
- private SourceMethod[] memberMethods;
- char[][] typeParameterNames;
- char[][][] typeParameterBounds;
- SourceMethod parent;
-
-public SourceMethod(
- int declarationStart,
- int modifiers,
- char[] returnTypeName,
- char[] selector,
- int nameSourceStart,
- int nameSourceEnd,
- char[][] argumentTypeNames,
- char[][] argumentNames,
- char[] source) {
-
- this.declarationStart = declarationStart;
- this.modifiers = modifiers;
- this.returnTypeName = returnTypeName;
- this.selector = selector;
- this.nameSourceStart = nameSourceStart;
- this.nameSourceEnd = nameSourceEnd;
- this.argumentTypeNames = argumentTypeNames;
- this.argumentNames = argumentNames;
- this.source = source;
-}
-public String displayModifiers() {
- StringBuffer buffer = new StringBuffer();
-
- if (this.modifiers == 0)
- return null;
- if ((this.modifiers & ClassFileConstants.AccPublic) != 0)
- buffer.append("public ");
- if ((this.modifiers & ClassFileConstants.AccProtected) != 0)
- buffer.append("protected ");
- if ((this.modifiers & ClassFileConstants.AccPrivate) != 0)
- buffer.append("private ");
- if ((this.modifiers & ClassFileConstants.AccFinal) != 0)
- buffer.append("final ");
- if ((this.modifiers & ClassFileConstants.AccStatic) != 0)
- buffer.append("static ");
- if ((this.modifiers & ClassFileConstants.AccAbstract) != 0)
- buffer.append("abstract ");
- if ((this.modifiers & ClassFileConstants.AccNative) != 0)
- buffer.append("native ");
- if (buffer.toString().trim().equals(""))
- return null;
- return buffer.toString().trim();
-}
-protected void addMemberMethod(SourceMethod sourceMemberMethod) {
- if(memberMethods == null) {
- memberMethods = new SourceMethod[4];
- }
-
- if(numberOfMemberMethods == memberMethods.length) {
- System.arraycopy(memberMethods, 0, memberMethods = new SourceMethod[numberOfMemberMethods * 2], 0, numberOfMemberMethods);
- }
- memberMethods[numberOfMemberMethods++] = sourceMemberMethod;
-}
-
-public SourceMethod[] getMemberMethods() {
- if (memberMethods != null && memberMethods.length != numberOfMemberMethods) {
- System.arraycopy(
- memberMethods,
- 0,
- memberMethods = new SourceMethod[numberOfMemberMethods],
- 0,
- numberOfMemberMethods);
- }
- return memberMethods;
-}
-
-public String getActualName() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(source, nameSourceStart, nameSourceEnd - nameSourceStart + 1);
- return buffer.toString();
-}
-public char[][] getArgumentNames() {
- return argumentNames;
-}
-public char[][] getArgumentTypeNames() {
- return argumentTypeNames;
-}
-public int getDeclarationSourceEnd() {
- return declarationEnd;
-}
-public int getDeclarationSourceStart() {
- return declarationStart;
-}
-public int getModifiers() {
- return modifiers;
-}
-public int getNameSourceEnd() {
- return nameSourceEnd;
-}
-public int getNameSourceStart() {
- return nameSourceStart;
-}
-public char[] getReturnTypeName() {
- return returnTypeName;
-}
-public char[] getSelector() {
- return selector;
-}
-public char[][][] getTypeParameterBounds() {
- return typeParameterBounds;
-}
-public char[][] getTypeParameterNames() {
- return typeParameterNames;
-}
-public boolean isConstructor() {
- return returnTypeName == null;
-}
-protected void setDeclarationSourceEnd(int position) {
- declarationEnd = position;
-}
-protected void setExplicitConstructorCall(String s) {
- explicitConstructorCall = s;
-}
-public String tabString(int tab) {
- /*slow code*/
-
- String s = "";
- for (int i = tab; i > 0; i--)
- s = s + "\t";
- return s;
-}
-public String toString() {
- return toString(0);
-}
-public String toString(int tab) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(tabString(tab));
- String displayModifiers = displayModifiers();
- if (displayModifiers != null) {
- buffer.append(displayModifiers).append(" ");
- }
- if (returnTypeName != null) {
- buffer.append(returnTypeName).append(" ");
- }
- buffer.append("function ").append(selector).append("(");
- if (argumentTypeNames != null) {
- for (int i = 0, max = argumentTypeNames.length; i < max; i++) {
- buffer.append(argumentTypeNames[i]).append(" ").append(
- argumentNames[i]).append(
- ", ");
- }
- }
- buffer.append(") ");
- buffer.append("{");
- if (explicitConstructorCall != null) {
- buffer.append("\n").append(tabString(tab+1)).append(explicitConstructorCall).append(tabString(tab)).append("}");
- }
- if (this.numberOfMemberMethods>0)
- {
- for (int i = 0; i < numberOfMemberMethods; i++) {
- buffer.append("\n").append(memberMethods[i].toString(tab+1));
- }
- buffer.append("\n").append(tabString(tab));
- }
- buffer.append("}");
- return buffer.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourcePackage.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourcePackage.java
deleted file mode 100644
index bedfb7b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourcePackage.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-public class SourcePackage {
- int declarationSourceStart;
- int declarationSourceEnd;
- char[] name;
- char[] source;
-/**
- * @param declarationSourceStart int
- * @param declarationSourceEnd int
- * @param name char[]
- * @param source char[]
- */
-public SourcePackage(
- int declarationSourceStart,
- int declarationSourceEnd,
- char[] name,
- char[] source) {
-
- this.declarationSourceStart = declarationSourceStart;
- this.declarationSourceEnd = declarationSourceEnd;
- this.name = name;
- this.source = source;
-}
-/**
- *
- * @return java.lang.String
- */
-public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer
- .append(
- source,
- declarationSourceStart,
- declarationSourceEnd - declarationSourceStart + 1)
- .append("\n");
- return buffer.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceType.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceType.java
deleted file mode 100644
index 25464c9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceType.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-
-public final class SourceType {
- private int modifiers;
- private int declarationStart;
- private int declarationEnd;
- private char[] fileName;
- private SourcePackage packageName;
- private SourceImport[] imports;
- private char[] enclosingTypeName;
- private char[] name;
- private int nameSourceStart;
- private int nameSourceEnd;
- private char[] superclassName;
- private SourceType[] memberTypes;
- private int numberOfMemberTypes;
- private SourceMethod[] methods;
- private int numberOfMethods;
- private SourceField[] fields;
- private int numberOfFields;
- private char[] source;
- SourceType parent;
-
- // Buffering.
- private char[] qualifiedName;
- private String defaultConstructor;
-public SourceType(
- char[] enclosingTypeName,
- int declarationStart,
- int modifiers,
- char[] name,
- int nameSourceStart,
- int nameSourceEnd,
- char[] superclassName,
- char[] source) {
-
- this.enclosingTypeName = enclosingTypeName;
- this.declarationStart = declarationStart;
-
- this.modifiers = modifiers;
- this.name = name;
- this.nameSourceStart = nameSourceStart;
- this.nameSourceEnd = nameSourceEnd;
- this.superclassName = superclassName;
- this.source = source;
-}
-protected void addField(SourceField sourceField) {
- if (fields == null) {
- fields = new SourceField[4];
- }
-
- if (numberOfFields == fields.length) {
- System.arraycopy(
- fields,
- 0,
- fields = new SourceField[numberOfFields * 2],
- 0,
- numberOfFields);
- }
- fields[numberOfFields++] = sourceField;
-}
-protected void addMemberType(SourceType sourceMemberType) {
- if(memberTypes == null) {
- memberTypes = new SourceType[4];
- }
-
- if(numberOfMemberTypes == memberTypes.length) {
- System.arraycopy(memberTypes, 0, memberTypes = new SourceType[numberOfMemberTypes * 2], 0, numberOfMemberTypes);
- }
- memberTypes[numberOfMemberTypes++] = sourceMemberType;
-}
-protected void addMethod(SourceMethod sourceMethod) {
- if (methods == null) {
- methods = new SourceMethod[4];
- }
-
- if (numberOfMethods == methods.length) {
- System.arraycopy(
- methods,
- 0,
- methods = new SourceMethod[numberOfMethods * 2],
- 0,
- numberOfMethods);
- }
- methods[numberOfMethods++] = sourceMethod;
-}
-public String displayModifiers() {
- StringBuffer buffer = new StringBuffer();
-
- if (this.modifiers == 0)
- return null;
- if ((this.modifiers & ClassFileConstants.AccPublic) != 0)
- buffer.append("public ");
- if ((this.modifiers & ClassFileConstants.AccProtected) != 0)
- buffer.append("protected ");
- if ((this.modifiers & ClassFileConstants.AccPrivate) != 0)
- buffer.append("private ");
- if ((this.modifiers & ClassFileConstants.AccFinal) != 0)
- buffer.append("final ");
- if ((this.modifiers & ClassFileConstants.AccStatic) != 0)
- buffer.append("static ");
- if ((this.modifiers & ClassFileConstants.AccAbstract) != 0)
- buffer.append("abstract ");
- if ((this.modifiers & ClassFileConstants.AccNative) != 0)
- buffer.append("native ");
- return buffer.toString().trim();
-}
-public String getActualName() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(source, nameSourceStart, nameSourceEnd - nameSourceStart + 1);
- return buffer.toString();
-}
-public int getDeclarationSourceEnd() {
- return declarationEnd;
-}
-public int getDeclarationSourceStart() {
- return declarationStart;
-}
-public char[] getEnclosingTypeName() {
- return enclosingTypeName;
-}
-public SourceField[] getFields() {
- if (fields != null && fields.length != numberOfFields) {
- System.arraycopy(fields, 0, fields = new SourceField[numberOfFields], 0, numberOfFields);
- }
- return fields;
-}
-public char[] getFileName() {
- return fileName;
-}
-public char[][] getImports() {
- if (imports == null) return null;
- int importLength = imports.length;
- char[][] importNames = new char[importLength][];
- for (int i = 0, max = importLength; i < max; i++) {
- importNames[i] = imports[i].name;
- }
- return importNames;
-}
-public SourceType[] getMemberTypes() {
- if (memberTypes != null && memberTypes.length != numberOfMemberTypes) {
- System.arraycopy(
- memberTypes,
- 0,
- memberTypes = new SourceType[numberOfMemberTypes],
- 0,
- numberOfMemberTypes);
- }
- return memberTypes;
-}
-public SourceMethod[] getMethods() {
- if (methods != null && methods.length != numberOfMethods) {
- System.arraycopy(methods, 0, methods = new SourceMethod[numberOfMethods], 0, numberOfMethods);
- }
- return methods;
-}
-public int getModifiers() {
- return modifiers;
-}
-public char[] getName() {
- return name;
-}
-public int getNameSourceEnd() {
- return nameSourceEnd;
-}
-public int getNameSourceStart() {
- return nameSourceStart;
-}
-public char[] getPackageName() {
- return packageName.name;
-}
-public char[] getQualifiedName() {
- if (qualifiedName == null) {
- StringBuffer temp = new StringBuffer();
- temp.append(packageName);
- temp.append('.');
- temp.append(name);
- qualifiedName = temp.toString().toCharArray();
- }
- return qualifiedName;
-}
-public char[] getSuperclassName() {
- return superclassName;
-}
-public boolean isBinaryType() {
- return false;
-}
-public boolean isClass() {
- return true;
-}
-public void setDeclarationSourceEnd(int position) {
- declarationEnd = position;
-}
-public void setDefaultConstructor(String s) {
- this.defaultConstructor = s;
-}
-public void setImports(SourceImport[] imports) {
- this.imports = imports;
-}
-public void setPackage(SourcePackage sourcePackage) {
- packageName = sourcePackage;
-}
-public void setSuperclass(char[] superclassName) {
- this.superclassName = superclassName;
-}
-public String tabString(int tab) {
- /*slow code*/
-
- String s = "";
- for (int i = tab; i > 0; i--)
- s = s + "\t";
- return s;
-}
-public String toString() {
- return toString(0);
-}
-public String toString(int tab) {
-
- StringBuffer buffer = new StringBuffer();
- if (packageName != null) {
- buffer.append(tabString(tab)).append(packageName);
- }
- if (imports != null) {
- for (int i = 0, max = imports.length; i < max; i++) {
- buffer.append(tabString(tab)).append(imports[i]);
- }
- }
- buffer.append(tabString(tab));
- String displayModifiers = displayModifiers();
- if (displayModifiers != null) {
- buffer.append(displayModifiers).append(" ");
- }
- buffer.append("class ").append(name).append(" ");
- if (superclassName != null) {
- buffer.append("extends ").append(superclassName).append(" ");
- }
- buffer.append("{\n");
- if (memberTypes != null) {
- for (int i = 0, max = numberOfMemberTypes; i < max; i++) {
- buffer.append(memberTypes[i].toString(tab + 1)).append("\n");
- }
- }
- if (fields != null) {
- for (int i = 0, max = numberOfFields; i < max; i++) {
- buffer.append(fields[i].toString(tab + 1)).append("\n");
- }
- }
- if (defaultConstructor != null) {
- buffer.append(tabString(tab + 1)).append(defaultConstructor);
- }
- if (methods != null) {
- for (int i = 0, max = numberOfMethods; i < max; i++) {
- buffer.append(methods[i].toString(tab + 1)).append("\n");
- }
- }
- buffer.append(tabString(tab)).append("}");
- return buffer.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceUnit.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceUnit.java
deleted file mode 100644
index 2d3e15c..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceUnit.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-
-public final class SourceUnit {
- private int modifiers;
- private int declarationStart;
- private int declarationEnd;
- private char[] fileName;
- private SourcePackage packageName;
- private SourceImport[] imports;
- private char[] enclosingTypeName;
- private char[] name;
- private int nameSourceStart;
- private int nameSourceEnd;
- private char[] superclassName;
- private char[][] interfaceNames;
- private SourceType[] memberTypes;
- private int numberOfMemberTypes;
- private SourceMethod[] methods;
- private int numberOfMethods;
- private SourceField[] fields;
- private int numberOfFields;
- private char[] source;
- SourceUnit parent;
-
- // Buffering.
- private char[] qualifiedName;
- private String defaultConstructor;
-public SourceUnit(
- ) {
-
-}
-protected void addField(SourceField sourceField) {
- if (fields == null) {
- fields = new SourceField[4];
- }
-
- if (numberOfFields == fields.length) {
- System.arraycopy(
- fields,
- 0,
- fields = new SourceField[numberOfFields * 2],
- 0,
- numberOfFields);
- }
- fields[numberOfFields++] = sourceField;
-}
-protected void addMemberType(SourceType sourceMemberType) {
- if(memberTypes == null) {
- memberTypes = new SourceType[4];
- }
-
- if(numberOfMemberTypes == memberTypes.length) {
- System.arraycopy(memberTypes, 0, memberTypes = new SourceType[numberOfMemberTypes * 2], 0, numberOfMemberTypes);
- }
- memberTypes[numberOfMemberTypes++] = sourceMemberType;
-}
-protected void addMethod(SourceMethod sourceMethod) {
- if (methods == null) {
- methods = new SourceMethod[4];
- }
-
- if (numberOfMethods == methods.length) {
- System.arraycopy(
- methods,
- 0,
- methods = new SourceMethod[numberOfMethods * 2],
- 0,
- numberOfMethods);
- }
- methods[numberOfMethods++] = sourceMethod;
-}
-public String displayModifiers() {
- StringBuffer buffer = new StringBuffer();
-
- if (this.modifiers == 0)
- return null;
- if ((this.modifiers & ClassFileConstants.AccPublic) != 0)
- buffer.append("public ");
- if ((this.modifiers & ClassFileConstants.AccProtected) != 0)
- buffer.append("protected ");
- if ((this.modifiers & ClassFileConstants.AccPrivate) != 0)
- buffer.append("private ");
- if ((this.modifiers & ClassFileConstants.AccFinal) != 0)
- buffer.append("final ");
- if ((this.modifiers & ClassFileConstants.AccStatic) != 0)
- buffer.append("static ");
- if ((this.modifiers & ClassFileConstants.AccAbstract) != 0)
- buffer.append("abstract ");
- if ((this.modifiers & ClassFileConstants.AccNative) != 0)
- buffer.append("native ");
- return buffer.toString().trim();
-}
-public String getActualName() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(source, nameSourceStart, nameSourceEnd - nameSourceStart + 1);
- return buffer.toString();
-}
-public int getDeclarationSourceEnd() {
- return declarationEnd;
-}
-public int getDeclarationSourceStart() {
- return declarationStart;
-}
-public char[] getEnclosingTypeName() {
- return enclosingTypeName;
-}
-public SourceField[] getFields() {
- if (fields != null && fields.length != numberOfFields) {
- System.arraycopy(fields, 0, fields = new SourceField[numberOfFields], 0, numberOfFields);
- }
- return fields;
-}
-public char[] getFileName() {
- return fileName;
-}
-public char[][] getImports() {
- if (imports == null) return null;
- int importLength = imports.length;
- char[][] importNames = new char[importLength][];
- for (int i = 0, max = importLength; i < max; i++) {
- importNames[i] = imports[i].name;
- }
- return importNames;
-}
-public char[][] getInterfaceNames() {
- return interfaceNames;
-}
-public SourceType[] getMemberTypes() {
- if (memberTypes != null && memberTypes.length != numberOfMemberTypes) {
- System.arraycopy(
- memberTypes,
- 0,
- memberTypes = new SourceType[numberOfMemberTypes],
- 0,
- numberOfMemberTypes);
- }
- return memberTypes;
-}
-public SourceMethod[] getMethods() {
- if (methods != null && methods.length != numberOfMethods) {
- System.arraycopy(methods, 0, methods = new SourceMethod[numberOfMethods], 0, numberOfMethods);
- }
- return methods;
-}
-public int getModifiers() {
- return modifiers;
-}
-public char[] getName() {
- return name;
-}
-public int getNameSourceEnd() {
- return nameSourceEnd;
-}
-public int getNameSourceStart() {
- return nameSourceStart;
-}
-public char[] getPackageName() {
- return packageName.name;
-}
-public char[] getQualifiedName() {
- if (qualifiedName == null) {
- StringBuffer temp = new StringBuffer();
- temp.append(packageName);
- temp.append('.');
- temp.append(name);
- qualifiedName = temp.toString().toCharArray();
- }
- return qualifiedName;
-}
-public char[] getSuperclassName() {
- return superclassName;
-}
-public boolean isBinaryType() {
- return false;
-}
-public boolean isClass() {
- return true;
-}
-public void setDeclarationSourceEnd(int position) {
- declarationEnd = position;
-}
-public void setDefaultConstructor(String s) {
- this.defaultConstructor = s;
-}
-public void setImports(SourceImport[] imports) {
- this.imports = imports;
-}
-public void setPackage(SourcePackage sourcePackage) {
- packageName = sourcePackage;
-}
-public void setSuperclass(char[] superclassName) {
- this.superclassName = superclassName;
-}
-public void setSuperinterfaces(char[][] superinterfacesNames) {
- this.interfaceNames = superinterfacesNames;
-}
-public String tabString(int tab) {
- /*slow code*/
-
- String s = "";
- for (int i = tab; i > 0; i--)
- s = s + "\t";
- return s;
-}
-public String toString() {
- return toString(0);
-}
-public String toString(int tab) {
-
- StringBuffer buffer = new StringBuffer();
-// if (packageName != null) {
-// buffer.append(tabString(tab)).append(packageName);
-// }
-// if (imports != null) {
-// for (int i = 0, max = imports.length; i < max; i++) {
-// buffer.append(tabString(tab)).append(imports[i]);
-// }
-// }
-// buffer.append(tabString(tab));
-// String displayModifiers = displayModifiers();
-// if (displayModifiers != null) {
-// buffer.append(displayModifiers).append(" ");
-// }
-// buffer.append(isInterface() ? "interface " : "class ").append(name).append(" ");
-// if (superclassName != null) {
-// buffer.append("extends ").append(superclassName).append(" ");
-// }
-// if (interfaceNames != null) {
-// buffer.append("implements ");
-// for (int i = 0, max = interfaceNames.length; i < max; i++) {
-// buffer.append(interfaceNames[i]).append(", ");
-// }
-// }
-// buffer.append("{\n");
-// if (memberTypes != null) {
-// for (int i = 0, max = numberOfMemberTypes; i < max; i++) {
-// buffer.append(memberTypes[i].toString(tab + 1)).append("\n");
-// }
-// }
- if (fields != null) {
- for (int i = 0, max = numberOfFields; i < max; i++) {
- buffer.append(fields[i].toString(tab + 1)).append("\n");
- }
- }
-// if (defaultConstructor != null) {
-// buffer.append(tabString(tab + 1)).append(defaultConstructor);
-// }
- if (methods != null) {
- for (int i = 0, max = numberOfMethods; i < max; i++) {
- buffer.append(methods[i].toString(tab + 1)).append("\n");
- }
- }
-// buffer.append(tabString(tab)).append("}");
- return buffer.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/StatementRecoveryTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/StatementRecoveryTest.java
deleted file mode 100644
index a7480c2..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/StatementRecoveryTest.java
+++ /dev/null
@@ -1,3734 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Locale;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-public class StatementRecoveryTest extends AbstractCompilerTest {
- public static final boolean ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY = true;
-
- public static boolean optimizeStringLiterals = false;
- public static long sourceLevel = ClassFileConstants.JDK1_3; //$NON-NLS-1$
-
-static {
-// TESTS_NAMES = new String[] { "test0037"};
-// TESTS_RANGE = new int[] {10, 20};
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(StatementRecoveryTest.class);
-}
-public StatementRecoveryTest(String testName){
- super(testName);
-}
-public void checkParse(
- char[] source,
- String expectedDietUnitToString,
- String expectedDietWithStatementRecoveryUnitToString,
- String expectedDietPlusBodyUnitToString,
- String expectedDietPlusBodyWithStatementRecoveryUnitToString,
- String expectedFullUnitToString,
- String expectedFullWithStatementRecoveryUnitToString,
- String testName) {
-
- /* using regular parser in DIET mode */
- if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
- parser.setMethodsFullRecovery(false);
- parser.setStatementsRecovery(false);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit diet structure" + testName,
- expectedDietUnitToString,
- computedUnitToString);
- }
- /* using regular parser in DIET mode and statementRecoveryEnabled */
- if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietWithStatementRecoveryUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit diet structure with statement recovery enabled" + testName,
- expectedDietWithStatementRecoveryUnitToString,
- computedUnitToString);
- }
- /* using regular parser in DIET mode + getMethodBodies */
- if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
- parser.setMethodsFullRecovery(false);
- parser.setStatementsRecovery(false);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit diet structure" + testName,
- expectedDietUnitToString,
- computedUnitToString);
- if (computedUnit.types != null) {
- for (int i = computedUnit.types.length; --i >= 0;){
- computedUnit.types[i].parseMethod(parser, computedUnit);
- }
- }
- computedUnitToString = computedUnit.toString();
- if (!expectedDietPlusBodyUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
-
- assertEquals(
- "Invalid unit diet+body structure" + testName,
- expectedDietPlusBodyUnitToString,
- computedUnitToString);
- }
- /* using regular parser in DIET mode + getMethodBodies and statementRecoveryEnabled */
- {
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.dietParse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedDietWithStatementRecoveryUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit diet structure" + testName,
- expectedDietWithStatementRecoveryUnitToString,
- computedUnitToString);
- if (computedUnit.types != null) {
- for (int i = computedUnit.types.length; --i >= 0;){
- computedUnit.types[i].parseMethod(parser, computedUnit);
- }
- }
- computedUnitToString = computedUnit.toString();
- if (!expectedDietPlusBodyWithStatementRecoveryUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
-
- assertEquals(
- "Invalid unit diet+body structure with statement recovery enabled" + testName,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- computedUnitToString);
- }
- /* using regular parser in FULL mode */
- if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
- parser.setMethodsFullRecovery(false);
- parser.setStatementsRecovery(false);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.parse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedFullUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit full structure" + testName,
- expectedFullUnitToString,
- computedUnitToString);
-
- }
- /* using regular parser in FULL mode and statementRecoveryEnabled */
- if(!ONLY_DIET_PLUS_BODY_WITH_STATEMENT_RECOVERY){
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- CompilationUnitDeclaration computedUnit = parser.parse(sourceUnit, compilationResult);
- String computedUnitToString = computedUnit.toString();
- if (!expectedFullWithStatementRecoveryUnitToString.equals(computedUnitToString)){
- System.out.println(Util.displayString(computedUnitToString));
- }
- assertEquals(
- "Invalid unit full structure with statement recovery enabled" + testName,
- expectedFullWithStatementRecoveryUnitToString,
- computedUnitToString);
-
- }
-}
-
-public void test0001() {
-
- String s =
- " function foo() { \n"
- + " System.out.println(); \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String expectedFullUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedFullUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0002() {
-
- String s =
- " function foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-public void test0002a() {
-
- String s =
- " System.out.print1(); \n"
- + " # \n"
- + " System.out.print2(); \n"
- + " \n";
-
- String expectedDietUnitToString =
- "System.out.print1();\n"+
- "System.out.print2();\n"+
- "";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- " System.out.println();\n"+
- "\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "System.out.print1();\n"+
- "System.out.print2();\n"+
- "";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-public void test0002b() {
-
- String s =
- " foo = function () { \n"
- + " # \n"
- + " System.out.println(); \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "};\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "};\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-
-
-
-public void test0002c() {
-
- String s =
- " obj ={ \n"
- +" p1 : 2, \n"
- +" meth: function () { \n"
- + " # \n"
- + " FOO(); \n"
- + "} \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "};\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "};\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-
-
-public void test0002d() {
-
- String s =
- " a= foo{ \n"
- +" function () { \n"
- + " # \n"
- + " bar(); \n"
- + "} \n"
- + "); \n";
-
- String expectedDietUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "};\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "foo = function () {\n" +
- " System.out.println();\n"+
- "};\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-
-
-
-public void test0003() {
-
- String s =
- " function foo() { \n"
- + " System.out.println(); \n"
- + " # \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-
-public void test0003b() {
-
- String s =
- " function foo1() { \n"
- + " var i; \n"
- + "} \n"
- + " function foo2() { \n"
- + " # \n"
- + " a=1; \n"
- + "} \n"
- + " function foo3() { \n"
- + " var k; \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-
-
-public void test0004() {
-
- String s =
- " function foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " System.out.println(); \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0005() {
-
- String s =
- " function foo() { \n"
- + " System.out.println(); \n"
- + " System.out.println(); \n"
- + " # \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0006() {
-
- String s =
- "function foo() {\n"
- + " System.out.println(); \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " System.out.println(); \n"
- +"}\n";
-
- String expectedDietUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "function foo() {\n" +
- " System.out.println();\n"+
- " System.out.println();\n"+
- " System.out.println();\n"+
- " System.out.println();\n"+
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0007() {
-
- String s =
- "function foo() {\n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- +"}\n";
-
- String expectedDietUnitToString =
- "function foo() {\n"
- + " System.out.println();\n"
- + " if (true)\n"
- + " {\n"
- + " System.out.println();\n"
- + " }\n"
- + " System.out.println();\n"
- +"}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "function foo() {\n"
- + " System.out.println();\n"
- + " if (true)\n"
- + " {\n"
- + " System.out.println();\n"
- + " }\n"
- + " System.out.println();\n"
- +"}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "function foo() {\n"
- + " System.out.println();\n"
- + " if (true)\n"
- + " {\n"
- + " System.out.println();\n"
- + " }\n"
- + " System.out.println();\n"
- +"}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0008() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0009() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0010() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() {} \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0011() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() {} \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0012() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() {} \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0013() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() {} \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " class Y { \n"
- + " void foo() {} \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " class Y {\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0014() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0015() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0016() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0017() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0018() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0019() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0020() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0021() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() {} \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " void foo() {\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " void foo() {\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietPlusBodyUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0022() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() {} \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " # \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0023() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void bar() {} \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0024() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void bar() {} \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void bar() {} \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0025() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " # \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0026() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0027() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0028() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0029() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0030() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0031() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0032() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " System.out.println(); \n"
- + " bar(new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " # \n"
- + " System.out.println(); \n"
- + " if(true) { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }); \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " bar(new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " System.out.println();\n" +
- " if (true)\n" +
- " {\n" +
- " System.out.println();\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- "});\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0033() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " class Z { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " class Z {\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0034() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " # \n"
- + " new Object() { \n"
- + " void foo() { \n"
- + " System.out.println(); \n"
- + " } \n"
- + " }; \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " () {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0035() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " bar(\\u0029 \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " bar();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0036() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " if(true) { \n"
- + " foo(); \n"
- + " } \n"
- + " for(; \n"
- + " if(true) { \n"
- + " foo(); \n"
- + " } \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " if (true)\n" +
- " {\n" +
- " foo();\n" +
- " }\n" +
- " for (; ; ) \n" +
- " ;\n" +
- " if (true)\n" +
- " {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0037() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " if() { \n"
- + " foo(); \n"
- + " } \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " if ($missing$)\n" +
- " {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0038() {
- String s =
- "package p1; \n"+
- "public class A { \n"+
- " public interface B { \n"+
- " public abstract void aMethod (int A); \n"+
- " public interface C { \n"+
- " public abstract void anotherMethod(int A);\n"+
- " } \n"+
- " } \n"+
- " public class aClass implements B, B.C { \n"+
- " public void aMethod (int A) { \n"+
- " public void anotherMethod(int A) {}; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "}";
-
- String expectedDietUnitToString =
- "package p1;\n" +
- "public class A {\n" +
- " public interface B {\n" +
- " public interface C {\n" +
- " public abstract void anotherMethod(int A);\n" +
- " }\n" +
- " public abstract void aMethod(int A);\n" +
- " }\n" +
- " public class aClass implements B, B.C {\n" +
- " public aClass() {\n" +
- " }\n" +
- " public void aMethod(int A) {\n" +
- " }\n" +
- " }\n" +
- " public A() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package p1;\n" +
- "public class A {\n" +
- " public interface B {\n" +
- " public interface C {\n" +
- " public abstract void anotherMethod(int A);\n" +
- " }\n" +
- " public abstract void aMethod(int A);\n" +
- " }\n" +
- " public class aClass implements B, B.C {\n" +
- " public aClass() {\n" +
- " super();\n" +
- " }\n" +
- " public void aMethod(int A) {\n" +
- " }\n" +
- " }\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package p1;\n" +
- "public class A {\n" +
- " public interface B {\n" +
- " public interface C {\n" +
- " public abstract void anotherMethod(int A);\n" +
- " }\n" +
- " public abstract void aMethod(int A);\n" +
- " }\n" +
- " public class aClass implements B, B.C {\n" +
- " public aClass() {\n" +
- " super();\n" +
- " }\n" +
- " public void aMethod(int A) {\n" +
- " public void anotherMethod;\n" +
- " int A;\n" +
- " ;\n" +
- " }\n" +
- " }\n" +
- " public A() {\n" +
- " super();\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- "package p1;\n" +
- "public class A {\n" +
- " public interface B {\n" +
- " public interface C {\n" +
- " public abstract void anotherMethod(int A);\n" +
- " }\n" +
- " public abstract void aMethod(int A);\n" +
- " }\n" +
- " public class aClass implements B, B.C {\n" +
- " public aClass() {\n" +
- " }\n" +
- " public void aMethod(int A) {\n" +
- " }\n" +
- " public void anotherMethod(int A) {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " public A() {\n" +
- " }\n" +
- " public static void main(String[] argv) {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedFullUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0039() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " { \n"
- + " System.out.println(); \n"
- + " foo() \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " System.out.println();\n" +
- " foo();\n" +
- " System.out.println();\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0040() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " { \n"
- + " System.out.println(); \n"
- + " class Y { \n"
- + " { \n"
- + " System.out.println(); \n"
- + " foo() \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " System.out.println();\n" +
- " class Y {\n" +
- " {\n" +
- " System.out.println();\n" +
- " foo();\n" +
- " System.out.println();\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0041() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " { \n"
- + " System.out.println(); \n"
- + " class Y { \n"
- + " { \n"
- + " System.out.println(); \n"
- + " foo() \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " class Z { \n"
- + " { \n"
- + " System.out.println(); \n"
- + " foo() \n"
- + " System.out.println(); \n"
- + " } \n"
- + " } \n"
- + " System.out.println(); \n"
- + " foo() \n"
- + " System.out.println(); \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " {\n" +
- " System.out.println();\n" +
- " class Y {\n" +
- " {\n" +
- " System.out.println();\n" +
- " foo();\n" +
- " System.out.println();\n" +
- " }\n" +
- " Y() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " class Z {\n" +
- " {\n" +
- " System.out.println();\n" +
- " foo();\n" +
- " System.out.println();\n" +
- " }\n" +
- " Z() {\n" +
- " super();\n" +
- " }\n" +
- " }\n" +
- " System.out.println();\n" +
- " foo();\n" +
- " System.out.println();\n" +
- " }\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-public void test0042() {
-
- String s =
- "package a; \n"
- + "public class X { \n"
- + " void foo() { \n"
- + " for(int i \n"
- + " } \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " void foo() {\n" +
- " for (int i;; ; ) \n" +
- " ;\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80339
-public void test0043() {
-
- String s =
- "package a; \n"
- + "public interface Test { \n"
- + " public void myMethod() \n"
- + "} \n";
-
- String expectedDietUnitToString =
- "package a;\n" +
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String expectedDietPlusBodyUnitToString =
- "package a;\n" +
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedDietPlusBodyWithStatementRecoveryUnitToString =
- "package a;\n" +
- "public interface Test {\n" +
- " public void myMethod() {\n" +
- " }\n" +
- "}\n";
-
- String expectedFullUnitToString =
- expectedDietUnitToString;
-
- String expectedFullWithStatementRecoveryUnitToString =
- expectedDietUnitToString;
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedDietUnitToString,
- expectedDietWithStatementRecoveryUnitToString,
- expectedDietPlusBodyUnitToString,
- expectedDietPlusBodyWithStatementRecoveryUnitToString,
- expectedFullUnitToString,
- expectedFullWithStatementRecoveryUnitToString,
- testName);
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SyntaxErrorTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SyntaxErrorTest.java
deleted file mode 100644
index ab3f37b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SyntaxErrorTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.Locale;
-
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblem;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-public class SyntaxErrorTest extends AbstractCompilerTest {
- public static boolean optimizeStringLiterals = false;
- public static long sourceLevel = ClassFileConstants.JDK1_3; //$NON-NLS-1$
-
-public SyntaxErrorTest(String testName){
- super(testName);
-}
-public void checkParse(
- char[] source,
- String expectedSyntaxErrorDiagnosis,
- String testName) {
-
- /* using regular parser in DIET mode */
- Parser parser =
- new Parser(
- new ProblemReporter(
- DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(getCompilerOptions()),
- new DefaultProblemFactory(Locale.getDefault())),
- optimizeStringLiterals);
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName, null);
- CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
-
- parser.parse(sourceUnit, compilationResult);
-
- StringBuffer buffer = new StringBuffer(100);
- if (compilationResult.hasProblems() || compilationResult.hasTasks()) {
- CategorizedProblem[] problems = compilationResult.getAllProblems();
- int count = problems.length;
- int problemCount = 0;
- char[] unitSource = compilationResult.compilationUnit.getContents();
- for (int i = 0; i < count; i++) {
- if (problems[i] != null) {
- if (problemCount == 0)
- buffer.append("----------\n");
- problemCount++;
- buffer.append(problemCount + (problems[i].isError() ? ". ERROR" : ". WARNING"));
- buffer.append(" in " + new String(problems[i].getOriginatingFileName()).replace('/', '\\'));
- try {
- buffer.append(((DefaultProblem)problems[i]).errorReportSource(unitSource));
- buffer.append("\n");
- buffer.append(problems[i].getMessage());
- buffer.append("\n");
- } catch (Exception e) {
- }
- buffer.append("----------\n");
- }
- }
- }
- String computedSyntaxErrorDiagnosis = buffer.toString();
- //System.out.println(Util.displayString(computedSyntaxErrorDiagnosis));
- assertEquals(
- "Invalid syntax error diagnosis" + testName,
- Util.convertToIndependantLineDelimiter(expectedSyntaxErrorDiagnosis),
- Util.convertToIndependantLineDelimiter(computedSyntaxErrorDiagnosis));
-}
-/*
- * Should diagnose parenthesis mismatch
- */
-//TODO - fix bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=279009
-public void Xtest01() {
-
- String s =
- "function X() { \n"+
- " function solve(){ \n"+
- " \n"+
- " var results = new X[10]; \n"+
- " for(var i = 0; i < 10; i++){ \n"+
- " var result = results[i]; \n"+
- " var found = false; \n"+
- " for(var j = 0; j < 10; j++){ \n"+
- " if (this == (result.documentName){ \n"+
- " found = true; \n"+
- " break; \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " return andResult; \n"+
- " } \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <parenthesis mismatch> (at line 9)\n" +
- " if (this == (result.documentName){ \n" +
- " ^\n" +
- "Syntax error, insert \") BlockStatement\" to complete BlockStatements\n" +
- "----------\n";
-
- String testName = "<parenthesis mismatch>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-/*
- * Should diagnose brace mismatch
- */
-public void test02() {
-
- String s =
- "function Bar() { \n"+
- " this.a = (fred().x{); \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n" +
- "1. ERROR in <brace mismatch> (at line 2)\n" +
- " this.a = (fred().x{); \n" +
- " ^\n" +
- "Syntax error on token \"{\", delete this token\n" +
- "----------\n";
-
- String testName = "<brace mismatch>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=133292
-public void test03() {
-
- String s =
- "function X() { \n"+
- " o = { s: \"Success\"; }; \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n"+
- "1. ERROR in <test> (at line 2)\n"+
- " o = { s: \"Success\"; }; \n"+
- " ^\n"+
- "Syntax error on token \";\", delete this token\n"+
- "----------\n";
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=133292
-public void test04() {
-
- String s =
- "function X() { \n"+
- " var o = { s: \"Success\"; }; \n"+
- "} \n";
-
- String expectedSyntaxErrorDiagnosis =
- "----------\n"+
- "1. ERROR in <test> (at line 2)\n"+
- " var o = { s: \"Success\"; }; \n"+
- " ^\n"+
- "Syntax error on token \";\", delete this token\n"+
- "----------\n";
-
- String testName = "<test>";
- checkParse(
- s.toCharArray(),
- expectedSyntaxErrorDiagnosis,
- testName);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestAll.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestAll.java
deleted file mode 100644
index 67161d6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestAll.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Run all parser regression tests
- */
-public class TestAll extends junit.framework.TestCase {
-
- public final static List TEST_CLASSES_1_5 = new ArrayList();
- static {
- /* completion tests */
- TEST_CLASSES_1_5.addAll(RunCompletionParserTests.TEST_CLASSES_1_5);
- }
-
-public TestAll(String testName) {
- super(testName);
-}
-
-public static Test suite() {
- ArrayList testClasses = new ArrayList();
-
- /* completion tests */
- testClasses.addAll(RunCompletionParserTests.TEST_CLASSES);
-
- /* selection tests */
- testClasses.add(ExplicitConstructorInvocationSelectionTest.class);
- testClasses.add(SelectionTest.class);
- testClasses.add(SelectionTest2.class);
- testClasses.add(SelectionJavadocTest.class);
-
- /* recovery tests */
- testClasses.add(DietRecoveryTest.class);
- testClasses.add(StatementRecoveryTest.class);
-
- /* source element parser tests */
- testClasses.add(SourceElementParserTest.class);
-
- /* syntax error diagnosis tests */
- testClasses.add(SyntaxErrorTest.class);
- testClasses.add(DualParseSyntaxErrorTest.class);
- testClasses.add(ParserTest.class);
- testClasses.add(ComplianceDiagnoseTest.class);
-
- TestSuite all = new TestSuite(TestAll.class.getName());
- int possibleComplianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_3) != 0) {
- ArrayList tests_1_3 = (ArrayList)testClasses.clone();
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_3, tests_1_3));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- ArrayList tests_1_4 = (ArrayList)testClasses.clone();
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_4, tests_1_4));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- ArrayList tests_1_5 = (ArrayList)testClasses.clone();
- tests_1_5.addAll(TEST_CLASSES_1_5);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_5, tests_1_5));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_6) != 0) {
- ArrayList tests_1_6 = (ArrayList)testClasses.clone();
- tests_1_6.addAll(TEST_CLASSES_1_5);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_6, tests_1_6));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_7) != 0) {
- ArrayList tests_1_7 = (ArrayList)testClasses.clone();
- tests_1_7.addAll(TEST_CLASSES_1_5);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_7, tests_1_7));
- }
-
- return all;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestSourceElementRequestor.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestSourceElementRequestor.java
deleted file mode 100644
index 4e06d49..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestSourceElementRequestor.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.internal.compiler.ISourceElementRequestor;
-
-public class TestSourceElementRequestor implements ISourceElementRequestor {
-/**
- * DummySourceElementRequestor constructor comment.
- */
-public TestSourceElementRequestor() {
- super();
-}
-/**
- * acceptConstructorReference method comment.
- */
-public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {}
-/**
- * acceptFieldReference method comment.
- */
-public void acceptFieldReference(char[] fieldName, int sourcePosition) {}
-/**
- * acceptImport method comment.
- */
-public void acceptImport(int declarationStart, int declarationEnd, char[][] tokens, boolean onDemand) {}
-/**
- * acceptLineSeparatorPositions method comment.
- */
-public void acceptLineSeparatorPositions(int[] positions) {}
-/**
- * acceptMethodReference method comment.
- */
-public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition) {}
-/**
- * acceptPackage method comment.
- */
-public void acceptPackage(int declarationStart, int declarationEnd, char[] name) {}
-/**
- * acceptProblem method comment.
- */
-public void acceptProblem(CategorizedProblem problem) {}
-/**
- * acceptTypeReference method comment.
- */
-public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {}
-/**
- * acceptTypeReference method comment.
- */
-public void acceptTypeReference(char[] typeName, int sourcePosition) {}
-/**
- * acceptUnknownReference method comment.
- */
-public void acceptUnknownReference(char[][] name, int sourceStart, int sourceEnd) {}
-/**
- * acceptUnknownReference method comment.
- */
-public void acceptUnknownReference(char[] name, int sourcePosition) {}
-/**
- * enterCompilationUnit method comment.
- */
-public void enterCompilationUnit() {}
-/**
- * enterConstructor method comment.
- */
-public void enterConstructor(MethodInfo methodInfo) {}
-/**
- * enterField method comment.
- */
-public void enterField(FieldInfo fieldInfo) {}
-/**
- * enterMethod method comment.
- */
-public void enterMethod(MethodInfo methodInfo) {}
-/**
- * enterType method comment.
- */
-public void enterType(TypeInfo typeInfo) {}
-/**
- * exitCompilationUnit method comment.
- */
-public void exitCompilationUnit(int declarationEnd) {}
-/**
- * exitConstructor method comment.
- */
-public void exitConstructor(int declarationEnd) {}
-/**
- * exitField method comment.
- */
-public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) {}
-/**
- * exitMethod method comment.
- */
-public void exitMethod(int declarationEnd, int defaultValueStart, int defaultValueEnd) {}
-
-/**
- * enterInitializer method comment.
- */
-public void enterInitializer(int sourceStart, int sourceEnd) {
-}
-
-/**
- * exitInitializer method comment.
- */
-public void exitInitializer(int sourceEnd) {
-}
-/**
- * exitType method comment.
- */
-public void exitType(int declarationEnd) {}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java
deleted file mode 100644
index d3501c6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java
+++ /dev/null
@@ -1,995 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
-import org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CombinedBinaryExpression;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ExtendedStringLiteral;
-import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocSingleTypeReference;
-import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference;
-import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteral;
-import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteralConcatenation;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-/**
- * A tests series especially meant to validate the internals of our AST
- * implementation.
- */
-public class ASTImplTests extends AbstractRegressionTest {
-public ASTImplTests(String name) {
- super(name);
-}
-
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- // Only the highest compliance level is run; add the VM argument
- // -Dcompliance=1.4 (for example) to lower it if needed
- static {
-// TESTS_NAMES = new String[] { "test2050" };
-// TESTS_NUMBERS = new int[] { 3 };
-// TESTS_NUMBERS = new int[] { 2999 };
-// TESTS_RANGE = new int[] { 2050, -1 };
- }
-
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public static Class testClass() {
- return ASTImplTests.class;
-}
-
-// Helper methods
-static Parser defaultParser = new Parser(
- new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(),
- new DefaultProblemFactory()), false);
-public void runConformTest(String fileName, String fileContents,
- Parser parser, ASTCollector visitor, String expected) {
- CompilationUnit source =
- new CompilationUnit(fileContents.toCharArray(), fileName, null);
- CompilationResult compilationResult =
- new CompilationResult(source, 1, 1, 10);
- CompilationUnitDeclaration unit = parser.parse(source, compilationResult);
- assertEquals(0, compilationResult.problemCount);
- unit.traverse(visitor, unit.scope);
- String result = visitor.result();
- if (! expected.equals(result)) {
- System.out.println(getClass().getName() + '#' + getName());
- System.out.println("Expected:");
- System.out.println(expected);
- System.out.println("But was:");
- System.out.println(result);
- System.out.println("Cut and paste:");
- System.out.println(Util.displayString(result, INDENT, SHIFT));
- }
- assertEquals(expected, result);
-}
-
-// AST implementation - visiting binary expressions
-public void test0001_regular_binary_expression() {
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " var s2 = \"s2\";\n" +
- " var s3 = \"s3\";\n" +
- " var s4 = \"s4\";\n" +
- " println(s1 + \"l1\" + s2 + \"l2\" +\n" +
- " s3 + \"l3\" + s4);\n" +
- " }\n" +
- "\n",
- defaultParser,
- new ASTBinaryExpressionCollector(),
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v SL \"s2\"]\n" +
- "[ev SL \"s2\"]\n" +
- "[v SL \"s3\"]\n" +
- "[ev SL \"s3\"]\n" +
- "[v SL \"s4\"]\n" +
- "[ev SL \"s4\"]\n" +
- "[v BE ((((((s1 + \"l1\") + s...) + s4)]\n" +
- "[v BE (((((s1 + \"l1\") + s2...+ \"l3\")]\n" +
- "[v BE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v BE ((s1 + \"l1\") + s2)]\n" +
- "[v BE (s1 + \"l1\")]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[v SL \"l1\"]\n" +
- "[ev SL \"l1\"]\n" +
- "[ev BE (s1 + \"l1\")]\n" +
- "[v SNR s2]\n" +
- "[ev SNR s2]\n" +
- "[ev BE ((s1 + \"l1\") + s2)]\n" +
- "[v SL \"l2\"]\n" +
- "[ev SL \"l2\"]\n" +
- "[ev BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v SNR s3]\n" +
- "[ev SNR s3]\n" +
- "[ev BE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v SL \"l3\"]\n" +
- "[ev SL \"l3\"]\n" +
- "[ev BE (((((s1 + \"l1\") + s2...+ \"l3\")]\n" +
- "[v SNR s4]\n" +
- "[ev SNR s4]\n" +
- "[ev BE ((((((s1 + \"l1\") + s...) + s4)]\n");
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions
-public void test0002_combined_binary_expression() {
- CombinedBinaryExpression.defaultArityMaxStartingValue = 3;
- // one CBE each fourth BE
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " var s2 = \"s2\";\n" +
- " var s3 = \"s3\";\n" +
- " var s4 = \"s4\";\n" +
- " println(s1 + \"l1\" + s2 + \"l2\" +\n" +
- " s3 + \"l3\" + s4);\n" +
- " }\n" +
- "\n",
- defaultParser,
- new ASTBinaryExpressionCollector() {
- public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
- if (binaryExpression instanceof CombinedBinaryExpression &&
- ((CombinedBinaryExpression) binaryExpression).
- referencesTable != null) {
- this.collector.append("[ev CBE " +
- cut(binaryExpression.toString()) + "]\n");
- } else {
- super.endVisit(binaryExpression, scope);
- }
- }
- },
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v SL \"s2\"]\n" +
- "[ev SL \"s2\"]\n" +
- "[v SL \"s3\"]\n" +
- "[ev SL \"s3\"]\n" +
- "[v SL \"s4\"]\n" +
- "[ev SL \"s4\"]\n" +
- "[v BE ((((((s1 + \"l1\") + s...) + s4)]\n" +
- "[v BE (((((s1 + \"l1\") + s2...+ \"l3\")]\n" +
- "[v BE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v BE ((s1 + \"l1\") + s2)]\n" +
- "[v BE (s1 + \"l1\")]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[v SL \"l1\"]\n" +
- "[ev SL \"l1\"]\n" +
- "[ev BE (s1 + \"l1\")]\n" +
- "[v SNR s2]\n" +
- "[ev SNR s2]\n" +
- "[ev BE ((s1 + \"l1\") + s2)]\n" +
- "[v SL \"l2\"]\n" +
- "[ev SL \"l2\"]\n" +
- "[ev BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v SNR s3]\n" +
- "[ev SNR s3]\n" +
- "[ev CBE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v SL \"l3\"]\n" +
- "[ev SL \"l3\"]\n" +
- "[ev BE (((((s1 + \"l1\") + s2...+ \"l3\")]\n" +
- "[v SNR s4]\n" +
- "[ev SNR s4]\n" +
- "[ev BE ((((((s1 + \"l1\") + s...) + s4)]\n");
- CombinedBinaryExpression.defaultArityMaxStartingValue =
- CombinedBinaryExpression.ARITY_MAX_MIN;
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions
-public void test0003_combined_binary_expression() {
- Parser parser = new Parser(
- new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(),
- new DefaultProblemFactory()), true); // optimize string literals
- CombinedBinaryExpression.defaultArityMaxStartingValue = 2;
- // one CBE each third BE - except the top one, which is degenerate (no
- // references table)
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " var s2 = \"s2\";\n" +
- " var s3 = \"s3\";\n" +
- " var s4 = \"s4\";\n" +
- " println(s1 + \"l1\" + s2 + \"l2\" +\n" +
- " s3 + \"l3\" + s4);\n" +
- " }\n" +
- "\n",
- parser,
- new ASTBinaryExpressionCollector() {
- public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
- if (binaryExpression instanceof CombinedBinaryExpression &&
- ((CombinedBinaryExpression) binaryExpression).
- referencesTable != null) {
- this.collector.append("[ev CBE " +
- cut(binaryExpression.toString()) + "]\n");
- } else {
- super.endVisit(binaryExpression, scope);
- }
- }
- },
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v SL \"s2\"]\n" +
- "[ev SL \"s2\"]\n" +
- "[v SL \"s3\"]\n" +
- "[ev SL \"s3\"]\n" +
- "[v SL \"s4\"]\n" +
- "[ev SL \"s4\"]\n" +
- "[v BE ((((((s1 + \"l1\") + s...) + s4)]\n" +
- "[v BE (((((s1 + \"l1\") + s2...+ \"l3\")]\n" +
- "[v BE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v BE ((s1 + \"l1\") + s2)]\n" +
- "[v BE (s1 + \"l1\")]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[v SL \"l1\"]\n" +
- "[ev SL \"l1\"]\n" +
- "[ev BE (s1 + \"l1\")]\n" +
- "[v SNR s2]\n" +
- "[ev SNR s2]\n" +
- "[ev BE ((s1 + \"l1\") + s2)]\n" +
- "[v SL \"l2\"]\n" +
- "[ev SL \"l2\"]\n" +
- "[ev CBE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v SNR s3]\n" +
- "[ev SNR s3]\n" +
- "[ev BE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v SL \"l3\"]\n" +
- "[ev SL \"l3\"]\n" +
- "[ev BE (((((s1 + \"l1\") + s2...+ \"l3\")]\n" +
- "[v SNR s4]\n" +
- "[ev SNR s4]\n" +
- "[ev BE ((((((s1 + \"l1\") + s...) + s4)]\n");
- CombinedBinaryExpression.defaultArityMaxStartingValue =
- CombinedBinaryExpression.ARITY_MAX_MIN;
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions - effect of a literal at the start with
-// string literal optimization
-public void test0004_combined_binary_expression() {
- Parser parser = new Parser(
- new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- new CompilerOptions(),
- new DefaultProblemFactory()), true); // optimize string literals
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " println(\"l\" + \"1\" + s1);\n" +
- // "l" + "1" is collapsed into "l1" without affecting binary
- // expressions: only one BE
- " }\n" +
- "\n",
- parser,
- new ASTBinaryExpressionCollector(),
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v BE (ExtendedStringLiter...} + s1)]\n" +
- "[v ESL ExtendedStringLiteral{l1}]\n" +
- "[ev ESL ExtendedStringLiteral{l1}]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[ev BE (ExtendedStringLiter...} + s1)]\n");
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions - effect of a literal at the start without
-// string literals optimization
-public void test0005_combined_binary_expression() {
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " println(\"l\" + \"1\" + s1);\n" +
- // "l" + "1" is handled by a string literal concatenation without
- // affecting binary expressions: only one BE
- " }\n" +
- "\n",
- defaultParser,
- new ASTBinaryExpressionCollector(),
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v BE (StringLiteralConcat...} + s1)]\n" +
- "[v SLC StringLiteralConcate...\n" +
- "\"1\"+\n" +
- "}]\n" +
- "[v SL \"l\"]\n" +
- "[ev SL \"l\"]\n" +
- "[v SL \"1\"]\n" +
- "[ev SL \"1\"]\n" +
- "[ev SLC StringLiteralConcate...\n" +
- "\"1\"+\n" +
- "}]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[ev BE (StringLiteralConcat...} + s1)]\n");
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions - cutting the traversal half-way down
-public void test0006_combined_binary_expression() {
- CombinedBinaryExpression.defaultArityMaxStartingValue = 1;
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " var s2 = \"s2\";\n" +
- " var s3 = \"s3\";\n" +
- " var s4 = \"s4\";\n" +
- " println(s1 + \"l1\" + s2 + \"l2\" +\n" +
- " s3 + s1 + s4);\n" +
- " }\n" +
- "\n",
- defaultParser,
- new ASTBinaryExpressionCollector() {
- public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
- super.visit(binaryExpression, scope);
- if (binaryExpression.right instanceof StringLiteral) {
- return false;
- }
- return true;
- }
- },
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v SL \"s2\"]\n" +
- "[ev SL \"s2\"]\n" +
- "[v SL \"s3\"]\n" +
- "[ev SL \"s3\"]\n" +
- "[v SL \"s4\"]\n" +
- "[ev SL \"s4\"]\n" +
- "[v BE ((((((s1 + \"l1\") + s...) + s4)]\n" +
- "[v BE (((((s1 + \"l1\") + s2...) + s1)]\n" +
- "[v BE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[ev BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v SNR s3]\n" +
- "[ev SNR s3]\n" +
- "[ev BE ((((s1 + \"l1\") + s2)...) + s3)]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[ev BE (((((s1 + \"l1\") + s2...) + s1)]\n" +
- "[v SNR s4]\n" +
- "[ev SNR s4]\n" +
- "[ev BE ((((((s1 + \"l1\") + s...) + s4)]\n");
- CombinedBinaryExpression.defaultArityMaxStartingValue =
- CombinedBinaryExpression.ARITY_MAX_MIN;
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions - cutting the traversal right away
-public void test0007_combined_binary_expression() {
- CombinedBinaryExpression.defaultArityMaxStartingValue = 4;
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " var s2 = \"s2\";\n" +
- " var s3 = \"s3\";\n" +
- " var s4 = \"s4\";\n" +
- " println(s1 + \"l1\" + s2 + \"l2\" +\n" +
- " s3 + \"l3\" + s4);\n" +
- " }\n" +
- "\n",
- defaultParser,
- new ASTBinaryExpressionCollector() {
- public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
- super.visit(binaryExpression, scope);
- return false;
- }
- },
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v SL \"s2\"]\n" +
- "[ev SL \"s2\"]\n" +
- "[v SL \"s3\"]\n" +
- "[ev SL \"s3\"]\n" +
- "[v SL \"s4\"]\n" +
- "[ev SL \"s4\"]\n" +
- "[v BE ((((((s1 + \"l1\") + s...) + s4)]\n" +
- "[ev BE ((((((s1 + \"l1\") + s...) + s4)]\n");
- CombinedBinaryExpression.defaultArityMaxStartingValue =
- CombinedBinaryExpression.ARITY_MAX_MIN;
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions - case of one-deep expression
-public void test0008_combined_binary_expression() {
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " var s2 = \"s2\";\n" +
- " println(s1 + \"l1\" + s2 + \"l2\");\n" +
- " println(s1 + s2);\n" +
- " }\n" +
- "\n",
- defaultParser,
- new ASTBinaryExpressionCollector() {
- public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
- if (binaryExpression instanceof CombinedBinaryExpression) {
- this.collector.append("[ev CBE " +
- cut(binaryExpression.toString()) + "]\n");
- } else {
- super.endVisit(binaryExpression, scope);
- }
- }
- },
- "[v SL \"s1\"]\n" +
- "[ev SL \"s1\"]\n" +
- "[v SL \"s2\"]\n" +
- "[ev SL \"s2\"]\n" +
- "[v BE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v BE ((s1 + \"l1\") + s2)]\n" +
- "[v BE (s1 + \"l1\")]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[v SL \"l1\"]\n" +
- "[ev SL \"l1\"]\n" +
- "[ev BE (s1 + \"l1\")]\n" +
- "[v SNR s2]\n" +
- "[ev SNR s2]\n" +
- "[ev BE ((s1 + \"l1\") + s2)]\n" +
- "[v SL \"l2\"]\n" +
- "[ev SL \"l2\"]\n" +
- "[ev CBE (((s1 + \"l1\") + s2) + \"l2\")]\n" +
- "[v BE (s1 + s2)]\n" +
- "[v SNR s1]\n" +
- "[ev SNR s1]\n" +
- "[v SNR s2]\n" +
- "[ev SNR s2]\n" +
- "[ev BE (s1 + s2)]\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// check if the generated code is OK when leveraging CombinedBinaryExpression
-public void test0009_combined_binary_expression() {
- assertEquals(20, CombinedBinaryExpression.ARITY_MAX_MIN);
- this.runConformTest(
- new String[] {
- "X.js",
- " function main(args) {\n" +
- " var max = 30; \n" +
- " var s = new Array();\n" +
- " for (var i = 0; i < max; i++) {\n" +
- " s[i] = \"a\";\n" +
- " }\n" +
- " foo(s);\n" +
- "}\n" +
- " function foo (s) {\n" +
- " println(\n" +
- " s[0] + s[1] + s[2] + s[3] + s[4] + s[5] + s[6] + \n" +
- " s[7] + s[8] + s[9] + s[10] + s[11] + s[12] + s[13] +\n" +
- " s[14] + s[15] + s[16] + s[17] + s[18] + s[19] + \n" +
- " s[20] + s[21] + s[22] + s[23] + s[24] + s[25] + \n" +
- " s[26] + s[27] + s[28] + s[29]\n" +
- " );\n" +
- "}\n" +
- ""},
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// check if the generated code is OK when leveraging CombinedBinaryExpression
-// variant involving constant binary expressions deep in the tree
-public void test0010_combined_binary_expression() {
- assertEquals(20, CombinedBinaryExpression.ARITY_MAX_MIN);
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n" +
- " function main(String args[]) {\n" +
- " final int max = 30; \n" +
- " String s[] = new String[max];\n" +
- " for (int i = 0; i < max; i++) {\n" +
- " s[i] = \"a\";\n" +
- " }\n" +
- " foo(s);\n" +
- "}\n" +
- " function foo (s) {\n" +
- " var c = \"a\";" +
- " println(\n" +
- " c + c + c + c + s[4] + s[5] + s[6] + s[7] + s[8] + \n" +
- " s[9] + s[10] + s[11] + s[12] + s[13] + s[14] + \n" +
- " s[15] + s[16] + s[17] + s[18] + s[19] + s[20] + \n" +
- " s[21] + s[22] + s[23] + s[24] + s[25] + s[26] + \n" +
- " s[27] + s[28] + s[29]\n" +
- " );\n" +
- "}\n" +
- "}"
- },
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// check if the generated code is OK when leveraging CombinedBinaryExpression
-// variant involving a constant combined binary expression
-public void test0011_combined_binary_expression() {
- assertEquals(20, CombinedBinaryExpression.ARITY_MAX_MIN);
- this.runConformTest(
- new String[] {
- "X.js",
- " function main(String args[]) {\n" +
- " var max = 30; \n" +
- " var s = new Array();\n" +
- " for (var i = 0; i < max; i++) {\n" +
- " s[i] = \"a\";\n" +
- " }\n" +
- " foo(s);\n" +
- "}\n" +
- " function foo (s) {\n" +
- " var c = \"a\";" +
- " println(\n" +
- " c + c + c + c + c + c + c + c + c + c + \n" +
- " c + c + c + c + c + c + c + c + c + c + \n" +
- " c + c + s[22] + s[23] + s[24] + s[25] + s[26] + \n" +
- " s[27] + s[28] + s[29]\n" +
- " );\n" +
- "}\n" +
- ""
- },
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
-}
-
-// AST implementation - visiting binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions - checking recursive print
-public void test0012_combined_binary_expression() {
- CombinedBinaryExpression.defaultArityMaxStartingValue = 2;
- runConformTest(
- "X.js",
- " function foo() {\n" +
- " var s1 = \"s1\";\n" +
- " var s2 = \"s2\";\n" +
- " var s3 = \"s3\";\n" +
- " var s4 = \"s4\";\n" +
- " println(s1 + \"l1\" + s2 + \"l2\" +\n" +
- " s3 + s1 + s4);\n" +
- " }\n" +
- "\n",
- defaultParser,
- new ASTCollector() {
- public boolean visit(BinaryExpression binaryExpression,
- BlockScope scope) {
- super.visit(binaryExpression, scope);
- this.collector.append(binaryExpression);
- return true;
- }
- },
- "((((((s1 + \"l1\") + s2) + \"l2\") + s3) + s1) + s4)(((((s1 + \"l1\")" +
- " + s2) + \"l2\") + s3) + s1)((((s1 + \"l1\") + s2) + \"l2\") + s3)" +
- "(((s1 + \"l1\") + s2) + \"l2\")((s1 + \"l1\") + s2)(s1 + \"l1\")");
- CombinedBinaryExpression.defaultArityMaxStartingValue =
- CombinedBinaryExpression.ARITY_MAX_MIN;
-}
-
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-//// check if the generated code is OK when leveraging CombinedBinaryExpression
-//// variant involving a left-deep right expression at the topmost level
-//public void test0013_combined_binary_expression() {
-// assertEquals(20, CombinedBinaryExpression.ARITY_MAX_MIN);
-// this.runConformTest(
-// new String[] {
-// "X.js",
-// " function main(var args[]) {\n" +
-// " final int max = 30; \n" +
-// " var s[] = new String[max];\n" +
-// " for (int i = 0; i < max; i++) {\n" +
-// " s[i] = \"a\";\n" +
-// " }\n" +
-// " foo(s);\n" +
-// "}\n" +
-// " function foo (var s[]) {\n" +
-// " println(\n" +
-// " \"b\" + (s[0] + s[1] + s[2] + s[3] + s[4] + s[5] + s[6] + \n" +
-// " s[7] + s[8] + s[9] + s[10] + s[11] + s[12] + s[13] +\n" +
-// " s[14] + s[15] + s[16] + s[17] + s[18] + s[19] + \n" +
-// " s[20] + s[21] + s[22] + s[23] + s[24] + s[25] + \n" +
-// " s[26] + s[27] + s[28] + s[29])\n" +
-// " );\n" +
-// "}\n" +
-// "}"
-// },
-// "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
-//}
-
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-//// check if the generated code is OK when leveraging CombinedBinaryExpression
-//// variant involving a left-deep right expression at the topmost level, with
-//// a constant high in tree
-//public void test0014_combined_binary_expression() {
-// assertEquals(20, CombinedBinaryExpression.ARITY_MAX_MIN);
-// this.runConformTest(
-// new String[] {
-// "X.js",
-// " class X {\n" +
-// " function main(var args[]) {\n" +
-// " final int max = 30; \n" +
-// " var s[] = new String[max];\n" +
-// " for (int i = 0; i < max; i++) {\n" +
-// " s[i] = \"a\";\n" +
-// " }\n" +
-// " foo(s);\n" +
-// "}\n" +
-// " function foo (var s[]) {\n" +
-// " final var c = \"c\";\n" +
-// " println(\n" +
-// " \"b\" + \n" +
-// " (c + c + c + c + c + c + c + c + c + c + \n" +
-// " c + c + c + c + c + c + c + c + c + c + \n" +
-// " c + c + s[0])\n" +
-// " );\n" +
-// "}\n" +
-// "}"
-// },
-// "bcccccccccccccccccccccca");
-//}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// check if the generated code is OK when leveraging CombinedBinaryExpression
-// variant involving a left-deep right expression at the topmost level, with
-// a constant low in tree
-//public void test0015_combined_binary_expression() {
-// assertEquals(20, CombinedBinaryExpression.ARITY_MAX_MIN);
-// this.runConformTest(
-// new String[] {
-// "X.js",
-// " class X {\n" +
-// " function main(var args[]) {\n" +
-// " final int max = 30; \n" +
-// " var s[] = new String[max];\n" +
-// " for (int i = 0; i < max; i++) {\n" +
-// " s[i] = \"a\";\n" +
-// " }\n" +
-// " foo(s);\n" +
-// "}\n" +
-// " function foo (var s[]) {\n" +
-// " final var c = \"c\";\n" +
-// " println(\n" +
-// " \"b\" + \n" +
-// " (c + c + c + c + c + c + c + c + c + c + \n" +
-// " c + c + c + c + c + c + c + c + c + c + \n" +
-// " s[0] + s[1] + s[2])\n" +
-// " );\n" +
-// "}\n" +
-// "}"
-// },
-// "bccccccccccccccccccccaaa");
-//}
-
-// AST implementation - binary expressions
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Adding combined binary expressions - alternate operands
-public void test0016_combined_binary_expression() {
- CombinedBinaryExpression.defaultArityMaxStartingValue = 2;
- this.runConformTest(
- "X.js",
- "function foo( i1, i2, i3, i4) {\n" +
- " println(i1 - i2 + 0 + i3 + 0 + i4);\n" +
- "}\n" +
- "\n",
- defaultParser,
- new ASTCollector() {
- public boolean visit(BinaryExpression binaryExpression,
- BlockScope scope) {
- super.visit(binaryExpression, scope);
- this.collector.append(binaryExpression);
- return true;
- }
- },
- "(((((i1 - i2) + 0) + i3) + 0) + i4)((((i1 - i2) + 0) + i3) + 0)" +
- "(((i1 - i2) + 0) + i3)((i1 - i2) + 0)(i1 - i2)");
- CombinedBinaryExpression.defaultArityMaxStartingValue =
- CombinedBinaryExpression.ARITY_MAX_MIN;
-}
-
-//
-//
-////https://bugs.eclipse.org/bugs/show_bug.cgi?id=157170
-//public void test0017() {
-// CompilerOptions options = new CompilerOptions();
-// options.complianceLevel = ClassFileConstants.JDK1_5;
-// options.sourceLevel = ClassFileConstants.JDK1_5;
-// options.targetJDK = ClassFileConstants.JDK1_5;
-// this.runConformTest(
-// "X.js",
-// "@interface Annot {\n" +
-// " int value() default 0;\n" +
-// "}\n" +
-// "@Annot\n" +
-// "@Annot(3)\n" +
-// "@Annot(value=4)\n" +
-// " class X {\n" +
-// "}\n",
-// new Parser(
-// new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
-// options,
-// new DefaultProblemFactory()), false),
-// new AnnotationCollector(),
-// "marker annotation start visit\n" +
-// "marker annotation end visit\n" +
-// "single member annotation start visit\n" +
-// "3\n" +
-// "single member annotation end visit\n" +
-// "normal annotation start visit\n" +
-// "member value pair start visit\n" +
-// "value, 4\n" +
-// "member value pair end visit\n" +
-// "normal annotation end visit\n");
-//}
-////https://bugs.eclipse.org/bugs/show_bug.cgi?id=157170
-//public void test0018() {
-// CompilerOptions options = new CompilerOptions();
-// options.complianceLevel = ClassFileConstants.JDK1_5;
-// options.sourceLevel = ClassFileConstants.JDK1_5;
-// options.targetJDK = ClassFileConstants.JDK1_5;
-// options.docCommentSupport = true;
-// this.runConformTest(
-// "X.js",
-// "@interface Annot {\n" +
-// " int value() default 0;\n" +
-// "}\n" +
-// "/**\n" +
-// " * @see Annot\n" +
-// " */\n" +
-// "@Annot\n" +
-// "@Annot(3)\n" +
-// "@Annot(value=4)\n" +
-// " class X {\n" +
-// " /**\n" +
-// " * @see Annot\n" +
-// " */\n" +
-// " public function foo() {}\n" +
-// "}\n",
-// new Parser(
-// new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
-// options,
-// new DefaultProblemFactory()), false),
-// new AnnotationCollector(),
-// "java doc single type reference start visit\n" +
-// "java doc single type reference end visit\n" +
-// "marker annotation start visit\n" +
-// "marker annotation end visit\n" +
-// "single member annotation start visit\n" +
-// "3\n" +
-// "single member annotation end visit\n" +
-// "normal annotation start visit\n" +
-// "member value pair start visit\n" +
-// "value, 4\n" +
-// "member value pair end visit\n" +
-// "normal annotation end visit\n" +
-// "java doc single type reference start visit\n" +
-// "java doc single type reference end visit\n");
-//}
-////https://bugs.eclipse.org/bugs/show_bug.cgi?id=157170
-//public void test0019() {
-// CompilerOptions options = new CompilerOptions();
-// options.complianceLevel = ClassFileConstants.JDK1_5;
-// options.sourceLevel = ClassFileConstants.JDK1_5;
-// options.targetJDK = ClassFileConstants.JDK1_5;
-// options.docCommentSupport = true;
-// this.runConformTest(
-// "X.js",
-// "@interface Annot {\n" +
-// " int value() default 0;\n" +
-// "}\n" +
-// "/**\n" +
-// " * @see Annot\n" +
-// " */\n" +
-// "@Annot\n" +
-// "@Annot(3)\n" +
-// "@Annot(value=4)\n" +
-// "public class X {\n" +
-// " /**\n" +
-// " * @see Annot\n" +
-// " */\n" +
-// " public function foo(@Annot int i) {\n" +
-// " @Annot int j = 0;" +
-// " }\n" +
-// "}\n",
-// new Parser(
-// new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
-// options,
-// new DefaultProblemFactory()), false),
-// new AnnotationCollector(),
-// "java doc single type reference start visit\n" +
-// "java doc single type reference end visit\n" +
-// "marker annotation start visit\n" +
-// "marker annotation end visit\n" +
-// "single member annotation start visit\n" +
-// "3\n" +
-// "single member annotation end visit\n" +
-// "normal annotation start visit\n" +
-// "member value pair start visit\n" +
-// "value, 4\n" +
-// "member value pair end visit\n" +
-// "normal annotation end visit\n" +
-// "java doc single type reference start visit\n" +
-// "java doc single type reference end visit\n" +
-// "start argument\n" +
-// "marker annotation start visit\n" +
-// "marker annotation end visit\n" +
-// "exit argument\n" +
-// "start local declaration\n" +
-// "marker annotation start visit\n" +
-// "marker annotation end visit\n" +
-// "exit local declaration\n");
-//}
-}
-
-// Helper classes: define visitors leveraged by some tests
-class ASTCollector extends ASTVisitor {
- StringBuffer collector = new StringBuffer();
-public String result() {
- return this.collector.toString();
-}
-}
-
-class ASTBinaryExpressionCollector extends ASTCollector {
-static final int LIMIT = 30;
-// help limit the output in length by suppressing the middle
-// part of strings which length exceeds LIMIT
-String cut(String source) {
- int length;
- if ((length = source.length()) > LIMIT) {
- StringBuffer result = new StringBuffer(length);
- result.append(source.substring(0, LIMIT - 10));
- result.append("...");
- result.append(source.substring(length - 7, length));
- return result.toString();
- } else {
- return source;
- }
-}
-public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
- this.collector.append("[ev BE " + cut(binaryExpression.toString()) + "]\n");
- super.endVisit(binaryExpression, scope);
-}
-
-public void endVisit(ExtendedStringLiteral literal, BlockScope scope) {
- this.collector.append("[ev ESL " + cut(literal.toString()) + "]\n");
- super.endVisit(literal, scope);
-}
-
-public void endVisit(SingleNameReference singleNameReference,
- BlockScope scope) {
- this.collector.append("[ev SNR " + cut(singleNameReference.toString()) +
- "]\n");
- super.endVisit(singleNameReference, scope);
-}
-
-public void endVisit(StringLiteral stringLiteral, BlockScope scope) {
- this.collector.append("[ev SL " + cut(stringLiteral.toString()) + "]\n");
- super.endVisit(stringLiteral, scope);
-}
-
-public void endVisit(StringLiteralConcatenation literal, BlockScope scope) {
- this.collector.append("[ev SLC " + cut(literal.toString()) + "]\n");
- super.endVisit(literal, scope);
-}
-
-public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
- this.collector.append("[v BE " + cut(binaryExpression.toString()) + "]\n");
- return super.visit(binaryExpression, scope);
-}
-
-public boolean visit(ExtendedStringLiteral literal, BlockScope scope) {
- this.collector.append("[v ESL " + cut(literal.toString()) + "]\n");
- return super.visit(literal, scope);
-}
-
-public boolean visit(SingleNameReference singleNameReference,
- BlockScope scope) {
- this.collector.append("[v SNR " + cut(singleNameReference.toString()) +
- "]\n");
- return super.visit(singleNameReference, scope);
-}
-
-public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
- this.collector.append("[v SL " + cut(stringLiteral.toString()) + "]\n");
- return super.visit(stringLiteral, scope);
-}
-
-public boolean visit(StringLiteralConcatenation literal, BlockScope scope) {
- this.collector.append("[v SLC " + cut(literal.toString()) + "]\n");
- return super.visit(literal, scope);
-}
-}
-class AnnotationCollector extends ASTCollector {
-public void endVisit(JavadocSingleTypeReference typeRef, BlockScope scope) {
- this.collector.append("java doc single type reference end visit\n");
-}
-public void endVisit(JavadocSingleTypeReference typeRef, ClassScope scope) {
- this.collector.append("java doc single type reference end visit\n");
-}
-public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) {
- this.collector.append("java doc single type reference start visit\n");
- return true;
-}
-public boolean visit(JavadocSingleTypeReference typeRef, ClassScope scope) {
- this.collector.append("java doc single type reference start visit\n");
- return true;
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.wst.jsdt.internal.compiler.ast.Argument, org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope)
- */
-public void endVisit(Argument argument, BlockScope scope) {
- this.collector.append("exit argument\n");
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.wst.jsdt.internal.compiler.ast.Argument, org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope)
- */
-public void endVisit(Argument argument, ClassScope scope) {
- this.collector.append("exit argument\n");
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.compiler.ASTVisitor#endVisit(org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration, org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope)
- */
-public void endVisit(LocalDeclaration localDeclaration, BlockScope scope) {
- this.collector.append("exit local declaration\n");
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.compiler.ASTVisitor#visit(org.eclipse.wst.jsdt.internal.compiler.ast.Argument, org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope)
- */
-public boolean visit(Argument argument, BlockScope scope) {
- this.collector.append("start argument\n");
- return true;
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.compiler.ASTVisitor#visit(org.eclipse.wst.jsdt.internal.compiler.ast.Argument, org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope)
- */
-public boolean visit(Argument argument, ClassScope scope) {
- this.collector.append("start argument\n");
- return true;
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.compiler.ASTVisitor#visit(org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration, org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope)
- */
-public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
- this.collector.append("start local declaration\n");
- return true;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java
deleted file mode 100644
index fc969d6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class AbstractComparableTest extends AbstractRegressionTest {
- public static Test buildComparableTestSuite(Class evaluationTestClass) {
- Test suite = buildMinimalComplianceTestSuite(evaluationTestClass, F_1_5);
- TESTS_COUNTERS.put(evaluationTestClass.getName(), new Integer(suite
- .countTestCases()));
- return suite;
- }
-
- public AbstractComparableTest(String name) {
- super(name);
- }
-
- /*
- * Toggle compiler in mode -1.5
- */
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_Compliance,
- CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_TargetPlatform,
- CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_ReportFinalParameterBound,
- CompilerOptions.WARNING);
- options.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck,
- CompilerOptions.WARNING);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference,
- CompilerOptions.WARNING);
- return options;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractRegressionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractRegressionTest.java
deleted file mode 100644
index 0fc895e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ /dev/null
@@ -1,1721 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Map;
-
-import junit.framework.AssertionFailedError;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.core.infer.DefaultInferrenceProvider;
-import org.eclipse.wst.jsdt.core.infer.IInferEngine;
-import org.eclipse.wst.jsdt.core.infer.InferEngine;
-import org.eclipse.wst.jsdt.core.infer.InferOptions;
-import org.eclipse.wst.jsdt.core.infer.InferrenceProvider;
-import org.eclipse.wst.jsdt.core.search.SearchDocument;
-import org.eclipse.wst.jsdt.core.search.SearchParticipant;
-import org.eclipse.wst.jsdt.core.tests.junit.extension.StopableTestCase;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.core.tests.util.CompilerTestSetup;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.Compiler;
-import org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies;
-import org.eclipse.wst.jsdt.internal.compiler.ICompilerRequestor;
-import org.eclipse.wst.jsdt.internal.compiler.IErrorHandlingPolicy;
-import org.eclipse.wst.jsdt.internal.compiler.IProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.SourceJavadocParser;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.batch.FileSystem;
-import org.eclipse.wst.jsdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.env.INameEnvironment;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.impl.ReferenceContext;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeConstants;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
-import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-import org.eclipse.wst.jsdt.internal.core.search.JavaSearchParticipant;
-import org.eclipse.wst.jsdt.internal.core.search.indexing.SourceIndexer;
-
-public abstract class AbstractRegressionTest extends AbstractCompilerTest
- implements StopableTestCase {
- // javac comparison related types, fields and methods - see runJavac for
- // details
- class Logger extends Thread {
- StringBuffer buffer;
- InputStream inputStream;
- String type;
-
- Logger(InputStream inputStream, String type) {
- this.inputStream = inputStream;
- this.type = type;
- this.buffer = new StringBuffer();
- }
-
- public void run() {
- try {
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(this.inputStream));
- String line = null;
- while ((line = reader.readLine()) != null) {
- this.buffer./* append(this.type).append("->"). */append(
- line).append("\n");
- }
- reader.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- protected static int[] DIFF_COUNTERS = new int[3];
- protected static final String EVAL_DIRECTORY = Util.getOutputDirectory()
- + File.separator + "eval";
- public static int INDENT = 2;
- protected static final String JAVA_NAME = File.pathSeparatorChar == ':' ? "java"
- : "java.exe";
- protected static final String JAVAC_NAME = File.pathSeparatorChar == ':' ? "javac"
- : "javac.exe";
-
- protected static String JAVAC_OUTPUT_DIR = Util.getOutputDirectory()
- + File.separator + "javac";
- protected static String javacCommandLineHeader;
- protected static PrintWriter javacFullLog;
- // flags errors so that any error in a test case prevents
- // java execution
- private static String javacFullLogFileName;
- protected static String javaCommandLineHeader;
-
- // needed for multiple test calls within a single test method
- protected static boolean javacTestErrorFlag;
-
- protected static String javacTestName;
-
- protected static IPath jdkRootDirPath;
-
- public static final String OUTPUT_DIR = Util.getOutputDirectory()
- + File.separator + "regression";
-
- public final static String PACKAGE_INFO_NAME = new String(
- TypeConstants.PACKAGE_INFO_NAME);
-
- public static boolean SHIFT = false;
-
- protected static final String SOURCE_DIRECTORY = Util.getOutputDirectory()
- + File.separator + "source";
-
- public static final String INFERENCE_ENGINES = "InferenceEnginesOption";
-
- protected String[] classpaths;
-// protected boolean createdVerifier;
- protected INameEnvironment javaClassLib;
-// protected TestVerifier verifier;
-
- public AbstractRegressionTest(String name) {
- super(name);
- }
-
- // protected void checkClassFile(String className, String source, String
- // expectedOutput) throws ClassFormatException, IOException {
- // // this.checkClassFile("", className, source, expectedOutput,
- // ClassFileBytesDisassembler.SYSTEM);
- // }
- // protected void checkClassFile(String className, String source, String
- // expectedOutput, int mode) throws ClassFormatException, IOException {
- // this.checkClassFile("", className, source, expectedOutput, mode);
- // }
- // protected void checkClassFile(String directoryName, String className,
- // String disassembledClassName, String source, String expectedOutput, int
- // mode) throws ClassFormatException, IOException {
- // // compileAndDeploy(source, directoryName, className);
- // // try {
- // // File directory = new File(EVAL_DIRECTORY, directoryName);
- // // if (!directory.exists()) {
- // // assertTrue(".class file not generated properly in " + directory,
- // false);
- // // }
- // // File f = new File(directory, disassembledClassName + ".class");
- // // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // // String result = disassembler.disassemble(classFileBytes, "\n", mode);
- // // int index = result.indexOf(expectedOutput);
- // // if (index == -1 || expectedOutput.length() == 0) {
- // // System.out.println(Util.displayString(result, 3));
- // // }
- // // if (index == -1) {
- // // assertEquals("Wrong contents", expectedOutput, result);
- // // }
- // //
- // // try {
- // // FileInputStream stream = new FileInputStream(f);
- // // ClassFileReader.read(stream, className + ".class", true);
- // // stream.close();
- // // } catch
- // (org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFormatException e)
- // {
- // // e.printStackTrace();
- // // assertTrue("ClassFormatException", false);
- // // } catch (IOException e) {
- // // e.printStackTrace();
- // // assertTrue("IOException", false);
- // // }
- // // } finally {
- // // removeTempClass(className);
- // // }
- // }
- //
- // protected void checkClassFile(String directoryName, String className,
- // String source, String expectedOutput, int mode) throws
- // ClassFormatException, IOException {
- // this.checkClassFile(directoryName, className, className, source,
- // expectedOutput, mode);
- // }
- //
- protected void checkDisassembledClassFile(String fileName,
- String className, String expectedOutput) {
- // this.checkDisassembledClassFile(fileName, className, expectedOutput,
- // ClassFileBytesDisassembler.DETAILED);
- }
-
- protected void checkDisassembledClassFile(String fileName,
- String className, String expectedOutput, int mode) {
- // File classFile = new File(fileName);
- // if (!classFile.exists()) {
- // assertTrue(".class file doesn't exist", false);
- // }
- // String result = null;
- // try {
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(classFile);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // result = disassembler.disassemble(classFileBytes, "\n", mode);
- // } catch (IOException e) {
- // e.printStackTrace();
- // assertTrue("Should not happen : ", false);
- // } catch (ClassFormatException e) {
- // e.printStackTrace();
- // assertTrue("Should not happen : ", false);
- // }
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 2));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- //
- // try {
- // FileInputStream stream = new FileInputStream(classFile);
- // ClassFileReader.read(stream, className + ".class", true);
- // stream.close();
- // } catch
- // (org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFormatException
- // e) {
- // e.printStackTrace();
- // assertTrue("ClassFormatException", false);
- // } catch (IOException e) {
- // e.printStackTrace();
- // assertTrue("IOException", false);
- // }
- }
-
- /*
- * ###################################### Specific method to let tests Sun
- * javac compilation available... #######################################
- */
- protected void compileAndDeploy(String source, String directoryName,
- String className) {
- File directory = new File(SOURCE_DIRECTORY);
- if (!directory.exists()) {
- if (!directory.mkdirs()) {
- System.out.println("Could not create " + SOURCE_DIRECTORY);
- return;
- }
- }
- if (directoryName != null && directoryName.length() != 0) {
- directory = new File(SOURCE_DIRECTORY, directoryName);
- if (!directory.exists()) {
- if (!directory.mkdirs()) {
- System.out.println("Could not create " + directory);
- return;
- }
- }
- }
- String fileName = directory.getAbsolutePath() + File.separator
- + className + ".java";
- try {
- BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
- writer.write(source);
- writer.flush();
- writer.close();
- } catch (IOException e) {
- e.printStackTrace();
- return;
- }
- StringBuffer buffer = new StringBuffer().append("\"").append(fileName)
- .append("\" -d \"").append(EVAL_DIRECTORY);
- if (this.complianceLevel.compareTo(COMPLIANCE_1_5) < 0) {
- buffer.append("\" -1.4 -source 1.3 -target 1.2");
- } else {
- buffer.append("\" -1.5");
- }
- buffer.append(" -preserveAllLocals -nowarn -g -classpath \"").append(
- Util.getJavaClassLibsAsString()).append(SOURCE_DIRECTORY)
- .append("\"");
- org.eclipse.wst.jsdt.internal.compiler.batch.Main.compile(buffer
- .toString());
- }
-
- protected void dualPrintln(String message) {
- System.out.println(message);
- javacFullLog.println(message);
- }
-
- protected void executeClass(String sourceFile,
- String expectedSuccessOutputString, String[] classLib,
- boolean shouldFlushOutputDirectory, String[] vmArguments,
- Map customOptions, ICompilerRequestor clientRequestor) {
-
- // Compute class name by removing ".java" and replacing slashes with
- // dots
- String className = sourceFile.substring(0, sourceFile.length() - 5)
- .replace('/', '.').replace('\\', '.');
- if (className.endsWith(PACKAGE_INFO_NAME))
- return;
-
-// if (vmArguments != null) {
-// if (this.verifier != null) {
-// this.verifier.shutDown();
-// }
-// this.verifier = new TestVerifier(false);
-// this.createdVerifier = true;
-// }
-// boolean passed = this.verifier
-// .verifyClassFiles(sourceFile, className,
-// expectedSuccessOutputString, this.classpaths, null,
-// vmArguments);
-// assertTrue(this.verifier.failureReason, // computed by
-// // verifyClassFiles(...) action
-// passed);
-// if (vmArguments != null) {
-// if (this.verifier != null) {
-// this.verifier.shutDown();
-// }
-// this.verifier = new TestVerifier(false);
-// this.createdVerifier = true;
-// }
- }
-
- /*
- * Returns the references in the given .class file.
- */
- protected String findReferences(String classFilePath) {
- // check that "new Z().init()" is bound to "AbstractB.init()"
- final StringBuffer references = new StringBuffer(10);
- final SearchParticipant participant = new JavaSearchParticipant() {
- final SearchParticipant searchParticipant = this;
-
- public SearchDocument getDocument(final String documentPath) {
- return new SearchDocument(documentPath, this.searchParticipant) {
- public byte[] getByteContents() {
- try {
- return org.eclipse.wst.jsdt.internal.compiler.util.Util
- .getFileByteContent(new File(getPath()));
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public char[] getCharContents() {
- // not used
- return null;
- }
-
- public String getEncoding() {
- // not used
- return null;
- }
- };
- }
- };
- SearchDocument document = participant.getDocument(new File(
- classFilePath).getPath());
- SourceIndexer indexer = new SourceIndexer(document) {
- protected void addIndexEntry(char[] category, char[] key) {
- references.append(category);
- references.append('/');
- references.append(key);
- references.append('\n');
- }
- };
- indexer.indexDocument();
- String computedReferences = references.toString();
- return computedReferences;
- }
-
- protected INameEnvironment[] getClassLibs() {
- String encoding = (String) getCompilerOptions().get(
- CompilerOptions.OPTION_Encoding);
- if ("".equals(encoding))
- encoding = null;
-
- INameEnvironment[] classLibs = new INameEnvironment[1];
- classLibs[0] = new FileSystem(this.classpaths, new String[] {}, // ignore
- // initial
- // file
- // names
- encoding // default encoding
- );
- return classLibs;
- }
-
- protected Map getCompilerOptions() {
- Map defaultOptions = super.getCompilerOptions();
- defaultOptions.put(CompilerOptions.OPTION_LocalVariableAttribute,
- CompilerOptions.GENERATE);
- defaultOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember,
- CompilerOptions.WARNING);
- defaultOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding,
- CompilerOptions.WARNING);
- defaultOptions.put(CompilerOptions.OPTION_ReportFieldHiding,
- CompilerOptions.WARNING);
- defaultOptions
- .put(
- CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment,
- CompilerOptions.WARNING);
- defaultOptions.put(CompilerOptions.OPTION_ReportWrongNumberOfArguments,
- CompilerOptions.WARNING);
- defaultOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal,
- CompilerOptions.PRESERVE);
- defaultOptions.put(CompilerOptions.OPTION_ReportUnnecessaryElse,
- CompilerOptions.WARNING);
- defaultOptions.put(CompilerOptions.OPTION_Unresolved_Field,
- CompilerOptions.ERROR);
- defaultOptions.put(CompilerOptions.OPTION_Unresolved_Method,
- CompilerOptions.ERROR);
- defaultOptions.put(CompilerOptions.OPTION_Unresolved_Type,
- CompilerOptions.ERROR);
- defaultOptions.put(CompilerOptions.OPTION_ReportUninitializedLocalVariable,
- CompilerOptions.WARNING);
- defaultOptions.put(CompilerOptions.OPTION_ReportUninitializedGlobalVariable,
- CompilerOptions.IGNORE);
- defaultOptions.put(CompilerOptions.OPTION_ReportUnusedLocal,
- CompilerOptions.WARNING);
- return defaultOptions;
- }
-
- protected String[] getDefaultClassPaths() {
- return Util.concatWithClassLibs(OUTPUT_DIR, false);
- }
-
- protected IErrorHandlingPolicy getErrorHandlingPolicy() {
- return new IErrorHandlingPolicy() {
- public boolean stopOnFirstError() {
- return false;
- }
-
- public boolean proceedOnErrors() {
- return true;
- }
- };
- }
-
- /*
- * Will consider first the source units passed as arguments, then
- * investigate the classpath: jdklib + output dir
- */
- protected INameEnvironment getNameEnvironment(final String[] testFiles,
- String[] classPaths) {
- this.classpaths = classPaths == null ? getDefaultClassPaths()
- : classPaths;
- return new InMemoryNameEnvironment(testFiles, getClassLibs());
- }
-
- protected INameEnvironment getNameEnvironment(final String[] testFiles,
- String[] files, String[] classPaths) {
- this.classpaths = classPaths == null ? getDefaultClassPaths()
- : classPaths;
- InMemoryNameEnvironment inMemoryNameEnvironment = new InMemoryNameEnvironment(
- testFiles, getClassLibs());
- return inMemoryNameEnvironment;
- }
-
- protected IProblemFactory getProblemFactory() {
- return new DefaultProblemFactory(Locale.getDefault());
- }
-
- public void initialize(CompilerTestSetup setUp) {
- super.initialize(setUp);
- if (setUp instanceof RegressionTestSetup) {
- RegressionTestSetup regressionTestSetUp = (RegressionTestSetup) setUp;
- this.javaClassLib = regressionTestSetUp.javaClassLib;
-// this.verifier = regressionTestSetUp.verifier;
- }
- }
-
- /*
- * Write given source test files in current output sub-directory. Use test
- * name for this sub-directory name (ie. test001, test002, etc...)
- */
- protected void printFiles(String[] testFiles) {
- for (int i = 0, length = testFiles.length; i < length; i++) {
- System.out.println(testFiles[i++]);
- System.out.println(testFiles[i]);
- }
- System.out.println("");
- }
-
- protected void printJavacResultsSummary() {
- if (RUN_JAVAC) {
- Integer count = (Integer) TESTS_COUNTERS.get(CURRENT_CLASS_NAME);
- if (count != null) {
- int newCount = count.intValue() - 1;
- TESTS_COUNTERS.put(CURRENT_CLASS_NAME, new Integer(newCount));
- if (newCount == 0) {
- if (DIFF_COUNTERS[0] != 0 || DIFF_COUNTERS[1] != 0
- || DIFF_COUNTERS[2] != 0) {
- dualPrintln("===========================================================================");
- dualPrintln("Results summary:");
- }
- if (DIFF_COUNTERS[0] != 0)
- dualPrintln(" - "
- + DIFF_COUNTERS[0]
- + " test(s) where Javac found errors/warnings but Eclipse did not");
- if (DIFF_COUNTERS[1] != 0)
- dualPrintln(" - "
- + DIFF_COUNTERS[1]
- + " test(s) where Eclipse found errors/warnings but Javac did not");
- if (DIFF_COUNTERS[2] != 0)
- dualPrintln(" - "
- + DIFF_COUNTERS[2]
- + " test(s) where Eclipse and Javac did not have same output");
- System.out.println("\n");
- }
- }
- dualPrintln("\n\nFull results sent to " + javacFullLogFileName);
- javacFullLog.flush();
- }
- }
-
- protected void removeTempClass(String className) {
- File dir = new File(SOURCE_DIRECTORY);
- String[] fileNames = dir.list();
- if (fileNames != null) {
- for (int i = 0, max = fileNames.length; i < max; i++) {
- if (fileNames[i].indexOf(className) != -1) {
- Util.delete(SOURCE_DIRECTORY + File.separator
- + fileNames[i]);
- }
- }
- }
-
- dir = new File(EVAL_DIRECTORY);
- fileNames = dir.list();
- if (fileNames != null) {
- for (int i = 0, max = fileNames.length; i < max; i++) {
- if (fileNames[i].indexOf(className) != -1) {
- Util.delete(EVAL_DIRECTORY + File.separator + fileNames[i]);
- }
- }
- }
-
- }
-
- protected void runConformTest(String[] testFiles) {
- runConformTest(testFiles, null /* no expected output string */,
- null /* no extra class libraries */, true /*
- * flush output
- * directory
- */, null /*
- * no vm
- * arguments
- */, null /*
- * no
- * custom
- * options
- */,
- null /* no custom requestor */, false /*
- * do not skip javac for
- * this peculiar test
- */);
- }
-
- protected void runConformTest(String[] testFiles,
- String expectedSuccessOutputString) {
- runConformTest(testFiles, expectedSuccessOutputString, null /*
- * no extra
- * class
- * libraries
- */,
- true /* flush output directory */, null /* no vm arguments */,
- null /* no custom options */, null /* no custom requestor */,
- false /* do not skip javac for this peculiar test */);
- }
-
- protected void runConformTest(String[] testFiles,
- String expectedSuccessOutputString, String[] vmArguments) {
- runConformTest(testFiles, expectedSuccessOutputString, null /*
- * no extra
- * class
- * libraries
- */,
- true /* flush output directory */, vmArguments, null /*
- * no custom
- * options
- */,
- null /* no custom requestor */, false /*
- * do not skip javac for
- * this peculiar test
- */);
- }
-
- protected void runConformTest(String[] testFiles,
- String expectedSuccessOutputString, String[] classLib,
- boolean shouldFlushOutputDirectory, String[] vmArguments) {
- runConformTest(testFiles, expectedSuccessOutputString, classLib,
- shouldFlushOutputDirectory, vmArguments,
- null /* no custom options */, null /* no custom requestor */,
- false /* do not skip javac for this peculiar test */);
- }
-
- protected void runConformTest(String[] testFiles,
- String expectedSuccessOutputString, String[] classLib,
- boolean shouldFlushOutputDirectory, String[] vmArguments,
- Map customOptions, ICompilerRequestor clientRequestor) {
- runConformTest(testFiles, expectedSuccessOutputString, classLib,
- shouldFlushOutputDirectory, vmArguments, customOptions,
- clientRequestor, false /*
- * do not skip javac for this peculiar
- * test
- */);
- }
-
- protected void runConformTest(String[] testFiles,
- String expectedSuccessOutputString, String[] classLib,
- boolean shouldFlushOutputDirectory, String[] vmArguments,
- Map customOptions, ICompilerRequestor clientRequestor,
- boolean skipJavac) {
- // Non-javac part
- try {
- if (shouldFlushOutputDirectory)
- Util.flushDirectoryContent(new File(OUTPUT_DIR));
-
- IProblemFactory problemFactory = getProblemFactory();
- Requestor requestor = new Requestor(problemFactory, OUTPUT_DIR
- .endsWith(File.separator) ? OUTPUT_DIR : OUTPUT_DIR
- + File.separator, false, clientRequestor, false, /*
- * show
- * category
- */
- false /* show warning token */);
-
- Map options = getCompilerOptions();
- if (customOptions != null) {
- options.putAll(customOptions);
- }
- CompilerOptions compilerOptions = new CompilerOptions(options);
- compilerOptions.performMethodsFullRecovery = false;
- compilerOptions.performStatementsRecovery = false;
- Compiler batchCompiler = new Compiler(getNameEnvironment(
- new String[] {}, classLib), getErrorHandlingPolicy(),
- compilerOptions, requestor, problemFactory);
- compilerOptions.produceReferenceInfo = true;
- try {
- batchCompiler.compile(Util.compilationUnits(testFiles)); // compile
- // all
- // files
- // together
- } catch (RuntimeException e) {
- System.out.println(getClass().getName() + '#' + getName());
- e.printStackTrace();
- for (int i = 0; i < testFiles.length; i += 2) {
- System.out.print(testFiles[i]);
- System.out.println(" ["); //$NON-NLS-1$
- System.out.println(testFiles[i + 1]);
- System.out.println("]"); //$NON-NLS-1$
- }
- throw e;
- }
- if (!requestor.hasErrors) {
- String sourceFile = testFiles[0];
-
- // Compute class name by removing ".java" and replacing slashes
- // with dots
- String className = sourceFile.substring(0,
- sourceFile.length() - 5).replace('/', '.').replace(
- '\\', '.');
- if (className.endsWith(PACKAGE_INFO_NAME))
- return;
-
-// if (vmArguments != null) {
-// if (this.verifier != null) {
-// this.verifier.shutDown();
-// }
-// this.verifier = new TestVerifier(false);
-// this.createdVerifier = true;
-// }
-// boolean passed = this.verifier.verifyClassFiles(sourceFile,
-// className, expectedSuccessOutputString,
-// this.classpaths, null, vmArguments);
-// if (!passed) {
-// System.out.println(getClass().getName() + '#' + getName());
-// for (int i = 0; i < testFiles.length; i += 2) {
-// System.out.print(testFiles[i]);
-// System.out.println(" ["); //$NON-NLS-1$
-// System.out.println(testFiles[i + 1]);
-// System.out.println("]"); //$NON-NLS-1$
-// }
-// }
-// assertTrue(this.verifier.failureReason, // computed by
-// // verifyClassFiles(...)
-// // action
-// passed);
- if (vmArguments != null) {
-// if (this.verifier != null) {
-// this.verifier.shutDown();
-// }
-// this.verifier = new TestVerifier(false);
-// this.createdVerifier = true;
- }
- } else {
- System.out.println(getClass().getName() + '#' + getName());
- System.out.println(Util.displayString(requestor.problemLog,
- INDENT, SHIFT));
- for (int i = 0; i < testFiles.length; i += 2) {
- System.out.print(testFiles[i]);
- System.out.println(" ["); //$NON-NLS-1$
- System.out.println(testFiles[i + 1]);
- System.out.println("]"); //$NON-NLS-1$
- }
- assertTrue("Unexpected problems: " + requestor.problemLog,
- false);
- }
- // javac part
- } catch (AssertionFailedError e) {
- throw e;
- } finally {
- if (RUN_JAVAC && !skipJavac)
- runJavac(testFiles, null, expectedSuccessOutputString,
- shouldFlushOutputDirectory);
- // PREMATURE for now, skipping javac implies skipping the compile
- // and execution steps; yet, only cases for which the
- // execution step was a problem have been discovered so
- // far; may consider skipping the execution step only
- }
- }
-
- protected void runConformTest(String[] testFiles, String[] vmArguments) {
- runConformTest(testFiles, null /* no expected output string */,
- null /* no extra class libraries */, true /*
- * flush output
- * directory
- */, vmArguments,
- null /* no custom options */, null /* no custom requestor */,
- false /* do not skip javac for this peculiar test */);
- }
-
- // PREMATURE consider whether conform tests throwing errors should
- // implement javac comparison or not
- protected void runConformTestThrowingError(String[] testFiles,
- String expectedSuccessOutputString, String[] classLib,
- boolean shouldFlushOutputDirectory, String[] vmArguments) {
-
- if (shouldFlushOutputDirectory)
- Util.flushDirectoryContent(new File(OUTPUT_DIR));
-
- IProblemFactory problemFactory = getProblemFactory();
- Requestor requestor = new Requestor(problemFactory, OUTPUT_DIR
- .endsWith(File.separator) ? OUTPUT_DIR : OUTPUT_DIR
- + File.separator, false, null/* no custom requestor */, false, /*
- * show
- * category
- */
- false /* show warning token */);
-
- CompilerOptions compilerOptions = new CompilerOptions(
- getCompilerOptions());
- compilerOptions.performMethodsFullRecovery = false;
- compilerOptions.performStatementsRecovery = false;
- Compiler batchCompiler = new Compiler(getNameEnvironment(
- new String[] {}, classLib), getErrorHandlingPolicy(),
- compilerOptions, requestor, problemFactory);
- batchCompiler.options.produceReferenceInfo = true;
- Throwable exception = null;
- try {
- batchCompiler.compile(Util.compilationUnits(testFiles)); // compile
- // all
- // files
- // together
- } catch (RuntimeException e) {
- exception = e;
- throw e;
- } catch (Error e) {
- exception = e;
- throw e;
- } finally {
-
- if (!requestor.hasErrors) {
- String sourceFile = testFiles[0];
-
- // Compute class name by removing ".java" and replacing slashes
- // with dots
- String className = sourceFile.substring(0,
- sourceFile.length() - 5).replace('/', '.').replace(
- '\\', '.');
-
-// boolean passed = this.verifier.verifyClassFilesThrowingError(
-// sourceFile, className, expectedSuccessOutputString,
-// this.classpaths, null, vmArguments);
-// if (exception == null)
-// assertTrue(this.verifier.failureReason, // computed by
-// // verifyClassFiles(...)
-// // action
-// passed);
- } else {
- if (exception == null)
- assertTrue("Unexpected problems: " + requestor.problemLog,
- false);
- }
- }
- }
-
- /*
- * Run Sun compilation using javac. Launch compilation in a thread and
- * verify that it does not take more than 5s to perform it. Otherwise abort
- * the process and log in console. TODO (maxime) not sure we really do that
- * 5s cap any more. A semi verbose output is sent to the console that
- * analyzes differences of behaviors between javac and Eclipse on a per test
- * basis. A more verbose output is produced into a file which name is
- * printed on the console. Such files can be compared between various javac
- * releases to check potential changes. To enable such tests, specify the
- * following VM properies in the launch configuration: -Drun.javac=enabled
- * mandatory - tells the test suite to run javac tests -Djdk.root=<the root
- * directory of the tested javac> optional - enables to find the javac that
- * will be run by the tests suite; the root directory must be specified as
- * an absolute path and should point to the JDK root, aka /opt/jdk1.5.0_05
- * for Linux or c:/JDK_50 for Windows; in case this property is not
- * specified, the tests suite will use the runtime JRE of the launching
- * configuration. Note that enabling javac tests implies running into 1.5
- * compliance level (without having to specify it into the VM properties.)
- * TODO (maxime) consider impacts of Java 6
- */
- protected void runJavac(String[] testFiles,
- final String expectedProblemLog,
- final String expectedSuccessOutputString,
- boolean shouldFlushOutputDirectory) {
- String testName = null;
- Process compileProcess = null;
- Process execProcess = null;
- try {
- // Init test name
- testName = testName();
-
- // Cleanup javac output dir if needed
- File javacOutputDirectory = new File(JAVAC_OUTPUT_DIR);
- if (shouldFlushOutputDirectory) {
- Util.delete(javacOutputDirectory);
- }
-
- // Write files in dir
- writeFiles(testFiles);
-
- // Prepare command line
- StringBuffer cmdLine = new StringBuffer(javacCommandLineHeader);
- // compute extra classpath
- String[] classpath = Util.concatWithClassLibs(JAVAC_OUTPUT_DIR,
- false);
- StringBuffer cp = new StringBuffer(" -classpath ");
- int length = classpath.length;
- for (int i = 0; i < length; i++) {
- if (i > 0)
- cp.append(File.pathSeparatorChar);
- if (classpath[i].indexOf(" ") != -1) {
- cp.append("\"" + classpath[i] + "\"");
- } else {
- cp.append(classpath[i]);
- }
- }
- cmdLine.append(cp);
- // add source files
- for (int i = 0; i < testFiles.length; i += 2) {
- // *.java is not enough (p1/X.java, p2/Y.java)
- cmdLine.append(' ');
- cmdLine.append(testFiles[i]);
- }
-
- // Launch process
- compileProcess = Runtime.getRuntime().exec(cmdLine.toString(),
- null, this.outputTestDirectory);
-
- // Log errors
- Logger errorLogger = new Logger(compileProcess.getErrorStream(),
- "ERROR");
-
- // Log output
- Logger outputLogger = new Logger(compileProcess.getInputStream(),
- "OUTPUT");
-
- // start the threads to run outputs (standard/error)
- errorLogger.start();
- outputLogger.start();
-
- // Wait for end of process
- int exitValue = compileProcess.waitFor();
- errorLogger.join(); // make sure we get the whole output
- outputLogger.join();
-
- // Report raw javac results
- if (!testName.equals(javacTestName)) {
- javacTestName = testName;
- javacTestErrorFlag = false;
- javacFullLog
- .println("-----------------------------------------------------------------");
- javacFullLog.println(CURRENT_CLASS_NAME + " " + testName);
- }
- if (exitValue != 0) {
- javacTestErrorFlag = true;
- }
- if (errorLogger.buffer.length() > 0) {
- javacFullLog.println("--- javac err: ---");
- javacFullLog.println(errorLogger.buffer.toString());
- }
- if (outputLogger.buffer.length() > 0) {
- javacFullLog.println("--- javac out: ---");
- javacFullLog.println(outputLogger.buffer.toString());
- }
-
- // Compare compilation results
- if (expectedProblemLog == null || expectedProblemLog.length() == 0) {
- // Eclipse found no error and no warning
- if (exitValue != 0) {
- // Javac found errors
- System.out
- .println("----------------------------------------");
- System.out
- .println(testName
- + " - Javac has found error(s) but Eclipse expects conform result:\n");
- javacFullLog
- .println("JAVAC_MISMATCH: Javac has found error(s) but Eclipse expects conform result");
- System.out.println(errorLogger.buffer.toString());
- printFiles(testFiles);
- DIFF_COUNTERS[0]++;
- } else {
- // Javac found no error - may have found warnings
- if (errorLogger.buffer.length() > 0) {
- System.out
- .println("----------------------------------------");
- System.out
- .println(testName
- + " - Javac has found warning(s) but Eclipse expects conform result:\n");
- javacFullLog
- .println("JAVAC_MISMATCH: Javac has found warning(s) but Eclipse expects conform result");
- System.out.println(errorLogger.buffer.toString());
- printFiles(testFiles);
- DIFF_COUNTERS[0]++;
- }
- if (expectedSuccessOutputString != null
- && !javacTestErrorFlag) {
- // Neither Eclipse nor Javac found errors, and we have a
- // runtime
- // bench value
- StringBuffer javaCmdLine = new StringBuffer(
- javaCommandLineHeader);
- javaCmdLine.append(cp);
- javaCmdLine.append(' ').append(
- testFiles[0].substring(0, testFiles[0]
- .indexOf('.')));
- // assume executable class is name of first test file -
- // PREMATURE check if this is also the case in other
- // test fwk classes
- execProcess = Runtime.getRuntime().exec(
- javaCmdLine.toString(), null,
- this.outputTestDirectory);
- Logger logger = new Logger(
- execProcess.getInputStream(), "");
- // PREMATURE implement consistent error policy
- logger.start();
- exitValue = execProcess.waitFor();
- logger.join(); // make sure we get the whole output
- String javaOutput = logger.buffer.toString().trim();
- if (!expectedSuccessOutputString.equals(javaOutput)) {
- System.out
- .println("----------------------------------------");
- System.out
- .println(testName
- + " - Javac and Eclipse runtime output is not the same:");
- javacFullLog
- .println("JAVAC_MISMATCH: Javac and Eclipse runtime output is not the same");
- dualPrintln("eclipse:");
- dualPrintln(expectedSuccessOutputString);
- dualPrintln("javac:");
- dualPrintln(javaOutput);
- System.out.println("\n");
- printFiles(testFiles); // PREMATURE consider
- // printing files to the log
- // as well
- DIFF_COUNTERS[2]++;
- }
- }
- }
- } else {
- // Eclipse found errors or warnings
- if (errorLogger.buffer.length() == 0) {
- System.out
- .println("----------------------------------------");
- System.out
- .println(testName
- + " - Eclipse has found error(s)/warning(s) but Javac did not find any:");
- javacFullLog
- .println("JAVAC_MISMATCH: Eclipse has found error(s)/warning(s) but Javac did not find any");
- dualPrintln("eclipse:");
- dualPrintln(expectedProblemLog);
- printFiles(testFiles);
- DIFF_COUNTERS[1]++;
- } else if (expectedProblemLog.indexOf("ERROR") > 0
- && exitValue == 0) {
- System.out
- .println("----------------------------------------");
- System.out
- .println(testName
- + " - Eclipse has found error(s) but Javac only found warning(s):");
- javacFullLog
- .println("JAVAC_MISMATCH: Eclipse has found error(s) but Javac only found warning(s)");
- dualPrintln("eclipse:");
- dualPrintln(expectedProblemLog);
- System.out.println("javac:");
- System.out.println(errorLogger.buffer.toString());
- printFiles(testFiles);
- DIFF_COUNTERS[1]++;
- } else {
- // PREMATURE refine comparison
- // TODO (frederic) compare warnings in each result and
- // verify they are similar...
- // System.out.println(testName+": javac has found warnings :");
- // System.out.print(errorLogger.buffer.toString());
- // System.out.println(testName+": we're expecting warning results:");
- // System.out.println(expectedProblemLog);
- }
- }
- } catch (InterruptedException e1) {
- if (compileProcess != null)
- compileProcess.destroy();
- if (execProcess != null)
- execProcess.destroy();
- System.out.println(testName
- + ": Sun javac compilation was aborted!");
- javacFullLog
- .println("JAVAC_WARNING: Sun javac compilation was aborted!");
- e1.printStackTrace(javacFullLog);
- } catch (Throwable e) {
- System.out.println(testName
- + ": could not launch Sun javac compilation!");
- e.printStackTrace();
- javacFullLog
- .println("JAVAC_ERROR: could not launch Sun javac compilation!");
- e.printStackTrace(javacFullLog);
- // PREMATURE failing the javac pass or comparison could also fail
- // the test itself
- } finally {
- // Clean up written file(s)
- Util.delete(outputTestDirectory);
- }
- }
-
- /**
- * Log contains all problems (warnings+errors)
- */
- protected void runNegativeTest(String[] testFiles, String expectedProblemLog) {
- runNegativeTest(testFiles, expectedProblemLog, null, true);
- runNegativeTest(testFiles, expectedProblemLog, null /*
- * no extra class
- * libraries
- */, true /*
- * flush
- * output
- * directory
- */,
- null /* no custom options */,
- false /* do not generate output */,
- false /* do not show category */,
- false /* do not show warning token */, false /*
- * do not skip javac
- * for this peculiar
- * test
- */, false /*
- * do
- * not
- * perform
- * statements
- * recovery
- */,
- null);
- }
-
- /**
- * Log contains all problems (warnings+errors)
- */
- protected void runNegativeTest(String[] testFiles,
- String expectedProblemLog, String[] classLib,
- boolean shouldFlushOutputDirectory) {
- runNegativeTest(testFiles, expectedProblemLog, classLib,
- shouldFlushOutputDirectory, null /* no custom options */,
- false /* do not generate output */,
- false /* do not show category */,
- false /* do not show warning token */, false /*
- * do not skip javac
- * for this peculiar
- * test
- */, false /*
- * do
- * not
- * perform
- * statements
- * recovery
- */,
- null);
- }
-
- /**
- * Log contains all problems (warnings+errors)
- */
- protected void runNegativeTest(String[] testFiles,
- String expectedProblemLog, String[] classLib,
- boolean shouldFlushOutputDirectory, Map customOptions) {
- runNegativeTest(testFiles, expectedProblemLog, classLib,
- shouldFlushOutputDirectory, customOptions, false /*
- * do not
- * generate
- * output
- */,
- false /* do not show category */,
- false /* do not show warning token */, false /*
- * do not skip javac
- * for this peculiar
- * test
- */, false /*
- * do
- * not
- * perform
- * statements
- * recovery
- */,
- null);
- }
-
- /**
- * Log contains all problems (warnings+errors)
- */
- protected void runNegativeTest(String[] testFiles,
- String expectedProblemLog, String[] classLib,
- boolean shouldFlushOutputDirectory, Map customOptions,
- boolean generateOutput, boolean showCategory,
- boolean showWarningToken) {
- runNegativeTest(testFiles, expectedProblemLog, classLib,
- shouldFlushOutputDirectory, customOptions, generateOutput,
- showCategory, showWarningToken, false /*
- * do not skip javac for
- * this peculiar test
- */, false /*
- * do not
- * perform
- * statements
- * recovery
- */, null);
- }
-
- /**
- * Log contains all problems (warnings+errors)
- */
- protected void runNegativeTest(String[] testFiles,
- String expectedProblemLog, String[] classLib,
- boolean shouldFlushOutputDirectory, Map customOptions,
- boolean generateOutput, boolean showCategory,
- boolean showWarningToken, boolean skipJavac,
- boolean performStatementsRecovery, String[] otherFiles) {
- // Non-javac part
- try {
- if (shouldFlushOutputDirectory)
- Util.flushDirectoryContent(new File(OUTPUT_DIR));
-
- if (otherFiles == null)
- otherFiles = new String[] {};
- IProblemFactory problemFactory = getProblemFactory();
- Requestor requestor = new Requestor(problemFactory, OUTPUT_DIR
- .endsWith(File.separator) ? OUTPUT_DIR : OUTPUT_DIR
- + File.separator, generateOutput,
- null/* no custom requestor */, showCategory,
- showWarningToken);
- Map options = getCompilerOptions();
- if (customOptions != null) {
- options.putAll(customOptions);
- }
- CompilerOptions compilerOptions = new CompilerOptions(options);
- compilerOptions.performMethodsFullRecovery = performStatementsRecovery;
- compilerOptions.performStatementsRecovery = performStatementsRecovery;
- Compiler batchCompiler = new Compiler(getNameEnvironment(
- otherFiles, classLib), getErrorHandlingPolicy(),
- compilerOptions, requestor, problemFactory);
- Object inferEngines = options.get(INFERENCE_ENGINES);
- if (inferEngines != null) {
- batchCompiler.parser.inferenceEngines = (IInferEngine[]) inferEngines;
-
- }
- batchCompiler.options.produceReferenceInfo = true;
- Throwable exception = null;
- try {
- batchCompiler.compile(Util.compilationUnits(testFiles)); // compile
- // all
- // files
- // together
- } catch (RuntimeException e) {
- exception = e;
- throw e;
- } catch (Error e) {
- exception = e;
- throw e;
- } finally {
- String computedProblemLog = Util
- .convertToIndependantLineDelimiter(requestor.problemLog
- .toString());
- String platformIndependantExpectedLog = Util
- .convertToIndependantLineDelimiter(expectedProblemLog);
- if (!platformIndependantExpectedLog.equals(computedProblemLog)) {
- System.out.println(getClass().getName() + '#' + getName());
- System.out.println(Util.displayString(computedProblemLog,
- INDENT, SHIFT));
- for (int i = 0; i < testFiles.length; i += 2) {
- System.out.print(testFiles[i]);
- System.out.println(" ["); //$NON-NLS-1$
- System.out.println(testFiles[i + 1]);
- System.out.println("]"); //$NON-NLS-1$
- }
- }
- if (exception == null)
- assertEquals("Invalid problem log ",
- platformIndependantExpectedLog, computedProblemLog);
- }
- // javac part
- } catch (AssertionFailedError e) {
- throw e;
- } finally {
- if (RUN_JAVAC && !skipJavac)
- runJavac(testFiles, expectedProblemLog, null,
- shouldFlushOutputDirectory);
- }
- }
-
- protected void runNegativeTestWithExecution(String[] testFiles,
- String expectedProblemLog, String expectedSuccessOutputString,
- String[] classLib, boolean shouldFlushOutputDirectory,
- String[] vmArguments, Map customOptions,
- ICompilerRequestor clientRequestor) {
-
- if (shouldFlushOutputDirectory)
- Util.flushDirectoryContent(new File(OUTPUT_DIR));
-
- IProblemFactory problemFactory = getProblemFactory();
- Requestor requestor = new Requestor(problemFactory, OUTPUT_DIR
- .endsWith(File.separator) ? OUTPUT_DIR : OUTPUT_DIR
- + File.separator, true, clientRequestor,
- false /* show category */, false /* show warning token */);
-
- Map options = getCompilerOptions();
- if (customOptions != null) {
- options.putAll(customOptions);
- }
- CompilerOptions compilerOptions = new CompilerOptions(options);
- compilerOptions.performMethodsFullRecovery = false;
- compilerOptions.performStatementsRecovery = false;
- Compiler batchCompiler = new Compiler(getNameEnvironment(
- new String[] {}, classLib), getErrorHandlingPolicy(),
- compilerOptions, requestor, problemFactory);
- batchCompiler.options.produceReferenceInfo = true;
- try {
- batchCompiler.compile(Util.compilationUnits(testFiles)); // compile
- // all
- // files
- // together
- } catch (RuntimeException e) {
- System.out.println(getClass().getName() + '#' + getName());
- e.printStackTrace();
- for (int i = 0; i < testFiles.length; i += 2) {
- System.out.print(testFiles[i]);
- System.out.println(" ["); //$NON-NLS-1$
- System.out.println(testFiles[i + 1]);
- System.out.println("]"); //$NON-NLS-1$
- }
- throw e;
- }
- assertTrue("Must have errors", requestor.hasErrors);
-
- String computedProblemLog = Util
- .convertToIndependantLineDelimiter(requestor.problemLog
- .toString());
- String platformIndependantExpectedLog = Util
- .convertToIndependantLineDelimiter(expectedProblemLog);
- if (!platformIndependantExpectedLog.equals(computedProblemLog)) {
- System.out.println(getClass().getName() + '#' + getName());
- System.out.println(Util.displayString(computedProblemLog, INDENT,
- SHIFT));
- for (int i = 0; i < testFiles.length; i += 2) {
- System.out.print(testFiles[i]);
- System.out.println(" ["); //$NON-NLS-1$
- System.out.println(testFiles[i + 1]);
- System.out.println("]"); //$NON-NLS-1$
- }
- assertEquals("Invalid problem log ",
- platformIndependantExpectedLog, computedProblemLog);
- }
-
- String sourceFile = testFiles[0];
-
- // Compute class name by removing ".java" and replacing slashes with
- // dots
- String className = sourceFile.substring(0, sourceFile.length() - 5)
- .replace('/', '.').replace('\\', '.');
- if (className.endsWith(PACKAGE_INFO_NAME))
- return;
-
-// if (vmArguments != null) {
-// if (this.verifier != null) {
-// this.verifier.shutDown();
-// }
-// this.verifier = new TestVerifier(false);
-// this.createdVerifier = true;
-// }
-// boolean passed = this.verifier
-// .verifyClassFiles(sourceFile, className,
-// expectedSuccessOutputString, this.classpaths, null,
-// vmArguments);
-// if (!passed) {
-// String platformIndependantExpectedSuccessOutputString = Util
-// .convertToIndependantLineDelimiter(expectedSuccessOutputString);
-// String platformIndependantFailureReason = Util
-// .convertToIndependantLineDelimiter(this.verifier.failureReason);
-// if (platformIndependantFailureReason
-// .indexOf(platformIndependantExpectedSuccessOutputString) == -1) {
-// System.out.println(getClass().getName() + '#' + getName());
-// System.out.println(Util.displayString(
-// platformIndependantFailureReason, INDENT, SHIFT));
-// assertEquals("Invalid runtime log ",
-// platformIndependantExpectedSuccessOutputString,
-// platformIndependantFailureReason);
-// System.out.println(getClass().getName() + '#' + getName());
-// for (int i = 0; i < testFiles.length; i += 2) {
-// System.out.print(testFiles[i]);
-// System.out.println(" ["); //$NON-NLS-1$
-// System.out.println(testFiles[i + 1]);
-// System.out.println("]"); //$NON-NLS-1$
-// }
-// }
-// } else if (vmArguments != null) {
-// if (this.verifier != null) {
-// this.verifier.shutDown();
-// }
-// this.verifier = new TestVerifier(false);
-// this.createdVerifier = true;
-// }
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-// if (this.verifier == null) {
-// this.verifier = new TestVerifier(true);
-// this.createdVerifier = true;
-// }
- if (RUN_JAVAC) {
- if (isFirst()) {
- if (javacFullLog == null) {
- // One time initialization of javac related concerns
- // compute command lines and extract javac version
- String jdkRootDirectory = System.getProperty("jdk.root");
- if (jdkRootDirectory == null)
- jdkRootDirPath = (new Path(Util.getJREDirectory()))
- .removeLastSegments(1);
- else
- jdkRootDirPath = new Path(jdkRootDirectory);
-
- StringBuffer cmdLineHeader = new StringBuffer(
- jdkRootDirPath.append("bin").append(JAVA_NAME)
- .toString()); // PREMATURE replace JAVA_NAME
- // and JAVAC_NAME with
- // locals? depends on
- // potential reuse
- javaCommandLineHeader = cmdLineHeader.toString();
- cmdLineHeader = new StringBuffer(jdkRootDirPath.append(
- "bin").append(JAVAC_NAME).toString());
- cmdLineHeader.append(" -classpath . ");
- // start with the current directory which contains the
- // source files
- Process compileProcess = Runtime.getRuntime().exec(
- cmdLineHeader.toString() + " -version", null, null);
- Logger versionLogger = new Logger(compileProcess
- .getErrorStream(), "");
- // PREMATURE implement consistent error policy
- versionLogger.start();
- compileProcess.waitFor();
- versionLogger.join(); // make sure we get the whole output
- String version = versionLogger.buffer.toString();
- int eol = version.indexOf('\n');
- version = version.substring(0, eol);
- cmdLineHeader.append(" -d ");
- cmdLineHeader
- .append(JAVAC_OUTPUT_DIR.indexOf(" ") != -1 ? "\""
- + JAVAC_OUTPUT_DIR + "\""
- : JAVAC_OUTPUT_DIR);
- cmdLineHeader
- .append(" -source 1.5 -deprecation -Xlint:unchecked "); // enable
- // recommended
- // warnings
- // REVIEW consider enabling all warnings instead? Philippe
- // does not see
- // this as ez to use (too many changes in logs)
- javacCommandLineHeader = cmdLineHeader.toString();
- new File(Util.getOutputDirectory()).mkdirs();
- // TODO maxime check why this happens to miss in some cases
- javacFullLogFileName = Util.getOutputDirectory()
- + File.separatorChar
- + version.replace(' ', '_')
- + "_"
- + (new SimpleDateFormat("yyyyMMdd_HHmmss"))
- .format(new Date()) + ".txt";
- javacFullLog = new PrintWriter(new FileOutputStream(
- javacFullLogFileName));
- javacFullLog.println(version); // so that the contents is
- // self sufficient
- System.out
- .println("***************************************************************************");
- System.out
- .println("* Sun Javac compiler output archived into file:");
- System.out.println("* " + javacFullLogFileName);
- System.out
- .println("***************************************************************************");
- }
- // per class initialization
- CURRENT_CLASS_NAME = getClass().getName();
- dualPrintln("***************************************************************************");
- System.out
- .print("* Comparison with Sun Javac compiler for class ");
- dualPrintln(CURRENT_CLASS_NAME.substring(CURRENT_CLASS_NAME
- .lastIndexOf('.') + 1)
- + " ("
- + TESTS_COUNTERS.get(CURRENT_CLASS_NAME)
- + " tests)");
- System.out
- .println("***************************************************************************");
- DIFF_COUNTERS[0] = 0;
- DIFF_COUNTERS[1] = 0;
- DIFF_COUNTERS[2] = 0;
- }
- }
- }
-
- public void stop() {
-// this.verifier.shutDown();
- }
-
- protected void tearDown() throws Exception {
-// if (this.createdVerifier) {
-// this.stop();
-// }
- // clean up output dir
- File outputDir = new File(OUTPUT_DIR);
- if (outputDir.exists()) {
- Util.flushDirectoryContent(outputDir);
- }
- super.tearDown();
- if (RUN_JAVAC) {
- printJavacResultsSummary();
- }
- }
-
- protected void runBasicTest(String[] testFiles) {
- runBasicTest(testFiles, null /* no extra class libraries */, null /*
- * no
- * custom
- * options
- */,
- null /* no custom requestor */);
- }
-
- protected void runBasicTest(String[] testFiles, String[] classLib,
- Map customOptions, ICompilerRequestor clientRequestor) {
- // Non-javac part
- try {
-
- IProblemFactory problemFactory = getProblemFactory();
- Requestor requestor = new Requestor(problemFactory, OUTPUT_DIR
- .endsWith(File.separator) ? OUTPUT_DIR : OUTPUT_DIR
- + File.separator, false, clientRequestor, false, /*
- * show
- * category
- */
- false /* show warning token */);
-
- Map options = getCompilerOptions();
- if (customOptions != null) {
- options.putAll(customOptions);
- }
- CompilerOptions compilerOptions = new CompilerOptions(options);
- compilerOptions.performStatementsRecovery = false;
- Compiler batchCompiler = new Compiler(getNameEnvironment(
- new String[] {}, classLib), getErrorHandlingPolicy(),
- compilerOptions, requestor, problemFactory);
- compilerOptions.produceReferenceInfo = true;
- try {
- batchCompiler.compile(Util.compilationUnits(testFiles)); // compile
- // all
- // files
- // together
- } catch (RuntimeException e) {
- System.out.println(getClass().getName() + '#' + getName());
- e.printStackTrace();
- for (int i = 0; i < testFiles.length; i += 2) {
- System.out.print(testFiles[i]);
- System.out.println(" ["); //$NON-NLS-1$
- System.out.println(testFiles[i + 1]);
- System.out.println("]"); //$NON-NLS-1$
- }
- throw e;
- }
- if (!requestor.hasErrors) {
-// String sourceFile = testFiles[0];
-// boolean passed = true;
-// if (!passed) {
-// System.out.println(getClass().getName() + '#' + getName());
-// for (int i = 0; i < testFiles.length; i += 2) {
-// System.out.print(testFiles[i]);
-// System.out.println(" ["); //$NON-NLS-1$
-// System.out.println(testFiles[i + 1]);
-// System.out.println("]"); //$NON-NLS-1$
-// }
-// }
-// assertTrue(this.verifier.failureReason, // computed by
-// // verifyClassFiles(...)
-// // action
-// passed);
- } else {
- System.out.println(getClass().getName() + '#' + getName());
- System.out.println(Util.displayString(requestor.problemLog,
- INDENT, SHIFT));
- for (int i = 0; i < testFiles.length; i += 2) {
- System.out.print(testFiles[i]);
- System.out.println(" ["); //$NON-NLS-1$
- System.out.println(testFiles[i + 1]);
- System.out.println("]"); //$NON-NLS-1$
- }
- assertTrue("Unexpected problems: " + requestor.problemLog,
- false);
- }
- // javac part
- } catch (AssertionFailedError e) {
- throw e;
- } finally {
- }
- }
-
- static class TestParser extends Parser {
-
- public TestParser(IProblemFactory problemFactory,
- CompilerOptions options, boolean optimizeStringLiterals,
- boolean useSourceJavadocParser) {
-
- super(new ProblemReporter(DefaultErrorHandlingPolicies
- .exitAfterAllProblems(), options, problemFactory),
- optimizeStringLiterals);
-
- // we want to notify all syntax error with the acceptProblem API
- // To do so, we define the record method of the ProblemReporter
- this.problemReporter = new ProblemReporter(
- DefaultErrorHandlingPolicies.exitAfterAllProblems(),
- options, problemFactory) {
- public void record(CategorizedProblem problem,
- CompilationResult unitResult, ReferenceContext context) {
- unitResult.record(problem, context); // TODO (jerome)
- // clients are
- // trapping problems
- // either through
- // factory or
- // requestor... is
- // result storing
- // needed?
- System.out.println("PARSER ERROR: " + problem.toString());
- assertTrue("unexpected parse Error", false);
- }
- };
- this.options = options;
- // set specific javadoc parser
- if (useSourceJavadocParser) {
- this.javadocParser = new SourceJavadocParser(this);
-
- }
- }
-
- public CompilationUnitDeclaration parseCompilationUnit(
- ICompilationUnit unit, boolean fullParse) {
-
- boolean old = diet;
-
- try {
- diet = !fullParse;
- CompilationResult compilationUnitResult = new CompilationResult(
- unit, 0, 0, this.options.maxProblemsPerUnit);
- CompilationUnitDeclaration parsedUnit = parse(unit,
- compilationUnitResult);
- int initialStart = this.scanner.initialPosition;
- int initialEnd = this.scanner.eofPosition;
- if (fullParse) {
- diet = false;
- this.getMethodBodies(parsedUnit);
- }
- this.scanner.resetTo(initialStart, initialEnd);
- assertTrue(this.expressionPtr < 0);
- assertTrue(this.expressionLengthPtr < 0);
- assertTrue(this.astPtr < 0);
- assertTrue(this.astLengthPtr < 0);
- assertTrue(this.intPtr < 0);
- return parsedUnit;
- } catch (AbortCompilation e) {
- // ignore this exception
- } finally {
- diet = old;
- }
- return null;
- }
- }
-
- protected CompilationUnitDeclaration runParseTest(String s,
- String testName, String expected) {
- // Non-javac part
- try {
-
- char[] source = s.toCharArray();
- TestParser parser = new TestParser(new DefaultProblemFactory(Locale
- .getDefault()), new CompilerOptions(getCompilerOptions()),
- true/* optimize string literals */, false);
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName,
- null);
-
- CompilationUnitDeclaration compUnit = parser.parseCompilationUnit(
- sourceUnit, true);
- if (expected != null) {
- String result = compUnit.toString();
- assertEquals(expected, result);
- }
- return compUnit;
- // javac part
- } catch (AssertionFailedError e) {
- throw e;
- } finally {
- }
- }
-
- protected CompilationUnitDeclaration runJSDocParseTest(String s,
- String testName, String expected) {
- // Non-javac part
- try {
-
- char[] source = s.toCharArray();
- TestParser parser = new TestParser(new DefaultProblemFactory(Locale
- .getDefault()), new CompilerOptions(getCompilerOptions()),
- true/* optimize string literals */, false);
-
- parser.javadocParser.checkDocComment = true;
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName,
- null);
-
- CompilationUnitDeclaration compUnit = parser.parseCompilationUnit(
- sourceUnit, true);
- if (expected != null) {
- String result = compUnit.toString();
- assertEquals(expected, result);
- }
- return compUnit;
- // javac part
- } catch (AssertionFailedError e) {
- throw e;
- } finally {
- }
- }
-
- protected CompilationUnitDeclaration runInferTest(String s,
- String testName, String expected, InferOptions inferOptions) {
-
- return runInferTest(s, testName, expected, inferOptions,
- new DefaultInferrenceProvider());
- }
-
- protected CompilationUnitDeclaration runInferTest(String s,
- String testName, String expected, InferOptions inferOptions,
- InferrenceProvider inferrenceProvider) {
- // Non-javac part
- try {
-
- char[] source = s.toCharArray();
- CompilerOptions compilerOptions = new CompilerOptions(
- getCompilerOptions());
- compilerOptions.inferOptions = inferOptions;
- TestParser parser = new TestParser(new DefaultProblemFactory(Locale
- .getDefault()), compilerOptions, true/*
- * optimize string
- * literals
- */, false);
-
- parser.javadocParser.checkDocComment = true;
-
- ICompilationUnit sourceUnit = new CompilationUnit(source, testName,
- null);
-
- CompilationUnitDeclaration compUnit = parser.parseCompilationUnit(
- sourceUnit, true);
-
- InferEngine inferEngine = (InferEngine)inferrenceProvider.getInferEngine();
-
- inferEngine.initialize();
- inferEngine.setCompilationUnit(compUnit);
- inferEngine.doInfer();
- if (expected != null) {
- StringBuffer sb = new StringBuffer();
- compUnit.printInferredTypes(sb);
- String result = sb.toString();
- assertEquals(expected, result);
- }
- return compUnit;
- // javac part
- } catch (AssertionFailedError e) {
- throw e;
- } finally {
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AssignmentTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AssignmentTest.java
deleted file mode 100644
index 9514ccb..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AssignmentTest.java
+++ /dev/null
@@ -1,614 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class AssignmentTest extends AbstractRegressionTest {
-
- public AssignmentTest(String name) {
- super(name);
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportNullReference,
- CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportNoEffectAssignment,
- CompilerOptions.ERROR);
- return options;
- }
-
- /*
- * no effect assignment bug
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=27235
- */
- public void test001() {
- this.runConformTest(
- new String[] {
- "X.js",
- " var i; \n" + " function X(j) { \n"
- + " i = j; \n" + " } \n"
- + " function B() { \n"
- + " this.i =this.i; \n"
- + " } \n"
- + " function main( args) { \n"
- + " X a = new X(3); \n"
- + " print(a.i + \" \"); \n"
- + " print(a.new B().i); \n" + " } \n"
- + "} \n", }, "3 3");
- }
-
- public void test002() {
- this
- .runNegativeTest(
- new String[] {
- "X.js",
- " var a; \n"
- + " var next; \n"
- + " function foo( arg){ \n"
- + " \n"
- + " zork = zork; \n"
- + " arg = zork; \n"
- + " \n"
- + " arg = arg; // noop \n"
- + " a = a; // noop \n"
- + " this.next = this.next; // noop \n"
- + " this.next = next; // noop \n"
- + " \n"
- + " next.a = next.a; // could raise NPE \n"
- + " this.next.next.a = next.next.a; // could raise NPE \n"
- + " a = next.a; // could raise NPE \n"
- + " this. a = next.a; \n" + " } \n"
- + "\n", },
- "----------\n"
- + "2. ERROR in X.js (at line 5)\n"
- + " zork = zork; \n"
- + " ^^^^\n"
- + "zork cannot be resolved\n"
- + "----------\n"
- + "3. ERROR in X.js (at line 6)\n"
- + " arg = zork; \n"
- + " ^^^^\n"
- + "zork cannot be resolved\n"
- + "----------\n"
- + "4. ERROR in X.js (at line 8)\n"
- + " arg = arg; // noop \n"
- + " ^^^^^^^^^\n"
- + "The assignment to variable arg has no effect\n"
- + "----------\n"
- + "5. ERROR in X.js (at line 9)\n"
- + " a = a; // noop \n"
- + " ^^^^^\n"
- + "The assignment to variable a has no effect\n"
- + "----------\n"
- + "6. ERROR in X.js (at line 10)\n"
- + " this.next = this.next; // noop \n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable next has no effect\n"
- + "----------\n"
- + "7. ERROR in X.js (at line 11)\n"
- + " this.next = next; // noop \n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable next has no effect\n"
- + "----------\n");
- }
-
- // // final multiple assignment
- // public void test020() {
- // this.runNegativeTest(
- // new String[] {
- // "X.js",
- // " function foo() {\n" +
- // " var v;\n" +
- // " for (var i = 0; i < 10; i++) {\n" +
- // " v = i;\n" +
- // " }\n" +
- // " v = 0;\n" +
- // " }\n" +
- // "\n",
- // },
- // "----------\n" +
- // "1. ERROR in X.js (at line 4)\n" +
- // " v = i;\n" +
- // " ^\n" +
- // "The final local variable v may already have been assigned\n" +
- // "----------\n" +
- // "2. ERROR in X.js (at line 6)\n" +
- // " v = 0;\n" +
- // " ^\n" +
- // "The final local variable v may already have been assigned\n" +
- // "----------\n");
- // }
-
- // null part has been repeated into NullReferenceTest#test1033
- public void test033() {
- this
- .runNegativeTest(
- new String[] {
- "X.js",
- " \n" + " function foo() {\n" + " var a,b;\n"
- + " do{\n" + " a=\"Hello \";\n"
- + " }while(a!=null);\n" + " \n"
- + " if(a!=null)\n" + " {\n"
- + " b=\"World!\";\n" + " }\n"
- + " println(a+b);\n" + " }\n" + "\n", },
- "----------\n"
- + "1. ERROR in X.js (at line 6)\n"
- + " }while(a!=null);\n"
- + " ^\n"
- + "The variable a cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n"
- + "----------\n"
- + "2. ERROR in X.js (at line 8)\n"
- + " if(a!=null)\n"
- + " ^\n"
- + "The variable a can only be null; it was either set to null or checked for null when last used\n"
- + "----------\n"
- + "3. ERROR in X.js (at line 12)\n"
- + " println(a+b);\n"
- + " ^\n"
- + "The local variable b may not have been initialized\n"
- + "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=84215
- // TODO (philippe) should move to InitializationTest suite
- public void test034() {
- this.runConformTest(new String[] {
- "X.js",
- "public final class X \n" + "{\n" + " var vdg;\n"
- + " var aa = null;\n" + " var a = 14;\n"
- + " var b = 3;\n" + " var c = 12;\n"
- + " var d = 2; \n" + " var e = 3; \n"
- + " var f = 34; \n" + " var g = 35; \n"
- + " var h = 36; \n" + " var j = 4;\n"
- + " var k = 1;\n" + " var aba = 1;\n"
- + " var as = 11;\n" + " var ad = 12;\n"
- + " var af = 13;\n" + " var ag = 2;\n"
- + " var ah = 21;\n" + " var aj = 22;\n"
- + " var ak = 3;\n" + " var aaad = null;\n"
- + " var aaaf = 1;\n" + " var aaag = 2;\n"
- + " var aaha = 2;\n" + " var cxvvb = 1;\n"
- + " var z = a;\n" + " var asdff;\n" + " var ppfp;\n"
- + " var ppfpged;\n" + " boolean asfadf;\n"
- + " boolean cbxbx;\n" + " long tyt, rrky;\n"
- + " var dgjt, ykjr6y;\n" + " var krykr = 1;\n"
- + " var rykr5;\n" + " var dhfg;\n"
- + " var dthj;\n" + " var fkffy;\n"
- + " var fhfy;\n" + " var fhmf;\n"
- + " var ryur6;\n" + " var dhdthd;\n"
- + " var dth5;\n" + " var kfyk;\n" + " var ntd;\n"
- + " var asdasdads;\n" + " var dntdr = 7;\n"
- + " var asys = 1;\n" + " var djd5rwas = 11;\n"
- + " var dhds45rjd = 12;\n"
- + " var srws4jd = 13;\n" + " var s4ts = 2;\n"
- + " var dshes4 = 21;\n"
- + " var drthed56u = 22;\n"
- + " var drtye45 = 23;\n" + " var xxbxrb = 3;\n"
- + " var xfbxr = 31;\n" + " var asgw4y = 32;\n"
- + " var hdtrhs5r = 33;\n" + " var dshsh = 34;\n"
- + " var ds45yuwsuy = 4;\n"
- + " var astgs45rys = 5;\n" + " var srgs4y = 6;\n"
- + " var srgsryw45 = -6;\n"
- + " var srgdtgjd45ry = -7;\n"
- + " var srdjs43t = 1;\n"
- + " var sedteued5y = 2;\n" + " var jrfd6u;\n"
- + " var udf56u;\n" + " var jf6tu;\n"
- + " var jf6tud;\n" + " var bsrh;\n" + " X(var a)\n"
- + " {\n" + " }\n" + " long sfhdsrhs;\n"
- + " boolean qaafasdfs;\n" + " var sdgsa;\n"
- + " long dgse4;\n" + " long sgrdsrg;\n"
- + " function gdsthsr()\n" + " {\n" + " }\n"
- + " var hsrhs;\n" + " function hsrhsdsh()\n" + " {\n"
- + " }\n" + " var dsfhshsr;\n"
- + " function sfhsh4rsrh()\n" + " {\n" + " }\n"
- + " function shsrhsh()\n" + " {\n" + " }\n"
- + " function sfhstuje56u()\n" + " {\n" + " }\n"
- + " function dhdrt6u()\n" + " {\n" + " }\n"
- + " function hdtue56u()\n" + " {\n" + " }\n"
- + " function htdws4()\n" + " {\n" + " }\n"
- + " var mfmgf;\n" + " var mgdmd;\n" + " var mdsrh;\n"
- + " var nmdr;\n" + " function oyioyio()\n" + " {\n"
- + " }\n" + " long oyioyreye()\n" + " {\n"
- + " return 0;\n" + " }\n" + " long etueierh()\n"
- + " {\n" + " return 0;\n" + " }\n"
- + " function sdfgsgs()\n" + " {\n" + " }\n"
- + " function fhsrhsrh()\n" + " {\n" + " }\n" + "\n"
- + " long dcggsdg;\n" + " var ssssssgsfh;\n"
- + " long ssssssgae;\n" + " long ssssssfaseg;\n"
- + " function zzzdged()\n" + " {\n" + " }\n" + " \n"
- + " var t;\n" + " function xxxxxcbsg()\n" + " {\n"
- + " }\n" + "\n" + " \n" + " function vdg()\n" + " {\n"
- + " }\n" + " \n" + " int[] fffcvffffffasdfaef;\n"
- + " int[] fffcffffffasdfaef;\n"
- + " long[] ffcvfffffffasdfaef;\n"
- + " var fffffghffffasdfaef; \n"
- + " var fffffdffffasdfaef; \n"
- + " var ffafffffffasdfaef;\n" + " \n"
- + " function fffffffffasdfaef()\n" + " {\n" + " }\n"
- + " \n" + " boolean aaaadgasrg;\n"
- + " function ddddgaergnj()\n" + " {\n" + " }\n" + "\n"
- + " function aaaadgaeg()\n" + " {\n" + " }\n" + " \n"
- + " function aaaaaaefadfgh()\n" + " {\n" + " }\n"
- + " \n" + " function addddddddafge()\n" + " {\n"
- + " }\n" + " \n" + " boolean aaaaaaaefae;\n"
- + " function aaaaaaefaef()\n" + " {\n" + " }\n" + "\n"
- + " function ggggseae()\n" + " {\n" + " }\n" + "\n"
- + " function ggggggsgsrg()\n" + " {\n" + " }\n"
- + "\n" + " synchronized function ggggggfsfgsr()\n"
- + " {\n" + " }\n" + "\n" + " function aaaaaadgaeg()\n"
- + " {\n" + " }\n" + " \n"
- + " function aaaaadgaerg()\n" + " {\n" + " }\n"
- + " \n" + " function bbbbbbsfryghs()\n" + " {\n"
- + " }\n" + " \n" + " function bfbbbbbbfssreg()\n"
- + " {\n" + " }\n" + "\n" + " function bbbbbbfssfb()\n"
- + " {\n" + " }\n" + "\n" + " function bbbbbbfssb()\n"
- + " {\n" + " }\n" + "\n" + " function bbbbfdssb()\n"
- + " {\n" + " }\n" + " \n" + " boolean dggggggdsg;\n"
- + "\n" + " function hdfhdr()\n" + " {\n" + " }\n"
- + " \n" + " function dhdrtdrs()\n" + " {\n" + " }\n"
- + " \n" + " function dghdthtdhd()\n" + " {\n" + " }\n"
- + " \n" + " function dhdhdtdh()\n" + " {\n" + " }\n"
- + " \n" + " function fddhdsh()\n" + " {\n" + " }\n"
- + " \n" + " boolean sdffgsdg()\n" + " {\n"
- + " return true;\n" + " }\n" + " \n"
- + " boolean sdgsdg()\n" + " {\n"
- + " return false;\n" + " }\n" + " \n"
- + " function sfdgsg()\n" + " {\n" + " }\n" + "\n"
- + " int[] fghtys;\n" + "\n" + " var sdsst = 1;\n"
- + " X asdfahnr;\n"
- + " var ssdsdbrtyrtdfhd, ssdsrtyrdbdfhd;\n"
- + " var ssdsrtydbdfhd, ssdsrtydffbdfhd;\n"
- + " var ssdrtyhrtysdbdfhd, ssyeghdsdbdfhd;\n"
- + " var ssdsdrtybdfhd, ssdsdehebdfhd;\n"
- + " var ssdthrtsdbdfhd, ssdshethetdbdfhd;\n"
- + " var sstrdrfhdsdbdfhd;\n"
- + " var ssdsdbdfhd, ssdsdethbdfhd;\n"
- + " long ssdshdfhchddbdfhd;\n"
- + " long ssdsdvbbdfhd;\n" + " \n" + " \n"
- + " long ssdsdbdfhd()\n" + " {\n" + " return 0;\n"
- + " }\n" + "\n" + " long sdgsrsbsf()\n" + " {\n"
- + " return 0;\n" + " }\n" + "\n"
- + " function sfgsfgssghr()\n" + " {\n" + " }\n"
- + " \n" + " var sgsgsrg()\n" + " {\n"
- + " return null;\n" + " }\n" + "\n"
- + " function sdgshsdygra()\n" + " {\n" + " }\n"
- + "\n" + " var sdfsdfs()\n" + " {\n"
- + " return null;\n" + " }\n" + "\n"
- + " boolean ryweyer;\n" + "\n"
- + " function adfadfaghsfh()\n" + " {\n" + " }\n"
- + " \n" + " function ghasghasrg()\n" + " {\n"
- + " }\n" + "\n" + " function aadfadfaf()\n" + " {\n"
- + " }\n" + "\n" + " function aadfadf()\n" + " {\n"
- + " }\n" + " \n" + " var fgsfhwr()\n" + " {\n"
- + " return 0;\n" + " }\n" + "\n"
- + " var gdfgfgrfg()\n" + " {\n" + " return 0;\n"
- + " }\n" + "\n" + " var asdfsfs()\n" + " {\n"
- + " return 0;\n" + " }\n" + "\n" + " var sdgs;\n"
- + " var sdfsh4e;\n" + " var gsregs = 0;\n" + " \n"
- + " var sgsgsd()\n" + " {\n" + " return null;\n"
- + " }\n" + "\n"
- + " byte[] sdhqtgwsrh(String rsName, var id)\n"
- + " {\n" + " var rs = null;\n" + " try\n" + " {\n"
- + " rs = \"\";\n" + " return null;\n" + " }\n"
- + " catch (Exception ex)\n" + " {\n" + " }\n"
- + " finally\n" + " {\n" + " if (rs != null)\n"
- + " {\n" + " try\n" + " {\n"
- + " rs.toString();\n" + " }\n"
- + " catch (Exception ex)\n" + " {\n" + " }\n"
- + " }\n" + " }\n" + " return null;\n" + " }\n"
- + "\n" + " function dgagadga()\n" + " {\n" + " }\n"
- + " \n" + " var adsyasta;\n" + "}\n", }, "");
- }
-
- /*
- * Check scenario: i = i++
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=84480 disabled:
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=111898
- */
- public void test035() {
- this.runNegativeTest(new String[] {
- "X.js",
- " var f;\n" + " function foo( i) {\n" + " i = i++;\n"
- + " i = ++i;\n" + " f = f++;\n" + " f = ++f;\n"
- + " var z;" + " }\n" + "\n", }, "----------\n"
- + "1. ERROR in X.js (at line 4)\n" + " i = ++i;\n"
- + " ^^^^^^^\n" + "The assignment to variable i has no effect\n"
- + "----------\n" + "2. ERROR in X.js (at line 6)\n"
- + " f = ++f;\n" + " ^^^^^^^\n"
- + "The assignment to variable f has no effect\n"
- + "----------\n");
- }
-
- public void test036() {
- this
- .runNegativeTest(
- new String[] {
- "X.js",
- "\n" + " function foo() {\n"
- + " var o = new Object();\n"
- + " do {\n" + " o = null;\n"
- + " } while (o != null);\n"
- + " if (o == null) {\n"
- + " // throw new Exception();\n"
- + " }\n" + " }\n" + "\n", },
- "----------\n"
- + "1. ERROR in X.js (at line 6)\n"
- + " } while (o != null);\n"
- + " ^\n"
- + "The variable o can only be null; it was either set to null or checked for null when last used\n"
- + "----------\n"
- + "2. ERROR in X.js (at line 7)\n"
- + " if (o == null) {\n"
- + " ^\n"
- + "The variable o can only be null; it was either set to null or checked for null when last used\n"
- + "----------\n");
- }
-
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=93588
- // public void test037() {
- // this.runConformTest(
- // new String[] {
- // "X.js",
- // " class X extends Object implements Runnable {\n" +
- // " var interval = 5;\n" +
- // " function run() {\n" +
- // " try {\n" +
- // " Thread.sleep(interval = interval + 100);\n" +
- // " Thread.sleep(interval += 100);\n" +
- // " } catch (InterruptedException e) {\n" +
- // " e.printStackTrace();\n" +
- // " }\n" +
- // " }\n" +
- // "\n" +
- // " function main( args) {\n" +
- // " new X().run();\n" +
- // " }\n" +
- // "}\n",
- // },
- // "");
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=111703
- // public void test038() {
- // this.runNegativeTest(
- // new String[] {
- // "X.js",
- // "import java.awt.event.*;\n" +
- // "\n" +
- // "import javax.swing.*;\n" +
- // "import javax.swing.event.*;\n" +
- // "\n" +
- // " class X {\n" +
- // " JButton myButton = new JButton();\n" +
- // " JTree myTree = new JTree();\n" +
- // " ActionListener action;\n" +
- // " X() {\n" +
- // " action = new ActionListener() {\n" +
- // " function actionPerformed(ActionEvent e) {\n" +
- // " if (true) {\n" +
- // " // unlock document\n" +
- // " Object document = new Object();\n" +
- // " myButton.addActionListener(new ActionListener() {\n"
- // +
- // " boolean selectionChanged;\n" +
- // " TreeSelectionListener list = new TreeSelectionListener() {\n"
- // +
- // " function valueChanged(TreeSelectionEvent e) {\n"
- // +
- // " selectionChanged = true;\n" +
- // " }\n" +
- // " };\n" +
- // " {\n" +
- // " myTree.addTreeSelectionListener(list);\n" +
- // " }\n" +
- // " function actionPerformed(ActionEvent e) {\n" +
- // " if(!selectionChanged)\n" +
- // " myButton.removeActionListener(this);\n" +
- // " }\n" +
- // " });\n" +
- // " }\n" +
- // " }\n" +
- // " };\n" +
- // " }\n" +
- // " function main( args) {\n" +
- // " new X();\n" +
- // " }\n" +
- // "\n" +
- // "}",
- // },
- // "----------\n" +
- // "1. WARNING in X.js (at line 19)\n" +
- // " function valueChanged(TreeSelectionEvent e) {\n" +
- // " ^\n" +
- // "The parameter e is hiding another local variable defined in an enclosing type scope\n"
- // +
- // "----------\n" +
- // "2. ERROR in X.js (at line 23)\n" +
- // " {\n" +
- // " ^\n" +
- // "Cannot define initializer in inner type new ActionListener(){}\n" +
- // "----------\n" +
- // "3. ERROR in X.js (at line 24)\n" +
- // " myTree.addTreeSelectionListener(list);\n" +
- // " ^^^^^^\n" +
- // "Cannot make a reference to the non- field myTree\n" +
- // "----------\n" +
- // "4. WARNING in X.js (at line 26)\n" +
- // " function actionPerformed(ActionEvent e) {\n" +
- // " ^\n" +
- // "The parameter e is hiding another local variable defined in an enclosing type scope\n"
- // +
- // "----------\n");
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=111898
- // public void test039() {
- // this.runConformTest(
- // new String[] {
- // "X.js",
- // " class X {\n" +
- // " function main( args) {\n" +
- // " var a = 1;\n" +
- // " a = a++;\n" +
- // " print(\"a=\"+a);\n" +
- // " \n" +
- // " var b = 1;\n" +
- // " print(b = b++);\n" +
- // " println(\"b=\"+b);\n" +
- // " }\n" +
- // "}\n",
- // },
- // "a=11b=1");
- // }
- // warn upon parameter assignment
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=53773
- public void test040() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportParameterAssignment,
- CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(b) {\n" + " b = false;\n" + " }\n"
- + "\n", }, "----------\n"
- + "1. ERROR in X.js (at line 2)\n" + " b = false;\n"
- + " ^\n" + "The parameter b should not be assigned\n"
- + "----------\n", null, true, options);
- }
-
- // warn upon parameter assignment
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=53773
- // diagnose within fake reachable code
- public void test041() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportParameterAssignment,
- CompilerOptions.ERROR);
- this.runNegativeTest(new String[] {
- "X.js",
- " function foo(b) {\n" + " if (false) {\n"
- + " b = false;\n" + " }\n" + " }\n" + "\n", },
- "----------\n" + "1. ERROR in X.js (at line 3)\n"
- + " b = false;\n" + " ^\n"
- + "The parameter b should not be assigned\n"
- + "----------\n", null, true, options);
- }
-
- // warn upon parameter assignment
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=53773
- // diagnose within fake reachable code
- public void test042() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportParameterAssignment,
- CompilerOptions.ERROR);
- this.runNegativeTest(new String[] {
- "X.js",
- " function foo(b) {\n" + " if (true) {\n"
- + " return;\n" + " }\n" + " b = false;\n"
- + " }\n" + "\n", }, "----------\n"
- + "1. ERROR in X.js (at line 5)\n" + " b = false;\n" + " ^\n"
- + "The parameter b should not be assigned\n" + "----------\n",
- null, true, options);
- }
-
- // // warn upon parameter assignment
- // // https://bugs.eclipse.org/bugs/show_bug.cgi?id=53773
- // // we only show the 'assignment to final' error here
- // public void test043() {
- // Map options = getCompilerOptions();
- // options.put(CompilerOptions.OPTION_ReportParameterAssignment,
- // CompilerOptions.ERROR);
- // this.runNegativeTest(
- // new String[] {
- // "X.js",
- // " class X {\n" +
- // " function foo( boolean b) {\n" +
- // " if (false) {\n" +
- // " b = false;\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "----------\n" +
- // "1. ERROR in X.js (at line 4)\n" +
- // " b = false;\n" +
- // " ^\n" +
- // "The final local variable b cannot be assigned. It must be blank and not using a compound assignment\n"
- // +
- // "----------\n",
- // null, true, options);
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=100369
- public void test044() {
- this.runNegativeTest(new String[] {
- "X.js",
- " var length1 = 0;\n" + " {\n"
- + " length1 = length1; // already detected\n" + " }\n"
- + " var length2 = length2 = 0; // not detected\n"
- + " var length3 = 0;\n" + " {\n"
- + " length3 = length3 = 0; // not detected\n" + " }\n"
- + " function foo() {\n" + " var length1 = 0;\n"
- + " length1 = length1; // already detected\n"
- + " var length2 = length2 = 0; // not detected\n"
- + " var length3 = 0;\n"
- + " length3 = length3 = 0; // not detected\n" + " }\n"
- + "\n", }, "----------\n"
- + "1. ERROR in X.js (at line 3)\n"
- + " length1 = length1; // already detected\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length1 has no effect\n"
- + "----------\n" + "2. ERROR in X.js (at line 5)\n"
- + " var length2 = length2 = 0; // not detected\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length2 has no effect\n"
- + "----------\n" + "3. ERROR in X.js (at line 8)\n"
- + " length3 = length3 = 0; // not detected\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length3 has no effect\n"
- + "----------\n" + "4. ERROR in X.js (at line 12)\n"
- + " length1 = length1; // already detected\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length1 has no effect\n"
- + "----------\n" + "5. ERROR in X.js (at line 13)\n"
- + " var length2 = length2 = 0; // not detected\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length2 has no effect\n"
- + "----------\n" + "6. ERROR in X.js (at line 15)\n"
- + " length3 = length3 = 0; // not detected\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length3 has no effect\n"
- + "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=133351
- public void test045() {
- this.runNegativeTest(new String[] {
- "X.js",
- " function foo() {\n"
- + " var length2 = length2 = 0; // first problem\n"
- + " var length3 = 0;\n"
- + " length3 = length3 = 0; // second problem\n"
- + " }\n" + "\n", }, "----------\n"
- + "1. ERROR in X.js (at line 2)\n"
- + " var length2 = length2 = 0; // first problem\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length2 has no effect\n"
- + "----------\n" + "2. ERROR in X.js (at line 4)\n"
- + " length3 = length3 = 0; // second problem\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "The assignment to variable length3 has no effect\n"
- + "----------\n");
- }
-
- public static Class testClass() {
- return AssignmentTest.class;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicAnalyseTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicAnalyseTests.java
deleted file mode 100644
index 49fb1e0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicAnalyseTests.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class BasicAnalyseTests extends AbstractRegressionTest {
- public BasicAnalyseTests(String name) {
- super(name);
- }
-
- public void testBug251374_1() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.nullReference", "error");
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.potentialNullReference", "error");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var b = null;\n" +
- "function boo() {\n" +
- "b.toString();\n" +
- "}\n" +
- "b = 2;\n" +
- "boo();"
- },
- "", null, false, custom
- );
- }
- public void testBug251374_2() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.nullReference", "error");
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.potentialNullReference", "error");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var b = null;\n" +
- "function boo() {\n" +
- "b.toString();\n" +
- "}\n" +
- "boo();"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 3)\n" +
- " b.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable b can only be null at this location\n" +
- "----------\n", null, false, custom
- );
- }
-
- public void testBug251374_3() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.nullReference", "error");
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.potentialNullReference", "error");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var b = null;\n" +
- "function boo() {\n" +
- "b = null\n" +
- "b.toString();\n" +
- "}\n" +
- "b = 2;\n" +
- "boo();"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 4)\n" +
- " b.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable b can only be null at this location\n" +
- "----------\n", null, false, custom
- );
- }
-
- public void testBug251374_4() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.nullReference", "error");
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.potentialNullReference", "error");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var b = null;\n" +
- "function boo() {\n" +
- "b = null\n" +
- "b.toString();\n" +
- "}\n" +
- "b = 2;\n" +
- "boo();\n" +
- "b.toString();"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 4)\n" +
- " b.toString();\n" +
- " ^\n" +
- "Null pointer access: The variable b can only be null at this location\n" +
- "----------\n", null, false, custom
- );
- }
-
- public void testBug251374_5() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var b = null;\n" +
- "function boo() {\n" +
- "b = null\n" +
- "b.toString();\n" +
- "}\n" +
- "b = 2;\n" +
- "boo();\n" +
- "b.toString();"
- },
- ""
- );
- }
-
- public void testBug286029_1() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var sub;\n" +
- "if(!sub) sub = {};"
- },
- ""
- );
- }
-
- public void testBug286029_2() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function abc() {\n" +
- "var sub;\n" +
- "if(!sub) sub = {};\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 3)\n" +
- " if(!sub) sub = {};\n" +
- " ^^^\n" +
- "The local variable sub may not have been initialized\n" +
- "----------\n"
- );
- }
-
- public void testBug286029_3() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function abc() {\n" +
- "var sub; sub = {};\n" +
- "if(!sub) sub = {};\n" +
- "}"
- },
- ""
- );
- }
-
- public void testBug251225_1() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var temp = function () {};\n" +
- "temp();"
- },
- ""
- );
- }
-
- public void testBug251225_2() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var temp = function () {};\n" +
- "new temp();"
- },
- ""
- );
- }
-
- public void testBug251225_3() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function testFunction() {\n" +
- "var temp = function () {};\n" +
- "function temp2(){}" +
- "new temp2();}"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " var temp = function () {};\n" +
- " ^^^^\n" +
- "The local variable temp is never read\n" +
- "----------\n"
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicErrorTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicErrorTests.java
deleted file mode 100644
index 7c835d4..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicErrorTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-
-public class BasicErrorTests extends AbstractRegressionTest {
-
- public BasicErrorTests(String name) {
- super(name);
-
- }
- public void test001() {
- CompilationUnitDeclaration declaration = this.runParseTest(
- "function foo(){\n" +
- " var c;\n" +
- " var d;\n" +
- " c.\n" +
- "}\n",
- "X.js",
- "function foo(){\n" +
- " var c;\n" +
- " var d;\n" +
- " c.\n" +
- "\n"
-
- );
- }
-
- public void test002() {
- CompilationUnitDeclaration declaration = this.runParseTest(
- "package p;\n" +
- "/**\n" +
- " * @category test\n" +
- " */\n" +
- "public class Y {\n" +
- "}\n",
- "X.js",
- "function foo(){\n" +
- " var c;\n" +
- " var d;\n" +
- " c.\n" +
- "\n"
-
- );
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicJsdocTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicJsdocTests.java
deleted file mode 100644
index 3f4965d..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicJsdocTests.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-
-public class BasicJsdocTests extends AbstractRegressionTest {
-
- public BasicJsdocTests(String name) {
- super(name);
-
- }
- public void test001() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @param p1 param def\n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @param p1\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
-
- public void test002() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @param {String} p1 param def\n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @param {String} p1\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
-
-// public void test002b() {
-// CompilationUnitDeclaration declaration = this.runJSDocParseTest(
-// "/**\n"
-// + " * Valid class javadoc\n"
-// + " * @param {String} p1 param def\n"
-// + " */\n"
-// +"function foo(p1){}" +
-// "\n",
-// "X.js",
-// "/**\n" +
-// " * @param {String*} p1\n" +
-// " */\n" +
-// "function foo(p1) {\n}" +
-// "\n"
-//
-// );
-// }
- public void test003() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @param {String|Number} p1 param def\n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @param {String|Number} p1\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
- public void test004() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @constructor \n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @constructor\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
- public void test005() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @type String \n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @type String\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
-
- public void test006() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @private \n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @private\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
-
- public void test007() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @member MyClass \n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @member MyClass\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
-
- public void test008() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @base MyClass \n"
- + " */\n"
- +"function foo(p1){}" +
- "\n",
- "X.js",
- "/**\n" +
- " * @extends MyClass\n" +
- " */\n" +
- "function foo(p1) {\n}" +
- "\n"
-
- );
- }
-
- public void test010() {
- CompilationUnitDeclaration declaration = this.runJSDocParseTest(
- "i= { \n"+
- "/**\n" +
- " * @type Number\n" +
- " */\n" +
- " a: 2 ,\n"+
- "/**\n" +
- " * @type Int\n" +
- " */\n" +
- " b: 3+4};" +
- "\n",
- "X.js",
- "i = {\n"+
- " /**\n" +
- " * @type Number\n" +
- " */\n" +
- "a : 2,\n"+
- " /**\n" +
- " * @type Int\n" +
- " */\n" +
- "b : (3 + 4)\n};" +
- "\n"
- );
-
-
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicParserTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicParserTests.java
deleted file mode 100644
index 3e0d568..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicParserTests.java
+++ /dev/null
@@ -1,1017 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-
-public class BasicParserTests extends AbstractRegressionTest {
-
- public BasicParserTests(String name) {
- super(name);
-
- }
- public void test001() {
- CompilationUnitDeclaration declaration = this.runParseTest(
- "{i=1;}" +
- "\n",
- "X.js",
- "{\n i = 1;\n}" +
- "\n"
-
- );
- }
- public void test002() { // missing semicolon
- CompilationUnitDeclaration declaration = this.runParseTest(
- "i=1\n" +
- "j=2;" +
- "\n",
- "X.js",
- "i = 1;\n" +
- "j = 2;" +
- "\n"
-
- );
- }
-
- public void test003() { // var
- CompilationUnitDeclaration declaration = this.runParseTest(
- "var i=1,c=4;" +
- "\n",
- "X.js",
- "var i = 1, c = 4;" +
- "\n"
- );
-
- this.runParseTest(
- "var i=1,c;" +
- "\n",
- "X.js",
- "var i = 1, c;" +
- "\n"
- );
- }
-
- public void test003a() { // var
- CompilationUnitDeclaration declaration = this.runParseTest(
- "var foo=null;" +
- "\n",
- "X.js",
- "var foo = null;" +
- "\n"
- );
-
- this.runParseTest(
- "var i=1,c;" +
- "\n",
- "X.js",
- "var i = 1, c;" +
- "\n"
- );
- }
-
- public void test004() { // functions
- this.runParseTest(
- "function abc(){}" +
- "\n",
- "X.js",
- "function abc() {\n}" +
- "\n"
- );
-
- }
-
- public void test004a() { // functions
- this.runParseTest(
- "function abc(a){}" +
- "\n",
- "X.js",
- "function abc(a) {\n}" +
- "\n"
- );
-
- }
-
- public void test004b() { // functions
- this.runParseTest(
- "function abc(a,b){i=1;}" +
- "\n",
- "X.js",
- "function abc(a, b) {\n i = 1;\n}" +
- "\n"
- );
-
- }
-
- public void test005a() { // expressions
- this.runParseTest(
- "i=this.v1+4;" +
- "\n",
- "X.js",
- "i = (this.v1 + 4);" +
- "\n"
- );
-
- }
-
- public void test005b() { // expressions
- this.runParseTest(
- "i=funccall(c,b);" +
- "i=cc.funccall(c,b);" +
- "i=dd.cc.funccall(c,b);" +
- "\n",
- "X.js",
- "i = funccall(c, b);\n" +
- "i = cc.funccall(c, b);\n" +
- "i = dd.cc.funccall(c, b);" +
- "\n"
- );
-
- }
-
-
- public void test005b2() { // expressions
- this.runParseTest(
- "i=funccall().methCall();" +
- "\n",
- "X.js",
- "i = funccall().methCall();" +
- "\n"
- );
-
- }
-
- public void test005d() { // expressions
- this.runParseTest(
- "i= function (c,b) {i=2;}" +
- "\n",
- "X.js",
- "i = function (c, b) {\n i = 2;\n};" +
- "\n"
- );
-
- }
-
- public void test005e() { // expressions/
- this.runParseTest(
- "i= 1+(z-v);" +
- "i= ++z * v--;" +
- "\n",
- "X.js",
- "i = (1 + (z - v));\n" +
- "i = ((++ z) * (v --));" +
- "\n"
- );
-
- }
-
- public void test005f() { // expressions
- this.runParseTest(
- "i= new abc(dd);" +
- "\n",
- "X.js",
- "i = new abc(dd);" +
- "\n"
- );
-
- }
-
- public void test005f1() { // expressions
- this.runParseTest(
- "i= new dojo.uri.Uri(1,2);" +
- "\n",
- "X.js",
- "i = new dojo.uri.Uri(1, 2);" +
- "\n"
- );
-
- }
-
- public void test005f2() { // expressions
- this.runParseTest(
- "dojo.string.normalizeNewlines = function (text,newlineChar) {i=1;}" +
- "\n",
- "X.js",
- "dojo.string.normalizeNewlines = function (text, newlineChar) {\n i = 1;\n};" +
- "\n"
- );
-
- }
-
- public void test005f3() { // expressions
- this.runParseTest(
- " function foo() {\n" +
- " var maxUnits = 0;\n" +
- " var unitResult = \n" +
- " new CompilationUnitResult(\n" +
- " null, \n" +
- " i, \n" +
- " maxUnits); \n" +
- "}\n",
- "X.js",
- "function foo() {\n"+
- " var maxUnits = 0;\n"+
- " var unitResult = new CompilationUnitResult(null, i, maxUnits);\n"+
- "}"+
- "\n"
- );
-
- }
-
- public void test005f4() { // expressions
- this.runParseTest(
- "i= new SomeClass;" +
- "\n",
- "X.js",
- "i = new SomeClass;" +
- "\n"
- );
-
- }
-
- public void test005f5() { // expressions
- this.runParseTest(
- "function f(){\n" +
- "i= new SomeClass \n}" +
- "\n",
- "X.js",
- "function f() {\n" +
- " i = new SomeClass;\n" +
- "}" +
- "\n"
- );
-
- }
-
- public void test005f6() { // expressions
- this.runParseTest(
- " function X(i){} \n" +
- " function foo(){ \n" +
- " var j = 0; \n" +
- " var x = new X(j); \n" +
- "} " +
- "\n",
- "X.js",
- "function X(i) {\n" +
- "}\n" +
- "function foo() {\n" +
- " var j = 0;\n" +
- " var x = new X(j);\n" +
- "}" +
- "\n"
- );
-
- }
-
-
-
- public void test005g1() { // expressions
- this.runParseTest(
- "i= typeof objpath != \"string\";" +
- "\n",
- "X.js",
- "i = ((typeof objpath) != \"string\");" +
- "\n"
- );
-
- }
-
- public void test005g2() { // expressions
- this.runParseTest(
- "i= ar instanceof Error;" +
- "\n",
- "X.js",
- "i = (ar instanceof Error);" +
- "\n"
- );
- }
-
- public void test005g3() { // expressions
- this.runParseTest(
- "i= anArg.name != null ;" +
- "\n",
- "X.js",
- "i = (anArg.name != null);" +
- "\n"
- );
- }
-
- public void test005g4() { // expressions
- this.runParseTest(
- "i= anArg.name != undefined ;" +
- "\n",
- "X.js",
- "i = (anArg.name != undefined);" +
- "\n"
- );
- }
-
- public void test005h1() { // expressions
- this.runParseTest(
- "i= { a: 2 , b: 3+4};" +
- "\n",
- "X.js",
- "i = {\n a : 2,\n b : (3 + 4)\n};" +
- "\n"
- );
-
-}
-
- public void test005h1a() { // expressions
- this.runParseTest(
- "i= { 'a': 2 , 'b': 3+4};" +
- "\n",
- "X.js",
- "i = {\n \"a\" : 2,\n \"b\" : (3 + 4)\n};" +
- "\n"
- );
-
-}
-
- public void test005h2() { // expressions
- this.runParseTest(
- "i= { a: function(){ var ar={c:3,d:4,e:4}; } , b: function(cc){ var c=1;} , d:function(){}};" +
- "\n",
- "X.js",
- "i = {\n a : function () {\n var ar = {\n c : 3,\n d : 4,\n e : 4\n };\n},\n b : function (cc) {\n var c = 1;\n},\n d : function () {\n}\n};" +
- "\n"
- );
-
-}
-
- public void test005i() { // expressions
- this.runParseTest(
- "i= arr[4];" +
- "\n",
- "X.js",
- "i = arr[4];" +
- "\n"
- );
- }
- public void test005i1() { // expressions
- this.runParseTest(
- "arr[4]=1;" +
- "\n",
- "X.js",
- "arr[4] = 1;" +
- "\n"
- );
- }
- public void test005i2() { // expressions
- this.runParseTest(
- "var arr=null;" +
- "arr[4]=1;" +
- "\n",
- "X.js",
- "var arr = null;\n" +
- "arr[4] = 1;" +
- "\n"
- );
- }
- public void test005j() { // expressions
- this.runParseTest(
- "i= [a,b];" +
- "\n",
- "X.js",
- "i = [a, b];" +
- "\n"
- );
- }
-
- public void test005j2() { // expressions
- this.runParseTest(
- "i= [,a];" +
- "\n",
- "X.js",
- "i = [, a];" +
- "\n"
- );
- }
-
- public void test005j3() { // expressions
- this.runParseTest(
- "i= [a,];" +
- "\n",
- "X.js",
- "i = [a, ];" +
- "\n"
- );
- }
-
- public void test005j4() { // expressions
- this.runParseTest(
- "i= [,];" +
- "\n",
- "X.js",
- "i = [, ];" +
- "\n"
- );
- }
-
- public void test005j5() { // expressions
- this.runParseTest(
- "i= [];" +
- "\n",
- "X.js",
- "i = [];" +
- "\n"
- );
- }
- public void test005j6() { // expressions
- this.runParseTest(
- "i= [a,,b];" +
- "\n",
- "X.js",
- "i = [a, , b];" +
- "\n"
- );
- }
-
- public void test005j7() { // expressions
- this.runParseTest(
- "i= [,,];" +
- "i= [,,,];" +
- "i= [,,b,];" +
- "\n",
- "X.js",
- "i = [, , ];\n" +
- "i = [, , , ];\n" +
- "i = [, , b, ];" +
- "\n"
- );
- }
-
- public void test005j8() { // expressions
- this.runParseTest(
- "i= [a,b,,c];" +
- "\n",
- "X.js",
- "i = [a, b, , c];" +
- "\n"
- );
- }
-
- public void test007() { // if
- this.runParseTest(
- "if (a>1) this.c=f+5;" +
- "\n",
- "X.js",
- "if ((a > 1))\n this.c = (f + 5);" +
- "\n"
- );
- }
-
- public void test008() { // try catch
- this.runParseTest(
- "try { a=2;} catch (ex) {a=3;}" +
- "\n",
- "X.js",
- "try \n {\n a = 2;\n }\ncatch (ex) {\n a = 3;\n }" +
- "\n"
- );
- }
-
- public void test009() { // for
- this.runParseTest(
- "for (i=1;i<3;i++)\n" +
- " f++;" +
- "\n",
- "X.js",
- "for (i = 1; (i < 3); i ++) \n f ++;"+
- "\n"
- );
- }
- public void test009a() { // for
- this.runParseTest(
- "for (;i<3;i++)\n" +
- " f++;" +
- "\n",
- "X.js",
- "for (; (i < 3); i ++) \n f ++;"+
- "\n"
- );
- }
-
- public void test010() { // for in
- this.runParseTest(
- "for (var a in this.vars)\n" +
- " f++;" +
- "\n",
- "X.js",
- "for (var a in this.vars) \n f ++;"+
- "\n"
- );
- }
-
-
- public void test011() { // for in
- this.runParseTest(
- "with (foo)\n" +
- " bar;" +
- "\n",
- "X.js",
- "with (foo)\n"+
- " bar;\n"
- );
- }
-
- public void test010a() { // for in
- this.runParseTest(
- "for (a in this.vars)\n" +
- " f++;" +
- "\n",
- "X.js",
- "for (a in this.vars) \n f ++;"+
- "\n"
- );
- }
-
-
- public void test015() { // missing semicolon
- this.runParseTest(
- " function bar() \n{\n" +
- " System.out.println()\n" +
- " }\n" ,
- "X.js",
- "function bar() {\n"+
- " System.out.println();\n" +
- "}\n"
- );
- }
-
- public void test015a() { // missing semicolon
- this.runParseTest(
- "function bar() {\n"+
- " System.out\n" +
- "}\n",
- "X.js",
- "function bar() {\n"+
- " System.out;\n" +
- "}\n"
- );
- }
-
- public void test020() { // missing semicolon
- this.runParseTest(
- "function Bob(firstname, lastname) {\n" +
- " var Firstname = firstname;\n" +
- " var Lastname = lastname;\n" +
- "}\n" +
- "Bob.prototype.name = function () {return this.Fistname + this.Lastname;};\n",
- "X.js",
- "function Bob(firstname, lastname) {\n" +
- " var Firstname = firstname;\n" +
- " var Lastname = lastname;\n" +
- "}\n" +
- "Bob.prototype.name = function () {\n return (this.Fistname + this.Lastname);\n};\n"
- );
- }
-
- public void test022() {
- this.runParseTest(
- "var SingleQuote = {\n" +
- " Version: '1.1-beta2' \n" +
- "}\n",
- "X.js",
- "var SingleQuote = {\n" +
- " Version : \"1.1-beta2\"\n" +
- "};\n"
- );
- }
-
- public void test023() {
- this.runParseTest(
- "var Try = { \n" +
- " these: function() { \n" +
- " var returnValue; \n" +
- " } \n"+
- " } \n",
- "X.js",
- "var Try = {\n" +
- " these : function () {\n" +
- " var returnValue;\n" +
- "}\n"+
- "};\n"
- );
- }
-
- public void test024() {
- this.runParseTest(
- "var Try = { \n" +
- " these: function() { \n" +
- " var returnValue; \n" +
- " } \n" +
- "};",
- "X.js",
- "var Try = {\n" +
- " these : function () {\n" +
- " var returnValue;\n" +
- "}\n" +
- "};\n"
- );
- }
-
-
- public void test026() {
- this.runParseTest(
- "String.replace(/&/g, '&amp;');",
- "X.js",
- "String.replace(/&/g, \"&amp;\");\n"
- );
- }
-
- public void test027() {
- this.runParseTest(
- " (!options) ? options = {} : '';",
- "X.js",
- "((! options) ? (options = {}) : \"\");\n"
- );
- }
-
- public void test027b() {
- this.runParseTest(
- " (!options) ? '' : options = {};",
- "X.js",
- "((! options) ? \"\" : (options = {}));\n"
- );
- }
-
- public void test028() {
- this.runParseTest(
- " if (typeof dojo==\"undefined\"){ \n" +
- " function dj_undef(){ \n" +
- " } \n" +
- "}",
- "X.js",
- "if (((typeof dojo) == \"undefined\"))\n" +
- " {\n" +
- " function dj_undef() {\n" +
- " }\n" +
- " }\n"
- );
- }
-
- public void test029() {
- this.runParseTest(
- " abc();",
- "X.js",
- "abc();\n"
- );
- }
-
- public void test030() {
- this.runParseTest(
- " \"cc\".abc();",
- "X.js",
- "\"cc\".abc();\n"
- );
- }
-
- public void test031() {
- this.runParseTest(
- "var a = 1;\n" +
- "// test unicode \\u00a var a =1; \n" +
- "var b = 2; \n",
- "X.js",
- "var a = 1;\n" +
- "var b = 2;\n"
- );
- }
- public void test032() {
- this.runParseTest(
- "var a = 1;\n" +
- "/* \n" +
- "* test unicode \\u00a var a =1; \n " +
- "*/" +
- "var b = 2; \n",
- "X.js",
- "var a = 1;\n" +
- "var b = 2;\n"
- );
- }
-
- public void test033() {
- this.runParseTest(
- "var a = \"a\\>\";\n",
- "X.js",
- "var a = \"a>\";\n"
- );
- }
-
- public void test034() {
- this.runParseTest(
- "label: for (var i = 0; i < 10; i++) {\n" +
- " continue label;\n" +
- "}",
- "X.js",
- "label: for (var i = 0;; (i < 10); i ++) \n" +
- " {\n"+
- " continue label;\n"+
- " }\n"
- );
- }
-
-
- public void test035() {
- // check a unicode " in string. The expected " is escaped
- // because of the way the test framework works. It converts
- // special characters to a character representation before
- // doing the compare.
- this.runParseTest(
- "\"abc\\u0022def\";\n",
- "X.js",
- "\"abc\\\"def\";\n"
- );
- }
-
- public void test036() {
- this.runParseTest(
- "'abc\\u0027def';\n",
- "X.js",
- "\"abc\\'def\";\n"
- );
- }
-
- public void test037() {
- // check a unicode " in string. The expected " is escaped
- // because of the way the test framework works. It converts
- // special characters to a character representation before
- // doing the compare.
- this.runParseTest(
- "\"\\u0022def\";\n",
- "X.js",
- "\"\\\"def\";\n"
- );
- }
-
- public void test038() {
- // check a unicode " in string. The expected " is escaped
- // because of the way the test framework works. It converts
- // special characters to a character representation before
- // doing the compare.
- this.runParseTest(
- "\"abc\\x22def\";\n",
- "X.js",
- "\"abc\\\"def\";\n"
- );
- }
-
- public void test039() {
- // check a unicode " in string. The expected " is escaped
- // because of the way the test framework works. It converts
- // special characters to a character representation before
- // doing the compare.
- this.runParseTest(
- "\"\\x22def\";\n",
- "X.js",
- "\"\\\"def\";\n"
- );
- }
-
- public void test040() {
- this.runParseTest(
- "var onStart = function() { \n" +
- " this.onStart.fire();\n" +
- " this.runtimeAttributes = {};\n" +
- " for (var attr in this.attributes) {\n" +
- " this.xyz(attr);\n" +
- " }\n" +
- "};",
- "X.js",
- "var onStart = function () {\n" +
- " this.onStart.fire();\n" +
- " this.runtimeAttributes = {};\n" +
- " for (var attr in this.attributes) \n" +
- " {\n" +
- " this.xyz(attr);\n" +
- " }\n" +
- "};\n"
- );
- }
-
- public void test041() {
- // check a unicode " in string. The expected " is escaped
- // because of the way the test framework works. It converts
- // special characters to a character representation before
- // doing the compare.
- this.runParseTest(
- "(function (){});\n",
- "X.js",
- "function () {\n};\n"
- );
- }
-
-
- public void test042() {
- // check a unicode " in string. The expected " is escaped
- // because of the way the test framework works. It converts
- // special characters to a character representation before
- // doing the compare.
- this.runParseTest(
- "function trim(oldString)\n" +
- "{\n" +
- "var newString = oldString;\n" +
- "var safety = 0;\n" +
- "var safetyLimit = 10000;\n" +
- "while(newString.charAt(0) == \" \" && safety < safetyLimit){\n" +
- " newString = newString.substring(1);\n" +
- " safety++;\n" +
- "}\n" +
- "while(newString.charAt(newString.length-1) == \" \" && safety < safetyLimit){\n" +
- "newString = newString.substring(0, newString.length-1);\n" +
- " safety++\n" +
- " }\n" +
- "return newString;\n" +
- "};",
- "X.js",
-
- "function trim(oldString) {\n" +
- " var newString = oldString;\n" +
- " var safety = 0;\n" +
- " var safetyLimit = 10000;\n" +
- " while (((newString.charAt(0) == \" \") && (safety < safetyLimit))) {\n" +
- " newString = newString.substring(1);\n" +
- " safety ++;\n" +
- " }\n" +
- " while (((newString.charAt((newString.length - 1)) == \" \") && (safety < safetyLimit))) {\n" +
- " newString = newString.substring(0, (newString.length - 1));\n" +
- " safety ++;\n" +
- " }\n" +
- " return newString;\n" +
- "}\n" +
- ";\n"
- );
- }
-
-
-
-
- public void test043() {
- this.runParseTest(
- "Foo=function(){}\nbar=function(){}",
- "X.js",
- "Foo = function () {\n};\nbar = function () {\n};\n"
- );
- }
-
-
- public void test044() {
- this.runParseTest(
- "ptr[i]();",
- "X.js",
- "ptr[i]();\n"
- );
- }
-
-
-
- public void test045() {
- // make sure divide not seen as regex
- this.runParseTest(
- "((weight + 1)/2)",
- "X.js",
- "((weight + 1) / 2);\n"
- );
- }
-
- public void test046() {
- // make sure divide not seen as regex
- this.runParseTest(
- "a=1,b=2",
- "X.js",
- "(a = 1), (b = 2);\n"
- );
- }
-
- public void test046b() {
- // make sure divide not seen as regex
- this.runParseTest(
- "a=1,funcall(0),5",
- "X.js",
- "(a = 1), funcall(0), 5;\n"
- );
- }
-
- public void test050() {
- // make sure divide not seen as regex
- this.runParseTest(
- "if (true) var c=1;",
- "X.js",
- "if (true)\n var c = 1;\n"
- );
- }
-
- public void test051() {
- // method on function object
- this.runParseTest(
- "var c=function(){}.bind();",
- "X.js",
- "var c = function () {\n}.bind();\n"
- );
- }
-
- public void test051b() {
- // method on function object
- this.runParseTest(
-
- "transforms = map(function (){\n"+
- "}.bind()).reject(function (){\n"+
- "});",
-
- "X.js",
- "transforms = map(function () {\n"+
- "}.bind()).reject(function () {\n"+
- "});\n"
- );
- }
-
-
- public void test051c() {
- // method on function object
- this.runParseTest(
-
- "map(function(){"+
- "if(true) {"+
- "} else if(true)"+
- "var components = value.match(),"+
- "unit = null;"+
- "}.bind(this));",
-
- "X.js",
- "map(function () {\n"+
- " if (true)\n {\n"+
- " }\n else\n if (true)\n"+
- " var components = value.match(),"+
- " unit = null;"+
- "\n}.bind(this));\n"
- );
- }
-
- public void test051d() {
- this.runParseTest(
-
- "function bb(){"+
- "if(true)"+
- "var components = value.match(),"+
- "unit = null;"+
- "};",
-
- "X.js",
- "function bb() {\n"+
- " if (true)\n"+
- " var components = value.match(),"+
- " unit = null;"+
- "\n}\n;\n"
- );
- }
-
-
- public void testbug254572() {
- this.runParseTest(
-
- "var fields = ["+
- " {name: 'id', type: 'int'},"+
- " abc, userName, , 'forumtitle', 'forumid', 'author',"+
- ""+
- " {name: 'lastpost', mapping: 'lastpost', type: 'date',"+
- "dateFormat: 'timestamp'},"+
- " 'lastposter', 'excerpt'"+
- " ];"+
- ";",
-
- "X.js",
- "var fields = ["+
- "{\n name : \"id\",\n type : \"int\"\n},"+
- " abc, userName, , \"forumtitle\", \"forumid\", \"author\","+
- " {\n name : \"lastpost\",\n mapping : \"lastpost\",\n type : \"date\",\n"+
- " dateFormat : \"timestamp\"\n},"+
- " \"lastposter\", \"excerpt\""+
- "];"+
- "\n;\n"
- );
- }
-
- public void testbug248145() {
- this.runParseTest(
-
- "return \n"+
- "a+b;"+
- "",
-
- "X.js",
- "return ;\n"+
- "(a + b);"+
- "\n"
- );
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java
deleted file mode 100644
index 798168e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java
+++ /dev/null
@@ -1,1717 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-
-
-
-public class BasicResolveTests extends AbstractRegressionTest {
-
- public BasicResolveTests(String name) {
- super(name);
-
- }
- public void test002() { // local method
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(){\n" +
- " abc(); \n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " abc(); \n"+
- " ^^^\n"+
- "The function abc() is undefined\n"+
- "----------\n"
- );
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(a){\n" +
- " foo(a); \n" +
- "}\n"
- },
- ""
- );
-
- }
-
- public void test003() { // local var
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var i;" +
- "i=1;\n" +
- "\n"
- },
- ""
- );
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var i;\n" +
- "i=j;\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " i=j;\n"+
- " ^\n"+
- "j cannot be resolved\n"+
- "----------\n"
- );
-
-
- }
-
- public void test004() { // system reference
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var win=debugger;\n" +
- "Object();\n" +
- "\n"
- },
- ""
- );
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var i;\n" +
- "i=j;\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " i=j;\n"+
- " ^\n"+
- "j cannot be resolved\n"+
- "----------\n"
- );
-
-
- }
-
- public void test005() { // system reference
- this.runNegativeTest(
- new String[] {
- "X.js",
- "Object();\n" +
- "\n"
- },
- ""
- );
-
-
- }
-
-
-// With inferred types
-
- public void test010() { // field reference
- this.runNegativeTest(
- new String[] {
- "X.js",
- "MyClass.prototype.someMethod = MyClass_someMethod;"+
- "function MyClass(){}"+
- "function MyClass_someMethod(){}"+
- "var myClassObj = new MyClass();\n"+
- "myClassObj.someMethod();\n"
- },
- ""
- );
-
-
- }
-
- public void test011() { // field reference
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function MyClass() {\n"+
- " this.url = \"\";\n"+
- " this.activate = function(){}\n"+
- "}\n"+
- "var myClassObj = new MyClass();\n"+
- "var u=myClassObj.url;\n"+
- "\n"
- },
- ""
- );
-
-
- }
-
-
- public void test012() { // field reference
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function Bob(firstname, lastname) {\n" +
- " this.Firstname = firstname;\n" +
- " this.Lastname = lastname;\n" +
- "}\n" +
- "Bob.prototype.name = function () {return this.Firstname + this.Lastname;};\n",
- },
- ""
- );
-
-
- }
-
- public void test013() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var SingleQuote = {\n" +
- " Version: '1.1-beta2' \n" +
- "}\n"
- },
- ""
- );
-
- }
-
- public void test014() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var o = {x:1, y: 2, name: \"print\" };\n" +
- "o.Z = 0; \n"
- },
- ""
- );
-
- }
-
-
-
- public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo() {\n" +
- " var t = new Test();\n" +
- "}\n" +
- " function Test()\n" +
- "{\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " var t = new Test();\n" +
- " ^\n" +
- "The local variable t is never read\n" +
- "----------\n"
- );
-
- }
- public void test021() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo() {\n" +
- " var i=1;\n" +
- " if (2>i )\n" +
- " foo();\n" +
- "}\n"
- },
- ""
- );
-
- }
-
- public void test022() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo() {\n" +
- " var ff=function(p) \n" +
- " {var c=p;};\n" +
- " ff(1);\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 3)\n" +
- " {var c=p;};\n" +
- " ^\n" +
- "The local variable c is never read\n" +
- "----------\n"
- );
-
- }
-
- public void test022b() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var ff=function(p) \n" +
- " {var c=p;};\n" +
- " ff(1);\n" +
- ""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " {var c=p;};\n" +
- " ^\n" +
- "The local variable c is never read\n" +
- "----------\n"
- );
-
- }
-
-
- public void test023() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var ff=new String();\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test024() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function bar() {;\n" +
- "return Test.x;\n" +
- "}\n" +
- "Test.prototype=new Object();\n" +
- "Test.x=1;\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test025() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function g() {\n" +
- "return null;\n" +
- "}\n" +
- "function foo() {\n" +
- " g();\n" +
- "}\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test026() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var i=[10];\n" +
- ""
- },
- ""
- );
-
- }
-
-
- public void test027() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function bar(vv) {;\n" +
- "return vv%4;\n" +
- "}\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test028() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var c=false;\n" +
- "var d=!c;\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test029() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var d=new Date(1);\n" +
- ""
- },
- ""
- );
-
- }
-
-
- public void test030() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo(e) {\n" +
- "var x= 10, z = null, i, j;\n" +
- "}\n" +
- ""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " var x= 10, z = null, i, j;\n" +
- " ^\n" +
- "The local variable x is never read\n" +
- "----------\n" +
- "2. WARNING in X.js (at line 2)\n" +
- " var x= 10, z = null, i, j;\n" +
- " ^\n" +
- "The local variable z is never read\n" +
- "----------\n" +
- "3. WARNING in X.js (at line 2)\n" +
- " var x= 10, z = null, i, j;\n" +
- " ^\n" +
- "The local variable i is never read\n" +
- "----------\n" +
- "4. WARNING in X.js (at line 2)\n" +
- " var x= 10, z = null, i, j;\n" +
- " ^\n" +
- "The local variable j is never read\n" +
- "----------\n"
- );
-
- }
- public void test031() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function OBJ(){}\n" +
- "var o = new OBJ();\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test032() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var foo = {};\n" +
- " foo.onMouseDown = function () { return 1; };\n" +
- " foo.onMouseDown();\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test032b() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var foo = {};\n" +
- " foo.level1=new Object();\n" +
- " foo.level1.onMouseDown = function () { return 1; };\n" +
- " foo.level1.onMouseDown();\n" +
- ""
- },
- ""
- );
-
- }
-
-
- public void test033() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " if (typeof abc == \"undefined\") {}\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test034() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " if (true) {\n" +
- " var abc=1;}\n" +
- " var d=abc;\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test035() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo() {\n" +
- " var vv=arguments;}\n" +
- ""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " var vv=arguments;}\n" +
- " ^^\n" +
- "The local variable vv is never read\n" +
- "----------\n"
- );
-
- }
-
-
- public void test036() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo() {\n" +
- " function inner(){}\n" +
- " inner();\n" +
- " }\n" +
- ""
- },
- ""
- );
-
- }
-
-
- public void test037() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var s = new String();\n" +
- " var sub=s.substring(0,0);\n" +
- " var i=sub.length;\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test038() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " s = new String();\n" +
- " sub=s.substring(0,0);\n" +
- " i=sub.length;\n" +
- ""
- },
- ""
- );
-
- }
-
-
- public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var s = \"\";\n" +
- " with (s) {\n" +
- " var i=length;\n" +
- " }\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test040() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var s = \"\";\n" +
- " with (s) {\n" +
- " var i=charAt(0);\n" +
- " }\n" +
- ""
- },
- ""
- );
-
- }
-
- /*
- * Field reference error testing
- */
- public void test041() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var x = {};\n" +
- "var b=x;\n;"+
- "b.a=\"\";\n;"+
- "x.a = \"\""
- },
- ""
- );
-
- }
-
- public void test042() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var x = {};\n" +
- "x.a.b = \"\""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " x.a.b = \"\"\n"+
- " ^\n"+
- "a cannot be resolved or is not a field\n"+
- "----------\n"
- );
- }
-
- public void test043() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var x = null;\n" +
- "x>3;"+
- "var y;\n" +
- "y=null;\n" +
- "y>3"+
- ""
- },
- ""
- );
-
- }
-
- public void test044() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " if (typeof abc == \"undefined\") { abc=1;}\n" +
- " var c= abc;\n" +
- ""
- },
- ""
- );
-
- }
-
- public void test045() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var a,b=1;\n" +
- " var c= b;\n" +
- " function abc(){" +
- " var d= 1,e=4;\n" +
- " var f=e;}\n" +
- ""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 3)\n" +
- " function abc(){ var d= 1,e=4;\n" +
- " ^\n" +
- "The local variable d is never read\n" +
- "----------\n" +
- "2. WARNING in X.js (at line 4)\n" +
- " var f=e;}\n" +
- " ^\n" +
- "The local variable f is never read\n" +
- "----------\n"
- );
-
- }
-
-
- public void test046() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function debug2() {\n" +
- " var keyFunct = null;\n" +
- " keyFunct = function () {};\n" +
- " keyFunct();\n" +
- " }\n" +
- ""
- },
- ""
- );
-
- }
-
-
- public void test046b() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function debug2() {\n" +
- " var keyFunct = null;\n" +
- " keyFunct = new function () {};\n" +
- " keyFunct();\n" +
- " }\n" +
- ""
- },
- ""
- );
-
- }
-
-
- public void test047() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function Config() {}\n" +
- "Config.printDocTypes = function() { throw new (\"doctype 1.\"); };\n" +
- "Config.prototype.toString = function () { return \"\"; };\n" +
- "function main() {\n" +
- " Config.printDocTypes();\n" +
- "} \n" +
- ""
- },
- ""
- );
- }
-
-
- public void test048() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function Config2() {};\n" +
- "Config2.INPUT_DIR = \"\";\n" +
- "Config2.OUTPUT_DIR = Config2.INPUT_DIR ;\n" +
- "Config2.getNum = function() { return 1; }\n" +
- "function numberGen() { \n" +
- " return Config2.getNum(); \n" +
- "} \n" +
- ""
- },
- ""
- );
- }
-
- public void test049() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var arr=[];\n" +
- "var ref=arr.length;\n" +
- "var o=arr.pop();\n" +
- ""
- },
- ""
- );
- }
-
-
- public void test050() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function getDateTime() {\n" +
- " this.ctime = new Object();\n" +
- " this.ctime.getDay = new function() { return \"Mon\"; };\n" +
- " return this;\n" +
- " }\n" +
- " function debug3() {\n" +
- " var newObj = getDateTime();\n" +
- " return newObj.ctime.getDay();\n" +
- " }\n" +
- ""
- },
- ""
- );
- }
-
- public void test050b() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function getDateTime() {\n" +
- " this.ctime = new Object();\n" +
- " this.ctime.getDay = new function() { return \"Mon\"; };\n" +
- " return this;\n" +
- " }\n" +
- " function debug3() {\n" +
- " var newObj = new getDateTime();\n" +
- " return newObj.ctime.getDay();\n" +
- " }\n" +
- ""
- },
- ""
- );
- }
-
-
- public void test051() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var ns = {};\n"+
- "ns.foo = function(){\n" +
- "};\n" +
- "ns.foo.prototype.bar = \"\";\n" +
- "ns.foo.prototype.bar2 = function(){\n" +
- " return \"\";\n" +
- "}\n"+
- "c=new ns.foo();\n"+
- "c.bar2();\n"+
- "i=c.bar;\n"+
- ""
- },
- ""
- );
- }
-
-
- public void test052() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var myObject=new Object();\n"+
- "myObject.ctor= function(){\n" +
- "};\n" +
- "myObject.ctor.prototype.bar = \"\";\n" +
- "myObject.ctor.prototype.bar2 = function(){\n" +
- " return \"\";\n" +
- "}\n"+
- "c=new myObject.ctor();\n"+
- "c.bar2();\n"+
- "i=c.bar;\n"+
- ""
- },
- ""
- );
- }
-
-
-
- public void test053() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function funccall(pp){}\n"+
- "funccall({\n"+
- "meth : function(){ \n" +
- " var c=this.i; },\n" +
- " i : 1 \n" +
- "});\n"+
- ""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 4)\n" +
- " var c=this.i; },\n" +
- " ^\n" +
- "The local variable c is never read\n" +
- "----------\n"
- );
- }
-
- /*public void testbug259187() {
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var params = \"some?string\".split('?');\n" +
- "var base = params.shift();"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 1)\n" +
- " var params = \"some?string\".split(\'?\');\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Wrong number of arguments for the function split (), expecting 2 argument(s), but there was 1 \n" +
- "----------\n"
- );
- }
-
- public void testbug259023() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal", "error");
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var myObject = {\n" +
- "val1: \"test1\",\n" +
- "val2: \"test2\"\n" +
- "};\n" +
- "myObject.val1 = \"test3\";"
- },
- "", null, true, custom
- );
- }
-
- public void testbug259023_2() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal", "error");
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var myObject = \"test3\";\n" +
- "if(myObject == \"test3\") {}"
- },
- "", null, true, custom
- );
- }
-
- public void testbug251374() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.nullReference", "error");
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var a = null;\n" +
- "function foo() { a.toString();}\n" +
- "a = 1; foo();"
- },
- "", null, true, custom
- );
- }
-
- public void testChris() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal", "error");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var square = function(x) {return x*x;};" +
- "square(2);",
- },
- "", null, true, custom
- );
- }
-
- public void testChris2() {
- Map custom = new HashMap();
- custom.put("org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal", "error");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var square = \"chris\";" +
- "square.split(\".\", 1);",
- },
- "", null, true, custom
- );
- }*/
-
- public void test054() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function func1(pp){}\n"+
- "func1();\n"+
- "function obj(){}\n"+
- "var o=new obj(1);\n"+
- ""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " func1();\n" +
- " ^^^^^^^\n" +
- "Wrong number of arguments for the function func1 (), expecting 1 argument(s), but there was 0 \n" +
- "----------\n" +
- "2. WARNING in X.js (at line 4)\n" +
- " var o=new obj(1);\n" +
- " ^^^^^^^^^^\n" +
- "Wrong number of arguments for the function obj (), expecting 0 argument(s), but there was 1 \n" +
- "----------\n"
- );
- }
-
-
- public void test055() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function func1(base,mixin){\n"+
- "var bp = (base||0).prototype;\n"+
- "}\n"+
- ""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " var bp = (base||0).prototype;\n" +
- " ^^\n" +
- "The local variable bp is never read\n" +
- "----------\n"
- );
- }
-
-
- public void test056() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var arr=[];\n"+
- "arr.push(1);\n"+
- ""
- },
- ""
- );
- }
-
- public void test057() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var arr= {\n"+
- " func: function(){ \n"+
- " this.func();\n"+
- " } \n"+
- "};\n"+
- ""
- },
- ""
- );
- }
-
-
- public void test058() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var cls= {};\n"+
- "cls.arr={};\n"+
- "cls.arr[\"ss\"]=1;\n"+
- "var dd=cls.arr[\"ssd\"];\n"+
- ""
- },
- ""
- );
- }
-
-
- public void test059() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "/**\n"
- + " * Valid class javadoc\n"
- + " * @param {String | Number} p1 param def\n"
- + " */\n"
- +"function foo(p1){\n"
- +"p1.length;\n"
- +"p1.toPrecision(1);\n"
- +"}\n"
- +""
- },
- ""
- );
- }
-
-
- public void test060() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo(p1){\n"
- +"p1();\n"
- +"}\n"
- +""
- },
- ""
- );
- }
-
- public void test061() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function foo(){\n"
- +"p1=1;\n"
- +"p1();\n"
- +"}\n"
- +""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 3)\n" +
- " p1();\n" +
- " ^^\n" +
- "p1 is not a function \n" +
- "----------\n"
- );
- }
-
-
- public void test062() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var cc=function(){\n"
- +" function inner(){}\n"
- +" var dd=inner;\n"
- +"}\n"
- +""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 3)\n" +
- " var dd=inner;\n" +
- " ^^\n" +
- "The local variable dd is never read\n" +
- "----------\n"
- );
- }
-
-
- public void test063() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var cc=function(){\n"
- +" var ii;\n"
- +" function inner(){\n"
- +" var dd=ii;\n"
- +" }\n"
- +"}\n"
- +""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 4)\n" +
- " var dd=ii;\n" +
- " ^^\n" +
- "The local variable dd is never read\n" +
- "----------\n" +
- "2. WARNING in X.js (at line 4)\n" +
- " var dd=ii;\n" +
- " ^^\n" +
- "The local variable ii may not have been initialized\n" +
- "----------\n"
- );
- }
-
- public void test064() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function inner(){\n"
- +" var ii=0,i2=ii+1;\n"
-// +" var ii=0;\n"
-// +" var i2=ii+1;\n"
- +"}\n"
- +""
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " var ii=0,i2=ii+1;\n" +
- " ^^\n" +
- "The local variable i2 is never read\n" +
- "----------\n"
- );
- }
-
- public void test065() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function inner(aArray){\n"
- +" var number = 0;\n"
- +" number -= aArray.length;\n"
- +" number += aArray.length;\n"
- +" return number;\n"
- +"}\n"
- +""
- },
- ""
- );
- }
-
- public void test066() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " TestClass = function() {\n"
- +" }\n"
- +" TestClass.prototype = new Object();\n"
- +" ns=new Object();\n"
- +" ns.TestClass = function() {\n"
- +" }\n"
- +" ns.TestClass.prototype = new Object();\n"
- +""
- },
- ""
- );
- }
-
- public void test067() {
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(a){\n" +
- " doo(a); \n" +
- "}\n",
- "Y.js",
- " function doo(a){\n" +
- " foo(a); \n" +
- "}\n"
- },
- ""
- );
-
- }
-
-
- public void test068() {
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(param1 , param2){\n" +
- " if(\"\" || 0) {} \n" +
- " var value = param1 || param2; \n" +
- " if(param1 || param2) {} \n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.js (at line 3)\n" +
- " var value = param1 || param2; \n" +
- " ^^^^^\n" +
- "The local variable value is never read\n" +
- "----------\n"
- );
-
- }
-
- public void test070() {
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var s=new String();\n" +
- " s.length=1; \n" +
- "\n",
- },
- ""
- );
- }
-
- public void testbug255428() {
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function MyClass(){}\n" +
- " MyClass.prototype = {\n" +
- " a : 0,\n" +
- " myfunc : function(){} \n" +
- " };\n" +
- "function test() { \n" +
- " var lObj = new MyClass();\n" +
- " lObj.a = 2;\n" +
- " lObj.myfunc();\n" +
- "}\n",
- },
- ""
- );
- }
-
- public void testbug259187_String_slice() {
- // String.split() argument count
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var params = \"some?string\".slice('?');\n"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 1)\n" +
- " var params = \"some?string\".slice(\'?\');\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Wrong number of arguments for the function slice (), expecting 2 argument(s), but there was 1 \n" +
- "----------\n"
- );
-
- // check return type and argument count
- runBasicTest(new String[] {
- "Yprime.js",
- "var aString = \"some?string\".slice(2, 4);\n" +
- "aString.length;"
- });
- }
-
- public void testbug259187_String_split() {
- // String.split() argument count
- this.runNegativeTest(
- new String[] {
- "Y.js",
- "var params = \"some?string\".split('?');\n" +
- "var base = params.shift();"
- },
- "----------\n" +
- "1. WARNING in Y.js (at line 1)\n" +
- " var params = \"some?string\".split(\'?\');\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Wrong number of arguments for the function split (), expecting 2 argument(s), but there was 1 \n" +
- "----------\n"
- );
-
- // check return type and argument count
- runBasicTest(new String[] {
- "Yprime.js",
- "var count = \"some?string\".split(\",\", 3);\n" +
- "count.length;"
- });
- }
-
- public void testbug259187_String_substring() {
- // String.substring() argument count
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "var count = \"some?string\".substring('?');"
- },
- "----------\n" +
- "1. WARNING in Z.js (at line 1)\n" +
- " var count = \"some?string\".substring(\'?\');\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Wrong number of arguments for the function substring (), expecting 2 argument(s), but there was 1 \n" +
- "----------\n"
- );
-
- // check return type and argument count
- runBasicTest(new String[] {
- "Zprime.js",
- "var count = \"some?string\".substring(4, 3);\n" +
- "count.substring(4, 3);"
- });
- }
-
- public void Xtestbug196377_1() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "(function() {\n" +
- "hasClass();\n" +
- "function hasClass() {}\n" +
- "})();"
- },
- ""
- );
- }
-
- public void Xtestbug196377_2() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "top();" +
- "function top() {\n" +
- "inner();\n" +
- "function inner() {}\n" +
- "}"
- },
- ""
- );
- }
-
- public void testbug196377_3() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "top();\n" +
- "function top() {}\n"
- },
- ""
- );
- }
-
- public void testbug196377_4() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "top(1);\n" +
- "function top(a) {}\n"
- },
- ""
- );
- }
-
- public void testbug283663() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "var myNum = 3;\n" +
- "if(myNum === undefined){}\n" +
- "if(myNum == undefined){}\n"
- },
- ""
- );
- }
-
- public void testbug262728_A() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function top() {\n"+
- "var x = function() {};\n"+
- "var x1 = 3;\n"+
- "inner();\n"+
- "function inner() {\n"+
- "var p = x1 + 3;\n"+
- "x();\n"+
- "inner2();\n"+
- "function inner2() {}\n"+
- "inner2();\n"+
- "}\n"+
- "x();\n"+
- "top();\n"+
- "}\n"+
- "top();"
- },
- "----------\n" +
- "1. WARNING in Z.js (at line 6)\n" +
- " var p = x1 + 3;\n" +
- " ^\n" +
- "The local variable p is never read\n" +
- "----------\n"
- );
- }
-
- public void testbug262728_B() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function class2() {\n"+
- "this.publicFunction = function() {\n"+
- "privateFunction();\n"+
- "};\n"+
- "function privateFunction() {\n"+
- "return null;\n"+
- "};\n"+
- "}\n"+
- "function class1() {\n"+
- "function privateFunction() {\n"+
- "return null;\n"+
- "};\n"+
- "this.publicFunction = function() {\n"+
- "privateFunction();\n"+
- "};\n"+
- "}"
- },
- ""
- );
- }
- public void testbug262728_C() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "inner();\n"+
- "function top() {\n"+
- "inner();\n"+
- "function inner(){};\n"+
- "inner();\n"+
- "}\n"+
- "inner();"
- },
- "----------\n" +
- "1. ERROR in Z.js (at line 1)\n" +
- " inner();\n" +
- " ^^^^^\n" +
- "The function inner() is undefined\n" +
- "----------\n" +
- "2. ERROR in Z.js (at line 7)\n" +
- " inner();\n" +
- " ^^^^^\n" +
- "The function inner() is undefined\n" +
- "----------\n"
- );
- }
-
- public void testbug262728_D() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "(function() {\n"+
- "privateFunction();\n"+
- "var x;\n"+
- "function privateFunction() {\n"+
- "x + 3;\n"+
- "}\n"+
- "})();"
- },
- "----------\n" +
- "1. WARNING in Z.js (at line 5)\n" +
- " x + 3;\n" +
- " ^\n" +
- "The local variable x may not have been initialized\n" +
- "----------\n"
- );
- }
-
- public void testbug269203() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function Square() {}\n" +
- "var sq = new Square();\n" +
- "sq.area = function() {};"
- },
- ""
- );
- }
-
- public void testbug290414() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function Test(w) {this.w1 = w;}\n" +
- "var t = new Test(3);\n" +
- "t.area = function() {};\n" +
- "var area = t.area();"
- },
- ""
- );
- }
-
- public void testbug268989_1() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "/**@return {Date}*/function test(w) {return w}\n" +
- "var t = test(3);\n" +
- "t.getTime();"
- },
- ""
- );
- }
-
- public void testbug268989_2() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "/**@returns {Date}*/function test(w) {return w}\n" +
- "var t = test(3);\n" +
- "t.getTime();"
- },
- ""
- );
- }
-
- public void testObject() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "var o = new Object();\n" +
- "var x = o.toString();\n" +
- "x.charAt(0);\n" +
- "var x = o.toLocaleString();\n" +
- "x.charAt(0);\n" +
- "var x = o.valueOf();\n" +
- "x.toLocaleString();\n" +
- "var x = o.hasOwnProperty(1);\n" +
- "var x = o.isPrototypeOf(1);\n" +
- "var x = o.propertyIsEnumerable(1);\n" +
- "var x = o.constructor;\n" +
- "x.call();"
- },
- ""
- );
- }
-
- public void testbug247201() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function Car() { this.color = 'red'; this.Move = function() {};};\n" +
- "Car.Stop = function() {};\n" +
- "Car.engine = 'diesel';\n" +
- "var o = '';\n" +
- "o += 'color => '+Car.color.prototype+'<br />';\n" +
- "var p = new Car();\n" +
- "o += 'Stop => '+p.Stop()+'<br />';\n" +
- "o += 'engine => '+p.engine+'<br />';\n" +
- "o += 'engine => '+p.engine.prototype+'<br />';\n" +
- "var MyCar = Car;\n" +
- "c = MyCar.Move;\n" +
- "o += 'Move => '+MyCar.Move()+'<br />';\n" +
- "o += 'Stop => '+MyCar.Stop+'<br />';\n" +
- "o += 'engine => '+MyCar.engine+'<br />';"
- },
- "----------\n" +
- "1. ERROR in Z.js (at line 5)\n" +
- " o += \'color => \'+Car.color.prototype+\'<br />\';\n" +
- " ^^^^^\n" +
- "Cannot make a static reference to the non-static field color\n" +
- "----------\n" +
- "2. WARNING in Z.js (at line 7)\n" +
- " o += \'Stop => \'+p.Stop()+\'<br />\';\n" +
- " ^^^^^^^^\n" +
- "The static function Stop() from the type Car should be accessed in a static way\n" +
- "----------\n" +
- "3. WARNING in Z.js (at line 8)\n" +
- " o += \'engine => \'+p.engine+\'<br />\';\n" +
- " ^^^^^^\n" +
- "The static field Car.engine should be accessed in a static way\n" +
- "----------\n" +
- "4. WARNING in Z.js (at line 9)\n" +
- " o += \'engine => \'+p.engine.prototype+\'<br />\';\n" +
- " ^^^^^^\n" +
- "The static field Car.engine should be accessed in a static way\n" +
- "----------\n" +
- "5. ERROR in Z.js (at line 11)\n" +
- " c = MyCar.Move;\n" +
- " ^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static function Move() from the type Car\n" +
- "----------\n" +
- "6. ERROR in Z.js (at line 12)\n" +
- " o += \'Move => \'+MyCar.Move()+\'<br />\';\n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static function Move() from the type Car\n" +
- "----------\n"
- );
- }
-
- public void testbug242871() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "TestClassBase = function() {};\n" +
- "TestFunction = function() {};\n" +
- "TestClass = function() {\n" +
- " TestFunction.call(this, 1);\n" +
- " TestClassBase.call(this, 2);\n" +
- "};\n" +
- "TestClass.prototype = new TestClassBase();"
- },
- ""
- );
- }
- public void testbug242871_2() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function TestClassBase() {};\n" +
- "TestFunction = function() {};\n" +
- "TestClass = function() {\n" +
- " TestFunction.call(this, 1);\n" +
- " TestClassBase.call(this, 2);\n" +
- "};\n" +
- "TestClass.prototype = new TestClassBase();"
- },
- ""
- );
- }
- public void testbug242871_3() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "TestClassBase = function() {};\n" +
- "TestFunction = function() {};\n" +
- "TestClass = function() {\n" +
- " TestFunction.call(this, 1);\n" +
- " TestClassBase.call2(this, 2);\n" +
- "};\n" +
- "TestClass.prototype = new TestClassBase();"
- },
- "----------\n" +
- "1. ERROR in Z.js (at line 5)\n" +
- " TestClassBase.call2(this, 2);\n" +
- " ^^^^^\n" +
- "The function call2(TestClass, Number) is undefined for the type TestClassBase\n" +
- "----------\n"
- );
- }
-
- public void testbug269094() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function myFunc() {\n" +
- "return myFunc.a++;\n" +
- "}\n" +
- "myFunc.a = 0;"
- },
- ""
- );
- }
-
- public void testbug269094_2() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function myFunc() {\n" +
- "return 3;\n" +
- "}\n" +
- "myFunc.a = 0;"
- },
- ""
- );
- }
-
- public void testbug269094_3() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "function myFunc() {\n" +
- "return 3;\n" +
- "}"
- },
- ""
- );
- }
-
- public void testbug269094_4() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "/**@returns {String}*/\n" +
- "function myFunc() {\n" +
- "return 3;\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in Z.js (at line 3)\n" +
- " return 3;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from Number to String\n" +
- "----------\n"
- );
- }
-
- public void testbug269094_5() {
- this.runNegativeTest(
- new String[] {
- "Z.js",
- "/**@returns {Number}*/\n" +
- "function myFunc() {\n" +
- "return 3;\n" +
- "}"
- },
- ""
- );
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/CharOperationTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/CharOperationTest.java
deleted file mode 100644
index f52a2fe..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/CharOperationTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-
-public class CharOperationTest extends AbstractRegressionTest {
-
-public CharOperationTest(String name) {
- super(name);
-}
-
-public void test001() {
- char[] array = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' };
- char[] toBeReplaced = { 'b', 'c' };
- char replacementChar = 'a';
- int start = 4;
- int end = 8;
- CharOperation.replace(array, toBeReplaced, replacementChar, start, end);
- char[] result = { 'a' , 'b', 'b', 'c', 'a', 'a', 'a', 'a' };
-
- for (int i = 0, max = array.length; i < max; i++) {
- assertEquals("Wrong value at " + i, result[i], array[i]);
- }
-}
-public void test002() {
- char[] array = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' };
- char[] toBeReplaced = { 'b', 'c' };
- char replacementChar = 'a';
- int start = 2;
- int end = 3;
- CharOperation.replace(array, toBeReplaced, replacementChar, start, end);
- char[] result = { 'a' , 'b', 'a', 'c', 'a', 'b', 'c', 'a' };
-
- for (int i = 0, max = array.length; i < max; i++) {
- assertEquals("Wrong value at " + i, result[i], array[i]);
- }
-}
-public void test003() {
- char[] second = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' };
- char[] first = { 'b', 'c', 'a' };
- int start = 2;
- int end = 5;
- assertTrue(CharOperation.equals(first, second, start, end, true));
-}
-public void test004() {
- char[] second = { 'A' };
- char[] first = { 'a' };
- int start = 0;
- int end = 1;
- assertTrue(CharOperation.equals(first, second, start, end, false));
-}
-public void test005() {
- char[] array = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' };
- char[] toBeReplaced = { 'b', 'c' };
- char replacementChar = 'a';
- CharOperation.replace(array, toBeReplaced, replacementChar);
- char[] result = { 'a' , 'a', 'a', 'a', 'a', 'a', 'a', 'a' };
-
- for (int i = 0, max = array.length; i < max; i++) {
- assertEquals("Wrong value at " + i, result[i], array[i]);
- }
-}
-public void test006() {
- char[] array = { 'a' , 'a', 'a', 'a', 'a', 'b', 'c', 'a' };
- char[] toBeReplaced = { 'a', 'a' };
- char[] replacementChar = { 'a' };
- char[] result = CharOperation.replace(array, toBeReplaced, replacementChar);
- char[] expectedValue = { 'a' , 'a', 'a', 'b', 'c', 'a' };
- assertEquals("Wrong size", expectedValue.length, result.length);
- for (int i = 0, max = expectedValue.length; i < max; i++) {
- assertEquals("Wrong value at " + i, result[i], expectedValue[i]);
- }
-}
-// test compareTo(char[], char[])
-public void test007() {
- char[] array = { 'a' , 'a', 'a', 'a', 'a', 'b', 'c', 'a' };
- char[] array2 = { 'a', 'a' };
- assertTrue(CharOperation.compareTo(array, array2) > 0);
-
- array2 = new char[] { 'a', 'a' };
- array = new char[] { 'a' , 'a', 'a', 'a', 'a', 'b', 'c', 'a' };
- assertTrue(CharOperation.compareTo(array2, array) < 0);
-
- array = new char[] { 'a' , 'a', 'a', 'a', 'a', 'b', 'c', 'a' };
- array2 = new char[] { 'a' , 'a', 'a', 'a', 'a', 'b', 'c', 'a' };
- assertTrue(CharOperation.compareTo(array, array2) == 0);
- assertTrue(CharOperation.compareTo(array2, array) == 0);
-
- array = new char[] { 'a' , 'b', 'c' };
- array2 = new char[] { 'a' , 'b', 'c', 'a', 'a'};
- assertTrue(CharOperation.compareTo(array, array2) < 0);
-
- array = new char[] { 'a' , 'b', 'c' };
- array2 = new char[] { 'a' , 'b', 'd'};
- assertTrue(CharOperation.compareTo(array, array2) < 0);
-}
-public static Class testClass() {
- return CharOperationTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/CompilerInvocationTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/CompilerInvocationTests.java
deleted file mode 100644
index 6b3aa3d..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/CompilerInvocationTests.java
+++ /dev/null
@@ -1,791 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.ICompilerRequestor;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemSeverities;
-
-import junit.framework.Test;
-
-/**
- * This class is meant to gather test cases related to the invocation of the
- * compiler, be it at an API or non API level.
- */
-public class CompilerInvocationTests extends AbstractRegressionTest {
-
-public CompilerInvocationTests(String name) {
- super(name);
-}
-
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- // Only the highest compliance level is run; add the VM argument
- // -Dcompliance=1.4 (for example) to lower it if needed
- static {
-// TESTS_NAMES = new String[] { "test001" };
-// TESTS_NUMBERS = new int[] { 1 };
-// TESTS_RANGE = new int[] { 1, -1 };
-// TESTS_RANGE = new int[] { 1, 2049 };
-// TESTS_RANGE = new int[] { 449, 451 };
-// TESTS_RANGE = new int[] { 900, 999 };
- }
-
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public static Class testClass() {
- return CompilerInvocationTests.class;
-}
-
-// irritant vs warning token
-public void test001_irritant_warning_token() {
- String [] tokens = new String[64];
- Map matcher = new HashMap();
- long irritant;
- String token;
- for (int i = 0; i < 64; i++) {
- if ((token = tokens[i] = CompilerOptions.warningTokenFromIrritant(irritant = 1L << i)) != null) {
- matcher.put(token, token);
- assertTrue((irritant & CompilerOptions.warningTokenToIrritant(token)) != 0);
- }
- }
- String [] allTokens = CompilerOptions.warningTokens;
- int length = allTokens.length;
- matcher.put("all", "all"); // all gets undetected in the From/To loop
- assertEquals(allTokens.length, matcher.size());
- for (int i = 0; i < length; i++) {
- assertNotNull(matcher.get(allTokens[i]));
- }
-}
-
-// problem categories - check that none is left unspecified
-public void test002_problem_categories() {
- try {
- Class iProblemClass;
- Map excludedProblems = new HashMap();
- // categories
- excludedProblems.put("ObjectHasNoSuperclass", null);
- excludedProblems.put("UndefinedType", null);
- excludedProblems.put("NotVisibleType", null);
- excludedProblems.put("AmbiguousType", null);
- excludedProblems.put("UsingDeprecatedType", null);
- excludedProblems.put("InternalTypeNameProvided", null);
- excludedProblems.put("UnusedPrivateType", null);
- excludedProblems.put("IncompatibleTypesInEqualityOperator", null);
- excludedProblems.put("IncompatibleTypesInConditionalOperator", null);
- excludedProblems.put("TypeMismatch", null);
- excludedProblems.put("IndirectAccessToStaticType", null);
- excludedProblems.put("MissingEnclosingInstanceForConstructorCall", null);
- excludedProblems.put("MissingEnclosingInstance", null);
- excludedProblems.put("IncorrectEnclosingInstanceReference", null);
- excludedProblems.put("IllegalEnclosingInstanceSpecification", null);
- excludedProblems.put("CannotDefineStaticInitializerInLocalType", null);
- excludedProblems.put("OuterLocalMustBeFinal", null);
- excludedProblems.put("CannotDefineInterfaceInLocalType", null);
- excludedProblems.put("IllegalPrimitiveOrArrayTypeForEnclosingInstance", null);
- excludedProblems.put("EnclosingInstanceInConstructorCall", null);
- excludedProblems.put("AnonymousClassCannotExtendFinalClass", null);
- excludedProblems.put("CannotDefineAnnotationInLocalType", null);
- excludedProblems.put("CannotDefineEnumInLocalType", null);
- excludedProblems.put("NonStaticContextForEnumMemberType", null);
- excludedProblems.put("UndefinedName", null);
- excludedProblems.put("UninitializedLocalVariable", null);
- excludedProblems.put("VariableTypeCannotBeVoid", null);
- excludedProblems.put("VariableTypeCannotBeVoidArray", null);
- excludedProblems.put("CannotAllocateVoidArray", null);
- excludedProblems.put("RedefinedLocal", null);
- excludedProblems.put("RedefinedArgument", null);
- excludedProblems.put("DuplicateFinalLocalInitialization", null);
- excludedProblems.put("NonBlankFinalLocalAssignment", null);
- excludedProblems.put("ParameterAssignment", null);
- excludedProblems.put("FinalOuterLocalAssignment", null);
- excludedProblems.put("LocalVariableIsNeverUsed", null);
- excludedProblems.put("ArgumentIsNeverUsed", null);
- excludedProblems.put("BytecodeExceeds64KLimit", null);
- excludedProblems.put("BytecodeExceeds64KLimitForClinit", null);
- excludedProblems.put("TooManyArgumentSlots", null);
- excludedProblems.put("TooManyLocalVariableSlots", null);
- excludedProblems.put("TooManySyntheticArgumentSlots", null);
- excludedProblems.put("TooManyArrayDimensions", null);
- excludedProblems.put("BytecodeExceeds64KLimitForConstructor", null);
- excludedProblems.put("UndefinedField", null);
- excludedProblems.put("NotVisibleField", null);
- excludedProblems.put("AmbiguousField", null);
- excludedProblems.put("UsingDeprecatedField", null);
- excludedProblems.put("NonStaticFieldFromStaticInvocation", null);
- excludedProblems.put("ReferenceToForwardField", null);
- excludedProblems.put("NonStaticAccessToStaticField", null);
- excludedProblems.put("UnusedPrivateField", null);
- excludedProblems.put("IndirectAccessToStaticField", null);
- excludedProblems.put("UnqualifiedFieldAccess", null);
- excludedProblems.put("FinalFieldAssignment", null);
- excludedProblems.put("UninitializedBlankFinalField", null);
- excludedProblems.put("DuplicateBlankFinalFieldInitialization", null);
- excludedProblems.put("LocalVariableHidingLocalVariable", null);
- excludedProblems.put("LocalVariableHidingField", null);
- excludedProblems.put("FieldHidingLocalVariable", null);
- excludedProblems.put("FieldHidingField", null);
- excludedProblems.put("ArgumentHidingLocalVariable", null);
- excludedProblems.put("ArgumentHidingField", null);
- excludedProblems.put("MissingSerialVersion", null);
- excludedProblems.put("UndefinedMethod", null);
- excludedProblems.put("NotVisibleMethod", null);
- excludedProblems.put("AmbiguousMethod", null);
- excludedProblems.put("UsingDeprecatedMethod", null);
- excludedProblems.put("DirectInvocationOfAbstractMethod", null);
- excludedProblems.put("VoidMethodReturnsValue", null);
- excludedProblems.put("MethodReturnsVoid", null);
- excludedProblems.put("MethodRequiresBody", null);
- excludedProblems.put("ShouldReturnValue", null);
- excludedProblems.put("MethodButWithConstructorName", null);
- excludedProblems.put("MissingReturnType", null);
- excludedProblems.put("BodyForNativeMethod", null);
- excludedProblems.put("BodyForAbstractMethod", null);
- excludedProblems.put("NoMessageSendOnBaseType", null);
- excludedProblems.put("ParameterMismatch", null);
- excludedProblems.put("NoMessageSendOnArrayType", null);
- excludedProblems.put("NonStaticAccessToStaticMethod", null);
- excludedProblems.put("UnusedPrivateMethod", null);
- excludedProblems.put("IndirectAccessToStaticMethod", null);
- excludedProblems.put("UndefinedConstructor", null);
- excludedProblems.put("NotVisibleConstructor", null);
- excludedProblems.put("AmbiguousConstructor", null);
- excludedProblems.put("UsingDeprecatedConstructor", null);
- excludedProblems.put("UnusedPrivateConstructor", null);
- excludedProblems.put("InstanceFieldDuringConstructorInvocation", null);
- excludedProblems.put("InstanceMethodDuringConstructorInvocation", null);
- excludedProblems.put("RecursiveConstructorInvocation", null);
- excludedProblems.put("ThisSuperDuringConstructorInvocation", null);
- excludedProblems.put("InvalidExplicitConstructorCall", null);
- excludedProblems.put("UndefinedConstructorInDefaultConstructor", null);
- excludedProblems.put("NotVisibleConstructorInDefaultConstructor", null);
- excludedProblems.put("AmbiguousConstructorInDefaultConstructor", null);
- excludedProblems.put("UndefinedConstructorInImplicitConstructorCall", null);
- excludedProblems.put("NotVisibleConstructorInImplicitConstructorCall", null);
- excludedProblems.put("AmbiguousConstructorInImplicitConstructorCall", null);
- excludedProblems.put("UnhandledExceptionInDefaultConstructor", null);
- excludedProblems.put("UnhandledExceptionInImplicitConstructorCall", null);
- excludedProblems.put("ArrayReferenceRequired", null);
- excludedProblems.put("NoImplicitStringConversionForCharArrayExpression", null);
- excludedProblems.put("StringConstantIsExceedingUtf8Limit", null);
- excludedProblems.put("NonConstantExpression", null);
- excludedProblems.put("NumericValueOutOfRange", null);
- excludedProblems.put("IllegalCast", null);
- excludedProblems.put("InvalidClassInstantiation", null);
- excludedProblems.put("CannotDefineDimensionExpressionsWithInit", null);
- excludedProblems.put("MustDefineEitherDimensionExpressionsOrInitializer", null);
- excludedProblems.put("InvalidOperator", null);
- excludedProblems.put("CodeCannotBeReached", null);
- excludedProblems.put("CannotReturnInInitializer", null);
- excludedProblems.put("InitializerMustCompleteNormally", null);
- excludedProblems.put("InvalidVoidExpression", null);
- excludedProblems.put("MaskedCatch", null);
- excludedProblems.put("DuplicateDefaultCase", null);
- excludedProblems.put("UnreachableCatch", null);
- excludedProblems.put("UnhandledException", null);
- excludedProblems.put("IncorrectSwitchType", null);
- excludedProblems.put("DuplicateCase", null);
- excludedProblems.put("DuplicateLabel", null);
- excludedProblems.put("InvalidBreak", null);
- excludedProblems.put("InvalidContinue", null);
- excludedProblems.put("UndefinedLabel", null);
- excludedProblems.put("InvalidTypeToSynchronized", null);
- excludedProblems.put("InvalidNullToSynchronized", null);
- excludedProblems.put("CannotThrowNull", null);
- excludedProblems.put("AssignmentHasNoEffect", null);
- excludedProblems.put("PossibleAccidentalBooleanAssignment", null);
- excludedProblems.put("SuperfluousSemicolon", null);
- excludedProblems.put("UnnecessaryCast", null);
- excludedProblems.put("UnnecessaryArgumentCast", null);
- excludedProblems.put("UnnecessaryInstanceof", null);
- excludedProblems.put("FinallyMustCompleteNormally", null);
- excludedProblems.put("UnusedMethodDeclaredThrownException", null);
- excludedProblems.put("UnusedConstructorDeclaredThrownException", null);
- excludedProblems.put("InvalidCatchBlockSequence", null);
- excludedProblems.put("EmptyControlFlowStatement", null);
- excludedProblems.put("UnnecessaryElse", null);
- excludedProblems.put("NeedToEmulateFieldReadAccess", null);
- excludedProblems.put("NeedToEmulateFieldWriteAccess", null);
- excludedProblems.put("NeedToEmulateMethodAccess", null);
- excludedProblems.put("NeedToEmulateConstructorAccess", null);
- excludedProblems.put("FallthroughCase", null);
- excludedProblems.put("InheritedMethodHidesEnclosingName", null);
- excludedProblems.put("InheritedFieldHidesEnclosingName", null);
- excludedProblems.put("InheritedTypeHidesEnclosingName", null);
- excludedProblems.put("IllegalUsageOfQualifiedTypeReference", null);
- excludedProblems.put("UnusedLabel", null);
- excludedProblems.put("ThisInStaticContext", null);
- excludedProblems.put("StaticMethodRequested", null);
- excludedProblems.put("IllegalDimension", null);
- excludedProblems.put("InvalidTypeExpression", null);
- excludedProblems.put("ParsingError", null);
- excludedProblems.put("ParsingErrorNoSuggestion", null);
- excludedProblems.put("InvalidUnaryExpression", null);
- excludedProblems.put("InterfaceCannotHaveConstructors", null);
- excludedProblems.put("ArrayConstantsOnlyInArrayInitializers", null);
- excludedProblems.put("ParsingErrorOnKeyword", null);
- excludedProblems.put("ParsingErrorOnKeywordNoSuggestion", null);
- excludedProblems.put("UnmatchedBracket", null);
- excludedProblems.put("NoFieldOnBaseType", null);
- excludedProblems.put("InvalidExpressionAsStatement", null);
- excludedProblems.put("ExpressionShouldBeAVariable", null);
- excludedProblems.put("MissingSemiColon", null);
- excludedProblems.put("InvalidParenthesizedExpression", null);
- excludedProblems.put("ParsingErrorInsertTokenBefore", null);
- excludedProblems.put("ParsingErrorInsertTokenAfter", null);
- excludedProblems.put("ParsingErrorDeleteToken", null);
- excludedProblems.put("ParsingErrorDeleteTokens", null);
- excludedProblems.put("ParsingErrorMergeTokens", null);
- excludedProblems.put("ParsingErrorInvalidToken", null);
- excludedProblems.put("ParsingErrorMisplacedConstruct", null);
- excludedProblems.put("ParsingErrorReplaceTokens", null);
- excludedProblems.put("ParsingErrorNoSuggestionForTokens", null);
- excludedProblems.put("ParsingErrorUnexpectedEOF", null);
- excludedProblems.put("ParsingErrorInsertToComplete", null);
- excludedProblems.put("ParsingErrorInsertToCompleteScope", null);
- excludedProblems.put("ParsingErrorInsertToCompletePhrase", null);
- excludedProblems.put("EndOfSource", null);
- excludedProblems.put("InvalidHexa", null);
- excludedProblems.put("InvalidOctal", null);
- excludedProblems.put("InvalidCharacterConstant", null);
- excludedProblems.put("InvalidEscape", null);
- excludedProblems.put("InvalidInput", null);
- excludedProblems.put("InvalidUnicodeEscape", null);
- excludedProblems.put("InvalidFloat", null);
- excludedProblems.put("NullSourceString", null);
- excludedProblems.put("UnterminatedString", null);
- excludedProblems.put("UnterminatedComment", null);
- excludedProblems.put("NonExternalizedStringLiteral", null);
- excludedProblems.put("InvalidDigit", null);
- excludedProblems.put("InvalidLowSurrogate", null);
- excludedProblems.put("InvalidHighSurrogate", null);
- excludedProblems.put("UnnecessaryNLSTag", null);
- excludedProblems.put("DiscouragedReference", null);
- excludedProblems.put("InterfaceCannotHaveInitializers", null);
- excludedProblems.put("DuplicateModifierForType", null);
- excludedProblems.put("IllegalModifierForClass", null);
- excludedProblems.put("IllegalModifierForInterface", null);
- excludedProblems.put("IllegalModifierForMemberClass", null);
- excludedProblems.put("IllegalModifierForMemberInterface", null);
- excludedProblems.put("IllegalModifierForLocalClass", null);
- excludedProblems.put("ForbiddenReference", null);
- excludedProblems.put("IllegalModifierCombinationFinalAbstractForClass", null);
- excludedProblems.put("IllegalVisibilityModifierForInterfaceMemberType", null);
- excludedProblems.put("IllegalVisibilityModifierCombinationForMemberType", null);
- excludedProblems.put("IllegalStaticModifierForMemberType", null);
- excludedProblems.put("SuperclassMustBeAClass", null);
- excludedProblems.put("ClassExtendFinalClass", null);
- excludedProblems.put("DuplicateSuperInterface", null);
- excludedProblems.put("SuperInterfaceMustBeAnInterface", null);
- excludedProblems.put("HierarchyCircularitySelfReference", null);
- excludedProblems.put("HierarchyCircularity", null);
- excludedProblems.put("HidingEnclosingType", null);
- excludedProblems.put("DuplicateNestedType", null);
- excludedProblems.put("CannotThrowType", null);
- excludedProblems.put("PackageCollidesWithType", null);
- excludedProblems.put("TypeCollidesWithPackage", null);
- excludedProblems.put("DuplicateTypes", null);
- excludedProblems.put("IsClassPathCorrect", null);
- excludedProblems.put("PublicClassMustMatchFileName", null);
- excludedProblems.put("MustSpecifyPackage", null);
- excludedProblems.put("HierarchyHasProblems", null);
- excludedProblems.put("PackageIsNotExpectedPackage", null);
- excludedProblems.put("ObjectCannotHaveSuperTypes", null);
- excludedProblems.put("ObjectMustBeClass", null);
- excludedProblems.put("SuperclassNotFound", null);
- excludedProblems.put("SuperclassNotVisible", null);
- excludedProblems.put("SuperclassAmbiguous", null);
- excludedProblems.put("SuperclassInternalNameProvided", null);
- excludedProblems.put("SuperclassInheritedNameHidesEnclosingName", null);
- excludedProblems.put("InterfaceNotFound", null);
- excludedProblems.put("InterfaceNotVisible", null);
- excludedProblems.put("InterfaceAmbiguous", null);
- excludedProblems.put("InterfaceInternalNameProvided", null);
- excludedProblems.put("InterfaceInheritedNameHidesEnclosingName", null);
- excludedProblems.put("DuplicateField", null);
- excludedProblems.put("DuplicateModifierForField", null);
- excludedProblems.put("IllegalModifierForField", null);
- excludedProblems.put("IllegalModifierForInterfaceField", null);
- excludedProblems.put("IllegalVisibilityModifierCombinationForField", null);
- excludedProblems.put("IllegalModifierCombinationFinalVolatileForField", null);
- excludedProblems.put("UnexpectedStaticModifierForField", null);
- excludedProblems.put("FieldTypeNotFound", null);
- excludedProblems.put("FieldTypeNotVisible", null);
- excludedProblems.put("FieldTypeAmbiguous", null);
- excludedProblems.put("FieldTypeInternalNameProvided", null);
- excludedProblems.put("FieldTypeInheritedNameHidesEnclosingName", null);
- excludedProblems.put("DuplicateMethod", null);
- excludedProblems.put("IllegalModifierForArgument", null);
- excludedProblems.put("DuplicateModifierForMethod", null);
- excludedProblems.put("IllegalModifierForMethod", null);
- excludedProblems.put("IllegalModifierForInterfaceMethod", null);
- excludedProblems.put("IllegalVisibilityModifierCombinationForMethod", null);
- excludedProblems.put("UnexpectedStaticModifierForMethod", null);
- excludedProblems.put("IllegalAbstractModifierCombinationForMethod", null);
- excludedProblems.put("AbstractMethodInAbstractClass", null);
- excludedProblems.put("ArgumentTypeCannotBeVoid", null);
- excludedProblems.put("ArgumentTypeCannotBeVoidArray", null);
- excludedProblems.put("ReturnTypeCannotBeVoidArray", null);
- excludedProblems.put("NativeMethodsCannotBeStrictfp", null);
- excludedProblems.put("DuplicateModifierForArgument", null);
- excludedProblems.put("ArgumentTypeNotFound", null);
- excludedProblems.put("ArgumentTypeNotVisible", null);
- excludedProblems.put("ArgumentTypeAmbiguous", null);
- excludedProblems.put("ArgumentTypeInternalNameProvided", null);
- excludedProblems.put("ArgumentTypeInheritedNameHidesEnclosingName", null);
- excludedProblems.put("ExceptionTypeNotFound", null);
- excludedProblems.put("ExceptionTypeNotVisible", null);
- excludedProblems.put("ExceptionTypeAmbiguous", null);
- excludedProblems.put("ExceptionTypeInternalNameProvided", null);
- excludedProblems.put("ExceptionTypeInheritedNameHidesEnclosingName", null);
- excludedProblems.put("ReturnTypeNotFound", null);
- excludedProblems.put("ReturnTypeNotVisible", null);
- excludedProblems.put("ReturnTypeAmbiguous", null);
- excludedProblems.put("ReturnTypeInternalNameProvided", null);
- excludedProblems.put("ReturnTypeInheritedNameHidesEnclosingName", null);
- excludedProblems.put("ConflictingImport", null);
- excludedProblems.put("DuplicateImport", null);
- excludedProblems.put("CannotImportPackage", null);
- excludedProblems.put("UnusedImport", null);
- excludedProblems.put("ImportNotFound", null);
- excludedProblems.put("ImportNotVisible", null);
- excludedProblems.put("ImportAmbiguous", null);
- excludedProblems.put("ImportInternalNameProvided", null);
- excludedProblems.put("ImportInheritedNameHidesEnclosingName", null);
- excludedProblems.put("InvalidTypeForStaticImport", null);
- excludedProblems.put("DuplicateModifierForVariable", null);
- excludedProblems.put("IllegalModifierForVariable", null);
- excludedProblems.put("LocalVariableCannotBeNull", null);
- excludedProblems.put("LocalVariableCanOnlyBeNull", null);
- excludedProblems.put("LocalVariableMayBeNull", null);
- excludedProblems.put("AbstractMethodMustBeImplemented", null);
- excludedProblems.put("FinalMethodCannotBeOverridden", null);
- excludedProblems.put("IncompatibleExceptionInThrowsClause", null);
- excludedProblems.put("IncompatibleExceptionInInheritedMethodThrowsClause", null);
- excludedProblems.put("IncompatibleReturnType", null);
- excludedProblems.put("InheritedMethodReducesVisibility", null);
- excludedProblems.put("CannotOverrideAStaticMethodWithAnInstanceMethod", null);
- excludedProblems.put("CannotHideAnInstanceMethodWithAStaticMethod", null);
- excludedProblems.put("StaticInheritedMethodConflicts", null);
- excludedProblems.put("MethodReducesVisibility", null);
- excludedProblems.put("OverridingNonVisibleMethod", null);
- excludedProblems.put("AbstractMethodCannotBeOverridden", null);
- excludedProblems.put("OverridingDeprecatedMethod", null);
- excludedProblems.put("IncompatibleReturnTypeForNonInheritedInterfaceMethod", null);
- excludedProblems.put("IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod", null);
- excludedProblems.put("IllegalVararg", null);
- excludedProblems.put("CodeSnippetMissingClass", null);
- excludedProblems.put("CodeSnippetMissingMethod", null);
- excludedProblems.put("CannotUseSuperInCodeSnippet", null);
- excludedProblems.put("TooManyConstantsInConstantPool", null);
- excludedProblems.put("TooManyBytesForStringConstant", null);
- excludedProblems.put("TooManyFields", null);
- excludedProblems.put("TooManyMethods", null);
- excludedProblems.put("UseAssertAsAnIdentifier", null);
- excludedProblems.put("UseEnumAsAnIdentifier", null);
- excludedProblems.put("EnumConstantsCannotBeSurroundedByParenthesis", null);
- excludedProblems.put("Task", null);
- excludedProblems.put("UndocumentedEmptyBlock", null);
- excludedProblems.put("JavadocMissingIdentifier", null);
- excludedProblems.put("JavadocNonStaticTypeFromStaticInvocation", null);
- excludedProblems.put("JavadocInvalidParamTagTypeParameter", null);
- excludedProblems.put("JavadocUnexpectedTag", null);
- excludedProblems.put("JavadocMissingParamTag", null);
- excludedProblems.put("JavadocMissingParamName", null);
- excludedProblems.put("JavadocDuplicateParamName", null);
- excludedProblems.put("JavadocInvalidParamName", null);
- excludedProblems.put("JavadocMissingReturnTag", null);
- excludedProblems.put("JavadocDuplicateReturnTag", null);
- excludedProblems.put("JavadocMissingThrowsTag", null);
- excludedProblems.put("JavadocMissingThrowsClassName", null);
- excludedProblems.put("JavadocInvalidThrowsClass", null);
- excludedProblems.put("JavadocDuplicateThrowsClassName", null);
- excludedProblems.put("JavadocInvalidThrowsClassName", null);
- excludedProblems.put("JavadocMissingSeeReference", null);
- excludedProblems.put("JavadocInvalidSeeReference", null);
- excludedProblems.put("JavadocInvalidSeeHref", null);
- excludedProblems.put("JavadocInvalidSeeArgs", null);
- excludedProblems.put("JavadocMissing", null);
- excludedProblems.put("JavadocInvalidTag", null);
- excludedProblems.put("JavadocUndefinedField", null);
- excludedProblems.put("JavadocNotVisibleField", null);
- excludedProblems.put("JavadocAmbiguousField", null);
- excludedProblems.put("JavadocUsingDeprecatedField", null);
- excludedProblems.put("JavadocUndefinedConstructor", null);
- excludedProblems.put("JavadocNotVisibleConstructor", null);
- excludedProblems.put("JavadocAmbiguousConstructor", null);
- excludedProblems.put("JavadocUsingDeprecatedConstructor", null);
- excludedProblems.put("JavadocUndefinedMethod", null);
- excludedProblems.put("JavadocNotVisibleMethod", null);
- excludedProblems.put("JavadocAmbiguousMethod", null);
- excludedProblems.put("JavadocUsingDeprecatedMethod", null);
- excludedProblems.put("JavadocNoMessageSendOnBaseType", null);
- excludedProblems.put("JavadocParameterMismatch", null);
- excludedProblems.put("JavadocNoMessageSendOnArrayType", null);
- excludedProblems.put("JavadocUndefinedType", null);
- excludedProblems.put("JavadocNotVisibleType", null);
- excludedProblems.put("JavadocAmbiguousType", null);
- excludedProblems.put("JavadocUsingDeprecatedType", null);
- excludedProblems.put("JavadocInternalTypeNameProvided", null);
- excludedProblems.put("JavadocInheritedMethodHidesEnclosingName", null);
- excludedProblems.put("JavadocInheritedFieldHidesEnclosingName", null);
- excludedProblems.put("JavadocInheritedNameHidesEnclosingTypeName", null);
- excludedProblems.put("JavadocAmbiguousMethodReference", null);
- excludedProblems.put("JavadocUnterminatedInlineTag", null);
- excludedProblems.put("JavadocMalformedSeeReference", null);
- excludedProblems.put("JavadocMessagePrefix", null);
- excludedProblems.put("JavadocMissingHashCharacter", null);
- excludedProblems.put("JavadocEmptyReturnTag", null);
- excludedProblems.put("JavadocInvalidValueReference", null);
- excludedProblems.put("JavadocUnexpectedText", null);
- excludedProblems.put("JavadocInvalidParamTagName", null);
- excludedProblems.put("DuplicateTypeVariable", null);
- excludedProblems.put("IllegalTypeVariableSuperReference", null);
- excludedProblems.put("NonStaticTypeFromStaticInvocation", null);
- excludedProblems.put("ObjectCannotBeGeneric", null);
- excludedProblems.put("NonGenericType", null);
- excludedProblems.put("IncorrectArityForParameterizedType", null);
- excludedProblems.put("TypeArgumentMismatch", null);
- excludedProblems.put("DuplicateMethodErasure", null);
- excludedProblems.put("ReferenceToForwardTypeVariable", null);
- excludedProblems.put("BoundMustBeAnInterface", null);
- excludedProblems.put("UnsafeRawConstructorInvocation", null);
- excludedProblems.put("UnsafeRawMethodInvocation", null);
- excludedProblems.put("UnsafeTypeConversion", null);
- excludedProblems.put("InvalidTypeVariableExceptionType", null);
- excludedProblems.put("InvalidParameterizedExceptionType", null);
- excludedProblems.put("IllegalGenericArray", null);
- excludedProblems.put("UnsafeRawFieldAssignment", null);
- excludedProblems.put("FinalBoundForTypeVariable", null);
- excludedProblems.put("UndefinedTypeVariable", null);
- excludedProblems.put("SuperInterfacesCollide", null);
- excludedProblems.put("WildcardConstructorInvocation", null);
- excludedProblems.put("WildcardMethodInvocation", null);
- excludedProblems.put("WildcardFieldAssignment", null);
- excludedProblems.put("GenericMethodTypeArgumentMismatch", null);
- excludedProblems.put("GenericConstructorTypeArgumentMismatch", null);
- excludedProblems.put("UnsafeGenericCast", null);
- excludedProblems.put("IllegalInstanceofParameterizedType", null);
- excludedProblems.put("IllegalInstanceofTypeParameter", null);
- excludedProblems.put("NonGenericMethod", null);
- excludedProblems.put("IncorrectArityForParameterizedMethod", null);
- excludedProblems.put("ParameterizedMethodArgumentTypeMismatch", null);
- excludedProblems.put("NonGenericConstructor", null);
- excludedProblems.put("IncorrectArityForParameterizedConstructor", null);
- excludedProblems.put("ParameterizedConstructorArgumentTypeMismatch", null);
- excludedProblems.put("TypeArgumentsForRawGenericMethod", null);
- excludedProblems.put("TypeArgumentsForRawGenericConstructor", null);
- excludedProblems.put("SuperTypeUsingWildcard", null);
- excludedProblems.put("GenericTypeCannotExtendThrowable", null);
- excludedProblems.put("IllegalClassLiteralForTypeVariable", null);
- excludedProblems.put("UnsafeReturnTypeOverride", null);
- excludedProblems.put("MethodNameClash", null);
- excludedProblems.put("RawMemberTypeCannotBeParameterized", null);
- excludedProblems.put("MissingArgumentsForParameterizedMemberType", null);
- excludedProblems.put("StaticMemberOfParameterizedType", null);
- excludedProblems.put("BoundHasConflictingArguments", null);
- excludedProblems.put("DuplicateParameterizedMethods", null);
- excludedProblems.put("IllegalQualifiedParameterizedTypeAllocation", null);
- excludedProblems.put("DuplicateBounds", null);
- excludedProblems.put("BoundCannotBeArray", null);
- excludedProblems.put("UnsafeRawGenericConstructorInvocation", null);
- excludedProblems.put("UnsafeRawGenericMethodInvocation", null);
- excludedProblems.put("TypeParameterHidingType", null);
- excludedProblems.put("RawTypeReference", null);
- excludedProblems.put("NoAdditionalBoundAfterTypeVariable", null);
- excludedProblems.put("IncompatibleTypesInForeach", null);
- excludedProblems.put("InvalidTypeForCollection", null);
- excludedProblems.put("InvalidUsageOfTypeParameters", null);
- excludedProblems.put("InvalidUsageOfStaticImports", null);
- excludedProblems.put("InvalidUsageOfForeachStatements", null);
- excludedProblems.put("InvalidUsageOfTypeArguments", null);
- excludedProblems.put("InvalidUsageOfEnumDeclarations", null);
- excludedProblems.put("InvalidUsageOfVarargs", null);
- excludedProblems.put("InvalidUsageOfAnnotations", null);
- excludedProblems.put("InvalidUsageOfAnnotationDeclarations", null);
- excludedProblems.put("IllegalModifierForAnnotationMethod", null);
- excludedProblems.put("IllegalExtendedDimensions", null);
- excludedProblems.put("InvalidFileNameForPackageAnnotations", null);
- excludedProblems.put("IllegalModifierForAnnotationType", null);
- excludedProblems.put("IllegalModifierForAnnotationMemberType", null);
- excludedProblems.put("InvalidAnnotationMemberType", null);
- excludedProblems.put("AnnotationCircularitySelfReference", null);
- excludedProblems.put("AnnotationCircularity", null);
- excludedProblems.put("DuplicateAnnotation", null);
- excludedProblems.put("MissingValueForAnnotationMember", null);
- excludedProblems.put("DuplicateAnnotationMember", null);
- excludedProblems.put("UndefinedAnnotationMember", null);
- excludedProblems.put("AnnotationValueMustBeClassLiteral", null);
- excludedProblems.put("AnnotationValueMustBeConstant", null);
- excludedProblems.put("AnnotationFieldNeedConstantInitialization", null);
- excludedProblems.put("IllegalModifierForAnnotationField", null);
- excludedProblems.put("AnnotationCannotOverrideMethod", null);
- excludedProblems.put("AnnotationMembersCannotHaveParameters", null);
- excludedProblems.put("AnnotationMembersCannotHaveTypeParameters", null);
- excludedProblems.put("AnnotationTypeDeclarationCannotHaveSuperclass", null);
- excludedProblems.put("AnnotationTypeDeclarationCannotHaveSuperinterfaces", null);
- excludedProblems.put("DuplicateTargetInTargetAnnotation", null);
- excludedProblems.put("DisallowedTargetForAnnotation", null);
- excludedProblems.put("MethodMustOverride", null);
- excludedProblems.put("AnnotationTypeDeclarationCannotHaveConstructor", null);
- excludedProblems.put("AnnotationValueMustBeAnnotation", null);
- excludedProblems.put("AnnotationTypeUsedAsSuperInterface", null);
- excludedProblems.put("MissingOverrideAnnotation", null);
- excludedProblems.put("FieldMissingDeprecatedAnnotation", null);
- excludedProblems.put("MethodMissingDeprecatedAnnotation", null);
- excludedProblems.put("TypeMissingDeprecatedAnnotation", null);
- excludedProblems.put("UnhandledWarningToken", null);
- excludedProblems.put("AnnotationValueMustBeArrayInitializer", null);
- excludedProblems.put("CorruptedSignature", null);
- excludedProblems.put("BoxingConversion", null);
- excludedProblems.put("UnboxingConversion", null);
- excludedProblems.put("IllegalModifierForEnum", null);
- excludedProblems.put("IllegalModifierForEnumConstant", null);
- excludedProblems.put("IllegalModifierForLocalEnum", null);
- excludedProblems.put("IllegalModifierForMemberEnum", null);
- excludedProblems.put("CannotDeclareEnumSpecialMethod", null);
- excludedProblems.put("IllegalQualifiedEnumConstantLabel", null);
- excludedProblems.put("CannotExtendEnum", null);
- excludedProblems.put("CannotInvokeSuperConstructorInEnum", null);
- excludedProblems.put("EnumAbstractMethodMustBeImplemented", null);
- excludedProblems.put("EnumSwitchCannotTargetField", null);
- excludedProblems.put("IllegalModifierForEnumConstructor", null);
- excludedProblems.put("MissingEnumConstantCase", null);
- excludedProblems.put("EnumStaticFieldInInInitializerContext", null);
- excludedProblems.put("IllegalExtendedDimensionsForVarArgs", null);
- excludedProblems.put("MethodVarargsArgumentNeedCast", null);
- excludedProblems.put("ConstructorVarargsArgumentNeedCast", null);
- excludedProblems.put("VarargsConflict", null);
- excludedProblems.put("JavadocGenericMethodTypeArgumentMismatch", null);
- excludedProblems.put("JavadocNonGenericMethod", null);
- excludedProblems.put("JavadocIncorrectArityForParameterizedMethod", null);
- excludedProblems.put("JavadocParameterizedMethodArgumentTypeMismatch", null);
- excludedProblems.put("JavadocTypeArgumentsForRawGenericMethod", null);
- excludedProblems.put("JavadocGenericConstructorTypeArgumentMismatch", null);
- excludedProblems.put("JavadocNonGenericConstructor", null);
- excludedProblems.put("JavadocIncorrectArityForParameterizedConstructor", null);
- excludedProblems.put("JavadocParameterizedConstructorArgumentTypeMismatch", null);
- excludedProblems.put("JavadocTypeArgumentsForRawGenericConstructor", null);
- excludedProblems.put("ExternalProblemNotFixable", null);
- excludedProblems.put("ExternalProblemFixable", null);
- // TODO (maxime) there are obviously too many exclusions here...
-
- Field[] fields = (iProblemClass = IProblem.class).getFields();
- for (int i = 0, length = fields.length; i < length; i++) {
- Field field = fields[i];
- int pureProblemId;
- if (field.getType() == Integer.TYPE) {
- if ((pureProblemId = field.getInt(iProblemClass) & IProblem.IgnoreCategoriesMask) != 0
- && pureProblemId != IProblem.IgnoreCategoriesMask
- && ProblemReporter.getProblemCategory(ProblemSeverities.Error, pureProblemId)
- == CategorizedProblem.CAT_UNSPECIFIED
- && !excludedProblems.containsKey(field.getName())) {
- fail("unspecified category for problem " + field.getName());
-// System.out.println("excludedProblems.put(\"" + field.getName() + "\", null);");
- }
- }
- }
- }
- catch (IllegalAccessException e) {
- fail("could not access members");
- }
-}
-class TasksReader implements ICompilerRequestor {
- CompilationResult result;
- public void acceptResult(CompilationResult compilationResult) {
- this.result = compilationResult;
- }
-}
-static String taskTagsAsCutAndPaste(CategorizedProblem tasks[]) {
- StringBuffer result = new StringBuffer();
- String arguments[];
- for (int i = 0; i < tasks.length - 1; i++) {
- arguments = tasks[i].getArguments();
- System.out.print("\t\t\"[");
- System.out.print(arguments[0]);
- System.out.print(',');
- System.out.print(arguments[1]);
- System.out.print(',');
- System.out.print(arguments[2]);
- System.out.println("]\\n\" +");
- }
- arguments = tasks[tasks.length - 1].getArguments();
- System.out.print("\t\t\"[");
- System.out.print(arguments[0]);
- System.out.print(',');
- System.out.print(arguments[1]);
- System.out.print(',');
- System.out.print(arguments[2]);
- System.out.println("]\\n\"");
- return result.toString();
-}
-static String taskTagsAsStrings(CategorizedProblem tasks[]) {
- StringBuffer result = new StringBuffer();
- String arguments[];
- for (int i = 0; i < tasks.length; i++) {
- arguments = tasks[i].getArguments();
- result.append('[');
- result.append(arguments[0]);
- result.append(',');
- result.append(arguments[1]);
- result.append(',');
- result.append(arguments[2]);
- result.append(']');
- result.append("\n");
- }
- return result.toString();
-}
-public void runTaskTagsOptionsTest(
- String[] testFiles,
- Map customOptions,
- String expectedTags) {
- TasksReader reader = new TasksReader();
- Map options = JavaScriptCore.getDefaultOptions();
- if (customOptions != null) {
- options.putAll(customOptions);
- }
- this.runConformTest(
- testFiles,
- "",
- null /* no extra class libraries */,
- true /* flush output directory */,
- null, /* no VM args */
- options,
- reader,
- true /* skip javac */);
- String tags = taskTagsAsStrings(reader.result.tasks);
- if (! tags.equals(expectedTags)) {
- System.out.println(getClass().getName() + '#' + getName());
- System.out.println("Effective results:");
- System.out.println(tags);
- System.out.println("Cut and paste:");
- taskTagsAsCutAndPaste(reader.result.tasks);
- assertEquals(expectedTags, tags);
- }
-}
-// Basic test on task tags: watch default behavior
-public void test003_task_tags_options() {
- this.runTaskTagsOptionsTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " // FIXME TODO XXX message contents\n" +
- " }\n" +
- "}\n"},
- null,
- "[FIXME,message contents,HIGH]\n" +
- "[TODO,message contents,NORMAL]\n" +
- "[XXX,message contents,NORMAL]\n");
-}
-// effect of cancelling priorities
-// reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test004_task_tags_options() {
- Map customOptions = new HashMap();
- customOptions.put(JavaScriptCore.COMPILER_TASK_PRIORITIES, "");
- this.runTaskTagsOptionsTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " // FIXME TODO XXX message contents\n" +
- " }\n" +
- "}\n"},
- customOptions,
- "[FIXME,message contents,NORMAL]\n" +
- "[TODO,message contents,NORMAL]\n" +
- "[XXX,message contents,NORMAL]\n");
-}
-// effect of cancelling priorities
-// reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test005_task_tags_options() {
- Map customOptions = new HashMap();
- customOptions.put(JavaScriptCore.COMPILER_TASK_PRIORITIES, ",,");
- this.runTaskTagsOptionsTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " // FIXME TODO XXX message contents\n" +
- " }\n" +
- "}\n"},
- customOptions,
- "[FIXME,message contents,NORMAL]\n" +
- "[TODO,message contents,NORMAL]\n" +
- "[XXX,message contents,NORMAL]\n");
- // would expect an exception of some sort
-}
-// effect of changing priorities
-// reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test006_task_tags_options() {
- Map customOptions = new HashMap();
- customOptions.put(JavaScriptCore.COMPILER_TASK_PRIORITIES, "A,B,C,D,E");
- this.runTaskTagsOptionsTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " // FIXME TODO XXX message contents\n" +
- " }\n" +
- "}\n"},
- customOptions,
- "[FIXME,message contents,NORMAL]\n" +
- "[TODO,message contents,NORMAL]\n" +
- "[XXX,message contents,NORMAL]\n");
- // would expect an exception of some sort
-}
-// effect of changing priorities
-public void test007_task_tags_options() {
- Map customOptions = new HashMap();
- customOptions.put(JavaScriptCore.COMPILER_TASK_PRIORITIES, "NORMAL,NORMAL,NORMAL");
- this.runTaskTagsOptionsTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " // FIXME TODO XXX message contents\n" +
- " }\n" +
- "}\n"},
- customOptions,
- "[FIXME,message contents,NORMAL]\n" +
- "[TODO,message contents,NORMAL]\n" +
- "[XXX,message contents,NORMAL]\n");
-}
-// effect of changing priorities
-// reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
-public void _test008_task_tags_options() {
- Map customOptions = new HashMap();
- customOptions.put(JavaScriptCore.COMPILER_TASK_PRIORITIES, "NORMAL,NORMAL"); // one less than the number of tags
- this.runTaskTagsOptionsTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " // FIXME TODO XXX message contents\n" +
- " }\n" +
- "}\n"},
- customOptions,
- "[FIXME,message contents,NORMAL]\n" +
- "[TODO,message contents,NORMAL]\n" +
- "[XXX,message contents,NORMAL]\n");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/Compliance_1_3.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/Compliance_1_3.java
deleted file mode 100644
index 6423214..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/Compliance_1_3.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class Compliance_1_3 extends AbstractRegressionTest {
-boolean docSupport = false;
-
-public Compliance_1_3(String name) {
- super(name);
-}
-
-/*
- * Toggle compiler in mode -1.3
- */
-protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- if (docSupport) {
- options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
- }
- return options;
-}
-public static Test suite() {
- return buildUniqueComplianceTestSuite(testClass(), COMPLIANCE_1_3);
-}
-public static Class testClass() {
- return Compliance_1_3.class;
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which does not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "Bug58069" };
-// TESTS_NUMBERS = new int[] { 104 };
-// TESTS_RANGE = new int[] { 76, -1 };
-}
-/* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- // Javadoc disabled by default
- docSupport = false;
-}
-
-// test001 - moved to SuperTypeTest#test002
-// test002 - moved to SuperTypeTest#test003
-// test003 - moved to SuperTypeTest#test004
-// test004 - moved to SuperTypeTest#test005
-// test005 - moved to SuperTypeTest#test006
-// test006 - moved to SuperTypeTest#test007
-// test007 - moved to TryStatementTest#test057
-// test008 - moved to LookupTest#test074
-// test009 - moved to RuntimeTests#test1004
-
-// check actualReceiverType when array type
-// test unreachable code complaints
-public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " void foo() { \n"+
- " while (false); \n" +
- " while (false) println(\"unreachable\"); \n" +
- " do ; while (false); \n" +
- " do println(\"unreachable\"); while (false); \n" +
- " for (;false;); \n" +
- " for (;false;) println(\"unreachable\"); \n" +
- " if (false); \n" +
- " if (false) println(\"unreachable\"); \n" +
- " } \n" +
- " function println(s){} \n" +
- " \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.js (at line 3)\n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.js (at line 7)\n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n"
- );
-}
-// binary compatibility
-
-
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=24744
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23096
- */
-public void test037() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "function X() {\n"+
- "}\n"+
- "// TODO: something"
- },
- "----------\n" +
- "1. WARNING in p\\X.js (at line 4)\n" +
- " // TODO: something\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "TODO: something\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=24833
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23096
- */
-public void test038() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:");
- this.runNegativeTest(
- new String[] {
- "X.js",
- "// TODO: something"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 1)\n" +
- " // TODO: something\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "TODO: something\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-
-public void test072() {
-
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main( args) {\n" +
- " try {\n" +
- " f();\n" +
- " } catch(e) {\n" +
- " println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- " function f() {\n" +
- " function ff ()\n" +
- " // {\n" +
- " if (true) throw null;\n" +
- " }\n" +
- " // };\n" +
- " }\n" +
- " function println(s){}",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 12)\n" +
- " if (true) throw null;\n" +
- " ^^^^\n" +
- "Cannot throw null as an exception\n" +
- "----------\n");
-}
-
-
-// checking for captured outer local initialization status
-// NOTE: only complain against non-inlinable outer locals
-// http://bugs.eclipse.org/bugs/show_bug.cgi?id=26134
-public void test074() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) { \n" +
- " var nonInlinedString = \"[Local]\"; \n" +
- " var i = 2; \n" +
- " switch(i){ \n" +
- " case 1: \n" +
- " var displayString = nonInlinedString;\n" +
- " var inlinedString = \"a\"; \n" +
- "// class Local { \n" +
- " function toString() { \n" +
- " return inlinedString + displayString; \n" +
- " } \n" +
- "// } \n" +
- " case 2: \n" +
- "// print(new Local()); \n" +
- "// print(\"-\"); \n" +
-// " println(new Local(){ \n" +
-// " public String toString() { \n" +
-// " return super.toString()+\": anonymous\"; \n" +
-// " } \n" +
-// " }); \n" +
- " } \n" +
- " } \n" +
- " function println(s){}\n",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 14)\n" +
- " System.out.print(new Local()); \n" +
- " ^^^^^^^^^^^\n" +
- "The local variable displayString may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 16)\n" +
- " System.out.println(new Local(){ \n" +
- " public String toString() { \n" +
- " return super.toString()+\": anonymous\"; \n" +
- " } \n" +
- " }); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The local variable displayString may not have been initialized\n" +
- "----------\n");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=66533
- */
-public void test084() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " void foo() {\n" +
- " Object enum = null;\n" +
- " }\n" +
- "\n"
- },
- "----------\n" +
- "1. WARNING in X.js (at line 2)\n" +
- " Object enum = null;\n" +
- " ^^^^\n" +
- "\'enum\' should not be used as an identifier, since it is a reserved keyword from source level 5.0 on\n" +
- "----------\n");
-}
-public void test100() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " function foo() {\n" +
- " var \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " }\n" +
- "\n"
- },
- "----------\n" +
- "1. ERROR in X.js (at line 1)\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " ^^^^^^\n" +
- "Invalid unicode\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " ^^^^^^\n" +
- "Invalid unicode\n" +
- "----------\n"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/DeprecatedTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/DeprecatedTest.java
deleted file mode 100644
index 0888dde..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/DeprecatedTest.java
+++ /dev/null
@@ -1,737 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-import junit.framework.Test;
-
-public class DeprecatedTest extends AbstractRegressionTest {
-public DeprecatedTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-public void test001() {
- this.runNegativeTest(new String[] {
- "p/B.java",
- "package p;\n" +
- "class B extends A {\n" +
- " float x = super.x;\n" +
- "}\n",
-
- "p/A.java",
- "package p;\n" +
- "class A {\n" +
- " /** @deprecated */\n" +
- " int x = 1;\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in p\\B.java (at line 3)\n" +
- " float x = super.x;\n" +
- " ^\n" +
- "The field B.x is hiding a field from type A\n" +
- "----------\n" +
- "2. WARNING in p\\B.java (at line 3)\n" +
- " float x = super.x;\n" +
- " ^\n" +
- "The field A.x is deprecated\n" +
- "----------\n"
- );
-}
-public void test002() {
- this.runNegativeTest(new String[] {
- "p/C.java",
- "package p;\n" +
- "class C {\n" +
- " static int x = new A().x;\n" +
- "}\n",
-
- "p/A.java",
- "package p;\n" +
- "class A {\n" +
- " /** @deprecated */\n" +
- " int x = 1;\n" +
- "}\n",
-
- },
- "----------\n" +
- "1. WARNING in p\\C.java (at line 3)\n" +
- " static int x = new A().x;\n" +
- " ^\n" +
- "The field A.x is deprecated\n" +
- "----------\n"
- );
-}
-public void test003() {
- this.runNegativeTest(new String[] {
- "p/Top.java",
- "package p;\n" +
- "public class Top {\n" +
- " \n" +
- " class M1 {\n" +
- " class M2 {}\n" +
- " };\n" +
- " \n" +
- " static class StaticM1 {\n" +
- " static class StaticM2 {\n" +
- " class NonStaticM3{}};\n" +
- " };\n" +
- " \n" +
- "public static void main(String argv[]){\n" +
- " Top tip = new Top();\n" +
- " System.out.println(\"Still alive 0\");\n" +
- " tip.testStaticMember();\n" +
- " System.out.println(\"Still alive 1\");\n" +
- " tip.testStaticMember1();\n" +
- " System.out.println(\"Still alive 2\");\n" +
- " tip.testStaticMember2();\n" +
- " System.out.println(\"Still alive 3\");\n" +
- " tip.testStaticMember3();\n" +
- " System.out.println(\"Still alive 4\");\n" +
- " tip.testStaticMember4();\n" +
- " System.out.println(\"Completed\");\n" +
- "}\n" +
- " void testMember(){\n" +
- " new M1().new M2();}\n" +
- " void testStaticMember(){\n" +
- " new StaticM1().new StaticM2();}\n" +
- " void testStaticMember1(){\n" +
- " new StaticM1.StaticM2();}\n" +
- " void testStaticMember2(){\n" +
- " new StaticM1.StaticM2().new NonStaticM3();}\n" +
- " void testStaticMember3(){\n" +
- " // define an anonymous subclass of the non-static M3\n" +
- " new StaticM1.StaticM2().new NonStaticM3(){};\n" +
- " } \n" +
- " void testStaticMember4(){\n" +
- " // define an anonymous subclass of the non-static M3\n" +
- " new StaticM1.StaticM2().new NonStaticM3(){\n" +
- " Object hello(){\n" +
- " return new StaticM1.StaticM2().new NonStaticM3();\n" +
- " }};\n" +
- " \n" +
- " } \n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\Top.java (at line 30)\n" +
- " new StaticM1().new StaticM2();}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Illegal enclosing instance specification for type Top.StaticM1.StaticM2\n" +
- "----------\n" +
- "2. WARNING in p\\Top.java (at line 42)\n" +
- " Object hello(){\n" +
- " ^^^^^^^\n" +
- "The method hello() from the type new Top.StaticM1.StaticM2.NonStaticM3(){} is never used locally\n" +
- "----------\n");
-}
-/**
- * Regression test for PR #1G9ES9B
- */
-public void test004() {
- this.runNegativeTest(new String[] {
- "p/Warning.java",
- "package p;\n" +
- "import java.util.Date;\n" +
- "public class Warning {\n" +
- "public Warning() {\n" +
- " super();\n" +
- " Date dateObj = new Date();\n" +
- " dateObj.UTC(1,2,3,4,5,6);\n" +
- "}\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in p\\Warning.java (at line 7)\n" +
- " dateObj.UTC(1,2,3,4,5,6);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The static method UTC(int, int, int, int, int, int) from the type Date should be accessed in a static way\n" +
- "----------\n" +
- "2. WARNING in p\\Warning.java (at line 7)\n" +
- " dateObj.UTC(1,2,3,4,5,6);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method UTC(int, int, int, int, int, int) from the type Date is deprecated\n" +
- "----------\n");
-}
-public void test005() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + "/**\n"
- + " * @deprecated\n"
- + " */\n"
- + " public static class Y {\n"
- + " }\n" +
- " public static void main(String[] args) { \n" +
- " System.out.print(\"SUCCESS\"); \n" +
- " } \n"
- + "}"
- },
- "SUCCESS", // expected output
- null,
- true, // flush previous output dir content
- null, // special vm args
- null, // custom options
- null); // custom requestor
- this.runNegativeTest(
- new String[] {
- "A.java",
- "public class A extends X.Y {}"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 1)\n" +
- " public class A extends X.Y {}\n" +
- " ^^^\n" +
- "The type X.Y is deprecated\n" +
- "----------\n",// expected output
- null,
- false, // flush previous output dir content
- null); // custom options
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=40839
-public void test006() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " @deprecated\n" +
- " */\n" +
- " ; // line comment\n" +
- " static int i;\n" +
- " public static void main(String[] args) { \n" +
- " System.out.print(\"SUCCESS\"); \n" +
- " } \n" +
- "}"
- },
- "SUCCESS", // expected output
- null,
- true, // flush previous output dir content
- null, // special vm args
- null, // custom options
- null); // custom requestor
- this.runNegativeTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " public static void main(String[] args) { \n" +
- " System.out.print(X.i); \n" +
- " } \n" +
- "}"
- },
- "",// expected output
- null,
- false, // flush previous output dir content
- null); // custom options
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=88124
-public void test007() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class X {\n" +
- "}\n",
-
- "Y.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class Y {\n" +
- " Zork z;\n" +
- " X x;\n" +
- " X foo() {\n" +
- " X x; // unexpected deprecated warning here\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in Y.java (at line 8)\n" +
- " X x; // unexpected deprecated warning here\n" +
- " ^\n" +
- "The local variable x is hiding a field from type Y\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=88124 - variation
-public void test008() {
- this.runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class X {\n" +
- "}\n",
- },
- "");
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class Y {\n" +
- " Zork z;\n" +
- " void foo() {\n" +
- " X x; // unexpected deprecated warning here\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n",// expected output
- null,
- false, // flush previous output dir content
- null); // custom options
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=88124 - variation
-public void test009() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class X {\n" +
- "}\n",
-
- "Y.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class Y {\n" +
- " Zork z;\n" +
- " void foo() {\n" +
- " X x; // unexpected deprecated warning here\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=88187
-public void test010() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
- customOptions.put(CompilerOptions.OPTION_ReportInvalidAnnotation, CompilerOptions.WARNING);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class X {\n" +
- " /**\n" +
- " * @see I2#foo()\n" +
- " */\n" +
- " I1 foo() {\n" +
- " return null;\n" +
- " }\n" +
- " Zork z;\n" +
- "}\n",
- "I1.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public interface I1 {\n" +
- " // empty block\n" +
- "}\n",
- "I2.java",
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public interface I2 {\n" +
- " I1 foo(); // unexpected warning here\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=123522
-public void test011() {
- this.runNegativeTest(
- new String[] {
- "p1/X.java", // =================
- "package p1;\n" +
- "import p2.I;\n" +
- "/** @deprecated */\n" +
- "public class X {\n" +
- " Zork z;\n" +
- "}\n", // =================
- "p2/I.java", // =================
- "package p2;\n" +
- "/** @deprecated */\n" +
- "public interface I {\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-
-// @deprecated upon locals do not influence the deprecation diagnostic
-// JLS3 9.6
-public void test012() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation,
- CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode,
- CompilerOptions.IGNORE);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " /** @deprecated */\n" +
- " int i1 = Y.m;\n" +
- " }\n" +
- " /** @deprecated */\n" +
- " void bar() {\n" +
- " int i1 = Y.m;\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "public class Y {\n" +
- " /** @deprecated */\n" +
- " static int m;\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int i1 = Y.m;\n" +
- " ^\n" +
- "The field Y.m is deprecated\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-// @deprecated upon locals do not influence the deprecation diagnostic
-// JLS3 9.6
-// @Deprecated variant
-public void test013() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation,
- CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode,
- CompilerOptions.IGNORE);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " @Deprecated\n" +
- " int i1 = Y.m;\n" +
- " }\n" +
- " @Deprecated\n" +
- " void bar() {\n" +
- " int i1 = Y.m;\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "public class Y {\n" +
- " @Deprecated\n" +
- " static int m;\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " int i1 = Y.m;\n" +
- " ^\n" +
- "The field Y.m is deprecated\n" +
- "----------\n",
- null,
- true,
- customOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159243
-public void test014() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "/**\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class X {\n" +
- "}\n",
- "Y.java",
- "import p.X;\n" +
- "public class Y {\n" +
- " Zork z;\n" +
- " void foo() {\n" +
- " X x;\n" +
- " X[] xs = { x };\n" +
- " }\n" +
- " void bar() {\n" +
- " p.X x;\n" +
- " p.X[] xs = { x };\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in Y.java (at line 1)\n" +
- " import p.X;\n" +
- " ^^^\n" +
- "The type X is deprecated\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 3)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "3. WARNING in Y.java (at line 5)\n" +
- " X x;\n" +
- " ^\n" +
- "The type X is deprecated\n" +
- "----------\n" +
- "4. WARNING in Y.java (at line 6)\n" +
- " X[] xs = { x };\n" +
- " ^\n" +
- "The type X is deprecated\n" +
- "----------\n" +
- "5. WARNING in Y.java (at line 9)\n" +
- " p.X x;\n" +
- " ^^^\n" +
- "The type X is deprecated\n" +
- "----------\n" +
- "6. WARNING in Y.java (at line 10)\n" +
- " p.X[] xs = { x };\n" +
- " ^^^\n" +
- "The type X is deprecated\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
-// the order of the CUs must not modify the behavior, see also test016
-public void test015() {
- Map customOptions = new HashMap();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "p/M1.java",
- "package p;\n" +
- "public class M1 {\n" +
- " void bar() {\n" +
- " a.N1.N2.N3 m = null;\n" +
- " m.foo();\n" +
- " }\n" +
- "}\n",
- "a/N1.java",
- "package a;\n" +
- "public class N1 {\n" +
- " /** @deprecated */\n" +
- " public class N2 {" +
- " public class N3 {" +
- " public void foo() {}" +
- " }" +
- " }" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\M1.java (at line 4)\n" +
- " a.N1.N2.N3 m = null;\n" +
- " ^^^^^^^^^^\n" +
- "The type N1.N2 is deprecated\n" +
- "----------\n" +
- "2. ERROR in p\\M1.java (at line 4)\n" +
- " a.N1.N2.N3 m = null;\n" +
- " ^^^^^^^^^^\n" +
- "The type N1.N2.N3 is deprecated\n" +
- "----------\n" +
- "3. ERROR in p\\M1.java (at line 5)\n" +
- " m.foo();\n" +
- " ^^^^^^^\n" +
- "The method foo() from the type N1.N2.N3 is deprecated\n" +
- "----------\n",
- null,
- true,
- customOptions,
- true,
- false,
- false);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
-public void test016() {
- Map customOptions = new HashMap();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "a/N1.java",
- "package a;\n" +
- "public class N1 {\n" +
- " /** @deprecated */\n" +
- " public class N2 {" +
- " public class N3 {" +
- " public void foo() {}" +
- " }" +
- " }" +
- "}\n",
- "p/M1.java",
- "package p;\n" +
- "public class M1 {\n" +
- " void bar() {\n" +
- " a.N1.N2.N3 m = null;\n" +
- " m.foo();\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\M1.java (at line 4)\n" +
- " a.N1.N2.N3 m = null;\n" +
- " ^^^^^^^^^^\n" +
- "The type N1.N2 is deprecated\n" +
- "----------\n" +
- "2. ERROR in p\\M1.java (at line 4)\n" +
- " a.N1.N2.N3 m = null;\n" +
- " ^^^^^^^^^^\n" +
- "The type N1.N2.N3 is deprecated\n" +
- "----------\n" +
- "3. ERROR in p\\M1.java (at line 5)\n" +
- " m.foo();\n" +
- " ^^^^^^^\n" +
- "The method foo() from the type N1.N2.N3 is deprecated\n" +
- "----------\n",
- null,
- true,
- customOptions,
- true,
- false,
- false);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
-// variant: self-contained case, hence no report
-public void test017() {
- Map customOptions = new HashMap();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "a/N1.java",
- "package a;\n" +
- "public class N1 {\n" +
- " /** @deprecated */\n" +
- " public class N2 {" +
- " public class N3 {" +
- " public void foo() {}" +
- " }" +
- " }" +
- " void bar() {\n" +
- " a.N1.N2.N3 m = null;\n" +
- " m.foo();\n" +
- " }\n" +
- "}\n"
- },
- "",
- null,
- true,
- null,
- customOptions,
- null,
- false);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159709
-// variant: using a binary class
-public void test018() {
- Map customOptions = new HashMap();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "a/N1.java",
- "package a;\n" +
- "public class N1 {\n" +
- " /** @deprecated */\n" +
- " public class N2 {" +
- " public class N3 {" +
- " public void foo() {}" +
- " }" +
- " }" +
- "}\n"
- },
- "",
- null,
- true,
- null,
- customOptions,
- null,
- false);
- this.runNegativeTest(
- new String[] {
- "p/M1.java",
- "package p;\n" +
- "public class M1 {\n" +
- " void bar() {\n" +
- " a.N1.N2.N3 m = null;\n" +
- " m.foo();\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in p\\M1.java (at line 4)\n" +
- " a.N1.N2.N3 m = null;\n" +
- " ^^^^^^^^^^\n" +
- "The type N1.N2 is deprecated\n" +
- "----------\n" +
- "2. ERROR in p\\M1.java (at line 4)\n" +
- " a.N1.N2.N3 m = null;\n" +
- " ^^^^^^^^^^\n" +
- "The type N1.N2.N3 is deprecated\n" +
- "----------\n" +
- "3. ERROR in p\\M1.java (at line 5)\n" +
- " m.foo();\n" +
- " ^^^^^^^\n" +
- "The method foo() from the type N1.N2.N3 is deprecated\n" +
- "----------\n",
- null,
- false /* do not flush */,
- customOptions,
- true,
- false,
- false);
-}
-public static Class testClass() {
- return DeprecatedTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java
deleted file mode 100644
index df6a6df..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class ExternalizeStringLiterals15Test extends AbstractRegressionTest {
-
-static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 6 };
-// TESTS_RANGE = new int[] { 11, -1 };
-}
-public ExternalizeStringLiterals15Test(String name) {
- super(name);
-}
-public static Test suite() {
- return buildUniqueComplianceTestSuite(testClass(), COMPLIANCE_1_5);
-}
-
-public void test001() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "X.java",
- "import static java.lang.annotation.ElementType.*;\n" +
- "import static java.lang.annotation.RetentionPolicy.*;\n" +
- "import java.lang.annotation.Retention;\n" +
- "import java.lang.annotation.Target;\n" +
- "@Target({TYPE, FIELD, METHOD,\r\n" +
- " PARAMETER, CONSTRUCTOR,\r\n" +
- " LOCAL_VARIABLE, PACKAGE})\r\n" +
- "@Retention(CLASS)\r\n" +
- "public @interface X\r\n" +
- "{\r\n" +
- " String[] value() default {};\r\n" +
- " String justification() default \"\";\r\n" +
- "}"
- },
- "",
- null,
- true,
- null,
- customOptions,
- null);
-}
-public void test002() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " String s2 = \"test1\"; //$NON-NLS-1$\n" +
- " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " \n" +
- " @SuppressWarnings(\"nls\")\n" +
- " void foo() {\n" +
- " String s4 = null;\n" +
- " String s5 = \"test3\";\n" +
- " String s6 = \"test4\";\n" +
- " System.out.println(\"test5\");\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " String s5 = \"test3\";\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " String s6 = \"test4\";\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " System.out.println(\"test5\");\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test003() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " String s2 = \"test1\"; //$NON-NLS-1$\n" +
- " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " \n" +
- " @SuppressWarnings(\"nls\")\n" +
- " void foo() {\n" +
- " String s4 = null;\n" +
- " String s5 = null;//$NON-NLS-1$\n" +
- " String s6 = \"test4\";\n" +
- " System.out.println(\"test5\");\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " String s5 = null;//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " String s6 = \"test4\";\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " System.out.println(\"test5\");\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test004() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " String s2 = \"test1\"; //$NON-NLS-1$\n" +
- " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " \n" +
- " @SuppressWarnings(\"nls\")\n" +
- " void foo() {\n" +
- " String s4 = null;\n" +
- " String s5 = null;//$NON-NLS-1$\n" +
- " String s6 = \"test4\";\n" +
- " System.out.println(\"test5\");\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903
-public void test005() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " @SuppressWarnings(\"nls\")\n" +
- " void foo() {\n" +
- " String s6 = \"SUCCESS\";\n" +
- " System.out.println(s6);\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " String s6 = \"SUCCESS\";\n" +
- " ^^^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903
-public void test006() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"nls\")\n" +
- " public static void main(String[] args) {\n" +
- " String s6 = \"SUCCESS\";\n" +
- " System.out.println(s6);\n" +
- " }\n" +
- "}",
- },
- "SUCCESS",
- null,
- true,
- null,
- customOptions,
- null);
-}
-public static Class testClass() {
- return ExternalizeStringLiterals15Test.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java
deleted file mode 100644
index e00ae3f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-import junit.framework.Test;
-
-public class ExternalizeStringLiteralsTest extends AbstractRegressionTest {
-
-static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 16 };
-// TESTS_RANGE = new int[] { 11, -1 };
-}
-public ExternalizeStringLiteralsTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public void test001() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "A.js",
- " function foo() {\n" +
- " println(\"a\");\n" +
- " } //$NON-NLS-1$ \n" +
- ""
- },
- "----------\n" +
- "1. ERROR in A.js (at line 2)\n" +
- " println(\"a\");\n" +
- " ^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in A.js (at line 3)\n" +
- " } //$NON-NLS-1$ \n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-public void test002() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var s = null; //$NON-NLS-1$\n" +
- " var s2 = \"\"; //$NON-NLS-1$\n" +
- " var s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " \n" +
- " function foo() {\n" +
- " var s4 = null; //$NON-NLS-1$\n" +
- " var s5 = \"\"; //$NON-NLS-1$\n" +
- " var s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" +
- " println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" +
- " } //$NON-NLS-1$\n" +
- " //$NON-NLS-1$\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 1)\n" +
- " var s = null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " var s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.js (at line 6)\n" +
- " var s4 = null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "4. ERROR in X.js (at line 8)\n" +
- " var s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "5. ERROR in X.js (at line 9)\n" +
- " println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "6. ERROR in X.js (at line 10)\n" +
- " } //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test003() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "Foo.js",
- " function foo() {\n" +
- " println(\"string1\" + \"string2\" //$NON-NLS-1$\n" +
- " );\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in Foo.js (at line 2)\n" +
- " println(\"string1\" + \"string2\" //$NON-NLS-1$\n" +
- " ^^^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in p\\Foo.js (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test004() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "Foo.js",
- " function foo() {\n" +
- " //$NON-NLS-1$\n" +
- " };\n" +
- "",
- },
- "",
- null,
- true,
- null,
- customOptions,
- null);
-}
-public void test005() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main( args) {\r\n" +
- " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
- " }\r\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test006() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " public static function main(String[] args) {\r\n" +
- " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
- " \r\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test007() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) {\r\n" +
- " var s = null; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
- " }\r\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = null; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 2)\n" +
- " var s = null; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test008() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) {\r\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\r\n" +
- " }\r\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 2)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.js (at line 2)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test009() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "Foo.js",
- " function foo(i) {\n" +
- " println(\"test1\" + i + \"test2\"); //$NON-NLS-2$//$NON-NLS-1$\r\n" +
- " };\n" +
- "",
- },
- "",
- null,
- true,
- null,
- customOptions,
- null);
-}
-public void test010() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) {\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " var i = s;\n" +
- " println(s);\n" +
- " }\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 2)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.js (at line 2)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test011() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) {\n" +
- " var i = null;\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " println(s + i);\n" +
- " }\n" +
- "",
- },
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "3. ERROR in X.js (at line 3)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "4. ERROR in X.js (at line 3)\n" +
- " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test012() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) {\n" +
- " var i = null;\n" +
- " var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " println(s + i);\n" +
- " }\n" +
- "",
- },
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.js (at line 3)\n" +
- " var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-public void test013() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) {\n" +
- " var s = \"test1\";\n" +
- " println(s);\n" +
- " }\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = \"test1\";\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=112973
-public void test014() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function main(args) {\n" +
- " var s = \"test1\"; //$NON-NLS-?$\n" +
- " println(s);\n" +
- " }\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s = \"test1\"; //$NON-NLS-?$\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 2)\n" +
- " var s = \"test1\"; //$NON-NLS-?$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077
-public void test015() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " public function foo() {\n" +
- " var s1= null; //$NON-NLS-1$\n" +
- " var s2= \"\";\n" +
- " }\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 2)\n" +
- " var s1= null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 3)\n" +
- " var s2= \"\";\n" +
- " ^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077
-public void test016() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " var s1= null; //$NON-NLS-1$\n" +
- " \n" +
- " function foo() {\n" +
- " var s2= \"\";\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 1)\n" +
- " private var s1= null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.js (at line 4)\n" +
- " var s2= \"\";\n" +
- " ^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148352
-public void test017() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.js",
- " function foo(locationInAST) {\n" +
- " var enclosingType= \"\"; //$NON-NLS-1$\n" +
- " if (locationInAST != null) {\n" +
- " enclosingType.toString()\n" +
- " }\n" +
- " }\n" +
- "",
- },
- "----------\n" +
- "1. ERROR in X.js (at line 5)\n" +
- " enclosingType.toString()\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n",
- null,
- true,
- customOptions,
- false,
- false,
- false,
- false,
- true,
- null);
-}
-public static Class testClass() {
- return ExternalizeStringLiteralsTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FieldAccessTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FieldAccessTest.java
deleted file mode 100644
index 81e689b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FieldAccessTest.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class FieldAccessTest extends AbstractRegressionTest {
- static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 5, 6 };
-// TESTS_RANGE = new int[] { 21, 50 };
- }
-
-public FieldAccessTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.ERROR);
- return options;
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=149004
-public void test001() {
- this.runConformTest(
- new String[] {
- "foo/BaseFoo.java",
- "package foo;\n" +
- "class BaseFoo {\n" +
- " public static final int VAL = 0;\n" +
- "}",
- "foo/NextFoo.java",
- "package foo;\n" +
- "public class NextFoo extends BaseFoo {\n" +
- "}",
- "bar/Bar.java",
- "package bar;\n" +
- "public class Bar {\n" +
- " int v = foo.NextFoo.VAL;\n" +
- "}"
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=149004
-public void test002() {
- this.runNegativeTest(
- new String[] {
- "foo/BaseFoo.java",
- "package foo;\n" +
- "public class BaseFoo {\n" +
- " public static final int VAL = 0;\n" +
- "}",
- "foo/NextFoo.java",
- "package foo;\n" +
- "public class NextFoo extends BaseFoo {\n" +
- "}",
- "bar/Bar.java",
- "package bar;\n" +
- "public class Bar {\n" +
- " int v = foo.NextFoo.VAL;\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in bar\\Bar.java (at line 3)\n" +
- " int v = foo.NextFoo.VAL;\n" +
- " ^^^\n" +
- "The static field BaseFoo.VAL should be accessed directly\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=149004
-public void test003() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
- this.runConformTest(
- new String[] {
- "foo/BaseFoo.java",
- "package foo;\n" +
- "class BaseFoo {\n" +
- " public static final int VAL = 0;\n" +
- "}",
- "foo/NextFoo.java",
- "package foo;\n" +
- "public class NextFoo extends BaseFoo {\n" +
- "}",
- "bar/Bar.java",
- "package bar;\n" +
- "import foo.NextFoo;\n" +
- "public class Bar {\n" +
- " NextFoo[] tab = new NextFoo[] { new NextFoo() };\n" +
- " int v = tab[0].VAL;\n" +
- "}"
- },
- "",
- null,
- true,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=149004
-public void test004() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
- this.runNegativeTest(
- new String[] {
- "foo/BaseFoo.java",
- "package foo;\n" +
- "public class BaseFoo {\n" +
- " public static final int VAL = 0;\n" +
- "}",
- "foo/NextFoo.java",
- "package foo;\n" +
- "public class NextFoo extends BaseFoo {\n" +
- "}",
- "bar/Bar.java",
- "package bar;\n" +
- "import foo.NextFoo;\n" +
- "public class Bar {\n" +
- " NextFoo[] tab = new NextFoo[] { new NextFoo() };\n" +
- " int v = tab[0].VAL;\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in bar\\Bar.java (at line 5)\n" +
- " int v = tab[0].VAL;\n" +
- " ^^^\n" +
- "The static field BaseFoo.VAL should be accessed directly\n" +
- "----------\n",
- null,
- true,
- options);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=142234
-public void test005() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " private String memberVariable;\n" +
- " public String getMemberVariable() {\n" +
- " return (memberVariable);\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return (memberVariable);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Unqualified access to the field X.memberVariable \n" +
- "----------\n",
- null,
- true,
- options);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=142234
-public void test006() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " private String memberVariable;\n" +
- " public String getMemberVariable() {\n" +
- " return \\u0028memberVariable\\u0029;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return \\u0028memberVariable\\u0029;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Unqualified access to the field X.memberVariable \n" +
- "----------\n",
- null,
- true,
- options);
-}
-public static Class testClass() {
- return FieldAccessTest.class;
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FlowAnalysisTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FlowAnalysisTest.java
deleted file mode 100644
index 5c6e0c6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FlowAnalysisTest.java
+++ /dev/null
@@ -1,1242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemSeverities;
-
-public class FlowAnalysisTest extends AbstractRegressionTest {
-
-public FlowAnalysisTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public void test001() {
- this.runNegativeTest(new String[] {
- "X.java", // =================
- "public class X {\n" +
- " public String foo(int i) {\n" +
- " if (true) {\n" +
- " return null;\n" +
- " }\n" +
- " if (i > 0) {\n" +
- " return null;\n" +
- " }\n" +
- " } \n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public String foo(int i) {\n" +
- " ^^^^^^^^^^\n" +
- "This method must return a result of type String\n" +
- "----------\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127255
-// Compiler incorrectly reports "variable may not have been initialized"
-public void test002() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportParameterAssignment, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test() {\n" +
- " int c1, c2;\n" +
- " while ((char) (c1 = 0) == 1) {}\n" +
- " if (c1 == 0) {} // silent\n" +
- " if (c2 == 0) {} // complain\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (c2 == 0) {} // complain\n" +
- " ^^\n" +
- "The local variable c2 may not have been initialized\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127255
-// Compiler incorrectly reports "variable may not have been initialized"
-public void test003() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportParameterAssignment, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test() {\n" +
- " int c1, c2;\n" +
- " while ((char) (c1 = 0) == 1) ;\n" +
- " if (c1 == 0) {} // silent\n" +
- " if (c2 == 0) {} // complain\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (c2 == 0) {} // complain\n" +
- " ^^\n" +
- "The local variable c2 may not have been initialized\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127255
-// Compiler incorrectly reports "variable may not have been initialized"
-public void test004() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportParameterAssignment, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test() {\n" +
- " int c1, c2;\n" +
- " for (;(char) (c1 = 0) == 1;) ;\n" +
- " if (c1 == 0) {} // silent\n" +
- " if (c2 == 0) {} // complain\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (c2 == 0) {} // complain\n" +
- " ^^\n" +
- "The local variable c2 may not have been initialized\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127255
-// Compiler incorrectly reports "variable may not have been initialized"
-public void test005() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportParameterAssignment, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test() {\n" +
- " int c1, c2;\n" +
- " do ; while ((char) (c1 = 0) == 1);\n" +
- " if (c1 == 0) {} // silent\n" +
- " if (c2 == 0) {} // complain\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (c2 == 0) {} // complain\n" +
- " ^^\n" +
- "The local variable c2 may not have been initialized\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// basic scenario
-public void test006() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " case 1:\n" +
- " System.out.println(1); // complain: possible fall-through\n" +
- " break;\n" +
- " case 2:\n" +
- " System.out.println(3); // silent because of break\n" +
- " return;\n" +
- " case 3: // silent because of return\n" +
- " case 4: // silent because grouped cases\n" +
- " default:\n" +
- " System.out.println(\"default\"); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1:\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// SuppressWarnings effect - explicit fallthrough token
-public void test007() {
- if (COMPLIANCE_1_5.equals(this.complianceLevel)) {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.WARNING);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"fallthrough\")\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " case 1:\n" +
- " System.out.println(1); // silent because of SuppressWarnings\n" +
- " }\n" +
- " }\n" +
- " Zork z;\n" + // complain on Zork (unknown type)
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n",
- null, true, options);
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// deep return (1) - fake reachable is seen as reachable
-public void test008() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0);\n" +
- " if (true) {\n" +
- " return;\n" +
- " }\n" +
- " case 1:\n" +
- " System.out.println(1);\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " case 1:\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// deep return (2)
-public void test009() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p, boolean b) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0);\n" +
- " if (b) {\n" +
- " return;\n" +
- " }\n" +
- " else {\n" +
- " return;\n" +
- " }\n" +
- " case 1:\n" +
- " System.out.println(1);\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "",
- null, true, null, options, null);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// deep return (3), limit: cannot recognize that we won't return
-public void test010() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p, boolean b) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.exit(0);\n" +
- " case 1:\n" + // complain
- " System.out.println(1);\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case 1:\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// SuppressWarnings effect - implicit, using all token
-public void test011() {
- if (COMPLIANCE_1_5.equals(this.complianceLevel)) {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.WARNING);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " @SuppressWarnings(\"all\")\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " case 1:\n" +
- " System.out.println(1); // silent because of SuppressWarnings\n" +
- " }\n" +
- " }\n" +
- " Zork z;\n" + // complain on Zork (unknown type)
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n",
- null, true, options);
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127730
-// [compiler] skip fall-through case warning when the fall-through is documented
-// skip because of comment
-public void _test012() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " // on purpose fall-through\n" +
- " case 1:\n" +
- " System.out.println(1); // silent because of comment alone on its line above \n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "",
- null, true, null, options, null);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127730
-// [compiler] skip fall-through case warning when the fall-through is documented
-// skip because of comment - default label
-public void _test013() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " // on purpose fall-through\n" +
- " default:\n" +
- " System.out.println(1); // silent because of comment alone on its line above \n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "",
- null, true, null, options, null);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// basic scenario: default label
-public void test014() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- // note: the comment above is not alone on its line, hence it does not
- // protect against fall-through diagnostic
- " default:\n" +
- " System.out.println(1); // complain: possible fall-through\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " default:\n" +
- " ^^^^^^^\n" +
- "Switch case may be entered by falling through previous case\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// skip because of comment - variants
-public void test015() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " // on purpose fall-through\n" +
- "\n" + // extraneous line breaks fall-through protection
- " case 1:\n" +
- " System.out.println(1); // silent because of comment alone on its line above \n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " case 1:\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// skip because of comment - variants
-public void test016() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " // on purpose fall-through\n" +
- " /* other comment */\n" + // non-single line comment breaks fall-through protection
- " case 1:\n" +
- " System.out.println(1); // silent because of comment alone on its line above \n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " case 1:\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127730
-// [compiler] skip fall-through case warning when the fall-through is documented
-// skip because of comment - variants
-public void _test017() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0);\n" +
- "// on purpose fall-through\n" + // very beginning of line
- " case 1:\n" +
- " System.out.println(1); // silent because of comment alone on its line above \n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "",
- null, true, null, options, null);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127730
-// [compiler] skip fall-through case warning when the fall-through is documented
-// skip because of comment - variants
-public void _test018() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0);\n" +
- " //\n" + // empty line comment alone upon its line
- " case 1:\n" +
- " System.out.println(1); // silent because of comment alone on its line above \n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "",
- null, true, null, options, null);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// conditioned break
-public void test019() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFallthroughCase, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p, boolean b) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " if (b) {\n" +
- " break;\n" +
- " }\n" +
- " case 1:\n" +
- " System.out.println(1); // silent because of comment alone on its line above \n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " case 1:\n" +
- " ^^^^^^\n" +
- "Switch case may be entered by falling through previous case\n" +
- "----------\n",
- null, true, options);
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// default reporting is ignore
-public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(int p) {\n" +
- " switch (p) {\n" +
- " case 0:\n" +
- " System.out.println(0); // silent because first case\n" +
- " case 1:\n" +
- " System.out.println(1); // silent because default level is ignore\n" +
- " }\n" +
- " }\n" +
- " Zork z;\n" + // complain on Zork (unknown type)
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=67836
-// [compiler] warning on fall through
-// problem category
-public void test021() {
- if (ProblemReporter.getProblemCategory(ProblemSeverities.Warning, IProblem.FallthroughCase) !=
- CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM) {
- fail("bad category for fall-through case problem");
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128840
-public void test022() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " if (true)\n" +
- " ;\n" +
- " else\n" +
- " ;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " ;\n" +
- " ^\n" +
- "Empty control-flow statement\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " ;\n" +
- " ^\n" +
- "Empty control-flow statement\n" +
- "----------\n",
- null, true, options);
-}
-public void test023() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " final X x;\n" +
- " while (true) {\n" +
- " if (true) {\n" +
- " break;\n" +
- " }\n" +
- " x = new X();\n" +
- " }\n" +
- " x.foo();\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " x.foo();\n" +
- " ^\n" +
- "The local variable x may not have been initialized\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=132974
-public void test024() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(boolean b) {\n" +
- " final Object l;\n" +
- " do {\n" +
- " if (b) {\n" +
- " l = new Object();\n" +
- " break;\n" +
- " }\n" +
- " } while (false);\n" +
- " l.toString();\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " l.toString();\n" +
- " ^\n" +
- "The local variable l may not have been initialized\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=135602
-public void test025() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(\"[starting]\");\n" +
- " X l = new X();\n" +
- " l.testLoop();\n" +
- " System.out.println(\"[finished]\");\n" +
- " }\n" +
- "\n" +
- " public void testLoop() {\n" +
- " int loops = 0;\n" +
- "\n" +
- " do {\n" +
- " System.out.print(\"[Loop \" + loops + \"]\");\n" +
- " if (loops > 2) {\n" +
- " return;\n" +
- " }\n" +
- "\n" +
- " if (loops < 4) {\n" +
- " ++loops;\n" +
- " continue; \n" +
- " }\n" +
- " } while (false);\n" +
- " }\n" +
- "\n" +
- "}\n"
- },
- "[starting][Loop 0][finished]");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137298
-public void test026() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1) {\n" +
- " int a00, a01, a02, a03, a04, a05, a06, a07, a08, a09;\n" +
- " int a10, a11, a12, a13, a14, a15, a16, a17, a18, a19;\n" +
- " int a20, a21, a22, a23, a24, a25, a26, a27, a28, a29;\n" +
- " int a30, a31, a32, a33, a34, a35, a36, a37, a38, a39;\n" +
- " int a40, a41, a42, a43, a44, a45, a46, a47, a48, a49;\n" +
- " int a50, a51, a52, a53, a54, a55, a56, a57, a58, a59;\n" +
- " int a60, a61, a62, a63, a64, a65, a66, a67, a68, a69;\n" +
- " String s;\n" +
- " Object o2 = o1;\n" +
- " if (o2 == null) {\n" +
- " s = \"\";\n" +
- " }\n" +
- " System.out.println(s);\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Non-recursive approach for deep binary expressions. Check that the
-// flow analysis doesn't break.
-public void test027() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " String s;\n" +
- " if (args.length == 0) {\n" +
- " s = \"s\";\n" +
- " } else {\n" +
- " s = args[0];\n" +
- " }\n" +
- " System.out.println(s + \"-\" + s + \"-\" + s + \"-\" +\n" +
- " s + \"-\" + s + \"-\" + s + \"-\" +\n" +
- " s + \"-\" + s + \"-\" + s + \"-\" +\n" +
- " s + \"-\" + s + \"-\" + s + \"-\" +\n" +
- " s + \"-\" + s + \"-\" + s + \"-\");\n" +
- " }\n" +
- "}"
- },
- "s-s-s-s-s-s-s-s-s-s-s-s-s-s-s-");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155423
-public void test028() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " {\n" +
- " if (true) throw new NullPointerException();\n" +
- " }\n" +
- "}\n" // =================
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155423 - variation
-public void test029() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " {\n" +
- " if (true) throw new NullPointerException();\n" +
- " }\n" +
- " X() {\n" +
- " System.out.println();\n" +
- " }\n" +
- "}\n", // =================
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155423 - variation
-public void test030() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " Y(Object o) {\n" +
- " System.out.print(o);\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X extends Y {\n" +
- " {\n" +
- " if (true)\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- "\n" +
- " X() {\n" +
- " super(new Object() {\n" +
- " public String toString() {\n" +
- " return \"SUCCESS:\";\n" +
- " }\n" +
- " });\n" +
- " System.out.println();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " new X();\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"caught:NPE\");\n" +
- " }\n" +
- " }\n" +
- "}\n", // =================
- },
- "SUCCESS:caught:NPE");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155423 - variation
-public void test031() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " Y(Object o) {\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X extends Y {\n" +
- " final int blank;\n" +
- " {\n" +
- " if (true)\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- "\n" +
- " X() {\n" +
- " super(new Object() {});\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " X() {\n" +
- " ^^^\n" +
- "The blank final field blank may not have been initialized\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155423 - variation
-public void test032() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " Y(int i) {\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X extends Y {\n" +
- " final int blank;\n" +
- " {\n" +
- " if (true)\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- "\n" +
- " X() {\n" +
- " super(blank = 0);\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " super(blank = 0);\n" +
- " ^^^^^\n" +
- "Cannot refer to an instance field blank while explicitly invoking a constructor\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155423 - variation
-public void test033() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " Y(int i) {\n" +
- " }\n" +
- "}\n" +
- "public class X extends Y {\n" +
- " final int blank;\n" +
- " {\n" +
- " if (true)\n" +
- " throw new NullPointerException();\n" +
- " }\n" +
- " X() {\n" +
- " super(0);\n" +
- " blank = 0;\n" +
- " }\n" +
- "}\n", // =================
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162918
-public void test034() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo1() {\n" +
- " switch (1) {\n" +
- " case 0:\n" +
- " final int i = 1;\n" +
- " case i: // should complain: i not initialized\n" +
- " System.out.println(i); // should complain: i not initialized\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " case i: // should complain: i not initialized\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " System.out.println(i); // should complain: i not initialized\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162918
-// variant
-public void test035() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo2() {\n" +
- " switch (1) {\n" +
- " case 0:\n" +
- " int j = 0;\n" +
- " case 1:\n" +
- " System.out.println(j); // should complain: j not initialized\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " System.out.println(j); // should complain: j not initialized\n" +
- " ^\n" +
- "The local variable j may not have been initialized\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162918
-// variant - not a flow analysis issue per se, contrast with 34 and 35 above
-public void test036() {
- String src =
- "public class X {\n" +
- " void foo3() {\n" +
- " switch (1) {\n" +
- " case 0:\n" +
- " class Local {\n" +
- " }\n" +
- " ;\n" +
- " case 1:\n" +
- " new Local();\n" + // complain for compliance >= 1.4
- " }\n" +
- " }\n" +
- "}";
- if (complianceLevel.compareTo(COMPLIANCE_1_3) <= 0) {
- this.runConformTest(
- new String[] {
- "X.java",
- src
- },
- ""
- );
- } else {
- this.runNegativeTest(
- new String[] {
- "X.java",
- src
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " new Local();\n" +
- " ^^^^^\n" +
- "Local cannot be resolved to a type\n" +
- "----------\n");
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
-public void test037() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " if (false) {\n" +
- " String s;\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
-// variant: the declaration is outside of the fake reachable block
-public void test038() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " String s;\n" +
- " if (false) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
-// variant with deeper nesting
-public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " if (false) {\n" +
- " String s;\n" +
- " if (System.out != null) {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " System.out.println(s);\n" +
- " ^\n" +
- "The local variable s may not have been initialized\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
-// variant - checking duplicate initialization of final variables
-public void test040() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " final String s = \"\";\n" +
- " if (false) {\n" +
- " s = \"\";\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " s = \"\";\n" +
- " ^\n" +
- "The final local variable s cannot be assigned. It must be blank and not using a compound assignment\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
-// variant - checking duplicate initialization of final variables
-public void test041() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " final String s;\n" +
- " s = \"\";\n" +
- " if (false) {\n" +
- " s = \"\";\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166641
-// variant - checking duplicate initialization of final variables
-public void test042() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " final String s;\n" +
- " if (false) {\n" +
- " s = \"\";\n" +
- " }\n" +
- " s = \"\";\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " s = \"\";\n" +
- " ^\n" +
- "The final local variable s may already have been assigned\n" +
- "----------\n");
-}
-// switch and definite assignment
-public void test043() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public abstract class X {\n" +
- " public static void main(String[] args) {\n" +
- " for (int i = 0; i < 3; i++) {\n" +
- " System.out.print(i);\n" +
- " switch (i) {\n" +
- " case 1:\n" +
- " final int j;\n" +
- " j = 1;\n" +
- " System.out.println(j);\n" +
- " break;\n" +
- " case 2:\n" +
- " j = 2;\n" +
- " System.out.println(j);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "011\n22");
-}
-// switch and definite assignment
-public void test044() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X {\n" +
- " public static void main(String[] args) {\n" +
- " for (int i = 0; i < 3; i++) {\n" +
- " System.out.print(i);\n" +
- " switch (i) {\n" +
- " case 1:\n" +
- " final int j = 1;\n" +
- " System.out.println(j);\n" +
- " break;\n" +
- " case 2:\n" +
- " j = 2;\n" +
- " System.out.println(j);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " j = 2;\n" +
- " ^\n" +
- "The final local variable j cannot be assigned. It must be blank and not using a compound assignment\n" +
- "----------\n");
-}
-// switch and definite assignment
-// **
-public void test045() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X {\n" +
- " public static void main(String[] args) {\n" +
- " switch (args.length) {\n" +
- " case 1:\n" +
- " final int j = 1;\n" +
- " case 2:\n" +
- " switch (5) {\n" +
- " case j:\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " case j:\n" +
- " ^\n" +
- "The local variable j may not have been initialized\n" +
- "----------\n");
-}
-// for and definite assignment
-// **
-public void test046() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public abstract class X {\n" +
- " public static void main(String args[]) {\n" +
- " for (final int i; 0 < (i = 1); i = i + 1) {\n" +
- " System.out.println(i);\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "1");
-}
-public static Class testClass() {
- return FlowAnalysisTest.class;
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ForStatementTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ForStatementTest.java
deleted file mode 100644
index b1ff69f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ForStatementTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class ForStatementTest extends AbstractRegressionTest {
-
-public ForStatementTest(String name) {
- super(name);
-}
-
-protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
- return options;
-}
-// Static initializer to specify tests subset using TESTS_* static variables
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 45, 46 };
-// TESTS_RANGE = new int[] { 34, 38 };
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-public void test001() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static Object m(int[] arg) {\n" +
- " yyLoop: for (int i = 0;; ++i) {\n" +
- " yyInner: for (;;) {\n" +
- " switch (arg[i]) {\n" +
- " case 0:\n" +
- " break;\n" +
- " case 1:\n" +
- " continue yyInner;\n" +
- " }\n" +
- " if (i == 32)\n" +
- " return arg;\n" +
- " if (i == 12)\n" +
- " break;\n" +
- " continue yyLoop;\n" +
- " }\n" +
- " if (i == 32)\n" +
- " return null;\n" +
- " if (i > 7)\n" +
- " continue yyLoop;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-public static Class testClass() {
- return ForStatementTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InMemoryNameEnvironment.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InMemoryNameEnvironment.java
deleted file mode 100644
index 5ebfd2a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InMemoryNameEnvironment.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.env.*;
-import org.eclipse.wst.jsdt.internal.compiler.impl.ITypeRequestor;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.internal.compiler.util.HashtableOfObject;
-
-public class InMemoryNameEnvironment implements INameEnvironment {
- INameEnvironment[] classLibs;
- HashtableOfObject compilationUnits = new HashtableOfObject();
-public InMemoryNameEnvironment(String[] compilationUnits, INameEnvironment[] classLibs) {
- this.classLibs = classLibs;
- for (int i = 0, length = compilationUnits.length - 1; i < length; i += 2) {
- String fileName = compilationUnits[i];
- char[] contents = compilationUnits[i + 1].toCharArray();
- String dirName = "";
- int lastSlash = -1;
- if ((lastSlash = fileName.lastIndexOf('/')) != -1) {
- dirName = fileName.substring(0, lastSlash);
- }
- char[] packageName = dirName.replace('/', '.').toCharArray();
- char[] cuName = fileName.substring(lastSlash == -1 ? 0 : lastSlash + 1, fileName.length() - 3).toCharArray(); // remove ".java"
- HashtableOfObject cus = (HashtableOfObject)this.compilationUnits.get(packageName);
- if (cus == null) {
- cus = new HashtableOfObject();
- this.compilationUnits.put(packageName, cus);
- }
- CompilationUnit unit = new CompilationUnit(contents, fileName, null);
- cus.put(cuName, unit);
- }
-}
-public NameEnvironmentAnswer findType(char[][] compoundTypeName, ITypeRequestor requestor) {
- return findType(
- compoundTypeName[compoundTypeName.length - 1],
- CharOperation.subarray(compoundTypeName, 0, compoundTypeName.length - 1),requestor);
-}
-public NameEnvironmentAnswer findBinding(char[] typeName, char[][] packageName, int type, ITypeRequestor requestor, boolean returnMultiple, String excludePath) {
- if ((type&Binding.COMPILATION_UNIT)!=0)
- {
- HashtableOfObject cus = (HashtableOfObject)this.compilationUnits.get(CharOperation.concatWith(packageName, '.'));
- if (cus!=null)
- {
- CompilationUnit unit = (CompilationUnit)cus.get(typeName);
- unit.packageName=packageName;
- if (unit != null)
- return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
-
- }
- }
-
- // HashtableOfObject cus = (HashtableOfObject)this.compilationUnits.get(CharOperation.concatWith(packageName, '.'));
-// if (cus == null) {
- return this.findTypeFromClassLibs(typeName, packageName,type,requestor);
-// }
-// JavaScriptUnit unit = (JavaScriptUnit)cus.get(typeName);
-// if (unit == null) {
-// return this.findTypeFromClassLibs(typeName, packageName,type,requestor);
-// }
-// return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
-}
-
-public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName, ITypeRequestor requestor) {
- return findBinding(typeName, packageName, Binding.TYPE|Binding.PACKAGE,requestor, false, null);
-// HashtableOfObject cus = (HashtableOfObject)this.compilationUnits.get(CharOperation.concatWith(packageName, '.'));
-// if (cus == null) {
-// return this.findTypeFromClassLibs(typeName, packageName);
-// }
-// JavaScriptUnit unit = (JavaScriptUnit)cus.get(typeName);
-// if (unit == null) {
-// return this.findTypeFromClassLibs(typeName, packageName);
-// }
-// return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
-}
-private NameEnvironmentAnswer findTypeFromClassLibs(char[] typeName, char[][] packageName, int type, ITypeRequestor requestor) {
- for (int i = 0; i < this.classLibs.length; i++) {
- NameEnvironmentAnswer answer = this.classLibs[i].findBinding(typeName, packageName, type,requestor, false, null);
- if (answer != null) {
- return answer;
- }
- }
- return null;
-}
-public boolean isPackage(char[][] parentPackageName, char[] packageName) {
- char[] pkg = CharOperation.concatWith(parentPackageName, packageName, '.');
- return
- this.compilationUnits.get(pkg) != null ||
- this.isPackageFromClassLibs(parentPackageName, packageName);
-}
-public boolean isPackageFromClassLibs(char[][] parentPackageName, char[] packageName) {
- for (int i = 0; i < this.classLibs.length; i++) {
- if (this.classLibs[i].isPackage(parentPackageName, packageName)) {
- return true;
- }
- }
- return false;
-}
-public void cleanup() {
- for (int i = 0, max = this.classLibs.length; i < max; i++) {
- this.classLibs[i].cleanup();
- }
- this.compilationUnits = new HashtableOfObject();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferResolveTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferResolveTests.java
deleted file mode 100644
index 5fda3d8..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferResolveTests.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.HashMap;
-
-import org.eclipse.wst.jsdt.core.ast.IExpression;
-import org.eclipse.wst.jsdt.core.ast.IFunctionCall;
-import org.eclipse.wst.jsdt.core.ast.IFunctionExpression;
-import org.eclipse.wst.jsdt.core.ast.IObjectLiteral;
-import org.eclipse.wst.jsdt.core.ast.IObjectLiteralField;
-import org.eclipse.wst.jsdt.core.ast.ISingleNameReference;
-import org.eclipse.wst.jsdt.core.ast.IStringLiteral;
-import org.eclipse.wst.jsdt.core.infer.IInferEngine;
-import org.eclipse.wst.jsdt.core.infer.IInferenceFile;
-import org.eclipse.wst.jsdt.core.infer.InferEngine;
-import org.eclipse.wst.jsdt.core.infer.InferredMethod;
-import org.eclipse.wst.jsdt.core.infer.InferredType;
-import org.eclipse.wst.jsdt.core.infer.InferrenceProvider;
-import org.eclipse.wst.jsdt.core.infer.RefactoringSupport;
-import org.eclipse.wst.jsdt.core.infer.ResolutionConfiguration;
-
-
-public class InferResolveTests extends AbstractRegressionTest {
-
-
- static class InferProvider implements InferrenceProvider
- {
-
- InferEngine inferEngine;
-
-
- public InferProvider(InferEngine inferEngine) {
- this.inferEngine = inferEngine;
- inferEngine.inferenceProvider=this;
- }
-
- public int applysTo(IInferenceFile scriptFile) {
- return InferrenceProvider.MAYBE_THIS;
- }
-
- public String getID() {
- return "dummyID";
- }
-
- public IInferEngine getInferEngine() {
- return inferEngine;
- }
-
- public RefactoringSupport getRefactoringSupport() {
- return null;
- }
-
- public ResolutionConfiguration getResolutionConfiguration() {
- return null;
- }
-
- }
-
- static class TestInferEngine extends InferEngine
- {
-
- static final char[] []ADD_CLASS={"defineClass".toCharArray()};
- static final char[] []ADD_MIXIN={"addMixin".toCharArray()};
-
- protected boolean handleFunctionCall(IFunctionCall functionCall) {
- if (isFunction(functionCall, ADD_CLASS) )
- {
- IExpression[] arguments = functionCall.getArguments();
- if (arguments.length>1 && arguments[0] instanceof IStringLiteral)
- {
- char [] className=getString(arguments[0]);
- InferredType type = addType(className,true);
- type.sourceStart = functionCall.sourceStart();
- type.sourceEnd = functionCall.sourceEnd();
- if (arguments[1] instanceof IObjectLiteral) {
- IObjectLiteral objectLiteral = (IObjectLiteral) arguments[1];
- if (objectLiteral.getFields()!=null)
- for (int i = 0; i < objectLiteral.getFields().length; i++) {
- IObjectLiteralField field=objectLiteral.getFields()[i];
- char[] name = getString(field.getFieldName());
- if (field.getInitializer() instanceof IFunctionExpression)
- {
- IFunctionExpression functionExpression=(IFunctionExpression)field.getInitializer();
-
- InferredMethod method=type.addMethod(name, functionExpression.getMethodDeclaration(),field.getFieldName().sourceStart());
- }
- }
- }
- }
- }
- else if (isFunction(functionCall, ADD_MIXIN) )
- {
- IExpression[] arguments = functionCall.getArguments();
- if (arguments.length>1 )
- {
- char [] className=getString(arguments[0]);
- char [] mixinName=getString(arguments[1]);
- if (className!=null && mixinName!=null)
- {
- InferredType type = findDefinedType(className);
- if (type!=null)
- type.addMixin(mixinName);
- }
-
-
- }
- }
- return true;
- }
-
- private char[] getString(IExpression expression)
- {
- if (expression instanceof IStringLiteral) {
- IStringLiteral strLit = (IStringLiteral) expression;
- return strLit.source();
- }
- else if ((expression instanceof ISingleNameReference))
- {
- ISingleNameReference snr=(ISingleNameReference)expression;
- return snr.getToken();
- }
- return null;
- }
- }
-
- public InferResolveTests(String name) {
- super(name);
- }
-
-
- protected void runNegativeTest(String[] testFiles, InferEngine inferEngine, String expectedProblemLog) {
- HashMap options = new HashMap();
-
- InferEngine[] inferenceEngines = new InferEngine[]
- {
- (InferEngine)new InferProvider(inferEngine).getInferEngine()
-
- };
- options.put(INFERENCE_ENGINES, inferenceEngines);
-
-
-
- runNegativeTest(
- testFiles,
- expectedProblemLog,
- null /* no extra class libraries */,
- true /* flush output directory */,
- options /* no custom options */,
- false /* do not generate output */,
- false /* do not show category */,
- false /* do not show warning token */,
- false /* do not skip javac for this peculiar test */,
- false /* do not perform statements recovery */,
- null);
- }
-
-
- public void test001() {
-
- this.runNegativeTest(
- new String[] {
- "cls.js",
- " function defineClass(name,args){}\n"
- +" function addMixin(toClass,mixinName){}\n"
- +" defineClass(\"MyClass\",\n"
- +" {meth1 : function (){} }\n"
- +" );\n"
- +" addMixin(\"MyClass\",\"myMixin\");\n"
- +"",
- "mix.js",
- " defineClass(\"myMixin\",\n"
- +" {mixinFunc : function (){} }\n"
- +" );\n"
- +"",
- "use.js",
- " var v=new MyClass();\n"
- +" v.mixinFunc();\n"
- +"",
- },
- new TestInferEngine(),
- ""
- );
-
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java
deleted file mode 100644
index 1d0c9a2..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java
+++ /dev/null
@@ -1,948 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import org.eclipse.wst.jsdt.core.infer.InferOptions;
-import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
-
-public class InferTypesTests extends AbstractRegressionTest {
-
- public InferTypesTests(String name) {
- super(name);
-
- }
-
- private InferOptions getDefaultOptions()
- {
- InferOptions inferOptions=new InferOptions();
- inferOptions.setDefaultOptions();
- return inferOptions;
- }
-
-
- public void test001() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function MyClass() {\n"+
- " this.url = \"\";\n"+
- " this.activate = function(){}\n"+
- "}\n"+
- "var myClassObj = new MyClass();\n"+
- "\n",
- "X.js",
- "class MyClass extends Object{\n String url;\n void activate()\n MyClass()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- public void test002() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "Shape.prototype.GetArea = Shape_GetArea;"+
- "function Shape(){}"+
- "function Shape_GetArea()"+
- "{"+
- " var area = 5;"+
- "return area;"+
- "}",
- "X.js",
- "class Shape extends Object{\n Number GetArea()\n Shape()\n}\n",
- getDefaultOptions()
-
- );
- }
- public void test003() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "Shape.prototype.GetArea = function(a){};"+
- "function Shape(){}\n"+
- "",
- "X.js",
- "class Shape extends Object{\n void GetArea(a)\n Shape()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test004() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "Shape.prototype.GetArea = Shape_GetArea;"+
- "function Shape(){}"+
- "function Shape_GetArea()"+
- "{"+
- "return this.area;"+
- "}"+
- "Circle.prototype = new Shape();"+
- "Circle.prototype.constructor = Circle;"+
- "Circle.prototype.GetArea = Circle_GetArea;"+
- "function Circle_GetArea()"+
- "{"+
- "}",
- "X.js",
- "class Shape extends Object{\n ?? GetArea()\n Shape()\n}\n"+
- "class Circle extends Shape{\n ?? constructor;\n void GetArea()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- /*
- * This test setting members using the this.
- *
- * The InferEngine will no be able to tell the types of the members... there is no information
- * provided.
- */
- public void test010() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Bob(firstname, lastname) {\n" +
- " this.Firstname = firstname;\n" +
- " this.Lastname = lastname;\n" +
- "}\n" +
- "Bob.prototype.name = function () {return this.Firstname + this.Lastname;};\n",
- "X.js",
- "class Bob extends Object{\n ?? Firstname;\n ?? Lastname;\n ?? name()\n Bob(firstname, lastname)\n}\n",
- getDefaultOptions()
-
- );
- }
- public void test011() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function X() {\n"
- + " this.h=1;\n"
- + " this.i=[];\n"
- + "}\n"
- + "function X_foo() {\n"
- + "}\n"
- + "X.prototype.foo=X_foo;\n"
- + "",
- "X.js",
- "class X extends Object{\n Number h;\n Array i;\n void foo()\n X()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test011b() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "P.prototype=new Object();\n"
- + "P.prototype.f=1;\n"
- + "function P(){}\n"
- + "function a(){}\n"
- + "function m() {\n"
- + " this.f++;\n"
- + " var p= new P();\n"
- + " a();"
- + "}\n"
- + "P.prototype.mm=m;\n",
- "X.js",
- "class P extends Object{\n Number f;\n void mm()\n P()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test012() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "Test.prototype=new Object();\n"
- + "Test.x=1;\n"
- + "",
- "X.js",
- "class Test extends Object{\n static Number x;\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- public void test013() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function MyClass() {\n"+
- " this.arr = [1];\n"+
- "}\n"+
- "var myClassObj = new MyClass();\n"+
- "\n",
- "X.js",
- "class MyClass extends Object{\n Array(Number) arr;\n MyClass()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
-
- public void test020() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var foo;\n"+
- " foo.onMouseDown = function () { return 1; };\n"+
- "\n",
- "X.js",
- "class ___foo0 extends Object{\n static Number onMouseDown()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
-
- public void test040() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "/**\n"
- + " * @constructor \n"
- + " */\n"
- +"function MyClass(){}"
- + "/**\n"
- + " * @memberOf MyClass \n"
- + " * @type String \n"
- + " */\n"
- +"var s;"
- + "/**\n"
- + " * @memberOf MyClass \n"
- + " * @type Number \n"
- + " */\n"
- +"function numValue(){};"
- +"\n",
- "X.js",
- "class MyClass extends Object{\n String s;\n MyClass()\n Number numValue()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
-
-
-
- public void test041() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- " i= { \n"+
- "/**\n" +
- " * @memberOf MyClass\n" +
- " * @type Number\n" +
- " */\n" +
- " a: 2 ,\n"+
- "/**\n" +
- " * @memberOf MyClass\n" +
- " * @type String\n" +
- " */\n" +
- " b: function(){}};" +
- "\n",
- "X.js",
- "class MyClass extends Object{\n Number a;\n String b()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- public void test042() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "/**\n"
- + " * @constructor \n"
- + " * @extends String \n"
- + " */\n"
- +"function MyClass(){}"
-
- +"MyClass.prototype = { \n"+
- "/**\n" +
- " * @memberOf MyClass\n" +
- " * @type Number\n" +
- " */\n" +
- " a: 2 ,\n"+
- "/**\n" +
- " * @memberOf MyClass\n" +
- " * @type String\n" +
- " */\n" +
- " b: function(){}};" +
- "\n",
- "X.js",
- "class MyClass extends String{\n Number a;\n MyClass()\n String b()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- public void test043() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "/**\n"
- + " * @constructor \n"
- + " */\n"
- +"function MyClass(){}"
- + "/**\n"
- + " * @memberOf MyClass \n"
- + " * @param {Number} p1\n"
- + " * @type String \n"
- + " */\n"
- +"function foo(p1){};"
- +"\n",
- "X.js",
- "class MyClass extends Object{\n MyClass()\n String foo(Number p1)\n}\n",
- getDefaultOptions()
- );
- }
-
- public void test060() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "Shape.prototype.GetArea = Shape_GetArea;"+
- "function Shape_GetArea()"+
- "{"+
- " var str=\"\";"+
- "return str;"+
- "}",
- "X.js",
- "class Shape extends Object{\n String GetArea()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * Test Object literal local variable declaration
- */
- public void test061() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var foo = {"+
- " bar: \"bar\","+
- " bar2: function(){}"+
- "}",
- "X.js",
- "class ___anonymous10_44 extends Object{\n String bar;\n void bar2()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * Test Object literal assignment
- */
- public void test062() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var foo;"+
- "foo = {"+
- " bar: \"bar\","+
- " bar2: function(){}"+
- "}",
- "X.js",
- "class ___anonymous14_48 extends Object{\n String bar;\n void bar2()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * Test nested Object literals
- */
- public void test063() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var foo = {"+
- " bar: \"bar\","+
- " bar2: {" +
- " bar3: \"bar3\"" +
- " }"+
- "}",
- "X.js",
- "class ___anonymous10_52 extends Object{\n String bar;\n ___anonymous32_51 bar2;\n}\n"+
- "class ___anonymous32_51 extends Object{\n String bar3;\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * Runtime simple member assignment to Object literal
- */
- public void test064() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var ns = {};" +
- "ns.foo = \"\";" +
- "ns.bar = function(){" +
- " return \"\";" +
- "}",
- "X.js",
- "class ___anonymous9_10 extends Object{\n String foo;\n String bar()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * Runtime complex member (setting to an Object literal) asignment to Object literal
- */
- public void test065() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var ns = {};"+
- "ns.foo = {" +
- " bar: \"\""+
- "};",
- "X.js",
- "class ___anonymous9_10 extends Object{\n ___anonymous21_31 foo;\n}\n"+
- "class ___anonymous21_31 extends Object{\n String bar;\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * Assign Object Literal to prototype
- */
- public void test066() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function foo(){"+
- "};"+
- "foo.prototype = {"+
- " bar: \"\""+
- "}",
- "X.js",
- "class foo extends Object{\n String bar;\n foo()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * Assign Object Literal to a prototype member
- */
- public void test067() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function foo(){"+
- "};"+
- "foo.prototype.bar = {"+
- " bar2: \"\""+
- "}",
- "X.js",
- "class foo extends Object{\n ___anonymous37_48 bar;\n foo()\n}\n"+
- "class ___anonymous37_48 extends Object{\n String bar2;\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * namespaced type (new "class" nested inside an Object Literal)
- */
- public void test068() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var ns = {};"+
- "ns.foo = function(){" +
- "};" +
- "ns.foo.prototype.bar = \"\";" +
- "ns.foo.prototype.bar2 = function(){" +
- " return \"\";" +
- "}",
- "X.js",
- "class ___anonymous9_10 extends Object{\n void foo()\n}\n"+
- "class ns.foo extends Object{\n String bar;\n String bar2()\n ns.foo()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test068b() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var ns = {};"+
- "ns.foo = function(){};" +
- "function abc(){};" +
- "ns.foo2 = abc;" +
- "",
- "X.js",
- "class ___anonymous9_10 extends Object{\n void foo()\n void foo2()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test068c() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var ns = {};"+
- "ns.foo = function(){};" +
- "ns.foo2 = ns.foo;" +
- "",
- "X.js",
- "class ___anonymous9_10 extends Object{\n void foo()\n void foo2()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /**
- * namespaced type (new "class" nested inside an Object Literal)
- */
- public void test069() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var ns1 = {" +
- " ns2: {}" +
- "};"+
- "ns1.ns2.foo = function(){" +
- "};" +
- "ns1.ns2.foo.prototype.bar = \"\";" +
- "ns1.ns2.foo.prototype.bar2 = function(){" +
- " return \"\";" +
- "}",
- "X.js",
- "class ___anonymous10_20 extends Object{\n ___anonymous18_19 ns2;\n}\n"+
- "class ___anonymous18_19 extends Object{\n void foo()\n}\n"+
- "class ns1.ns2.foo extends Object{\n String bar;\n String bar2()\n ns1.ns2.foo()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /*
- * Test a potential problem with anonymous and members when returning an {} from a member
- */
- public void test070() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var foo = {" +
- " a: \"\"," +
- " b: function(){" +
- " return \"\";" +
- " }"+
- "};" +
- "foo.c = \"\";" +
- "foo.d = function(x, y, z) {" +
- " return { x : \"\", y : \"\", z : \"\" };" +
- "};",
- "X.js",
- "class ___anonymous10_52 extends Object{\n String a;\n String c;\n String b()\n ___anonymous101_126 d(x, y, z)\n}\n"+
- "class ___anonymous101_126 extends Object{\n String x;\n String y;\n String z;\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test071() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "if( true ){" +
- " var foo = {};" +
- "}" +
- "foo.bar = \"\"",
- "X.js",
- "class ___anonymous23_24 extends Object{\n String bar;\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /*
- * Object literal within a function as return (need to prevent duplicates)
- */
- public void test072() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var foo = function(){" +
- " return {" +
- " x: \"\"," +
- " y: \"\"" +
- " }" +
- "};",
- "X.js",
- "class ___anonymous29_46 extends Object{\n String x;\n String y;\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /*
- * Object literal within a function (not a return
- */
- public void test073() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var foo = function(){" +
- " var bar = {" +
- " x: \"\"," +
- " y: \"\"" +
- " }" +
- "};",
- "X.js",
- "class ___anonymous32_49 extends Object{\n String x;\n String y;\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test074() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "/**\n" +
- " * Object Node()\n" +
- " * @super Object\n" +
- " * @constructor\n" +
- " * @class Node\n" +
- " * @since Standard ECMA-262 3rd. Edition\n" +
- " * @since Level 2 Document Object Model Core Definition.\n" +
- " * @link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n" +
- " */\n" +
- "function Node(){};\n" +
- "/**\n" +
- " * Property firstChild\n" +
- " * @type Node\n" +
- " * @class Node\n" +
- " * @see Node\n" +
- "\n" +
- " * @since Standard ECMA-262 3rd. Edition\n" +
- " * @since Level 2 Document Object Model Core Definition.\n" +
- " * @link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n" +
- " */\n" +
- "Node.prototype.firstChild=new Node();\n" +
- "/**\n" +
- " * function insertBefore(newChild, refChild)\n" +
- " * @type Node\n" +
- " * @class Node\n" +
- " * @param newChilds Node\n" +
- " * @param refChild Node\n" +
- " * @return Node\n" +
- " * @throws DOMException\n" +
- " * @see Node\n" +
- " * @since Standard ECMA-262 3rd. Edition\n" +
- " * @since Level 2 Document Object Model Core Definition.\n" +
- " * @link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n" +
- " */\n" +
- "Node.prototype.insertBefore = function(newChild, refChild){};\n",
- "X.js",
- "class Node extends Object{\n Node firstChild;\n Node()\n Node insertBefore(newChild, refChild)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- /*
- * Static member check
- */
- public void test075() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var x = function(){};" +
- "x.prototype = {};" +
- "x.foo = \"\";" +
- "x.bar = function(){" +
- " return \"\";" +
- "}",
- "X.js",
- "class x extends Object{\n static String foo;\n static String bar()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- /*
- * only statics
- */
- public void test075b() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function x(){};" +
- "x.foo = \"\";" +
- "x.bar = function(){" +
- " return \"\";" +
- "}",
- "X.js",
- "class x extends Object{\n static String foo;\n static String bar()\n x()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
-
- /*
- * Global Object mixin
- */
- public void test080() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "(function(){" +
- "this.someField = 1;" +
- "})();" ,
- "X.js",
- "class Global extends Object{\n Number someField;\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- /*
- * Static member on built-in
- */
- public void test081() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "String.foo = \"\";" +
- "String.bar = function(){" +
- " return \"\";" +
- "}",
- "X.js",
- "class String extends Object{\n static String foo;\n static String bar()\n}\n",
- getDefaultOptions()
-
- );
- }
-
-
- public void test082() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "String.foo = \"\";" +
- "String.bar1 = String.bar2 = function(){" +
- " return \"\";" +
- "}",
- "X.js",
- "class String extends Object{\n static String foo;\n static String bar1()\n static String bar2()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test083() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Car() {" +
- " this.color = 'red';" +
- " this.Move = function() { return \"I'm moving\"; };" +
- "};" +
- "Car.Stop = function() { return \"I'm not moving\"; };" +
- "Car.engine = 'diesel';" +
- "",
- "X.js",
- "class Car extends Object{\n String color;\n static String engine;\n String Move()\n static String Stop()\n Car()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- // test type infered from function with 'this' assignments
- public void test084() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Car() {" +
- " this.color = 'red';" +
- " this.Move = function() { return \"I'm moving\"; };" +
- "};" +
- "",
- "X.js",
- "class Car extends Object{\n String color;\n String Move()\n Car()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test085() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = l;" +
- " this.width = w;" +
- "}",
- "X.js",
- "class Shape extends Object{\n ?? length;\n ?? width;\n Shape(l, w)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test086() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = l;" +
- " this.width = w;" +
- " return this.length * this.width;" +
- "}",
- "X.js",
- "class Shape extends Object{\n ?? length;\n ?? width;\n Shape(l, w)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test087() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = l;" +
- " this.width = w;" +
- "}" +
- "var s = new Shape(2, 3);" +
- "s.area = function() {return this.length * this.width;};",
- "X.js",
- "class Shape extends Object{\n ?? length;\n ?? width;\n Shape(l, w)\n}\n" +
- "class ___s0 extends Shape{\n Number area()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test088() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = l;" +
- " this.width = w;" +
- " this.area = function() {return this.length * this.width;};" +
- "}",
- "X.js",
- "class Shape extends Object{\n ?? length;\n ?? width;\n Number area()\n Shape(l, w)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test089() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = l;" +
- " this.width = w;" +
- "}" +
- "Shape.prototype.area = function() {return this.length * this.width;};",
- "X.js",
- "class Shape extends Object{\n ?? length;\n ?? width;\n Number area()\n Shape(l, w)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test090() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = l;" +
- " this.width = w;" +
- "}" +
- "Shape.CONSTANT = 3;",
- "X.js",
- "class Shape extends Object{\n ?? length;\n ?? width;\n static Number CONSTANT;\n Shape(l, w)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test091() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Round(r){" +
- " this.rad = r;" +
- "}" +
- "Round.PI = 3.14;" +
- "Round.prototype.area = function() {return Round.PI * this.rad * this.rad;};" +
- "Round.equal = function(a, b) {" +
- "if(a == b) return true;" +
- "return false;" +
- "};",
- "X.js",
- "class Round extends Object{\n ?? rad;\n static Number PI;\n Number area()\n static Boolean equal(a, b)\n Round(r)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test092() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Com(r, i){" +
- " this.r1 = r;" +
- " this.i1 = i;" +
- "}" +
- "Com.prototype.meth1 = function() {return 1;};" +
- "Com.prototype.meth2 = function() {return new Com(1, 2);};" +
- "Com.prototype.meth3 = function(that) {return new Com(that+1, that-1);};" +
- "Com.prototype.toString = function() {return \"hi\"};" +
- "Com.classMeth1 = function(a, b) {return new Com(a, b);};" +
- "Com.classMeth2 = function(a, b) {return new Com(a, b);};" +
- "Com.ZERO = new Com(0,0);" +
- "Com.ONE = new Com(1,0);",
- "X.js",
- "class Com extends Object{\n ?? r1;\n ?? i1;\n static Com ZERO;\n static Com ONE;\n" +
- " Number meth1()\n Com meth2()\n Com meth3(that)\n String toString()\n static Com classMeth1(a, b)\n static Com classMeth2(a, b)\n Com(r, i)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test093() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = function() {return l;};" +
- " this.width = function() {return w;};" +
- "}" +
- "Shape.prototype.perimeter = function() {return (this.length * 2) + (this.width * 2);};",
- "X.js",
- "class Shape extends Object{\n ?? length()\n ?? width()\n Number perimeter()\n Shape(l, w)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test094() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Shape(l, w){" +
- " this.length = l;" +
- " this.width = w;" +
- "}" +
- "Shape.prototype.area = function() {return this.length * this.width;};" +
- "function SubShape(l, w, x) {" +
- "Shape.call(this, l, w);" +
- "this.x = y;" +
- "}" +
- "SubShape.prototype = new Shape();" +
- "SubShape.prototype.meth = function() {return 1};",
- "X.js",
- "class Shape extends Object{\n ?? length;\n ?? width;\n Number area()\n Shape(l, w)\n}\n" +
- "class SubShape extends Shape{\n ?? x;\n Number meth()\n SubShape(l, w, x)\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test095() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Abc(){" +
- " this.mult = function(a, b){return a * b;};" +
- " this.div = function(a, b){return a / b;};" +
- " this.rem = function(a, b){return a % b;};" +
- " this.sub = function(a, b){return a - b;};" +
- "}",
- "X.js",
- "class Abc extends Object{\n Number mult(a, b)\n Number div(a, b)\n Number rem(a, b)\n Number sub(a, b)\n Abc()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test096() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Plus(){" +
- " this.strings = function(){return \"a\" + \"b\";};" +
- " this.oneStringOneNumber = function(){return \"a\" + 1;};" +
- " this.oneStringOneNumber2 = function(){return \"3\" + 1;};" +
- " this.numbers = function(){return 1 + 2;};" +
- " this.unknownString = function(a){return a + \"b\";};" +
- " this.unknownNumber = function(a){return a + 3;};" +
- " this.unknownUnknown = function(a, b){return a + b;};" +
- "}",
- "X.js",
- "class Plus extends Object{\n String strings()\n String oneStringOneNumber()\n String oneStringOneNumber2()\n " +
- "Number numbers()\n String unknownString(a)\n ?? unknownNumber(a)\n ?? unknownUnknown(a, b)\n Plus()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void test097() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "function Equality(){" +
- " this.equalsEquals = function(){return \"a\" == \"b\";};" +
- " this.equalsEqualsEquals = function(){return \"a\" === \"b\";};" +
- " this.notEquals = function(){return \"a\" != \"b\";};" +
- " this.notEqualsEquals = function(){return \"a\" !== \"b\";};" +
- "}",
- "X.js",
- "class Equality extends Object{\n Boolean equalsEquals()\n Boolean equalsEqualsEquals()\n Boolean notEquals()\n Boolean notEqualsEquals()\n Equality()\n}\n",
- getDefaultOptions()
-
- );
- }
-
- public void testBUG286010() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "var MyFunc = function () {};\n" +
- "MyFunc.myMeth = function () {};",
- "X.js",
- "class MyFunc extends Function{\n static void myMeth()\n}\n",
- getDefaultOptions()
-
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java
deleted file mode 100644
index 8edf0b5..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java
+++ /dev/null
@@ -1,5692 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.io.File;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class InnerEmulationTest extends AbstractRegressionTest {
-static {
-// TESTS_NAMES = new String[] { "Bug58069" };
-// TESTS_NUMBERS = new int[] { 144 };
-// TESTS_RANGE = new int[] { 144, -1 };
-}
-public InnerEmulationTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-/**
- * Protected access emulation : should be performed onto implicit field and method accesses
- */
-public void test001() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "import p2.*; \n"+
- "public class A { \n"+
- " protected int value = 0; \n"+
- " protected A delegatee; \n"+
- " public A(A del, int val) { \n"+
- " this.delegatee = del; \n"+
- " this.value = val; \n"+
- " } \n"+
- " protected void foo() { \n"+
- " value += 3; \n"+
- " } \n"+
- " public static void main(String[] argv){ \n"+
- " int result = new B( \n"+
- " new B(null, 10), 20) \n"+
- " .value; \n"+
- " int expected = 30; \n"+
- " System.out.println( \n"+
- " result == expected \n"+
- " ? \"SUCCESS\" \n"+
- " : \"FAILED : got \"+result+\" instead of \"+ expected); \n"+
- " } \n"+
- "} \n",
- /* p2.B */
- "p2/B.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class B extends A { \n"+
- " public B(B del, int val){ \n"+
- " super(del, val); \n"+
- " Runnable r = new Runnable () { \n"+
- " public void run() { \n"+
- " foo(); \n"+
- " if (delegatee != null) \n"+
- " value += 7; \n"+
- " } \n"+
- " }; \n"+
- " r.run(); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1FN4S4Z: The compiler doesn't detect a illegal constructor invocation which leads to a VerifyError
- */
-public void test002() {
- this.runNegativeTest(
- new String[] {
- /* A.java */
- "A.java",
- "class B { \n"+
- "} \n"+
- "public class A { \n"+
- " B b; \n"+
- " class C extends B { \n"+
- " public C() { \n"+
- " } \n"+
- " } \n"+
- " public A() { \n"+
- " this(new C()); \n"+
- " } \n"+
- " public A(C c) { \n"+
- " this.b = c; \n"+
- " } \n"+
- " public static void main(String[] args) { \n"+
- " A a = new A(); \n"+
- " System.out.println(a); \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 10)\n" +
- " this(new C()); \n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type A is available due to some intermediate constructor invocation\n" +
- "----------\n"
-
- );
-}
-/**
- * 1FZ2G7R: use of non static inner class in constuctor
- */
-public void test003() {
- this.runNegativeTest(
- new String[] {
- /* A.java */
- "A.java",
- "public class A extends Thread { \n" +
- " private class B { \n" +
- " } \n" +
- " private static Runnable getRunnable() { \n" +
- " return null; \n" +
- " } \n" +
- " public A() { \n" +
- " super(getRunnable(), new B().toString()); \n" +
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 8)\n" +
- " super(getRunnable(), new B().toString()); \n" +
- " ^^^^^^^\n" +
- "Access to enclosing constructor A.B() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 8)\n" +
- " super(getRunnable(), new B().toString()); \n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type A is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-/**
- * 1F995V9: Walkback in innerclass emulation when mixing source and binaries
- */
-public void test004() {
-
-
- /* first compile A3.java */
-
- this.runConformTest(
- new String[] {
- /* A3.java */
- "A3.java",
- "class A3 { \n"+
- " class B {} \n"+
- "} \n"
- },
- null,
- null); // no specific success output string
-
- /* then compile with previous input */
-
- this.runConformTest(
- new String[] {
- /* A4.java */
- "A4.java",
- "class A4 { \n"+
- " void foo(){ \n"+
- " new A3().new B(){}; \n"+
- " } \n"+
- "} \n"
- },
- null, // no specific success output string
- null, // use default class-path
- false,
- null); // do not flush previous output dir content
-
-}
-/**
- * 1FK9ALJ: Cannot invoke private super constructor ...
- */
-public void test005() {
- this.runConformTest(
- new String[] {
- /* X.java */
- "X.java",
- "public class X { \n"+
- " private X(){} \n"+
- " class Y extends X { \n"+
- " } \n"+
- " public static void main(String[] argv){ \n"+
- " new X().new Y(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1FKLXDL: Verification error due to incorrect private access emulation
- */
-public void test006() {
- this.runConformTest(
- new String[] {
- /* X.java */
- "X.java",
- "public class X { \n"+
- " public static void main(String[] argv){ \n"+
- " new B(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " private static void foo(int i, int j) { \n"+
- " System.out.println(\"private foo\"); \n"+
- " } \n"+
- " static class B { \n"+
- " { \n"+
- " foo(1, 2); \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "private foo\n" +
- "SUCCESS"
- );
-}
-/**
- * 1PQCT5T: Missing emulation for access to sibling local types
- */
-public void test007() {
- this.runConformTest(
- new String[] {
- /* Y.java */
- "Y.java",
- "public class Y { \n" +
- " public static void main(String[] argv){ \n" +
- " if (new Y().bar() == 3) \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " else \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } \n" +
- " int bar() { \n" +
- " final int i = \"xxx\".length(); \n" +
- " class X { \n" +
- " class AX { \n" +
- " int foo() { \n" +
- " return new BX().foo(); \n" +
- " } \n" +
- " } \n" +
- " class BX { \n" +
- " int foo() { \n" +
- " return new CX().foo(); \n" +
- " } \n" +
- " } \n" +
- " class CX { \n" +
- " int foo() { \n" +
- " return i; \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- " return new X().new AX().foo(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1PQCT5T: Missing emulation for access to sibling local types
- */
-public void test008() {
- this.runConformTest(
- new String[] {
- /* Y2.java */
- "Y2.java",
- "public class Y2 { \n" +
- " public static void main(String[] argv){ \n" +
- " if (new Y2().foo(45) == 45) \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " else \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } \n" +
- " int foo(final int i){ \n"+
- " class B { \n"+
- " int foo(){ \n"+
- " return new C().foo(); \n"+
- " } \n"+
- " class C { \n"+
- " int foo(){ return i; } \n"+
- " } \n"+
- " }; \n"+
- " return new B().foo(); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1PQCT5T: Missing emulation for access to sibling local types
- */
-public void test009() {
- this.runConformTest(
- new String[] {
- /* Y3.java */
- "Y3.java",
- "public class Y3 { \n" +
- " public static void main(String[] argv){ \n" +
- " if (new Y3().bar() == 8) \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " else \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } \n" +
- " int bar() { \n" +
- " final int i = \"xxx\".length(); \n" +
- " final String s = this.toString(); \n" +
- " class X { \n" +
- " class AX { \n" +
- " int foo() { \n" +
- " return i + new CX().foo(); \n" +
- " } \n" +
- " } \n" +
- " class BX { \n" +
- " int foo() { \n" +
- " return new AX().foo(); \n" +
- " } \n" +
- " } \n" +
- " class CX { \n" +
- " int foo() { \n" +
- " return 5; \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- " return new X().new AX().foo(); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1PQCT5T: Missing emulation for access to sibling local types
- */
-public void test010() {
- this.runConformTest(
- new String[] {
- /* Y4.java */
- "Y4.java",
- "public class Y4 { \n" +
- " public static void main(String[] argv){ \n" +
- " if (new Y4().bar() == 3) \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " else \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } \n" +
- " int bar() { \n" +
- " final int i = \"xxx\".length(); \n" +
- " final String s = this.toString(); \n" +
- " class X { \n" +
- " class AX { \n" +
- " int bar() { \n" +
- " class BX { \n" +
- " int foo() { \n" +
- " return new AX().foo(); \n" +
- " } \n" +
- " } \n" +
- " return new BX().foo(); \n" +
- " } \n" +
- " int foo() { \n" +
- " return i; \n" +
- " } \n" +
- " } \n" +
- " } \n" +
- " return new X().new AX().bar(); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1PQCT5T: Missing emulation for access to sibling local types
- */
-public void test011() {
- this.runConformTest(
- new String[] {
- /* Y5.java */
- "Y5.java",
- "public class Y5 { \n" +
- " public static void main(String[] argv){ \n" +
- " if (new Y5().bar(5) == 5) \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " else \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } \n" +
- " int bar(final int i) { \n" +
- " class X { \n" +
- " int bar() { \n" +
- " return new Object(){ \n" +
- " int foo(){ \n" +
- " return i; \n" +
- " } \n" +
- " }.foo(); \n" +
- " } \n" +
- " } \n" +
- " return new X().bar(); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1F3AH7N: GPF on innerclass emulation for double anonymous type
- */
-public void test012() {
- this.runConformTest(
- new String[] {
- /* A.java */
- "A.java",
- "public class A { \n" +
- " public static void main(String[] argv){ \n" +
- " if (new A().foo() == 5) \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " else \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } \n" +
- " int foo() { \n" +
- " return new A() { \n" +
- " int foo() { \n" +
- " final int i = \"hello\".length(); \n" +
- " return new A() { \n" +
- " int foo() { \n" +
- " return i; \n" +
- " } \n" +
- " } \n" +
- " .foo(); \n" +
- " } \n" +
- " } \n" +
- " .foo(); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1F26XE2: Bug in inner class emulation
- */
-public void test013() {
- this.runConformTest(
- new String[] {
- /* Inner.java */
- "Inner.java",
- "public class Inner { \n" +
- " public static void main(String[] argv){ \n" +
- " new B().new C(\"hello\"); \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " class A { \n"+
- " public A(String s){ this.s=s; } \n"+
- " String s; \n"+
- " } \n"+
- "} \n"+
- "class B { \n"+
- " class C extends Inner.A { \n"+
- " public C(String s){ B.this.inner.super(s); } \n"+
- " } \n"+
- " Inner inner=new Inner(); \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1EX5I8Z: Inner class emulation bug
- */
-public void test014() {
- this.runConformTest(
- new String[] {
- /* Z1.java */
- "Z1.java",
- "public class Z1 { \n" +
- " public static void main(String[] argv){ \n" +
- " new Z1().new W(); \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " class W extends Y { \n" +
- " W() { \n" +
- " super(new Object(), foo()); \n" +
- " } \n" +
- " } \n" +
- " String foo() { \n" +
- " return \"\"; \n" +
- " } \n" +
- "} \n" +
- "class Y { \n" +
- " Y(Object o, String s) { \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * 1EUC39Y: Incorrect Synthetic Emulation
- */
-public void test015() {
- this.runConformTest(
- new String[] {
- /* AAA.java */
- "AAA.java",
- "public class AAA { \n"+
- " public static void main(String argv[]){ \n"+
- " if (new AAA().foo(5) == 15); \n"+
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n"+
- " int foo(final int loc){ \n"+
- " class I { \n"+
- " int i = loc; \n"+
- " { \n"+
- " System.out.println(\"loc=\"+ loc ); \n"+
- " } \n"+
- " int foo(){ \n"+
- " System.out.println(\"I:i=\"+ i ); \n"+
- " return i;} \n"+
- " } \n"+
- " class J extends I { \n"+
- " I obj = new I(){ \n"+
- " int foo() { \n"+
- " System.out.println(\"J\"); \n"+
- " return super.foo() + 10; }}; \n"+
- " } \n"+
- " return new J().obj.foo(); \n"+
- " } \n"+
- " } \n"
- },
- "loc=5\n" +
- "loc=5\n" +
- "J\n" +
- "I:i=5\n" +
- "SUCCESS"
- );
-}
-/**
- * 1EUC39Y: Incorrect Synthetic Emulation
- */
-public void test016() {
- this.runConformTest(
- new String[] {
- /* AAA.java */
- "AAA.java",
- "public class AAA { \n"+
- " public static void main(String argv[]){ \n"+
- " if (new AAA().foo(5) == 15); \n"+
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n"+
- " class B{} \n"+
- " int foo(final int loc){ \n"+
- " class I extends B { \n"+
- " int i = loc; \n"+
- " { \n"+
- " System.out.println(\"loc=\"+ loc ); \n"+
- " } \n"+
- " int foo(){ \n"+
- " System.out.println(\"I:i=\"+ i ); \n"+
- " return i;} \n"+
- " } \n"+
- " class J extends I { \n"+
- " I obj = new I(){ \n"+
- " int foo() { \n"+
- " System.out.println(\"J\"); \n"+
- " return super.foo() + 10; }}; \n"+
- " } \n"+
- " return new J().obj.foo(); \n"+
- " } \n"+
- " } \n"
- },
- "loc=5\n" +
- "loc=5\n" +
- "J\n" +
- "I:i=5\n" +
- "SUCCESS"
- );
-}
-/**
- * Complex multi-threaded test involving inner classes
- */
-public void test017() {
- this.runConformTest(
- new String[] {
- /* MultiComplex.java */
- "MultiComplex.java",
- "public class MultiComplex {\n" +
- " // should just be an interface, once supported...\n" +
- " abstract class AbstractTask implements Runnable {\n" +
- " public void run() {\n" +
- " MultiComplex.this.notifyCompletion(this,0); \n" +
- " }\n" +
- " abstract public String taskName(); \n" +
- " }\n" +
- " public static void main(String argv[]){\n" +
- " try {\n" +
- " new MultiComplex().performTasks(3);\n" +
- " }\n" +
- " catch(InterruptedException e){};\n" +
- " } \n" +
- " void notifyCompleted(AbstractTask task) {\n" +
- " }\n" +
- " void notifyCompletion(AbstractTask task, int percentage) {\n" +
- " }\n" +
- " void notifyExecutionEnd() {\n" +
- " System.out.println(\"EXECUTION FINISHED\");\n" +
- " }\n" +
- " void notifyExecutionStart() {\n" +
- " System.out.println(\"EXECUTION STARTING\");\n" +
- " }\n" +
- " void performTasks(final int maxTasks) throws InterruptedException {\n" +
- " Thread workers[] = new Thread[maxTasks];\n" +
- " AbstractTask tasks[] = new AbstractTask[maxTasks];\n" +
- " final int maxIteration = 5;\n" +
- " \n" +
- " // Local Task \n" +
- " class Task extends AbstractTask { \n" +
- " String taskName; \n" +
- " Task(String aName) {\n" +
- " taskName = aName;\n" +
- " }\n" +
- " public String taskName() { \n" +
- " return taskName; \n" +
- " }\n" +
- " \n" +
- " public void run() {\n" +
- " super.run();\n" +
- " for(int j = 0; j < maxIteration; j++)\n" +
- " MultiComplex.this.notifyCompletion(this, (int)((float) (j + 1) / maxIteration * 100));\n" +
- " }\n" +
- " };\n" +
- " notifyExecutionStart();\n" +
- " \n" +
- " // Creating and launching the tasks\n" +
- " for (int ii = 0; ii < maxTasks; ii++) {\n" +
- " final int i = ii;\n" +
- " tasks[i] = new Task(String.valueOf(i + 1)) { \n" +
- " public String taskName() { \n" +
- " return super.taskName() + \" of \" + maxTasks; }\n" +
- " public void run() {\n" +
- " super.run();\n" +
- " MultiComplex.this.notifyCompleted(this);\n" +
- " } \n" +
- " };\n" +
- " workers[i] = new Thread(tasks[i],tasks[i].taskName());\n" +
- " workers[i].start();\n" +
- " }\n" +
- " // Waiting for *all* tasks to be ended\n" +
- " for (int i = 0; i < tasks.length; i++)\n" +
- " workers[i].join();\n" +
- " notifyExecutionEnd();\n" +
- " }\n" +
- "}\n"
- },
- "EXECUTION STARTING\n" +
- "EXECUTION FINISHED"
- );
-}
-/**
- * Complex multi-threaded test involving inner classes
- */
-public void test018() {
- this.runConformTest(
- new String[] {
- /* MultiAnonymous.java */
- "MultiAnonymous.java",
- "public class MultiAnonymous {\n" +
- " public static void main(String argv[]){\n" +
- " try {\n" +
- " new MultiAnonymous().performTasks(3);\n" +
- " }\n" +
- " catch(InterruptedException e){};\n" +
- " }\n" +
- " void notifyExecutionEnd() {\n" +
- " System.out.println(\"EXECUTION FINISHED\");\n" +
- " }\n" +
- " void notifyExecutionStart() {\n" +
- " System.out.println(\"EXECUTION STARTING\");\n" +
- " }\n" +
- " void performTasks(final int maxTasks) throws java.lang.InterruptedException {\n" +
- " Thread workers[] = new Thread[maxTasks];\n" +
- " Runnable tasks[] = new Runnable[maxTasks];\n" +
- " final int maxIteration = 5;\n" +
- " notifyExecutionStart();\n" +
- " \n" +
- " // Creating and launching the tasks\n" +
- " for (int ii = 0; ii < maxTasks; ii++) {\n" +
- " final int i = ii;\n" +
- " tasks[i] = new Runnable() { \n" +
- " public String toString() { return ((i + 1) + \" of \" + maxTasks); }\n" +
- " public void run() {\n" +
- " for(int j = 0; j < maxIteration; j++)\n" +
- " notifyCompletion( (int)((float) (j + 1) / maxIteration * 100));\n" +
- " } \n" +
- " \n" +
- " void notifyCompletion(int percentage) {\n" +
- " }\n" +
- " };\n" +
- " workers[i] = new Thread(tasks[i],\"Running task(\"+(tasks[i].toString())+\")\");\n" +
- " workers[i].start();\n" +
- " }\n" +
- " // Waiting for *all* tasks to be ended\n" +
- " for (int i = 0; i < tasks.length; i++)\n" +
- " workers[i].join();\n" +
- " notifyExecutionEnd();\n" +
- " }\n" +
- "}\n"
- },
- "EXECUTION STARTING\n" +
- "EXECUTION FINISHED"
- );
-}
-/**
- * Complex multi-threaded test involving inner classes
- */
-public void test019() {
- this.runConformTest(
- new String[] {
- /* MultiComplex2.java */
- "MultiComplex2.java",
- "public class MultiComplex2 {\n" +
- " public interface AbstractTask extends Runnable {\n" +
- " public void run();\n" +
- " public String taskName(); \n" +
- " }\n" +
- " \n" +
- " public static void main(String argv[]){\n" +
- " try {\n" +
- " new MultiComplex2().performTasks(3);\n" +
- " }\n" +
- " catch(InterruptedException e){};\n" +
- " }\n" +
- " void notifyCompleted(AbstractTask task) {\n" +
- " }\n" +
- " void notifyCompletion(AbstractTask task, int percentage) {\n" +
- " }\n" +
- " void notifyExecutionEnd() {\n" +
- " System.out.println(\"EXECUTION FINISHED\");\n" +
- " }\n" +
- " void notifyExecutionStart() {\n" +
- " System.out.println(\"EXECUTION STARTING\");\n" +
- " }\n" +
- " void performTasks(final int maxTasks) throws java.lang.InterruptedException {\n" +
- " Thread workers[] = new Thread[maxTasks];\n" +
- " AbstractTask tasks[] = new AbstractTask[maxTasks];\n" +
- " final int maxIteration = 5;\n" +
- " // Local Task\n" +
- " class Task implements AbstractTask {\n" +
- " String taskName;\n" +
- " Task(String aName) {\n" +
- " taskName = aName;\n" +
- " }\n" +
- " public String taskName() { \n" +
- " return taskName; \n" +
- " }\n" +
- " \n" +
- " public void run() {\n" +
- " MultiComplex2.this.notifyCompletion(this,0); \n" +
- " for(int j = 0; j < maxIteration; j++)\n" +
- " MultiComplex2.this.notifyCompletion(this, (int)((float) (j + 1) / maxIteration * 100));\n" +
- " }\n" +
- " };\n" +
- " notifyExecutionStart();\n" +
- " \n" +
- " // Creating and launching the tasks\n" +
- " for (int ii = 0; ii < maxTasks; ii++) {\n" +
- " final int i = ii;\n" +
- " tasks[i] = new Task(String.valueOf(i + 1)) { \n" +
- " public String taskName() { \n" +
- " return super.taskName() + \" of \" + maxTasks; }\n" +
- " public void run() {\n" +
- " super.run();\n" +
- " MultiComplex2.this.notifyCompleted(this);\n" +
- " } \n" +
- " };\n" +
- " workers[i] = new Thread(tasks[i],tasks[i].taskName());\n" +
- " workers[i].start();\n" +
- " }\n" +
- " // Waiting for *all* tasks to be ended\n" +
- " for (int i = 0; i < tasks.length; i++)\n" +
- " workers[i].join();\n" +
- " notifyExecutionEnd();\n" +
- " }\n" +
- "}\n"
- },
- "EXECUTION STARTING\n" +
- "EXECUTION FINISHED"
- );
-}
-/**
- * Complex multi-threaded test involving inner classes
- */
-public void test020() {
- this.runConformTest(
- new String[] {
- /* MultiLocal.java */
- "MultiLocal.java",
- "public class MultiLocal {\n" +
- " public static void main(String argv[]){\n" +
- " class Task implements Runnable {\n" +
- " private String taskName;\n" +
- " private int maxIteration; \n" +
- " public Task(String name, int value) {\n" +
- " taskName = name; \n" +
- " maxIteration = value;\n" +
- " }\n" +
- " \n" +
- " public String toString() { return taskName; }\n" +
- " public void run() {\n" +
- " for(int i = 0; i < maxIteration; i++)\n" +
- " notifyCompletion( (int)((float) (i + 1) / maxIteration * 100));\n" +
- " } \n" +
- " \n" +
- " void notifyCompletion(int percentage) {\n" +
- " }\n" +
- " };\n" +
- " MultiLocal multi = new MultiLocal();\n" +
- " int maxTasks = 3;\n" +
- " Task tasks[] = new Task[maxTasks];\n" +
- " for (int i = 0; i < maxTasks; i++) \n" +
- " tasks[i] = new Task(String.valueOf(i),5);\n" +
- " try {\n" +
- " multi.performTasks(tasks);\n" +
- " }\n" +
- " catch(InterruptedException e){};\n" +
- " }\n" +
- " void notifyExecutionEnd() {\n" +
- " System.out.println(\"EXECUTION FINISHED\");\n" +
- " }\n" +
- " void notifyExecutionStart() {\n" +
- " System.out.println(\"EXECUTION STARTING\");\n" +
- " }\n" +
- " void performTasks(Runnable tasks[]) throws java.lang.InterruptedException {\n" +
- " Thread workers[] = new Thread[tasks.length];\n" +
- " notifyExecutionStart();\n" +
- " \n" +
- " // Launching the tasks\n" +
- " for (int i = 0; i < tasks.length; i++) {\n" +
- " workers[i] = new Thread(tasks[i],\"Running task(\"+(tasks[i].toString())+\")\");\n" +
- " workers[i].start();\n" +
- " }\n" +
- " // Waiting for *all* tasks to be ended\n" +
- " for (int i = 0; i < tasks.length; i++)\n" +
- " workers[i].join();\n" +
- " notifyExecutionEnd();\n" +
- " }\n" +
- "}\n"
- },
- "EXECUTION STARTING\n" +
- "EXECUTION FINISHED"
- );
-}
-/**
- * Complex multi-threaded test involving inner classes
- */
-public void test021() {
- this.runConformTest(
- new String[] {
- /* MultiLocal2.java */
- "MultiLocal2.java",
- "public class MultiLocal2 {\n" +
- " public static void main(String argv[]){\n" +
- " final int maxTasks = 3;\n" +
- " class Task implements Runnable {\n" +
- " private String taskName;\n" +
- " private int maxIteration;\n" +
- " public Task(String name, int value) {\n" +
- " taskName = name; \n" +
- " maxIteration = value;\n" +
- " }\n" +
- " \n" +
- " public String toString() { return taskName + \" of \" + String.valueOf(maxTasks); }\n" +
- " public void run() {\n" +
- " for(int i = 0; i < maxIteration; i++)\n" +
- " notifyCompletion( (int)((float) (i + 1) / maxIteration * 100));\n" +
- " } \n" +
- " \n" +
- " void notifyCompletion(int percentage) {\n" +
- " }\n" +
- " };\n" +
- " MultiLocal2 multi = new MultiLocal2();\n" +
- " Task tasks[] = new Task[maxTasks];\n" +
- " for (int i = 0; i < maxTasks; i++) \n" +
- " tasks[i] = new Task(String.valueOf(i+1),5);\n" +
- " try {\n" +
- " multi.performTasks(tasks);\n" +
- " }\n" +
- " catch(InterruptedException e){};\n" +
- " }\n" +
- " void notifyExecutionEnd() {\n" +
- " System.out.println(\"EXECUTION FINISHED\");\n" +
- " }\n" +
- " void notifyExecutionStart() {\n" +
- " System.out.println(\"EXECUTION STARTING\");\n" +
- " }\n" +
- " void performTasks(Runnable tasks[]) throws java.lang.InterruptedException {\n" +
- " Thread workers[] = new Thread[tasks.length];\n" +
- " notifyExecutionStart();\n" +
- " \n" +
- " // Launching the tasks\n" +
- " for (int i = 0; i < tasks.length; i++) {\n" +
- " workers[i] = new Thread(tasks[i],\"Running task(\"+(tasks[i].toString())+\")\");\n" +
- " workers[i].start();\n" +
- " }\n" +
- " // Waiting for *all* tasks to be ended\n" +
- " for (int i = 0; i < tasks.length; i++)\n" +
- " workers[i].join();\n" +
- " notifyExecutionEnd();\n" +
- " }\n" +
- "}\n"
- },
- "EXECUTION STARTING\n" +
- "EXECUTION FINISHED"
- );
-}
-/**
- * Complex multi-threaded test involving inner classes
- */
-public void test022() {
- this.runConformTest(
- new String[] {
- /* MultiMember.java */
- "MultiMember.java",
- "public class MultiMember {\n" +
- " class Task implements Runnable {\n" +
- " private String taskName; \n" +
- " private int maxIteration;\n" +
- " public Task(String name, int value) {\n" +
- " taskName = name; \n" +
- " maxIteration = value;\n" +
- " }\n" +
- " public String toString() { return taskName; }\n" +
- " public void run() {\n" +
- " for(int i = 0; i < maxIteration; i++)\n" +
- " notifyCompletion( (int)((float) (i + 1) / maxIteration * 100));\n" +
- " } \n" +
- " \n" +
- " void notifyCompletion(int percentage) {\n" +
- " }\n" +
- " }\n" +
- " public static void main(String argv[]){\n" +
- " MultiMember multi = new MultiMember();\n" +
- " int maxTasks = 3;\n" +
- " Task tasks[] = new Task[maxTasks];\n" +
- " for (int i = 0; i < maxTasks; i++) \n" +
- " tasks[i] = multi.new Task(String.valueOf(i),5);\n" +
- " try {\n" +
- " multi.performTasks(tasks);\n" +
- " }\n" +
- " catch(InterruptedException e){};\n" +
- " }\n" +
- " void notifyExecutionEnd() {\n" +
- " System.out.println(\"EXECUTION FINISHED\");\n" +
- " }\n" +
- " void notifyExecutionStart() {\n" +
- " System.out.println(\"EXECUTION STARTING\");\n" +
- " }\n" +
- " void performTasks(Task tasks[]) throws java.lang.InterruptedException {\n" +
- " Thread workers[] = new Thread[tasks.length];\n" +
- " notifyExecutionStart();\n" +
- " \n" +
- " // Launching the tasks\n" +
- " for (int i = 0; i < tasks.length; i++) {\n" +
- " workers[i] = new Thread(tasks[i],\"Running task(\"+(tasks[i].toString())+\")\");\n" +
- " workers[i].start();\n" +
- " }\n" +
- " // Waiting for *all* tasks to be ended\n" +
- " for (int i = 0; i < tasks.length; i++)\n" +
- " workers[i].join();\n" +
- " notifyExecutionEnd();\n" +
- " }\n" +
- "}\n"
- },
- "EXECUTION STARTING\n" +
- "EXECUTION FINISHED"
- );
-}
-/**
- * No need for protected access emulation
- */
-public void test023() {
- this.runNegativeTest(
- new String[] {
- /* X.java */
- "p/X.java",
- "public class X extends q.Y { \n" +
- " void bar(){ Object o = someObject; } \n"+
- " public static void main(String[] argv){ \n" +
- " new X().bar();\n"+
- " System.out.println(\"SUCCESS\");\n"+
- " }\n"+
- "}\n",
- /* Y.java */
- "q/Y.java",
- "package q; \n" +
- "public class Y { \n" +
- " protected Object someObject; \n" +
- "}\n"
- },
- "" // no problem log: not even a synthetic access emulation one
- );
-}
-/**
- * No need for protected access emulation
- */
-public void test024() {
- this.runNegativeTest(
- new String[] {
- /* X.java */
- "p/X.java",
- "package p; \n" +
- "public class X extends q.Y { \n" +
- " void bar(){ foo(); } \n"+
- " public static void main(String[] argv){ \n" +
- " new X().bar();\n"+
- " System.out.println(\"SUCCESS\");\n"+
- " }\n"+
- "}\n",
- /* Y.java */
- "q/Y.java",
- "package q; \n" +
- "public class Y { \n" +
- " protected Object foo(){ return null;} \n" +
- "}\n"
- },
- "" // no problem log: not even a synthetic access emulation one
- );
-}
-
-public void test025() {
- this.runConformTest(
- new String[] {
- /* PortReport.java */
- "PortReport.java",
- "import java.util.*; \n"+
- "public class PortReport { \n"+
- " public static void main(String[] args) { \n"+
- " Portfolio port = new Portfolio(\"foobar\"); \n"+
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n"+
- "} \n",
- /* Portfolio.java */
- "Portfolio.java",
- "import java.util.*; \n"+
- "public class Portfolio { \n"+
- " String name; \n"+
- " public Portfolio(String buf) { \n"+
- " TokenBuffer tbuf = new TokenBuffer(); \n"+
- " switch (1) { \n"+
- " case TokenBuffer.T_NAME : \n"+
- " name = \"figi\"; \n"+
- " } \n"+
- " } \n"+
- " String getName() { \n"+
- " return name; \n"+
- " } \n"+
- " class TokenBuffer { \n"+
- " static final int T_NAME = 3; \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * Compatability - Compiler does not comply with 1.1 standard.
- */
-public void test026() {
- this.runConformTest(
- new String[] {
- /* Test.java */
- "p2/Test.java",
- "package p2; \n"+
- "public class Test { \n"+
- " public static void main (String args[]){ \n"+
- " new c2(); \n"+
- " } \n"+
- "} \n",
- /* c1.java */
- "p1/c1.java",
- "package p1; \n"+
- "public class c1 { \n"+
- " protected class c1a{ \n"+
- " public c1a(){} \n"+
- " public void foo(){ System.out.println(\"Foo called\"); \n"+
- " } \n"+
- " }; \n"+
- "} \n",
- /* c2.java */
- "p2/c2.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class c2 extends c1 { \n"+
- " public c1a myC1a; \n"+
- " { \n"+
- " myC1a = new c1a(); \n"+
- " myC1a.foo(); \n"+
- " } \n"+
- "} \n"
- },
- "Foo called"
- );
-}
-/**
- * Compatability - Compiler does not comply with 1.1 standard.
- */
-public void test027() {
- this.runNegativeTest(
- new String[] {
- /* Test.java */
- "p2/Test.java",
- "package p2; \n"+
- "public class Test { \n"+
- " public static void main (String args[]){ \n"+
- " new c2(); \n"+
- " } \n"+
- "} \n",
- /* c1.java */
- "p1/c1.java",
- "package p1; \n"+
- "public class c1 { \n"+
- " public class c1m { \n"+
- " protected class c1a{ \n"+
- " public c1a(){} \n"+
- " public void foo(){ System.out.println(\"Foo called\"); \n"+
- " } \n"+
- " }; \n"+
- " }; \n"+
- "} \n",
- /* c2.java */
- "p2/c2.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class c2 extends c1 { \n"+
- " public c1m.c1a myC1a; \n"+
- " { \n"+
- " myC1a = new c1m().new c1a(); \n"+
- " myC1a.foo(); \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p2\\c2.java (at line 4)\n" +
- " public c1m.c1a myC1a; \n" +
- " ^^^^^^^\n" +
- "The type c1m.c1a is not visible\n" +
- "----------\n" +
- "2. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1m().new c1a(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1m().new c1a(); \n" +
- " ^^^\n" +
- "The type c1.c1m.c1a is not visible\n" +
- "----------\n" +
- "4. ERROR in p2\\c2.java (at line 7)\n" +
- " myC1a.foo(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n"
- );
-}
-/**
- * Compatability - Compiler does not comply with 1.1 standard.
- */
-public void test028() {
- this.runNegativeTest(
- new String[] {
- /* Test.java */
- "p2/Test.java",
- "package p2; \n"+
- "public class Test { \n"+
- " public static void main (String args[]){ \n"+
- " new c2(); \n"+
- " } \n"+
- "} \n",
- /* c1.java */
- "p1/c1.java",
- "package p1; \n"+
- "public class c1 { \n"+
- " protected class c1m { \n"+
- " protected class c1a{ \n"+
- " public c1a(){} \n"+
- " public void foo(){ System.out.println(\"Foo called\"); \n"+
- " } \n"+
- " }; \n"+
- " }; \n"+
- "} \n",
- /* c2.java */
- "p2/c2.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class c2 extends c1 { \n"+
- " public c1m.c1a myC1a; \n"+
- " { \n"+
- " myC1a = new c1m().new c1a(); \n"+
- " myC1a.foo(); \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p2\\c2.java (at line 4)\n" +
- " public c1m.c1a myC1a; \n" +
- " ^^^^^^^\n" +
- "The type c1m.c1a is not visible\n" +
- "----------\n" +
- "2. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1m().new c1a(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1m().new c1a(); \n" +
- " ^^^^^^^^^\n" +
- "The constructor c1.c1m() is not visible\n" +
- "----------\n" +
- "4. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1m().new c1a(); \n" +
- " ^^^\n" +
- "The type c1.c1m.c1a is not visible\n" +
- "----------\n" +
- "5. ERROR in p2\\c2.java (at line 7)\n" +
- " myC1a.foo(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n"
- );
-}
-/**
- * Compatability - Compiler does not comply with 1.1 standard.
- */
-public void test029() {
- this.runConformTest(
- new String[] {
- /* Test.java */
- "p2/Test.java",
- "package p2; \n"+
- "public class Test { \n"+
- " public static void main (String args[]){ \n"+
- " new c2(); \n"+
- " } \n"+
- "} \n",
- /* c1.java */
- "p1/c1.java",
- "package p1; \n"+
- "public class c1 { \n"+
- " protected class c1a{ \n"+
- " public c1a(){} \n"+
- " public void foo(){ System.out.println(\"Foo called\"); \n"+
- " } \n"+
- " }; \n"+
- "} \n",
- /* c2.java */
- "p2/c2.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class c2 extends c1 { \n"+
- " public c1.c1a myC1a;\n"+
- " { \n"+
- " myC1a = new c1a(); \n"+
- " myC1a.foo(); \n"+
- " } \n"+
- "} \n"
- },
- "Foo called");
-}
-/**
- * Compatability - Compiler does not comply with 1.1 standard.
- */
-public void test030() {
- this.runNegativeTest(
- new String[] {
- /* Test.java */
- "p2/Test.java",
- "package p2; \n"+
- "public class Test { \n"+
- " public static void main (String args[]){ \n"+
- " new c2(); \n"+
- " } \n"+
- "} \n",
- /* c1.java */
- "p1/c1.java",
- "package p1; \n"+
- "public class c1 { \n"+
- " protected class c1a{ \n"+
- " public c1a(){} \n"+
- " public void foo(){ System.out.println(\"Foo called\"); \n"+
- " } \n"+
- " }; \n"+
- "} \n",
- /* c2.java */
- "p2/c2.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class c2 extends c1.c1a {// qualified acces does not work \n"+
- " public c1a myC1a; \n"+
- " { \n"+
- " myC1a = new c1a(); \n"+
- " myC1a.foo(); \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p2\\c2.java (at line 3)\n" +
- " public class c2 extends c1.c1a {// qualified acces does not work \n" +
- " ^^^^^^\n" +
- "The type c1.c1a is not visible\n" +
- "----------\n" +
- "2. ERROR in p2\\c2.java (at line 4)\n" +
- " public c1a myC1a; \n" +
- " ^^^\n" +
- "c1a cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1a(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1a(); \n" +
- " ^^^\n" +
- "c1a cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in p2\\c2.java (at line 7)\n" +
- " myC1a.foo(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n"
- );
-}
-/**
- * Compatability - Compiler does not comply with 1.1 standard.
- */
-public void test031() {
- this.runNegativeTest(
- new String[] {
- /* Test.java */
- "p2/Test.java",
- "package p2; \n"+
- "public class Test { \n"+
- " public static void main (String args[]){ \n"+
- " new c2(); \n"+
- " } \n"+
- "} \n",
- /* c1.java */
- "p1/c1.java",
- "package p1; \n"+
- "public class c1 { \n"+
- " protected class c1a{ \n"+
- " public c1a(){} \n"+
- " public void foo(){ System.out.println(\"Foo called\"); \n"+
- " } \n"+
- " }; \n"+
- "} \n",
- /* c2.java */
- "p2/c2.java",
- "package p2; \n"+
- "import p1.c1.*; \n"+
- "public class c2 extends c1a { \n"+
- " public c1a myC1a; \n"+
- " { \n"+
- " myC1a = new c1a(); \n"+
- " myC1a.foo(); \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p2\\c2.java (at line 3)\n" +
- " public class c2 extends c1a { \n" +
- " ^^^\n" +
- "The type c1a is not visible\n" +
- "----------\n" +
- "2. ERROR in p2\\c2.java (at line 4)\n" +
- " public c1a myC1a; \n" +
- " ^^^\n" +
- "The type c1a is not visible\n" +
- "----------\n" +
- "3. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1a(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in p2\\c2.java (at line 6)\n" +
- " myC1a = new c1a(); \n" +
- " ^^^\n" +
- "The type c1a is not visible\n" +
- "----------\n" +
- "5. ERROR in p2\\c2.java (at line 7)\n" +
- " myC1a.foo(); \n" +
- " ^^^^^\n" +
- "myC1a cannot be resolved\n" +
- "----------\n"
-
- );
-}
-/**
- * VerifyError using .class literal inside inner classes
- */
-public void test032() {
- this.runConformTest(
- new String[] {
- "p/A.java",
- "package p; \n"+
- "public class A {\n" +
- " public class B {\n" +
- " public B() {\n" +
- " }\n" +
- " public Class getCls() {\n" +
- " return A.class;\n" +
- " }\n" +
- " }\n" +
- " public A() {\n" +
- " super();\n" +
- " B b = new B();\n" +
- " System.out.println(\"Class: \" + b.getCls());\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " A a = new A();\n" +
- " }\n" +
- "}\n"
- },
- "Class: class p.A");
-}
-/**
- * Missing implementation in the compiler compiling invalid code
- */
-public void test033() {
- this.runNegativeTest(
- new String[] {
- /* A2.java */
- "p1/A2.java",
- "package p1; \n"+
- "class D { \n"+
- " class E { \n"+
- " E(Object o, Object o1, Object o2, F f) {} \n"+
- " void execute() {} \n"+
- " } \n"+
- "} \n"+
- "class F { \n"+
- " F(Object o) { \n"+
- " } \n"+
- "} \n"+
- "public class A2 { \n"+
- " private abstract class B { \n"+
- " public Object get() { \n"+
- " return null; \n"+
- " } \n"+
- " } \n"+
- " private class C extends B { \n"+
- " public void foo() { \n"+
- " (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n"+
- " } \n"+
- " } \n"+
- "}\n"
- },
- "----------\n" +
- "1. WARNING in p1\\A2.java (at line 18)\n" +
- " private class C extends B { \n" +
- " ^\n" +
- "The type A2.C is never used locally\n" +
- "----------\n" +
- "2. WARNING in p1\\A2.java (at line 18)\n" +
- " private class C extends B { \n" +
- " ^\n" +
- "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" +
- "----------\n" +
- "3. ERROR in p1\\A2.java (at line 20)\n" +
- " (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" +
- "----------\n");
-}
-/**
- * Missing implementation in the compiler compiling invalid code
- */
-public void test034() {
- this.runConformTest(
- new String[] {
- /* A2.java */
- "p1/A2.java",
- "package p1; \n"+
- "class D { \n"+
- " class E { \n"+
- " E(Object o, Object o1, Object o2, F f) {} \n"+
- " void execute() {} \n"+
- " } \n"+
- "} \n"+
- "class F { \n"+
- " F(Object o) { \n"+
- " } \n"+
- "} \n"+
- "public class A2 { \n"+
- " private abstract class B { \n"+
- " public Object get() { \n"+
- " return null; \n"+
- " } \n"+
- " } \n"+
- " private class C extends B { \n"+
- " public void foo() { \n"+
- " (new D().new E(null, null, null, new F(get()) {}) {}).execute(); \n"+
- " } \n"+
- " } \n"+
- " public static void main(String[] argv){ \n"+
- " new A2().new C().foo(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * Missing implementation in the compiler compiling invalid code
- */
-public void test035() {
- this.runNegativeTest(
- new String[] {
- /* A2.java */
- "p1/A2.java",
- "package p1; \n"+
- "class D { \n"+
- " class E { \n"+
- " E(Object o, Object o1, Object o2, F f) {} \n"+
- " void execute() {} \n"+
- " } \n"+
- "} \n"+
- "class F { \n"+
- " F(Object o) { \n"+
- " } \n"+
- "} \n"+
- "public class A2 { \n"+
- " private abstract class B { \n"+
- " public Object get() { \n"+
- " return null; \n"+
- " } \n"+
- " } \n"+
- " private class C extends B { \n"+
- " public void foo() { \n"+
- " (new D.E(null, null, null, new F(get()) {})).execute(); \n"+
- " } \n"+
- " } \n"+
- "}\n"
- },
- "----------\n" +
- "1. WARNING in p1\\A2.java (at line 18)\n" +
- " private class C extends B { \n" +
- " ^\n" +
- "The type A2.C is never used locally\n" +
- "----------\n" +
- "2. WARNING in p1\\A2.java (at line 18)\n" +
- " private class C extends B { \n" +
- " ^\n" +
- "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" +
- "----------\n" +
- "3. ERROR in p1\\A2.java (at line 20)\n" +
- " (new D.E(null, null, null, new F(get()) {})).execute(); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" +
- "----------\n");
-}
-/**
- * ClassCastException during inner class emulation
- */
-public void test036() {
- this.runConformTest(
- new String[] {
- /* A.java */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " public static void main(String[] argv){ \n"+
- " new A().foo(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " public Object foo() { \n"+
- " B b = new B() { \n"+
- " protected Object bar() { \n"+
- " return new B.C() {}; \n"+
- " } \n"+
- " }; \n"+
- " return b; \n"+
- " } \n"+
- "} \n"+
- "class B { \n"+
- " class C { \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * ClassCastException during inner class emulation
- */
-public void test037() {
- this.runConformTest(
- new String[] {
- /* A.java */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " public static void main(String[] argv){ \n"+
- " new A().foo(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " public Object foo() { \n"+
- " I i = new I() { \n"+
- " protected Object bar() { \n"+
- " return new I.C() {}; \n"+
- " } \n"+
- " }; \n"+
- " return i; \n"+
- " } \n"+
- "} \n"+
- "interface I { \n"+
- " class C { \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-
-/**
- * Enclosing instance comparison
- */
-public void test038() {
- this.runConformTest(
- new String[] {
- /* X.java */
- "X.java",
- "public class X { \n"+
- " public static void main(String argv[]) { \n"+
- " if (new X().foo()) \n"+
- " System.out.println(\"FAILED\"); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " boolean bar() { \n"+
- " return false; \n"+
- " } \n"+
- " boolean foo() { \n"+
- " X x = new X() { \n"+
- " boolean test() { \n"+
- " return (X.this == this); \n"+
- " } \n"+
- " }; \n"+
- " return x.bar(); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test039() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected void foo() { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " Y.this.foo(); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test040() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected void foo() { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " new Y().foo(); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test041() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected void foo() { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " Y.super.foo(); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test042() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"SUCCESS\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(Y.super.foo); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test043() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"SUCCESS\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(Y.this.foo); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test044() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"SUCCESS\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(new Y().foo); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test045() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"SUCCESS\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(foo); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test046() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"SUCCESS\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " Y someY; \n"+
- " public void bar() { \n"+
- " someY = this; \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(someY.foo); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test047() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"FAILED\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(Y.super.foo = \"SUCCESS\"); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test048() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"FAILED\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(Y.this.foo = \"SUCCESS\"); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test049() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"FAILED\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(new Y().foo = \"SUCCESS\"); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test050() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"FAILED\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(foo = \"SUCCESS\"); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=6456
- * Invalid error when compiling access to protected member inside innerclass
- */
-public void test051() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"FAILED\"; \n"+
- " public static void main(String argv[]) { \n"+
- " new p2.Y().bar(); \n"+
- " } \n"+
- "} \n",
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends p1.X { \n"+
- " Y someY; \n"+
- " public void bar() { \n"+
- " someY = this; \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.println(someY.foo = \"SUCCESS\"); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-
-public void test052() {
- this.runConformTest(
- new String[] {
- /* p2/Y.java */
- "p2/Y.java",
- "package p2; \n"+
- "public class Y { \n"+
- " void bar(final int someVal){ \n"+
- " class Local { \n"+
- " void localDo(final int localVal){ \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " System.out.print(someVal + localVal); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- " }; \n"+
- " Local loc = new Local(); \n"+
- " loc.localDo(8); \n"+
- " class SubLocal extends Local { \n"+
- " void localDo(final int localVal){ \n"+
- " super.localDo(localVal + 1); \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n"+
- " SubLocal.super.localDo(localVal + 2); \n"+
- " System.out.print(someVal + localVal + 3); \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- " }; \n"+
- " SubLocal subloc = new SubLocal(); \n"+
- " subloc.localDo(8); \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new Y().bar(4); \n"+
- " System.out.println(); \n"+
- " } \n"+
- "} \n",
- },
- "12131415"
- );
-}
-
-public void test053() {
- this.runConformTest(
- new String[] {
- /* p2/Z.java */
- "p2/Z.java",
- "package p2; \n"+
- "import p1.X; \n"+
- "public class Z { \n"+
- " class ZMember extends X { \n"+
- " ZMember(Object o){} \n"+
- " Z bar(){ \n"+
- " System.out.println(foo = \"FAILED\"); \n"+
- " return Z.this; \n"+
- " } \n"+
- " } \n"+
- " Z(final Object foo){ \n"+
- " Object obj2 = new Object(){ \n"+
- " Object doSomething(){ \n"+
- " ZMember obj3 = new ZMember(foo){ \n"+
- " Z bar(){ \n"+
- " System.out.println(this.foo); \n"+
- " return Z.this; \n"+
- " } \n"+
- " }; \n"+
- " obj3.bar(); \n"+
- " return this; \n"+
- " } \n"+
- " }.doSomething(); \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new Z(new Object()); \n"+
- " } \n"+
- "} \n",
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected String foo = \"SUCCESS\"; \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-public void test055() {
- this.runNegativeTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " void foo() { \n"+
- " class L1 { \n"+
- " class LM1 { \n"+
- " } \n"+
- " } \n"+
- " class L2 extends L1.LM1 { \n"+
- " } \n"+
- " new L2(); \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().foo(); \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 8)\n" +
- " class L2 extends L1.LM1 { \n" +
- " ^^\n" +
- "No enclosing instance of type L1 is accessible to invoke the super constructor. Must define a constructor and explicitly qualify its super constructor invocation with an instance of L1 (e.g. x.super() where x is an instance of L1).\n" +
- "----------\n"
-
- );
-}
-
-public void test056() {
- this.runNegativeTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " void foo() { \n"+
- " class L1 { \n"+
- " class LM1 { \n"+
- " } \n"+
- " } \n"+
- " new L1().new LM1(){}; //ok\n"+
- " new L1.LM1(){}; //ko\n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().foo(); \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 9)\n" +
- " new L1.LM1(){}; //ko\n" +
- " ^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type L1 is accessible. Must qualify the allocation with an enclosing instance of type L1 (e.g. x.new A() where x is an instance of L1).\n" +
- "----------\n"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=9813
- * VerifyError with Inner Class having private constructor
- */
-public void test057() {
- this.runConformTest(
- new String[] {
- /* VE_Test.java */
- "VE_Test.java",
- "public class VE_Test { \n"+
- " class VE_Inner { \n"+
- " private VE_Inner() {} \n"+
- " } \n"+
- " private static void test(){ \n"+
- " VE_Test ve_test = new VE_Test(); \n"+
- " VE_Inner pi = ve_test.new VE_Inner(); \n"+
- " } \n"+
- " public static void main(String[] args){ \n"+
- " new VE_Test(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=11845
- * NPE during emulation
- */
-public void test058() {
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "import p2.A; \n"+
- "public class Test { \n"+
- " public static void main(String[] args){ \n"+
- " new Test().a.bar(); \n"+
- " } \n"+
- " private A a = new A() { \n"+
- " public void bar() { \n"+
- " new Object() { \n"+
- " protected void foo() { \n"+
- " init(); \n"+
- " } \n"+
- " }.foo(); \n"+
- " } \n"+
- " }; \n"+
- " private void init() { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n" +
- "} \n",
- "p2/A.java",
- "package p2; \n"+
- "public class A { \n"+
- " public void bar() { \n"+
- " } \n"+
- " private void init() { \n"+
- " System.out.println(\"FAILED\"); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=11845
- * variant for single name ref
- */
-public void test059() {
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "import p2.A; \n"+
- "public class Test { \n"+
- " public static void main(String[] args){ \n"+
- " new Test().a.bar(); \n"+
- " } \n"+
- " private A a = new A() { \n"+
- " public void bar() { \n"+
- " new Object() { \n"+
- " protected void foo() { \n"+
- " System.out.println(init); \n"+
- " } \n"+
- " }.foo(); \n"+
- " } \n"+
- " }; \n"+
- " private String init = \"SUCCESS\"; \n"+
- "} \n",
- "p2/A.java",
- "package p2; \n"+
- "public class A { \n"+
- " public void bar() { \n"+
- " } \n"+
- " private String init = \"FAILED\"; \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=11845
- * variant for qualified name ref
- */
-public void test060() {
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "import p2.A; \n"+
- "public class Test { \n"+
- " public static void main(String[] args){ \n"+
- " new Test().a.bar(); \n"+
- " } \n"+
- " private A a = new A() { \n"+
- " public void bar() { \n"+
- " class L { \n"+
- " Test next = Test.this; \n"+
- " protected void foo() { \n"+
- " System.out.println(next.init); \n"+
- " } \n"+
- " }; \n" +
- " new L().foo(); \n"+
- " } \n"+
- " }; \n"+
- " private String init = \"SUCCESS\"; \n"+
- "} \n",
- "p2/A.java",
- "package p2; \n"+
- "public class A { \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=11845
- * variant for field name ref
- */
-public void test061() {
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "import p2.A; \n"+
- "public class Test { \n"+
- " public static void main(String[] args){ \n"+
- " new Test().a.bar(); \n"+
- " } \n"+
- " private A a = new A() { \n"+
- " public void bar() { \n"+
- " class L { \n"+
- " protected void foo() { \n"+
- " System.out.println(Test.this.init); \n"+
- " } \n"+
- " }; \n" +
- " new L().foo(); \n"+
- " } \n"+
- " }; \n"+
- " private String init = \"SUCCESS\"; \n"+
- "} \n",
- "p2/A.java",
- "package p2; \n"+
- "public class A { \n"+
- " public void bar() { \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-
-public void test062() {
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " public static void main(String args[]) { \n"+
- " final String s = args.length == 0 ? \"SUCCESS\" : null; \n"+
- " final class Local { \n"+
- " private Local() { \n"+
- " new LocalMember(); \n"+
- " } \n"+
- " class LocalMember { \n"+
- " { \n"+
- " new LocalMemberMember(); \n"+
- " } \n"+
- " class LocalMemberMember { \n"+
- " { \n"+
- " System.out.println(s); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " new Local(); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-
-public void test062a() {
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " public static void main(String args[]) { \n"+
- " final String s = \"SUCCESS\";\n"+
- " final class Local { \n"+
- " Local() { \n"+
- " new LocalMember(); \n"+
- " } \n"+
- " class LocalMember { \n"+
- " { \n"+
- " new LocalMemberMember(); \n"+
- " } \n"+
- " class LocalMemberMember { \n"+
- " { \n"+
- " System.out.println(s); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " new Local(); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-
-public void test063() {
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " String a = new Object(){ \n"+
- " class LocalMember { \n"+
- " String s = \"SUCCESS\"; \n"+
- " }; \n"+
- " String get_a(){ \n"+
- " return new LocalMember().s; \n"+
- " } \n"+
- " }.get_a(); \n"+
- " public static void main(String argv[]) { \n"+
- " System.out.println(new X().a); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=21447
- * should invoke Y.foo() at runtime
- */
-public void test064(){
- this.runConformTest(
- new String[] {
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends T { \n"+
- " public static void main(String argv[]) { \n"+
- " new Y().bar(); \n"+
- " } \n"+
- " protected void foo() { \n"+
- " System.out.println(\"Y.foo()\"); \n"+
- " } \n"+
- "} \n",
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected void foo() { \n"+
- " System.out.println(\"X.foo()\"); \n"+
- " } \n"+
- "} \n",
- "p2/T.java",
- "package p2; \n"+
- "public class T extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n" +
- " T.this.foo(); \n"+
- " } \n" +
- " }.doSomething(); \n" +
- " } \n"+
- "} \n",
- },
- "Y.foo()"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=21447
- * variation - if T.foo() is defined
- */
-public void test065(){
- this.runConformTest(
- new String[] {
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends T { \n"+
- " public static void main(String argv[]) { \n"+
- " new Y().bar(); \n"+
- " } \n"+
- " protected void foo() { \n"+
- " System.out.println(\"Y.foo()\"); \n"+
- " } \n"+
- "} \n",
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected void foo() { \n"+
- " System.out.println(\"X.foo()\"); \n"+
- " } \n"+
- "} \n",
- "p2/T.java",
- "package p2; \n"+
- "public class T extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n" +
- " T.this.foo(); \n"+
- " } \n" +
- " }.doSomething(); \n" +
- " } \n"+
- " protected void foo() { \n"+
- " System.out.println(\"T.foo()\"); \n"+
- " } \n"+
- "} \n",
- },
- "Y.foo()"
- );
-}
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=21447
- * should invoke Y.foo() and X.foo() at runtime (through 2 separate access methods)
- */
-public void test066(){
- this.runConformTest(
- new String[] {
- "p2/Y.java",
- "package p2; \n"+
- "public class Y extends T { \n"+
- " public static void main(String argv[]) { \n"+
- " new Y().bar(); \n"+
- " } \n"+
- " protected void foo() { \n"+
- " System.out.print(\"Y.foo()-\"); \n"+
- " } \n"+
- "} \n",
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " protected void foo() { \n"+
- " System.out.println(\"X.foo()\"); \n"+
- " } \n"+
- "} \n",
- "p2/T.java",
- "package p2; \n"+
- "public class T extends p1.X { \n"+
- " public void bar() { \n"+
- " new Object(){ \n"+
- " void doSomething(){ \n" +
- " T.this.foo(); \n"+
- " T.super.foo(); //need extra access method \n"+
- " } \n" +
- " }.doSomething(); \n" +
- " } \n"+
- "} \n",
- },
- "Y.foo()-X.foo()"
- );
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22093
- * test collision check for synthetic accessors to constructors
- */
-public void test067(){
- this.runConformTest(
- new String[] {
- "p/Test.java",
- "package p; \n"+
- "public class Test { \n"+
- " class Member { \n"+
- " private Member(){ \n"+
- " } \n"+
- " private Member(Member other){ \n"+
- " } \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " Test t = new Test(); \n"+
- " Member m1 = t.new Member(); \n"+
- " t.new Member(m1); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=25229
-public void test068(){
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new X2().foo(); \n"+
- " } \n"+
- " class X1 { \n"+
- " void baz1() { \n"+
- " System.out.print(\"-X1.baz1()\"); \n"+
- " } \n"+
- " } \n"+
- " class X2 { \n"+
- " void foo(){ \n"+
- " X.this.new X1(){ \n"+
- " void bar(){ \n"+
- " baz(); \n"+
- " baz1(); \n"+
- " baz2(); \n"+
- " } \n"+
- " }.bar(); \n"+
- " } \n"+
- " void baz2() { \n"+
- " System.out.println(\"-X2.baz2()\"); \n"+
- " } \n"+
- " } \n"+
- " void baz() { \n"+
- " System.out.print(\"X.baz()\"); \n"+
- " } \n"+
- "} \n"
- },
- "X.baz()-X1.baz1()-X2.baz2()");
-}
-
-// http://bugs.eclipse.org/bugs/show_bug.cgi?id=26122
-// synthetic outer local variables must be appended after user arguments
-public void test069() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X(String s, int j) {} \n"+
- " public static void main(String[] args) { \n"+
- " final int i; \n"+
- " new X(\"hello\", i = 1) { \n"+ // val$i must be appended after i got assigned
- " { \n"+
- " System.out.print(\"SUCCESS:\"+i); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS:1");
-}
-// variation on test069
-public void test070() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X() {} \n"+
- " public static void main(String[] args) { \n"+
- " final int i; \n"+
- " new X().new Y(\"hello\", i = 1) { \n"+ // val$i must be appended after i got assigned
- " { \n"+
- " System.out.print(\"SUCCESS:\"+i); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " class Y { \n" +
- " Y(String s, int j) {} \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS:1");
-}
-
-// test too many synthetic arguments
-public void test071() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " void foo(int i) { \n"+
- " final long v0 = i, v1 = i, v2 = i, v3 = i, v4 = i, v5 = i, v6 = i; \n"+
- " final long v7 = i, v8 = i, v9 = i, v10 = i, v11 = i, v12 = i, v13 = i; \n"+
- " final long v14 = i, v15 = i, v16 = i, v17 = i, v18 = i, v19 = i, v20 = i; \n"+
- " final long v21 = i, v22 = i, v23 = i, v24 = i, v25 = i, v26 = i, v27 = i; \n"+
- " final long v28 = i, v29 = i, v30 = i, v31 = i, v32 = i, v33 = i, v34 = i; \n"+
- " final long v35 = i, v36 = i, v37 = i, v38 = i, v39 = i, v40 = i, v41 = i; \n"+
- " final long v42 = i, v43 = i, v44 = i, v45 = i, v46 = i, v47 = i, v48 = i; \n"+
- " final long v49 = i, v50 = i, v51 = i, v52 = i, v53 = i, v54 = i, v55 = i; \n"+
- " final long v56 = i, v57 = i, v58 = i, v59 = i, v60 = i, v61 = i, v62 = i; \n"+
- " final long v63 = i, v64 = i, v65 = i, v66 = i, v67 = i, v68 = i, v69 = i; \n"+
- " final long v70 = i, v71 = i, v72 = i, v73 = i, v74 = i, v75 = i, v76 = i; \n"+
- " final long v77 = i, v78 = i, v79 = i, v80 = i, v81 = i, v82 = i, v83 = i; \n"+
- " final long v84 = i, v85 = i, v86 = i, v87 = i, v88 = i, v89 = i, v90 = i; \n"+
- " final long v91 = i, v92 = i, v93 = i, v94 = i, v95 = i, v96 = i, v97 = i; \n"+
- " final long v98 = i, v99 = i, v100 = i, v101 = i, v102 = i, v103 = i, v104 = i; \n"+
- " final long v105 = i, v106 = i, v107 = i, v108 = i, v109 = i, v110 = i, v111 = i; \n"+
- " final long v112 = i, v113 = i, v114 = i, v115 = i, v116 = i, v117 = i, v118 = i; \n"+
- " final long v119 = i, v120 = i, v121 = i, v122 = i, v123 = i, v124 = i, v125 = i; \n"+
- " final long v126 = i; \n"+
- " final int v127 = i; // int is already too many arg \n"+
- " new X() { \n"+
- " { \n"+
- " System.out.println( \n"+
- " v0 + v1 + v2 + v3 + v4 + v5 + v6 \n" +
- " + v7 + v8 + v9 + v10 + v11 + v12 + v13 \n" +
- " + v14 + v15 + v16 + v17 + v18 + v19 + v20 \n" +
- " + v21 + v22 + v23 + v24 + v25 + v26 + v27 \n" +
- " + v28 + v29 + v30 + v31 + v32 + v33 + v34 \n" +
- " + v35 + v36 + v37 + v38 + v39 + v40 + v41 \n" +
- " + v42 + v43 + v44 + v45 + v46 + v47 + v48 \n" +
- " + v49 + v50 + v51 + v52 + v53 + v54 + v55 \n" +
- " + v56 + v57 + v58 + v59 + v60 + v61 + v62 \n" +
- " + v63 + v64 + v65 + v66 + v67 + v68 + v69 \n" +
- " + v70 + v71 + v72 + v73 + v74 + v75 + v76 \n" +
- " + v77 + v78 + v79 + v80 + v81 + v82 + v83 \n" +
- " + v84 + v85 + v86 + v87 + v88 + v89 + v90 \n" +
- " + v91 + v92 + v93 + v94 + v95 + v96 + v97 \n" +
- " + v98 + v99 + v100 + v101 + v102 + v103 + v104 \n" +
- " + v105 + v106 + v107 + v108 + v109 + v110 + v111 \n" +
- " + v112 + v113 + v114 + v115 + v116 + v117 + v118 \n" +
- " + v119 + v120 + v121 + v122 + v123 + v124 + v125 \n" +
- " + v126); \n"+
- " } \n"+
- " }; \n"+
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 23)\n" +
- " new X() { \n" +
- " ^^^\n" +
- "Too many synthetic parameters, emulated parameter val$v126 is exceeding the limit of 255 words eligible for method parameters\n" +
- "----------\n");
-}
-
-// test too many synthetic arguments
-public void test072() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " void foo(int i) { \n"+
- " final long v0 = i, v1 = i, v2 = i, v3 = i, v4 = i, v5 = i, v6 = i; \n"+
- " final long v7 = i, v8 = i, v9 = i, v10 = i, v11 = i, v12 = i, v13 = i; \n"+
- " final long v14 = i, v15 = i, v16 = i, v17 = i, v18 = i, v19 = i, v20 = i; \n"+
- " final long v21 = i, v22 = i, v23 = i, v24 = i, v25 = i, v26 = i, v27 = i; \n"+
- " final long v28 = i, v29 = i, v30 = i, v31 = i, v32 = i, v33 = i, v34 = i; \n"+
- " final long v35 = i, v36 = i, v37 = i, v38 = i, v39 = i, v40 = i, v41 = i; \n"+
- " final long v42 = i, v43 = i, v44 = i, v45 = i, v46 = i, v47 = i, v48 = i; \n"+
- " final long v49 = i, v50 = i, v51 = i, v52 = i, v53 = i, v54 = i, v55 = i; \n"+
- " final long v56 = i, v57 = i, v58 = i, v59 = i, v60 = i, v61 = i, v62 = i; \n"+
- " final long v63 = i, v64 = i, v65 = i, v66 = i, v67 = i, v68 = i, v69 = i; \n"+
- " final long v70 = i, v71 = i, v72 = i, v73 = i, v74 = i, v75 = i, v76 = i; \n"+
- " final long v77 = i, v78 = i, v79 = i, v80 = i, v81 = i, v82 = i, v83 = i; \n"+
- " final long v84 = i, v85 = i, v86 = i, v87 = i, v88 = i, v89 = i, v90 = i; \n"+
- " final long v91 = i, v92 = i, v93 = i, v94 = i, v95 = i, v96 = i, v97 = i; \n"+
- " final long v98 = i, v99 = i, v100 = i, v101 = i, v102 = i, v103 = i, v104 = i; \n"+
- " final long v105 = i, v106 = i, v107 = i, v108 = i, v109 = i, v110 = i, v111 = i; \n"+
- " final long v112 = i, v113 = i, v114 = i, v115 = i, v116 = i, v117 = i, v118 = i; \n"+
- " final long v119 = i, v120 = i, v121 = i, v122 = i, v123 = i, v124 = i, v125 = i; \n"+
- " new X() { \n"+
- " { \n"+
- " System.out.println( \n"+
- " v0 + v1 + v2 + v3 + v4 + v5 + v6 \n" +
- " + v7 + v8 + v9 + v10 + v11 + v12 + v13 \n" +
- " + v14 + v15 + v16 + v17 + v18 + v19 + v20 \n" +
- " + v21 + v22 + v23 + v24 + v25 + v26 + v27 \n" +
- " + v28 + v29 + v30 + v31 + v32 + v33 + v34 \n" +
- " + v35 + v36 + v37 + v38 + v39 + v40 + v41 \n" +
- " + v42 + v43 + v44 + v45 + v46 + v47 + v48 \n" +
- " + v49 + v50 + v51 + v52 + v53 + v54 + v55 \n" +
- " + v56 + v57 + v58 + v59 + v60 + v61 + v62 \n" +
- " + v63 + v64 + v65 + v66 + v67 + v68 + v69 \n" +
- " + v70 + v71 + v72 + v73 + v74 + v75 + v76 \n" +
- " + v77 + v78 + v79 + v80 + v81 + v82 + v83 \n" +
- " + v84 + v85 + v86 + v87 + v88 + v89 + v90 \n" +
- " + v91 + v92 + v93 + v94 + v95 + v96 + v97 \n" +
- " + v98 + v99 + v100 + v101 + v102 + v103 + v104 \n" +
- " + v105 + v106 + v107 + v108 + v109 + v110 + v111 \n" +
- " + v112 + v113 + v114 + v115 + v116 + v117 + v118 \n" +
- " + v119 + v120 + v121 + v122 + v123 + v124 + v125); \n" +
- " } \n"+
- " }; \n"+
- " } \n" +
- " public static void main(String[] args) { \n"+
- " System.out.print(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-/**
- * verify error in synthetic access to constructor
- * (ordering of parameters after moving outerlocals after user args)
- */
-public void test073() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(final String[] args) { \n" +
- " class Local { \n" +
- " private Local(String str){ \n" +
- " Object o = args; \n" +
- " System.out.println(str); \n" +
- " } \n" +
- " }; \n" +
- " new Local(\"SUCCESS\"); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-/**
- * verify error in synthetic access to constructor - test collisions
- * (ordering of parameters after moving outerlocals after user args)
- */
-public void test074() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(final String[] args) { \n" +
- " class Local { \n" +
- " public Local(String str, Local loc, String str2){ \n" + // collision
- " } \n" +
- " public Local(String str, Local loc){ \n" + // collision
- " } \n" +
- " private Local(String str){ \n" +
- " Object o = args; \n" +
- " System.out.println(str); \n" +
- " } \n" +
- " }; \n" +
- " new Local(\"SUCCESS\"); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-/**
- * should not consider synthetic methods on binary types
- */
-public void test075() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(final String[] args) { \n" +
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " private static void foo() { \n" +
- " } \n" +
- " A a = new A(); \n" +
- " class A { \n" +
- " private A() {} \n" +
- " A(String s) { \n" +
- " foo(); \n" +
- " } \n" +
- " A(int s) { \n" +
- " foo(); \n" +
- " } \n" +
- " } \n" +
- " class B extends A { \n" +
- " B(){ \n" +
- " super(); \n" +
- " } \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS");
-
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "public class Y { \n" +
- " void foo(){ \n" +
- " new X().new A(null); \n" +
- " new X().access$0(); \n" +
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 4)\n" +
- " new X().access$0(); \n" +
- " ^^^^^^^^\n" +
- "The method access$0() is undefined for the type X\n" +
- "----------\n",
- null, // use default class-path
- false); // do not flush previous output dir content
-
-}
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=27413
- * implicit enclosing instances
- */
-public void test076() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel <= ClassFileConstants.JDK1_3) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X(Object o){ \n"+
- " class A { \n"+
- " private A() { \n"+ // implicit enclosing instance in non-static context
- " } \n"+
- " } \n"+
- " class B extends X { \n"+
- " B() { \n"+
- " super(new A(){ \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " class B extends X { \n" +
- " ^\n" +
- "The type B is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " B() { \n" +
- " ^^^\n" +
- "The constructor B() is never used locally\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " super(new A(){ \n" +
- " }); \n" +
- " ^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " super(new A(){ \n" +
- " ^^^\n" +
- "Access to enclosing constructor A() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" +
- "----------\n");
- return;
- }
- if (options.sourceLevel <= ClassFileConstants.JDK1_4) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X(Object o){ \n"+
- " class A { \n"+
- " private A() { \n"+ // implicit enclosing instance in non-static context
- " } \n"+
- " } \n"+
- " class B extends X { \n"+
- " B() { \n"+
- " super(new A(){ \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " class B extends X { \n" +
- " ^\n" +
- "The type B is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " B() { \n" +
- " ^^^\n" +
- "The constructor B() is never used locally\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " super(new A(){ \n" +
- " }); \n" +
- " ^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X(Object o){ \n"+
- " class A { \n"+
- " private A() { \n"+ // implicit enclosing instance in non-static context
- " } \n"+
- " } \n"+
- " class B extends X { \n"+
- " B() { \n"+
- " super(new A(){ \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "");
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=27413
- * implicit enclosing instances
- */
-public void test077() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] args){ \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n" +
- " X(Object o){ \n"+
- " } \n" +
- " static void foo() { \n"+
- " class A { \n"+ // no implicit enclosing in STATIC context
- " private A() { \n"+
- " } \n"+
- " } \n"+
- " class B extends X { \n"+
- " B() { \n"+
- " super(new A(){ \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=27413
- * implicit enclosing instances
- */
-public void test078() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel <= ClassFileConstants.JDK1_3) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X(Object o){ \n"+
- " class A { \n"+
- " private A() { \n"+ // implicit enclosing instance in non-static context
- " } \n"+
- " } \n"+
- " class B extends X { \n"+
- " B() { \n"+
- " super(new A(){ \n"+
- " void foo() { System.out.println(X.this); } \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " class B extends X { \n" +
- " ^\n" +
- "The type B is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " B() { \n" +
- " ^^^\n" +
- "The constructor B() is never used locally\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " super(new A(){ \n" +
- " void foo() { System.out.println(X.this); } \n" +
- " }); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " super(new A(){ \n" +
- " ^^^\n" +
- "Access to enclosing constructor A() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 10)\n" +
- " void foo() { System.out.println(X.this); } \n" +
- " ^^^^^\n" +
- "The method foo() from the type new A(){} is never used locally\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " void foo() { System.out.println(X.this); } \n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n");
- return;
- }
- if (options.sourceLevel <= ClassFileConstants.JDK1_4) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X(Object o){ \n"+
- " class A { \n"+
- " private A() { \n"+ // implicit enclosing instance in non-static context
- " } \n"+
- " } \n"+
- " class B extends X { \n"+
- " B() { \n"+
- " super(new A(){ \n"+
- " void foo() { System.out.println(X.this); } \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " class B extends X { \n" +
- " ^\n" +
- "The type B is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 8)\n" +
- " B() { \n" +
- " ^^^\n" +
- "The constructor B() is never used locally\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " super(new A(){ \n" +
- " void foo() { System.out.println(X.this); } \n" +
- " }); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " void foo() { System.out.println(X.this); } \n" +
- " ^^^^^\n" +
- "The method foo() from the type new A(){} is never used locally\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " void foo() { System.out.println(X.this); } \n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n");
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " X(Object o){ \n"+
- " class A { \n"+
- " private A() { \n"+ // implicit enclosing instance in non-static context
- " } \n"+
- " } \n"+
- " class B extends X { \n"+
- " B() { \n"+
- " super(new A(){ \n"+
- " void foo() { System.out.println(X.this); } \n"+
- " }); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "");
-}
-
-/*
- * Check that X.this is actually bound to an X, and not innermost compatible type (Z)
- */
-public void test079() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new Y().new Z().bar(); \n"+
- " } \n"+
- " String foo() { return \"X-foo\"; } \n"+
- " class Y extends X { \n"+
- " String foo() { return \"Y-foo\"; } \n"+
- " class Z extends Y { \n"+
- " Z(){ \n"+
- " X.this.super(); \n"+
- " } \n"+
- " String foo() { return \"Z-foo\"; } \n"+
- " void bar () { \n"+
- " System.out.println(X.this.foo()); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "X-foo");
-}
-
-public void test080() { // verified as conform
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new C(); \n"+
- " } \n"+
- " int m() { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " return 1; \n"+
- " } \n"+
- " class C extends B { \n"+
- " C(int j){} \n"+
- " C(){ \n"+
- " this(X.this.m()); \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class B extends X { \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-public void test081() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p; \n"+
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new C(); \n"+
- " } \n"+
- " int m() { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " return 1; \n"+
- " } \n"+
- " class C extends q.B { \n"+
- " C(int j){} \n"+
- " C(){ \n"+
- " this(m()); \n"+ // only X.this can see m()
- " } \n"+
- " } \n"+
- "} \n",
- "q/B.java",
- "package q; \n"+
- "public class B extends p.X { \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-/*
- * Default constructor for Z, will use enclosing 'this' as default-value for enclosing instance for super().
- */
-public void test083() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new Y().new Z().bar(); \n"+
- " } \n"+
- " String foo() { return \"X-foo\"; } \n"+
- " class Y extends X { \n"+
- " String foo() { return \"Y-foo\"; } \n"+
- " class Z { \n"+
- " Z(){ \n"+
- " //X.this.super(); \n"+
- " } \n"+
- " String foo() { return \"Z-foo\"; } \n"+
- " void bar () { \n"+
- " System.out.println(X.this.foo()); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "X-foo");
-}
-
-public void test084() {
- this.runConformTest(
- new String[] {
- "Foo.java",
- "public class Foo { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Foo(null); \n"+
- " } \n"+
- " Foo(int i){} \n"+
- " Foo(Object o){ \n"+
- " class A { \n"+
- " private A() { \n"+
- " } \n"+
- " } \n"+
- " class B extends Foo { \n"+
- " B() { \n"+
- " super(0); \n"+
- " new A(){ \n"+
- " void foo() { \n"+
- " System.out.println(Foo.this.getClass().getName()); \n"+
- " } \n"+
- " }.foo(); \n"+
- " } \n"+
- " } \n"+
- " new B(); \n"+
- " } \n"+
- "} \n",
- },
- "Foo");
-}
-
-public void test085() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel < ClassFileConstants.JDK1_5) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " int m() { \n"+
- " return 1; \n"+
- " } \n"+
- " class C extends B { \n"+
- " C(int j){} \n"+
- " C(){ \n"+
- " this( \n"+
- " new B(){ \n"+
- " X x = X.this; \n"+
- " int m(){ \n"+
- " return 1; \n"+
- " } \n"+
- " }.m()); \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class B extends X { \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " X x = X.this; \n" +
- " ^\n" +
- "The field new B(){}.x is never read locally\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " X x = X.this; \n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n");
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " int m() { \n"+
- " return 1; \n"+
- " } \n"+
- " class C extends B { \n"+
- " C(int j){} \n"+
- " C(){ \n"+
- " this( \n"+
- " new B(){ \n"+
- " X x = X.this; \n"+
- " int m(){ \n"+
- " return 1; \n"+
- " } \n"+
- " }.m()); \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class B extends X { \n"+
- "} \n"
- },
- "");
-}
-
-public void test086() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new C(); \n"+
- " } \n"+
- " int m() { \n"+
- " return 1; \n"+
- " } \n"+
- " class C extends B { \n"+
- " C(int j){} \n"+
- " C(){ \n"+
- " this( \n"+
- " new B(){ \n"+
- " int m(){ \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " return 1; \n"+
- " } \n"+
- " }.m()); \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class B extends X { \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-public void test087() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.complianceLevel <= ClassFileConstants.JDK1_4) {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().f(); \n"+
- " } \n"+
- " void f () { \n"+
- " class C { \n"+
- " C() { \n"+
- " System.out.println(\"[\"+X.this.getClass().getName()+\"]\"); \n"+
- " } \n"+
- " } \n"+
- " class N extends X { \n"+
- " { new C(); } // selects N.this, not O.this \n"+
- " } \n"+
- " new N(); \n"+
- " } \n"+
- "} \n"
- },
- "[X$1$N]");
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().f(); \n"+
- " } \n"+
- " void f () { \n"+
- " class C { \n"+
- " C() { \n"+
- " System.out.println(\"[\"+X.this.getClass().getName()+\"]\"); \n"+
- " } \n"+
- " } \n"+
- " class N extends X { \n"+
- " { new C(); } // selects N.this, not O.this \n"+
- " } \n"+
- " new N(); \n"+
- " } \n"+
- "} \n"
- },
- "[X$1N]");
-}
-
-public void test088() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " class Middle { \n"+
- " class Inner { \n"+
- " } \n"+
- " } \n"+
- " class M extends Middle.Inner { \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " class M extends Middle.Inner { \n" +
- " ^\n" +
- "No enclosing instance of type X.Middle is accessible to invoke the super constructor. Must define a constructor and explicitly qualify its super constructor invocation with an instance of X.Middle (e.g. x.super() where x is an instance of X.Middle).\n" +
- "----------\n");
-}
-
-public void test089() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " static class Middle { \n"+
- " static class Inner { \n"+
- " } \n"+
- " } \n"+
- " class M extends Middle.Inner { \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new M(); \n" +
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-public void test090() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " void foo() { \n"+
- " class Middle { \n"+
- " class Inner { \n"+
- " } \n"+
- " } \n"+
- " class M extends Middle.Inner { \n"+
- " M() { \n"+
- " new Middle().super(); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().foo(); \n" +
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-// ensure that local member empty constructor gets implicit constructor call
-public void test091() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " Object o = new Object() { \n"+
- " class Inner { \n"+
- " private Inner() {} \n"+
- " } \n"+
- " }.new Inner(){}; \n"+
- " public static void main(String[] arguments) { \n"+
- " new X(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS");
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=29636
- * ensure first anonymous is X$1(extends X), last is X$2(extends A)
- */
-public void test092() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " class A { \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " System.out.println(\"[\"+new X(){}.new A(){}.getClass().getName()+\"]\"); \n"+
- " } \n"+
- "} \n",
- },
- "[X$2]");
-}
-
-public void test093() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " System.out.println(X.this); \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(X.this); \n" +
- " ^^^^^^\n" +
- "Cannot use this in a static context \n" +
- "----------\n");
-}
-
-public void test094() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " class Y {} \n"+
- " public static void main(String[] arguments) { \n"+
- " int i = 0; \n"+
- " i.new Y(); \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " i.new Y(); \n" +
- " ^\n" +
- "Cannot use an expression of the type int as a valid enclosing instance\n" +
- "----------\n");
-}
-//http://bugs.eclipse.org/bugs/show_bug.cgi?id=30280
-public void test095() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " class Y {} \n"+
- " public static void main(String[] arguments) { \n"+
- " int i = 0; \n"+
- " i.new Y(){}; \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " i.new Y(){}; \n" +
- " ^\n" +
- "Cannot use an expression of the type int as a valid enclosing instance\n" +
- "----------\n");
-}
-public void test096() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " static class Y {} \n"+
- " void foo() { \n"+
- " new X().new Y(){}; \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " new X().new Y(){}; \n" +
- " ^^^^^^^\n" +
- "Illegal enclosing instance specification for type X.Y\n" +
- "----------\n");
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=35456
- */
-public void test097() {
- this.runConformTest(
- new String[] {
- "apples/Base.java",
- "package apples; \n" +
- "public class Base { \n"+
- " protected String foo = \"SUCCESS\"; \n" +
- " public static void main(String[] args){ \n"+
- " new oranges.Derived().new Inner(new oranges.Derived()).bug(); \n"+
- " } \n"+
- "} \n",
- "oranges/Derived.java",
- "package oranges; \n"+
- "import apples.*; \n"+
- "public class Derived extends Base { \n"+
- " public class Inner { \n"+
- " Derived c = null; \n"+
- " public Inner(Derived c) { \n"+
- " this.c = c; \n"+
- " } \n"+
- " public void bug() { \n"+
- " // The following reference to Base.foo causes the \n"+
- " // VerifyError \n"+
- " System.out.println(c.foo); \n"+
- " } \n"+
- " } \n"+
- "} \n",
- },
- "SUCCESS");
-}
-
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33751
- */
-public void test098() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] args) { \n"+
- " System.out.println(\"first inner class = \" + new Object() {}.getClass()); \n"+
- " if (true) { \n"+
- " System.out.println(\"Always true\"); \n"+
- " } else { \n"+
- " System.out.println(\"unreachable inner class = \" + new Object() {}.getClass()); \n"+
- " } \n"+
- " System.out.println(\"last inner class = \" + new Object() {}.getClass()); \n"+
- " } \n"+
- "} \n",
- },
- "first inner class = class X$1\n" +
- "Always true\n" +
- "last inner class = class X$2");
-}
-
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40240
- */
-public void test099() {
- this.runConformTest(
- new String[] {
- "Y.java",
- "public class Y { \n" +
- " public static void main(String[] args) { \n" +
- " class Local {} \n"+
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- "} \n",
- },
- "SUCCESS");
-
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.complianceLevel <= ClassFileConstants.JDK1_4) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String argv[]) { \n" +
- " Object a = new Y$1$Local(); // compile-time error \n" +
- " } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Object a = new Y$1$Local(); // compile-time error \n" +
- " ^^^^^^^^^\n" +
- "The nested type Y$1$Local cannot be referenced using its binary name\n" +
- "----------\n",
- null,
- false);
- return;
- }
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String argv[]) { \n" +
- " Object a = new Y$1Local(); // compile-time error \n" +
- " } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Object a = new Y$1Local(); // compile-time error \n" +
- " ^^^^^^^^\n" +
- "The nested type Y$1Local cannot be referenced using its binary name\n" +
- "----------\n",
- null,
- false);
-}
-
-/*
- * Check that member type allocation is granted access to compatible enclosing instance available as constructor argument
- */
-public void test101() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X(null).new M(null);\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " class M extends Top {\n" + // no issue if M is unrelated to X
- " M() {\n" +
- " super(null);\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new M(){});\n" +
- " }\n" +
- " }\n" +
- " class Top {\n" +
- " Top(Object o) {\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-
-/*
- * Check that direct member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test102() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- " class M extends X {\n" +
- " M() {\n" +
- " super(null); //1\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new M());//2\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-
-/*
- * Check that indirect member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test104() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X(null).new M(null);\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " class N extends X {\n" +
- " N() {\n" +
- " super(null); //1\n" +
- " }\n" +
- " N(Object o) {\n" +
- " super(new M());//2\n" +
- " }\n" +
- " }\n" +
- " class M extends X {\n" +
- " M() {\n" +
- " super(null); //3\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new M());//4\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 21)\n" +
- " super(new M());//4\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-public void test107() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static class Y { \n" +
- " public Y(Z z) {} \n" +
- " } \n" +
- " public interface Z {} \n" +
- "} \n" +
- "\n" +
- "class A { \n" +
- " private static class B extends X.Y implements X.Z { \n" +
- " B(A a) { \n" +
- " super(B.this); \n" +
- " } \n" +
- " } \n" +
- "} ",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 9)\n" +
- " private static class B extends X.Y implements X.Z { \n" +
- " ^\n" +
- "The type A.B is never used locally\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " super(B.this); \n" +
- " ^^^^^^\n" +
- "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" +
- "----------\n");
-}
-
- // javac 1.4.2 incorrectly accepts it, jikes rejects it as we do
-public void test108() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel == ClassFileConstants.JDK1_4) { // 1.3 and 1.5 both accept it
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " {\n" +
- " class Local1 extends X {\n" +
- " }\n" +
- " class Local2 extends Local1 {\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " class Local2 extends Local1 {\n" +
- " ^^^^^^\n" +
- "The type Local2 is never used locally\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " class Local2 extends Local1 {\n" +
- " ^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " {\n" +
- " class Local1 extends X {\n" +
- " }\n" +
- " class Local2 extends Local1 {\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- "");
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44538
-public void test109() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel == ClassFileConstants.JDK1_4) { // 1.3 and 1.5 both accept it
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void bar() {\n" +
- " class C extends X {\n" +
- " public void foo() {\n" +
- " \n" +
- " }\n" +
- " }\n" +
- " X a= new X() {\n" +
- " public void foo() {\n" +
- " \n" +
- " }\n" +
- " };\n" +
- " class D extends C {\n" +
- " \n" +
- " };\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " public void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type C is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " public void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type new X(){} is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 13)\n" +
- " class D extends C {\n" +
- " ^\n" +
- "The type D is never used locally\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " class D extends C {\n" +
- " ^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void bar() {\n" +
- " class C extends X {\n" +
- " public void foo() {\n" +
- " \n" +
- " }\n" +
- " }\n" +
- " X a= new X() {\n" +
- " public void foo() {\n" +
- " \n" +
- " }\n" +
- " };\n" +
- " class D extends C {\n" +
- " \n" +
- " };\n" +
- " }\n" +
- "}"
- },
- "");
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44715 - NPE when generating fake reachable local type
-public void test110() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " if (true) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return;\n" +
- " }\n" +
- " class ShouldNotBeGenerated {\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44715 - variation with anonymous type
-public void test111() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " if (true) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return;\n" +
- " }\n" +
- " new Object() {}; \n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-public void test112() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " private Object t;\n" +
- " X(Object t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X(\"OUTER\").bar();\n" +
- " }\n" +
- " void bar() {\n" +
- " new X(this) {\n" +
- " void run() {\n" +
- " new Object() {\n" +
- " void run() {\n" +
- " System.out.println(t);\n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- "}\n"
- },
- "OUTER");
-}
-public void test113() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " private Object t;\n" +
- " X(Object t) {\n" +
- " this.t = t;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X(\"OUTER\").bar();\n" +
- " }\n" +
- " void bar() {\n" +
- " new X(this) {\n" +
- " void run() {\n" +
- " new Object() {\n" +
- " void run() {\n" +
- " try { \n" +
- " X x = (X) t; \n" +
- " } catch(ClassCastException e){ \n" +
- " System.out.println(\"SUCCESS\");\n" +
- " } \n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- "}\n"
- },
- "SUCCESS");
-}
-public void test114() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String s;\n" +
- " X(String s) {\n" +
- " this.s = s;\n" +
- " }\n" +
- " void foo() {\n" +
- " class L extends X {\n" +
- " L() {\n" +
- " super(s);\n" +
- " System.out.println(s); \n" +
- " }\n" +
- " }\n" +
- " new L();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X(\"SUCCESS\").foo(); \n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " super(s);\n" +
- " ^\n" +
- "Cannot refer to an instance field s while explicitly invoking a constructor\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=58606
-public void test115() {
- this.runConformTest(
- new String[] {
- "p2/X2.java",
- "package p2;\n" +
- "public class X2 extends p1.X1 {\n" +
- " private void foo() {\n" +
- " new p1.X1.M1() {\n" +
- " public void bar() {\n" +
- " System.out.print(X2.this.field);\n" +
- " X2.this.doit();\n" +
- " }\n" +
- " }.bar();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X2 t2 = new X2();\n" +
- " t2.foo();\n" +
- " }\n" +
- "}",
- "p1/X1.java",
- "package p1;\n" +
- "public class X1 {\n" +
- " public abstract class M1 {\n" +
- " public abstract void bar();\n" +
- " }\n" +
- " protected static String field = \"SUCC\";\n" +
- " protected static void doit() {\n" +
- " System.out.println(\"ESS\");\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=68698
-public void test116() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Display {\n" +
- " public interface Bla {\n" +
- " void a();\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " void aMethod() {\n" +
- " Display display = null;\n" +
- " display.new Bla() {\n" +
- " };\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " display.new Bla() {\n" +
- " ^^^^^^^\n" +
- "Illegal enclosing instance specification for type Display.Bla\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " display.new Bla() {\n" +
- " ^^^^^\n" +
- "The type new Display.Bla(){} must implement the inherited abstract method Display.Bla.a()\n" +
- "----------\n");
-}
-
-public void test117() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " new X().bar();\n" +
- " }\n" +
- " void bar() {\n" +
- " new X(){\n" +
- " void baz() {\n" +
- " new M();\n" +
- " }\n" +
- " }.baz();\n" +
- " }\n" +
- " class M {\n" +
- " M() {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-
-public void test118() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {}\n" +
- " class M {\n" +
- " M(Object o) {}\n" +
- " M() {\n" +
- " this(new Object() {\n" +
- " void baz() {\n" +
- " foo();\n" +
- " bar();\n" +
- " }\n" +
- " });\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo();\n" +
- " bar();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " void bar() {}\n" +
- " void baz() {\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo();\n" +
- " bar();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " bar();\n" +
- " ^^^\n" +
- "Cannot refer to an instance method while explicitly invoking a constructor\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 22)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n");
-}
-public void test119() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel < ClassFileConstants.JDK1_5) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new X().new M();\n" +
- " }\n" +
- " void foo(String s) { System.out.print(\"<foo:\"+s+\">\"); }\n" +
- " class M {\n" +
- " M(Runnable r) { r.run(); }\n" +
- " M() {\n" +
- " this(new Runnable() {\n" +
- " public void run() {\n" +
- " foo(\"0\");\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- "// foo(\"1\");\n" +
- " }\n" +
- " };\n" +
- " class Local {\n" +
- " void baz() {\n" +
- "// foo(\"2\");\n" +
- " }\n" +
- " } \n" +
- " new Local();\n" +
- " }\n" +
- " });\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo(\"3\");\n" +
- " bar(\"3\");\n" +
- " }\n" +
- " }.baz();\n" +
- " }\n" +
- " void bar(String s) { System.out.print(\"<bar:\"+s+\">\"); }\n" +
- " void baz() {\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo(\"4\");\n" +
- " bar(\"4\");\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " foo(\"0\");\n" +
- " ^^^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 18)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type Local is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 35)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n");
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new X().new M();\n" +
- " }\n" +
- " void foo(String s) { System.out.print(\"<foo:\"+s+\">\"); }\n" +
- " class M {\n" +
- " M(Runnable r) { r.run(); }\n" +
- " M() {\n" +
- " this(new Runnable() {\n" +
- " public void run() {\n" +
- " foo(\"0\");\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- "// foo(\"1\");\n" +
- " }\n" +
- " };\n" +
- " class Local {\n" +
- " void baz() {\n" +
- "// foo(\"2\");\n" +
- " }\n" +
- " } \n" +
- " new Local();\n" +
- " }\n" +
- " });\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo(\"3\");\n" +
- " bar(\"3\");\n" +
- " }\n" +
- " }.baz();\n" +
- " }\n" +
- " void bar(String s) { System.out.print(\"<bar:\"+s+\">\"); }\n" +
- " void baz() {\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo(\"4\");\n" +
- " bar(\"4\");\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "<foo:0><foo:3><bar:3>");
-}
-public void test120() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel < ClassFileConstants.JDK1_5) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {}\n" +
- " class M {\n" +
- " M(Object o) {}\n" +
- " M() {\n" +
- " this(new Object() {\n" +
- " void baz() {\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo(); //0\n" +
- " }\n" +
- " };\n" +
- " class Local {\n" +
- " void baz() {\n" +
- " foo(); //1\n" +
- " }\n" +
- " }\n" +
- " new Local();\n" +
- " foo();//2\n" +
- " }\n" +
- " });\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo();//3\n" +
- " bar();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " void bar() {}\n" +
- " void baz() {\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo();//4\n" +
- " bar();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " foo(); //0\n" +
- " ^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 14)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type Local is never used locally\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 15)\n" +
- " foo(); //1\n" +
- " ^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 19)\n" +
- " foo();//2\n" +
- " ^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 23)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 32)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n");
- return;
- }
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {}\n" +
- " class M {\n" +
- " M(Object o) {}\n" +
- " M() {\n" +
- " this(new Object() {\n" +
- " void baz() {\n" +
- " class Local {\n" +
- " void baz() {\n" +
- " foo(); //1\n" +
- " }\n" +
- " }\n" +
- " new Local();\n" +
- " foo();//2\n" +
- " }\n" +
- " });\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo();//3\n" +
- " bar();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " void bar() {}\n" +
- " void baz() {\n" +
- " new Object() {\n" +
- " void baz() {\n" +
- " foo();//4\n" +
- " bar();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type Local is never used locally\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " foo(); //1\n" +
- " ^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 18)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 27)\n" +
- " void baz() {\n" +
- " ^^^^^\n" +
- "The method baz() from the type new Object(){} is never used locally\n" +
- "----------\n");
-}
-public void test121() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- " class M extends X {\n" +
- " M() {\n" +
- " super(null); //1\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new X(null){});//2\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "");
-}
-public void _test122() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel < ClassFileConstants.JDK1_5) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new X().new M();\n" +
- " }\n" +
- " void foo(String s) { System.out.print(\"<foo:\"+s+\">\"); }\n" +
- " class M {\n" +
- " M(Runnable r) { r.run(); }\n" +
- " M() {\n" +
- " this(new Runnable() {\n" +
- " {\n" +
- " foo(\"0\");\n" +
- " bar(\"0\");\n" +
- " }\n" +
- " public void run() {\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " void bar(String s) { System.out.print(\"<bar:\"+s+\">\"); }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "cannot access foo(0)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " bar(\"0\");\n" +
- " ^^^\n" +
- "Cannot refer to an instance method while explicitly invoking a constructor\n" +
- "----------\n");
- return;
- }
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new X().new M();\n" +
- " }\n" +
- " void foo(String s) { System.out.print(\"<foo:\"+s+\">\"); }\n" +
- " class M {\n" +
- " M(Runnable r) { r.run(); }\n" +
- " M() {\n" +
- " this(new Runnable() {\n" +
- " {\n" +
- " foo(\"0\");\n" +
- " bar(\"0\");\n" +
- " }\n" +
- " public void run() {\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " void bar(String s) { System.out.print(\"<bar:\"+s+\">\"); }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " bar(\"0\");\n" +
- " ^^^\n" +
- "Cannot refer to an instance method while explicitly invoking a constructor\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=110182 - variation
-public void test123() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " public static final boolean b = false;\n" +
- "}\n" +
- "public class X {\n" +
- " private static Y y = new Y(); \n" +
- " private static Object o = new Object(); \n" +
- "\n" +
- " static class Z {\n" +
- " Z() {\n" +
- " if (y.b) {\n" +
- " System.out.println(\"dead code\");\n" +
- " }\n" +
- " }\n" +
- " public int bar() {\n" +
- " if (y.b) {\n" +
- " System.out.println(\"dead code\");\n" +
- " }\n" +
- " System.out.println(\"bar\");\n" +
- " return 0;\n" +
- " }\n" +
- " }\n" +
- " static int foo() {\n" +
- " synchronized(o) { \n" +
- " Z z = new Z();\n" +
- " return z.bar();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " foo();\n" +
- " }\n" +
- "}\n",
- },
- "bar");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=77473
-public void test124() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Foo foo = new Foo();\n" +
- " try {\n" +
- " foo.frob(Baz.class);\n" +
- " System.out.println(\"FAILED\");\n" +
- " } catch(IllegalAccessException e){\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- " private static class Baz {\n" +
- " }\n" +
- "}\n" +
- "class Foo {\n" +
- " public void frob(Class cls) throws Exception {\n" +
- " Object o = cls.newInstance();\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=77473 - variation
-public void test125() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo(final String s) {\n" +
- " class Local {\n" +
- " private Local() {}\n" +
- " void bar() {\n" +
- " System.out.println(s);\n" +
- " }\n" +
- " }\n" +
- " new Local().bar();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
- // check private constructor outcome (if >= 1.4 modifier change, if 1.3 synthetic emulation)
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
-
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=130117
-public void test126() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel < ClassFileConstants.JDK1_5) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public interface X {\n" +
- " private class Inner {}\n" +
- " private interface IInner {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " private class Inner {}\n" +
- " ^^^^^\n" +
- "The interface member type Inner can only be public\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " private interface IInner {}\n" +
- " ^^^^^^\n" +
- "The interface member type IInner can only be public\n" +
- "----------\n");
- return;
- }
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public interface X {\n" +
- " private class Inner {}\n" +
- " private interface IInner {}\n" +
- " private enum EInner {}\n" +
- " private @interface AInner {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " private class Inner {}\n" +
- " ^^^^^\n" +
- "The interface member type Inner can only be public\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " private interface IInner {}\n" +
- " ^^^^^^\n" +
- "The interface member type IInner can only be public\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " private enum EInner {}\n" +
- " ^^^^^^\n" +
- "The interface member type EInner can only be public\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " private @interface AInner {}\n" +
- " ^^^^^^\n" +
- "The interface member type AInner can only be public\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89347
-public void test127() {
- this.runConformTest(
- new String[] {
- "p/BugContainer.java",
- "package p;\n" +
- "\n" +
- "public abstract class BugContainer {\n" +
- " protected static class InternalInfo$ {\n" +
- " public InternalInfo$() {}\n" +
- " }\n" +
- " abstract protected InternalInfo$ getInfo();\n" +
- "}\n", // =================
- },
- "");
- this.runConformTest(
- new String[] {
- "q/BugUser.java", // =================
- "package q;\n" +
- "\n" +
- "import p.BugContainer;\n" +
- "\n" +
- "public class BugUser extends BugContainer{\n" +
- " protected InternalInfo$ getInfo() {\n" +
- " return new InternalInfo$();\n" +
- " }\n" +
- "}", // =================
- },
- "",
- null,
- false,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89347 - variation
-public void test128() {
- this.runConformTest(
- new String[] {
- "p/BugContainer.java",
- "package p;\n" +
- "\n" +
- "public abstract class BugContainer {\n" +
- " protected static class InternalInfo$ {\n" +
- " public InternalInfo$() {}\n" +
- " }\n" +
- " abstract protected InternalInfo$ getInfo();\n" +
- "}\n", // =================
- "q/BugUser.java", // =================
- "package q;\n" +
- "\n" +
- "import p.BugContainer;\n" +
- "\n" +
- "public class BugUser extends BugContainer{\n" +
- " protected InternalInfo$ getInfo() {\n" +
- " return new InternalInfo$();\n" +
- " }\n" +
- "}", // =================
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=160132 - variation
-public void test129() {
- this.runConformTest(
- new String[] {
- "X.java", //========================
- "public interface X {\n" +
- " interface Entry {\n" +
- " interface Internal extends Entry {\n" +
- " Internal createEntry();\n" +
- " }\n" +
- " }\n" +
- "}\n", //========================
- "Y.java",
- "public class Y implements X.Entry.Internal {\n" +
- " public Internal createEntry() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" , //========================
- },
- "");
- // compile Y against X binary
- this.runConformTest(
- new String[] {
- "Y.java", //========================
- "public class Y implements X.Entry.Internal {\n" +
- " public Internal createEntry() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" , //========================
- },
- "",
- null,
- false,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164497
-public void test130() {
- CompilerOptions options = new CompilerOptions(getCompilerOptions());
- if (options.sourceLevel <= ClassFileConstants.JDK1_3) {
- this.runConformTestThrowingError(
- new String[] {
- "X.java", //========================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new M().foo2();\n" +
- " }\n" +
- "}\n"+
- "class M {\n" +
- " String name;\n" +
- " \n" +
- " M() {\n" +
- " this.name = \"SUCCESS\";\n" +
- " }\n" +
- "\n" +
- " private class Y extends N {\n" +
- " private Y() {\n" +
- " super();\n" +
- " }\n" +
- " protected void foo(Z z) {\n" +
- " z.bar(new A());\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public class A implements I {\n" +
- " public void configure() {\n" +
- " new B().foo();\n" +
- " }\n" +
- " public class B {\n" +
- " public void foo() {\n" +
- " try {\n" +
- " System.out.println(M.this.name);\n" +
- " } catch(NullPointerException e) {\n" +
- " System.err.println(\"NPE THROWN\");\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void foo2() {\n" +
- " new Y();\n" +
- " }\n" +
- "}\n" +
- "class Z {\n" +
- " void bar(I i) {\n" +
- " i.configure();\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface I {\n" +
- " void configure();\n" +
- "}\n" +
- "\n" +
- "class N {\n" +
- " protected void foo(Z z) {\n" +
- " }\n" +
- " N() {\n" +
- " this.foo(new Z());\n" +
- " }\n" +
- "}\n"
- },
- "NPE THROWN",
- null,
- true,
- null);
- return;
- }
- this.runConformTest(
- new String[] {
- "X.java", //========================
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new M().foo2();\n" +
- " }\n" +
- "}\n"+
- "class M {\n" +
- " String name;\n" +
- " \n" +
- " M() {\n" +
- " this.name = \"SUCCESS\";\n" +
- " }\n" +
- "\n" +
- " private class Y extends N {\n" +
- " private Y() {\n" +
- " super();\n" +
- " }\n" +
- " protected void foo(Z z) {\n" +
- " z.bar(new A());\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public class A implements I {\n" +
- " public void configure() {\n" +
- " new B().foo();\n" +
- " }\n" +
- " public class B {\n" +
- " public void foo() {\n" +
- " System.out.println(M.this.name);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void foo2() {\n" +
- " new Y();\n" +
- " }\n" +
- "}\n" +
- "class Z {\n" +
- " void bar(I i) {\n" +
- " i.configure();\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface I {\n" +
- " void configure();\n" +
- "}\n" +
- "\n" +
- "class N {\n" +
- " protected void foo(Z z) {\n" +
- " }\n" +
- " N() {\n" +
- " this.foo(new Z());\n" +
- " }\n" +
- "}\n"
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=165662
-public void test131() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " class Local {\n" +
- " Local(int i) {\n" +
- " this.init(i);\n" +
- " this.bar(); // should detect error\n" +
- " }\n" +
- " void init(int i) {\n" +
- " }\n" +
- " }\n" +
- " Local l = new Local(0); // should be fine\n" +
- " }\n" +
- " Local l = new Local();\n" +
- " l.foo();\n" +
- " }\n" +
- "}", // =================,
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " class Local {\n" +
- " ^^^^^\n" +
- "Duplicate nested type Local\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " this.bar(); // should detect error\n" +
- " ^^^\n" +
- "The method bar() is undefined for the type Local\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=165662
-public void test132() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " class Local {}\n" +
- " class Foo {\n" +
- " void foo() {\n" +
- " class Local {}\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}", // =================
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class Local {}\n" +
- " ^^^^^\n" +
- "The type Local is never used locally\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " class Foo {\n" +
- " ^^^\n" +
- "The type Foo is never used locally\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type Foo is never used locally\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 6)\n" +
- " class Local {}\n" +
- " ^^^^^\n" +
- "The type Local is hiding the type Local\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 6)\n" +
- " class Local {}\n" +
- " ^^^^^\n" +
- "The type Local is never used locally\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331
-public void test133() {
- if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
- this.runConformTest(
- new String[] {
- "X.java", //===================
- "public class X {\n" +
- " public static interface I {\n" +
- " }\n" +
- " public static interface IE extends I {\n" +
- " }\n" +
- " public static interface J {\n" +
- " I getI(int i);\n" +
- " }\n" +
- " public static interface JE extends J {\n" +
- " IE getI(int i);\n" +
- " }\n" +
- " public static class Y implements JE {\n" +
- " public IE getI(int i) {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " private J j = new Y();\n" +
- " public void foo() {\n" +
- " j.getI(0);\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- "}", // =================
- },
- "SUCCESS");
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331
-public void test134() {
- if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
- this.runConformTest(
- new String[] {
- "X.java", //===================
- "public class X {\n" +
- " public interface I {\n" +
- " public String foo();\n" +
- " }\n" +
- " public interface J {\n" +
- " public I getI();\n" +
- " }\n" +
- " public static class XI implements I {\n" +
- " public String foo() {\n" +
- " return \"XI\";\n" +
- " }\n" +
- " }\n" +
- " public interface K extends J {\n" +
- " public XI getI();\n" +
- " }\n" +
- " public static abstract class XK implements K {\n" +
- " public XI getI() {\n" +
- " return new XI();\n" +
- " }\n" +
- " }\n" +
- " public static class Y extends XK {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " K k = new Y();\n" +
- " System.out.println(k.getI().foo());\n" +
- " J j = k;\n" +
- " System.out.println(j.getI().foo());\n" +
- " }\n" +
- "}", // =================
- },
- "XI\nXI");
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961
-public void test135() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import p.A;\n" +
- "public class X {\n" +
- " \n" +
- " void foo(Object o, Object [] os) {\n" +
- " A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
- " A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
- " }\n" +
- " private interface Outer {\n" +
- " interface Inner {\n" +
- " String variable = \"my testing\";\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Outer.Inner.variable);\n" +
- " Zork z;\n" +
- " }\n" +
- "}", // =================,
- "p/A.java",
- "package p;\n" +
- "/** @deprecated */\n" +
- "public class A {\n" +
- " public class M1 {\n" +
- " public class MM1 {\n" +
- " }\n" +
- " }\n" +
- " public class M2 extends M1 {\n" +
- " }\n" +
- "}", // =================,
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 2)\n" +
- " import p.A;\n" +
- " ^^^\n" +
- "The type A is deprecated\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 6)\n" +
- " A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
- " ^^^^^^^^\n" +
- "The type A is deprecated\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 6)\n" +
- " A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
- " ^^^^^^^^\n" +
- "The type A.M2 is deprecated\n" +
- "----------\n" +
- "4. WARNING in p\\X.java (at line 6)\n" +
- " A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
- " ^^^^^^^^\n" +
- "The type A.M1.MM1 is deprecated\n" +
- "----------\n" +
- "5. WARNING in p\\X.java (at line 6)\n" +
- " A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
- " ^\n" +
- "The type A is deprecated\n" +
- "----------\n" +
- "6. WARNING in p\\X.java (at line 6)\n" +
- " A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
- " ^^^^\n" +
- "The type A.M2 is deprecated\n" +
- "----------\n" +
- "7. WARNING in p\\X.java (at line 6)\n" +
- " A.M2.MM1 mm1 = (A.M2.MM1) o;\n" +
- " ^^^^^^^^\n" +
- "The type A.M1.MM1 is deprecated\n" +
- "----------\n" +
- "8. WARNING in p\\X.java (at line 7)\n" +
- " A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
- " ^^^^^^^^\n" +
- "The type A is deprecated\n" +
- "----------\n" +
- "9. WARNING in p\\X.java (at line 7)\n" +
- " A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
- " ^^^^^^^^\n" +
- "The type A.M2 is deprecated\n" +
- "----------\n" +
- "10. WARNING in p\\X.java (at line 7)\n" +
- " A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
- " ^^^^^^^^\n" +
- "The type A.M1.MM1 is deprecated\n" +
- "----------\n" +
- "11. WARNING in p\\X.java (at line 7)\n" +
- " A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
- " ^^^^^^^^\n" +
- "The type A is deprecated\n" +
- "----------\n" +
- "12. WARNING in p\\X.java (at line 7)\n" +
- " A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
- " ^^^^^^^^\n" +
- "The type A.M2 is deprecated\n" +
- "----------\n" +
- "13. WARNING in p\\X.java (at line 7)\n" +
- " A.M2.MM1[] mm1s = (A.M2.MM1[]) os;\n" +
- " ^^^^^^^^\n" +
- "The type A.M1.MM1 is deprecated\n" +
- "----------\n" +
- "14. ERROR in p\\X.java (at line 16)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961 - variation
-public void test136() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " private interface Outer {\n" +
- " interface Inner {\n" +
- " String variable = \"my testing\";\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Outer.Inner variable = null;\n" +
- " System.out.println(variable);\n" +
- " Zork z;\n" +
- " }\n" +
- "}", // =================,
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961 - variation
-public void test137() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " private interface Outer {\n" +
- " interface Inner {\n" +
- " String variable = \"my testing\";\n" +
- " }\n" +
- " }\n" +
- " private interface Outer2 extends Outer {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(Outer2.Inner.variable);\n" +
- " Zork z;\n" +
- " }\n" +
- "}", // =================,
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961 - variation
-public void test138() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "public class X {\n" +
- " private interface Outer {\n" +
- " interface Inner {\n" +
- " String variable = \"my testing\";\n" +
- " }\n" +
- " }\n" +
- " private interface Outer2 extends Outer {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Outer2.Inner variable = null;\n" +
- " System.out.println(variable);\n" +
- " Zork z;\n" +
- " }\n" +
- "}", // =================,
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961 - variation
-public void test139() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " private class A {\n" +
- " class B {}\n" +
- " }\n" +
- " private class Y extends A {\n" +
- " }\n" +
- " Y.B d = null;\n" +
- "}\n" +
- "class Y extends Zork {}\n", // =================
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " private class Y extends A {\n" +
- " ^\n" +
- "Access to enclosing constructor X.A() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " class Y extends Zork {}\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test140() {
- this.runConformTest(new String[] {
- "p/A.java",
- "package p;\n" +
- "public class A {\n" +
- " public static interface I {\n" +
- " void foo();\n" +
- " }\n" +
- "}",
- "p1/X.java",
- "package p1;\n" +
- "import p.A;\n" +
- "public class X implements A.I {\n" +
- " public void foo() { /* dummy */ }\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #5 p/A$I, outer class info: #20 p/A\n" +
- " inner name: #22 I, accessflags: 1545 public abstract static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p1" + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test141() {
- this.runConformTest(new String[] {
- "p/A.java",
- "package p;\n" +
- "public class A {\n" +
- " public static class B {\n" +
- " void foo() { /* dummy */ }\n" +
- " }\n" +
- "}",
- "p1/X.java",
- "package p1;\n" +
- "import p.A;\n" +
- "public class X extends A.B {\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #3 p/A$B, outer class info: #17 p/A\n" +
- " inner name: #19 B, accessflags: 9 public static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p1" + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test142() {
- this.runConformTest(new String[] {
- "p/A.java",
- "package p;\n" +
- "public class A {\n" +
- " public class B {\n" +
- " void foo() { /* dummy */ }\n" +
- " }\n" +
- "}",
- "p1/X.java",
- "package p1;\n" +
- "import p.A;\n" +
- "public class X {\n" +
- " Object foo() {\n" +
- " return new A().new B();\n" +
- " }\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #16 p/A$B, outer class info: #18 p/A\n" +
- " inner name: #31 B, accessflags: 1 public]\n";
- if (new CompilerOptions(this.getCompilerOptions()).targetJDK == ClassFileConstants.JDK1_1) {
- expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #16 p/A$B, outer class info: #18 p/A\n" +
- " inner name: #27 B, accessflags: 1 public]\n";
- }
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p1" + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test143() {
- this.runConformTest(new String[] {
- "X.java",
- "class A {\n" +
- " public class B {\n" +
- " void foo() { /* dummy */ }\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " Object foo() {\n" +
- " return A.B.class;\n" +
- " }\n" +
- "}"
- });
- if (new CompilerOptions(this.getCompilerOptions()).targetJDK >= ClassFileConstants.JDK1_5) {
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #16 A$B, outer class info: #21 A\n" +
- " inner name: #23 B, accessflags: 1 public]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test144() {
- this.runConformTest(new String[] {
- "X.java",
- "class A {\n" +
- " public static class B {\n" +
- " public static int CONST = 0;\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " int foo() {\n" +
- " return A.B.CONST;\n" +
- " }\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #17 A$B, outer class info: #25 A\n" +
- " inner name: #27 B, accessflags: 9 public static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test145() {
- this.runConformTest(new String[] {
- "X.java",
- "class A {\n" +
- " public static class B {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " A.B field;\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #19 A$B, outer class info: #21 A\n" +
- " inner name: #23 B, accessflags: 9 public static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test146() {
- this.runConformTest(new String[] {
- "X.java",
- "class A {\n" +
- " public static class B {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " int foo(A.B o) {\n" +
- " return 0;\n" +
- " }\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #21 A$B, outer class info: #23 A\n" +
- " inner name: #25 B, accessflags: 9 public static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test147() {
- this.runConformTest(new String[] {
- "X.java",
- "class A {\n" +
- " public static class B {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " A.B foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #19 A$B, outer class info: #21 A\n" +
- " inner name: #23 B, accessflags: 9 public static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184
-public void test148() {
- this.runConformTest(new String[] {
- "X.java",
- "class A {\n" +
- " public static class B extends Exception {\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " void foo() throws A.B{\n" +
- " }\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #16 A$B, outer class info: #21 A\n" +
- " inner name: #23 B, accessflags: 9 public static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=171749
-public void test149() {
- this.runConformTest(new String[] {
- "X.java",
- "public final class X implements A.Foo1 {\n" +
- " public void foo() {}\n" +
- " public A.Foo2 foo2() { return null; }\n" +
- " public void foo3( A.Foo3 foo ) {}\n" +
- " public void foo4() { A.Foo4 foo = null; }\n" +
- " public void foo5() {\n" +
- " new A.Foo5() {\n" +
- " public void foo() {}\n" +
- " }.foo();\n" +
- " }\n" +
- " public static class Foo6 implements A.Foo6 {\n" +
- " public void foo() {}\n" +
- " }\n" +
- " public void foo7() { Bar2.foo7().foo(); }\n" +
- "}",
- "A.java",
- "class A {\n" +
- " public static interface Foo1 { void foo(); }\n" +
- " public static interface Foo2 { void foo(); }\n" +
- " public static interface Foo3 { void foo(); }\n" +
- " public static interface Foo4 { void foo(); }\n" +
- " public static interface Foo5 { void foo(); }\n" +
- " public static interface Foo6 { void foo(); }\n" +
- " public static interface Foo7 { void foo(); }\n" +
- "}",
- "Bar2.java",
- "class Bar2 {\n" +
- " public static A.Foo7 foo7() { return null; }\n" +
- "}"
- });
- String expectedOutput =
- " Inner classes:\n" +
- " [inner class info: #5 A$Foo1, outer class info: #44 A\n" +
- " inner name: #46 Foo1, accessflags: 1545 public abstract static],\n" +
- " [inner class info: #47 A$Foo2, outer class info: #44 A\n" +
- " inner name: #49 Foo2, accessflags: 1545 public abstract static],\n" +
- " [inner class info: #50 A$Foo3, outer class info: #44 A\n" +
- " inner name: #52 Foo3, accessflags: 1545 public abstract static],\n" +
- " [inner class info: #39 A$Foo7, outer class info: #44 A\n" +
- " inner name: #53 Foo7, accessflags: 1545 public abstract static],\n" +
- " [inner class info: #25 X$1, outer class info: #0\n" +
- " inner name: #0, accessflags: 0 default],\n" +
- " [inner class info: #54 X$Foo6, outer class info: #1 X\n" +
- " inner name: #56 Foo6, accessflags: 9 public static]\n";
- checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
-}
-public static Class testClass() {
- return InnerEmulationTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalHexFloatTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalHexFloatTest.java
deleted file mode 100644
index bef8cfc..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalHexFloatTest.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.util.FloatUtil;
-
-public class InternalHexFloatTest extends AbstractRegressionTest {
- static class DoubleTest {
- String input;
- long output;
- public DoubleTest(String input, long output) {
- this.input = input;
- this.output = output;
- }
- }
-
- static class FloatTest {
- String input;
- int output;
- public FloatTest(String input, int output) {
- this.input = input;
- this.output = output;
- }
- }
-
- public InternalHexFloatTest(String name) {
- super(name);
- }
- public static Test suite() {
- return buildMinimalComplianceTestSuite(testClass(), F_1_5);
- }
-
- public static Class testClass() {
- return InternalHexFloatTest.class;
- }
-
- /**
- */
- public void test001() {
- List x = new ArrayList();
-
- // various forms of zero
- x.add(new DoubleTest("0x0p0", 0x0L));
- x.add(new DoubleTest("0x0p0d", 0x0L));
- x.add(new DoubleTest("0x0p0D", 0x0L));
- x.add(new DoubleTest("0x0.0p0D", 0x0L));
- x.add(new DoubleTest("0x.0p0D", 0x0L));
- x.add(new DoubleTest("0x0.p0D", 0x0L));
- x.add(new DoubleTest("0x00000.00000000000p0D", 0x0L));
- x.add(new DoubleTest("0x0p99D", 0x0L));
- x.add(new DoubleTest("0x0p-99D", 0x0L));
- x.add(new DoubleTest("0x0p9999999D", 0x0L));
- x.add(new DoubleTest("0x0p-9999999D", 0x0L));
-
- // small doubles
- x.add(new DoubleTest("0x0.8p0D", 0x3fe0000000000000L));
- x.add(new DoubleTest("0x0.4p0D", 0x3fd0000000000000L));
- x.add(new DoubleTest("0x0.2p0D", 0x3fc0000000000000L));
- x.add(new DoubleTest("0x0.1p0D", 0x3fb0000000000000L));
- x.add(new DoubleTest("0x0.08p0D", 0x3fa0000000000000L));
- x.add(new DoubleTest("0x0.04p0D", 0x3f90000000000000L));
- x.add(new DoubleTest("0x0.02p0D", 0x3f80000000000000L));
- x.add(new DoubleTest("0x0.01p0D", 0x3f70000000000000L));
- x.add(new DoubleTest("0x0.010p0D", 0x3f70000000000000L));
- x.add(new DoubleTest("0x1p0D", 0x3ff0000000000000L));
- x.add(new DoubleTest("0x2p0D", 0x4000000000000000L));
- x.add(new DoubleTest("0x4p0D", 0x4010000000000000L));
- x.add(new DoubleTest("0x8p0D", 0x4020000000000000L));
- x.add(new DoubleTest("0x10p0D", 0x4030000000000000L));
- x.add(new DoubleTest("0x20p0D", 0x4040000000000000L));
- x.add(new DoubleTest("0x40p0D", 0x4050000000000000L));
- x.add(new DoubleTest("0x80p0D", 0x4060000000000000L));
- x.add(new DoubleTest("0x80.p0D", 0x4060000000000000L));
- x.add(new DoubleTest("0x80.8p0D", 0x4060100000000000L));
- x.add(new DoubleTest("0x80.80p0D", 0x4060100000000000L));
- x.add(new DoubleTest("0x123456789p0D", 0x41f2345678900000L));
- x.add(new DoubleTest("0xabcedfp0D", 0x416579dbe0000000L));
- x.add(new DoubleTest("0xABCDEFp0D", 0x416579bde0000000L));
-
- x.add(new DoubleTest("0x0.0100000000000000000000000000000000000000000000000p0d", 0x3f70000000000000L));
- x.add(new DoubleTest("0x0.0000000000000000000000000000000000000000000000001p0d", 0x33b0000000000000L));
- x.add(new DoubleTest("0x10000000000000000000000000000000000000000000000000000p0d", 0x4cf0000000000000L));
-
- // rounding to 53 bits
- x.add(new DoubleTest("0x823456789012380p0d", 0x43a0468acf120247L));
- x.add(new DoubleTest("0xFFFFFFFFFFFFF80p0d", 0x43afffffffffffffL));
- x.add(new DoubleTest("0xFFFFFFFFFFFFFC0p0d", 0x43b0000000000000L));
- x.add(new DoubleTest("0xFFFFFFFFFFFFFA0p0d", 0x43afffffffffffffL));
- x.add(new DoubleTest("0xFFFFFFFFFFFFF81p0d", 0x43afffffffffffffL));
- x.add(new DoubleTest("0x123456789abcd10p0d", 0x43723456789abcd1L));
- x.add(new DoubleTest("0x123456789abcd18p0d", 0x43723456789abcd2L));
- x.add(new DoubleTest("0x7FFFFFFFFFFFFC0p0d", 0x439fffffffffffffL));
- x.add(new DoubleTest("0x7FFFFFFFFFFFFE0p0d", 0x43a0000000000000L));
- x.add(new DoubleTest("0x3FFFFFFFFFFFFE0p0d", 0x438fffffffffffffL));
- x.add(new DoubleTest("0x3FFFFFFFFFFFFF0p0d", 0x4390000000000000L));
- x.add(new DoubleTest("0x1FFFFFFFFFFFFF0p0d", 0x437fffffffffffffL));
- x.add(new DoubleTest("0x1FFFFFFFFFFFFF8p0d", 0x4380000000000000L));
-
- // rounding to overflow at +1024; denormalized at -1022; underflow at -1075
- x.add(new DoubleTest("0x1p5000D", 0x7ff0000000000000L));
- x.add(new DoubleTest("0x1p-5000D", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x1.0p1022d", 0x7fd0000000000000L));
- x.add(new DoubleTest("0x1.0p1023d", 0x7fe0000000000000L));
- x.add(new DoubleTest("0x1.0p1024d", 0x7ff0000000000000L));
- x.add(new DoubleTest("0x1.0p-1022d", 0x0010000000000000L));
- x.add(new DoubleTest("0x1.0p-1023d", 0x0008000000000000L));
- x.add(new DoubleTest("0x1.0p-1024d", 0x0004000000000000L));
- x.add(new DoubleTest("0x1.0p-1074d", 0x0000000000000001L));
- x.add(new DoubleTest("0x1.0p-1075d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x1.0p-1076d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x1.0p-1077d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x1.0p-1078d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.8p1023d", 0x7fd0000000000000L));
- x.add(new DoubleTest("0x0.8p1024d", 0x7fe0000000000000L));
- x.add(new DoubleTest("0x0.8p1025d", 0x7ff0000000000000L));
- x.add(new DoubleTest("0x0.8p-1021d", 0x0010000000000000L));
- x.add(new DoubleTest("0x0.8p-1022d", 0x0008000000000000L));
- x.add(new DoubleTest("0x0.8p-1023d", 0x0004000000000000L));
- x.add(new DoubleTest("0x0.8p-1024d", 0x0002000000000000L));
- x.add(new DoubleTest("0x0.8p-1074d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.8p-1075d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.8p-1076d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.4p-1021d", 0x0008000000000000L));
- x.add(new DoubleTest("0x0.4p-1022d", 0x0004000000000000L));
- x.add(new DoubleTest("0x0.4p-1023d", 0x0002000000000000L));
- x.add(new DoubleTest("0x0.4p-1073d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.4p-1074d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.4p-1075d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.2p-1020d", 0x0008000000000000L));
- x.add(new DoubleTest("0x0.2p-1021d", 0x0004000000000000L));
- x.add(new DoubleTest("0x0.2p-1022d", 0x0002000000000000L));
- x.add(new DoubleTest("0x0.2p-1072d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.2p-1073d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.2p-1074d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.1p-1019d", 0x0008000000000000L));
- x.add(new DoubleTest("0x0.1p-1020d", 0x0004000000000000L));
- x.add(new DoubleTest("0x0.1p-1021d", 0x0002000000000000L));
- x.add(new DoubleTest("0x0.1p-1071d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.1p-1072d", 0x7ff8000000000000L));
- x.add(new DoubleTest("0x0.1p-1073d", 0x7ff8000000000000L));
-
- for (Iterator it = x.iterator(); it.hasNext();) {
- DoubleTest t = (DoubleTest) it.next();
- String s = t.input;
- long expectedBits = t.output;
- double libExpected = 0.0d;
- boolean isJ2SE5;
- try {
- // note that next line only works with a 1.5 J2SE
- libExpected = Double.parseDouble(s);
- isJ2SE5 = true;
- } catch(NumberFormatException e) {
- isJ2SE5 = false;
- }
- double dActual = FloatUtil.valueOfHexDoubleLiteral(s.toCharArray());
- long actualBits = Double.doubleToLongBits(dActual);
- if (isJ2SE5) {
- // cross-check bits computed by J2SE 1.5 library
- long libExpectedBits = Double.doubleToRawLongBits(libExpected);
- if (expectedBits != libExpectedBits) {
- if (Double.isNaN(Double.longBitsToDouble(expectedBits)) && libExpected == 0.0d) {
- // this is ok - we return NaN where lib quietly underflows to 0
- } else {
- assertEquals("Test has wrong table value for " + s, libExpectedBits, expectedBits);
- }
- }
- }
- assertEquals("Wrong double value for " + s, expectedBits, actualBits);
- }
- }
-
- /**
- */
- public void test002() {
- List x = new ArrayList();
- // various forms of zero
- x.add(new FloatTest("0x0p0f", 0x0));
- x.add(new FloatTest("0x0p0F", 0x0));
- x.add(new FloatTest("0x0.0p0F", 0x0));
- x.add(new FloatTest("0x.0p0F", 0x0));
- x.add(new FloatTest("0x0.p0F", 0x0));
- x.add(new FloatTest("0x00000.00000000000p0F", 0x0));
- x.add(new FloatTest("0x0p99F", 0x0));
- x.add(new FloatTest("0x0p-99F", 0x0));
- x.add(new FloatTest("0x0p9999999F", 0x0));
- x.add(new FloatTest("0x0p-9999999F", 0x0));
-
- // small floats
- x.add(new FloatTest("0x0.8p0F", 0x3f000000));
- x.add(new FloatTest("0x0.4p0F", 0x3e800000));
- x.add(new FloatTest("0x0.2p0F", 0x3e000000));
- x.add(new FloatTest("0x0.1p0F", 0x3d800000));
- x.add(new FloatTest("0x0.08p0F", 0x3d000000));
- x.add(new FloatTest("0x0.04p0F", 0x3c800000));
- x.add(new FloatTest("0x0.02p0F", 0x3c000000));
- x.add(new FloatTest("0x0.01p0F", 0x3b800000));
- x.add(new FloatTest("0x0.010p0F", 0x3b800000));
- x.add(new FloatTest("0x1p0F", 0x3f800000));
- x.add(new FloatTest("0x2p0F", 0x40000000));
- x.add(new FloatTest("0x4p0F", 0x40800000));
- x.add(new FloatTest("0x8p0F", 0x41000000));
- x.add(new FloatTest("0x10p0F", 0x41800000));
- x.add(new FloatTest("0x20p0F", 0x42000000));
- x.add(new FloatTest("0x40p0F", 0x42800000));
- x.add(new FloatTest("0x80p0F", 0x43000000));
- x.add(new FloatTest("0x80.p0F", 0x43000000));
- x.add(new FloatTest("0x80.8p0F", 0x43008000));
- x.add(new FloatTest("0x80.80p0F", 0x43008000));
- x.add(new FloatTest("0x123456789p0F", 0x4f91a2b4));
- x.add(new FloatTest("0xabcedfp0F", 0x4b2bcedf));
- x.add(new FloatTest("0xABCDEFp0F", 0x4b2bcdef));
-
- x.add(new FloatTest("0x0.000000000000000000000000000001p0f", 0x3800000));
- x.add(new FloatTest("0x10000000000000000000000000000000p0f", 0x7d800000));
-
- // rounding to 24 bits
- x.add(new FloatTest("0x823456p0f", 0x4b023456));
- x.add(new FloatTest("0xFFFFFF80p0f", 0x4f800000));
- x.add(new FloatTest("0xFFFFFF40p0f", 0x4f7fffff));
- x.add(new FloatTest("0xFFFFFF20p0f", 0x4f7fffff));
- x.add(new FloatTest("0x123456p0f", 0x4991a2b0));
- x.add(new FloatTest("0x7890abp0f", 0x4af12156));
- x.add(new FloatTest("0xcdefABp0f", 0x4b4defab));
- x.add(new FloatTest("0xCDEFdep0f", 0x4b4defde));
- x.add(new FloatTest("0x123456p0f", 0x4991a2b0));
- x.add(new FloatTest("0x7FFFFF8p0f", 0x4cffffff));
- x.add(new FloatTest("0x3FFFFFCp0f", 0x4c7fffff));
- x.add(new FloatTest("0x1FFFFFEp0f", 0x4bffffff));
-
- // rounding to overflow at +128; denormalized at -126; underflow at -150
- x.add(new FloatTest("0x1p5000F", 0x7f800000));
- x.add(new FloatTest("0x1p-5000F", 0x7fc00000));
- x.add(new FloatTest("0x1.0p126f", 0x7e800000));
- x.add(new FloatTest("0x1.0p127f", 0x7f000000));
- x.add(new FloatTest("0x1.0p128f", 0x7f800000));
- x.add(new FloatTest("0x1.0p129f", 0x7f800000));
- x.add(new FloatTest("0x1.0p-127f", 0x00400000));
- x.add(new FloatTest("0x1.0p-128f", 0x00200000));
- x.add(new FloatTest("0x1.0p-129f", 0x00100000));
- x.add(new FloatTest("0x1.0p-149f", 0x00000001));
- x.add(new FloatTest("0x1.0p-150f", 0x7fc00000));
- x.add(new FloatTest("0x1.0p-151f", 0x7fc00000));
- x.add(new FloatTest("0x0.8p127f", 0x7e800000));
- x.add(new FloatTest("0x0.8p128f", 0x7f000000));
- x.add(new FloatTest("0x0.8p129f", 0x7f800000));
- x.add(new FloatTest("0x0.8p-125f", 0x00800000));
- x.add(new FloatTest("0x0.8p-126f", 0x00400000));
- x.add(new FloatTest("0x0.8p-127f", 0x00200000));
- x.add(new FloatTest("0x0.8p-128f", 0x00100000));
- x.add(new FloatTest("0x0.8p-148f", 0x00000001));
- x.add(new FloatTest("0x0.8p-149f", 0x7fc00000));
- x.add(new FloatTest("0x0.8p-150f", 0x7fc00000));
- x.add(new FloatTest("0x0.4p-124f", 0x00800000));
- x.add(new FloatTest("0x0.4p-125f", 0x00400000));
- x.add(new FloatTest("0x0.4p-126f", 0x00200000));
- x.add(new FloatTest("0x0.4p-147f", 0x00000001));
- x.add(new FloatTest("0x0.4p-148f", 0x7fc00000));
- x.add(new FloatTest("0x0.4p-149f", 0x7fc00000));
- x.add(new FloatTest("0x0.4p-150f", 0x7fc00000));
- x.add(new FloatTest("0x0.2p-123f", 0x00800000));
- x.add(new FloatTest("0x0.2p-124f", 0x00400000));
- x.add(new FloatTest("0x0.2p-125f", 0x00200000));
- x.add(new FloatTest("0x0.2p-126f", 0x00100000));
- x.add(new FloatTest("0x0.2p-146f", 0x00000001));
- x.add(new FloatTest("0x0.2p-147f", 0x7fc00000));
- x.add(new FloatTest("0x0.2p-148f", 0x7fc00000));
- x.add(new FloatTest("0x0.2p-149f", 0x7fc00000));
- x.add(new FloatTest("0x0.1p-122f", 0x00800000));
- x.add(new FloatTest("0x0.1p-123f", 0x00400000));
- x.add(new FloatTest("0x0.1p-124f", 0x00200000));
- x.add(new FloatTest("0x0.1p-145f", 0x00000001));
- x.add(new FloatTest("0x0.1p-146f", 0x7fc00000));
- x.add(new FloatTest("0x0.1p-147f", 0x7fc00000));
- x.add(new FloatTest("0x0.1p-148f", 0x7fc00000));
-
- for (Iterator it = x.iterator(); it.hasNext();) {
- FloatTest t = (FloatTest) it.next();
- String s = t.input;
- int expectedBits = t.output;
- float libExpected = 0.0f;
- boolean isJ2SE5;
- try {
- // note that next line only works with a 1.5 J2SE
- libExpected = Float.parseFloat(s);
- isJ2SE5 = true;
- } catch(NumberFormatException e) {
- isJ2SE5 = false;
- }
- float dActual = FloatUtil.valueOfHexFloatLiteral(s.toCharArray());
- long actualBits = Float.floatToIntBits(dActual);
- if (isJ2SE5) {
- // cross-check bits computed by J2SE 1.5 library
- int libExpectedBits = Float.floatToRawIntBits(libExpected);
- if (expectedBits != libExpectedBits) {
- if (Float.isNaN(Float.intBitsToFloat(expectedBits)) && libExpected == 0.0f) {
- // this is ok - we return NaN where lib quietly underflows to 0
- } else {
- assertEquals("Test has wrong table value for " + s, libExpectedBits, expectedBits);
- }
- }
- }
- assertEquals("Wrong float value for " + s, expectedBits, actualBits);
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test003() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(-0Xf.aP1F);\n" +
- " }\n" +
- "}"
- },
- "-31.25");
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test004() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(0X000.0000P5000);\n" +
- " }\n" +
- "}"
- },
- "0.0");
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test005() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(-0X000.0000P5000F);\n" +
- " }\n" +
- "}"
- },
- "-0.0");
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(0X000.eP-5000F);\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " System.out.println(0X000.eP-5000F);\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The literal 0X000.eP-5000F of type float is out of range \n" +
- "----------\n");
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test007() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(0X000.eP5000F);\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " System.out.println(0X000.eP5000F);\r\n" +
- " ^^^^^^^^^^^^^\n" +
- "The literal 0X000.eP5000F of type float is out of range \n" +
- "----------\n");
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalScannerTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalScannerTest.java
deleted file mode 100644
index c3985d1..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalScannerTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.compiler.InvalidInputException;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner;
-import org.eclipse.wst.jsdt.internal.compiler.parser.TerminalTokens;
-public class InternalScannerTest extends AbstractRegressionTest {
-
- public InternalScannerTest(String name) {
- super(name);
- }
- public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
- }
-
- public static Class testClass() {
- return InternalScannerTest.class;
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23181
- */
- public void test001() {
- String source = "//Comment";
- Scanner scanner = new Scanner();
- scanner.setSource(source.toCharArray());
- int token = 0;
- try {
- token = scanner.getNextToken();
- } catch (InvalidInputException e) {
- // ignore
- }
- assertEquals("Wrong token type", TerminalTokens.TokenNameEOF, token);
- assertEquals("Wrong comment start", 0, scanner.commentStarts[0]);
- assertEquals("Wrong comment start", -9, scanner.commentStops[0]);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=73762
- */
- public void test002() throws InvalidInputException {
- Scanner scanner = new Scanner();
- scanner.recordLineSeparator = true;
- scanner.setSource("a\nb\nc\n".toCharArray());
- int token = 0;
- while (token != TerminalTokens.TokenNameEOF) {
- token = scanner.getNextToken();
- }
- scanner.setSource("a\nb\n".toCharArray());
- token = 0;
- while (token != TerminalTokens.TokenNameEOF) {
- token = scanner.getNextToken();
- }
- assertEquals("Wrong number of line ends", 2, scanner.getLineEnds().length);
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocBugsTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocBugsTest.java
deleted file mode 100644
index 61c4459..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocBugsTest.java
+++ /dev/null
@@ -1,5193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocBugsTest extends JavadocTest {
-
- String docCommentSupport = CompilerOptions.ENABLED;
- String reportInvalidJavadoc = CompilerOptions.ERROR;
- String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- String reportMissingJavadocTags = CompilerOptions.ERROR;
- String reportMissingJavadocComments = null;
- String reportDeprecation = CompilerOptions.ERROR;
- String reportJavadocDeprecation = null;
-
- public JavadocBugsTest(String name) {
- super(name);
- }
-
- public static Class javadocTestClass() {
- return JavadocBugsTest.class;
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_PREFIX = "testBug96237";
-// TESTS_NAMES = new String[] { "testBug68017javadocWarning2" };
-// TESTS_NUMBERS = new int[] { 129241 };
-// TESTS_RANGE = new int[] { 21, 50 };
- }
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_DocCommentSupport, docCommentSupport);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
- if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
- }
- if (this.reportJavadocDeprecation != null) {
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, reportJavadocDeprecation);
- }
- if (reportMissingJavadocComments != null) {
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.ENABLED);
- } else {
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportInvalidJavadoc);
- }
- if (reportMissingJavadocTags != null) {
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportMissingJavadocTags);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, CompilerOptions.ENABLED);
- } else {
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportInvalidJavadoc);
- }
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportDeprecation, reportDeprecation);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
- return options;
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- docCommentSupport = CompilerOptions.ENABLED;
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- reportMissingJavadocComments = CompilerOptions.IGNORE;
- reportDeprecation = CompilerOptions.ERROR;
- }
-
- /**
- * Bug 45596.
- * When this bug happened, compiler wrongly complained on missing parameter javadoc
- * entries for method declaration in anonymous class.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45596">45596</a>
- */
- public void testBug45596() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "class X {\n"
- + " void foo(int x, String str) {}\n"
- + "}\n",
- "test/Y.java",
- "package test;\n"
- + "class Y {\n"
- + " /** */\n"
- + " protected X field = new X() {\n"
- + " void foo(int x, String str) {}\n"
- + " };\n"
- + "}\n"});
- }
-
- /**
- * Additional test for bug 45596.
- * Verify correct complain about missing parameter javadoc entries in anonymous class.
- * Since bug 47132, @param, @return and @throws tags are not resolved in javadoc of anonymous
- * class...
- */
- public void testBug45596a() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(int x, String str) {}\n" +
- "}\n",
- "Y1.java",
- "public class Y1 {\n" +
- " /** */\n" +
- " protected X field = new X() {\n" +
- " /** Invalid javadoc comment in anonymous class */\n" +
- " void foo(String str) {}\n" +
- " };\n" +
- "}\n",
- "Y2.java",
- "public class Y2 {\n" +
- " /** */\n" +
- " void foo() {\n" +
- " X x = new X() {\n" +
- " /** Invalid javadoc comment in anonymous class */\n" +
- " void foo(String str) {}\n" +
- " };\n" +
- " x.foo(0, \"\");\n" +
- " }\n" +
- "}\n",
- "Y3.java",
- "public class Y3 {\n" +
- " static X x;\n" +
- " static {\n" +
- " x = new X() {\n" +
- " /** Invalid javadoc comment in anonymous class */\n" +
- " void foo(String str) {}\n" +
- " };\n" +
- " }\n" +
- "}\n" }
- );
- }
-
- /**
- * Additional test for bug 45596.
- * Verify no complain about missing parameter javadoc entries.
- */
- public void testBug45596b() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(int x, String str) {}\n" +
- "}\n",
- "Y1.java",
- "public class Y1 {\n" +
- " /** */\n" +
- " protected X field = new X() {\n" +
- " /**\n" +
- " * Valid javadoc comment in anonymous class.\n" +
- " * @param str String\n" +
- " * @return int\n" +
- " */\n" +
- " int bar(String str) {\n" +
- " return 10;\n" +
- " }\n" +
- " };\n" +
- "}\n",
- "Y2.java",
- "public class Y2 {\n" +
- " /** */\n" +
- " void foo() {\n" +
- " X x = new X() {\n" +
- " /**\n" +
- " * Valid javadoc comment in anonymous class.\n" +
- " * @param str String\n" +
- " * @return int\n" +
- " */\n" +
- " int bar(String str) {\n" +
- " return 10;\n" +
- " }\n" +
- " };\n" +
- " x.foo(0, \"\");\n" +
- " }\n" +
- "}\n",
- "Y3.java",
- "public class Y3 {\n" +
- " static X x;\n" +
- " static {\n" +
- " x = new X() {\n" +
- " /**\n" +
- " * Valid javadoc comment in anonymous class.\n" +
- " * @param str String\n" +
- " * @return int\n" +
- " */\n" +
- " int bar(String str) {\n" +
- " return 10;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n"}
- );
- }
-
- /**
- * Bug 45592.
- * When this bug happened, a NullPointerException occured during the compilation.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45592">45592</a>
- */
- public void testBug45592() {
- runConformTest(
- new String[] {
- "a/Y.java",
- "package a;\n" +
- "\n" +
- "/** */\n" +
- "public class Y {\n" +
- " protected boolean bar(Object obj) {\n" +
- " return obj == null;\n" +
- " }\n" +
- "}\n",
- "test/X.java",
- "package test;\n" +
- "public class X {\n" +
- " public static Boolean valueOf(boolean bool) {\n" +
- " if (bool) {\n" +
- " return Boolean.TRUE;\n" +
- " } else {\n" +
- " return Boolean.FALSE;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test/YY.java",
- "package test;\n" +
- "\n" +
- "import a.Y;\n" +
- "\n" +
- "/** */\n" +
- "public class YY extends Y {\n" +
- " /**\n" +
- " * Returns a Boolean.\n" +
- " * @param key\n" +
- " * @return A Boolean telling whether the key is null or not.\n" +
- " * @see #bar(Object)\n" +
- " */\n" +
- " protected Boolean foo(Object key) {\n" +
- " return X.valueOf(bar(key));\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 45737.
- * When this bug happened, compiler complains on return type and argument of method bar.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45737">45737</a>
- */
- public void testBug45737() {
- runConformTest(
- new String[] {
- "Y.java",
- "class Y {\n" +
- " void foo() {\n" +
- " X x = new X() {\n" +
- " /**\n" +
- " * Valid javadoc comment in anonymous class.\n" +
- " * @param str String\n" +
- " * @return int\n" +
- " */\n" +
- " int bar(String str) {\n" +
- " return 10;\n" +
- " }\n" +
- " };\n" +
- " x.foo();\n" +
- " }\n" +
- "}\n",
- "X.java",
- "class X {\n" +
- " void foo() {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 45669.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45669">45669</a>
- */
- public void testBug45669() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Valid javadoc comment with tags mixed order\n" +
- " * @param str first param\n" +
- " * @see String\n" +
- " * @param dbl second param\n" +
- " * @see Double\n" +
- " * also\n" +
- " * @see \"String ref\"\n" +
- " * @return int\n" +
- " * @throws InterruptedException\n" +
- " * \n" +
- " */\n" +
- " int foo(String str, Double dbl) throws InterruptedException {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- /*
- * Additional test for bug 45669.
- * Verify that compiler complains when @throws tag is between @param tags.
- */
- public void testBug45669a() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Javadoc comment with tags invalid mixed order\n" +
- " * @param str first param\n" +
- " * @see String\n" +
- " * @throws InterruptedException\n" +
- " * @param dbl second param\n" +
- " * @see Double\n" +
- " * also\n" +
- " * @see \"String ref\"\n" +
- " * @return int\n" +
- " * \n" +
- " */\n" +
- " public int foo(String str, Double dbl) throws InterruptedException {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * @param dbl second param\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " public int foo(String str, Double dbl) throws InterruptedException {\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter dbl\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 45958.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45958">45958</a>
- */
- public void testBug45958() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int x;\n" +
- " public X(int i) {\n" +
- " x = i;\n" +
- " }\n" +
- " /**\n" +
- " * @see #X(int)\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug45958a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int x;\n" +
- " public X(int i) {\n" +
- " x = i;\n" +
- " }\n" +
- " /**\n" +
- " * @see #X(String)\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * @see #X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n"
- );
- }
- public void testBug45958b() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int x;\n" +
- " public X(int i) {\n" +
- " x = i;\n" +
- " }\n" +
- " /**\n" +
- " * @see #X(int)\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n",
- "XX.java",
- "public class XX extends X {\n" +
- " /**\n" +
- " * @param i\n" +
- " * @see #X(int)\n" +
- " */\n" +
- " public XX(int i) {\n" +
- " super(i);\n" +
- " x++;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in XX.java (at line 4)\n" +
- " * @see #X(int)\n" +
- " ^\n" +
- "Javadoc: The method X(int) is undefined for the type XX\n" +
- "----------\n"
- );
- }
- public void testBug45958c() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int x;\n" +
- " public X(int i) {\n" +
- " x = i;\n" +
- " }\n" +
- " /**\n" +
- " * @see #X(String)\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- " void X(String str) {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 46901.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=46901">46901</a>
- */
- public void testBug46901() {
- runConformTest(
- new String[] {
- "A.java",
- "public abstract class A {\n" +
- " public A() { super(); }\n" +
- "}\n",
- "X.java",
- "/**\n" +
- " * @see A#A()\n" +
- " */\n" +
- "public class X extends A {\n" +
- " public X() { super(); }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 47215.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=47215">47215</a>
- */
- public void testBug47215() {
- runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * @see X\n" +
- " * @see X#X(int)\n" +
- " * @see X(double)\n" +
- " * @see X (double)\n" +
- " * @see X[double]\n" +
- " * @see X!=}}\n" +
- " * @see foo()\n" +
- " * @see foo ()\n" +
- " */\n" +
- " public class X {\n" +
- " public X(int i){}\n" +
- " public void foo() {}\n" +
- " }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @see X(double)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Missing #: \"X(double)\"\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @see X[double]\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @see X!=}}\n" +
- " ^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @see foo()\n" +
- " ^^^^^\n" +
- "Javadoc: Missing #: \"foo()\"\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " * @see foo ()\n" +
- " ^^^\n" +
- "Javadoc: foo cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 47341.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=47341">47341</a>
- */
- public void testBug47341() {
- runConformTest(
- new String[] {
- "p1/X.java",
- "package p1;\n" +
- "public class X {\n" +
- " void foo_package() {}\n" +
- " protected void foo_protected() {}\n" +
- "}\n",
- "p1/Y.java",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " /**\n" +
- " * @see #foo_package()\n" +
- " */\n" +
- " protected void bar() {\n" +
- " foo_package();\n" +
- " }\n" +
- "}\n",
- "p2/Y.java",
- "package p2;\n" +
- "import p1.X;\n" +
- "\n" +
- "public class Y extends X {\n" +
- " /**\n" +
- " * @see X#foo_protected()\n" +
- " */\n" +
- " protected void bar() {\n" +
- " foo_protected();\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 47132.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=47132">47132</a>
- */
- public void testBug47132() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- runConformTest(
- new String[] {
- "X.java",
- "/** */\n" +
- "public class X {\n" +
- " /** */\n" +
- " public void foo(){\n" +
- " new Object(){\n" +
- " public int x;\n" +
- " public void bar(){}\n" +
- " };\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 47339.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=47339">47339</a>
- */
- public void testBug47339() {
- runConformTest(
- new String[] {
- "X.java",
- "/** */\n" +
- "public class X implements Comparable {\n" +
- " /**\n" +
- " * @see java.lang.Comparable#compareTo(java.lang.Object)\n" +
- " */\n" +
- " public int compareTo(Object o) {\n" +
- " return 0;\n" +
- " }\n" +
- " /** @see Object#toString() */\n" +
- " public String toString(){\n" +
- " return \"\";\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug47339a() {
- runConformTest(
- new String[] {
- "X.java",
- "/** */\n" +
- "public class X extends RuntimeException {\n" +
- " \n" +
- " /**\n" +
- " * @see RuntimeException#RuntimeException(java.lang.String)\n" +
- " */\n" +
- " public X(String message) {\n" +
- " super(message);\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug47339b() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "/** */\n" +
- "public class X implements Comparable {\n" +
- " /** */\n" +
- " public int compareTo(Object o) {\n" +
- " return 0;\n" +
- " }\n" +
- " /** */\n" +
- " public String toString(){\n" +
- " return \"\";\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public int compareTo(Object o) {\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public int compareTo(Object o) {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter o\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " public String toString(){\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n"
- );
- }
- public void testBug47339c() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "/** */\n" +
- "public class X extends RuntimeException {\n" +
- " \n" +
- " /** */\n" +
- " public X(String message) {\n" +
- " super(message);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public X(String message) {\n" +
- " ^^^^^^^\n" +
- "Javadoc: Missing tag for parameter message\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 48064.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=48064">48064</a>
- */
- public void testBug48064() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public X(String str) {}\n" +
- "}\n",
- "Y.java",
- "public class Y extends X {\n" +
- " /**\n" +
- " * @see X#X(STRING)\n" +
- " */\n" +
- " public Y(String str) {super(str);}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " * @see X#X(STRING)\n" +
- " ^^^^^^\n" +
- "Javadoc: STRING cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 5)\n" +
- " public Y(String str) {super(str);}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter str\n" +
- "----------\n"
- );
- }
- public void testBug48064a() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(String str) {}\n" +
- "}\n",
- "Y.java",
- "public class Y extends X {\n" +
- " /**\n" +
- " * @see X#foo(STRING)\n" +
- " */\n" +
- " public void foo(String str) {super.foo(str);}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 3)\n" +
- " * @see X#foo(STRING)\n" +
- " ^^^^^^\n" +
- "Javadoc: STRING cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 5)\n" +
- " public void foo(String str) {super.foo(str);}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter str\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 48523.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=48523">48523</a>
- */
- public void testBug48523() {
- runConformTest(
- new String[] {
- "X.java",
- "import java.io.IOException;\n" +
- "public class X {\n" +
- " public void foo() throws IOException {}\n" +
- "}\n",
- "Y.java",
- "import java.io.IOException;\n" +
- "public class Y extends X {\n" +
- " /**\n" +
- " * @throws IOException\n" +
- " * @see X#foo()\n" +
- " */\n" +
- " public void foo() throws IOException {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 48711.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=48711">48711</a>
- */
- public void testBug48711() {
- runConformTest(
- new String[] {
- "X.java",
- "import java.io.*;\n" +
- "\n" +
- "public class X {\n" +
- " /**\n" +
- " * @throws IOException\n" +
- " * @throws EOFException\n" +
- " * @throws FileNotFoundException\n" +
- " */\n" +
- " public void foo() throws IOException {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 45782.
- * When this bug happened, compiler wrongly complained on missing parameters declaration
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45782">45782</a>
- */
- public void testBug45782() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X implements Comparable {\n" +
- "\n" +
- " /**\n" +
- " * Overridden method with return value and parameters.\n" +
- " * {@inheritDoc}\n" +
- " */\n" +
- " public boolean equals(Object obj) {\n" +
- " return super.equals(obj);\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Overridden method with return value and thrown exception.\n" +
- " * {@inheritDoc}\n" +
- " */\n" +
- " public Object clone() throws CloneNotSupportedException {\n" +
- " return super.clone();\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * Implemented method (Comparable) with return value and parameters.\n" +
- " * {@inheritDoc}\n" +
- " */\n" +
- " public int compareTo(Object o) { return 0; }\n" +
- "}\n"
- });
- }
- public void testBug45782a() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Unefficient inheritDoc tag on a method which is neither overridden nor implemented...\n" +
- " * {@inheritDoc}\n" +
- " */\n" +
- " public int foo(String str) throws IllegalArgumentException { return 0; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public int foo(String str) throws IllegalArgumentException { return 0; }\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public int foo(String str) throws IllegalArgumentException { return 0; }\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter str\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " public int foo(String str) throws IllegalArgumentException { return 0; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalArgumentException\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 49260.
- * When this bug happened, compiler wrongly complained on Invalid parameters declaration
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=49260">49260</a>
- */
- public void testBug49260() {
- runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n" +
- "public final class X {\n" +
- " int bar(String str, int var, Vector list, char[] array) throws IllegalAccessException { return 0; }\n" +
- " /**\n" +
- " * Valid method reference on several lines\n" +
- " * @see #bar(String str,\n" +
- " * int var,\n" +
- " * Vector list,\n" +
- " * char[] array)\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n" });
- }
-
- /**
- * Bug 48385.
- * When this bug happened, compiler does not complain on CharOperation references in @link tags
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=48385">48385</a>
- */
- public void testBug48385() {
- runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Method outside javaDoc Comment\n" +
- " * 1) {@link String} tag description not empty\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " * @param str\n" +
- " * @param var tag description not empty\n" +
- " * @param list third param with embedded tag: {@link Vector}\n" +
- " * @param array fourth param with several embedded tags on several lines:\n" +
- " * 1) {@link String} tag description not empty\n" +
- " * 2) {@linkplain CharOperation Label not empty} tag description not empty\n" +
- " * @throws IllegalAccessException\n" +
- " * @throws NullPointerException tag description not empty\n" +
- " * @return an integer\n" +
- " * @see String\n" +
- " * @see Vector tag description not empty\n" +
- " * @see Object tag description includes embedded tags and several lines:\n" +
- " * 1) {@link String} tag description not empty\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " */\n" +
- " int foo(String str, int var, Vector list, char[] array) throws IllegalAccessException { return 0; }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: CharOperation cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " * 2) {@linkplain CharOperation Label not empty} tag description not empty\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: CharOperation cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 20)\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: CharOperation cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- public void testBug48385And49620() {
- runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Method outside javaDoc Comment\n" +
- " * 1) {@link\n" +
- " * String} tag description not empty\n" +
- " * 2) {@link\n" +
- " * CharOperation Label not empty} tag description not empty\n" +
- " * @param\n" +
- " * str\n" +
- " * @param\n" +
- " * var tag description not empty\n" +
- " * @param list third param with embedded tag: {@link\n" +
- " * Vector} but also on several lines: {@link\n" +
- " * CharOperation}\n" +
- " * @param array fourth param with several embedded tags on several lines:\n" +
- " * 1) {@link String} tag description not empty\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " * @throws\n" +
- " * IllegalAccessException\n" +
- " * @throws\n" +
- " * NullPointerException tag description not empty\n" +
- " * @return\n" +
- " * an integer\n" +
- " * @see\n" +
- " * String\n" +
- " * @see\n" +
- " * Vector\n" +
- " * tag description not empty\n" +
- " * @see Object tag description includes embedded tags and several lines:\n" +
- " * 1) {@link String} tag description not empty\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " */\n" +
- " int foo(String str, int var, Vector list, char[] array) throws IllegalAccessException { return 0; }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " * CharOperation Label not empty} tag description not empty\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: CharOperation cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " * CharOperation}\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: CharOperation cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 18)\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: CharOperation cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 32)\n" +
- " * 2) {@link CharOperation Label not empty} tag description not empty\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: CharOperation cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug48385a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Method outside javaDoc Comment\n" +
- " * 1) {@link } Missing reference\n" +
- " * 2) {@link Unknown} Cannot be resolved\n" +
- " * 3) {@link *} Missing reference\n" +
- " * 4) {@link #} Invalid reference\n" +
- " * 5) {@link String } } Valid reference\n" +
- " * 6) {@link String {} Invalid tag\n" +
- " * @return int\n" +
- " */\n" +
- " int foo() {return 0;}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * 1) {@link } Missing reference\n" +
- " ^^^^\n" +
- "Javadoc: Missing reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * 2) {@link Unknown} Cannot be resolved\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * 3) {@link *} Missing reference\n" +
- " ^^^^\n" +
- "Javadoc: Missing reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " * 4) {@link #} Invalid reference\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " * 6) {@link String {} Invalid tag\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 49491.
- * When this bug happened, compiler complained on duplicated throws tag
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=49491">49491</a>
- */
- public void testBug49491() {
- runConformTest(
- new String[] {
- "X.java",
- "public final class X {\n" +
- " /**\n" +
- " * Now valid duplicated throws tag\n" +
- " * @throws IllegalArgumentException First comment\n" +
- " * @throws IllegalArgumentException Second comment\n" +
- " * @throws IllegalArgumentException Last comment\n" +
- " */\n" +
- " void foo() throws IllegalArgumentException {}\n" +
- "}\n" });
- }
- public void testBug49491a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public final class X {\n" +
- " /**\n" +
- " * Duplicated param tags should be still flagged\n" +
- " * @param str First comment\n" +
- " * @param str Second comment\n" +
- " * @param str Last comment\n" +
- " */\n" +
- " void foo(String str) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param str Second comment\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param str Last comment\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 48376.
- * When this bug happened, compiler complained on duplicated throws tag
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=48376">48376</a>
- */
- public void testBug48376() {
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see <a href=\"http:/www.ibm.com\">IBM Home Page</a>\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " * IBM Home Page</a>\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " * IBM Home Page\n" +
- " * </a>\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " *\n" +
- " *\n" +
- " * </a>\n" +
- " * @see Object\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- });
- }
- public void testBug48376a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see <a href=\"http:/www.ibm.com\">IBM Home Page\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " * IBM Home Page\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " * IBM Home Page<\n" +
- " * /a>\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " *\n" +
- " *\n" +
- " * \n" +
- " * @see Unknown\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see <a href=\"http:/www.ibm.com\">IBM Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " * IBM Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * IBM Home Page<\n" +
- " ^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @see <a href=\"http:/www.ibm.com\">\n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 50644.
- * When this bug happened, compiler complained on duplicated throws tag
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=50644">50644</a>
- */
- public void testBug50644() {
- reportInvalidJavadoc = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "p1/X.java",
- "package p1;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Should not be @deprecated\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n",
- "p2/Y.java",
- "package p2;\n" +
- "import p1.X;\n" +
- "public class Y {\n" +
- " public void foo() {\n" +
- " X x = new X();\n" +
- " x.foo();\n" +
- " }\n" +
- "}\n"
- });
- }
-
- /**
- * Bug 50695.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=50695">50695</a>
- */
- public void testBug50695() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see java\n" +
- " * @see java.util\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- });
- }
- public void testBug50695b() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see java.unknown\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @see java.unknown\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: java.unknown cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 51626.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=51626">51626</a>
- */
- public void testBug51626() {
- runConformTest(
- new String[] {
- "p1/X.java",
- "package p1;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @see String\n" +
- " * toto @deprecated\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n",
- "p2/Y.java",
- "package p2;\n" +
- "import p1.*;\n" +
- "public class Y {\n" +
- " void foo() {\n" +
- " X x = new X(); \n" +
- " x.foo();\n" +
- " }\n" +
- "}\n"
- });
- }
-
- /**
- * Bug 52216.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=52216">52216</a>
- */
- public void testBug52216() {
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * Valid ref with white spaces at the end\n" +
- "* @see <a href=\"http://www.ietf.org/rfc/rfc2045.txt\">RFC 2045 - Section 6.8</a> \n" +
- "*/\n" +
- "public class X {\n" +
- "}\n"
- });
- }
- public void testBug52216a() {
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- "* @see \"Valid ref with white spaces at the end\" \n" +
- "*/\n" +
- "public class X {\n" +
- "}\n"
- });
- }
- public void testBug52216b() {
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- "* @see <a href=\"http://www.ietf.org/rfc/rfc2045.txt\">RFC 2045 - Section 6.8</a> \n" +
- "* @see <a href=\"http://www.ietf.org/rfc/rfc2045.txt\">RFC 2045 - Section 6.8</a>\n" +
- "* @see <a href=\"http://www.ietf.org/rfc/rfc2045.txt\">RFC 2045 - Section 6.8</a> ,\n" +
- "* @see \"Valid ref with white spaces at the end\"\n" +
- "* @see \"Valid ref with white spaces at the end\" \n" +
- "* @see \"Invalid ref\" .\n" +
- "*/\n" +
- "public class X {\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @see <a href=\"http://www.ietf.org/rfc/rfc2045.txt\">RFC 2045 - Section 6.8</a> ,\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " * @see \"Invalid ref\" .\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 51529.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=51529">51529</a>
- */
- public void testBug51529() {
- runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @see Vector\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- });
- }
- public void testBug51529a() {
- reportInvalidJavadoc = CompilerOptions.IGNORE;
- reportMissingJavadocComments = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @see Vector\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug51529b() {
- docCommentSupport = CompilerOptions.DISABLED;
- runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @see Vector\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import java.util.Vector;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The import java.util.Vector is never used\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 51911.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=51911">51911</a>
- */
- public void testBug51911() {
- // Warn an ambiguous method reference
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see #foo\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(int i, float f) {}\n" +
- " public void foo(String str) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see #foo\n" +
- " ^^^\n" +
- "Javadoc: foo is an ambiguous method reference or is not a field\n" +
- "----------\n"
- );
- }
- public void testBug51911a() {
- // Accept unambiguous method reference
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see #foo\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(String str) {}\n" +
- "}\n"
- }
- );
- }
- public void testBug51911b() {
- // Accept field reference with method name
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see #foo\n" +
- " */\n" +
- "public class X {\n" +
- " public int foo;\n" +
- " public void foo(String str) {}\n" +
- "}\n"
- }
- );
- }
- public void testBug51911c() {
- // Accept field reference with ambiguous method name
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see #foo\n" +
- " */\n" +
- "public class X {\n" +
- " public int foo;\n" +
- " public void foo() {}\n" +
- " public void foo(String str) {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 53279: [Javadoc] Compiler should complain when inline tag is not terminated
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=53279">53279</a>
- */
- public void testBug53279() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Unterminated inline tags\n" +
- " * {@link Object\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * {@link Object\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
- "----------\n"
- );
- }
- public void testBug53279a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Unterminated inline tags\n" +
- " * {@link Object\n" +
- " * @return int\n" +
- " */\n" +
- " int foo() {return 0;}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * {@link Object\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
- "----------\n"
- );
- }
- public void testBug53279b() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Unterminated inline tags\n" +
- " * {@link \n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * {@link \n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * {@link \n" +
- " ^^^^\n" +
- "Javadoc: Missing reference\n" +
- "----------\n"
- );
- }
- public void testBug53279c() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Unterminated inline tags\n" +
- " * {@link\n" +
- " * @return int\n" +
- " */\n" +
- " int foo() {return 0;}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * {@link\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing closing brace for inline tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * {@link\n" +
- " ^^^^\n" +
- "Javadoc: Missing reference\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 53290: [Javadoc] Compiler should complain when tag name is not correct
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=53290">53290</a>
- */
- public void testBug53290() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * See as inline tag\n" +
- " * {@see Object}\n" +
- " * @see Object\n" +
- " * @link Object\n" +
- " * {@link Object}\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * {@see Object}\n" +
- " ^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @link Object\n" +
- " ^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 62812: Some malformed javadoc tags are not reported as malformed
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=62812">62812</a>
- */
- public void testBug62812() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * @see Object#clone())\n" +
- " * @see Object#equals(Object)}\n" +
- " * @see Object#equals(Object))\n" +
- " * @see Object#equals(Object)xx\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Object#clone())\n" +
- " ^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Object#equals(Object)}\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 4)\n" +
- " * @see Object#equals(Object))\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 5)\n" +
- " * @see Object#equals(Object)xx\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n"
- );
- }
- public void testBug62812a() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * {@link Object#clone())}\n" +
- " * {@link Object#equals(Object)}\n" +
- " * {@link Object#equals(Object))}\n" +
- " * {@link Object#equals(Object)xx}\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * {@link Object#clone())}\n" +
- " ^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\n" +
- " * {@link Object#equals(Object))}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\n" +
- " * {@link Object#equals(Object)xx}\n" +
- " ^^^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 51606: [Javadoc] Compiler should complain when tag name is not correct
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=51606">51606</a>
- */
- public void testBug51606() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @param a aaa\n" +
- " * @param b bbb\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "public class Y extends X {\n" +
- " /**\n" +
- " * @param a {@inheritDoc}\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 5)\n" +
- " public void foo(int a, int b) {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter b\n" +
- "----------\n"
- );
- }
- public void testBug51606a() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @param a aaa\n" +
- " * @param b bbb\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "public class Y extends X {\n" +
- " /**\n" +
- " * {@inheritDoc}\n" +
- " * @param a aaaaa\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n"
- },
- ""
- );
- }
- public void testBug51606b() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @param a aaa\n" +
- " * @param b bbb\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "public class Y extends X {\n" +
- " /**\n" +
- " * Text before inherit tag\n" +
- " * {@inheritDoc}\n" +
- " * @param a aaaaa\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug51606c() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @param a aaa\n" +
- " * @param b bbb\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "public class Y extends X {\n" +
- " /**\n" +
- " * Text before inherit tag {@inheritDoc}\n" +
- " * @param a aaaaa\n" +
- " */\n" +
- " public void foo(int a, int b) {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 65174: Spurious "Javadoc: Missing reference" error
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=65174">65174</a>
- */
- public void testBug65174() {
- runConformTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Comment with no error: {@link\n" +
- " * Object valid} because it\'s not on first line\n" +
- " */\n" +
- "public class Test {\n" +
- " /** Comment previously with error: {@link\n" +
- " * Object valid} because tag is on comment very first line\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug65174a() {
- runConformTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Comment with no error: {@link \n" +
- " * Object valid} because it\'s not on first line\n" +
- " */\n" +
- "public class Test {\n" +
- " /** Comment previously with error: {@link \n" +
- " * Object valid} because tag is on comment very first line\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug65174b() {
- runConformTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Comment with no error: {@link java.lang.\n" +
- " * Object valid} because it\'s not on first line\n" +
- " */\n" +
- "public class Test {\n" +
- " /** Comment previously with error: {@link java.lang.\n" +
- " * Object valid} because tag is on comment very first line\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug65174c() {
- runConformTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Comment with no error: {@link Object\n" +
- " * valid} because it\'s not on first line\n" +
- " */\n" +
- "public class Test {\n" +
- " /** Comment previously with no error: {@link Object\n" +
- " * valid} because tag is on comment very first line\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug65174d() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " /** Comment previously with no error: {@link Object valid} comment on one line */\n" +
- " void foo1() {}\n" +
- " /** Comment previously with no error: {@link Object valid} */\n" +
- " void foo2() {}\n" +
- " /** Comment previously with no error: {@link Object valid}*/\n" +
- " void foo3() {}\n" +
- " /** {@link Object valid} comment on one line */\n" +
- " void foo4() {}\n" +
- " /**{@link Object valid} comment on one line */\n" +
- " void foo5() {}\n" +
- " /** {@link Object valid} */\n" +
- " void foo6() {}\n" +
- " /**{@link Object valid} */\n" +
- " void foo7() {}\n" +
- " /** {@link Object valid}*/\n" +
- " void foo8() {}\n" +
- " /**{@link Object valid}*/\n" +
- " void foo9() {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 65180: Spurious "Javadoc: xxx cannot be resolved or is not a field" error with inner classes
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=65180">65180</a>
- */
- public void testBug65180() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * Does something.\n" +
- " * \n" +
- " * @see #testFunc\n" +
- " */\n" +
- " public void innerFunc() {\n" +
- " testFunc();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void testFunc() {}\n" +
- "}\n" +
- "\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 6)\r\n" +
- " * @see #testFunc\r\n" +
- " ^^^^^^^^\n" +
- "Javadoc: testFunc cannot be resolved or is not a field\n" +
- "----------\n"
- );
- }
- public void testBug65180a() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * Does something.\n" +
- " * \n" +
- " * @see #testFunc()\n" +
- " */\n" +
- " public void innerFunc() {\n" +
- " testFunc();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void testFunc() {}\n" +
- "}\n" +
- "\n"
- }
- );
- }
- public void testBug65180b() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * Does something.\n" +
- " * \n" +
- " * @see Test#testFunc\n" +
- " * @see Test#testFunc()\n" +
- " */\n" +
- " public void innerFunc() {\n" +
- " testFunc();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void testFunc() {}\n" +
- "}\n" +
- "\n"
- }
- );
- }
- public void testBug65180c() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * Does something.\n" +
- " * \n" +
- " * @see #testFunc\n" +
- " */\n" +
- " public void innerFunc() {\n" +
- " testFunc();\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void testFunc() {}\n" +
- " public void testFunc(String str) {}\n" +
- "}\n" +
- "\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 6)\n" +
- " * @see #testFunc\n" +
- " ^^^^^^^^\n" +
- "Javadoc: testFunc cannot be resolved or is not a field\n" +
- "----------\n"
- );
- }
- public void testBug65180d() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " int testField;\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * Does something.\n" +
- " * \n" +
- " * @see #testField\n" +
- " * @see #testFunc(int)\n" +
- " */\n" +
- " public void innerFunc() {\n" +
- " testFunc(testField);\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " public void testFunc(int test) {\n" +
- " testField = test; \n" +
- " }\n" +
- "}\n" +
- "\n"
- }
- );
- }
- public void testBug65180e() {
- runConformTest(
- new String[] {
- "ITest.java",
- "public interface ITest {\n" +
- " /**\n" +
- " * @see #foo() \n" +
- " */\n" +
- " public static int field = 0;\n" +
- " /**\n" +
- " * @see #field\n" +
- " */\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
- public void testBug65180f() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static class SuperInner {\n" +
- " public int field;\n" +
- " public void foo() {}\n" +
- " }\n" +
- " \n" +
- " public static class Inner extends SuperInner {\n" +
- " /**\n" +
- " * @see #field\n" +
- " */\n" +
- " public static int f;\n" +
- " /**\n" +
- " * @see #foo()\n" +
- " */\n" +
- " public static void bar() {}\n" +
- " }\n" +
- " \n" +
- " public void foo() {}\n" +
- "}"
- }
- );
- }
-
- /**
- * Bug 65253: [Javadoc] @@tag is wrongly parsed as @tag
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=65253">65253</a>
- */
- public void testBug65253() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Comment \n" +
- " * @@@@see Unknown Should not complain on ref\n" +
- " */\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Comment\n" +
- " * @@@param xxx Should not complain on param\n" +
- " * @@return int\n" +
- " */\n" +
- " int foo() { // should warn on missing tag for return type\n" +
- " return 0;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " * @@@@see Unknown Should not complain on ref\n" +
- " ^^^^^^\n" +
- "Javadoc: Invalid tag\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 8)\n" +
- " * @@@param xxx Should not complain on param\n" +
- " ^^^^^^^\n" +
- "Javadoc: Invalid tag\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " * @@return int\n" +
- " ^^^^^^^\n" +
- "Javadoc: Invalid tag\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 11)\n" +
- " int foo() { // should warn on missing tag for return type\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 66551: Error in org.eclipse.swt project on class PrinterData
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=66551">66551</a>
- */
- public void testBug66551() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " int field;\n" +
- " /**\n" +
- " * @see #field\n" +
- " */\n" +
- " void foo(int field) {\n" +
- " }\n" +
- "\n" +
- "}\n"
- }
- );
- }
- public void testBug66551a() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static int field;\n" +
- " /**\n" +
- " * @see #field\n" +
- " */\n" +
- " static void foo(int field) {\n" +
- " }\n" +
- "\n" +
- "}\n"
- }
- );
- }
- public void testBug66551b() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " int field;\n" +
- " /**\n" +
- " * {@link #field}\n" +
- " */\n" +
- " void foo(int field) {\n" +
- " }\n" +
- "\n" +
- "}\n"
- }
- );
- }
- public void testBug66551c() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static int field;\n" +
- " /**\n" +
- " * {@link #field}\n" +
- " */\n" +
- " static void foo(int field) {\n" +
- " }\n" +
- "\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 66573: Shouldn't bind to local constructs
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=66573">66573</a>
- */
- public void testBug66573() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " /**\n" +
- " * @see Local\n" +
- " */\n" +
- " void foo() {\n" +
- " class Local { \n" +
- " // shouldn\'t be seen from javadoc\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " * @see Local\n" +
- " ^^^^^\n" +
- "Javadoc: Local cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 68017: Javadoc processing does not detect missing argument to @return
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=68017">68017</a>
- */
- public void testBug68017conform() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@return valid integer*/\n" +
- " public int foo1() {return 0; }\n" +
- " /**\n" +
- " * @return #\n" +
- " */\n" +
- " public int foo2() {return 0; }\n" +
- "}\n",
- }
- );
- }
- public void testBug68017negative() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@return*/\n" +
- " public int foo1() {return 0; }\n" +
- " /**@return */\n" +
- " public int foo2() {return 0; }\n" +
- " /**@return****/\n" +
- " public int foo3() {return 0; }\n" +
- " /**\n" +
- " * @return\n" +
- " */\n" +
- " public int foo4() {return 0; }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " /**@return*/\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " /**@return */\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " /**@return****/\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " * @return\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n"
- );
- }
- // Javadoc issue a warning on following tests
- public void testBug68017javadocWarning1() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @return* */\n" +
- " public int foo1() {return 0; }\n" +
- " /**@return** **/\n" +
- " public int foo2() {return 0; }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @return* */\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " /**@return** **/\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n"
- );
- }
- public void testBug68017javadocWarning2() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @return #\n" +
- " */\n" +
- " public int foo1() {return 0; }\n" +
- " /**\n" +
- " * @return @\n" +
- " */\n" +
- " public int foo2() {return 0; }\n" +
- "}\n"
- }
- );
- }
- public void testBug68017javadocWarning3() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @return#\n" +
- " * @return#text\n" +
- " */\n" +
- " public int foo() {return 0; }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @return#\n" +
- " ^^^^^^^\n" +
- "Javadoc: Invalid tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @return#text\n" +
- " ^^^^^^^^^^^\n" +
- "Javadoc: Invalid tag\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 68025: Javadoc processing does not detect some wrong links
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=68025">68025</a>
- */
- public void testBug68025conform() {
- runConformTest(
- new String[] {
- "Y.java",
- "public class Y {\n" +
- " public int field;\n" +
- " public void foo() {}\n" +
- "}\n",
- "Z.java",
- "public class Z {\n" +
- " /**\n" +
- " * @see Y#field #valid\n" +
- " * @see Y#foo #valid\n" +
- " */\n" +
- " public void foo1() {}\n" +
- " /**@see Y#field # valid*/\n" +
- " public void foo2() {}\n" +
- " /**@see Y#foo # valid*/\n" +
- " public void foo3() {}\n" +
- " /**@see Y#foo()\n" +
- " *# valid*/\n" +
- " public void foo4() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug68025negative() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public int field;\n" +
- " public void foo() {}\n" +
- " /**\n" +
- " * @see #field#invalid\n" +
- " * @see #foo#invalid\n" +
- " */\n" +
- " public void foo1() {}\n" +
- " /**@see Y#field# invalid*/\n" +
- " public void foo2() {}\n" +
- " /**@see Y#foo# invalid*/\n" +
- " public void foo3() {}\n" +
- " /**@see Y#foo()#\n" +
- " *valid*/\n" +
- " public void foo4() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @see #field#invalid\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @see #foo#invalid\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " /**@see Y#field# invalid*/\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\n" +
- " /**@see Y#foo# invalid*/\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 13)\n" +
- " /**@see Y#foo()#\n" +
- " ^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 68726: [Javadoc] Target attribute in @see link triggers warning
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=68726">68726</a>
- */
- public void testBug68726conform1() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see Object <a href=\"http://www.eclipse.org\" target=\"_top\">Eclipse</a>\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**@see Object <a href=\"http://www.eclipse.org\" target=\"_top\" target1=\"_top1\" target2=\"_top2\">Eclipse</a>*/\n" +
- " void foo2() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug68726conform2() {
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page</a>\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " * IBM Home Page</a>\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " * IBM Home Page\n" +
- " * </a>\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " *\n" +
- " *\n" +
- " * </a>\n" +
- " * @see Object\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- }
- );
- }
- public void testBug68726negative1() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Invalid URL link references\n" +
- " *\n" +
- " * @see <a href=\"invalid\" target\n" +
- " * @see <a href=\"invalid\" target=\n" +
- " * @see <a href=\"invalid\" target=\"\n" +
- " * @see <a href=\"invalid\" target=\"_top\n" +
- " * @see <a href=\"invalid\" target=\"_top\"\n" +
- " * @see <a href=\"invalid\" target=\"_top\">\n" +
- " * @see <a href=\"invalid\" target=\"_top\">\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid<\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid</\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid</a\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid</a> no text allowed after the href\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @see <a href=\"invalid\" target\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @see <a href=\"invalid\" target=\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @see <a href=\"invalid\" target=\"\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @see <a href=\"invalid\" target=\"_top\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " * @see <a href=\"invalid\" target=\"_top\"\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " * @see <a href=\"invalid\" target=\"_top\">\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " * @see <a href=\"invalid\" target=\"_top\">\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 12)\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 13)\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid<\n" +
- " ^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 14)\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid</\n" +
- " ^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 15)\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid</a\n" +
- " ^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 16)\n" +
- " * @see <a href=\"invalid\" target=\"_top\">invalid</a> no text allowed after the href\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n"
- );
- }
- public void testBug68726negative2() {
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " * IBM Home Page\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " * IBM Home Page<\n" +
- " * /a>\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " *\n" +
- " *\n" +
- " * \n" +
- " * @see Unknown\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " * IBM Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * IBM Home Page<\n" +
- " ^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 69272: [Javadoc] Invalid malformed reference (missing separator)
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=69272">69272</a>
- */
- public void testBug69272classValid() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@see Object*/\n" +
- " public void foo1() {}\n" +
- " /**@see Object\n" +
- " */\n" +
- " public void foo2() {}\n" +
- " /**@see Object */\n" +
- " public void foo3() {}\n" +
- " /**@see Object****/\n" +
- " public void foo4() {}\n" +
- " /**@see Object ****/\n" +
- " public void foo5() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug69272classInvalid() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@see Object* */\n" +
- " public void foo1() {}\n" +
- " /**@see Object*** ***/\n" +
- " public void foo2() {}\n" +
- " /**@see Object***\n" +
- " */\n" +
- " public void foo3() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " /**@see Object* */\n" +
- " ^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " /**@see Object*** ***/\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " /**@see Object***\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n"
- );
- }
- public void testBug69272fieldValid() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int field;\n" +
- " /**@see #field*/\n" +
- " public void foo1() {}\n" +
- " /**@see #field\n" +
- " */\n" +
- " public void foo2() {}\n" +
- " /**@see #field */\n" +
- " public void foo3() {}\n" +
- " /**@see #field****/\n" +
- " public void foo4() {}\n" +
- " /**@see #field ********/\n" +
- " public void foo5() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug69272fieldInvalid() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int field;\n" +
- " /**@see #field* */\n" +
- " public void foo1() {}\n" +
- " /**@see #field*** ***/\n" +
- " public void foo2() {}\n" +
- " /**@see #field***\n" +
- " */\n" +
- " public void foo3() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " /**@see #field* */\n" +
- " ^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " /**@see #field*** ***/\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " /**@see #field***\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n"
- );
- }
- public void testBug69272methodValid() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@see Object#wait()*/\n" +
- " public void foo1() {}\n" +
- " /**@see Object#wait()\n" +
- " */\n" +
- " public void foo2() {}\n" +
- " /**@see Object#wait() */\n" +
- " public void foo3() {}\n" +
- " /**@see Object#wait()****/\n" +
- " public void foo4() {}\n" +
- " /**@see Object#wait() ****/\n" +
- " public void foo5() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug69272methodInvalid() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@see Object#wait()* */\n" +
- " public void foo1() {}\n" +
- " /**@see Object#wait()*** ***/\n" +
- " public void foo2() {}\n" +
- " /**@see Object#wait()***\n" +
- " */\n" +
- " public void foo3() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " /**@see Object#wait()* */\n" +
- " ^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " /**@see Object#wait()*** ***/\n" +
- " ^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " /**@see Object#wait()***\n" +
- " ^^^^^\n" +
- "Javadoc: Malformed reference (missing end space separator)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 69275: [Javadoc] Invalid warning on @see link
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=69275">69275</a>
- */
- public void testBug69275conform() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a>*/\n" +
- " void foo1() {}\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a>\n" +
- " */\n" +
- " void foo2() {}\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a> */\n" +
- " void foo3() {}\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a>**/\n" +
- " void foo4() {}\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a> *****/\n" +
- " void foo5() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug69275negative() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a>* */\n" +
- " void foo1() {}\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a> ** **/\n" +
- " void foo2() {}\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a>**\n" +
- " */\n" +
- " void foo3() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a>* */\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " /**@see <a href=\"http://www.eclipse.org\">text</a> ** **/\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 69302: [Javadoc] Invalid reference warning inconsistent with javadoc tool
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=69302"
- */
- public void testBug69302conform1() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see Object <a href=\"http://www.eclipse.org\">Eclipse</a>\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**\n" +
- " * @see Object \"Valid string reference\"\n" +
- " */\n" +
- " void foo2() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug69302negative1() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see Unknown <a href=\"http://www.eclipse.org\">Eclipse</a>\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**\n" +
- " * @see Unknown \"Valid string reference\"\n" +
- " */\n" +
- " void foo2() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @see Unknown <a href=\"http://www.eclipse.org\">Eclipse</a>\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " * @see Unknown \"Valid string reference\"\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug69302negative2() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**@see Unknown blabla <a href=\"http://www.eclipse.org\">text</a>*/\n" +
- " void foo1() {}\n" +
- " /**@see Unknown blabla \"Valid string reference\"*/\n" +
- " void foo2() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " /**@see Unknown blabla <a href=\"http://www.eclipse.org\">text</a>*/\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " /**@see Unknown blabla \"Valid string reference\"*/\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * @bug 70892: [1.5][Javadoc] Compiler should parse reference for inline tag @value
- * @test Ensure that reference in tag 'value' is only verified when source level >= 1.5
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=70892"
- */
- public void testBug70892a() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * {@value}\n" +
- " */\n" +
- " static int field1;\n" +
- " /**\n" +
- " * {@value }\n" +
- " */\n" +
- " static int field2;\n" +
- " /**\n" +
- " * {@value #field}\n" +
- " */\n" +
- " static int field;\n" +
- "}\n"
- }
- );
- }
- public void testBug70892b() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * {@value \"invalid\"}\n" +
- " */\n" +
- " final static int field1 = 1;\n" +
- " /**\n" +
- " * {@value <a href=\"invalid\">invalid</a>} invalid\n" +
- " */\n" +
- " final static int field2 = 2;\n" +
- " /**\n" +
- " * {@value #field}\n" +
- " */\n" +
- " final static int field3 = 3;\n" +
- " /**\n" +
- " * {@value #foo}\n" +
- " */\n" +
- " final static int field4 = 4;\n" +
- " /**\n" +
- " * {@value #foo()}\n" +
- " */\n" +
- " final static int field5 = 5;\n" +
- " void foo() {}\n" +
- "}\n"
- };
- if (this.complianceLevel.equals(COMPLIANCE_1_3) || this.complianceLevel.equals(COMPLIANCE_1_4)) {
- runConformTest(testFiles);
- } else {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * {@value \"invalid\"}\r\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Only static field reference is allowed for @value tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\r\n" +
- " * {@value <a href=\"invalid\">invalid</a>} invalid\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Only static field reference is allowed for @value tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\r\n" +
- " * {@value #field}\r\n" +
- " ^^^^^\n" +
- "Javadoc: field cannot be resolved or is not a field\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 15)\r\n" +
- " * {@value #foo}\r\n" +
- " ^^^\n" +
- "Javadoc: Only static field reference is allowed for @value tag\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 19)\r\n" +
- " * {@value #foo()}\r\n" +
- " ^^^^^\n" +
- "Javadoc: Only static field reference is allowed for @value tag\n" +
- "----------\n"
- );
- }
- }
-
- /**
- * Bug 73348: [Javadoc] Missing description for return tag is not always warned
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73348">73348</a>
- */
- public void testBug73348conform() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @return \n" +
- " * int\n" +
- " */\n" +
- " public int foo1() {return 0; }\n" +
- " /**\n" +
- " * @return \n" +
- " * int\n" +
- " * @see Object\n" +
- " */\n" +
- " public int foo2() {return 0; }\n" +
- "}\n",
- }
- );
- }
- public void testBug73348negative() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @return\n" +
- " * @see Object\n" +
- " */\n" +
- " public int foo1() {return 0; }\n" +
- " /**\n" +
- " * @return \n" +
- " * @see Object\n" +
- " */\n" +
- " public int foo2() {return 0; }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @return\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " * @return \n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 73479: [Javadoc] Improve error message for invalid link in @see tags
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73479">73479</a>
- */
- public void testBug73479() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see <a href=\"spec.html#section\">Java Spec<a>\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @see <a href=\"spec.html#section\">Java Spec<a>\n" +
- " ^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 73995: [Javadoc] Wrong warning for missing return type description for @return {@inheritdoc}
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73995">73995</a>
- */
- public void testBug73995() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @return {@link Object} \n" +
- " */\n" +
- " public int foo1() {return 0; }\n" +
- " /** @return {@inheritedDoc} */\n" +
- " public int foo2() {return 0; }\n" +
- " /**\n" +
- " * @return\n" +
- " * {@unknown_tag}\n" +
- " */\n" +
- " public int foo3() {return 0; }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 74369: [Javadoc] incorrect javadoc in local class
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=74369">74369</a>
- */
- public void testBug74369() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public void method() {\n" +
- " /**\n" +
- " * @see #hsgdfdj\n" +
- " */\n" +
- " System.out.println(\"println\");\n" +
- " class Local {}\n" +
- " }\n" +
- "}"
- }
- );
- }
- public void testBug74369deprecated() {
- runNegativeTest(
- new String[] {
- "p/Y.java",
- "package p;\n" +
- "\n" +
- "\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @deprecated\n" +
- " */\n" +
- " public void bar() {}\n" +
- "}\n",
- "X.java",
- "import p.Y;\n" +
- "\n" +
- "public class X {\n" +
- " Object obj = new Object() {\n" +
- " public boolean equals(Object o) {\n" +
- " /**\n" +
- " * @deprecated\n" +
- " */\n" +
- " System.out.println(\"println\");\n" +
- " class Local {\n" +
- " void bar() {\n" +
- " new Y().bar();\n" +
- " }\n" +
- " }\n" +
- " return super.equals(o);\n" +
- " }\n" +
- " };\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " new Y().bar();\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method bar() from the type Y is deprecated\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 76324: [Javadoc] Wrongly reports invalid link format in @see and @link
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=76324">76324</a>
- */
- public void testBug76324() {
- runConformTest(
- new String[] {
- "X.java",
- "\n" +
- "/**\n" +
- " * Subclasses perform GUI-related work in a dedicated thread. For instructions\n" +
- " * on using this class, see\n" +
- " * {@link <a href=\"http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html\"> Swing tutorial </a>}\n" +
- " * \n" +
- " * @see <a\n" +
- " * href=\"http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html\">\n" +
- " * EDU.oswego.cs.dl.util.concurrent </a>\n" +
- " * @see <a\n" +
- " * href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/package-summary.html\">\n" +
- " * JDK 5.0 </a>\n" +
- " * @author {@link <a href=\"http://gee.cs.oswego.edu/dl\">Doug Lea</a>}\n" +
- " * @author {@link <a href=\"http://home.pacbell.net/jfai\">J?rgen Failenschmid</a>}\n" +
- " *\n" +
- " * It is assumed that you have read the introductory document\n" +
- " * {@link <a HREF=\"../../../../../internat/overview.htm\">\n" +
- " * Internationalization</a>}\n" +
- " * and are familiar with \n" +
- " */\n" +
- "public class X {\n" +
- "\n" +
- "}\n"
- }
- );
- }
- // URL Link references
- public void testBug76324url() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Invalid inline URL link references \n" +
- " *\n" +
- " * {@link <}\n" +
- " * {@link <a}\n" +
- " * {@link <a hre}\n" +
- " * {@link <a href}\n" +
- " * {@link <a href=}\n" +
- " * {@link <a href=\"}\n" +
- " * {@link <a href=\"invalid}\n" +
- " * {@link <a href=\"invalid\"}\n" +
- " * {@link <a href=\"invalid\">}\n" +
- " * {@link <a href=\"invalid\">invalid}\n" +
- " * {@link <a href=\"invalid\">invalid<}\n" +
- " * {@link <a href=\"invalid\">invalid</}\n" +
- " * {@link <a href=\"invalid\">invalid</a}\n" +
- " * {@link <a href=\"invalid\">invalid</a> no text allowed after}\n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * {@link <}\n" +
- " ^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * {@link <a}\n" +
- " ^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * {@link <a hre}\n" +
- " ^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * {@link <a href}\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " * {@link <a href=}\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " * {@link <a href=\"}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " * {@link <a href=\"invalid}\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 12)\n" +
- " * {@link <a href=\"invalid\"}\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 13)\n" +
- " * {@link <a href=\"invalid\">}\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 14)\n" +
- " * {@link <a href=\"invalid\">invalid}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 15)\n" +
- " * {@link <a href=\"invalid\">invalid<}\n" +
- " ^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 16)\n" +
- " * {@link <a href=\"invalid\">invalid</}\n" +
- " ^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 17)\n" +
- " * {@link <a href=\"invalid\">invalid</a}\n" +
- " ^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 18)\n" +
- " * {@link <a href=\"invalid\">invalid</a> no text allowed after}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n"
- );
- }
- // String references
- public void testBug76324string() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Inline string references \n" +
- " *\n" +
- " * {@link \"}\n" +
- " * {@link \"unterminated string}\n" +
- " * {@link \"invalid string\"\"}\n" +
- " * {@link \"valid string\"}\n" +
- " * {@link \"invalid\" no text allowed after the string}\n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * {@link \"}\n" +
- " ^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * {@link \"unterminated string}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * {@link \"invalid string\"\"}\n" +
- " ^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " * {@link \"invalid\" no text allowed after the string}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 77510: [javadoc] compiler wrongly report deprecation when option "process javadoc comments" is not set
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=77510">77510</a>
- */
- public void testBug77510enabled() {
- runNegativeTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " /** \\u0009 @deprecated */\n" +
- " static int i0009;\n" +
- " /** \\u000a @deprecated */\n" +
- " static int i000a;\n" +
- " /** \\u000b @deprecated */\n" +
- " static int i000b;\n" +
- " /** \\u000c @deprecated */\n" +
- " static int i000c;\n" +
- " /** \\u001c @deprecated */\n" +
- " static int i001c;\n" +
- " /** \\u001d @deprecated */\n" +
- " static int i001d;\n" +
- " /** \\u001e @deprecated */\n" +
- " static int i001e;\n" +
- " /** \\u001f @deprecated */\n" +
- " static int i001f;\n" +
- " /** \\u2007 @deprecated */\n" +
- " static int i2007;\n" +
- " /** \\u202f @deprecated */\n" +
- " static int i202f;\n" +
- "}\n",
- "X.java",
- "public class X {\n" +
- " int i0 = A.i0009;\n" +
- " int i1 = A.i000a;\n" +
- " int i2 = A.i000b;\n" +
- " int i3 = A.i000c;\n" +
- " int i4 = A.i001c;\n" +
- " int i5 = A.i001d;\n" +
- " int i6 = A.i001e;\n" +
- " int i7 = A.i001f;\n" +
- " int i8 = A.i2007;\n" +
- " int i9 = A.i202f;\n" +
- "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int i0 = A.i0009;\n" +
- " ^^^^^\n" +
- "The field A.i0009 is deprecated\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " int i1 = A.i000a;\n" +
- " ^^^^^\n" +
- "The field A.i000a is deprecated\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " int i3 = A.i000c;\n" +
- " ^^^^^\n" +
- "The field A.i000c is deprecated\n" +
- "----------\n"
- );
- }
- public void testBug77510disabled() {
- docCommentSupport = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " /** \\u0009 @deprecated */\n" +
- " static int i0009;\n" +
- " /** \\u000a @deprecated */\n" +
- " static int i000a;\n" +
- " /** \\u000b @deprecated */\n" +
- " static int i000b;\n" +
- " /** \\u000c @deprecated */\n" +
- " static int i000c;\n" +
- " /** \\u001c @deprecated */\n" +
- " static int i001c;\n" +
- " /** \\u001d @deprecated */\n" +
- " static int i001d;\n" +
- " /** \\u001e @deprecated */\n" +
- " static int i001e;\n" +
- " /** \\u001f @deprecated */\n" +
- " static int i001f;\n" +
- " /** \\u2007 @deprecated */\n" +
- " static int i2007;\n" +
- " /** \\u202f @deprecated */\n" +
- " static int i202f;\n" +
- "}\n",
- "X.java",
- "public class X {\n" +
- " int i0 = A.i0009;\n" +
- " int i1 = A.i000a;\n" +
- " int i2 = A.i000b;\n" +
- " int i3 = A.i000c;\n" +
- " int i4 = A.i001c;\n" +
- " int i5 = A.i001d;\n" +
- " int i6 = A.i001e;\n" +
- " int i7 = A.i001f;\n" +
- " int i8 = A.i2007;\n" +
- " int i9 = A.i202f;\n" +
- "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int i0 = A.i0009;\n" +
- " ^^^^^\n" +
- "The field A.i0009 is deprecated\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " int i1 = A.i000a;\n" +
- " ^^^^^\n" +
- "The field A.i000a is deprecated\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " int i3 = A.i000c;\n" +
- " ^^^^^\n" +
- "The field A.i000c is deprecated\n" +
- "----------\n"
- );
- }
-
- /**
- * Test bug 77260: [Javadoc] deprecation warning should not be reported when @deprecated tag is set
- */
- public void testBug77260() {
- runConformTest(
- new String[] {
- "X.java",
- "/** @deprecated */\n" +
- "public class X {\n" +
- " public int x;\n" +
- " public void foo() {}\n" +
- "}\n",
- "Y.java",
- "/**\n" +
- " * @see X\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class Y {\n" +
- " /** @see X#x */\n" +
- " public int x;\n" +
- " /** @see X#foo() */\n" +
- " public void foo() {}\n" +
- "}\n",
- "Z.java",
- "public class Z {\n" +
- " /** \n" +
- " * @see X#x\n" +
- " * @deprecated\n" +
- " */\n" +
- " public int x;\n" +
- " /**\n" +
- " * @see X#foo()\n" +
- " * @deprecated\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n" }
- );
- }
- public void testBug77260nested() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED);
- runNegativeTest(
- new String[] {
- "X.java",
- "/** @deprecated */\n" +
- "public class X {\n" +
- " public int x;\n" +
- " public void foo() {}\n" +
- "}\n",
- "Y.java",
- "/**\n" +
- " * @see X\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class Y {\n" +
- " /** @see X#x */\n" +
- " public int x;\n" +
- " /** @see X#foo() */\n" +
- " public void foo() {}\n" +
- "}\n",
- "Z.java",
- "public class Z {\n" +
- " /** \n" +
- " * @see X#x\n" +
- " * @deprecated\n" +
- " */\n" +
- " public int x;\n" +
- " /**\n" +
- " * @see X#foo()\n" +
- " * @deprecated\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n" },
- "----------\n" +
- "1. ERROR in Y.java (at line 2)\n" +
- " * @see X\n" +
- " ^\n" +
- "Javadoc: The type X is deprecated\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 6)\n" +
- " /** @see X#x */\n" +
- " ^\n" +
- "Javadoc: The type X is deprecated\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 6)\n" +
- " /** @see X#x */\n" +
- " ^\n" +
- "Javadoc: The field X.x is deprecated\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 8)\n" +
- " /** @see X#foo() */\n" +
- " ^\n" +
- "Javadoc: The type X is deprecated\n" +
- "----------\n" +
- "5. ERROR in Y.java (at line 8)\n" +
- " /** @see X#foo() */\n" +
- " ^^^^^\n" +
- "Javadoc: The method foo() from the type X is deprecated\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Z.java (at line 3)\n" +
- " * @see X#x\n" +
- " ^\n" +
- "Javadoc: The type X is deprecated\n" +
- "----------\n" +
- "2. ERROR in Z.java (at line 3)\n" +
- " * @see X#x\n" +
- " ^\n" +
- "Javadoc: The field X.x is deprecated\n" +
- "----------\n" +
- "3. ERROR in Z.java (at line 8)\n" +
- " * @see X#foo()\n" +
- " ^\n" +
- "Javadoc: The type X is deprecated\n" +
- "----------\n" +
- "4. ERROR in Z.java (at line 8)\n" +
- " * @see X#foo()\n" +
- " ^^^^^\n" +
- "Javadoc: The method foo() from the type X is deprecated\n" +
- "----------\n",
- null,
- true,
- options
- );
- }
- public void testBug77260nested_disabled() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.DISABLED);
- runConformTest(
- new String[] {
- "X.java",
- "/** @deprecated */\n" +
- "public class X {\n" +
- " public int x;\n" +
- " public void foo() {}\n" +
- "}\n",
- "Y.java",
- "/**\n" +
- " * @see X\n" +
- " * @deprecated\n" +
- " */\n" +
- "public class Y {\n" +
- " /** @see X#x */\n" +
- " public int x;\n" +
- " /** @see X#foo() */\n" +
- " public void foo() {}\n" +
- "}\n",
- "Z.java",
- "public class Z {\n" +
- " /** \n" +
- " * @see X#x\n" +
- " * @deprecated\n" +
- " */\n" +
- " public int x;\n" +
- " /**\n" +
- " * @see X#foo()\n" +
- " * @deprecated\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n"
- },
- "",
- null,
- true,
- null,
- options,
- null
- );
- }
-
- /**
- * Bug 77602: [javadoc] "Only consider members as visible as" is does not work for syntax error
- */
- public void testBug77602() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see\n" +
- " * @see UnknownClass\n" +
- " */\n" +
- " protected void foo() {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @see\n" +
- " ^^^\n" +
- "Javadoc: Missing reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see UnknownClass\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: UnknownClass cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug77602_Public() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see\n" +
- " * @see UnknownClass\n" +
- " */\n" +
- " protected void foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 78091: [1.5][javadoc] Compiler should accept new 1.5 syntax for @param
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=78091">78091</a>
- */
- public void testBug78091() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param xxx.yyy invalid\n" +
- " * @param obj(x) invalid\n" +
- " */\n" +
- " public void foo(int xxx, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param xxx.yyy invalid\n" +
- " ^^^^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param obj(x) invalid\n" +
- " ^^^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public void foo(int xxx, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter xxx\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public void foo(int xxx, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 80910: [javadoc] Invalid missing reference warning on @see or @link tags
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=80910"
- */
- public void testBug80910() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " int field;\n" +
- "\n" +
- " /**\n" +
- " * @param key\'s toto\n" +
- " * @see #field\n" +
- " */\n" +
- " public void foo(int x) {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " * @param key\'s toto\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 82088: [search][javadoc] Method parameter types references not found in @see/@link tags
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=82088"
- */
- public void testBug82088() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " int field;\n" +
- "\n" +
- " /**\n" +
- " * @param key\'s toto\n" +
- " * @see #field\n" +
- " */\n" +
- " public void foo(int x) {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 5)\n" +
- " * @param key\'s toto\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 83285: [javadoc] Javadoc reference to constructor of secondary type has no binding / not found by search
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83285"
- */
- public void testBug83285a() {
- runConformTest(
- new String[] {
- "p/A.java",
- "package p;\n" +
- "class A { }\n" +
- "class C {\n" +
- " /**\n" +
- " * Link {@link #C(String)} was also wrongly warned...\n" +
- " */\n" +
- " private String fGerman;\n" +
- " public C(String german) {\n" +
- " fGerman = german;\n" +
- " }\n" +
- "}"
- }
- );
- }
- public void testBug83285b() {
- runConformTest(
- new String[] {
- "p/A.java",
- "package p;\n" +
- "class A {\n" +
- " A(char c) {}\n" +
- "}\n" +
- "class B {\n" +
- " B(Exception ex) {}\n" +
- " void foo() {} \n" +
- " class C { \n" +
- " /**\n" +
- " * Link {@link #B(Exception)} OK\n" +
- " * Link {@link #B.C(String)} OK\n" +
- " * Link {@link #foo()} OK\n" +
- " * Link {@link #bar()} OK\n" +
- " */\n" +
- " public C(String str) {}\n" +
- " void bar() {}\n" +
- " }\n" +
- "}"
- }
- );
- }
- public void testBug83285c() {
- runNegativeTest(
- new String[] {
- "p/A.java",
- "package p;\n" +
- "class A {\n" +
- " A(char c) {}\n" +
- "}\n" +
- "class B {\n" +
- " B(Exception ex) {}\n" +
- " void foo() {}\n" +
- " class C { \n" +
- " /**\n" +
- " * Link {@link #A(char)} KO\n" +
- " * Link {@link #B(char)} KO\n" +
- " * Link {@link #C(char)} KO\n" +
- " * Link {@link #foo(int)} KO\n" +
- " * Link {@link #bar(int)} KO\n" +
- " */\n" +
- " public C(String str) {}\n" +
- " void bar() {}\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in p\\A.java (at line 10)\n" +
- " * Link {@link #A(char)} KO\n" +
- " ^\n" +
- "Javadoc: The method A(char) is undefined for the type B.C\n" +
- "----------\n" +
- "2. ERROR in p\\A.java (at line 11)\n" +
- " * Link {@link #B(char)} KO\n" +
- " ^\n" +
- "Javadoc: The method B(char) is undefined for the type B.C\n" +
- "----------\n" +
- "3. ERROR in p\\A.java (at line 12)\n" +
- " * Link {@link #C(char)} KO\n" +
- " ^^^^^^^\n" +
- "Javadoc: The constructor B.C(char) is undefined\n" +
- "----------\n" +
- "4. ERROR in p\\A.java (at line 13)\n" +
- " * Link {@link #foo(int)} KO\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int) is undefined for the type B.C\n" +
- "----------\n" +
- "5. ERROR in p\\A.java (at line 14)\n" +
- " * Link {@link #bar(int)} KO\n" +
- " ^^^\n" +
- "Javadoc: The method bar() in the type B.C is not applicable for the arguments (int)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 87404: [javadoc] Unexpected not defined warning on constructor
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=87404"
- */
- public void testBug87404() {
- runConformTest(
- new String[] {
- "p/A.java",
- "package p;\n" +
- "class A {\n" +
- " A(char c) {}\n" +
- " class B {\n" +
- " B(Exception ex) {}\n" +
- " }\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Link {@link #A(char)} OK \n" +
- " * Link {@link #A(String)} OK\n" +
- " * Link {@link #foo()} OK\n" +
- " * Link {@link #bar()} OK\n" +
- " */\n" +
- " public A(String str) {}\n" +
- " void bar() {}\n" +
- "}"
- }
- );
- }
-
- /**
- * Bug 90302: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=90302"
- */
- public void testBug90302() {
- this.reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see #foo(String)\n" +
- " */\n" +
- "public class X {\n" +
- " /**\n" +
- " * Static method\n" +
- " * @param str\n" +
- " * @return int\n" +
- " * @throws NumberFormatException\n" +
- " */\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " return Integer.parseInt(str);\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "/**\n" +
- " * @see #foo(String)\n" +
- " */\n" +
- "public class Y extends X { \n" +
- " /**\n" +
- " * Static method: does not override super\n" +
- " * {@inheritDoc}\n" +
- " */\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " return Integer.parseInt(str);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 7)\n" +
- " * {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 9)\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 9)\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter str\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 9)\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception NumberFormatException\n" +
- "----------\n"
- );
- }
- public void testBug90302b() {
- this.reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "/** */\n" +
- "public class X {\n" +
- "}\n",
- "Y.java",
- "/**\n" +
- " * @see #foo(String)\n" +
- " */\n" +
- "public class Y extends X { \n" +
- " /**\n" +
- " * Simple method: does not override super\n" +
- " * {@inheritDoc}\n" +
- " */\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " return Integer.parseInt(str);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 7)\n" +
- " * {@inheritDoc}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 9)\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 9)\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter str\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 9)\n" +
- " static int foo(String str) throws NumberFormatException{\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception NumberFormatException\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 103304: [Javadoc] Wrong reference proposal for inner classes.
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
- */
- public void testBug103304a() {
- runNegativeTest(
- new String[] {
- "boden/IAFAState.java",
- "package boden;\n" +
- "public interface IAFAState {\n" +
- " public class ValidationException extends Exception {\n" +
- " public ValidationException(String variableName, IAFAState subformula) {\n" +
- " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
- " }\n" +
- " public void method() {}\n" +
- " }\n" +
- " /**\n" +
- " * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
- " * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
- " * @throws ValidationException Thrown if a variable is unbound. \n" +
- " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
- " * @see IAFAState.ValidationException#method()\n" +
- " * @see ValidationException\n" +
- " * {@link ValidationException}\n" +
- " */\n" +
- " public void validate() throws ValidationException;\n" +
- "}\n",
- "boden/TestValid.java",
- "package boden;\n" +
- "import boden.IAFAState.ValidationException;\n" +
- "/**\n" +
- " * @see ValidationException\n" +
- " * @see IAFAState.ValidationException\n" +
- " */\n" +
- "public class TestValid {\n" +
- " /** \n" +
- " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
- " */\n" +
- " IAFAState.ValidationException valid1;\n" +
- " /**\n" +
- " * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
- " */\n" +
- " IAFAState.ValidationException valid2;\n" +
- "}\n"
- },
- //boden\TestValid.java:8: warning - Tag @see: reference not found: ValidationException
- //boden\TestValid.java:12: warning - Tag @see: reference not found: ValidationException#IAFAState.ValidationException(String, IAFAState)
- "----------\n" +
- "1. ERROR in boden\\TestValid.java (at line 4)\n" +
- " * @see ValidationException\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in boden\\TestValid.java (at line 9)\n" +
- " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug103304b() {
- runNegativeTest(
- new String[] {
- "boden/IAFAState.java",
- "package boden;\n" +
- "public interface IAFAState {\n" +
- " public class ValidationException extends Exception {\n" +
- " public ValidationException(String variableName, IAFAState subformula) {\n" +
- " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
- " }\n" +
- " public void method() {}\n" +
- " }\n" +
- "}\n",
- "boden/TestInvalid1.java",
- "package boden;\n" +
- "import boden.IAFAState.ValidationException;\n" +
- "public class TestInvalid1 {\n" +
- " /** \n" +
- " * @see ValidationException#ValidationException(String, IAFAState)\n" +
- " */ \n" +
- " IAFAState.ValidationException invalid;\n" +
- "}\n",
- "boden/TestInvalid2.java",
- "package boden;\n" +
- "public class TestInvalid2 {\n" +
- " /**\n" +
- " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
- " */\n" +
- " IAFAState.ValidationException invalid;\n" +
- "}\n",
- "boden/TestInvalid3.java",
- "package boden;\n" +
- "import boden.IAFAState.ValidationException;\n" +
- "public class TestInvalid3 {\n" +
- " /**\n" +
- " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
- " */\n" +
- " IAFAState.ValidationException invalid;\n" +
- "}\n",
- "boden/TestInvalid4.java",
- "package boden;\n" +
- "import boden.IAFAState.ValidationException;\n" +
- "public class TestInvalid4 {\n" +
- " /**\n" +
- " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
- " */\n" +
- " IAFAState.ValidationException invalid;\n" +
- "}\n"
- },
- //boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
- //boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException => bug ID: 4288720
- //boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
- //boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
- "----------\n" +
- "1. ERROR in boden\\TestInvalid1.java (at line 5)\n" +
- " * @see ValidationException#ValidationException(String, IAFAState)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
- " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
- " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: IAFAState cannot be resolved or is not a field\n" +
- "----------\n"
- );
- }
- public void testBug103304c() {
- runConformTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public interface Test {\n" +
- " public class Level0 {\n" +
- " public Level0() {}\n" +
- " }\n" +
- " public interface Member {\n" +
- " public class Level1 {\n" +
- " public Level1() {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test/C.java",
- "package test;\n" +
- "public class C {\n" +
- " /**\n" +
- " * @see Test.Level0#Test.Level0()\n" +
- " */\n" +
- " Test.Level0 valid = new Test.Level0();\n" +
- " /**\n" +
- " * @see Test.Level0#Level0()\n" +
- " */\n" +
- " Test.Level0 invalid = new Test.Level0();\n" +
- "}\n"
- }
- //test\C.java:10: warning - Tag @see: can't find Level0() in test.Test.Level0 => bug ID: 4288720
- );
- }
- public void testBug103304d() {
- runNegativeTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public interface Test {\n" +
- " public class Level0 {\n" +
- " public Level0() {}\n" +
- " }\n" +
- " public interface Member {\n" +
- " public class Level1 {\n" +
- " public Level1() {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test/C2.java",
- "package test;\n" +
- "public class C2 {\n" +
- " /**\n" +
- " * @see Test.Member.Level1#Test.Member.Level1()\n" +
- " */\n" +
- " Test.Member.Level1 valid = new Test.Member.Level1();\n" +
- " /**\n" +
- " * @see Test.Member.Level1#Level1()\n" +
- " */\n" +
- " Test.Member.Level1 invalid = new Test.Member.Level1();\n" +
- " /**\n" +
- " * @see Test.Member.Level1#Test.Level1()\n" +
- " */\n" +
- " Test.Member.Level1 wrong = new Test.Member.Level1();\n" +
- "}\n"
- },
- //test\C2.java:10: warning - Tag @see: can't find Level1() in test.Test.Member.Level1 => Bug ID: 4288720
- //test\C2.java:14: warning - Tag @see: can't find Test.Level1() in test.Test.Member.Level1
- "----------\n" +
- "1. ERROR in test\\C2.java (at line 12)\n" +
- " * @see Test.Member.Level1#Test.Level1()\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug103304e() {
- runConformTest(
- new String[] {
- "implicit/Valid.java",
- "package implicit;\n" +
- "public interface Valid {\n" +
- " public class Level0 {\n" +
- " /**\n" +
- " * @see #Valid.Level0() Valid\n" +
- " */\n" +
- " public Level0() {}\n" +
- " /**\n" +
- " * @see #Valid.Level0(String) Valid\n" +
- " */\n" +
- " public Level0(String str) {}\n" +
- " }\n" +
- " public interface Member {\n" +
- " public class Level1 {\n" +
- " /**\n" +
- " * @see #Valid.Member.Level1() Valid\n" +
- " */\n" +
- " public Level1() {}\n" +
- " /**\n" +
- " * @see #Valid.Member.Level1(int) Valid\n" +
- " */\n" +
- " public Level1(int x) {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug103304f() {
- runNegativeTest(
- new String[] {
- "implicit/Invalid.java",
- "package implicit;\n" +
- "public interface Invalid {\n" +
- " public class Level0 {\n" +
- " /**\n" +
- " * @see #Level0() Invalid\n" +
- " */\n" +
- " public Level0() {}\n" +
- " /**\n" +
- " * @see #Level0(String) Invalid\n" +
- " */\n" +
- " public Level0(String str) {}\n" +
- " }\n" +
- " public interface Member {\n" +
- " public class Level1 {\n" +
- " /**\n" +
- " * @see #Level1() Invalid\n" +
- " * @see #Member.Level1() Invalid\n" +
- " * @see #Invalid.Level1() Invalid\n" +
- " */\n" +
- " public Level1() {}\n" +
- " /**\n" +
- " * @see #Level1(int) Invalid\n" +
- " * @see #Invalid.Level1(int) Invalid\n" +
- " * @see #Member.Level1(int) Invalid\n" +
- " */\n" +
- " public Level1(int x) {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //implicit\Invalid.java:7: warning - Tag @see: can't find Level0() in implicit.Invalid.Level0 => bug ID: 4288720
- //implicit\Invalid.java:11: warning - Tag @see: can't find Level0(String) in implicit.Invalid.Level0 => bug ID: 4288720
- //implicit\Invalid.java:20: warning - Tag @see: can't find Level1() in implicit.Invalid.Member.Level1 => bug ID: 4288720
- //implicit\Invalid.java:20: warning - Tag @see: can't find Member.Level1() in implicit.Invalid.Member.Level1
- //implicit\Invalid.java:20: warning - Tag @see: can't find Invalid.Level1() in implicit.Invalid.Member.Level1
- //implicit\Invalid.java:26: warning - Tag @see: can't find Level1(int) in implicit.Invalid.Member.Level1 => bug ID: 4288720
- //implicit\Invalid.java:26: warning - Tag @see: can't find Invalid.Level1(int) in implicit.Invalid.Member.Level1
- //implicit\Invalid.java:26: warning - Tag @see: can't find Member.Level1(int) in implicit.Invalid.Member.Level1
- "----------\n" +
- "1. ERROR in implicit\\Invalid.java (at line 17)\n" +
- " * @see #Member.Level1() Invalid\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in implicit\\Invalid.java (at line 18)\n" +
- " * @see #Invalid.Level1() Invalid\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "3. ERROR in implicit\\Invalid.java (at line 23)\n" +
- " * @see #Invalid.Level1(int) Invalid\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "4. ERROR in implicit\\Invalid.java (at line 24)\n" +
- " * @see #Member.Level1(int) Invalid\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 116464: [javadoc] Unicode tag name are not correctly parsed
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=116464"
- */
- public void testBug116464() {
- this.reportMissingJavadocTags = CompilerOptions.ERROR;
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @\\u0070\\u0061\\u0072\\u0061\\u006d str xxx\n" +
- " */\n" +
- " void foo(String str) {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 125903: [javadoc] Treat whitespace in javadoc tags as invalid tags
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=125903"
- */
- public void testBug125903() {
- this.reportMissingJavadocTags = CompilerOptions.ERROR;
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * {@ link java.lang.String}\n" +
- " * @ since 2.1\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * {@ link java.lang.String}\n" +
- " ^^\n" +
- "Javadoc: Invalid tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * @ since 2.1\n" +
- " ^^\n" +
- "Javadoc: Invalid tag\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 128954: Javadoc problems with category CAT_INTERNAL
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=128954"
- */
- public void testBug128954() {
- this.reportInvalidJavadoc = CompilerOptions.WARNING;
- this.reportDeprecation = CompilerOptions.WARNING;
- runNegativeTest(
- new String[] {
- "X.java", //========================
- "public class X {\n" +
- " /**\n" +
- " * @see p.A#bar()\n" +
- " */\n" +
- " void foo() {\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n",
- "p/A.java", //========================
- "package p;\n" +
- "public class A {\n" +
- " /** @deprecated */\n" +
- " public void bar() {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " * @see p.A#bar()\n" +
- " ^^^^^\n" +
- "[@cat:javadoc] Javadoc: The method bar() from the type A is deprecated\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "[@cat:type] Zork cannot be resolved to a type\n" +
- "----------\n",
- null,
- true,
- null,
- false,
- true,
- true);
- }
- /**
- * Bug 128954: Javadoc problems with category CAT_INTERNAL - variation
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=128954"
- */
- public void testBug128954a() {
- this.reportInvalidJavadoc = CompilerOptions.WARNING;
- this.reportDeprecation = CompilerOptions.WARNING;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " /**\n" +
- " * @see p.A#bar()\n" +
- " */\n" +
- " void foo() {\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " * @see p.A#bar()\n" +
- " ^^^\n" +
- "[@cat:javadoc] Javadoc: p cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "[@cat:type] Zork cannot be resolved to a type\n" +
- "----------\n",
- null,
- true,
- null,
- false,
- true,
- true);
- }
-
- /**
- * Bug 129241: [Javadoc] deprecation warning wrongly reported when ignoring Malformed Javadoc comments
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=129241"
- */
- public void testBug129241a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see p.A#bar\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "/** @deprecated */\n" +
- "public class A {\n" +
- " void bar() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @see p.A#bar\n" +
- " ^^^\n" +
- "Javadoc: The type A is deprecated\n" +
- "----------\n"
- );
- }
- public void testBug129241b() {
- this.reportDeprecation = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see p.A#bar\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "/** @deprecated */\n" +
- "public class A {\n" +
- " void bar() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @see p.A#bar\n" +
- " ^^^\n" +
- "Javadoc: The type A is deprecated\n" +
- "----------\n"
- );
- }
- public void testBug129241c() {
- this.reportJavadocDeprecation = CompilerOptions.DISABLED;
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see p.A#bar\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "/** @deprecated */\n" +
- "public class A {\n" +
- " void bar() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug129241d() {
- this.reportInvalidJavadoc = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see p.A#bar\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "/** @deprecated */\n" +
- "public class A {\n" +
- " void bar() {}\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 132813: NPE in Javadoc.resolve(Javadoc.java:196) + log swamped
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=132813"
- */
- public void testBug132813() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class X { \n" +
- " /** */ \n" +
- " public Test() {}\n" +
- " /** */\n" +
- " public test() {}\n" +
- "}\n" },
- "----------\n" +
- "1. ERROR in Test.java (at line 1)\n" +
- " public class X { \n" +
- " ^\n" +
- "The public type X must be defined in its own file\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " public Test() {}\n" +
- " ^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\n" +
- " public test() {}\n" +
- " ^^^^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 149013: [javadoc] In latest 3.3 build, there is a javadoc error in org.eclipse.core.resources
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=149013"
- */
- public void testBug149013_Private01() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "test1/X.java",
- "package test1;\n" +
- "public class X {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test1/Test.java",
- "package test1;\n" +
- "/**\n" +
- " * @see X.Inner\n" +
- " * @see X.Inner.Level2\n" +
- " * @see X.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {}\n",
- "test1/X.java"
- }
- );
- }
- public void testBug149013_Public01() {
- this.reportMissingJavadocTags = CompilerOptions.DISABLED;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test1/X.java",
- "package test1;\n" +
- "public class X {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test1/Test.java",
- "package test1;\n" +
- "/**\n" +
- " * @see X.Inner\n" +
- " * @see X.Inner.Level2\n" +
- " * @see X.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n"
- },
- //test1\Test.java:7: warning - Tag @see: reference not found: X.Inner
- //test1\Test.java:7: warning - Tag @see: reference not found: X.Inner.Level2
- //test1\Test.java:7: warning - Tag @see: reference not found: X.Inner.Level2.Level3
- "----------\n" +
- "1. ERROR in test1\\Test.java (at line 3)\n" +
- " * @see X.Inner\n" +
- " ^^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n" +
- "2. ERROR in test1\\Test.java (at line 4)\n" +
- " * @see X.Inner.Level2\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n" +
- "3. ERROR in test1\\Test.java (at line 5)\n" +
- " * @see X.Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n"
- );
- }
- public void testBug149013_Private02() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "test1/X.java",
- "package test1;\n" +
- "public class X {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test2/Test.java",
- "package test2;\n" +
- "import test1.X;\n" +
- "/**\n" +
- " * @see X.Inner\n" +
- " * @see X.Inner.Level2\n" +
- " * @see X.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {}\n",
- },
- //test2\Test.java:10: warning - Tag @see: reference not found: X.Inner
- //test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2
- //test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2.Level3
- "----------\n" +
- "1. ERROR in test2\\Test.java (at line 4)\r\n" +
- " * @see X.Inner\r\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.Inner is not visible\n" +
- "----------\n" +
- "2. ERROR in test2\\Test.java (at line 5)\r\n" +
- " * @see X.Inner.Level2\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: The type X.Inner is not visible\n" +
- "----------\n" +
- "3. ERROR in test2\\Test.java (at line 6)\r\n" +
- " * @see X.Inner.Level2.Level3\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type X.Inner is not visible\n" +
- "----------\n"
- );
- }
- public void testBug149013_Public02() {
- this.reportMissingJavadocTags = CompilerOptions.DISABLED;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test1/X.java",
- "package test1;\n" +
- "public class X {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test2/Test.java",
- "package test2;\n" +
- "import test1.X;\n" +
- "/**\n" +
- " * @see X.Inner\n" +
- " * @see X.Inner.Level2\n" +
- " * @see X.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {}\n",
- },
- //test2\Test.java:10: warning - Tag @see: reference not found: X.Inner
- //test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2
- //test2\Test.java:10: warning - Tag @see: reference not found: X.Inner.Level2.Level3
- "----------\n" +
- "1. ERROR in test2\\Test.java (at line 4)\r\n" +
- " * @see X.Inner\r\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.Inner is not visible\n" +
- "----------\n" +
- "2. ERROR in test2\\Test.java (at line 5)\r\n" +
- " * @see X.Inner.Level2\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: The type X.Inner is not visible\n" +
- "----------\n" +
- "3. ERROR in test2\\Test.java (at line 6)\r\n" +
- " * @see X.Inner.Level2.Level3\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type X.Inner is not visible\n" +
- "----------\n"
- );
- }
- public void testBug149013_Private03() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "test1/X.java",
- "package test1;\n" +
- "public class X {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test3/Test.java",
- "package test3;\n" +
- "/**\n" +
- " * @see test1.X.Inner\n" +
- " * @see test1.X.Inner.Level2\n" +
- " * @see test1.X.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {}\n"
- },
- // no warning
- "----------\n" +
- "1. ERROR in test3\\Test.java (at line 3)\r\n" +
- " * @see test1.X.Inner\r\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: The type test1.X.Inner is not visible\n" +
- "----------\n" +
- "2. ERROR in test3\\Test.java (at line 4)\r\n" +
- " * @see test1.X.Inner.Level2\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test1.X.Inner is not visible\n" +
- "----------\n" +
- "3. ERROR in test3\\Test.java (at line 5)\r\n" +
- " * @see test1.X.Inner.Level2.Level3\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test1.X.Inner is not visible\n" +
- "----------\n"
- );
- }
- public void testBug149013_Public03() {
- this.reportMissingJavadocTags = CompilerOptions.DISABLED;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test1/X.java",
- "package test1;\n" +
- "public class X {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {}\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test3/Test.java",
- "package test3;\n" +
- "/**\n" +
- " * @see test1.X.Inner\n" +
- " * @see test1.X.Inner.Level2\n" +
- " * @see test1.X.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {}\n"
- },
- // no warning
- "----------\n" +
- "1. ERROR in test3\\Test.java (at line 3)\r\n" +
- " * @see test1.X.Inner\r\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: The type test1.X.Inner is not visible\n" +
- "----------\n" +
- "2. ERROR in test3\\Test.java (at line 4)\r\n" +
- " * @see test1.X.Inner.Level2\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test1.X.Inner is not visible\n" +
- "----------\n" +
- "3. ERROR in test3\\Test.java (at line 5)\r\n" +
- " * @see test1.X.Inner.Level2.Level3\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test1.X.Inner is not visible\n" +
- "----------\n"
- );
- }
-
- /**
- * @bug 153399: [javadoc] JDT Core should warn if the @value tag is not used correctly
- * @test Ensure that 'value' tag is well warned when not used correctly
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=153399"
- */
- public void testBug153399a() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X { \n" +
- " /**\n" +
- " * {@value #MY_VALUE}\n" +
- " */\n" +
- " public final static int MY_VALUE = 0; \n" +
- " /**\n" +
- " * {@value #MY_VALUE}\n" +
- " */\n" +
- " public void foo() {}\n" +
- " /**\n" +
- " * {@value #MY_VALUE}\n" +
- " */\n" +
- " class Sub {} \n" +
- "}\n"
- };
- if (complianceLevel.equals(COMPLIANCE_1_3) || complianceLevel.equals(COMPLIANCE_1_4)) {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * {@value #MY_VALUE}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " * {@value #MY_VALUE}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- } else {
- runConformTest(testFiles);
- }
- }
- public void testBug153399b() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X { \n" +
- " /**\n" +
- " * {@value}\n" +
- " */\n" +
- " public final static int MY_VALUE = 0; \n" +
- " /**\n" +
- " * {@value}\n" +
- " */\n" +
- " public void foo() {}\n" +
- " /**\n" +
- " * {@value}\n" +
- " */\n" +
- " class Sub {} \n" +
- "}\n"
- };
- if (complianceLevel.equals(COMPLIANCE_1_3) || complianceLevel.equals(COMPLIANCE_1_4)) {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " * {@value}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " * {@value}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- } else {
- runConformTest(testFiles);
- }
- }
- public void testBug153399c() {
- String[] testFiles = new String[] {
- "p1/X.java",
- "package p1;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @return a\n" +
- " */\n" +
- " boolean get() {\n" +
- " return false;\n" +
- " }\n" +
- "}\n"
- };
- runConformTest(testFiles);
- }
- public void testBug153399d() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X { \n" +
- " /**\n" +
- " * {@value #MY_VALUE}\n" +
- " * {@value}\n" +
- " * {@value Invalid}\n" +
- " */\n" +
- " public final static int MY_VALUE = 0; \n" +
- "}\n"
- };
- if (complianceLevel.equals(COMPLIANCE_1_3) || complianceLevel.equals(COMPLIANCE_1_4)) {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * {@value #MY_VALUE}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * {@value}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- } else {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * {@value Invalid}\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n"
- );
- }
- }
- public void testBug153399e() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X { \n" +
- " /**\n" +
- " * {@value Invalid}\n" +
- " * {@value #MY_VALUE}\n" +
- " */\n" +
- " public final static int MY_VALUE = 0; \n" +
- "}\n"
- };
- if (complianceLevel.equals(COMPLIANCE_1_3) || complianceLevel.equals(COMPLIANCE_1_4)) {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * {@value Invalid}\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- } else {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * {@value Invalid}\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n"
- );
- }
- }
-
- /**
- * @bug 160015: [1.5][javadoc] Missing warning on autoboxing compatible methods
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=160015"
- */
- public void testBug160015() {
- runNegativeTest(new String[] {
- "Test.java",
- "/**\n" +
- " * @see #method(Long) Warning!\n" +
- " */\n" +
- "public class Test {\n" +
- " public void method(long l) {}\n" +
- " /**\n" +
- " * @see #method(Long) Warning!\n" +
- " */\n" +
- " void bar() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see #method(Long) Warning!\n" +
- " ^^^^^^\n" +
- "Javadoc: The method method(long) in the type Test is not applicable for the arguments (Long)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 7)\n" +
- " * @see #method(Long) Warning!\n" +
- " ^^^^^^\n" +
- "Javadoc: The method method(long) in the type Test is not applicable for the arguments (Long)\n" +
- "----------\n"
- );
- }
-
- /**
- * @bug 163659: [javadoc] Compiler should warn when method parameters are not identical
- * @test Ensure that a warning is raised when method parameter types are not identical
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=163659"
- */
- public void testBug163659() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * @see #foo(MyInterface)\n" +
- " * @see #foo(MySubInterface)\n" +
- " */\n" +
- "public class Test {\n" +
- " public void foo(MyInterface mi) {\n" +
- " }\n" +
- "}\n" +
- "interface MyInterface {}\n" +
- "interface MySubInterface extends MyInterface {} \n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " * @see #foo(MySubInterface)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(MyInterface) in the type Test is not applicable for the arguments (MySubInterface)\n" +
- "----------\n"
- );
- }
-
- /**
- * @bug 165794: [javadoc] Should not report ambiguous on method with parameterized types as parameters
- * @test Ensure that no warning are raised when ambiguous parameterized methods are present in javadoc comments
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=165794"
- */
- public void testBug165794() {
- String[] testFiles = new String[] {
- "X.java",
- "/**\n" +
- " * No reasonable hint for resolving the {@link #getMax(A)}.\n" +
- " */\n" +
- "public class X {\n" +
- " /**\n" +
- " * Extends Number method.\n" +
- " * @see #getMax(A ipZ)\n" +
- " */\n" +
- " public <T extends Y> T getMax(final A<T> ipY) {\n" +
- " return ipY.t();\n" +
- " }\n" +
- " \n" +
- " /**\n" +
- " * Extends Exception method.\n" +
- " * @see #getMax(A ipY)\n" +
- " */\n" +
- " public <T extends Z> T getMax(final A<T> ipZ) {\n" +
- " return ipZ.t();\n" +
- " }\n" +
- "}\n" +
- "class A<T> {\n" +
- " T t() { return null; }\n" +
- "}\n" +
- "class Y {}\n" +
- "class Z {}"
- };
- if (complianceLevel.equals(COMPLIANCE_1_3) || complianceLevel.equals(COMPLIANCE_1_4)) {
- return;
- }
- runConformTest(testFiles);
- }
-
- /**
- * @bug 166365: [javadoc] severity level of malformed javadoc comments did not work properly
- * @test Ensure that no warning is raised when visibility is lower than the javadoc option one
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=166365"
- */
- public void testBug166365() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @return\n" +
- " */\n" +
- " private String getSomePrivate() {\n" +
- " return \"SomePrivate\";\n" +
- " }\n" +
- " /**\n" +
- " * @return\n" +
- " */\n" +
- " protected String getSomeProtected() {\n" +
- " return \"SomeProtected\";\n" +
- " }\n" +
- " /**\n" +
- " * @return\n" +
- " */\n" +
- " String getSomeDefault() {\n" +
- " return \"SomeDefault\";\n" +
- " }\n" +
- " /**\n" +
- " * @return\n" +
- " */\n" +
- " public String getSomePublic() {\n" +
- " return \"SomePublic\";\n" +
- " }\n" +
- "}\n"
- };
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 21)\n" +
- " * @return\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing return type description\n" +
- "----------\n"
- );
- }
-
- /**
- * @bug 166436: [javadoc] Potentially wrong javadoc warning for unexpected duplicate tag value
- * @test Ensure that no duplicate warning is raised for value tag
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=166436"
- */
- public void testBug166436() {
- String[] testFiles = new String[] {
- "X.java",
- "public class X {\n" +
- " public static final String PUBLIC_CONST = \"public\";\n" +
- " protected static final String PROTECTED_CONST = \"protected\";\n" +
- " static final String DEFAULT_CONST = \"default\"; \n" +
- " private static final String PRIVATE_CONST = \"private\"; \n" +
- " /**\n" +
- " * Values:\n" +
- " * <ul>\n" +
- " * <li>{@value #PUBLIC_CONST}</li>\n" +
- " * <li>{@value #PROTECTED_CONST}</li>\n" +
- " * <li>{@value #DEFAULT_CONST}</li>\n" +
- " * <li>{@value #PRIVATE_CONST}</li>\n" +
- " * </ul>\n" +
- " */\n" +
- " public X() {\n" +
- " }\n" +
- "}\n"
- };
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- if (complianceLevel.equals(COMPLIANCE_1_3) || complianceLevel.equals(COMPLIANCE_1_4)) {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " * <li>{@value #PUBLIC_CONST}</li>\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " * <li>{@value #PROTECTED_CONST}</li>\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " * <li>{@value #DEFAULT_CONST}</li>\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " * <li>{@value #PRIVATE_CONST}</li>\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- } else {
- runNegativeTest(testFiles,
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " * <li>{@value #PROTECTED_CONST}</li>\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'protected\' reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " * <li>{@value #DEFAULT_CONST}</li>\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 12)\n" +
- " * <li>{@value #PRIVATE_CONST}</li>\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'private\' reference\n" +
- "----------\n"
- );
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest.java
deleted file mode 100644
index cf6e61f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest.java
+++ /dev/null
@@ -1,578 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Map;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public abstract class JavadocTest extends AbstractRegressionTest {
-
- boolean useLibrary = false;
- static String ZIP_FILE = "/TestJavadocVisibility.zip";
- static final String LINE_SEPARATOR = System.getProperty("line.separator");
- public static ArrayList ALL_CLASSES = null;
- static final String DOC_COMMENT_SUPPORT = System.getProperty("doc.support");
- static boolean debug = false;
-
- // Javadoc execution
- protected static final String JAVADOC_NAME =
- File.pathSeparatorChar == ':' ? "javadoc" : "javadoc.exe";
- protected static String javadocCommandLineHeader;
-
- static {
- ALL_CLASSES = new ArrayList();
- ALL_CLASSES.add(JavadocBugsTest.class);
- ALL_CLASSES.add(JavadocTestForMethod.class);
- ALL_CLASSES.add(JavadocTestMixed.class);
- ALL_CLASSES.add(JavadocTestForClass.class);
- ALL_CLASSES.add(JavadocTestForConstructor.class);
- ALL_CLASSES.add(JavadocTestForField.class);
- ALL_CLASSES.add(JavadocTestForInterface.class);
- ALL_CLASSES.add(JavadocTestOptions.class);
- }
-
-
- public static void addTest(TestSuite suite, Class testClass) {
- TestSuite innerSuite = new TestSuite(testClass);
- suite.addTest(innerSuite);
- }
-
- public static Test suite() {
- TestSuite testSuite = new TestSuite(JavadocTest.class.getName());
-
- // Reset forgotten subsets of tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS = null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
-
- for (int i = 0, size=ALL_CLASSES.size(); i < size; i++) {
- Class testClass = (Class) ALL_CLASSES.get(i);
- Test suite = buildAllCompliancesTestSuite(testClass);
- testSuite.addTest(suite);
- }
- int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((complianceLevels & AbstractCompilerTest.F_1_3) != 0) {
- testSuite.addTest(buildUniqueComplianceTestSuite(JavadocTest_1_3.class, COMPLIANCE_1_3));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- testSuite.addTest(buildUniqueComplianceTestSuite(JavadocTest_1_4.class, COMPLIANCE_1_4));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- testSuite.addTest(buildUniqueComplianceTestSuite(JavadocTest_1_5.class, COMPLIANCE_1_5));
- }
- return testSuite;
- }
-
- public static Test suiteForComplianceLevel(String level, Class testClass) {
- Test suite = buildAllCompliancesTestSuite(testClass);
- return new RegressionTestSetup(suite, level);
- }
-
- public JavadocTest(String name) {
- super(name);
- }
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
- // Set default before bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=110964 changes
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.ENABLED);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.ENABLED);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
-// options.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE);
- return options;
- }
-
- protected String[] getDefaultClassPaths() {
- if (useLibrary) {
- String[] classLibs = super.getDefaultClassPaths();
- final int length = classLibs.length;
- String[] newClassPaths = new String[length + 1];
- System.arraycopy(classLibs, 0, newClassPaths, 0, length);
- newClassPaths[length] = getClass().getResource(ZIP_FILE).getPath();
- return newClassPaths;
- }
- return super.getDefaultClassPaths();
- }
-
- static String[] referencedClasses = null;
- static {
- referencedClasses =
- new String[] {
- "test/AbstractVisibility.java",
- "package test;\n" +
- "public abstract class AbstractVisibility {\n" +
- " private class AvcPrivate {\n" +
- " private int avf_private = 10;\n" +
- " public int avf_public = avf_private;\n" +
- " private int avm_private() {\n" +
- " avf_private = (new AvcPrivate()).avf_private;\n" +
- " return avf_private;\n" +
- " }\n" +
- " public int avm_public() {\n" +
- " return avm_private();\n" +
- " }\n" +
- " }\n" +
- " public class AvcPublic {\n" +
- " private int avf_private = 10;\n" +
- " public int avf_public = avf_private;\n" +
- " private int avm_private() {\n" +
- " avf_private = (new AvcPrivate()).avf_private;\n" +
- " return avf_private;\n" +
- " }\n" +
- " public int avm_public() {\n" +
- " return avm_private();\n" +
- " }\n" +
- " }\n" +
- " private int avf_private = 100;\n" +
- " public int avf_public = avf_private;\n" +
- " \n" +
- " private int avm_private() {\n" +
- " avf_private = (new AvcPrivate()).avf_private;\n" +
- " return avf_private;\n" +
- " }\n" +
- " public int avm_public() {\n" +
- " return avm_private();\n" +
- " }\n" +
- "}\n",
- "test/Visibility.java",
- "package test;\n" +
- "public class Visibility extends AbstractVisibility {\n" +
- " private class VcPrivate {\n" +
- " private int vf_private = 10;\n" +
- " public int vf_public = vf_private;\n" +
- " private int vm_private() {\n" +
- " vf_private = (new VcPrivate()).vf_private;\n" +
- " avf_private = vf_private;\n" +
- " return vf_private+avf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- " };\n" +
- " public class VcPublic {\n" +
- " private int vf_private = 10;\n" +
- " public int vf_public = vf_private;\n" +
- " private int vm_private() {\n" +
- " vf_private = (new VcPrivate()).vf_private;\n" +
- " avf_private = vf_private;\n" +
- " return vf_private+avf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- " };\n" +
- " private int vf_private = 100;\n" +
- " private int avf_private = 100;\n" +
- " public int vf_public = vf_private;\n" +
- " public int avf_public = vf_private;\n" +
- " \n" +
- " private int vm_private() {\n" +
- " vf_private = (new VcPrivate()).vf_private;\n" +
- " avf_private = vf_private;\n" +
- " return vf_private+avf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- "}\n",
- "test/copy/VisibilityPackage.java",
- "package test.copy;\n" +
- "class VisibilityPackage {\n" +
- " private class VpPrivate {\n" +
- " private int vf_private = 10;\n" +
- " public int vf_public = vf_private;\n" +
- " private int vm_private() {\n" +
- " vf_private = (new VpPrivate()).vf_private;\n" +
- " return vf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- " }\n" +
- " public class VpPublic {\n" +
- " private int vf_private = 10;\n" +
- " public int vf_public = vf_private;\n" +
- " private int vm_private() {\n" +
- " vf_private = (new VpPrivate()).vf_private;\n" +
- " return vf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- " }\n" +
- " private int vf_private = 100;\n" +
- " public int vf_public = vf_private;\n" +
- " \n" +
- " private int vm_private() {\n" +
- " vf_private = (new VpPrivate()).vf_private;\n" +
- " return vf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- "}\n",
- "test/copy/VisibilityPublic.java",
- "package test.copy;\n" +
- "public class VisibilityPublic {\n" +
- " private class VpPrivate {\n" +
- " private int vf_private = 10;\n" +
- " public int vf_public = vf_private;\n" +
- " private int vm_private() {\n" +
- " vf_private = (new VpPrivate()).vf_private;\n" +
- " return vf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- " }\n" +
- " public class VpPublic {\n" +
- " private int vf_private = 10;\n" +
- " public int vf_public = vf_private;\n" +
- " private int vm_private() {\n" +
- " vf_private = (new VpPrivate()).vf_private;\n" +
- " return vf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- " }\n" +
- " private int vf_private = 100;\n" +
- " public int vf_public = vf_private;\n" +
- " \n" +
- " private int vm_private() {\n" +
- " vf_private = (new VpPrivate()).vf_private;\n" +
- " return vf_private;\n" +
- " }\n" +
- " public int vm_public() {\n" +
- " return vm_private();\n" +
- " }\n" +
- "}\n" };
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- if (RUN_JAVAC) {
- javadocCommandLineHeader =
- jdkRootDirPath.append("bin").append(JAVADOC_NAME).toString(); // PREMATURE replace JAVA_NAME and JAVAC_NAME with locals? depends on potential reuse
- }
-// SHIFT = true;
-// INDENT = 3;
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
-// SHIFT = false;
-// INDENT = 2;
- super.tearDown();
- }
-
- protected void runConformReferenceTest(String[] testFiles) {
- String[] completedFiles = testFiles;
- if (!useLibrary) {
- completedFiles = new String[testFiles.length + referencedClasses.length];
- System.arraycopy(referencedClasses, 0, completedFiles, 0, referencedClasses.length);
- System.arraycopy(testFiles, 0, completedFiles, referencedClasses.length, testFiles.length);
- }
- runConformTest(completedFiles);
- }
- protected void runNegativeReferenceTest(String[] testFiles, String expected) {
- String[] completedFiles = testFiles;
- if (!useLibrary) {
- completedFiles = new String[testFiles.length + referencedClasses.length];
- System.arraycopy(referencedClasses, 0, completedFiles, 0, referencedClasses.length);
- System.arraycopy(testFiles, 0, completedFiles, referencedClasses.length, testFiles.length);
- }
- runNegativeTest(completedFiles, expected);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest#runConformTest(java.lang.String[], java.lang.String, java.lang.String[], boolean, java.lang.String[], java.util.Map, org.eclipse.wst.jsdt.internal.compiler.ICompilerRequestor)
- *
- protected void runConformTest(String[] testFiles,
- String expectedSuccessOutputString,
- String[] classLib,
- boolean shouldFlushOutputDirectory,
- String[] vmArguments,
- Map customOptions,
- ICompilerRequestor clientRequestor) {
- if (TESTS_NAMES != null || TESTS_PREFIX != null || TESTS_NUMBERS != null || TESTS_RANGE != null) {
- writeFiles(testFiles);
- }
- super.runConformTest(testFiles,
- expectedSuccessOutputString,
- classLib,
- shouldFlushOutputDirectory,
- vmArguments,
- customOptions,
- clientRequestor);
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest#runNegativeTest(java.lang.String[], java.lang.String, java.lang.String[], boolean, java.util.Map, boolean)
- *
- protected void runNegativeTest(String[] testFiles,
- String expectedProblemLog,
- String[] classLib,
- boolean shouldFlushOutputDirectory,
- Map customOptions,
- boolean generateOutput) {
- if (TESTS_NAMES != null || TESTS_PREFIX != null || TESTS_NUMBERS != null || TESTS_RANGE != null) {
- writeFiles(testFiles);
- }
- super.runNegativeTest(testFiles,
- expectedProblemLog,
- classLib,
- shouldFlushOutputDirectory,
- customOptions,
- generateOutput);
- }
- */
- protected void writeFiles(String[] testFiles) {
- String classDirName = getClass().getName().substring(getClass().getName().lastIndexOf('.')+1); //.substring(11);
- String testName = getName();
- int idx = testName.indexOf(" - ");
- if (idx > 0) {
- testName = testName.substring(idx+3);
- }
-
- // File dir = new File("d:/usr/OTI/tests/javadoc/");
- // non portable
- createOutputTestDirectory(classDirName);
- createOutputTestDirectory(Character.toUpperCase(testName.charAt(0)) +
- testName.substring(1));
- System.out.println("Write test file to " +
- this.outputTestDirectory.getPath() + "...");
- for (int i=0, length=testFiles.length; i<length; i++) {
- String contents = testFiles[i+1];
- String fileName = testFiles[i++];
- String dirFileName = this.outputTestDirectory.getPath();
- if (fileName.indexOf("Visibility")>0) {
- continue;
- } else {
- int index = fileName.lastIndexOf('/');
- if (index > 0) {
- String subdirs = fileName.substring(0, index);
- String packName = subdirs.replace('/', '.');
- contents = "package "+packName+";"+contents.substring(contents.indexOf(';')+1);
- File dir = new File(dirFileName, subdirs);
- if (!dir.exists()) dir.mkdirs();
- if (RUN_JAVAC) {
- Util.writeToFile(contents, dirFileName+"/"+fileName);
- // PREMATURE this results into a duplicate file.
- }
- fileName = fileName.substring(index+1);
- }
- }
- Util.writeToFile(contents, dirFileName+"/"+fileName);
- // REVIEW don't know why this is created at the default package level
- }
- }
-
- /*
- * Run Sun compilation using javadoc.
- * See implementation in parent for details.
- */
- protected void runJavac(
- String[] testFiles,
- final String expectedProblemLog,
- final String expectedSuccessOutputString,
- boolean shouldFlushOutputDirectory) {
- String testName = null;
- Process compileProcess = null;
- Process execProcess = null;
- try {
- // Init test name
- testName = testName();
-
- // Cleanup javac output dir if needed
- File javacOutputDirectory = new File(JAVAC_OUTPUT_DIR);
- if (shouldFlushOutputDirectory) {
- Util.delete(javacOutputDirectory);
- }
-
- // Write files in dir
- writeFiles(testFiles);
-
- // Prepare command line
- StringBuffer cmdLine = new StringBuffer(javadocCommandLineHeader);
- // compute extra classpath
- String[] classpath = Util.concatWithClassLibs(JAVAC_OUTPUT_DIR, false);
- StringBuffer cp = new StringBuffer(" -classpath ");
- int length = classpath.length;
- for (int i = 0; i < length; i++) {
- if (i > 0)
- cp.append(File.pathSeparatorChar);
- if (classpath[i].indexOf(" ") != -1) {
- cp.append("\"" + classpath[i] + "\"");
- } else {
- cp.append(classpath[i]);
- }
- }
- cmdLine.append(cp);
- // add source files
- for (int i = 0; i < testFiles.length; i += 2) {
- // *.java is not enough (p1/X.java, p2/Y.java)
- cmdLine.append(' ');
- cmdLine.append(testFiles[i]);
- }
-
- // Launch process
- compileProcess = Runtime.getRuntime().exec(
- cmdLine.toString(), null, this.outputTestDirectory);
-
- // Log errors
- Logger errorLogger = new Logger(compileProcess.getErrorStream(), "ERROR");
-
- // Log output
- Logger outputLogger = new Logger(compileProcess.getInputStream(), "OUTPUT");
-
- // start the threads to run outputs (standard/error)
- errorLogger.start();
- outputLogger.start();
-
- // Wait for end of process
- int exitValue = compileProcess.waitFor();
- errorLogger.join(); // make sure we get the whole output
- outputLogger.join();
-
- // Report raw javadoc results
- if (! testName.equals(javacTestName)) {
- javacTestName = testName;
- javacTestErrorFlag = false;
- javacFullLog.println("-----------------------------------------------------------------");
- javacFullLog.println(CURRENT_CLASS_NAME + " " + testName);
- }
- if (exitValue != 0) {
- javacTestErrorFlag = true;
- }
- if (errorLogger.buffer.length() > 0) {
- javacFullLog.println("--- javac err: ---");
- javacFullLog.println(errorLogger.buffer.toString());
- }
- if (outputLogger.buffer.length() > 0) {
- javacFullLog.println("--- javac out: ---");
- javacFullLog.println(outputLogger.buffer.toString());
- }
-
- // Compare compilation results
- if (expectedProblemLog == null || expectedProblemLog.length() == 0) {
- // Eclipse found no error and no warning
- if (exitValue != 0) {
- // Javac found errors
- System.out.println("----------------------------------------");
- System.out.println(testName + " - Javadoc has found error(s) but Eclipse expects conform result:\n");
- javacFullLog.println("JAVAC_MISMATCH: Javadoc has found error(s) but Eclipse expects conform result");
- System.out.println(errorLogger.buffer.toString());
- printFiles(testFiles);
- DIFF_COUNTERS[0]++;
- }
- else {
- // Javac found no error - may have found warnings
- if (errorLogger.buffer.length() > 0) {
- System.out.println("----------------------------------------");
- System.out.println(testName + " - Javadoc has found warning(s) but Eclipse expects conform result:\n");
- javacFullLog.println("JAVAC_MISMATCH: Javadoc has found warning(s) but Eclipse expects conform result");
- System.out.println(errorLogger.buffer.toString());
- printFiles(testFiles);
- DIFF_COUNTERS[0]++;
- }
- }
- }
- else {
- // Eclipse found errors or warnings
- if (errorLogger.buffer.length() == 0) {
- System.out.println("----------------------------------------");
- System.out.println(testName + " - Eclipse has found error(s)/warning(s) but Javadoc did not find any:");
- javacFullLog.println("JAVAC_MISMATCH: Eclipse has found error(s)/warning(s) but Javadoc did not find any");
- dualPrintln("eclipse:");
- dualPrintln(expectedProblemLog);
- printFiles(testFiles);
- DIFF_COUNTERS[1]++;
- } else if (expectedProblemLog.indexOf("ERROR") > 0 && exitValue == 0){
- System.out.println("----------------------------------------");
- System.out.println(testName + " - Eclipse has found error(s) but Javadoc only found warning(s):");
- javacFullLog.println("JAVAC_MISMATCH: Eclipse has found error(s) but Javadoc only found warning(s)");
- dualPrintln("eclipse:");
- dualPrintln(expectedProblemLog);
- System.out.println("javadoc:");
- System.out.println(errorLogger.buffer.toString());
- printFiles(testFiles);
- DIFF_COUNTERS[1]++;
- } else {
- // PREMATURE refine comparison
- // TODO (frederic) compare warnings in each result and verify they are similar...
-// System.out.println(testName+": javac has found warnings :");
-// System.out.print(errorLogger.buffer.toString());
-// System.out.println(testName+": we're expecting warning results:");
-// System.out.println(expectedProblemLog);
- }
- }
- }
- catch (InterruptedException e1) {
- if (compileProcess != null) compileProcess.destroy();
- if (execProcess != null) execProcess.destroy();
- System.out.println(testName+": Sun javadoc compilation was aborted!");
- javacFullLog.println("JAVAC_WARNING: Sun javadoc compilation was aborted!");
- e1.printStackTrace(javacFullLog);
- }
- catch (Throwable e) {
- System.out.println(testName+": could not launch Sun javadoc compilation!");
- e.printStackTrace();
- javacFullLog.println("JAVAC_ERROR: could not launch Sun javac compilation!");
- e.printStackTrace(javacFullLog);
- // PREMATURE failing the javac pass or comparison could also fail
- // the test itself
- }
- finally {
- Util.delete(outputTestDirectory);
- }
- }
-
- protected void printJavacResultsSummary() {
- if (RUN_JAVAC) {
- Integer count = (Integer)TESTS_COUNTERS.get(CURRENT_CLASS_NAME);
- if (count != null) {
- int newCount = count.intValue()-1;
- TESTS_COUNTERS.put(CURRENT_CLASS_NAME, new Integer(newCount));
- if (newCount == 0) {
- if (DIFF_COUNTERS[0]!=0 || DIFF_COUNTERS[1]!=0 || DIFF_COUNTERS[2]!=0) {
- dualPrintln("===========================================================================");
- dualPrintln("Results summary:");
- }
- if (DIFF_COUNTERS[0]!=0)
- dualPrintln(" - "+DIFF_COUNTERS[0]+" test(s) where Javadoc found errors/warnings but Eclipse did not");
- if (DIFF_COUNTERS[1]!=0)
- dualPrintln(" - "+DIFF_COUNTERS[1]+" test(s) where Eclipse found errors/warnings but Javadoc did not");
- System.out.println("\n");
- }
- }
- javacFullLog.flush();
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForClass.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForClass.java
deleted file mode 100644
index 0313a05..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForClass.java
+++ /dev/null
@@ -1,990 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTestForClass extends JavadocTest {
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
- public JavadocTestForClass(String name) {
- super(name);
- }
- public static Class javadocTestClass() {
- return JavadocTestForClass.class;
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- return options;
- }
-
- /* (non-Javadoc)
- * Test unexpected tags
- */
- public void test001() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " */\n"
- + "public class X {\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test002() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @param x Invalid tag\n"
- + " */\n"
- + "public class X {\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @param x Invalid tag\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " */\n"
- + "public class X {\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test004() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " */\n"
- + "public class X {\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test005() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @return Invalid tag\n"
- + " */\n"
- + "public class X {\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @return Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " * @return Invalid tag\n"
- + " * @param x Invalid tag\n"
- + " */\n"
- + "public class X {\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 4)\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 5)\n"
- + " * @return Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 6)\n"
- + " * @param x Invalid tag\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test007() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " */\n"
- + "public class X {\n"
- + " public void foo() {}\n"
- + " /**\n"
- + " * Invalid javadoc comment\n"
- + " */\n"
- + "}\n" }
- );
- }
-
- public void test008() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public void foo() {}\n"
- + " /**\n"
- + " * Invalid javadoc comment\n"
- + " */\n"
- + "}\n" }
- );
- }
-
- public void test009() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid javadoc comment\n"
- + " */\n"
- + "}\n" }
- );
- }
-
- /*
- * (non-Javadoc) Test @see tag
- */
- // String references
- public void test010() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid string references \n"
- + " *\n"
- + " * @see \"\n"
- + " * @see \"unterminated string\n"
- + " * @see \"invalid string\"\"\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @see \"\n"
- + " ^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @see \"unterminated string\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " * @see \"invalid string\"\"\n"
- +" ^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 7)\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test011() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Valid string references \n"
- + " *\n"
- + " * @see \"Valid normal string\"\n"
- + " * @see \"Valid \\\"string containing\\\" \\\"double-quote\\\"\"\n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- // URL Link references
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid URL link references \n"
- + " *\n"
- + " * @see <a href=\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @see <a href=\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test013() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Valid URL link references \n"
- + " *\n"
- + " * @see <a href=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Valid URL link reference</a>\n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- // @see Classes references
- public void test020() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Valid local classes references \n"
- + " *\n"
- + " * @see Visibility Valid ref: local class \n"
- + " * @see Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " * @see test.Visibility Valid ref: local class \n"
- + " * @see test.Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see test.Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test021() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid local classes references \n"
- + " *\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 5)\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 7)\n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 9)\n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test022() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- "public class X {\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test023() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Invalid external classes references \n"
- + " *\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n");
- }
-
- public void test024() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- "public class X {\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- // @see Field references
- public void test030() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Valid local class field references\n"
- + " *\n"
- + " * @see #x Valid ref: accessible field\n"
- + " * @see Visibility#vf_public Valid ref: visible field\n"
- + " * @see Visibility.VcPublic#vf_public Valid ref: visible field in visible inner class\n"
- + " */\n"
- + "public class X {\n"
- + " int x;\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test031() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid local class field references\n"
- + " *\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 5)\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " ^\n"
- + "Javadoc: x cannot be resolved or is not a field\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- public void test032() {
- runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- " /**\n" +
- " * Valid other package visible class fields references\n" +
- " *\n" +
- " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n" +
- " */\n" +
- "public class X {\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test033() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- // @see method references
- public void test040() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references with array\n"
- + " * \n"
- + " * @see #smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) Valid local method reference\n"
- + " * @see #smr_foo(char[], int[][], String[][][], Vector[][][][]) Valid local method reference\n"
- + " * @see #smr_foo(char[],int[][],java.lang.String[][][],java.util.Vector[][][][]) Valid local method reference\n"
- + " */ \n"
- + "public class X {\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test041() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Invalid local methods references with array (non applicable arrays)\n"
- + " * \n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + "public class X {\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[][][], Vector[][][])\n"
- + "----------\n");
- }
-
- public void test042() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see #smr_foo() Valid local method reference\n"
- + " * @see #smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see #smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see #smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test043() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + "public class X {\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type X\n"
- + "----------\n");
- }
-
- public void test044() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " */ \n"
- + "public class X {\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (float, long, char, short, byte, int, boolean)\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String, String, int, String)\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean)\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^\n"
- + "Javadoc: Vector cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test045() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see X#smr_foo() Valid local method reference\n"
- + " * @see X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see X#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + "public class X {\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test046() {
- this.runConformTest(
- new String[] {
- "test/deep/qualified/name/p/X.java",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo() Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + "public class X {\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test047() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Valid package class methods references\n"
- + " * \n"
- + " * @see Visibility#vm_public() Valid ref: visible method\n"
- + " * @see Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " * @see test.Visibility#vm_public() Valid ref: visible method\n"
- + " * @see test.Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " */ \n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test048() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid package class methods references (non-existence)\n"
- + " * \n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " */ \n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 5)\n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility.VcPublic\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 7)\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Visibility.Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test049() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid package class methods references (non-visible)\n"
- + " * \n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */ \n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 5)\n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility.VcPublic is not visible\n"
- + "----------\n");
- }
-
- public void test050() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid package class methods references (non-applicable)\n"
- + " * \n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " */ \n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 5)\n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility is not applicable for the arguments (String)\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility.VcPublic is not applicable for the arguments (Integer, byte)\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility.VcPublic is not applicable for the arguments (Double, Boolean)\n"
- + "----------\n");
- }
-
- public void test051() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Invalid other package non visible class methods references (non existent/visible arguments)\n"
- + " * \n"
- + " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " */ \n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 7)\n" +
- " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPackage is not visible\n" +
- "----------\n");
- }
-
- public void test052() {
- runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.VisibilityPublic;\n" +
- " /**\n" +
- " * Valid other package visible class methods references \n" +
- " * \n" +
- " * @see VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n" +
- " */\n" +
- "public class X {\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test053() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Valid other package visible class methods references \n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForConstructor.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForConstructor.java
deleted file mode 100644
index 9658557..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForConstructor.java
+++ /dev/null
@@ -1,946 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTestForConstructor extends JavadocTest {
- public JavadocTestForConstructor(String name) {
- super(name);
- }
- public static Class javadocTestClass() {
- return JavadocTestForConstructor.class;
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
- static { // Use this static to initialize TESTS_NAMES (String[]) , TESTS_RANGE (int[2]), TESTS_NUMBERS (int[])
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- return options;
- }
-
- /* (non-Javadoc)
- * Test @deprecated tag
- */
- public void test001() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z();\n"
- + " }\n"
- + "}\n",
- "Z.java",
- "public class Z {\n"
- + " /** \n"
- + " * \n"
- + " * ** ** ** ** @deprecated */\n"
- + " public Z() { \n"
- + " }\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 4)\n"
- + " new Z();\n"
- + " ^^^^^^^\n"
- + "The constructor Z() is deprecated\n"
- + "----------\n");
- }
-
- public void test002() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z(2);\n"
- + " }\n"
- + "}\n",
- "Z.java",
- "public class Z {\n"
- + " /** \n"
- + " * Valid tags with deprecation at end\n"
- + " *\n"
- + " * @param value Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public Z(int value) { \n"
- + " }\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 4)\n"
- + " new Z(2);\n"
- + " ^^^^^^^^\n"
- + "The constructor Z(int) is deprecated\n"
- + "----------\n");
- }
-
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z();\n"
- + " }\n"
- + "}\n",
- "Z.java",
- "public class Z {\n"
- + " /** \n"
- + " * Invalid javadoc tags with valid deprecation at end\n"
- + " *\n"
- + " * @param\n"
- + " * @return\n"
- + " * @throws Unknown\n"
- + " * @see \"Invalid\n"
- + " * @see Unknown\n"
- + " * @param x\n"
- + " * @deprecated\n"
- + " */\n"
- + " public Z() { \n"
- + " }\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 4)\n"
- + " new Z();\n"
- + " ^^^^^^^\n"
- + "The constructor Z() is deprecated\n"
- + "----------\n"
- + "----------\n"
- + "1. ERROR in Z.java (at line 5)\n"
- + " * @param\n"
- + " ^^^^^\n"
- + "Javadoc: Missing parameter name\n"
- + "----------\n"
- + "2. ERROR in Z.java (at line 6)\n"
- + " * @return\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "3. ERROR in Z.java (at line 7)\n"
- + " * @throws Unknown\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in Z.java (at line 8)\n"
- + " * @see \"Invalid\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "5. ERROR in Z.java (at line 9)\n"
- + " * @see Unknown\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "6. ERROR in Z.java (at line 10)\n"
- + " * @param x\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- /*
- * (non-Javadoc) Test @see tag
- */
- // String references
- public void test010() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid string references \n"
- + " *\n"
- + " * @see \"unterminated string\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see \"unterminated string\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test011() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Valid string references \n"
- + " *\n"
- + " * @see \"Valid normal string\"\n"
- + " * @see \"Valid \\\"string containing\\\" \\\"double-quote\\\"\"\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
- }
-
- // URL Link references
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid URL link references \n"
- + " *\n"
- + " * @see <a href=\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see <a href=\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test013() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Valid URL link references \n"
- + " *\n"
- + " * @see <a href=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Valid URL link reference</a>\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
- }
-
- // @see Classes references
- public void test020() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local classes references \n"
- + " *\n"
- + " * @see Visibility Valid ref: local class \n"
- + " * @see Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " * @see test.Visibility Valid ref: local class \n"
- + " * @see test.Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see test.Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test021() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local classes references \n"
- + " *\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test022() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public X() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test023() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid external classes references \n"
- + " *\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n");
- }
-
- public void test024() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public X() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- // @see Field references
- public void test030() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " int x;\n"
- + " /**\n"
- + " * Valid local class field references\n"
- + " *\n"
- + " * @see #x Valid ref: accessible field\n"
- + " * @see Visibility#vf_public Valid ref: visible field\n"
- + " * @see Visibility.VcPublic#vf_public Valid ref: visible field in visible inner class\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test031() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local class field references\n"
- + " *\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " ^\n"
- + "Javadoc: x cannot be resolved or is not a field\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- public void test032() {
- runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid other package visible class fields references\n" +
- " *\n" +
- " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n" +
- " */\n" +
- " public X() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test033() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 11)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 12)\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- // @see method references
- public void test040() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references with array\n"
- + " * \n"
- + " * @see #smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) Valid local method reference\n"
- + " * @see #smr_foo(char[], int[][], String[][][], Vector[][][][]) Valid local method reference\n"
- + " * @see #smr_foo(char[],int[][],java.lang.String[][][],java.util.Vector[][][][]) Valid local method reference\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test041() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references with array (non applicable arrays)\n"
- + " * \n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[][][], Vector[][][])\n"
- + "----------\n");
- }
-
- public void test042() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see #smr_foo() Valid local method reference\n"
- + " * @see #smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see #smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see #smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test043() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type X\n"
- + "----------\n");
- }
-
- public void test044() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (float, long, char, short, byte, int, boolean)\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String, String, int, String)\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean)\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^\n"
- + "Javadoc: Vector cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test045() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see X#smr_foo() Valid local method reference\n"
- + " * @see X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see X#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test046() {
- this.runConformTest(
- new String[] {
- "test/deep/qualified/name/p/X.java",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo() Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test047() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid package class methods references\n"
- + " * \n"
- + " * @see Visibility#vm_public() Valid ref: visible method\n"
- + " * @see Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " * @see test.Visibility#vm_public() Valid ref: visible method\n"
- + " * @see test.Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test048() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-existence)\n"
- + " * \n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility.VcPublic\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Visibility.Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test049() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-visible)\n"
- + " * \n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility.VcPublic is not visible\n"
- + "----------\n");
- }
-
- public void test050() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-applicable)\n"
- + " * \n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility is not applicable for the arguments (String)\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility.VcPublic is not applicable for the arguments (Integer, byte)\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility.VcPublic is not applicable for the arguments (Double, Boolean)\n"
- + "----------\n");
- }
-
- public void test051() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class methods references (non existent/visible arguments)\n"
- + " * \n"
- + " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " */ \n"
- + " public X() {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 7)\n" +
- " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPackage is not visible\n" +
- "----------\n");
- }
-
- public void test052() {
- runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.VisibilityPublic;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid other package visible class methods references \n" +
- " * \n" +
- " * @see VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n" +
- " */\n" +
- " public X() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test053() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid other package visible class methods references \n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForField.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForField.java
deleted file mode 100644
index 058f7a6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForField.java
+++ /dev/null
@@ -1,1013 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTestForField extends JavadocTest {
- public JavadocTestForField(String name) {
- super(name);
- }
- public static Class javadocTestClass() {
- return JavadocTestForField.class;
- }
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
- static { // Use this static to initialize testNames (String[]) , testRange (int[2]), testNumbers (int[])
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- return options;
- }
-
- /*
- * (non-Javadoc) Test @param tag
- */
- public void test001() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @author ffr\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" });
- }
-
- public void test002() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid field javadoc\n"
- + " * @param x Invalid tag\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @param x Invalid tag\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid field javadoc\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test004() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid field javadoc\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test005() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid class javadoc\n"
- + " * @return Invalid tag\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @return Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid class javadoc\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " * @return Invalid tag\n"
- + " * @param x Invalid tag\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " * @return Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 7)\n"
- + " * @param x Invalid tag\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
- /*
- * (non-Javadoc)
- * Test @deprecated tag
- */
- public void test007() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " int x;\n"
- + " {\n"
- + " x=(new Z()).z;\n"
- + " }\n"
- + "}\n",
- "Z.java",
- "public class Z {\n"
- + " /** \n"
- + " * \n"
- + " * ** ** ** ** @deprecated */\n"
- + " public int z;\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 4)\n"
- + " x=(new Z()).z;\n"
- + " ^\n"
- + "The field Z.z is deprecated\n"
- + "----------\n");
- }
-
- public void test008() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " int x;\n"
- + " {\n"
- + " x=(new Z()).z;\n"
- + " }\n"
- + "}\n",
- "Z.java",
- "public class Z {\n"
- + " /** \n"
- + " * Invalid tags with deprecation\n"
- + " *\n"
- + " * @param x\n"
- + " * @return\n"
- + " * @throws NullPointerException\n"
- + " * @exception IllegalArgumentException\n"
- + " * @see X\n"
- + " * @deprecated\n"
- + " */\n"
- + " public int z;\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 4)\n"
- + " x=(new Z()).z;\n"
- + " ^\n"
- + "The field Z.z is deprecated\n"
- + "----------\n"
- + "----------\n"
- + "1. ERROR in Z.java (at line 5)\n"
- + " * @param x\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "2. ERROR in Z.java (at line 6)\n"
- + " * @return\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "3. ERROR in Z.java (at line 7)\n"
- + " * @throws NullPointerException\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "4. ERROR in Z.java (at line 8)\n"
- + " * @exception IllegalArgumentException\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- /*
- * (non-Javadoc)
- * Test @see tag
- */
- // String references
- public void test010() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid string references \n"
- + " *\n"
- + " * @see \"unterminated string\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see \"unterminated string\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test011() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Valid string references \n"
- + " *\n"
- + " * @see \"Valid normal string\"\n"
- + " * @see \"Valid \\\"string containing\\\" \\\"double-quote\\\"\"\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" });
- }
-
- // URL Link references
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid URL link references \n"
- + " *\n"
- + " * @see <a href=\"invalid\">invalid</\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see <a href=\"invalid\">invalid</\n"
- + " ^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test013() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Valid URL link references \n"
- + " *\n"
- + " * @see <A HREF = \"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Valid URL link reference</A>\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" });
- }
-
- // @see Classes references
- public void test020() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local classes references \n"
- + " *\n"
- + " * @see Visibility Valid ref: local class \n"
- + " * @see Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " * @see test.Visibility Valid ref: local class \n"
- + " * @see test.Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see test.Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " */\n"
- + " public int x;\n"
- + "}\n" });
- }
-
- public void test021() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local classes references \n"
- + " *\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test022() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public int x;\n" +
- "}\n"
- }
- );
- }
-
- public void test023() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid external classes references \n"
- + " *\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n");
- }
-
- public void test024() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public int x;\n" +
- "}\n"
- }
- );
- }
-
- // @see Field references
- public void test030() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local class field references\n"
- + " *\n"
- + " * @see #str Valid ref: accessible field\n"
- + " * @see Visibility#vf_public Valid ref: visible field\n"
- + " * @see Visibility.VcPublic#vf_public Valid ref: visible field in visible inner class\n"
- + " */\n"
- + " public int x;\n"
- + " public String str;\n"
- + "}\n" });
- }
-
- public void test031() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local class field references\n"
- + " *\n"
- + " * @see #str Invalid ref: non existent field\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see #str Invalid ref: non existent field\n"
- + " ^^^\n"
- + "Javadoc: str cannot be resolved or is not a field\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- public void test032() {
- runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Invalid other package non visible class fields references\n" +
- " *\n" +
- " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n" +
- " */\n" +
- " public int x;\n" +
- "}\n"
- }
- );
- }
-
- public void test033() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see VisibilityPackage#unknown Invalid ref: non visible class (non existent field)\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPackage#unknown Invalid ref: non visible class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 11)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 12)\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- // @see method references
- public void test040() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references with array\n"
- + " * \n"
- + " * @see #smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) Valid local method reference\n"
- + " * @see #smr_foo(char[], int[][], String[][][], Vector[][][][]) Valid local method reference\n"
- + " * @see #smr_foo(char[],int[][],java.lang.String[][][],java.util.Vector[][][][]) Valid local method reference\n"
- + " */ \n"
- + " public int x;\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test041() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references with array (non applicable arrays)\n"
- + " * \n"
- + " * @see #smr_foo(char , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + " public int x;\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(char , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char, int[][], String[][][], Vector[][][][])\n"
- + "----------\n");
- }
-
- public void test042() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see #smr_foo() Valid local method reference\n"
- + " * @see #smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see #smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see #smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public int x;\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test043() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + " public int x;\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type X\n"
- + "----------\n");
- }
-
- public void test044() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " */ \n"
- + " public int x;\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (float, long, char, short, byte, int, boolean)\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String, String, int, String)\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean)\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^\n"
- + "Javadoc: Vector cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test045() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see X#smr_foo() Valid local method reference\n"
- + " * @see X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see X#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public int x;\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test046() {
- this.runConformTest(
- new String[] {
- "test/deep/qualified/name/p/X.java",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo() Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public int x;\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test047() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid package class methods references\n"
- + " * \n"
- + " * @see Visibility#vm_public() Valid ref: visible method\n"
- + " * @see Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " * @see test.Visibility#vm_public() Valid ref: visible method\n"
- + " * @see test.Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " */ \n"
- + " public int x;\n"
- + "}\n" });
- }
-
- public void test048() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-existence)\n"
- + " * \n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " */ \n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility.VcPublic\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Visibility.Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test049() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-visible)\n"
- + " * \n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */ \n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility.VcPublic is not visible\n"
- + "----------\n");
- }
-
- public void test050() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-applicable)\n"
- + " * \n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " */ \n"
- + " public int x;\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility is not applicable for the arguments (String)\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility.VcPublic is not applicable for the arguments (Integer, byte)\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility.VcPublic is not applicable for the arguments (Double, Boolean)\n"
- + "----------\n");
- }
-
- public void test051() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class methods references (non existent/visible arguments)\n"
- + " * \n"
- + " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " */ \n"
- + " public int x;\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 7)\n" +
- " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPackage is not visible\n" +
- "----------\n");
- }
-
- public void test052() {
- runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "import test.copy.VisibilityPublic;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid other package visible class methods references \n" +
- " * \n" +
- " * @see VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n" +
- " */\n" +
- " public int x;\n" +
- "}\n"
- }
- );
- }
-
- public void test053() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid other package visible class methods references \n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n"
- + " */\n"
- + " public int x;\n"
- + "}\n" });
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForInterface.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForInterface.java
deleted file mode 100644
index b7fb201..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForInterface.java
+++ /dev/null
@@ -1,2219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTestForInterface extends JavadocTest {
- public JavadocTestForInterface(String name) {
- super(name);
- }
- public static Class javadocTestClass() {
- return JavadocTestForInterface.class;
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
- static { // Use this static to initialize testNames (String[]) , testRange (int[2]), testNumbers (int[])
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- return options;
- }
-
- /*
- * (non-Javadoc)
- * Javadoc comment of Interface
- */
- // Unexpected tag
- public void test001() {
- this.runConformTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test002() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @param x Invalid tag\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 3)\n"
- + " * @param x Invalid tag\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 3)\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test004() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 3)\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test005() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @return Invalid tag\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 3)\n"
- + " * @return Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid class javadoc\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " * @return Invalid tag\n"
- + " * @param x Invalid tag\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 3)\n"
- + " * @exception NullPointerException Invalid tag\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 4)\n"
- + " * @throws NullPointerException Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "3. ERROR in IX.java (at line 5)\n"
- + " * @return Invalid tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "4. ERROR in IX.java (at line 6)\n"
- + " * @param x Invalid tag\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test007() {
- this.runConformTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + " /**\n"
- + " * Invalid javadoc comment\n"
- + " */\n"
- + "}\n" }
- );
- }
-
- public void test008() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " public void foo();\n"
- + " /**\n"
- + " * Invalid javadoc comment\n"
- + " */\n"
- + "}\n" }
- );
- }
-
- public void test009() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid javadoc comment\n"
- + " */\n"
- + "}\n" }
- );
- }
-
-
- // @see tag
- public void test010() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid string references \n"
- + " *\n"
- + " * @see \"unterminated string\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 4)\n"
- + " * @see \"unterminated string\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 5)\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test011() {
- this.runConformTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Valid string references \n"
- + " *\n"
- + " * @see \"Valid normal string\"\n"
- + " * @see \"Valid \\\"string containing\\\" \\\"double-quote\\\"\"\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid URL link references \n"
- + " *\n"
- + " * @see <a href=\"invalid\">invalid</a\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 4)\n"
- + " * @see <a href=\"invalid\">invalid</a\n"
- + " ^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 5)\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test013() {
- this.runConformTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Valid URL link references \n"
- + " *\n"
- + " * @see <a hReF = \"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Valid URL link reference</A>\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- // @see Classes references
- public void test020() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Valid local classes references \n"
- + " *\n"
- + " * @see Visibility Valid ref: local class \n"
- + " * @see Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " * @see test.Visibility Valid ref: local class \n"
- + " * @see test.Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see test.Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test021() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid local classes references \n"
- + " *\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 5)\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 7)\n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 8)\n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\IX.java (at line 9)\n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test022() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- "public interface IX {\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- public void test023() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Invalid external classes references \n"
- + " *\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 6)\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 7)\n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n");
- }
-
- public void test024() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- "public interface IX {\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- // @see Field references
- public void test030() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Valid local class field references\n"
- + " *\n"
- + " * @see Visibility#vf_public Valid ref: visible field\n"
- + " * @see Visibility.VcPublic#vf_public Valid ref: visible field in visible inner class\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test031() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid local class field references\n"
- + " *\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 5)\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " ^\n"
- + "Javadoc: x cannot be resolved or is not a field\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 8)\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\IX.java (at line 9)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\IX.java (at line 10)\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- public void test032() {
- runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- " /**\n" +
- " * Valid other package visible class fields references\n" +
- " *\n" +
- " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n" +
- " */\n" +
- "public interface IX {\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- public void test033() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 6)\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 7)\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 8)\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 9)\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\IX.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\IX.java (at line 11)\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- // @see method references
- public void test040() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references with array\n"
- + " * \n"
- + " * @see #smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) Valid local method reference\n"
- + " * @see #smr_foo(char[], int[][], String[][][], Vector[][][][]) Valid local method reference\n"
- + " * @see #smr_foo(char[],int[][],java.lang.String[][][],java.util.Vector[][][][]) Valid local method reference\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra);\n"
- + "}\n" });
- }
-
- public void test041() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Invalid local methods references with array (non applicable arrays)\n"
- + " * \n"
- + " * @see #smr_foo(char[] , int[][], String[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra);\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @see #smr_foo(char[] , int[][], String[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type IX is not applicable for the arguments (char[], int[][], String[][], Vector[][][][])\n"
- + "----------\n");
- }
-
- public void test042() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see #smr_foo() Valid local method reference\n"
- + " * @see #smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see #smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see #smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b);\n"
- + "}\n" });
- }
-
- public void test043() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 4)\n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type IX\n"
- + "----------\n");
- }
-
- public void test044() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(int) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b);\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 4)\n"
- + " * @see #smr_foo(int) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo() in the type IX is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 5)\n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type IX is not applicable for the arguments (float, long, char, short, byte, int, boolean)\n"
- + "----------\n"
- + "3. ERROR in IX.java (at line 6)\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type IX is not applicable for the arguments (String, String, int, String)\n"
- + "----------\n"
- + "4. ERROR in IX.java (at line 7)\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type IX is not applicable for the arguments (boolean)\n"
- + "----------\n"
- + "5. ERROR in IX.java (at line 8)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "6. ERROR in IX.java (at line 8)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^\n"
- + "Javadoc: Vector cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test045() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see IX#smr_foo() Valid local method reference\n"
- + " * @see IX#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see IX#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see IX#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b);\n"
- + "}\n" });
- }
-
- public void test046() {
- this.runConformTest(
- new String[] {
- "test/deep/qualified/name/p/IX.java",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo() Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, Vector v, boolean b);\n"
- + "}\n" });
- }
-
- public void test047() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Valid package class methods references\n"
- + " * \n"
- + " * @see Visibility#vm_public() Valid ref: visible method\n"
- + " * @see Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " * @see test.Visibility#vm_public() Valid ref: visible method\n"
- + " * @see test.Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test048() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid package class methods references (non-existence)\n"
- + " * \n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 5)\n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility.VcPublic\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 8)\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Visibility.Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test049() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid package class methods references (non-visible)\n"
- + " * \n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 5)\n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility.VcPublic is not visible\n"
- + "----------\n");
- }
-
- public void test050() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Invalid package class methods references (non-applicable)\n"
- + " * \n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 5)\n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility is not applicable for the arguments (String)\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility.VcPublic is not applicable for the arguments (Integer, byte)\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility.VcPublic is not applicable for the arguments (Double, Boolean)\n"
- + "----------\n");
- }
-
- public void test051() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Invalid other package non visible class methods references (non existent/visible arguments)\n"
- + " * \n"
- + " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\IX.java (at line 6)\n" +
- " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\IX.java (at line 7)\n" +
- " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPackage is not visible\n" +
- "----------\n");
- }
-
- public void test052() {
- runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- "import test.copy.VisibilityPublic;\n" +
- " /**\n" +
- " * Valid other package visible class methods references \n" +
- " * \n" +
- " * @see VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n" +
- " */\n" +
- "public interface IX {\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- public void test053() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Valid other package visible class methods references \n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- /*
- * (non-Javadoc)
- * Javadoc method comment in Interface
- */
- // @deprecated tag
- public void test060() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public void foo(IX x) {\n"
- + " x.foo();\n"
- + " }\n"
- + "}\n",
- "IX.java",
- "public interface IX {\n"
- + " /** \n"
- + " * \n"
- + " * ** ** ** ** @deprecated */\n"
- + " public void foo();\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 3)\n"
- + " x.foo();\n"
- + " ^^^^^^^\n"
- + "The method foo() from the type IX is deprecated\n"
- + "----------\n");
- }
-
- public void test061() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /** @deprecated */\n"
- + " int x=0;\n"
- + " /**\n"
- + " * @see #x\n"
- + " */\n"
- + " void foo();\n"
- + "}\n",
- "IY.java",
- "/** @deprecated */\n"
- + "public interface IY {\n"
- + " int y=0;\n"
- + " /**\n"
- + " * @see IX#x\n"
- + " * @see IY\n"
- + " * @see IY#y\n"
- + " */\n"
- + " void foo();\n"
- + "}\n",
- "X.java",
- "public class X {\n"
- + " int x;\n"
- + " /**\n"
- + " * @see IX#x\n"
- + " * @see IY\n"
- + " * @see IY#y\n"
- + " */\n"
- + " void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @see IX#x\n"
- + " ^\n"
- + "Javadoc: The field IX.x is deprecated\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @see IY\n"
- + " ^^\n"
- + "Javadoc: The type IY is deprecated\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " * @see IY#y\n"
- + " ^^\n"
- + "Javadoc: The type IY is deprecated\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 6)\n"
- + " * @see IY#y\n"
- + " ^\n"
- + "Javadoc: The field IY.y is deprecated\n"
- + "----------\n");
- }
-
- public void test062() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " \n"
- + " void foo(IX x) {\n"
- + " x.foo(2);\n"
- + " }\n"
- + "}\n",
- "IX.java",
- "public interface IX {\n"
- + " /** \n"
- + " * Valid tags with deprecation\n"
- + " *\n"
- + " * @param x Valid param tag\n"
- + " * @return Valid return tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(int x);\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 4)\n"
- + " x.foo(2);\n"
- + " ^^^^^^^^\n"
- + "The method foo(int) from the type IX is deprecated\n"
- + "----------\n");
- }
-
- public void test063() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " \n"
- + " void foo(IX x) {\n"
- + " x.foo(2);\n"
- + " }\n"
- + "}\n",
- "IX.java",
- "public interface IX {\n"
- + " /** \n"
- + " * Invalid javadoc tags with valid deprecation\n"
- + " *\n"
- + " * @param\n"
- + " * @return String\n"
- + " * @throws Unknown\n"
- + " * @see \"Invalid\n"
- + " * @see Unknown\n"
- + " * @param x\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(int x);\n"
- + "}\n",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 4)\n"
- + " x.foo(2);\n"
- + " ^^^^^^^^\n"
- + "The method foo(int) from the type IX is deprecated\n"
- + "----------\n"
- + "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @param\n"
- + " ^^^^^\n"
- + "Javadoc: Missing parameter name\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 7)\n"
- + " * @throws Unknown\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "3. ERROR in IX.java (at line 8)\n"
- + " * @see \"Invalid\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "4. ERROR in IX.java (at line 9)\n"
- + " * @see Unknown\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "5. ERROR in IX.java (at line 10)\n"
- + " * @param x\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "6. ERROR in IX.java (at line 13)\n"
- + " public String foo(int x);\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter x\n"
- + "----------\n");
- }
-
- // @param tag
- public void test064() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Valid @param: no tags, no args\n"
- + " * Valid @throws/@exception: no tags, no thrown exception\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test065() {
- this.runConformTest(new String[] {
- "IX.java",
- "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test066() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid @param declaration: no arguments, 2 declared tags\n"
- + " * @param x\n"
- + " * Invalid param: not an argument on 2 lines\n"
- + " * @param x Invalid param: not an argument\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 4)\n"
- + " * @param x\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 6)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n");
- }
-
- public void test067() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " \n"
- + " /**\n"
- + " * Valid @param declaration: 3 arguments, 3 tags in right order\n"
- + " * @param a Valid param\n"
- + " * @param b Valid param \n"
- + " * @param c Valid param\n"
- + " */\n"
- + " public void foo(int a, int b, int c);\n"
- + "}\n" });
- }
-
- public void test068() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid @param declaration: 3 arguments, 3 correct tags in right order + 2 additional\n"
- + " * @param a Valid param\n"
- + " * @param x Invalid param: not an argument\n"
- + " * @param b Valid param \n"
- + " * @param y Invalid param: not an argument\n"
- + " * @param c Valid param\n"
- + " */\n"
- + " public void foo(char a, char b, char c);\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 7)\n"
- + " * @param y Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter y is not declared\n"
- + "----------\n");
- }
-
- public void test069() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid @param: all arguments are not documented\n"
- + " */\n"
- + " public void foo(double a, double b, double c);\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " public void foo(double a, double b, double c);\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 5)\n"
- + " public void foo(double a, double b, double c);\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter b\n"
- + "----------\n"
- + "3. ERROR in IX.java (at line 5)\n"
- + " public void foo(double a, double b, double c);\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter c\n"
- + "----------\n");
- }
-
- public void test070() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid @param: mix of all possible errors (missing a, not argument tag and duplicated)\n"
- + " * @param c Valid param\n"
- + " * @param x Invalid param: not an argument\n"
- + " * @param b Valid param\n"
- + " * @param c Invalid param: duplicated\n"
- + " * @param\n"
- + " */\n"
- + " public void foo(double a, long b, int c);\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 7)\n"
- + " * @param c Invalid param: duplicated\n"
- + " ^\n"
- + "Javadoc: Duplicate tag for parameter\n"
- + "----------\n"
- + "3. ERROR in IX.java (at line 8)\n"
- + " * @param\n"
- + " ^^^^^\n"
- + "Javadoc: Missing parameter name\n"
- + "----------\n"
- + "4. ERROR in IX.java (at line 10)\n"
- + " public void foo(double a, long b, int c);\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n");
- }
-
- // @throws/@exception tag
- public void test071() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Valid @throws tags: documented exception are unchecked\n"
- + " * @throws IllegalArgumentException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @exception NullPointerException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws java.awt.AWTError Valid unchecked exception (java.lang.Error subclass)\n"
- + " * @exception OutOfMemoryError Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test072() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 3)\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: java.awt.AWTexception cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 4)\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: IOException cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test073() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "import java.io.FileNotFoundException;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 4)\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception EOFException is not declared\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 5)\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception FileNotFoundException is not declared\n"
- + "----------\n");
- }
-
- public void test074() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "import java.io.FileNotFoundException;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid @throws tags: documented exception are unchecked but some thrown exception are invalid\n"
- + " * @throws IllegalAccessException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws IllegalArgumentException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @exception NullPointerException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws java.awt.AWTError Valid unchecked exception (java.lang.Error subclass)\n"
- + " * @exception OutOfMemoryError Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " */\n"
- + " public void foo() throws\n"
- + " IllegalAccessException, \n"
- + " InvalidException, \n"
- + " String, \n"
- + " java.io.EOFException, \n"
- + " FileNotFoundException, \n"
- + " IOException;\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in IX.java (at line 13)\n" +
- " InvalidException, \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "InvalidException cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in IX.java (at line 14)\n" +
- " String, \n" +
- " ^^^^^^\n" +
- "No exception of type String can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "3. ERROR in IX.java (at line 15)\n" +
- " java.io.EOFException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception EOFException\n" +
- "----------\n" +
- "4. ERROR in IX.java (at line 16)\n" +
- " FileNotFoundException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception FileNotFoundException\n" +
- "----------\n" +
- "5. ERROR in IX.java (at line 17)\n" +
- " IOException;\n" +
- " ^^^^^^^^^^^\n" +
- "IOException cannot be resolved to a type\n" +
- "----------\n");
- }
-
- // @return tag
- public void test080() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Valid return declaration\n"
- + " *\n"
- + " * @return Return an int\n"
- + " */\n"
- + " public int foo();\n"
- + "}\n" });
- }
-
- public void test081() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Valid empty return declaration\n"
- + " *\n"
- + " * @return string\n"
- + " */\n"
- + " public String foo();\n"
- + "}\n" });
- }
-
- public void test082() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Missing return declaration\n"
- + " */\n"
- + " public Object[] foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " public Object[] foo();\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Missing tag for return type\n"
- + "----------\n");
- }
-
- public void test083() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid return declaration\n"
- + " *\n"
- + " * @return Dimension\n"
- + " * @return Duplicated\n"
- + " */\n"
- + " public double foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 6)\n"
- + " * @return Duplicated\n"
- + " ^^^^^^\n"
- + "Javadoc: Duplicate tag for return type\n"
- + "----------\n");
- }
-
- public void test084() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid return declaration\n"
- + " *\n"
- + " * @return Invalid return on void method\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @return Invalid return on void method\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- // @see tag: string
- public void test090() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid string references \n"
- + " *\n"
- + " * @see \"unterminated string\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @see \"unterminated string\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 6)\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test091() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Valid string references \n"
- + " *\n"
- + " * @see \"Valid normal string\"\n"
- + " * @see \"Valid \\\"string containing\\\" \\\"double-quote\\\"\"\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- // @see tag: URL
- public void test092() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid URL link references \n"
- + " *\n"
- + " * @see <a\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @see <a\n"
- + " ^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 6)\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- // @see tag: class references
- public void test095() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid local classes references \n"
- + " *\n"
- + " * @see Visibility Valid ref: local class \n"
- + " * @see Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " * @see test.Visibility Valid ref: local class \n"
- + " * @see test.Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see test.Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test096() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid local classes references \n"
- + " *\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 8)\n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 9)\n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\IX.java (at line 10)\n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test097() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public interface IX {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- public void test098() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid external classes references \n"
- + " *\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 7)\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 8)\n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n");
- }
-
- public void test099() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- "public interface IX {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- // Inner classes are not visible in generated documentation
- //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- // @see tag: field references
- public void test105() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid local class field references\n"
- + " *\n"
- + " * @see Visibility#vf_public Valid ref: visible field\n"
- + " * @see Visibility.VcPublic#vf_public Valid ref: visible field in visible inner class\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test106() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid local class field references\n"
- + " *\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 6)\n"
- + " * @see #x Invalid ref: non existent field\n"
- + " ^\n"
- + "Javadoc: x cannot be resolved or is not a field\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 8)\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 9)\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\IX.java (at line 10)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\IX.java (at line 11)\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- public void test107() {
- runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public interface IX {\n" +
- " /**\n" +
- " * Invalid other package non visible class fields references\n" +
- " *\n" +
- " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n" +
- " */\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- public void test108() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 7)\n"
- + " * @see VisibilityPackage#unknown Invalid ref to non existent field of other package non visible class\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 8)\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 9)\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\IX.java (at line 11)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "6. ERROR in test\\IX.java (at line 12)\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- // @see method references
- public void test110() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid local methods references with array\n"
- + " * \n"
- + " * @see #smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) Valid local method reference\n"
- + " * @see #smr_foo(char[], int[][], String[][][], Vector[][][][]) Valid local method reference\n"
- + " * @see #smr_foo(char[],int[][],java.lang.String[][][],java.util.Vector[][][][]) Valid local method reference\n"
- + " */ \n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra);\n"
- + "}\n" });
- }
-
- public void test111() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid local methods references with array (non applicable arrays)\n"
- + " * \n"
- + " * @see #smr_foo(char[] , int[][], String[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra);\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 6)\n"
- + " * @see #smr_foo(char[] , int[][], String[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type IX is not applicable for the arguments (char[], int[][], String[][], Vector[][][][])\n"
- + "----------\n");
- }
-
- public void test112() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see #smr_foo() Valid local method reference\n"
- + " * @see #smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see #smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see #smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b);\n"
- + "}\n" });
- }
-
- public void test113() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type IX\n"
- + "----------\n");
- }
-
- public void test114() {
- this.runNegativeTest(
- new String[] {
- "IX.java",
- "public interface IX {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(int) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " */ \n"
- + " public void foo();\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b);\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in IX.java (at line 5)\n"
- + " * @see #smr_foo(int) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo() in the type IX is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in IX.java (at line 6)\n"
- + " * @see #smr_foo(float, long, char, short, byte, int, boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type IX is not applicable for the arguments (float, long, char, short, byte, int, boolean)\n"
- + "----------\n"
- + "3. ERROR in IX.java (at line 7)\n"
- + " * @see #smr_foo(String, String, int, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type IX is not applicable for the arguments (String, String, int, String)\n"
- + "----------\n"
- + "4. ERROR in IX.java (at line 8)\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type IX is not applicable for the arguments (boolean)\n"
- + "----------\n"
- + "5. ERROR in IX.java (at line 9)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "6. ERROR in IX.java (at line 9)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^\n"
- + "Javadoc: Vector cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test115() {
- this.runConformTest(
- new String[] {
- "IX.java",
- "import java.util.Vector;\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see IX#smr_foo() Valid local method reference\n"
- + " * @see IX#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see IX#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see IX#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + "public interface IX {\n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b);\n"
- + "}\n" });
- }
-
- public void test116() {
- this.runConformTest(
- new String[] {
- "test/deep/qualified/name/p/IX.java",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo() Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo(String x, java.lang.String y, int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.IX#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public void smr_foo();\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d);\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i);\n"
- + " public void smr_foo(java.util.Hashtable h, Vector v, boolean b);\n"
- + "}\n" });
- }
-
- public void test117() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid package class methods references\n"
- + " * \n"
- + " * @see Visibility#vm_public() Valid ref: visible method\n"
- + " * @see Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " * @see test.Visibility#vm_public() Valid ref: visible method\n"
- + " * @see test.Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " */ \n"
- + " public void foo();\n"
- + "}\n" });
- }
-
- public void test118() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-existence)\n"
- + " * \n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " */ \n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility.VcPublic\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 8)\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 9)\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Visibility.Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test119() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-visible)\n"
- + " * \n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */ \n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility.VcPublic is not visible\n"
- + "----------\n");
- }
-
- public void test120() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-applicable)\n"
- + " * \n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " */ \n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\IX.java (at line 6)\n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in test\\IX.java (at line 7)\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility is not applicable for the arguments (String)\n"
- + "----------\n"
- + "3. ERROR in test\\IX.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility.VcPublic is not applicable for the arguments (Integer, byte)\n"
- + "----------\n"
- + "4. ERROR in test\\IX.java (at line 9)\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility.VcPublic is not applicable for the arguments (Double, Boolean)\n"
- + "----------\n");
- }
-
- public void test121() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Invalid other package non visible class methods references (non existent/visible arguments)\n"
- + " * \n"
- + " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\IX.java (at line 7)\n" +
- " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\IX.java (at line 8)\n" +
- " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPackage is not visible\n" +
- "----------\n");
- }
-
- public void test122() {
- runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n" +
- "import test.copy.VisibilityPublic;\n" +
- "public interface IX {\n" +
- " /**\n" +
- " * Valid other package visible class methods references \n" +
- " * \n" +
- " * @see VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n" +
- " */\n" +
- " public void foo();\n" +
- "}\n"
- }
- );
- }
-
- public void test123() {
- this.runConformReferenceTest(
- new String[] {
- "test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid other package visible class methods references \n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForMethod.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForMethod.java
deleted file mode 100644
index 3793429..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForMethod.java
+++ /dev/null
@@ -1,4835 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTestForMethod extends JavadocTest {
- public JavadocTestForMethod(String name) {
- super(name);
- }
- public static Class javadocTestClass() {
- return JavadocTestForMethod.class;
- }
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which does not belong to the class are skipped...
- static {
- // Names of tests to run: can be "testBugXXXX" or "BugXXXX")
-// TESTS_NAMES = new String[] { "Bug51529a", "Bug51529b" };
- // Numbers of tests to run: "test<number>" will be run for each number of this array
-// TESTS_NUMBERS = new int[] { 117, 124, 132, 137 };
- // Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
-// TESTS_RANGE = new int[] { 21, 50 };
-// TESTS_RANGE = new int[] { -1, 50 }; // run all tests with a number less or equals to 50
-// TESTS_RANGE = new int[] { 10, -1 }; // run all tests with a number greater or equals to 10
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- return options;
- }
-
- /* (non-Javadoc)
- * Test @deprecated tag
- */
- public void test001() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " foo();\n"
-// "Z.java",
-// "public class Z {\n"
- + " /** \n"
- + " * \n"
- + " * ** ** ** ** @deprecated */\n"
- + " function foo() { \n"
- + " }\n"
- + "",
- },
- "----------\n"
- + "1. WARNING in X.java (at line 1)\n"
- + " foo();\n"
- + " ^^^^^\n"
- + "The function foo() from the type X.java is deprecated\n"
- + "----------\n");
- }
-
- public void test002() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /** @deprecated */\n" +
- " int x;\n" +
- " /**\n" +
- " * @see #x\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "/** @deprecated */\n" +
- "public class Y {\n" +
- " int y;\n" +
- " /**\n" +
- " * @see X#x\n" +
- " * @see Y\n" +
- " * @see Y#y\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n",
- "Z.java",
- "public class Z {\n" +
- " int z;\n" +
- " /**\n" +
- " * @see X#x\n" +
- " * @see Y\n" +
- " * @see Y#y\n" +
- " */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" },
- "----------\n" +
- "1. ERROR in Z.java (at line 4)\n" +
- " * @see X#x\n" +
- " ^\n" +
- "Javadoc: The field X.x is deprecated\n" +
- "----------\n" +
- "2. ERROR in Z.java (at line 5)\n" +
- " * @see Y\n" +
- " ^\n" +
- "Javadoc: The type Y is deprecated\n" +
- "----------\n" +
- "3. ERROR in Z.java (at line 6)\n" +
- " * @see Y#y\n" +
- " ^\n" +
- "Javadoc: The type Y is deprecated\n" +
- "----------\n" +
- "4. ERROR in Z.java (at line 6)\n" +
- " * @see Y#y\n" +
- " ^\n" +
- "Javadoc: The field Y.y is deprecated\n" +
- "----------\n"
- );
- }
-
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- " foo(2);\n"
-// "Z.java",
-// "public class Z {\n"
- + " /** \n"
- + " * Valid tags with deprecation at end\n"
- + " *\n"
- + " * @param x Valid param tag\n"
- + " * @return Valid return tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " function foo( x) { \n"
- + " return \"\";\n"
- + " }\n"
- + "",
- },
- "----------\n" +
- "1. WARNING in X.js (at line 1)\n" +
- " foo(2);\n" +
- " ^^^^^^\n" +
- "The function foo(any) from the type X.js is deprecated\n" +
- "----------\n"
- );
- }
-
- public void test004() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z().foo(2);\n"
- + " }\n"
- + "}\n",
- "Z.js",
- "public class Z {\n"
- + " /** \n"
- + " * Invalid javadoc tags with valid deprecation at end\n"
- + " *\n"
- + " * @param\n"
- + " * @return String\n"
- + " * @throws Unknown\n"
- + " * @see \"Invalid\n"
- + " * @see Unknown\n"
- + " * @param x\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(int x) { \n"
- + " return \"\";\n"
- + " }\n"
- + "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new Z().foo(2);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(int) from the type Z is deprecated\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Z.java (at line 5)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "2. ERROR in Z.java (at line 7)\n" +
- " * @throws Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Z.java (at line 8)\n" +
- " * @see \"Invalid\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "4. ERROR in Z.java (at line 9)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Z.java (at line 10)\n" +
- " * @param x\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "6. ERROR in Z.java (at line 13)\n" +
- " public String foo(int x) { \n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter x\n" +
- "----------\n"
- );
- }
-
- public void test005() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z().foo(2);\n"
- + " }\n"
- + "}\n",
- "Z.js",
- "public class Z {\n"
- + " /** \n"
- + " * Valid tags with deprecation at beginning\n"
- + " *\n"
- + " * @deprecated\n"
- + " * @param x Valid param tag\n"
- + " * @return Valid return tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " */\n"
- + " public String foo(int x) { \n"
- + " return \"\";\n"
- + " }\n"
- + "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new Z().foo(2);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(int) from the type Z is deprecated\n" +
- "----------\n"
- );
- }
-
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z().foo(2);\n"
- + " }\n"
- + "}\n",
- "Z.js",
- "public class Z {\n"
- + " /** \n"
- + " * Invalid javadoc tags with valid deprecation at beginning\n"
- + " *\n"
- + " * @deprecated\n"
- + " * @param\n"
- + " * @return String\n"
- + " * @throws Unknown\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see \"Invalid\n"
- + " * @see Unknown\n"
- + " * @param x\n"
- + " */\n"
- + " public String foo(int x) { \n"
- + " return \"\";\n"
- + " }\n"
- + "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new Z().foo(2);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(int) from the type Z is deprecated\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Z.java (at line 6)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "2. ERROR in Z.java (at line 8)\n" +
- " * @throws Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Z.java (at line 10)\n" +
- " * @see \"Invalid\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "4. ERROR in Z.java (at line 11)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Z.java (at line 12)\n" +
- " * @param x\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "6. ERROR in Z.java (at line 14)\n" +
- " public String foo(int x) { \n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter x\n" +
- "----------\n"
- );
- }
-
- public void test007() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z().foo(2);\n"
- + " }\n"
- + "}\n",
- "Z.js",
- "public class Z {\n"
- + " /** \n"
- + " * Valid tags with deprecation in the middle\n"
- + " *\n"
- + " * @param x Valid param tag\n"
- + " * @return Valid return tag\n"
- + " * @deprecated\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " */\n"
- + " public String foo(int x) { \n"
- + " return \"\";\n"
- + " }\n"
- + "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new Z().foo(2);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(int) from the type Z is deprecated\n" +
- "----------\n"
- );
- }
-
- public void test008() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " \n"
- + " {\n"
- + " new Z().foo(2);\n"
- + " }\n"
- + "}\n",
- "Z.js",
- "public class Z {\n"
- + " /** \n"
- + " * Invalid javadoc tags with valid deprecation in the middle\n"
- + " *\n"
- + " * @param\n"
- + " * @return String\n"
- + " * @throws Unknown\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see \"Invalid\n"
- + " * @deprecated\n"
- + " * @see Unknown\n"
- + " */\n"
- + " public String foo(int x) { \n"
- + " return \"\";\n"
- + " }\n"
- + "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " new Z().foo(2);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The method foo(int) from the type Z is deprecated\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Z.java (at line 5)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "2. ERROR in Z.java (at line 7)\n" +
- " * @throws Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Z.java (at line 9)\n" +
- " * @see \"Invalid\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "4. ERROR in Z.java (at line 11)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Z.java (at line 13)\n" +
- " public String foo(int x) { \n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter x\n" +
- "----------\n"
- );
- }
-
- /* (non-Javadoc)
- * Test @param tag
- */
- public void test011() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid @param: no tags, no args\n"
- + " * Valid @throws/@exception: no tags, no thrown exception\n"
- + " */\n"
- + " public void p_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test012() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " public void p_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test013() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param declaration: no arguments, 2 declared tags\n"
- + " * @param x\n"
- + " * Invalid param: not an argument on 2 lines\n"
- + " * @param x Invalid param: not an argument\n"
- + " */\n"
- + " public void p_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @param x\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n");
- }
-
- public void test014() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " \n"
- + " /**\n"
- + " * Valid @param declaration: 3 arguments, 3 tags in right order\n"
- + " * @param a Valid param\n"
- + " * @param b Valid param \n"
- + " * @param c Valid param\n"
- + " */\n"
- + " public void p_foo(int a, int b, int c) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test015() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param declaration: 3 arguments, 3 correct tags in right order + 2 additional\n"
- + " * @param a Valid param\n"
- + " * @param x Invalid param: not an argument\n"
- + " * @param b Valid param \n"
- + " * @param x Invalid param: not an argument\n"
- + " * @param c Valid param\n"
- + " */\n"
- + " public void p_foo(char a, char b, char c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n");
- }
-
- public void test016() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid @param declaration: 3 arguments, 3 tags in wrong order\n"
- + " * @param c Valid param, not well placed\n"
- + " * @param b Valid param, not well placed \n"
- + " * @param a Valid param, not well placed\n"
- + " */\n"
- + " public void p_foo(long a, long b, long c) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test017() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param declaration: 3 arguments, 3 correct tags in wrong order + 1 duplicate tag + 1 additional\n"
- + " * @param c Valid param, not well placed\n"
- + " * @param a Valid param, not well placed\n"
- + " * @param b Valid param, not well placed \n"
- + " * @param a Invalid param: duplicated\n"
- + " * @param x Invalid param: not an argument\n"
- + " */\n"
- + " public void p_foo(float a, float b, float c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 7)\n"
- + " * @param a Invalid param: duplicated\n"
- + " ^\n"
- + "Javadoc: Duplicate tag for parameter\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 8)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n");
- }
-
- public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: all arguments are not documented\n"
- + " */\n"
- + " public void p_foo(double a, double b, double c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " public void p_foo(double a, double b, double c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " public void p_foo(double a, double b, double c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter b\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 5)\n"
- + " public void p_foo(double a, double b, double c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter c\n"
- + "----------\n");
- }
-
- public void test021() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: b and c arguments are not documented\n"
- + " * @param a Valid param\n"
- + " */\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter b\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter c\n"
- + "----------\n");
- }
-
- public void test022() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: a and c arguments are not documented\n"
- + " * @param b Valid param\n"
- + " */\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter c\n"
- + "----------\n");
- }
-
- public void test023() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: a and b arguments are not documented\n"
- + " * @param c Valid param\n"
- + " */\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter b\n"
- + "----------\n");
- }
-
- public void test024() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: c argument is not documented\n"
- + " * @param a Valid param\n"
- + " * @param b Valid param\n"
- + " */\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 7)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter c\n"
- + "----------\n");
- }
-
- public void test025() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: a argument is not documented + b and c are not well placed\n"
- + " * @param c Valid param\n"
- + " * @param b Valid param\n"
- + " */\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 7)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n");
- }
-
- public void test026() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: b argument is not documented + a and c are not well placed\n"
- + " * @param c Valid param\n"
- + " * @param a Valid param\n"
- + " */\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 7)\n"
- + " public void p_foo(int a, char b, long c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter b\n"
- + "----------\n");
- }
-
- public void test030() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: mix of all possible errors (missing a, not argument tag and duplicated)\n"
- + " * @param c Valid param\n"
- + " * @param x Invalid param: not an argument\n"
- + " * @param b Valid param\n"
- + " * @param c Invalid param: duplicated\n"
- + " */\n"
- + " public void p_foo(double a, long b, int c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @param x Invalid param: not an argument\n"
- + " ^\n"
- + "Javadoc: Parameter x is not declared\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @param c Invalid param: duplicated\n"
- + " ^\n"
- + "Javadoc: Duplicate tag for parameter\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 9)\n"
- + " public void p_foo(double a, long b, int c) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n");
- }
-
- public void test031() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: missing parameter name\n"
- + " * @param\n"
- + " */\n"
- + " public void p_foo(String a) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @param\n"
- + " ^^^^^\n"
- + "Javadoc: Missing parameter name\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " public void p_foo(String a) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter a\n"
- + "----------\n");
- }
-
- public void test032() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: missing parameter name + valid param \n"
- + " * @param\n"
- + " * @param x\n"
- + " */\n"
- + " public void p_foo(int x) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @param\n"
- + " ^^^^^\n"
- + "Javadoc: Missing parameter name\n"
- + "----------\n");
- }
-
- public void test033() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: missing parameter names + valid params \n"
- + " * @param h\n"
- + " * @param\n"
- + " * @param h\n"
- + " * @param\n"
- + " */\n"
- + " public void p_foo(java.util.Hashtable h, float f) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @param\n"
- + " ^^^^^\n"
- + "Javadoc: Missing parameter name\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @param h\n"
- + " ^\n"
- + "Javadoc: Duplicate tag for parameter\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @param\n"
- + " ^^^^^\n"
- + "Javadoc: Missing parameter name\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 9)\n"
- + " public void p_foo(java.util.Hashtable h, float f) {\n"
- + " ^\n"
- + "Javadoc: Missing tag for parameter f\n"
- + "----------\n");
- }
-
- public void test034() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: missing parameter name + valid param \n"
- + " * @param *\n"
- + " * @param ?\n"
- + " */\n"
- + " public void p_foo(int x) {\n"
- + " }\n"
- + "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param *\n" +
- " ^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param ?\n" +
- " ^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public void p_foo(int x) {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter x\n" +
- "----------\n"
- );
- }
-
- public void test035() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid @param but compiler errors\n"
- + " * @param a Valid param\n"
- + " * @param b Valid param\n"
- + " * @param c Valid param\n"
- + " */\n"
- + " public void p_foo(inr a, int b, int c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 8)\n"
- + " public void p_foo(inr a, int b, int c) {\n"
- + " ^^^\n"
- + "inr cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test036() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param + compiler errors\n"
- + " * @param b Valid param\n"
- + " * @param b Valid param\n"
- + " * @param c Valid param\n"
- + " */\n"
- + " public void p_foo(inr a, inx b, inq c) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 8)\n"
- + " public void p_foo(inr a, inx b, inq c) {\n"
- + " ^^^\n"
- + "inr cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 8)\n"
- + " public void p_foo(inr a, inx b, inq c) {\n"
- + " ^^^\n"
- + "inx cannot be resolved to a type\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 8)\n"
- + " public void p_foo(inr a, inx b, inq c) {\n"
- + " ^^^\n"
- + "inq cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test037() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @param: class reference instead of param name\n"
- + " * @param java.lang.Hashtable\n"
- + " */\n"
- + " public void p_foo(int x) {\n"
- + " }\n"
- + "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param java.lang.Hashtable\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public void p_foo(int x) {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter x\n" +
- "----------\n"
- );
- }
-
- public void test038() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.util.Hashtable;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid @param: class reference instead of param name + unused import\n"
- + " * @param Hashtable\n"
- + " */\n"
- + " public void p_foo(int x) {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param Hashtable\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Parameter Hashtable is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public void p_foo(int x) {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter x\n" +
- "----------\n");
- }
-
- /* (non-Javadoc)
- * Test @throws/@exception tag
- */
- public void test050() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid @throws tags: documented exception are unchecked\n"
- + " * @throws IllegalArgumentException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @exception NullPointerException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws java.awt.AWTError Valid unchecked exception (java.lang.Error subclass)\n"
- + " * @exception OutOfMemoryError Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " */\n"
- + " public void t_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test051() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws IllegalArgumenException.. Invalid exception: invalid class name\n"
- + " * @exception IllegalArgumen..Exception.. Invalid exception: invalid class name\n"
- + " */\n"
- + " public void t_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @throws IllegalArgumenException.. Invalid exception: invalid class name\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid class name\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 4)\n"
- + " * @exception IllegalArgumen..Exception.. Invalid exception: invalid class name\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid class name\n"
- + "----------\n");
- }
-
- public void test052() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " */\n"
- + " public void t_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: java.awt.AWTexception cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 4)\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: IOException cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test053() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.io.FileNotFoundException;\n"
- + "public class X {\n"
- + " /**\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " */\n"
- + " public void t_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception EOFException is not declared\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception FileNotFoundException is not declared\n"
- + "----------\n");
- }
-
- public void test055() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid @throws tags: documented exception are unchecked but method throws an unknown exception\n"
- + " * @throws IllegalArgumentException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @exception NullPointerException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws java.awt.AWTError Valid unchecked exception (java.lang.Error subclass)\n"
- + " * @exception OutOfMemoryError Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " */\n"
- + " public void t_foo() throws InvalidException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 9)\n"
- + " public void t_foo() throws InvalidException {\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "InvalidException cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test056() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws IllegalArgumenException._ Invalid exception: invalid class name\n"
- + " * @exception IllegalArgumen.*.Exception.. Invalid exception: invalid class name\n"
- + " */\n"
- + " public void t_foo() throws InvalidException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @throws IllegalArgumenException._ Invalid exception: invalid class name\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: IllegalArgumenException cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 4)\n"
- + " * @exception IllegalArgumen.*.Exception.. Invalid exception: invalid class name\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid class name\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " public void t_foo() throws InvalidException {\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "InvalidException cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test057() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " */\n"
- + " public void t_foo() throws InvalidException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: java.awt.AWTexception cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 4)\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: IOException cannot be resolved to a type\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " public void t_foo() throws InvalidException {\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "InvalidException cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test058() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.io.FileNotFoundException;\n"
- + "public class X {\n"
- + " /**\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " */\n"
- + " public void t_foo() throws InvalidException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception EOFException is not declared\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception FileNotFoundException is not declared\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " public void t_foo() throws InvalidException {\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "InvalidException cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test060() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @throws tags: documented exception are unchecked but thrown exception is not documented\n"
- + " * @throws IllegalArgumentException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @exception NullPointerException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws java.awt.AWTError Valid unchecked exception (java.lang.Error subclass)\n"
- + " * @exception OutOfMemoryError Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " */\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 9)\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Missing tag for declared exception IllegalAccessException\n"
- + "----------\n");
- }
-
- public void test061() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws /IllegalArgumenException.. Invalid exception: invalid class name\n"
- + " * @exception .IllegalArgumen..Exception.. Invalid exception: invalid class name\n"
- + " */\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @throws /IllegalArgumenException.. Invalid exception: invalid class name\n"
- + " ^^^^^^\n"
- + "Javadoc: Missing class name\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 4)\n"
- + " * @exception .IllegalArgumen..Exception.. Invalid exception: invalid class name\n"
- + " ^^\n"
- + "Javadoc: Invalid class name\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Missing tag for declared exception IllegalAccessException\n"
- + "----------\n");
- }
-
- public void test062() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " */\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 3)\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: java.awt.AWTexception cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 4)\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: IOException cannot be resolved to a type\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Missing tag for declared exception IllegalAccessException\n"
- + "----------\n");
- }
-
- public void test063() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.io.FileNotFoundException;\n"
- + "public class X {\n"
- + " /**\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " */\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception EOFException is not declared\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Exception FileNotFoundException is not declared\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: IOException cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " public void t_foo() throws IllegalAccessException {\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Missing tag for declared exception IllegalAccessException\n"
- + "----------\n");
- }
-
- public void test065() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid @throws tags: documented exception are unchecked but some thrown exception are invalid\n"
- + " * @throws IllegalAccessException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws IllegalArgumentException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @exception NullPointerException Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " * @throws java.awt.AWTError Valid unchecked exception (java.lang.Error subclass)\n"
- + " * @exception OutOfMemoryError Valid unchecked exception (java.lang.Runtime subclass)\n"
- + " */\n"
- + " public void t_foo() throws\n"
- + " IllegalAccessException, \n"
- + " InvalidException, \n"
- + " String, \n"
- + " IllegalArgumentException\n"
- + " {}\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " InvalidException, \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "InvalidException cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " String, \n" +
- " ^^^^^^\n" +
- "No exception of type String can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n");
- }
-
- public void test066() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws %IllegalArgumenException Invalid exception: invalid class name\n"
- + " * @exception (IllegalArgumen Invalid exception: invalid class name\n"
- + " * @exception \"IllegalArgumen Invalid exception: invalid class name\n"
- + " */\n"
- + " public void t_foo() throws\n"
- + " IllegalAccessException, \n"
- + " InvalidException, \n"
- + " String, \n"
- + " IllegalArgumentException\n"
- + " {}\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @throws %IllegalArgumenException Invalid exception: invalid class name\n" +
- " ^^^^^^\n" +
- "Javadoc: Missing class name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @exception (IllegalArgumen Invalid exception: invalid class name\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Missing class name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @exception \"IllegalArgumen Invalid exception: invalid class name\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Missing class name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " IllegalAccessException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalAccessException\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " InvalidException, \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "InvalidException cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " String, \n" +
- " ^^^^^^\n" +
- "No exception of type String can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " IllegalArgumentException\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalArgumentException\n" +
- "----------\n");
- }
-
- public void test067() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * @throws java.awt.AWTexception Invalid exception: unknown type\n"
- + " * @throws IOException Invalid exception: unknown type\n"
- + " */\n"
- + " public void t_foo() throws\n"
- + " IllegalAccessException, \n"
- + " InvalidException, \n"
- + " String, \n"
- + " IllegalArgumentException\n"
- + " {}\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @throws java.awt.AWTexception Invalid exception: unknown type\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: java.awt.AWTexception cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @throws IOException Invalid exception: unknown type\n" +
- " ^^^^^^^^^^^\n" +
- "Javadoc: IOException cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " IllegalAccessException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalAccessException\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " InvalidException, \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "InvalidException cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " String, \n" +
- " ^^^^^^\n" +
- "No exception of type String can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " IllegalArgumentException\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalArgumentException\n" +
- "----------\n");
- }
-
- public void test068() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.io.FileNotFoundException;\n"
- + "public class X {\n"
- + " /**\n"
- + " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n"
- + " */\n"
- + " public void t_foo() throws\n"
- + " IllegalAccessException, \n"
- + " InvalidException, \n"
- + " String, \n"
- + " IllegalArgumentException\n"
- + " {}\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @throws java.io.EOFException Invalid exception: known exception but neither thrown nor unchecked\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Exception EOFException is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @throws FileNotFoundException Invalid exception: known exception but neither thrown nor unchecked\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Exception FileNotFoundException is not declared\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " IllegalAccessException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalAccessException\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " InvalidException, \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "InvalidException cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " String, \n" +
- " ^^^^^^\n" +
- "No exception of type String can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " IllegalArgumentException\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalArgumentException\n" +
- "----------\n");
- }
-
- public void test069() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.io.FileNotFoundException;\n"
- + "public class X {\n"
- + " /**\n"
- + " */\n"
- + " public void t_foo() throws\n"
- + " IllegalAccessException, \n"
- + " InvalidException, \n"
- + " String, \n"
- + " java.io.EOFException, \n"
- + " FileNotFoundException, \n"
- + " IOException, \n"
- + " IllegalArgumentException\n"
- + " {}\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " IllegalAccessException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalAccessException\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " InvalidException, \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "InvalidException cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " String, \n" +
- " ^^^^^^\n" +
- "No exception of type String can be thrown; an exception type must be a subclass of Throwable\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " java.io.EOFException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception EOFException\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " FileNotFoundException, \n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception FileNotFoundException\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " IOException, \n" +
- " ^^^^^^^^^^^\n" +
- "IOException cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 12)\n" +
- " IllegalArgumentException\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing tag for declared exception IllegalArgumentException\n" +
- "----------\n");
- }
-
- /* (non-Javadoc)
- * Test @return tag
- */
- public void test070() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid return declaration\n"
- + " *\n"
- + " * @return Return an int\n"
- + " */\n"
- + " public int s_foo() {\n"
- + " return 0;\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test071() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid empty return declaration\n"
- + " *\n"
- + " * @return string\n"
- + " */\n"
- + " public String s_foo() {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test072() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid return declaration\n"
- + " *\n"
- + " * @return Vector A list of things\n"
- + " */\n"
- + " public java.util.Vector s_foo() {\n"
- + " return new java.util.Vector();\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test073() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Missing return declaration\n"
- + " */\n"
- + " public Object[] s_foo() {\n"
- + " return new Object[0];\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " public Object[] s_foo() {\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Missing tag for return type\n"
- + "----------\n");
- }
-
- public void test074() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid return declaration\n"
- + " *\n"
- + " * @return double\n"
- + " * @return Dimension\n"
- + " */\n"
- + " public double s_foo() {\n"
- + " return 3.14;\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @return Dimension\n"
- + " ^^^^^^\n"
- + "Javadoc: Duplicate tag for return type\n"
- + "----------\n");
- }
-
- public void test075() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid return declaration\n"
- + " *\n"
- + " * @return Invalid return on void method\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @return Invalid return on void method\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test076() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid return declaration\n"
- + " *\n"
- + " * @return Invalid return on void method\n"
- + " * @return\n"
- + " * @return Invalid return on void method\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @return Invalid return on void method\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @return\n"
- + " ^^^^^^\n"
- + "Javadoc: Duplicate tag for return type\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @return Invalid return on void method\n"
- + " ^^^^^^\n"
- + "Javadoc: Duplicate tag for return type\n"
- + "----------\n");
- }
-
- /* (non-Javadoc)
- * Test @see tag
- */
- // String references
- public void test080() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid string references \n"
- + " *\n"
- + " * @see \"\n"
- + " * @see \"unterminated string\n"
- + " * @see \"invalid string\"\"\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see \"\n"
- + " ^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see \"unterminated string\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see \"invalid string\"\"\n"
- + " ^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see \"invalid\" no text allowed after the string\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test081() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid string references \n"
- + " *\n"
- + " * @see \"Valid normal string\"\n"
- + " * @see \"Valid \\\"string containing\\\" \\\"double-quote\\\"\"\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- // URL Link references
- public void test085() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid URL link references \n"
- + " *\n"
- + " * @see <\n"
- + " * @see <a\n"
- + " * @see <a hre\n"
- + " * @see <a href\n"
- + " * @see <a href=\n"
- + " * @see <a href=\"\n"
- + " * @see <a href=\"invalid\n"
- + " * @see <a href=\"invalid\"\n"
- + " * @see <a href=\"invalid\">\n"
- + " * @see <a href=\"invalid\">invalid\n"
- + " * @see <a href=\"invalid\">invalid<\n"
- + " * @see <a href=\"invalid\">invalid</\n"
- + " * @see <a href=\"invalid\">invalid</a\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see <\n"
- + " ^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see <a\n"
- + " ^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see <a hre\n"
- + " ^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see <a href\n"
- + " ^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 9)\n"
- + " * @see <a href=\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "6. ERROR in X.java (at line 10)\n"
- + " * @see <a href=\"\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "7. ERROR in X.java (at line 11)\n"
- + " * @see <a href=\"invalid\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "8. ERROR in X.java (at line 12)\n"
- + " * @see <a href=\"invalid\"\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "9. ERROR in X.java (at line 13)\n"
- + " * @see <a href=\"invalid\">\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "10. ERROR in X.java (at line 14)\n"
- + " * @see <a href=\"invalid\">invalid\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "11. ERROR in X.java (at line 15)\n"
- + " * @see <a href=\"invalid\">invalid<\n"
- + " ^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "12. ERROR in X.java (at line 16)\n"
- + " * @see <a href=\"invalid\">invalid</\n"
- + " ^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "13. ERROR in X.java (at line 17)\n"
- + " * @see <a href=\"invalid\">invalid</a\n"
- + " ^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "14. ERROR in X.java (at line 18)\n"
- + " * @see <a href=\"invalid\">invalid</a> no text allowed after the href\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n");
- }
-
- public void test086() {
- this.runConformTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Valid URL references \n"
- + " *\n"
- + " * @see <a href=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Valid URL link reference</a>\n"
- + " * @see <A HREF = \"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Valid URL link reference</A>\n"
- + " * @see <a hReF = \"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Valid URL link reference</A>\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test087() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid URL references \n"
- + " *\n"
- + " * @see <a xref=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Invalid URL link reference</a>\n"
- + " * @see <b href=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Invalid URL link reference</a>\n"
- + " * @see <a href=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Invalid URL link reference</b>\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see <a xref=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Invalid URL link reference</a>\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see <b href=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Invalid URL link reference</a>\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see <a href=\"http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html\">Invalid URL link reference</b>\n"
- + " ^^^^\n"
- + "Javadoc: Malformed link reference\n"
- + "----------\n");
- }
-
- // @see Classes references
- public void test090() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local classes references \n"
- + " *\n"
- + " * @see Visibility Valid ref: local class \n"
- + " * @see Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " * @see test.Visibility Valid ref: local class \n"
- + " * @see test.Visibility.VcPublic Valid ref: visible inner class of local class \n"
- + " * @see test.Visibility.AvcPublic Valid ref: visible inherited inner class of local class \n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test091() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local classes references \n"
- + " *\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.Visibility.VcPrivate Invalid ref: non visible inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.Visibility.AvcPrivate Invalid ref: non visible inherited inner class of local class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Unknown Invalid ref: unknown class \n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test092() {
- runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- " * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test093() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid external classes references \n"
- + " *\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " * @see VisibilityPackage.VpPrivate Invalid ref: non visible inner class in non visible class \n"
- + " * @see VisibilityPackage.VpPublic Invalid ref: visible inner class in non visible class \n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPackage Invalid ref: non visible class \n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPackage.VpPrivate Invalid ref: non visible inner class in non visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPackage.VpPublic Invalid ref: visible inner class in non visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPackage is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n");
- }
-
- public void test094() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid external classes references \n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
- " * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test095() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid external classes references \n"
- + " *\n"
- + " * @see test.copy.VisibilityPackage Invalid ref: non visible class \n"
- + " * @see test.copy.VisibilityPackage.VpPrivate Invalid ref: non visible inner class in non visible class \n"
- + " * @see test.copy.VisibilityPackage.VpPublic Invalid ref: visible inner class in non visible class \n"
- + " * @see test.copy.VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see test.copy.VisibilityPackage Invalid ref: non visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate Invalid ref: non visible inner class in non visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic Invalid ref: visible inner class in non visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate Invalid ref: non visible inner class in visible class \n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n");
- }
-
- // @see Field references
- public void test100() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " int x;\n"
- + " /**\n"
- + " * Valid local class field references\n"
- + " *\n"
- + " * @see #x Valid ref: visible field\n"
- + " * @see Visibility#vf_public Valid ref: visible field\n"
- + " * @see Visibility.VcPublic#vf_public Valid ref: visible field in visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test101() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local class field references\n"
- + " *\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " * @see Visibility.VcPrivate#vf_private Invalid ref: non visible inner class (non visible field)\n"
- + " * @see Visibility.VcPrivate#vf_public Invalid ref: non visible inner class (public field)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#unknown Invalid ref: non existent field\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#vf_private Invalid ref: non visible field\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPrivate#unknown Invalid ref: non visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPrivate#vf_private Invalid ref: non visible inner class (non visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.VcPrivate#vf_public Invalid ref: non visible inner class (public field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see Visibility.VcPublic#unknown Invalid ref: non existent field in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: unknown cannot be resolved or is not a field\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 12)\n"
- + " * @see Visibility.VcPublic#vf_private Invalid ref: non visible field in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The field vf_private is not visible\n"
- + "----------\n");
- }
-
- public void test102() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid super class field references in the same package\n"
- + " *\n"
- + " * @see Visibility#avf_public Valid ref: visible inherited field\n"
- + " * @see Visibility.AvcPublic#avf_public Valid ref: visible field of inherited visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test103() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid super class field references in the same package\n"
- + " *\n"
- + " * @see Visibility#avf_private Invalid ref: non visible inherited field\n"
- + " * @see Visibility.AvcPrivate#avf_private Invalid ref: inherited non visible inner class (non visible field)\n"
- + " * @see Visibility.AvcPrivate#avf_public Invalid ref: inherited non visible inner class (visible field)\n"
- + " * @see Visibility.AvcPublic#avf_private Invalid ref: non visible field of inherited visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#avf_private Invalid ref: non visible inherited field\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: The field avf_private is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.AvcPrivate#avf_private Invalid ref: inherited non visible inner class (non visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.AvcPrivate#avf_public Invalid ref: inherited non visible inner class (visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.AvcPublic#avf_private Invalid ref: non visible field of inherited visible inner class\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: The field avf_private is not visible\n"
- + "----------\n");
- }
-
- public void test104() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see VisibilityPackage#unknown Invalid ref: non visible class (non existent field)\n"
- + " * @see VisibilityPackage#vf_private Invalid ref: non visible class (non existent field)\n"
- + " * @see VisibilityPackage#vf_public Invalid ref: non visible class (visible field)\n"
- + " * @see VisibilityPackage.VpPrivate#unknown Invalid ref: non visible class and non visible inner class (non existent field)\n"
- + " * @see VisibilityPackage.VpPrivate#vf_private Invalid ref: non visible class and non visible inner class (non visible field)\n"
- + " * @see VisibilityPackage.VpPrivate#vf_public Invalid ref: non visible class and non visible inner class (visible field)\n"
- + " * @see VisibilityPackage.VpPublic#unknown Invalid ref: non visible class and visible inner class (non existent field)\n"
- + " * @see VisibilityPackage.VpPublic#vf_private Invalid ref: non visible class and visible inner class (non visible field)\n"
- + " * @see VisibilityPackage.VpPublic#vf_public Invalid ref: non visible class and visible inner class (visible field)\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 7)\n" +
- " * @see VisibilityPackage#unknown Invalid ref: non visible class (non existent field)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " * @see VisibilityPackage#vf_private Invalid ref: non visible class (non existent field)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " * @see VisibilityPackage#vf_public Invalid ref: non visible class (visible field)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 10)\n" +
- " * @see VisibilityPackage.VpPrivate#unknown Invalid ref: non visible class and non visible inner class (non existent field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 11)\n" +
- " * @see VisibilityPackage.VpPrivate#vf_private Invalid ref: non visible class and non visible inner class (non visible field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 12)\n" +
- " * @see VisibilityPackage.VpPrivate#vf_public Invalid ref: non visible class and non visible inner class (visible field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 13)\n" +
- " * @see VisibilityPackage.VpPublic#unknown Invalid ref: non visible class and visible inner class (non existent field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 14)\n" +
- " * @see VisibilityPackage.VpPublic#vf_private Invalid ref: non visible class and visible inner class (non visible field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 15)\n" +
- " * @see VisibilityPackage.VpPublic#vf_public Invalid ref: non visible class and visible inner class (visible field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n");
- }
-
- public void test105() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see test.copy.VisibilityPackage#unknown Invalid ref: non visible class (non existent field)\n"
- + " * @see test.copy.VisibilityPackage#vf_private Invalid ref: non visible class (non existent field)\n"
- + " * @see test.copy.VisibilityPackage#vf_public Invalid ref: non visible class (visible field)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#unknown Invalid ref: non visible class and non visible inner class (non existent field)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vf_private Invalid ref: non visible class and non visible inner class (non visible field)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vf_public Invalid ref: non visible class and non visible inner class (visible field)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#unknown Invalid ref: non visible class and visible inner class (non existent field)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vf_private Invalid ref: non visible class and visible inner class (non visible field)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vf_public Invalid ref: non visible class and visible inner class (visible field)\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see test.copy.VisibilityPackage#unknown Invalid ref: non visible class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see test.copy.VisibilityPackage#vf_private Invalid ref: non visible class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.copy.VisibilityPackage#vf_public Invalid ref: non visible class (visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#unknown Invalid ref: non visible class and non visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vf_private Invalid ref: non visible class and non visible inner class (non visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vf_public Invalid ref: non visible class and non visible inner class (visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 12)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#unknown Invalid ref: non visible class and visible inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "8. ERROR in test\\X.java (at line 13)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vf_private Invalid ref: non visible class and visible inner class (non visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "9. ERROR in test\\X.java (at line 14)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vf_public Invalid ref: non visible class and visible inner class (visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n");
- }
-
- public void test106() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class fields references\n"
- + " *\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " * @see VisibilityPublic.VpPrivate#vf_private Invalid ref to a non visible other package private inner class (non visible field)\n"
- + " * @see VisibilityPublic.VpPrivate#vf_public Invalid ref to a non visible other package private inner class (public field)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPrivate#vf_private Invalid ref to a non visible other package private inner class (non visible field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see VisibilityPublic.VpPrivate#vf_public Invalid ref to a non visible other package private inner class (public field)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 12)\n"
- + " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "8. ERROR in test\\X.java (at line 13)\n"
- + " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n"
- + "9. ERROR in test\\X.java (at line 14)\n"
- + " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: VisibilityPublic cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test107() {
- runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Invalid other package non visible class fields references\n" +
- " *\n" +
- " * @see VisibilityPublic#vf_public Valid ref to not visible field of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test108() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n" +
- "import test.copy.*;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Invalid other package non visible class fields references\n" +
- " *\n" +
- " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n" +
- " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n" +
- " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n" +
- " * @see VisibilityPublic.VpPrivate#vf_private Invalid ref to a non visible other package private inner class (non visible field)\n" +
- " * @see VisibilityPublic.VpPrivate#vf_public Invalid ref to a non visible other package private inner class (public field)\n" +
- " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n" +
- " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 7)\n" +
- " * @see VisibilityPublic#unknown Invalid ref to non existent field of other package class\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " * @see VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: The field vf_private is not visible\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " * @see VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 10)\n" +
- " * @see VisibilityPublic.VpPrivate#vf_private Invalid ref to a non visible other package private inner class (non visible field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 11)\n" +
- " * @see VisibilityPublic.VpPrivate#vf_public Invalid ref to a non visible other package private inner class (public field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 12)\n" +
- " * @see VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 13)\n" +
- " * @see VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: The field vf_private is not visible\n" +
- "----------\n"
- );
- }
-
- public void test109() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Invalid other package non visible class fields references\n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic#vf_public Valid ref to not visible field of other package class\n" +
- " * @see test.copy.VisibilityPublic.VpPublic#vf_public Valid ref to not visible field of other package public inner class\n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test110() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Invalid other package non visible class fields references\n" +
- " *\n" +
- " * @see test.copy.VisibilityPublic#unknown Invalid ref to non existent field of other package class\n" +
- " * @see test.copy.VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#vf_private Invalid ref to a non visible other package private inner class (non visible field)\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#vf_public Invalid ref to a non visible other package private inner class (public field)\n" +
- " * @see test.copy.VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n" +
- " * @see test.copy.VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " * @see test.copy.VisibilityPublic#unknown Invalid ref to non existent field of other package class\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 7)\n" +
- " * @see test.copy.VisibilityPublic#vf_private Invalid ref to not visible field of other package class\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: The field vf_private is not visible\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 8)\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#unknown Invalid ref to a non visible other package private inner class (non existent field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 9)\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#vf_private Invalid ref to a non visible other package private inner class (non visible field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 10)\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#vf_public Invalid ref to a non visible other package private inner class (public field)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 11)\n" +
- " * @see test.copy.VisibilityPublic.VpPublic#unknown Invalid ref to non existent field of other package public inner class\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 12)\n" +
- " * @see test.copy.VisibilityPublic.VpPublic#vf_private Invalid ref to not visible field of other package public inner class\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: The field vf_private is not visible\n" +
- "----------\n"
- );
- }
-
- // @see local method references
- public void test115() {
- this.runConformTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references with array\n"
- + " * \n"
- + " * @see #smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) Valid local method reference\n"
- + " * @see #smr_foo(char[], int[][], String[][][], Vector[][][][]) Valid local method reference\n"
- + " * @see #smr_foo(char[],int[][],java.lang.String[][][],java.util.Vector[][][][]) Valid local method reference\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test116() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references with array (wrong brackets peer)\n"
- + " * \n"
- + " * @see #smr_foo(char[ , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char] , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][, String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[]], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[[], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][, Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][]], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][[], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[]][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][][) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][[]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][]][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][[][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[]][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[[][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector][][][]) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(char[ , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(char] , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(char[] , int[][, String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 9)\n"
- + " * @see #smr_foo(char[] , int[]], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 10)\n"
- + " * @see #smr_foo(char[] , int[[], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in X.java (at line 11)\n"
- + " * @see #smr_foo(char[] , int][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "7. ERROR in X.java (at line 12)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][, Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "8. ERROR in X.java (at line 13)\n"
- + " * @see #smr_foo(char[] , int[][], String[][]], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "9. ERROR in X.java (at line 14)\n"
- + " * @see #smr_foo(char[] , int[][], String[][[], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "10. ERROR in X.java (at line 15)\n"
- + " * @see #smr_foo(char[] , int[][], String[]][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "11. ERROR in X.java (at line 16)\n"
- + " * @see #smr_foo(char[] , int[][], String[[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "12. ERROR in X.java (at line 17)\n"
- + " * @see #smr_foo(char[] , int[][], String][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "13. ERROR in X.java (at line 18)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][][) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "14. ERROR in X.java (at line 19)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "15. ERROR in X.java (at line 20)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][[]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "16. ERROR in X.java (at line 21)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][]][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "17. ERROR in X.java (at line 22)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][[][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "18. ERROR in X.java (at line 23)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[]][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "19. ERROR in X.java (at line 24)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[[][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "20. ERROR in X.java (at line 25)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test117() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references with array (non applicable arrays)\n"
- + " * \n"
- + " * @see #smr_foo(char , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int, String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String, Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(char , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char, int[][], String[][][], Vector[][][][])\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(char[] , int[], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[], String[][][], Vector[][][][])\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(char[] , int, String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int, String[][][], Vector[][][][])\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 9)\n"
- + " * @see #smr_foo(char[] , int[][], String[][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[][], Vector[][][][])\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 10)\n"
- + " * @see #smr_foo(char[] , int[][], String[], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[], Vector[][][][])\n"
- + "----------\n"
- + "6. ERROR in X.java (at line 11)\n"
- + " * @see #smr_foo(char[] , int[][], String, Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String, Vector[][][][])\n"
- + "----------\n"
- + "7. ERROR in X.java (at line 12)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[][][], Vector[][][])\n"
- + "----------\n"
- + "8. ERROR in X.java (at line 13)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[][][], Vector[][])\n"
- + "----------\n"
- + "9. ERROR in X.java (at line 14)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[][][], Vector[])\n"
- + "----------\n"
- + "10. ERROR in X.java (at line 15)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(char[], int[][], String[][][], Vector[][][][]) in the type X is not applicable for the arguments (char[], int[][], String[][][], Vector)\n"
- + "----------\n");
- }
-
- public void test118() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references with array (non applicable arrays)\n"
- + " * \n"
- + " * @see #smr_foo(char[1] , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[2][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][3], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[4][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][5][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][6], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[7][][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][8][][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][9][]) Invalid ref: invalid arguments declaration\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][][10]) Invalid ref: invalid arguments declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(char[] array, int[][] matrix, String[][][] dim, Vector[][][][] extra) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(char[1] , int[][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(char[] , int[2][], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(char[] , int[][3], String[][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 9)\n"
- + " * @see #smr_foo(char[] , int[][], String[4][][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 10)\n"
- + " * @see #smr_foo(char[] , int[][], String[][5][], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in X.java (at line 11)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][6], Vector[][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "7. ERROR in X.java (at line 12)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[7][][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "8. ERROR in X.java (at line 13)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][8][][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "9. ERROR in X.java (at line 14)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][9][]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "10. ERROR in X.java (at line 15)\n"
- + " * @see #smr_foo(char[] , int[][], String[][][], Vector[][][][10]) Invalid ref: invalid arguments declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
- public void test120() {
- this.runConformTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see #smr_foo() Valid local method reference\n"
- + " * @see #smr_foo(boolean, int, byte, short, char, long, float, double) Valid local method reference\n"
- + " * @see #smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see #smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) Valid local method reference\n"
- + " * @see #smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see #smr_foo(String, String, int) Valid local method reference\n"
- + " * @see #smr_foo(java.lang.String, String, int) Valid local method reference \n"
- + " * @see #smr_foo(String, java.lang.String, int) Valid local method reference \n"
- + " * @see #smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see #smr_foo(String x,String y,int z) Valid local method reference \n"
- + " * @see #smr_foo(java.lang.String x,String y, int z) Valid local method reference \n"
- + " * @see #smr_foo(String x,java.lang.String y,int z) Valid local method reference \n"
- + " * @see #smr_foo(java.lang.String x,java.lang.String y,int z) Valid local method reference \n"
- + " * @see #smr_foo(java.util.Hashtable,java.util.Vector,boolean) Valid local method reference\n"
- + " * @see #smr_foo(java.util.Hashtable,Vector,boolean) Valid local method reference\n"
- + " * @see #smr_foo(java.util.Hashtable a, java.util.Vector b, boolean c) Valid local method reference\n"
- + " * @see #smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test121() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " * @see #smrfoo() Invalid ref: undefined local method reference\n"
- + " * @see #smr_FOO() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type X\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smrfoo() Invalid ref: undefined local method reference\n"
- + " ^^^^^^\n"
- + "Javadoc: The method smrfoo() is undefined for the type X\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_FOO() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_FOO() is undefined for the type X\n"
- + "----------\n");
- }
-
- public void test122() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(boolean, int, byte, short, char, long, float) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean, int, byte, short, char, long) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean, int, byte, short, char) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean, int, byte, short) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean, int, byte) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean, int) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(boolean, int, byte, short, char, long, float) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean, int, byte, short, char, long, float)\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(boolean, int, byte, short, char, long) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean, int, byte, short, char, long)\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(boolean, int, byte, short, char) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean, int, byte, short, char)\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(boolean, int, byte, short) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean, int, byte, short)\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 9)\n"
- + " * @see #smr_foo(boolean, int, byte) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean, int, byte)\n"
- + "----------\n"
- + "6. ERROR in X.java (at line 10)\n"
- + " * @see #smr_foo(boolean, int) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean, int)\n"
- + "----------\n"
- + "7. ERROR in X.java (at line 11)\n"
- + " * @see #smr_foo(boolean) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (boolean)\n"
- + "----------\n");
- }
-
- public void test123() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(int, String, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String, int, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String, String) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(String) Invalid ref: local method not applicable\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(int, String, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (int, String, String)\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(String, int, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String, int, String)\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(String, String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String, String)\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String)\n"
- + "----------\n");
- }
-
- public void test124() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(java.util.Hashtable,java.util.Vector) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(java.util.Hashtable,boolean,java.util.Vector) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(boolean,java.util.Hashtable,java.util.Vector) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(java.util.Hashtable) Invalid ref: local method not applicable\n"
- + " * @see #smr_foo(java.util.Vector) Invalid ref: local method not applicable\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(java.util.Hashtable,java.util.Vector) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(Hashtable, Vector, boolean) in the type X is not applicable for the arguments (Hashtable, Vector)\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(java.util.Hashtable,boolean,java.util.Vector) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(Hashtable, Vector, boolean) in the type X is not applicable for the arguments (Hashtable, boolean, Vector)\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(boolean,java.util.Hashtable,java.util.Vector) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(Hashtable, Vector, boolean) in the type X is not applicable for the arguments (boolean, Hashtable, Vector)\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(java.util.Hashtable) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(Hashtable, Vector, boolean) in the type X is not applicable for the arguments (Hashtable)\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 9)\n"
- + " * @see #smr_foo(java.util.Vector) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(Hashtable, Vector, boolean) in the type X is not applicable for the arguments (Vector)\n"
- + "----------\n");
- }
-
- public void test125() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(boolean,int i,byte y,short s,char c,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(boolean b,int, byte y, short s, char c, long l, float f, double d) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(boolean b,int i,byte,short s,char c,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short,char c,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char c,long,float f,double d) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char c,long l,float,double d) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char c,long l,float f,double) Invalid reference: mixed argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(boolean,int i,byte y,short s,char c,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(boolean b,int, byte y, short s, char c, long l, float f, double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(boolean b,int i,byte,short s,char c,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short,char c,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 9)\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char,long l,float f,double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in X.java (at line 10)\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char c,long,float f,double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "7. ERROR in X.java (at line 11)\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char c,long l,float,double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "8. ERROR in X.java (at line 12)\n"
- + " * @see #smr_foo(boolean b,int i,byte y,short s,char c,long l,float f,double) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test126() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(String,String y,int z) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(java.lang.String x,String, int z) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(String x,java.lang.String y,int) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(java.lang.String,java.lang.String,int z) Invalid reference: mixed argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see #smr_foo(String,String y,int z) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(java.lang.String x,String, int z) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(String x,java.lang.String y,int) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(java.lang.String,java.lang.String,int z) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test127() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see #smr_foo(Hashtable,java.util.Vector,boolean) Invalid reference: unresolved argument type\n"
- + " * @see #smr_foo(Hashtable,Vector,boolean) Invalid reference: unresolved argument type\n"
- + " * @see #smr_foo(Hashtable a, java.util.Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " * @see #smr_foo(java.util.Hashtable a, java.util.Vector b, boolean) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(java.util.Hashtable, Vector, boolean c) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(Hashtable a, java.util.Vector, boolean c) Invalid reference: mixed argument declaration\n"
- + " * @see #smr_foo(Hashtable, Vector b, boolean c) Invalid reference: mixed argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see #smr_foo(Hashtable,java.util.Vector,boolean) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @see #smr_foo(Hashtable,Vector,boolean) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 8)\n"
- + " * @see #smr_foo(Hashtable a, java.util.Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 9)\n"
- + " * @see #smr_foo(Hashtable a, Vector b, boolean c) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 10)\n"
- + " * @see #smr_foo(java.util.Hashtable a, java.util.Vector b, boolean) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in X.java (at line 11)\n"
- + " * @see #smr_foo(java.util.Hashtable, Vector, boolean c) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "7. ERROR in X.java (at line 12)\n"
- + " * @see #smr_foo(Hashtable a, java.util.Vector, boolean c) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "8. ERROR in X.java (at line 13)\n"
- + " * @see #smr_foo(Hashtable, Vector b, boolean c) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test130() {
- this.runConformTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see X#smr_foo() Valid local method reference\n"
- + " * @see X#smr_foo(boolean, int, byte, short, char, long, float, double) Valid local method reference\n"
- + " * @see X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see X#smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) Valid local method reference\n"
- + " * @see X#smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see X#smr_foo(String, String, int) Valid local method reference\n"
- + " * @see X#smr_foo(java.lang.String, String, int) Valid local method reference \n"
- + " * @see X#smr_foo(String, java.lang.String, int) Valid local method reference \n"
- + " * @see X#smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see X#smr_foo(String x,String y,int z) Valid local method reference \n"
- + " * @see X#smr_foo(java.lang.String x,String y, int z) Valid local method reference \n"
- + " * @see X#smr_foo(String x,java.lang.String y,int z) Valid local method reference \n"
- + " * @see X#smr_foo(java.lang.String x,java.lang.String y,int z) Valid local method reference \n"
- + " * @see X#smr_foo(java.util.Hashtable,java.util.Vector,boolean) Valid local method reference\n"
- + " * @see X#smr_foo(java.util.Hashtable,Vector,boolean) Valid local method reference\n"
- + " * @see X#smr_foo(java.util.Hashtable a, java.util.Vector b, boolean c) Valid local method reference\n"
- + " * @see X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test131() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see X#unknown() Invalid ref: undefined local method reference\n"
- + " * @see X#smrfoo() Invalid ref: undefined local method reference\n"
- + " * @see X#smr_FOO() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " * @see X#unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type X\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " * @see X#smrfoo() Invalid ref: undefined local method reference\n"
- + " ^^^^^^\n"
- + "Javadoc: The method smrfoo() is undefined for the type X\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 7)\n"
- + " * @see X#smr_FOO() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_FOO() is undefined for the type X\n"
- + "----------\n");
- }
-
- public void test132() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see X#smr_foo(Object) Invalid ref: local method not applicable\n"
- + " * @see X#smr_foo(int, byte, short, char, long, float, double) Invalid ref: local method not applicable\n"
- + " * @see X#smr_foo(String, int) Invalid ref: local method not applicable\n"
- + " * @see X#smr_foo(String) Invalid ref: local method not applicable\n"
- + " * @see X#smr_foo(java.util.Hashtable,Vector) Invalid ref: local method not applicable\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see X#smr_foo(Object) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo() in the type X is not applicable for the arguments (Object)\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @see X#smr_foo(int, byte, short, char, long, float, double) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (int, byte, short, char, long, float, double)\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 8)\n"
- + " * @see X#smr_foo(String, int) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String, int)\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 9)\n"
- + " * @see X#smr_foo(String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String)\n"
- + "----------\n"
- + "5. ERROR in X.java (at line 10)\n"
- + " * @see X#smr_foo(java.util.Hashtable,Vector) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(Hashtable, Vector, boolean) in the type X is not applicable for the arguments (Hashtable, Vector)\n"
- + "----------\n");
- }
-
- public void test133() {
- this.runNegativeTest(
- new String[] {
- "X.js",
- "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see X#smr_foo(boolean,int i,byte,short s,char,long l,float,double d) Invalid reference: mixed argument declaration\n"
- + " * @see X#smr_foo(String,String y,int) Invalid reference: mixed argument declaration\n"
- + " * @see X#smr_foo(Hashtable,Vector,boolean) Invalid reference: unresolved argument type\n"
- + " * @see X#smr_foo(Hashtable,Vector,boolean b) Invalid reference: mixed argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " * @see X#smr_foo(boolean,int i,byte,short s,char,long l,float,double d) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 7)\n"
- + " * @see X#smr_foo(String,String y,int) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 8)\n"
- + " * @see X#smr_foo(Hashtable,Vector,boolean) Invalid reference: unresolved argument type\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Hashtable cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in X.java (at line 9)\n"
- + " * @see X#smr_foo(Hashtable,Vector,boolean b) Invalid reference: mixed argument declaration\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test135() {
- this.runConformTest(
- new String[] {
- "test/deep/qualified/name/p/X.js",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo() Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean, int, byte, short, char, long, float, double) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean,int,byte,short,char,long,float,double) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean a1,int a2,byte a3,short a4,char a5,long a6,float a7,double a8) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String, String, int) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.lang.String, String, int) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String, java.lang.String, int) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.lang.String, java.lang.String, int) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String x,String y,int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.lang.String x,String y, int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String x,java.lang.String y,int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.lang.String x,java.lang.String y,int z) Valid local method reference \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable,java.util.Vector,boolean) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable,Vector,boolean) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable a, java.util.Vector b, boolean c) Valid local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable a, Vector b, boolean c) Valid local method reference\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test136() {
- this.runNegativeTest(
- new String[] {
- "test/deep/qualified/name/p/X.js",
- "package test.deep.qualified.name.p;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.X#unknown() Invalid ref: undefined local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smrfoo() Invalid ref: undefined local method reference\n"
- + " * @see test.deep.qualified.name.p.X#smr_FOO() Invalid ref: undefined local method reference\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 6)\n"
- + " * @see test.deep.qualified.name.p.X#unknown() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type X\n"
- + "----------\n"
- + "2. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 7)\n"
- + " * @see test.deep.qualified.name.p.X#smrfoo() Invalid ref: undefined local method reference\n"
- + " ^^^^^^\n"
- + "Javadoc: The method smrfoo() is undefined for the type X\n"
- + "----------\n"
- + "3. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 8)\n"
- + " * @see test.deep.qualified.name.p.X#smr_FOO() Invalid ref: undefined local method reference\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_FOO() is undefined for the type X\n"
- + "----------\n");
- }
-
- public void test137() {
- this.runNegativeTest(
- new String[] {
- "test/deep/qualified/name/p/X.js",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(Object) Invalid ref: local method not applicable\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(int, byte, short, char, long, float, double) Invalid ref: local method not applicable\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String, int) Invalid ref: local method not applicable\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String) Invalid ref: local method not applicable\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable,Vector) Invalid ref: local method not applicable\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo() {\n"
- + " }\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 7)\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(Object) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo() in the type X is not applicable for the arguments (Object)\n"
- + "----------\n"
- + "2. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 8)\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(int, byte, short, char, long, float, double) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(boolean, int, byte, short, char, long, float, double) in the type X is not applicable for the arguments (int, byte, short, char, long, float, double)\n"
- + "----------\n"
- + "3. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 9)\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String, int) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String, int)\n"
- + "----------\n"
- + "4. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 10)\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(String, String, int) in the type X is not applicable for the arguments (String)\n"
- + "----------\n"
- + "5. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 11)\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(java.util.Hashtable,Vector) Invalid ref: local method not applicable\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method smr_foo(Hashtable, Vector, boolean) in the type X is not applicable for the arguments (Hashtable, Vector)\n"
- + "----------\n");
- }
-
- public void test138() {
- this.runNegativeTest(
- new String[] {
- "test/deep/qualified/name/p/X.js",
- "package test.deep.qualified.name.p;\n"
- + "import java.util.Vector;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid local methods references\n"
- + " * \n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(boolean,int i,byte,short s,char,long l,float,double d) Invalid reference: mixed argument declaration\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(String,String y,int) Invalid reference: mixed argument declaration\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(Hashtable,Vector,boolean b) Invalid reference: mixed argument declaration\n"
- + " * @see test.deep.qualified.name.p.X#smr_foo(Hashtable,Vector,boolean b) Invalid reference: mixed argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "\n"
- + " // Empty methods definition for reference\n"
- + " public void smr_foo(boolean b, int i, byte y, short s, char c, long l, float f, double d) {\n"
- + " }\n"
- + " public void smr_foo(String str1, java.lang.String str2, int i) {\n"
- + " }\n"
- + " public void smr_foo(java.util.Hashtable h, java.util.Vector v, boolean b) {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 7)\n" +
- " * @see test.deep.qualified.name.p.X#smr_foo(boolean,int i,byte,short s,char,long l,float,double d) Invalid reference: mixed argument declaration\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "2. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 8)\n" +
- " * @see test.deep.qualified.name.p.X#smr_foo(String,String y,int) Invalid reference: mixed argument declaration\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "3. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 9)\n" +
- " * @see test.deep.qualified.name.p.X#smr_foo(Hashtable,Vector,boolean b) Invalid reference: mixed argument declaration\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "4. ERROR in test\\deep\\qualified\\name\\p\\X.java (at line 10)\n" +
- " * @see test.deep.qualified.name.p.X#smr_foo(Hashtable,Vector,boolean b) Invalid reference: mixed argument declaration\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n");
- }
-
- public void test140() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid package class methods references\n"
- + " * \n"
- + " * @see Visibility#vm_public() Valid ref: visible method\n"
- + " * @see Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " * @see test.Visibility#vm_public() Valid ref: visible method\n"
- + " * @see test.Visibility.VcPublic#vm_public() Valid ref: visible method in visible inner class\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test141() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-existence)\n"
- + " * \n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#unknown() Invalid ref: non-existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPublic#unknown() Invalid ref: non existent method in visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type Visibility.VcPublic\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Unknown#vm_public() Invalid ref: non-existent class\n"
- + " ^^^^^^^\n"
- + "Javadoc: Unknown cannot be resolved to a type\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.Unknown#vm_public() Invalid ref: non existent inner class\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Visibility.Unknown cannot be resolved to a type\n"
- + "----------\n");
- }
-
- public void test142() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-visible)\n"
- + " * \n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see Visibility.VcPrivate#vm_private() Invalid ref: non visible inner class (non visible method)\n"
- + " * @see Visibility.VcPrivate#vm_private(boolean, String) Invalid ref: non visible inner class (non applicable method)\n"
- + " * @see Visibility.VcPrivate#vm_public() Invalid ref: non visible inner class (visible method)\n"
- + " * @see Visibility.VcPrivate#vm_public(Object, float) Invalid ref: non visible inner class (non applicable visible method)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_private() Invalid ref: non-visible method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.VcPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPrivate#vm_private() Invalid ref: non visible inner class (non visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPrivate#vm_private(boolean, String) Invalid ref: non visible inner class (non applicable method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.VcPrivate#vm_public() Invalid ref: non visible inner class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see Visibility.VcPrivate#vm_public(Object, float) Invalid ref: non visible inner class (non applicable visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.VcPrivate is not visible\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 12)\n"
- + " * @see Visibility.VcPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type Visibility.VcPublic is not visible\n"
- + "----------\n");
- }
-
- public void test143() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (non-applicable)\n"
- + " * \n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_private(int) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#vm_public(String) Invalid ref: non-applicable method\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility is not applicable for the arguments (String)\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPublic#vm_private(Integer, byte) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type Visibility.VcPublic is not applicable for the arguments (Integer, byte)\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPublic#vm_public(Double z, Boolean x) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type Visibility.VcPublic is not applicable for the arguments (Double, Boolean)\n"
- + "----------\n");
- }
-
- public void test144() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package class methods references (invalid arguments)\n"
- + " * \n"
- + " * @see Visibility#vm_private(,) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility#vm_public(,String) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.VcPrivate#vm_private(char, double d) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.VcPrivate#vm_public(#) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.VcPublic#vm_private(a a a) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.VcPublic#vm_public(####) Invalid ref: Invalid ref: invalid argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#vm_private(,) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#vm_public(,String) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.VcPrivate#vm_private(char, double d) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.VcPrivate#vm_public(#) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.VcPublic#vm_private(a a a) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see Visibility.VcPublic#vm_public(####) Invalid ref: Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test145() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid package super class methods references\n"
- + " * \n"
- + " * @see Visibility#avm_public() Valid ref: visible inherited method\n"
- + " * @see Visibility.AvcPublic#avm_public() Valid ref: visible inherited method in visible inner class\n"
- + " * @see test.Visibility#avm_public() Valid ref: visible inherited method\n"
- + " * @see test.Visibility.AvcPublic#avm_public() Valid ref: visible inherited method in visible inner class\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test146() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package super class methods references (non-visible)\n"
- + " * \n"
- + " * @see Visibility#avm_private() Invalid ref: non-visible inherited method\n"
- + " * @see Visibility.AvcPrivate#unknown() Invalid ref: non visible inherited inner class (non existent method)\n"
- + " * @see Visibility.AvcPrivate#avm_private() Invalid ref: non visible inherited inner class (non visible method)\n"
- + " * @see Visibility.AvcPrivate#avm_private(boolean, String) Invalid ref: non visible inherited inner class (non applicable method)\n"
- + " * @see Visibility.AvcPrivate#avm_public() Invalid ref: non visible inherited inner class (visible method)\n"
- + " * @see Visibility.AvcPrivate#avm_public(Object, float) Invalid ref: non visible inherited inner class (non applicable visible method)\n"
- + " * @see Visibility.AvcPublic#avm_private() Invalid ref: non visible inherited method in visible inherited inner class\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#avm_private() Invalid ref: non-visible inherited method\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: The method avm_private() from the type AbstractVisibility is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility.AvcPrivate#unknown() Invalid ref: non visible inherited inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.AvcPrivate#avm_private() Invalid ref: non visible inherited inner class (non visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.AvcPrivate#avm_private(boolean, String) Invalid ref: non visible inherited inner class (non applicable method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.AvcPrivate#avm_public() Invalid ref: non visible inherited inner class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see Visibility.AvcPrivate#avm_public(Object, float) Invalid ref: non visible inherited inner class (non applicable visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type Visibility.AvcPrivate is not visible\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 12)\n"
- + " * @see Visibility.AvcPublic#avm_private() Invalid ref: non visible inherited method in visible inherited inner class\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: The method avm_private() from the type AbstractVisibility.AvcPublic is not visible\n"
- + "----------\n");
- }
-
- public void test147() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package super class methods references (non-applicable)\n"
- + " * \n"
- + " * @see Visibility#avm_private(int) Invalid ref: non-applicable inherited method\n"
- + " * @see Visibility#avm_public(String) Invalid ref: non-applicable inherited method\n"
- + " * @see Visibility.AvcPublic#avm_private(Integer, byte) Invalid ref: non applicable inherited method in visible inner class\n"
- + " * @see Visibility.AvcPublic#avm_public(Double z, Boolean x) Invalid ref: non applicable inherited method in visible inner class\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#avm_private(int) Invalid ref: non-applicable inherited method\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: The method avm_private() in the type AbstractVisibility is not applicable for the arguments (int)\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#avm_public(String) Invalid ref: non-applicable inherited method\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method avm_public() in the type AbstractVisibility is not applicable for the arguments (String)\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.AvcPublic#avm_private(Integer, byte) Invalid ref: non applicable inherited method in visible inner class\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: The method avm_private() in the type AbstractVisibility.AvcPublic is not applicable for the arguments (Integer, byte)\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.AvcPublic#avm_public(Double z, Boolean x) Invalid ref: non applicable inherited method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method avm_public() in the type AbstractVisibility.AvcPublic is not applicable for the arguments (Double, Boolean)\n"
- + "----------\n");
- }
-
- public void test148() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid package super class methods references (invalid arguments)\n"
- + " * \n"
- + " * @see Visibility#avm_private(,,,,) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility#avm_public(String,,,) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.AvcPrivate#avm_private(char c, double) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.AvcPrivate#avm_public(*) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.AvcPublic#avm_private(a a a) Invalid ref: invalid argument declaration\n"
- + " * @see Visibility.AvcPublic#avm_public(*****) Invalid ref: invalid argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see Visibility#avm_private(,,,,) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see Visibility#avm_public(String,,,) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see Visibility.AvcPrivate#avm_private(char c, double) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see Visibility.AvcPrivate#avm_public(*) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see Visibility.AvcPublic#avm_private(a a a) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see Visibility.AvcPublic#avm_public(*****) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test150() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class methods references (non existent/visible arguments)\n"
- + " * \n"
- + " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " * @see VisibilityPackage#vm_private() Invalid ref: non visible class (non visible method)\n"
- + " * @see VisibilityPackage#vm_private(boolean) Invalid ref: non visible class (non existent method)\n"
- + " * @see VisibilityPackage#vm_public() Invalid ref: non visible class (visible method)\n"
- + " * @see VisibilityPackage#vm_public(long,long,long,int) Invalid ref: non visible class (visible method)\n"
- + " * @see VisibilityPackage.VpPrivate#unknown() Invalid ref: non visible class and non visible inner class (non existent method)\n"
- + " * @see VisibilityPackage.VpPrivate#vm_private() Invalid ref: non visible class and non visible inner class (non visible method)\n"
- + " * @see VisibilityPackage.VpPrivate#vm_private(boolean, String) Invalid ref: non visible class and non visible inner class (non applicable method)\n"
- + " * @see VisibilityPackage.VpPrivate#vm_public() Invalid ref: non visible class and non visible inner class (visible method)\n"
- + " * @see VisibilityPackage.VpPrivate#vm_public(Object, float) Invalid ref: non visible class and non visible inner class (non applicable visible method)\n"
- + " * @see VisibilityPackage.VpPublic#unknown() Invalid ref: non visible class and visible inner class (non existent method)\n"
- + " * @see VisibilityPackage.VpPublic#vm_private() Invalid ref: non visible class and visible inner class (non visible method)\n"
- + " * @see VisibilityPackage.VpPublic#vm_private(boolean, String) Invalid ref: non visible class and visible inner class (non applicable method)\n"
- + " * @see VisibilityPackage.VpPublic#vm_public() Invalid ref: non visible class and visible inner class (visible method)\n"
- + " * @see VisibilityPackage.VpPublic#vm_public(Object, float) Invalid ref: non visible class and visible inner class (non applicable visible method)\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 7)\n" +
- " * @see VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " * @see VisibilityPackage#vm_private() Invalid ref: non visible class (non visible method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " * @see VisibilityPackage#vm_private(boolean) Invalid ref: non visible class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 10)\n" +
- " * @see VisibilityPackage#vm_public() Invalid ref: non visible class (visible method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 11)\n" +
- " * @see VisibilityPackage#vm_public(long,long,long,int) Invalid ref: non visible class (visible method)\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 12)\n" +
- " * @see VisibilityPackage.VpPrivate#unknown() Invalid ref: non visible class and non visible inner class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 13)\n" +
- " * @see VisibilityPackage.VpPrivate#vm_private() Invalid ref: non visible class and non visible inner class (non visible method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 14)\n" +
- " * @see VisibilityPackage.VpPrivate#vm_private(boolean, String) Invalid ref: non visible class and non visible inner class (non applicable method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 15)\n" +
- " * @see VisibilityPackage.VpPrivate#vm_public() Invalid ref: non visible class and non visible inner class (visible method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "10. ERROR in test\\X.java (at line 16)\n" +
- " * @see VisibilityPackage.VpPrivate#vm_public(Object, float) Invalid ref: non visible class and non visible inner class (non applicable visible method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "11. ERROR in test\\X.java (at line 17)\n" +
- " * @see VisibilityPackage.VpPublic#unknown() Invalid ref: non visible class and visible inner class (non existent method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "12. ERROR in test\\X.java (at line 18)\n" +
- " * @see VisibilityPackage.VpPublic#vm_private() Invalid ref: non visible class and visible inner class (non visible method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "13. ERROR in test\\X.java (at line 19)\n" +
- " * @see VisibilityPackage.VpPublic#vm_private(boolean, String) Invalid ref: non visible class and visible inner class (non applicable method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "14. ERROR in test\\X.java (at line 20)\n" +
- " * @see VisibilityPackage.VpPublic#vm_public() Invalid ref: non visible class and visible inner class (visible method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n" +
- "15. ERROR in test\\X.java (at line 21)\n" +
- " * @see VisibilityPackage.VpPublic#vm_public(Object, float) Invalid ref: non visible class and visible inner class (non applicable visible method)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The type VisibilityPackage is not visible\n" +
- "----------\n");
- }
-
- public void test151() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.VisibilityPackage;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package non visible class methods references (invalid arguments)\n"
- + " * \n"
- + " * @see VisibilityPackage#vm_private(boolean-) Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPackage#vm_public(long, int() Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPackage.VpPrivate#vm_private(char, a double d()) Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPackage.VpPrivate#vm_public(()) Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPackage.VpPublic#vm_private(char double) Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPackage.VpPublic#vm_public((((() Invalid ref: invalid argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 2)\n"
- + " import test.copy.VisibilityPackage;\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPackage#vm_private(boolean-) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPackage#vm_public(long, int() Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPackage.VpPrivate#vm_private(char, a double d()) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPackage.VpPrivate#vm_public(()) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see VisibilityPackage.VpPublic#vm_private(char double) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 12)\n"
- + " * @see VisibilityPackage.VpPublic#vm_public((((() Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test152() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other fully qualified name package non visible class methods references (non existent/visible arguments)\n"
- + " * \n"
- + " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage#vm_private() Invalid ref: non visible class (non visible method)\n"
- + " * @see test.copy.VisibilityPackage#vm_private(boolean) Invalid ref: non visible class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage#vm_public() Invalid ref: non visible class (visible method)\n"
- + " * @see test.copy.VisibilityPackage#vm_public(long,long,long,int) Invalid ref: non visible class (visible method)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#unknown() Invalid ref: non visible class and non visible inner class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_private() Invalid ref: non visible class and non visible inner class (non visible method)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_private(boolean, String) Invalid ref: non visible class and non visible inner class (non applicable method)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_public() Invalid ref: non visible class and non visible inner class (visible method)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_public(Object, float) Invalid ref: non visible class and non visible inner class (non applicable visible method)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#unknown() Invalid ref: non visible class and visible inner class (non existent method)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_private() Invalid ref: non visible class and visible inner class (non visible method)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_private(boolean, String) Invalid ref: non visible class and visible inner class (non applicable method)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_public() Invalid ref: non visible class and visible inner class (visible method)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_public(Object, float) Invalid ref: non visible class and visible inner class (non applicable visible method)\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see test.copy.VisibilityPackage#unknown() Invalid ref: non visible class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see test.copy.VisibilityPackage#vm_private() Invalid ref: non visible class (non visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.copy.VisibilityPackage#vm_private(boolean) Invalid ref: non visible class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.copy.VisibilityPackage#vm_public() Invalid ref: non visible class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see test.copy.VisibilityPackage#vm_public(long,long,long,int) Invalid ref: non visible class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#unknown() Invalid ref: non visible class and non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 12)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_private() Invalid ref: non visible class and non visible inner class (non visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "8. ERROR in test\\X.java (at line 13)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_private(boolean, String) Invalid ref: non visible class and non visible inner class (non applicable method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "9. ERROR in test\\X.java (at line 14)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_public() Invalid ref: non visible class and non visible inner class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "10. ERROR in test\\X.java (at line 15)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_public(Object, float) Invalid ref: non visible class and non visible inner class (non applicable visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "11. ERROR in test\\X.java (at line 16)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#unknown() Invalid ref: non visible class and visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "12. ERROR in test\\X.java (at line 17)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_private() Invalid ref: non visible class and visible inner class (non visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "13. ERROR in test\\X.java (at line 18)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_private(boolean, String) Invalid ref: non visible class and visible inner class (non applicable method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "14. ERROR in test\\X.java (at line 19)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_public() Invalid ref: non visible class and visible inner class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n"
- + "15. ERROR in test\\X.java (at line 20)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_public(Object, float) Invalid ref: non visible class and visible inner class (non applicable visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPackage is not visible\n"
- + "----------\n");
- }
-
- public void test153() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other fully qualified name package non visible class methods references (invalid arguments)\n"
- + " * \n"
- + " * @see test.copy.VisibilityPackage#vm_private(boolean-) Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPackage#vm_public(long, int() Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_private(char, a double d()) Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_public(()) Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_private(char double) Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_public((((() Invalid ref: invalid argument declaration\n"
- + " */ \n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see test.copy.VisibilityPackage#vm_private(boolean-) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see test.copy.VisibilityPackage#vm_public(long, int() Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_private(char, a double d()) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.copy.VisibilityPackage.VpPrivate#vm_public(()) Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 10)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_private(char double) Invalid ref: invalid argument declaration\n"
- + " ^^^^^^^^^^^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 11)\n"
- + " * @see test.copy.VisibilityPackage.VpPublic#vm_public((((() Invalid ref: invalid argument declaration\n"
- + " ^^\n"
- + "Javadoc: Invalid parameters declaration\n"
- + "----------\n");
- }
-
- public void test154() {
- runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n" +
- "import test.copy.VisibilityPublic;\n" +
- "public class X {\n" +
- " /**\n" +
- " * Valid other package visible class methods references \n" +
- " * \n" +
- " * @see VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n" +
- " * @see VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n" +
- " */\n" +
- " public void s_foo() {\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- public void test155() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.VisibilityPublic;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-existent)\n"
- + " * \n"
- + " * @see VisibilityPublic#unknown() Invalid ref: non existent method\n"
- + " * @see VisibilityPublic.VpPublic#unknown() Invalid ref: non existent method of visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPublic#unknown() Invalid ref: non existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type VisibilityPublic\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic.VpPublic#unknown() Invalid ref: non existent method of visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type VisibilityPublic.VpPublic\n"
- + "----------\n");
- }
-
- public void test156() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.VisibilityPublic;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-visible)\n"
- + " * \n"
- + " * @see VisibilityPublic#vm_private() Invalid ref: non visible method in visible class\n"
- + " * @see VisibilityPublic#vm_public() Valid ref: visible method in visible class\n"
- + " * @see VisibilityPublic.VpPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_private() Invalid ref: non visible inner class in visible class and (non visible method)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_private(boolean, String) Invalid ref: non visible inner class in visible class (non applicable method)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_public() Invalid ref: non visible inner class in visible class (visible method)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_public(Object, float) Invalid ref: non visible inner class in visible class (non applicable visible method)\n"
- + " * @see VisibilityPublic.VpPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPublic#vm_private() Invalid ref: non visible method in visible class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type VisibilityPublic is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPublic.VpPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_private() Invalid ref: non visible inner class in visible class and (non visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 11)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_private(boolean, String) Invalid ref: non visible inner class in visible class (non applicable method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 12)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_public() Invalid ref: non visible inner class in visible class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 13)\n"
- + " * @see VisibilityPublic.VpPrivate#vm_public(Object, float) Invalid ref: non visible inner class in visible class (non applicable visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 14)\n"
- + " * @see VisibilityPublic.VpPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type VisibilityPublic.VpPublic is not visible\n"
- + "----------\n");
- }
-
- public void test157() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.VisibilityPublic;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-applicable)\n"
- + " * \n"
- + " * @see VisibilityPublic#vm_private(boolean) Invalid ref: non applicable method in visible class\n"
- + " * @see VisibilityPublic#vm_public(long,long,long,int) Invalid ref: non applicable method in visible class\n"
- + " * @see VisibilityPublic.VpPublic#vm_private(boolean, String) Invalid ref: non applicable method in visible inner class\n"
- + " * @see VisibilityPublic.VpPublic#vm_public(Object, float) Invalid ref: visible inner class (non applicable visible method)\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " * @see VisibilityPublic#vm_private(boolean) Invalid ref: non applicable method in visible class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type VisibilityPublic is not applicable for the arguments (boolean)\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see VisibilityPublic#vm_public(long,long,long,int) Invalid ref: non applicable method in visible class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type VisibilityPublic is not applicable for the arguments (long, long, long, int)\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 9)\n"
- + " * @see VisibilityPublic.VpPublic#vm_private(boolean, String) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type VisibilityPublic.VpPublic is not applicable for the arguments (boolean, String)\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 10)\n"
- + " * @see VisibilityPublic.VpPublic#vm_public(Object, float) Invalid ref: visible inner class (non applicable visible method)\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type VisibilityPublic.VpPublic is not applicable for the arguments (Object, float)\n"
- + "----------\n");
- }
-
- public void test158() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.VisibilityPublic;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-existent)\n"
- + " * \n"
- + " * @see VisibilityPublic#vm_private(\"boolean\") Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPublic#vm_public(long, \"int) Invalid ref: invalid argument definition\n"
- + " * @see VisibilityPublic.VpPrivate#vm_private(double d()) Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPublic.VpPrivate#vm_public(\") Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPublic.VpPublic#vm_private(d()) Invalid ref: invalid argument declaration\n"
- + " * @see VisibilityPublic.VpPublic#vm_public(205) Invalid ref: invalid argument declaration\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 7)\n" +
- " * @see VisibilityPublic#vm_private(\"boolean\") Invalid ref: invalid argument declaration\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " * @see VisibilityPublic#vm_public(long, \"int) Invalid ref: invalid argument definition\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " * @see VisibilityPublic.VpPrivate#vm_private(double d()) Invalid ref: invalid argument declaration\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 10)\n" +
- " * @see VisibilityPublic.VpPrivate#vm_public(\") Invalid ref: invalid argument declaration\n" +
- " ^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 11)\n" +
- " * @see VisibilityPublic.VpPublic#vm_private(d()) Invalid ref: invalid argument declaration\n" +
- " ^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 12)\n" +
- " * @see VisibilityPublic.VpPublic#vm_public(205) Invalid ref: invalid argument declaration\n" +
- " ^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n");
- }
-
- public void test159() {
- this.runConformReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid other package visible class methods references \n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_public() Valid ref to not visible method of other package class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public() Valid ref to visible method of other package public inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test160() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-existent)\n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#unknown() Invalid ref: non existent method\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#unknown() Invalid ref: non existent method of visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see test.copy.VisibilityPublic#unknown() Invalid ref: non existent method\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type VisibilityPublic\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#unknown() Invalid ref: non existent method of visible inner class\n"
- + " ^^^^^^^\n"
- + "Javadoc: The method unknown() is undefined for the type VisibilityPublic.VpPublic\n"
- + "----------\n");
- }
-
- public void test161() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-visible)\n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_private() Invalid ref: non visible method in visible class\n"
- + " * @see test.copy.VisibilityPublic#vm_public() Valid ref: visible method in visible class\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_private() Invalid ref: non visible inner class in visible class and (non visible method)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_private(boolean, String) Invalid ref: non visible inner class in visible class (non applicable method)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_public() Invalid ref: non visible inner class in visible class (visible method)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_public(Object, float) Invalid ref: non visible inner class in visible class (non applicable visible method)\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see test.copy.VisibilityPublic#vm_private() Invalid ref: non visible method in visible class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type VisibilityPublic is not visible\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#unknown() Invalid ref: non visible inner class (non existent method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_private() Invalid ref: non visible inner class in visible class and (non visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 10)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_private(boolean, String) Invalid ref: non visible inner class in visible class (non applicable method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "5. ERROR in test\\X.java (at line 11)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_public() Invalid ref: non visible inner class in visible class (visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "6. ERROR in test\\X.java (at line 12)\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_public(Object, float) Invalid ref: non visible inner class in visible class (non applicable visible method)\n"
- + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: The type test.copy.VisibilityPublic.VpPrivate is not visible\n"
- + "----------\n"
- + "7. ERROR in test\\X.java (at line 13)\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_private() Invalid ref: non visible method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() from the type VisibilityPublic.VpPublic is not visible\n"
- + "----------\n");
- }
-
- public void test162() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-applicable)\n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_private(boolean) Invalid ref: non applicable method in visible class\n"
- + " * @see test.copy.VisibilityPublic#vm_public(long,long,long,int) Invalid ref: non applicable method in visible class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_private(boolean, String) Invalid ref: non applicable method in visible inner class\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public(Object, float) Invalid ref: visible inner class (non applicable visible method)\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @see test.copy.VisibilityPublic#vm_private(boolean) Invalid ref: non applicable method in visible class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type VisibilityPublic is not applicable for the arguments (boolean)\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 7)\n"
- + " * @see test.copy.VisibilityPublic#vm_public(long,long,long,int) Invalid ref: non applicable method in visible class\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type VisibilityPublic is not applicable for the arguments (long, long, long, int)\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 8)\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_private(boolean, String) Invalid ref: non applicable method in visible inner class\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: The method vm_private() in the type VisibilityPublic.VpPublic is not applicable for the arguments (boolean, String)\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 9)\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public(Object, float) Invalid ref: visible inner class (non applicable visible method)\n"
- + " ^^^^^^^^^\n"
- + "Javadoc: The method vm_public() in the type VisibilityPublic.VpPublic is not applicable for the arguments (Object, float)\n"
- + "----------\n");
- }
-
- public void test163() {
- this.runNegativeReferenceTest(
- new String[] {
- "test/X.js",
- "package test;\n"
- + "import test.copy.VisibilityPublic;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Invalid other package visible class methods references (non-existent)\n"
- + " * \n"
- + " * @see test.copy.VisibilityPublic#vm_private(\"\") Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPublic#vm_public(\"\"\") Invalid ref: invalid argument definition\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_private(String d()) Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPublic.VpPrivate#vm_public([) Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_private([]) Invalid ref: invalid argument declaration\n"
- + " * @see test.copy.VisibilityPublic.VpPublic#vm_public(char[], int[],]) Invalid ref: invalid argument declaration\n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 7)\n" +
- " * @see test.copy.VisibilityPublic#vm_private(\"\") Invalid ref: invalid argument declaration\n" +
- " ^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " * @see test.copy.VisibilityPublic#vm_public(\"\"\") Invalid ref: invalid argument definition\n" +
- " ^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#vm_private(String d()) Invalid ref: invalid argument declaration\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 10)\n" +
- " * @see test.copy.VisibilityPublic.VpPrivate#vm_public([) Invalid ref: invalid argument declaration\n" +
- " ^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 11)\n" +
- " * @see test.copy.VisibilityPublic.VpPublic#vm_private([]) Invalid ref: invalid argument declaration\n" +
- " ^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 12)\n" +
- " * @see test.copy.VisibilityPublic.VpPublic#vm_public(char[], int[],]) Invalid ref: invalid argument declaration\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid parameters declaration\n" +
- "----------\n");
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestMixed.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestMixed.java
deleted file mode 100644
index 9539670..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestMixed.java
+++ /dev/null
@@ -1,859 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTestMixed extends JavadocTest {
-
- String docCommentSupport = CompilerOptions.ENABLED;
- String reportInvalidJavadoc = CompilerOptions.ERROR;
- String reportMissingJavadocTags = CompilerOptions.ERROR;
- String reportMissingJavadocComments = null;
-
- public JavadocTestMixed(String name) {
- super(name);
- }
-
- public static Class javadocTestClass() {
- return JavadocTestMixed.class;
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_PREFIX = "testBug77602";
-// TESTS_NAMES = new String[] { "testBug80910" };
-// TESTS_NUMBERS = new int[] { 31, 32, 33 };
-// TESTS_RANGE = new int[] { 21, 50 };
- }
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
- if (reportMissingJavadocComments != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
- else
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportInvalidJavadoc);
- if (reportMissingJavadocTags != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportMissingJavadocTags);
- else
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportInvalidJavadoc);
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- return options;
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- this.docCommentSupport = CompilerOptions.ENABLED;
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocComments = null;
- }
-
- /*
- * Test missing javadoc
- */
- public void test001() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/** */\n"
- + "public class X {\n"
- + " /** */\n"
- + " public int x;\n"
- + " /** */\n"
- + " public X() {}\n"
- + " /** */\n"
- + " public void foo() {}\n"
- + "}\n" });
- }
-
- public void test002() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/** */\n"
- + "class X {\n"
- + " /** */\n"
- + " int x;\n"
- + " /** */\n"
- + " X() {}\n"
- + " /** */\n"
- + " void foo() {}\n"
- + "}\n" });
- }
-
- public void test003() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/** */\n"
- + "class X {\n"
- + " /** */\n"
- + " protected int x;\n"
- + " /** */\n"
- + " protected X() {}\n"
- + " /** */\n"
- + " protected void foo() {}\n"
- + "}\n" });
- }
-
- public void test004() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/** */\n"
- + "class X {\n"
- + " /** */\n"
- + " private int x;\n"
- + " /** */\n"
- + " private X() {}\n"
- + " /** */\n"
- + " private void foo() {}\n"
- + "}\n" });
- }
-
- public void test005() {
- reportInvalidJavadoc = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " public int x;\n"
- + "\n"
- + " public X() {}\n"
- + "\n"
- + " public void foo() {}\n"
- + "}\n" });
- }
-
- public void test006() {
- reportMissingJavadocComments = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String s1 = \"non-terminated;\n" +
- " void foo() {}\n" +
- " String s2 = \"terminated\";\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " String s1 = \"non-terminated;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "String literal is not properly closed by a double-quote\n" +
- "----------\n"
- );
- }
-
- public void test010() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /** Field javadoc comment */\n"
- + " public int x;\n"
- + "\n"
- + " /** Constructor javadoc comment */\n"
- + " public X() {\n"
- + " }\n"
- + " /** Method javadoc comment */\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 2)\n"
- + " public class X {\n"
- + " ^\n"
- + "Javadoc: Missing comment for public declaration\n"
- + "----------\n");
- }
-
- public void test011() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/** Class javadoc comment */\n"
- + "public class X {\n"
- + " public int x;\n"
- + "\n"
- + " /** Constructor javadoc comment */\n"
- + " public X() {\n"
- + " }\n"
- + " /** Method javadoc comment */\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 4)\n"
- + " public int x;\n"
- + " ^\n"
- + "Javadoc: Missing comment for public declaration\n"
- + "----------\n");
- }
-
- public void test012() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/** Class javadoc comment */\n"
- + "public class X {\n"
- + " /** Field javadoc comment */\n"
- + " public int x;\n"
- + "\n"
- + " public X() {\n"
- + " }\n"
- + " /** Method javadoc comment */\n"
- + " public void foo() {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " public X() {\n"
- + " ^^^\n"
- + "Javadoc: Missing comment for public declaration\n"
- + "----------\n");
- }
-
- public void test013() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/** Class javadoc comment */\n"
- + "public class X {\n"
- + " /** Field javadoc comment */\n"
- + " public int x;\n"
- + "\n"
- + " /** Constructor javadoc comment */\n"
- + " public X() {\n"
- + " }\n"
- + " public void foo(int a) {\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 10)\n"
- + " public void foo(int a) {\n"
- + " ^^^^^^^^^^\n"
- + "Javadoc: Missing comment for public declaration\n"
- + "----------\n");
- }
-
- /*
- * Test mixing javadoc comments
- */
- public void test021() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" });
- }
-
- public void test022() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Unexpected tag in class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " * @param x\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 6)\n"
- + " * @param x\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test023() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Unexpected tag in field javadoc\n"
- + " * @throws InvalidException\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 10)\n"
- + " * @throws InvalidException\n"
- + " ^^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n");
- }
-
- public void test024() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Wrong tags order in constructor javadoc\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @param str Valid param tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 19)\n"
- + " * @param str Valid param tag\n"
- + " ^^^^^\n"
- + "Javadoc: Unexpected tag\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 22)\n"
- + " public X(String str) {\n"
- + " ^^^\n"
- + "Javadoc: Missing tag for parameter str\n"
- + "----------\n");
- }
-
- public void test025() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Wrong param tag in method javadoc\n"
- + " * @param vector Invalid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 26)\n"
- + " * @param vector Invalid param tag\n"
- + " ^^^^^^\n"
- + "Javadoc: Parameter vector is not declared\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 33)\n"
- + " public String foo(java.util.Vector list) {\n"
- + " ^^^^\n"
- + "Javadoc: Missing tag for parameter list\n"
- + "----------\n");
- }
-
- public void test026() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Invalid see tag in class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Invalid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>unexpected text\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Missing throws tag in constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) throws java.io.IOException {\n"
- + " }\n"
- + "/**\n"
- + " * Missing return tag in method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 5)\n"
- + " * @see \"Test class X\n"
- + " ^^^^^^^^^^^^^\n"
- + "Javadoc: Invalid reference\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 10)\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>unexpected text\n"
- + " ^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Unexpected text\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 22)\n"
- + " public X(String str) throws java.io.IOException {\n"
- + " ^^^^^^^^^^^^^^^^^^^\n"
- + "Javadoc: Missing tag for declared exception IOException\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 32)\n"
- + " public String foo(java.util.Vector list) {\n"
- + " ^^^^^^\n"
- + "Javadoc: Missing tag for return type\n"
- + "----------\n");
- }
-
- /*
- * Javadoc on invalid syntax
- */
- public void test030() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc on invalid declaration\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "protected class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 7)\n"
- + " protected class X {\n"
- + " ^\n"
- + "Illegal modifier for the class X; only public, abstract & final are permitted\n"
- + "----------\n");
- }
-
- public void test031() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc on invalid declaration\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 12)\n"
- + " public int x\n"
- + " ^\n"
- + "Syntax error, insert \";\" to complete ClassBodyDeclarations\n"
- + "----------\n");
- }
-
- public void test032() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc on invalid declaration\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) \n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector list) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- "----------\n"
- + "1. ERROR in test\\X.java (at line 22)\n"
- + " public X(String str) \n"
- + " ^\n"
- + "Syntax error on token \")\", { expected after this token\n"
- + "----------\n");
- }
-
- public void test033() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n"
- + "/**\n"
- + " * Valid class javadoc\n"
- + " * @author ffr\n"
- + " * @see \"Test class X\"\n"
- + " */\n"
- + "public class X {\n"
- + "/**\n"
- + " * Valid field javadoc\n"
- + " * @see <a href=\"http://www.ibm.com\">Valid URL</a>\n"
- + " */\n"
- + " public int x;\n"
- + "\n"
- + "/**\n"
- + " * Valid constructor javadoc\n"
- + " * @param str Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public X(String str) {\n"
- + " }\n"
- + "/**\n"
- + " * Valid method javadoc on invalid declaration\n"
- + " * @param list Valid param tag\n"
- + " * @throws NullPointerException Valid throws tag\n"
- + " * @exception IllegalArgumentException Valid throws tag\n"
- + " * @return Valid return tag\n"
- + " * @see X Valid see tag\n"
- + " * @deprecated\n"
- + " */\n"
- + " public String foo(java.util.Vector ) {\n"
- + " return \"\";\n"
- + " }\n"
- + "}\n" },
- this.complianceLevel.compareTo(COMPLIANCE_1_5) < 0
- ? "----------\n"
- + "1. ERROR in test\\X.java (at line 23)\n"
- + " }\n"
- + " ^\n"
- + "Syntax error, insert \"}\" to complete ClassBody\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 26)\n"
- + " * @param list Valid param tag\n"
- + " ^^^^\n"
- + "Javadoc: Parameter list is not declared\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 33)\n"
- + " public String foo(java.util.Vector ) {\n"
- + " ^^^^^^\n"
- + "Syntax error on token \"Vector\", VariableDeclaratorId expected after this token\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 36)\n"
- + " }\n"
- + " ^\n"
- + "Syntax error on token \"}\", delete this token\n"
- + "----------\n"
- : "----------\n"
- + "1. ERROR in test\\X.java (at line 23)\n"
- + " }\n"
- + " ^\n"
- + "Syntax error, insert \"}\" to complete ClassBody\n"
- + "----------\n"
- + "2. ERROR in test\\X.java (at line 26)\n"
- + " * @param list Valid param tag\n"
- + " ^^^^\n"
- + "Javadoc: Parameter list is not declared\n"
- + "----------\n"
- + "3. ERROR in test\\X.java (at line 33)\n"
- + " public String foo(java.util.Vector ) {\n"
- + " ^\n"
- + "Syntax error on token \".\", ... expected\n"
- + "----------\n"
- + "4. ERROR in test\\X.java (at line 36)\n"
- + " }\n"
- + " ^\n"
- + "Syntax error on token \"}\", delete this token\n"
- + "----------\n");
- }
-
- public void test040() {
- reportMissingJavadocComments = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " /**\n" +
- " /**\n" +
- " /** \n" +
- " * @param str\n" +
- " * @param x\n" +
- " */\n" +
- " public void bar(String str, int x) {\n" +
- " }\n" +
- " public void foo() {\n" +
- " bar(\"toto\", 0 /* block comment inline */);\n" +
- " }\n" +
- "}\n" });
- }
-
- public void test041() {
- reportMissingJavadocComments = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see String\n" +
- " * @see #\n" +
- " * @return String\n" +
- " */\n" +
- " String bar() {return \"\";}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @see #\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n"
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestOptions.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestOptions.java
deleted file mode 100644
index 085e110..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestOptions.java
+++ /dev/null
@@ -1,2022 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-/**
- * Tests to verify that Compiler options work well for Javadoc.
- * This class does not tests syntax error option as it's considered already
- * tested by other JavadocTest* classes.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=46854">46854</a>
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=46976">46976</a>
- */
-public class JavadocTestOptions extends JavadocTest {
-
- String docCommentSupport = null;
- String reportInvalidJavadoc = null;
- String reportInvalidJavadocTagsVisibility = null;
- String reportInvalidJavadocTags = null;
- String reportInvalidJavadocTagsDeprecatedRef= null;
- String reportInvalidJavadocTagsNotVisibleRef = null;
- String reportMissingJavadocTags = null;
- String reportMissingJavadocTagsVisibility = null;
- String reportMissingJavadocTagsOverriding = null;
- String reportMissingJavadocComments = null;
- String reportMissingJavadocCommentsVisibility = null;
- String reportMissingJavadocCommentsOverriding = null;
-
- private final int PUBLIC_VISIBILITY = 0;
- private final int PROTECTED_VISIBILITY = 1;
- private final int DEFAULT_VISIBILITY = 2;
- private final int PRIVATE_VISIBILITY = 3;
-
- private static String INVALID_CLASS_JAVADOC_REF = " /**\n" +
- " * @see X_dep\n" +
- " * @see X.X_priv\n" +
- " * @see X.Unknown\n" +
- " * @see X#X(int)\n" +
- " * @see X#X(String)\n" +
- " * @see X#X()\n" +
- " * @see X#x_dep\n" +
- " * @see X#x_priv\n" +
- " * @see X#unknown\n" +
- " * @see X#foo_dep()\n" +
- " * @see X#foo_priv()\n" +
- " * @see X#foo_dep(String)\n" +
- " * @see X#unknown()\n" +
- " */\n";
- private static String INVALID_METHOD_JAVADOC_REF = " /**\n" +
- " * @param str\n" +
- " * @param str\n" +
- " * @param xxx\n" +
- " * @throws IllegalArgumentException\n" +
- " * @throws IllegalArgumentException\n" +
- " * @throws java.io.IOException\n" +
- " * @throws Unknown\n" +
- " * @see X_dep\n" +
- " * @see X.X_priv\n" +
- " * @see X.Unknown\n" +
- " * @see X#X(int)\n" +
- " * @see X#X(String)\n" +
- " * @see X#X()\n" +
- " * @see X#x_dep\n" +
- " * @see X#x_priv\n" +
- " * @see X#unknown\n" +
- " * @see X#foo_dep()\n" +
- " * @see X#foo_priv()\n" +
- " * @see X#foo_dep(String)\n" +
- " * @see X#unknown()\n" +
- " */\n";
- private static String DEP_CLASS =
- "/** @deprecated */\n" +
- "public class X_dep {}\n";
- private static String REF_CLASS =
- "public class X {\n" +
-// Deprecated class must be a top level to avoid visibility issue
-// " /** @deprecated */\n" +
-// " class X_dep{}\n" +
- " private class X_priv{}\n" +
- " /** @deprecated */\n" +
- " public int x_dep;\n" +
- " private int x_priv;\n" +
- " /** @deprecated */\n" +
- " public X() {}\n" +
- " private X(int x) {}\n" +
- " /** @deprecated */\n" +
- " public void foo_dep() {}\n" +
- " private void foo_priv() {}\n" +
- " }\n";
- private static String[] CLASSES_INVALID_COMMENT = {
- "X.java",
- REF_CLASS,
- "X_dep.java",
- DEP_CLASS,
- "Y.java",
- "public class Y {\n" +
- INVALID_CLASS_JAVADOC_REF +
- " public class X_pub {}\n" +
- INVALID_CLASS_JAVADOC_REF +
- " protected class X_prot {}\n" +
- INVALID_CLASS_JAVADOC_REF +
- " class X_pack {}\n" +
- INVALID_CLASS_JAVADOC_REF +
- " private class X_priv {}\n" +
- "}\n" +
- "\n"
- };
- private static String[] FIELDS_INVALID_COMMENT = {
- "X.java",
- REF_CLASS,
- "X_dep.java",
- DEP_CLASS,
- "Y.java",
- "public class Y {\n" +
- INVALID_CLASS_JAVADOC_REF +
- " public int x_pub;\n" +
- INVALID_CLASS_JAVADOC_REF +
- " protected int x_prot;\n" +
- INVALID_CLASS_JAVADOC_REF +
- " int x_pack;\n" +
- INVALID_CLASS_JAVADOC_REF+
- " private int x_priv;\n" +
- "}\n" +
- "\n"
- };
- private static String[] METHODS_INVALID_COMMENT = {
- "X.java",
- REF_CLASS,
- "X_dep.java",
- DEP_CLASS,
- "Y.java",
- "public class Y {\n" +
- INVALID_METHOD_JAVADOC_REF +
- " public void foo_pub(String str) throws IllegalArgumentException {}\n" +
- INVALID_METHOD_JAVADOC_REF +
- " protected void foo_pro(String str) throws IllegalArgumentException {}\n" +
- INVALID_METHOD_JAVADOC_REF +
- " void foo_pack(String str) throws IllegalArgumentException {}\n" +
- INVALID_METHOD_JAVADOC_REF +
- " private void foo_priv(String str) throws IllegalArgumentException {}\n" +
- "}\n" +
- "\n"
- };
- private static String[] CONSTRUCTORS_INVALID_COMMENT = {
- "X.java",
- REF_CLASS,
- "X_dep.java",
- DEP_CLASS,
- "Y.java",
- "public class Y {\n" +
- INVALID_METHOD_JAVADOC_REF +
- " public Y(int str) {}\n" +
- INVALID_METHOD_JAVADOC_REF +
- " protected Y(long str) {}\n" +
- INVALID_METHOD_JAVADOC_REF +
- " Y(float str) {}\n" +
- INVALID_METHOD_JAVADOC_REF +
- " private Y(double str) {}\n" +
- "}\n" +
- "\n"
- };
- private static String[] MISSING_TAGS = {
- "X.java",
- "public class X {\n" +
- " // public\n" +
- " /** */\n" +
- " public class PublicClass {}\n" +
- " /** */\n" +
- " public int publicField;\n" +
- " /** */\n" +
- " public X(int i) {}\n" +
- " /** */\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " // protected\n" +
- " /** */\n" +
- " protected class ProtectedClass {}\n" +
- " /** */\n" +
- " protected int protectedField;\n" +
- " /** */\n" +
- " protected X(long l) {}\n" +
- " /** */\n" +
- " protected int protectedMethod(long l) { return 0; }\n" +
- " // default\n" +
- " /** */\n" +
- " class PackageClass {}\n" +
- " /** */\n" +
- " int packageField;\n" +
- " /** */\n" +
- " X(float f) {}\n" +
- " /** */\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " // private\n" +
- " /** */\n" +
- " private class PrivateClass {}\n" +
- " /** */\n" +
- " private int privateField;\n" +
- " /** */\n" +
- " private X(double d) {}\n" +
- " /** */\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- "}\n" +
- "\n",
- "Y.java",
- "/** */\n" +
- "public class Y extends X {\n" +
- " public Y(int i) { super(i); }\n" +
- " //methods\n" +
- " /** */\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " /** */\n" +
- " protected int protectedMethod(long l) { return 0;}\n" +
- " /** */\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " /** */\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- "}\n"
- };
- private static String[] MISSING_COMMENTS = {
- "X.java",
- "/** */\n" +
- "public class X {\n" +
- " // public\n" +
- " public class PublicClass {}\n" +
- " public int publicField;\n" +
- " public X(int i) {}\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " // protected\n" +
- " protected class ProtectedClass {}\n" +
- " protected int protectedField;\n" +
- " protected X(long l) {}\n" +
- " protected int protectedMethod(long l) { return 0; }\n" +
- " // default\n" +
- " class PackageClass {}\n" +
- " int packageField;\n" +
- " X(float f) {}\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " // private\n" +
- " private class PrivateClass {}\n" +
- " private int privateField;\n" +
- " private X(double d) {}\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- "}\n" +
- "\n",
- "Y.java",
- "/** */\n" +
- "public class Y extends X {\n" +
- " /** */\n" +
- " public Y(int i) { super(i); }\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " protected int protectedMethod(long l) { return 0;}\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- "}\n"
- };
-
- private static String[] CLASSES_ERRORS = {
- "1. ERROR in Y.java (at line 3)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 4)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 5)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 6)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "5. ERROR in Y.java (at line 7)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "6. ERROR in Y.java (at line 8)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "7. ERROR in Y.java (at line 9)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "8. ERROR in Y.java (at line 10)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "9. ERROR in Y.java (at line 11)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "10. ERROR in Y.java (at line 12)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "11. ERROR in Y.java (at line 13)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "12. ERROR in Y.java (at line 14)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "13. ERROR in Y.java (at line 15)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n",
- "14. ERROR in Y.java (at line 19)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "15. ERROR in Y.java (at line 20)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "16. ERROR in Y.java (at line 21)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "17. ERROR in Y.java (at line 22)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "18. ERROR in Y.java (at line 23)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "19. ERROR in Y.java (at line 24)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "20. ERROR in Y.java (at line 25)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "21. ERROR in Y.java (at line 26)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "22. ERROR in Y.java (at line 27)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "23. ERROR in Y.java (at line 28)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "24. ERROR in Y.java (at line 29)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "25. ERROR in Y.java (at line 30)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "26. ERROR in Y.java (at line 31)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n",
- "27. ERROR in Y.java (at line 35)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "28. ERROR in Y.java (at line 36)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "29. ERROR in Y.java (at line 37)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "30. ERROR in Y.java (at line 38)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "31. ERROR in Y.java (at line 39)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "32. ERROR in Y.java (at line 40)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "33. ERROR in Y.java (at line 41)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "34. ERROR in Y.java (at line 42)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "35. ERROR in Y.java (at line 43)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "36. ERROR in Y.java (at line 44)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "37. ERROR in Y.java (at line 45)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "38. ERROR in Y.java (at line 46)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "39. ERROR in Y.java (at line 47)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n",
- "40. ERROR in Y.java (at line 51)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "41. ERROR in Y.java (at line 52)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "42. ERROR in Y.java (at line 53)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "43. ERROR in Y.java (at line 54)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "44. ERROR in Y.java (at line 55)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "45. ERROR in Y.java (at line 56)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "46. ERROR in Y.java (at line 57)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "47. ERROR in Y.java (at line 58)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "48. ERROR in Y.java (at line 59)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "49. ERROR in Y.java (at line 60)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "50. ERROR in Y.java (at line 61)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "51. ERROR in Y.java (at line 62)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "52. ERROR in Y.java (at line 63)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n"
- };
-
- private static String[] METHODS_ERRORS = {
- "1. ERROR in Y.java (at line 4)\n" +
- " * @param str\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 5)\n" +
- " * @param xxx\n" +
- " ^^^\n" +
- "Javadoc: Parameter xxx is not declared\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 8)\n" +
- " * @throws java.io.IOException\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Exception IOException is not declared\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 9)\n" +
- " * @throws Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Y.java (at line 10)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "6. ERROR in Y.java (at line 11)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "7. ERROR in Y.java (at line 12)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in Y.java (at line 13)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "9. ERROR in Y.java (at line 14)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "10. ERROR in Y.java (at line 15)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "11. ERROR in Y.java (at line 16)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "12. ERROR in Y.java (at line 17)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "13. ERROR in Y.java (at line 18)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "14. ERROR in Y.java (at line 19)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "15. ERROR in Y.java (at line 20)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "16. ERROR in Y.java (at line 21)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "17. ERROR in Y.java (at line 22)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n",
- "18. ERROR in Y.java (at line 27)\n" +
- " * @param str\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "19. ERROR in Y.java (at line 28)\n" +
- " * @param xxx\n" +
- " ^^^\n" +
- "Javadoc: Parameter xxx is not declared\n" +
- "----------\n" +
- "20. ERROR in Y.java (at line 31)\n" +
- " * @throws java.io.IOException\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Exception IOException is not declared\n" +
- "----------\n" +
- "21. ERROR in Y.java (at line 32)\n" +
- " * @throws Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "22. ERROR in Y.java (at line 33)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "23. ERROR in Y.java (at line 34)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "24. ERROR in Y.java (at line 35)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "25. ERROR in Y.java (at line 36)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "26. ERROR in Y.java (at line 37)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "27. ERROR in Y.java (at line 38)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "28. ERROR in Y.java (at line 39)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "29. ERROR in Y.java (at line 40)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "30. ERROR in Y.java (at line 41)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "31. ERROR in Y.java (at line 42)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "32. ERROR in Y.java (at line 43)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "33. ERROR in Y.java (at line 44)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "34. ERROR in Y.java (at line 45)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n",
- "35. ERROR in Y.java (at line 50)\n" +
- " * @param str\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "36. ERROR in Y.java (at line 51)\n" +
- " * @param xxx\n" +
- " ^^^\n" +
- "Javadoc: Parameter xxx is not declared\n" +
- "----------\n" +
- "37. ERROR in Y.java (at line 54)\n" +
- " * @throws java.io.IOException\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Exception IOException is not declared\n" +
- "----------\n" +
- "38. ERROR in Y.java (at line 55)\n" +
- " * @throws Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "39. ERROR in Y.java (at line 56)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "40. ERROR in Y.java (at line 57)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "41. ERROR in Y.java (at line 58)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "42. ERROR in Y.java (at line 59)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "43. ERROR in Y.java (at line 60)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "44. ERROR in Y.java (at line 61)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "45. ERROR in Y.java (at line 62)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "46. ERROR in Y.java (at line 63)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "47. ERROR in Y.java (at line 64)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "48. ERROR in Y.java (at line 65)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "49. ERROR in Y.java (at line 66)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "50. ERROR in Y.java (at line 67)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "51. ERROR in Y.java (at line 68)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n",
- "52. ERROR in Y.java (at line 73)\n" +
- " * @param str\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "53. ERROR in Y.java (at line 74)\n" +
- " * @param xxx\n" +
- " ^^^\n" +
- "Javadoc: Parameter xxx is not declared\n" +
- "----------\n" +
- "54. ERROR in Y.java (at line 77)\n" +
- " * @throws java.io.IOException\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Exception IOException is not declared\n" +
- "----------\n" +
- "55. ERROR in Y.java (at line 78)\n" +
- " * @throws Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "56. ERROR in Y.java (at line 79)\n" +
- " * @see X_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The type X_dep is deprecated\n" +
- "----------\n" +
- "57. ERROR in Y.java (at line 80)\n" +
- " * @see X.X_priv\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The type X.X_priv is not visible\n" +
- "----------\n" +
- "58. ERROR in Y.java (at line 81)\n" +
- " * @see X.Unknown\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: X.Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "59. ERROR in Y.java (at line 82)\n" +
- " * @see X#X(int)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor X(int) is not visible\n" +
- "----------\n" +
- "60. ERROR in Y.java (at line 83)\n" +
- " * @see X#X(String)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor X(String) is undefined\n" +
- "----------\n" +
- "61. ERROR in Y.java (at line 84)\n" +
- " * @see X#X()\n" +
- " ^^^\n" +
- "Javadoc: The constructor X() is deprecated\n" +
- "----------\n" +
- "62. ERROR in Y.java (at line 85)\n" +
- " * @see X#x_dep\n" +
- " ^^^^^\n" +
- "Javadoc: The field X.x_dep is deprecated\n" +
- "----------\n" +
- "63. ERROR in Y.java (at line 86)\n" +
- " * @see X#x_priv\n" +
- " ^^^^^^\n" +
- "Javadoc: The field x_priv is not visible\n" +
- "----------\n" +
- "64. ERROR in Y.java (at line 87)\n" +
- " * @see X#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "65. ERROR in Y.java (at line 88)\n" +
- " * @see X#foo_dep()\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method foo_dep() from the type X is deprecated\n" +
- "----------\n" +
- "66. ERROR in Y.java (at line 89)\n" +
- " * @see X#foo_priv()\n" +
- " ^^^^^^^^\n" +
- "Javadoc: The method foo_priv() from the type X is not visible\n" +
- "----------\n" +
- "67. ERROR in Y.java (at line 90)\n" +
- " * @see X#foo_dep(String)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method foo_dep() in the type X is not applicable for the arguments (String)\n" +
- "----------\n" +
- "68. ERROR in Y.java (at line 91)\n" +
- " * @see X#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type X\n" +
- "----------\n"
- };
-
- private String resultForInvalidTagsClassOrField(int visibility) {
- if (reportInvalidJavadocTagsDeprecatedRef == null && reportInvalidJavadocTagsNotVisibleRef == null) {
- String result = "----------\n";
- for (int i=0; i<=visibility; i++) {
- result += CLASSES_ERRORS[i];
- }
- return result;
- }
- StringBuffer result = new StringBuffer("----------\n");
- for (int i=0, count=1; i<= visibility; i++) {
- StringTokenizer tokenizer = new StringTokenizer(CLASSES_ERRORS[i], "\n");
- while (tokenizer.hasMoreTokens()) {
- StringBuffer error = new StringBuffer();
- boolean add = true;
- for (int j=0; j<5; j++) {
- String line = tokenizer.nextToken();
- switch (j) {
- case 0:
- error.append(count);
- error.append(line.substring(line.indexOf('.')));
- break;
- case 3:
- if (CompilerOptions.DISABLED.equals(reportInvalidJavadocTagsDeprecatedRef)) {
- add = line.indexOf("is deprecated") == -1;
- }
- if (add && CompilerOptions.DISABLED.equals(reportInvalidJavadocTagsNotVisibleRef)) {
- add = line.indexOf("is not visible") == -1 && line.indexOf("visibility for malformed doc comments") == -1;
- }
- default:
- error.append(line);
- }
- error.append('\n');
- }
- if (add) {
- count++;
- result.append(error);
- }
- }
- }
- return result.toString();
- }
-
- private String resultForInvalidTagsMethodOrConstructor(int visibility) {
- if (reportInvalidJavadocTagsDeprecatedRef == null && reportInvalidJavadocTagsNotVisibleRef == null) {
- String result = "----------\n";
- for (int i=0; i<=visibility; i++) {
- result += METHODS_ERRORS[i];
- }
- return result;
- }
- StringBuffer result = new StringBuffer("----------\n");
- for (int i=0, count=1; i<= visibility; i++) {
- StringTokenizer tokenizer = new StringTokenizer(METHODS_ERRORS[i], "\n");
- while (tokenizer.hasMoreTokens()) {
- StringBuffer error = new StringBuffer();
- boolean add = true;
- for (int j=0; j<5; j++) {
- String line = tokenizer.nextToken();
- switch (j) {
- case 0:
- error.append(count);
- error.append(line.substring(line.indexOf('.')));
- break;
- case 3:
- if (CompilerOptions.DISABLED.equals(reportInvalidJavadocTagsDeprecatedRef)) {
- add = line.indexOf("is deprecated") == -1;
- }
- if (add && CompilerOptions.DISABLED.equals(reportInvalidJavadocTagsNotVisibleRef)) {
- add = line.indexOf("is not visible") == -1 && line.indexOf("visibility for malformed doc comments") == -1;
- }
- default:
- error.append(line);
- }
- error.append('\n');
- }
- if (add) {
- count++;
- result.append(error);
- }
- }
- }
- return result.toString();
- }
-
- private static String[] X_ResultForMissingTags = {
- "1. ERROR in X.java (at line 8)\n" +
- " public X(int i) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter i\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n",
- "4. ERROR in X.java (at line 17)\n" +
- " protected X(long l) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 19)\n" +
- " protected int protectedMethod(long l) { return 0; }\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 19)\n" +
- " protected int protectedMethod(long l) { return 0; }\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n",
- "7. ERROR in X.java (at line 26)\n" +
- " X(float f) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter f\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 28)\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 28)\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n",
- "10. ERROR in X.java (at line 35)\n" +
- " private X(double d) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter d\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 37)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 37)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n"
- };
- private static String[] Y_ResultForMissingTags = {
- "1. ERROR in Y.java (at line 6)\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 6)\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n",
- "3. ERROR in Y.java (at line 8)\n" +
- " protected int protectedMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 8)\n" +
- " protected int protectedMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n",
- "5. ERROR in Y.java (at line 10)\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "6. ERROR in Y.java (at line 10)\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n",
- "7. ERROR in Y.java (at line 12)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "8. ERROR in Y.java (at line 12)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n",
- "----------\n" +
- "1. ERROR in Y.java (at line 12)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for return type\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 12)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter l\n" +
- "----------\n"
- };
-
- private String resultForMissingTags(int visibility) {
- StringBuffer result = new StringBuffer("----------\n");
- for (int i=0; i<=visibility; i++) {
- result.append(X_ResultForMissingTags[i]);
- }
- if (CompilerOptions.ENABLED.equals(reportMissingJavadocTagsOverriding)) {
- result.append("----------\n");
- result.append(Y_ResultForMissingTags[PUBLIC_VISIBILITY]);
- if (visibility >= PROTECTED_VISIBILITY) {
- result.append(Y_ResultForMissingTags[PROTECTED_VISIBILITY]);
- if (visibility >= DEFAULT_VISIBILITY) {
- result.append(Y_ResultForMissingTags[DEFAULT_VISIBILITY]);
- if (visibility == PRIVATE_VISIBILITY) {
- result.append(Y_ResultForMissingTags[PRIVATE_VISIBILITY]);
- }
- }
- }
- }
- // Private level is always reported for as it never overrides...
- else if (visibility == PRIVATE_VISIBILITY) {
- result.append(Y_ResultForMissingTags[PRIVATE_VISIBILITY+1]);
- }
- return result.toString();
- }
-
- private static String[] X_ResultForMissingComments = {
- "1. ERROR in X.java (at line 4)\n" +
- " public class PublicClass {}\n" +
- " ^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for public declaration\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public int publicField;\n" +
- " ^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for public declaration\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public X(int i) {}\n" +
- " ^^^^^^^^\n" +
- "Javadoc: Missing comment for public declaration\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for public declaration\n" +
- "----------\n",
- "5. ERROR in X.java (at line 9)\n" +
- " protected class ProtectedClass {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for protected declaration\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " protected int protectedField;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for protected declaration\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " protected X(long l) {}\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Missing comment for protected declaration\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 12)\n" +
- " protected int protectedMethod(long l) { return 0; }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for protected declaration\n" +
- "----------\n",
- "9. ERROR in X.java (at line 14)\n" +
- " class PackageClass {}\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for default declaration\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 15)\n" +
- " int packageField;\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for default declaration\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 16)\n" +
- " X(float f) {}\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: Missing comment for default declaration\n" +
- "----------\n" +
- "12. ERROR in X.java (at line 17)\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for default declaration\n" +
- "----------\n",
- "13. ERROR in X.java (at line 19)\n" +
- " private class PrivateClass {}\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for private declaration\n" +
- "----------\n" +
- "14. ERROR in X.java (at line 20)\n" +
- " private int privateField;\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for private declaration\n" +
- "----------\n" +
- "15. ERROR in X.java (at line 21)\n" +
- " private X(double d) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for private declaration\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 22)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for private declaration\n" +
- "----------\n"
- };
- private static String[] Y_ResultForMissingComments = {
- "1. ERROR in Y.java (at line 5)\n" +
- " public int publicMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for public declaration\n" +
- "----------\n",
- "2. ERROR in Y.java (at line 6)\n" +
- " protected int protectedMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for protected declaration\n" +
- "----------\n",
- "3. ERROR in Y.java (at line 7)\n" +
- " int packageMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for default declaration\n" +
- "----------\n",
- "4. ERROR in Y.java (at line 8)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for private declaration\n" +
- "----------\n",
- "----------\n" +
- "1. ERROR in Y.java (at line 8)\n" +
- " private int privateMethod(long l) { return 0;}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Missing comment for private declaration\n" +
- "----------\n"
- };
-
- private String resultForMissingComments(int visibility) {
- StringBuffer result = new StringBuffer("----------\n");
- for (int i=0; i<=visibility; i++) {
- result.append(X_ResultForMissingComments[i]);
- }
- if (CompilerOptions.ENABLED.equals(reportMissingJavadocCommentsOverriding)) {
- result.append("----------\n");
- result.append(Y_ResultForMissingComments[PUBLIC_VISIBILITY]);
- if (visibility >= PROTECTED_VISIBILITY) {
- result.append(Y_ResultForMissingComments[PROTECTED_VISIBILITY]);
- if (visibility >= DEFAULT_VISIBILITY) {
- result.append(Y_ResultForMissingComments[DEFAULT_VISIBILITY]);
- if (visibility == PRIVATE_VISIBILITY) {
- result.append(Y_ResultForMissingComments[PRIVATE_VISIBILITY]);
- }
- }
- }
- }
- // Private level is always reported for as it never overrides...
- else if (visibility == PRIVATE_VISIBILITY) {
- result.append(Y_ResultForMissingComments[PRIVATE_VISIBILITY+1]);
- }
- return result.toString();
- }
-
- public JavadocTestOptions(String name) {
- super(name);
- }
- public static Class javadocTestClass() {
- return JavadocTestOptions.class;
- }
- public static Test suite() {
- return buildAllCompliancesTestSuite(javadocTestClass());
- }
- static { // Use this static to initialize testNames (String[]) , testRange (int[2]), testNumbers (int[])
- }
- /**
- * @return Returns the docCommentSupport.
- *
- public String getNamePrefix() {
- if (this.localDocCommentSupport == null) {
- return super.getNamePrefix();
- } else {
- return this.localDocCommentSupport;
- }
- }
- */
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- // Set javadoc options if non null
- if (this.docCommentSupport != null)
- options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
- if (reportInvalidJavadoc != null)
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
- if (reportInvalidJavadocTagsVisibility != null)
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, reportInvalidJavadocTagsVisibility);
- if (reportInvalidJavadocTags != null)
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, reportInvalidJavadocTags);
- if (reportInvalidJavadocTagsDeprecatedRef != null)
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, reportInvalidJavadocTagsDeprecatedRef);
- if (reportInvalidJavadocTagsNotVisibleRef!= null)
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, reportInvalidJavadocTagsNotVisibleRef);
- if (reportMissingJavadocTags != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportMissingJavadocTags);
- if (reportMissingJavadocTagsVisibility != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, reportMissingJavadocTagsVisibility);
- if (reportMissingJavadocTagsOverriding != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, reportMissingJavadocTagsOverriding);
- if (reportMissingJavadocComments != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
- if (reportMissingJavadocCommentsVisibility != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, reportMissingJavadocCommentsVisibility);
- if (reportMissingJavadocCommentsOverriding != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, reportMissingJavadocCommentsOverriding);
-
- // Ignore other options to avoid polluting warnings
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
- return options;
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- reportInvalidJavadoc = null;
- reportInvalidJavadocTagsVisibility = null;
- reportInvalidJavadocTags = null;
- reportInvalidJavadocTagsDeprecatedRef = null;
- reportInvalidJavadocTagsNotVisibleRef = null;
- reportMissingJavadocTags = null;
- reportMissingJavadocTagsVisibility = null;
- reportMissingJavadocTagsOverriding = null;
- reportMissingJavadocComments = null;
- reportMissingJavadocCommentsVisibility = null;
- reportMissingJavadocCommentsOverriding = null;
- }
-
- /*
- * Tests for 'invalid javadoc' options when no doc support is set
- */
- public void testInvalidTagsClassNoSupport() {
- docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(CLASSES_INVALID_COMMENT);
- }
- public void testInvalidTagsFieldNoSupport() {
- docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(FIELDS_INVALID_COMMENT);
- }
- public void testInvalidTagsMethodNoSupport() {
- docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(METHODS_INVALID_COMMENT);
- }
- public void testInvalidTagsConstructorNoSupport() {
- docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(CONSTRUCTORS_INVALID_COMMENT);
- }
-
- /*
- * Tests for 'invalid javadoc' options
- */
- // Test default invalid javadoc (means "ignore" with tags"disabled" and visibility "public")
- public void testInvalidTagsClassDefaults() {
- runConformTest(CLASSES_INVALID_COMMENT);
- }
- public void testInvalidTagsFieldDefaults() {
- runConformTest(FIELDS_INVALID_COMMENT);
- }
- public void testInvalidTagsMethodDefaults() {
- runConformTest(METHODS_INVALID_COMMENT);
- }
- public void testInvalidTagsConstructorDefaults() {
- runConformTest(CONSTRUCTORS_INVALID_COMMENT);
- }
-
- // Test invalid javadoc "error" + tags "disabled" and visibility "public"
- public void testInvalidTagsClassErrorNotags() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(CLASSES_INVALID_COMMENT);
- }
- public void testInvalidTagsFieldErrorNotags() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(FIELDS_INVALID_COMMENT);
- }
- public void testInvalidTagsMethodErrorNotags() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(METHODS_INVALID_COMMENT);
- }
- public void testInvalidTagsConstructorErrorNotags() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(CONSTRUCTORS_INVALID_COMMENT);
- }
-
- // Test invalid javadoc "error" + tags "enabled" and visibility "public"
- public void testInvalidTagsClassErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsFieldErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsMethodErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsConstructorErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" and visibility "protected"
- public void testInvalidTagsClassErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsFieldErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsMethodErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsConstructorErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" and visibility "default"
- public void testInvalidTagsClassErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsFieldErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsMethodErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsConstructorErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" and visibility "private"
- public void testInvalidTagsClassErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsFieldErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsMethodErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsConstructorErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" and visibility "public"
- public void testInvalidTagsDeprecatedRefClassErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefFieldErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefMethodErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefConstructorErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" visibility "protected"
- public void testInvalidTagsDeprecatedRefClassErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefFieldErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefMethodErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefConstructorErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" and visibility "default"
- public void testInvalidTagsDeprecatedRefClassErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefFieldErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefMethodErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefConstructorErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" and visibility "private"
- public void testInvalidTagsDeprecatedRefClassErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefFieldErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefMethodErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedRefConstructorErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" and visibility "public"
- public void testInvalidTagsNotVisibleRefClassErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefFieldErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefMethodErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefConstructorErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" visibility "protected"
- public void testInvalidTagsNotVisibleRefClassErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefFieldErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefMethodErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefConstructorErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" and visibility "default"
- public void testInvalidTagsNotVisibleRefClassErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefFieldErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefMethodErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefConstructorErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" and visibility "private"
- public void testInvalidTagsNotVisibleRefClassErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefFieldErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefMethodErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsNotVisibleRefConstructorErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" and visibility "public"
- public void testInvalidTagsDeprecatedAndNotVisibleRefClassErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsPublic() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" visibility "protected"
- public void testInvalidTagsDeprecatedAndNotVisibleRefClassErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsProtected() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" and visibility "default"
- public void testInvalidTagsDeprecatedAndNotVisibleRefClassErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsPackage() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
- }
-
- // Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" and visibility "private"
- public void testInvalidTagsDeprecatedAndNotVisibleRefClassErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
- public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsPrivate() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
- }
-
- /*
- * Tests for 'missing javadoc tags' options
- */
- // Test default missing javadoc tags (means "ignore" with visibility "public" and overriding="enabled")
- public void testMissingTagsDefaults() {
- runConformTest(MISSING_TAGS);
- }
-
- // Test missing javadoc tags "error" + "public" visibility + "enabled" overriding
- public void testMissingTagsErrorPublicOverriding() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PUBLIC;
- reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(PUBLIC_VISIBILITY));
- }
-
- // Test missing javadoc tags "error" + "public" visibility + "disabled" overriding
- public void testMissingTagsErrorPublic() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PUBLIC;
- reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(PUBLIC_VISIBILITY));
- }
-
- // Test missing javadoc tags "error" + "protected" visibility + "enabled" overriding
- public void testMissingTagsErrorProtectedOverriding() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PROTECTED;
- reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(PROTECTED_VISIBILITY));
- }
-
- // Test missing javadoc tags "error" + "protected" visibility + "disabled" overriding
- public void testMissingTagsErrorProtected() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PROTECTED;
- reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(PROTECTED_VISIBILITY));
- }
-
- // Test missing javadoc tags "error" + "default" visibility + "enabled" overriding
- public void testMissingTagsErrorPackageOverriding() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.DEFAULT;
- reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(DEFAULT_VISIBILITY));
- }
-
- // Test missing javadoc tags "error" + "default" visibility + "disabled" overriding
- public void testMissingTagsErrorPackage() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.DEFAULT;
- reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(DEFAULT_VISIBILITY));
- }
-
- // Test missing javadoc tags "error" + "private" visibility + "enabled" overriding
- public void testMissingTagsErrorPrivateOverriding() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(PRIVATE_VISIBILITY));
- }
-
- // Test missing javadoc tags "error" + "private" visibility + "disabled" overriding
- public void testMissingTagsErrorPrivate() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_TAGS, resultForMissingTags(PRIVATE_VISIBILITY));
- }
-
- /*
- * Tests for 'missing javadoc comments' options
- */
- // Test default missing javadoc comments (means "ignore" with visibility "public" and overriding="enabled")
- public void testMissingCommentsDefaults() {
- runConformTest(MISSING_COMMENTS);
- }
-
- // Test missing javadoc comments "error" + "public" visibility + "enabled" overriding
- public void testMissingCommentsErrorPublicOverriding() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
- reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PUBLIC_VISIBILITY));
- }
-
- // Test missing javadoc comments "error" + "public" visibility + "disabled" overriding
- public void testMissingCommentsErrorPublic() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
- reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PUBLIC_VISIBILITY));
- }
-
- // Test missing javadoc comments "error" + "protected" visibility + "enabled" overriding
- public void testMissingCommentsErrorProtectedOverriding() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
- reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PROTECTED_VISIBILITY));
- }
-
- // Test missing javadoc comments "error" + "protected" visibility + "disabled" overriding
- public void testMissingCommentsErrorProtected() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
- reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PROTECTED_VISIBILITY));
- }
-
- // Test missing javadoc comments "error" + "default" visibility + "enabled" overriding
- public void testMissingCommentsErrorPackageOverriding() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
- reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(DEFAULT_VISIBILITY));
- }
-
- // Test missing javadoc comments "error" + "default" visibility + "disabled" overriding
- public void testMissingCommentsErrorPackage() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
- reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(DEFAULT_VISIBILITY));
- }
-
- // Test missing javadoc comments "error" + "private" visibility + "enabled" overriding
- public void testMissingCommentsErrorPrivateOverriding() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
- reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PRIVATE_VISIBILITY));
- }
-
- // Test missing javadoc comments "error" + "private" visibility + "disabled" overriding
- public void testMissingCommentsErrorPrivate() {
- reportMissingJavadocComments = CompilerOptions.ERROR;
- reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
- reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PRIVATE_VISIBILITY));
- }
-
- /*
- * Crossed tests
- */
- public void testInvalidTagsClassWithMissingTagsOption() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(CLASSES_INVALID_COMMENT);
- }
- public void testInvalidTagsFieldWithMissingTagsOption() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(FIELDS_INVALID_COMMENT);
- }
- public void testInvalidTagsMethodWithMissingTagsOption() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(METHODS_INVALID_COMMENT);
- }
- public void testInvalidTagsConstructorWithMissingTagsOption() {
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(CONSTRUCTORS_INVALID_COMMENT);
- }
- public void testMissingTagsWithInvalidTagsOption() {
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ENABLED;
- reportInvalidJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(MISSING_TAGS);
- }
-
- /**
- * Test fix for bug 52264.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=52264">52264</a>
- */
- // Test invalid javadoc "error" with javadoc comment support disabled
- public void testInvalidTagsJavadocSupportDisabled() {
- this.docCommentSupport = CompilerOptions.DISABLED;
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportInvalidJavadocTags = CompilerOptions.ERROR;
- runConformTest(CLASSES_INVALID_COMMENT);
- runConformTest(FIELDS_INVALID_COMMENT);
- runConformTest(METHODS_INVALID_COMMENT);
- runConformTest(CONSTRUCTORS_INVALID_COMMENT);
- }
-
- // Test missing javadoc comments "error" with javadoc comment support disabled
- public void testMissingCommentsJavadocSupportDisabled() {
- this.docCommentSupport = CompilerOptions.DISABLED;
- reportMissingJavadocComments = CompilerOptions.ERROR;
- runConformReferenceTest(MISSING_COMMENTS);
- }
-
- // Test missing javadoc tags "error" with javadoc comment support disabled
- public void testMissingTagsJavadocSupportDisabled() {
- this.docCommentSupport = CompilerOptions.DISABLED;
- reportMissingJavadocTags = CompilerOptions.ERROR;
- runConformReferenceTest(MISSING_TAGS);
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_3.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_3.java
deleted file mode 100644
index 752ca73..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_3.java
+++ /dev/null
@@ -1,3914 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTest_1_3 extends JavadocTest {
-
- String docCommentSupport = CompilerOptions.ENABLED;
- String reportInvalidJavadoc = CompilerOptions.ERROR;
- String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- String reportMissingJavadocTags = CompilerOptions.ERROR;
- String reportMissingJavadocComments = null;
- String reportMissingJavadocCommentsVisibility = null;
-
- public JavadocTest_1_3(String name) {
- super(name);
- }
-
- public static Class testClass() {
- return JavadocTest_1_3.class;
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] {
-// "testBug70892conform1", "testBug70892conform2"
-// };
-// TESTS_NUMBERS = new int[] { 101283 };
-// TESTS_RANGE = new int[] { 21, 50 };
- }
- public static Test suite() {
- return buildMinimalComplianceTestSuite(testClass(), F_1_3);
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
- if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
- }
- if (reportMissingJavadocComments != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
- else
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportInvalidJavadoc);
- if (reportMissingJavadocCommentsVisibility != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, reportMissingJavadocCommentsVisibility);
- if (reportMissingJavadocTags != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportMissingJavadocTags);
- else
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportInvalidJavadoc);
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- return options;
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- this.docCommentSupport = CompilerOptions.ENABLED;
- this.reportInvalidJavadoc = CompilerOptions.ERROR;
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- this.reportMissingJavadocTags = CompilerOptions.ERROR;
- this.reportMissingJavadocComments = CompilerOptions.IGNORE;
- }
-
-
- /**
- * Test fix for bug 70891: [1.5][javadoc] Compiler should accept new 1.5 syntax for @param
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=70891">70891</a>
- * These two tests fail for 1.5 source level but should pass for 1.3 or 1.4
- * @see JavadocTest_1_3
- */
- /* (non-Javadoc)
- * Test @param for generic class type parameter
- */
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <E> Type\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\r\n" +
- " public class X<E> {}\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test004() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type extends RuntimeException\n" +
- " */\n" +
- " public class X<E extends RuntimeException> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <E> Type extends RuntimeException\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\r\n" +
- " public class X<E extends RuntimeException> {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
-
- );
- }
- public void test005() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\r\n" +
- " public class X<T, U, V> {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public class X {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n"
- );
- }
- public void test007() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public class X<E, F> {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<E, F> {}\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test008() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test009() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test010() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <T> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\r\n" +
- " public class X<T, U, V> {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <T> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test013() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test014() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test015() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test016() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test017() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param <U> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test018() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test019() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test021() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, , V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^\n" +
- "Syntax error, insert \"ClassBody\" to complete JavaScriptUnit\n" +
- "----------\n"
- );
- }
- public void test022() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V extend Exception> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^\n" +
- "Syntax error, insert \"ClassBody\" to complete JavaScriptUnit\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^^^^^^\n" +
- "extend cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /* (non-Javadoc)
- * Test @param for generic method type parameter
- */
- public void test023() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type\n" +
- " */\n" +
- " public <E> void foo() {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " * @param <E> Type\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\r\n" +
- " public <E> void foo() {}\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test024() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type extends RuntimeException\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <E extends RuntimeException> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " * @param <E> Type extends RuntimeException\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\r\n" +
- " public <E extends RuntimeException> void foo(int val, Object obj) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test025() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\r\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test026() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param val int\n" +
- " * @param <E> Type parameter\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n"
- );
- }
- public void test027() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test028() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param xxx int\n" +
- " * @param Obj Object\n" +
- " */\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " * @param xxx int\n" +
- " ^^^\n" +
- "Javadoc: Parameter xxx is not declared\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 8)\n" +
- " * @param Obj Object\n" +
- " ^^^\n" +
- "Javadoc: Parameter Obj is not declared\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test029() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param val int\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param obj Object\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test030() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param obj Object\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param val int\n" +
- " * @param <T> Type parameter 1\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\r\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test031() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test032() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param val int\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test033() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param obj Object\n" +
- " * @param <U> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n"
- );
- }
- public void test034() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param val int\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param Object obj\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param val int\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @param Object obj\n" +
- " ^^^^^^\n" +
- "Javadoc: Parameter Object is not declared\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " * @param val int\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 13)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 13)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test035() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- // TODO (david) recovery seems not to work properly here:
- // we should have type parameters in method declaration.
- public void test036() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <T, , V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T, , V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n"
- );
- }
- public void test037() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test038() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param < Type\n" +
- " * @param < Type for parameterization\n" +
- " * @param <> Type\n" +
- " * @param <?> Type\n" +
- " * @param <*> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param < Type\n" +
- " ^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param < Type for parameterization\n" +
- " ^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <> Type\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <?> Type\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <*> Type\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<E> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E Type parameter of class X\n" +
- " * @param E> Type\n" +
- " * @param <<E> Type\n" +
- " * @param <<<E> Type\n" +
- " * @param <E>> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E Type parameter of class X\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param E> Type\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <<E> Type\n" +
- " ^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <<<E> Type\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <E>> Type\n" +
- " ^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<E> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
-
- public void test040() {
- runConformReferenceTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @category\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Test fix for bug 80257: [javadoc] Invalid missing reference warning on @see or @link tags
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=80257"
- */
- public void testBug80257() {
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see G#G(Object)\n" +
- " * @see G#G(Exception)\n" +
- " */\n" +
- "public class X extends G<Exception> {\n" +
- " X(Exception exc) { super(exc);}\n" +
- "}\n" +
- "class G<E extends Exception> {\n" +
- " G(E e) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see G#G(Object)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor G(Object) is undefined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * @see G#G(Exception)\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: The constructor G(Exception) is undefined\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public class X extends G<Exception> {\n" +
- " ^\n" +
- "The type G is not generic; it cannot be parameterized with arguments <Exception>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public class X extends G<Exception> {\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " X(Exception exc) { super(exc);}\n" +
- " ^^^^^^^^^^^\n" +
- "The constructor Object(Exception) is undefined\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 8)\n" +
- " class G<E extends Exception> {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 9)\n" +
- " G(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Test fix for bug 82514: [1.5][javadoc] Problem with generics in javadoc
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=82514"
- */
- public void testBug82514() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class ComparableUtils {\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " {\n" +
- " return 0;\n" +
- " }\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " throws ClassCastException\n" +
- " {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n" +
- "public final class X { \n" +
- " /** Tests the method{@link ComparableUtils#compareTo(Object, Object, Class)} and\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " */\n" +
- " public void testCompareTo() {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 13)\n" +
- " /** Tests the method{@link ComparableUtils#compareTo(Object, Object, Class)} and\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object, Class)\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
- "----------\n");
- }
-
- /**
- * Test fix for bug 83127: [1.5][javadoc][dom] Wrong / strange bindings for references in javadoc to methods with type variables as parameter types
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83127"
- */
- public void testBug83127a() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Test#add(T) \n" +
- " * @see #add(T)\n" +
- " * @see Test#Test(T)\n" +
- " * @see #Test(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Test.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " */\n" +
- "public class Test<T> {\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Test#add(T) \n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see #add(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 4)\n" +
- " * @see Test#Test(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 5)\n" +
- " * @see #Test(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public class Test<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 12)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 13)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "12. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "13. ERROR in Test.java (at line 20)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127b() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Sub#add(T)\n" +
- " * @see Sub#Sub(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Test.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " * -> Do we need to change this as T natually resolved to TypeVariable?\n" +
- " * As compiler raises a warning, it\'s perhaps not a problem now...\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 11)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 12)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 13)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 20)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127c() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Sub#add(E) \n" +
- " * @see Sub#Sub(E)\n" +
- " * - warning = \"E cannot be resolved to a type\"\n" +
- " * - method binding = null\n" +
- " * - parameter binding = null\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(E) \n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 9)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 10)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 17)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127d() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(E)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " * - warning = \"E cannot be resolved to a type\"\n" +
- " * - method binding = null\n" +
- " * - parameter binding = null\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\n" +
- " public Unrelated1(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\n" +
- " public boolean add(E e) { return false; }\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 9)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 10)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 17)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127e() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Object)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (Object)\"\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Object\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\n" +
- " public Unrelated1(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\n" +
- " public boolean add(E e) { return false; }\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Object)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) is undefined for the type Unrelated1\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Object) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 10)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 17)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127f() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Number)\n" +
- " * @see Unrelated1#Unrelated1(Number)\n" +
- " * - no warning\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Number\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\r\n" +
- " public class Unrelated1<E extends Number> {\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\r\n" +
- " public Unrelated1(E e) {}\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\r\n" +
- " public boolean add(E e) { return false; }\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\r\n" +
- " * @see Unrelated1#add(Number)\r\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) is undefined for the type Unrelated1\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\r\n" +
- " * @see Unrelated1#Unrelated1(Number)\r\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Number) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\r\n" +
- " public class Test<T>{\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 9)\r\n" +
- " Test(T t) {}\r\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 10)\r\n" +
- " public boolean add(T t) {\r\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 14)\r\n" +
- " class Sub<E extends Number> extends Test<E> {\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 14)\r\n" +
- " class Sub<E extends Number> extends Test<E> {\r\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 14)\r\n" +
- " class Sub<E extends Number> extends Test<E> {\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 15)\r\n" +
- " Sub (E e) {super(null);}\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 15)\r\n" +
- " Sub (E e) {super(null);}\r\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 16)\r\n" +
- " public boolean add(E e) {\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127g() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Integer)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (Integer)\"\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Integer\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\n" +
- " public Unrelated1(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\n" +
- " public boolean add(E e) { return false; }\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Integer)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Integer) is undefined for the type Unrelated1\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Integer) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 10)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 17)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 17)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 18)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127h() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated2.java",
- "public interface Unrelated2<E> {\n" +
- " boolean add(E e);\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated2#add(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Unrelated2.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " * -> Do we need to change this as T natually resolved to TypeVariable?\n" +
- " * As compiler raises a warning, it\'s perhaps not a problem now...\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated2.java (at line 1)\n" +
- " public interface Unrelated2<E> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated2.java (at line 2)\n" +
- " boolean add(E e);\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated2#add(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 10)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 11)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 12)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 18)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 18)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 19)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n");
- }
-
- /**
- * Bug 83393: [1.5][javadoc] reference to vararg method also considers non-array type as correct
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83393"
- */
- public void testBug83393a() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public void foo(int a, int b) {} \n" +
- " public void foo(int a, int... args) {}\n" +
- " public void foo(String... args) {}\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- "}\n",
- "Valid.java",
- "/**\n" +
- " * @see Test#foo(int, int)\n" +
- " * @see Test#foo(int, int[])\n" +
- " * @see Test#foo(int, int...)\n" +
- " * @see Test#foo(String[])\n" +
- " * @see Test#foo(String...)\n" +
- " * @see Test#foo(Exception, boolean[])\n" +
- " * @see Test#foo(Exception, boolean...)\n" +
- " */\n" +
- "public class Valid {}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\r\n" +
- " public void foo(int a, int... args) {}\r\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\r\n" +
- " public void foo(String... args) {}\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\r\n" +
- " public void foo(Exception str, boolean... args) {}\r\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug83393b() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public void foo(int a, int b) {} \n" +
- " public void foo(int a, int... args) {}\n" +
- " public void foo(String... args) {}\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- "}\n",
- "Invalid.java",
- "/**\n" +
- " * @see Test#foo(int)\n" +
- " * @see Test#foo(int, int, int)\n" +
- " * @see Test#foo()\n" +
- " * @see Test#foo(String)\n" +
- " * @see Test#foo(String, String)\n" +
- " * @see Test#foo(Exception)\n" +
- " * @see Test#foo(Exception, boolean)\n" +
- " * @see Test#foo(Exception, boolean, boolean)\n" +
- " */\n" +
- "public class Invalid {}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " public void foo(int a, int... args) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\n" +
- " public void foo(String... args) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Invalid.java (at line 2)\n" +
- " * @see Test#foo(int)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int) in the type Test is not applicable for the arguments (int)\n" +
- "----------\n" +
- "2. ERROR in Invalid.java (at line 3)\n" +
- " * @see Test#foo(int, int, int)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int) in the type Test is not applicable for the arguments (int, int, int)\n" +
- "----------\n" +
- "3. ERROR in Invalid.java (at line 4)\n" +
- " * @see Test#foo()\n" +
- " ^^^\n" +
- "Javadoc: The method foo(String[]) in the type Test is not applicable for the arguments ()\n" +
- "----------\n" +
- "4. ERROR in Invalid.java (at line 5)\n" +
- " * @see Test#foo(String)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(String[]) in the type Test is not applicable for the arguments (String)\n" +
- "----------\n" +
- "5. ERROR in Invalid.java (at line 6)\n" +
- " * @see Test#foo(String, String)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int) in the type Test is not applicable for the arguments (String, String)\n" +
- "----------\n" +
- "6. ERROR in Invalid.java (at line 7)\n" +
- " * @see Test#foo(Exception)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean[]) in the type Test is not applicable for the arguments (Exception)\n" +
- "----------\n" +
- "7. ERROR in Invalid.java (at line 8)\n" +
- " * @see Test#foo(Exception, boolean)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean[]) in the type Test is not applicable for the arguments (Exception, boolean)\n" +
- "----------\n" +
- "8. ERROR in Invalid.java (at line 9)\n" +
- " * @see Test#foo(Exception, boolean, boolean)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean[]) in the type Test is not applicable for the arguments (Exception, boolean, boolean)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 83804: [1.5][javadoc] Missing Javadoc node for package declaration
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83804"
- */
- public void testBug83804() {
- runNegativeTest(
- new String[] {
- "pack/package-info.java",
- "/**\n" +
- " * Valid javadoc.\n" +
- " * @see Test\n" +
- " * @see Unknown\n" +
- " * @see Test#foo()\n" +
- " * @see Test#unknown()\n" +
- " * @see Test#field\n" +
- " * @see Test#unknown\n" +
- " * @param unexpected\n" +
- " * @throws unexpected\n" +
- " * @return unexpected \n" +
- " * @deprecated accepted by javadoc.exe although javadoc 1.5 spec does not say that's a valid tag\n" +
- " * @other-tags are valid\n" +
- " */\n" +
- "package pack;\n",
- "pack/Test.java",
- "/**\n" +
- " * Invalid javadoc\n" +
- " */\n" +
- "package pack;\n" +
- "public class Test {\n" +
- " public int field;\n" +
- " public void foo() {}\n" +
- "}\n"
- },
- ""
- );
- }
- /**
- * Bug 96237: [javadoc] Inner types must be qualified
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237"
- */
- public void testBug96237_Public01() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "comment6/Valid.java",
- "package comment6;\n" +
- "public class Valid {\n" +
- " /**\n" +
- " * @see Valid.Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Valid.Inner}\n" +
- " */\n" +
- "class Sub2 extends Valid { }"
- }
- );
- }
- public void testBug96237_Public02() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6/Invalid.java",
- "package comment6;\n" +
- "public class Invalid {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Inner} \n" +
- " */\n" +
- "class Sub1 extends Invalid { }\n"
- },
- //comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6\\Invalid.java (at line 4)\r\n" +
- " * @see Inner\r\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public03() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6a/def/Test.java",
- "package comment6a.def;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6a/test/Invalid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * See also {@link Inner}\n" +
- " */\n" +
- "public class Invalid extends Test { \n" +
- "}",
- "comment6a/test/Invalid2.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Invalid2 extends Test { \n" +
- "}",
- "comment6a/test/Valid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see comment6a.def.Test.Inner\n" +
- " */\n" +
- "public class Valid extends Test { \n" +
- "}"
- },
- //comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
- //comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
- //comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner => bug ID: 4464323
- "----------\n" +
- "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
- " * See also {@link Inner}\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public04() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6b/Invalid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Inner\n" +
- " */\n" +
- "public class Invalid implements Test { \n" +
- "}",
- "comment6b/Test.java",
- "package comment6b;\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6b/Valid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Valid implements Test { \n" +
- "}"
- },
- //comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
- //comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6b\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public05() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/a/Test.java",
- "package test.a;\n" +
- "/**\n" +
- " * @see Inner\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Test {\n" +
- " class Inner {}\n" +
- "}\n"
- },
- //test\a\Test.java:6: warning - Tag @see: reference not found: Inner
- //test\a\Test.java:6: warning - Tag @see: reference not found: Test.Inner
- "----------\n" +
- "1. ERROR in test\\a\\Test.java (at line 3)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\a\\Test.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public06() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/b/Test.java",
- "package test.b;\n" +
- "/** \n" +
- " * @see Inner.Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- "public class Test {\n" +
- " /** \n" +
- " * @see Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- " public class Inner {\n" +
- " class Level2 {}\n" +
- " }\n" +
- "}\n"
- },
- //test\b\Test.java:6: warning - Tag @see: reference not found: Inner.Level2
- //test\b\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2
- //test\b\Test.java:11: warning - Tag @see: reference not found: Level2
- //test\b\Test.java:11: warning - Tag @see: reference not found: Test.Inner.Level2
- "----------\n" +
- "1. ERROR in test\\b\\Test.java (at line 3)\n" +
- " * @see Inner.Level2\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\b\\Test.java (at line 4)\n" +
- " * @see Test.Inner.Level2\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "3. ERROR in test\\b\\Test.java (at line 8)\n" +
- " * @see Level2\n" +
- " ^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "4. ERROR in test\\b\\Test.java (at line 9)\n" +
- " * @see Test.Inner.Level2\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public07() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/c/Test.java",
- "package test.c;\n" +
- "/**\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * @see Level3\n" +
- " * @see Level2.Level3\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- " public class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //test\c\Test.java:6: warning - Tag @see: reference not found: Inner.Level2.Level3
- //test\c\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Inner.Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
- "----------\n" +
- "1. ERROR in test\\c\\Test.java (at line 3)\n" +
- " * @see Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\c\\Test.java (at line 4)\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "3. ERROR in test\\c\\Test.java (at line 9)\n" +
- " * @see Level3\n" +
- " ^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "4. ERROR in test\\c\\Test.java (at line 10)\n" +
- " * @see Level2.Level3\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "5. ERROR in test\\c\\Test.java (at line 11)\n" +
- " * @see Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "6. ERROR in test\\c\\Test.java (at line 12)\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public08() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/d/Reference.java",
- "package test.d;\n" +
- "class Reference {\n" +
- "}\n",
- "test/d/Test.java",
- "package test.d;\n" +
- "/**\n" +
- " * @see Secondary\n" +
- " * @see Reference\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n" +
- "class Secondary {}"
- },
- "----------\n" +
- "1. ERROR in test\\d\\Test.java (at line 3)\n" +
- " * @see Secondary\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\d\\Test.java (at line 4)\n" +
- " * @see Reference\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private01() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "comment6/Valid.java",
- "package comment6;\n" +
- "public class Valid {\n" +
- " /**\n" +
- " * @see Valid.Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Valid.Inner}\n" +
- " */\n" +
- "class Sub2 extends Valid { }"
- }
- );
- }
- public void testBug96237_Private02() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6/Invalid.java",
- "package comment6;\n" +
- "public class Invalid {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Inner} \n" +
- " */\n" +
- "class Sub1 extends Invalid { }\n"
- },
- //comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
- //comment6\Invalid.java:11: warning - Tag @link: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in comment6\\Invalid.java (at line 9)\n" +
- " * See also {@link Inner} \n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private03() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6a/def/Test.java",
- "package comment6a.def;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6a/test/Invalid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * See also {@link Inner}\n" +
- " */\n" +
- "public class Invalid extends Test { \n" +
- "}",
- "comment6a/test/Invalid2.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Invalid2 extends Test { \n" +
- "}",
- "comment6a/test/Valid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see comment6a.def.Test.Inner\n" +
- " */\n" +
- "public class Valid extends Test { \n" +
- "}"
- },
- //comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
- //comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
- //comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner => bug ID: 4464323
- "----------\n" +
- "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
- " * See also {@link Inner}\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private04() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6b/Invalid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Inner\n" +
- " */\n" +
- "public class Invalid implements Test { \n" +
- "}",
- "comment6b/Test.java",
- "package comment6b;\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6b/Valid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Valid implements Test { \n" +
- "}"
- },
- //comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
- //comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6b\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private05() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/a/Test.java",
- "package test.a;\n" +
- "/**\n" +
- " * @see Inner\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Test {\n" +
- " class Inner {}\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private06() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/b/Test.java",
- "package test.b;\n" +
- "/** \n" +
- " * @see Inner.Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- "public class Test {\n" +
- " /** \n" +
- " * @see Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- " public class Inner {\n" +
- " class Level2 {}\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private07() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/c/Test.java",
- "package test.c;\n" +
- "/**\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * @see Level3\n" +
- " * @see Level2.Level3\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- " public class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private08() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/d/Reference.java",
- "package test.d;\n" +
- "class Reference {\n" +
- "}\n",
- "test/d/Test.java",
- "package test.d;\n" +
- "/**\n" +
- " * @see Secondary\n" +
- " * @see Reference\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n" +
- "class Secondary {}"
- }
- );
- }
-
- /**
- * Bug 95286: [1.5][javadoc] package-info.java incorrectly flags "Missing comment for public declaration"
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=95286"
- */
- public void testBug95286_Default() {
- this.reportMissingJavadocComments = CompilerOptions.ERROR;
- this.reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
- runConformTest(
- new String[] {
- "test/package-info.java",
- "/**\n" +
- " * Javadoc for all package \n" +
- " */\n" +
- "package test;\n"
- }
- );
- }
- public void testBug95286_Private() {
- this.reportMissingJavadocComments = CompilerOptions.ERROR;
- this.reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/package-info.java",
- "/**\n" +
- " * Javadoc for all package \n" +
- " */\n" +
- "package test;\n"
- }
- );
- }
-
- /**
- * Bug 95521: [1.5][javadoc] validation with @see tag not working for generic method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=95521"
- */
- public void testBug95521() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "\n" +
- "/** Test */\n" +
- "public class X implements I {\n" +
- " /**\n" +
- " * @see test.I#foo(java.lang.Class)\n" +
- " */\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "/** Interface */\n" +
- "interface I {\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param stuffClass \n" +
- " * @return stuff\n" +
- " */\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- "}\n" +
- "/** \n" +
- " * @param <T>\n" +
- " */\n" +
- "class G<T> {}\n"
- },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 15)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "11. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "12. ERROR in test\\X.java (at line 22)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "13. ERROR in test\\X.java (at line 24)\n" +
- " class G<T> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n");
- }
- public void testBug95521b() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "\n" +
- "/** Test */\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param classT \n" +
- " */\n" +
- " public <T> X(Class<T> classT) {\n" +
- " }\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param classT\n" +
- " * @return classT\n" +
- " */\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " return classT;\n" +
- " }\n" +
- "}\n" +
- "/** Super class */\n" +
- "class Y extends X {\n" +
- " /**\n" +
- " * @see X#X(java.lang.Class)\n" +
- " */\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " super(classT);\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * @see X#foo(java.lang.Class)\n" +
- " */\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 12)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "10. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "11. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "12. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "13. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "14. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "15. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "16. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "17. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "18. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n");
- }
-
- /**
- * Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=101283"
- */
- public void testBug101283a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @param <T> \n" +
- " * @param <F>\n" +
- " */\n" +
- " static class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <T> \n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <F>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug101283b() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @see T Variable \n" +
- " * @see F Variable\n" +
- " */\n" +
- " static class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: F cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug101283c() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @param <T> \n" +
- " * @param <F>\n" +
- " */\n" +
- " class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <T> \n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <F>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug101283d() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @see T Variable \n" +
- " * @see F Variable\n" +
- " */\n" +
- " class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: F cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- // Verify that ProblemReasons.InheritedNameHidesEnclosingName is not reported as Javadoc error
- public void testBug101283g() {
- reportMissingJavadocTags = CompilerOptions.DISABLED;
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "public class X {\n" +
- " int foo() { return 0; }\n" +
- " class XX extends X2 {\n" +
- " int bar() {\n" +
- " return foo();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class X2 {\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n",
- "test/Y.java",
- "package test;\n" +
- "public class Y {\n" +
- " int foo;\n" +
- " class YY extends Y2 {\n" +
- " /**\n" +
- " * @see #foo\n" +
- " */\n" +
- " int bar() {\n" +
- " return foo;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class Y2 {\n" +
- " int foo;\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\r\n" +
- " return foo();\r\n" +
- " ^^^\n" +
- "The method foo is defined in an inherited type and an enclosing scope\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in test\\Y.java (at line 9)\r\n" +
- " return foo;\r\n" +
- " ^^^\n" +
- "The field foo is defined in an inherited type and an enclosing scope \n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 112346: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=112346"
- */
- public void testBug112346() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Test references\n" +
- " * @see Test#field\n" +
- " * @see Test#foo()\n" +
- " */\n" +
- "public class Test<T> {\n" +
- " T field;\n" +
- " T foo() { return null; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " * @see Test#field\n" +
- " ^^^^^\n" +
- "Javadoc: field cannot be resolved or is not a field\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\n" +
- " * @see Test#foo()\n" +
- " ^^^\n" +
- "Javadoc: The method foo() is undefined for the type Test\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 6)\n" +
- " public class Test<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 7)\n" +
- " T field;\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 8)\n" +
- " T foo() { return null; }\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 119857: [javadoc] Some inner class references should be flagged as unresolved
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=119857"
- */
- public void testBug119857() {
- runNegativeTest(
- new String[] {
- "DefaultInformationControl.java",
- "public class DefaultInformationControl {\n" +
- " public interface IInformationPresenter {\n" +
- " /**\n" +
- " * Updates the given presentation of the given information and\n" +
- " * thereby may manipulate the information to be displayed. The manipulation\n" +
- " * could be the extraction of textual encoded style information etc. Returns the\n" +
- " * manipulated information.\n" +
- " *\n" +
- " * @param hoverInfo the information to be presented\n" +
- " * @param maxWidth the maximal width in pixels\n" +
- " * @param maxHeight the maximal height in pixels\n" +
- " *\n" +
- " * @return the manipulated information\n" +
- " * @deprecated As of 3.2, replaced by {@link IInformationPresenterExtension#updatePresentation(String, int, int)}\n" +
- " * see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=38528 for details.\n" +
- " */\n" +
- " String updatePresentation(String hoverInfo, int maxWidth, int maxHeight);\n" +
- " }\n" +
- " /**\n" +
- " * An information presenter determines the style presentation\n" +
- " * of information displayed in the default information control.\n" +
- " * The interface can be implemented by clients.\n" +
- " * \n" +
- " * @since 3.2\n" +
- " */\n" +
- " public interface IInformationPresenterExtension {\n" +
- " \n" +
- " /**\n" +
- " * Updates the given presentation of the given information and\n" +
- " * thereby may manipulate the information to be displayed. The manipulation\n" +
- " * could be the extraction of textual encoded style information etc. Returns the\n" +
- " * manipulated information.\n" +
- " * <p>\n" +
- " * Replaces {@link IInformationPresenter#updatePresentation(String, int, int)}\n" +
- " * <em>Make sure that you do not pass in a <code>Display</code></em> until\n" +
- " * https://bugs.eclipse.org/bugs/show_bug.cgi?id=38528 is fixed.\n" +
- " * </p>\n" +
- " *\n" +
- " * @param hoverInfo the information to be presented\n" +
- " * @param maxWidth the maximal width in pixels\n" +
- " * @param maxHeight the maximal height in pixels\n" +
- " *\n" +
- " * @return the manipulated information\n" +
- " */\n" +
- " String updatePresentation(String hoverInfo, int maxWidth, int maxHeight);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in DefaultInformationControl.java (at line 14)\n" +
- " * @deprecated As of 3.2, replaced by {@link IInformationPresenterExtension#updatePresentation(String, int, int)}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in DefaultInformationControl.java (at line 34)\n" +
- " * Replaces {@link IInformationPresenter#updatePresentation(String, int, int)}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Fields() {
- runNegativeTest(
- new String[] {
- "TestFields.java",
- "/**\n" +
- " * @see MyInnerClass#foo\n" +
- " */\n" +
- "public class TestFields {\n" +
- " /**\n" +
- " * @see MyInnerClass#foo\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " Object foo;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestFields.java (at line 6)\n" +
- " * @see MyInnerClass#foo\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Methods() {
- runNegativeTest(
- new String[] {
- "TestMethods.java",
- "/**\n" +
- " * @see MyInnerClass#foo()\n" +
- " * @see MyInnerInterface#foo()\n" +
- " */\n" +
- "public class TestMethods {\n" +
- " /**\n" +
- " * @see MyInnerInterface#foo()\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " public void foo() {}\n" +
- " }\n" +
- " /**\n" +
- " * @see MyInnerClass#foo()\n" +
- " */\n" +
- " public interface MyInnerInterface {\n" +
- " public void foo();\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestMethods.java (at line 7)\n" +
- " * @see MyInnerInterface#foo()\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in TestMethods.java (at line 13)\n" +
- " * @see MyInnerClass#foo()\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Types() {
- runNegativeTest(
- new String[] {
- "TestTypes.java",
- "/**\n" +
- " * @see MyInnerClass\n" +
- " * @see MyInnerInterface\n" +
- " */\n" +
- "public class TestTypes {\n" +
- " /**\n" +
- " * @see MyInnerInterface\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " public void foo() {}\n" +
- " }\n" +
- " /**\n" +
- " * @see MyInnerClass\n" +
- " */\n" +
- " public interface MyInnerInterface {\n" +
- " public void foo();\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestTypes.java (at line 7)\n" +
- " * @see MyInnerInterface\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in TestTypes.java (at line 13)\n" +
- " * @see MyInnerClass\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Private01() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public Inner field;\n" +
- " /** \n" +
- " * @see Inner#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Public01() {
- this.reportMissingJavadocTags = CompilerOptions.DISABLED;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public Inner field;\n" +
- " /** \n" +
- " * @see Inner#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- "}\n"
- },
- //pack/Test.java:13: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in pack\\Test.java (at line 8)\r\n" +
- " * @see Inner#foo()\r\n" +
- " ^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n"
- );
- }
- public void testBug119857_Private02() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //pack\Test2.java:11: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 9)\r\n" +
- " * @see Inner1#foo()\r\n" +
- " ^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Public02() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Public03() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //pack/Test.java:13: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in pack\\Test.java (at line 9)\n" +
- " * @see Inner1#foo()\n" +
- " ^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 145007: [1.5][javadoc] Generics + Inner Class -> Javadoc "missing @throws" warning
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=145007"
- */
- public void testBug145007() {
- runNegativeTest(
- new String[] {
- "TestClass.java",
- "class TestClass<T> {\n" +
- " static class Test1 {\n" +
- " /**\n" +
- " * A simple method that demonstrates tag problems\n" +
- " * \n" +
- " * @return a string\n" +
- " * @throws MyException\n" +
- " * if something goes wrong\n" +
- " */\n" +
- " public String getString() throws MyException {\n" +
- " throw new MyException();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " static class MyException extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestClass.java (at line 1)\r\n" +
- " class TestClass<T> {\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_4.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_4.java
deleted file mode 100644
index a9b902a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_4.java
+++ /dev/null
@@ -1,3908 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTest_1_4 extends JavadocTest {
-
- String docCommentSupport = CompilerOptions.ENABLED;
- String reportInvalidJavadoc = CompilerOptions.ERROR;
- String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- String reportMissingJavadocTags = CompilerOptions.ERROR;
- String reportMissingJavadocComments = null;
- String reportMissingJavadocCommentsVisibility = null;
-
- public JavadocTest_1_4(String name) {
- super(name);
- }
-
- public static Class testClass() {
- return JavadocTest_1_4.class;
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_PREFIX = "testBug95521";
-// TESTS_NAMES = new String[] {
-// "testBug70892conform1", "testBug70892conform2"
-// };
-// TESTS_NUMBERS = new int[] { 101283 };
-// TESTS_RANGE = new int[] { 21, 50 };
- }
- public static Test suite() {
- return buildMinimalComplianceTestSuite(testClass(), F_1_4);
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
- if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
- }
- if (reportMissingJavadocComments != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
- else
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportInvalidJavadoc);
- if (reportMissingJavadocCommentsVisibility != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, reportMissingJavadocCommentsVisibility);
- if (reportMissingJavadocTags != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportMissingJavadocTags);
- else
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportInvalidJavadoc);
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- return options;
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- this.docCommentSupport = CompilerOptions.ENABLED;
- this.reportInvalidJavadoc = CompilerOptions.ERROR;
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- this.reportMissingJavadocTags = CompilerOptions.ERROR;
- this.reportMissingJavadocComments = CompilerOptions.IGNORE;
- }
-
-
- /**
- * Test fix for bug 70891: [1.5][javadoc] Compiler should accept new 1.5 syntax for @param
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=70891">70891</a>
- * These two tests fail for 1.5 source level but should pass for 1.3 or 1.4
- * @see JavadocTest_1_4
- */
- /* (non-Javadoc)
- * Test @param for generic class type parameter
- */
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <E> Type\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\r\n" +
- " public class X<E> {}\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test004() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type extends RuntimeException\n" +
- " */\n" +
- " public class X<E extends RuntimeException> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <E> Type extends RuntimeException\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\r\n" +
- " public class X<E extends RuntimeException> {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
-
- );
- }
- public void test005() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\r\n" +
- " public class X<T, U, V> {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public class X {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n"
- );
- }
- public void test007() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public class X<E, F> {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<E, F> {}\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test008() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test009() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test010() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <T> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\r\n" +
- " public class X<T, U, V> {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <T> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test013() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test014() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test015() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test016() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test017() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param <U> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test018() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test019() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V> {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test021() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, , V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^\n" +
- "Syntax error, insert \"ClassBody\" to complete JavaScriptUnit\n" +
- "----------\n"
- );
- }
- public void test022() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V extend Exception> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^\n" +
- "Syntax error, insert \"ClassBody\" to complete JavaScriptUnit\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^^^^^^\n" +
- "extend cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /* (non-Javadoc)
- * Test @param for generic method type parameter
- */
- public void test023() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type\n" +
- " */\n" +
- " public <E> void foo() {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " * @param <E> Type\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\r\n" +
- " public <E> void foo() {}\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test024() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type extends RuntimeException\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <E extends RuntimeException> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " * @param <E> Type extends RuntimeException\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\r\n" +
- " public <E extends RuntimeException> void foo(int val, Object obj) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test025() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\r\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test026() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param val int\n" +
- " * @param <E> Type parameter\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n"
- );
- }
- public void test027() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test028() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param xxx int\n" +
- " * @param Obj Object\n" +
- " */\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " * @param xxx int\n" +
- " ^^^\n" +
- "Javadoc: Parameter xxx is not declared\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 8)\n" +
- " * @param Obj Object\n" +
- " ^^^\n" +
- "Javadoc: Parameter Obj is not declared\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test029() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param val int\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param obj Object\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 12)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test030() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param obj Object\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param val int\n" +
- " * @param <T> Type parameter 1\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " * @param <V> Type parameter 3\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\r\n" +
- " * @param <U> Type parameter 2\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\r\n" +
- " * @param <T> Type parameter 1\r\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\r\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\r\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test031() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test032() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param val int\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test033() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param obj Object\n" +
- " * @param <U> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n"
- );
- }
- public void test034() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param val int\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param Object obj\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param val int\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @param Object obj\n" +
- " ^^^^^^\n" +
- "Javadoc: Parameter Object is not declared\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 9)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " * @param val int\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 13)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 13)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test035() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- // TODO (david) recovery seems not to work properly here:
- // we should have type parameters in method declaration.
- public void test036() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <T, , V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T, , V> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n"
- );
- }
- public void test037() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test038() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param < Type\n" +
- " * @param < Type for parameterization\n" +
- " * @param <> Type\n" +
- " * @param <?> Type\n" +
- " * @param <*> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param < Type\n" +
- " ^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param < Type for parameterization\n" +
- " ^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <> Type\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <?> Type\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <*> Type\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<E> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E Type parameter of class X\n" +
- " * @param E> Type\n" +
- " * @param <<E> Type\n" +
- " * @param <<<E> Type\n" +
- " * @param <E>> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E Type parameter of class X\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param E> Type\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <<E> Type\n" +
- " ^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <<<E> Type\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <E>> Type\n" +
- " ^^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<E> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
-
- public void test040() {
- runConformReferenceTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @category\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Test fix for bug 80257: [javadoc] Invalid missing reference warning on @see or @link tags
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=80257"
- */
- public void testBug80257() {
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see G#G(Object)\n" +
- " * @see G#G(Exception)\n" +
- " */\n" +
- "public class X extends G<Exception> {\n" +
- " X(Exception exc) { super(exc);}\n" +
- "}\n" +
- "class G<E extends Exception> {\n" +
- " G(E e) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see G#G(Object)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor G(Object) is undefined\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * @see G#G(Exception)\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: The constructor G(Exception) is undefined\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public class X extends G<Exception> {\n" +
- " ^\n" +
- "The type G is not generic; it cannot be parameterized with arguments <Exception>\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public class X extends G<Exception> {\n" +
- " ^^^^^^^^^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " X(Exception exc) { super(exc);}\n" +
- " ^^^^^^^^^^^\n" +
- "The constructor Object(Exception) is undefined\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 8)\n" +
- " class G<E extends Exception> {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 9)\n" +
- " G(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Test fix for bug 82514: [1.5][javadoc] Problem with generics in javadoc
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=82514"
- */
- public void testBug82514() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class ComparableUtils {\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " {\n" +
- " return 0;\n" +
- " }\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " throws ClassCastException\n" +
- " {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n" +
- "public final class X { \n" +
- " /** Tests the method{@link ComparableUtils#compareTo(Object, Object, Class)} and\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " */\n" +
- " public void testCompareTo() {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 2)\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 13)\n" +
- " /** Tests the method{@link ComparableUtils#compareTo(Object, Object, Class)} and\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object, Class)\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 14)\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" +
- "----------\n"
- );
- }
-
- /**
- * Test fix for bug 83127: [1.5][javadoc][dom] Wrong / strange bindings for references in javadoc to methods with type variables as parameter types
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83127"
- */
- public void testBug83127a() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Test#add(T) \n" +
- " * @see #add(T)\n" +
- " * @see Test#Test(T)\n" +
- " * @see #Test(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Test.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " */\n" +
- "public class Test<T> {\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Test#add(T) \n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see #add(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 4)\n" +
- " * @see Test#Test(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 5)\n" +
- " * @see #Test(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public class Test<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 12)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 13)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "12. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "13. ERROR in Test.java (at line 20)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127b() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Sub#add(T)\n" +
- " * @see Sub#Sub(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Test.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " * -> Do we need to change this as T natually resolved to TypeVariable?\n" +
- " * As compiler raises a warning, it\'s perhaps not a problem now...\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 11)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 12)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 13)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 18)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 19)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 20)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127c() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Sub#add(E) \n" +
- " * @see Sub#Sub(E)\n" +
- " * - warning = \"E cannot be resolved to a type\"\n" +
- " * - method binding = null\n" +
- " * - parameter binding = null\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(E) \n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 9)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 10)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 17)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127d() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(E)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " * - warning = \"E cannot be resolved to a type\"\n" +
- " * - method binding = null\n" +
- " * - parameter binding = null\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\n" +
- " public Unrelated1(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\n" +
- " public boolean add(E e) { return false; }\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 9)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 10)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 17)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127e() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Object)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (Object)\"\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Object\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\n" +
- " public Unrelated1(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\n" +
- " public boolean add(E e) { return false; }\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Object)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) is undefined for the type Unrelated1\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Object) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 10)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 15)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 16)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 17)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127f() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Number)\n" +
- " * @see Unrelated1#Unrelated1(Number)\n" +
- " * - no warning\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Number\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\r\n" +
- " public class Unrelated1<E extends Number> {\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\r\n" +
- " public Unrelated1(E e) {}\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\r\n" +
- " public boolean add(E e) { return false; }\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\r\n" +
- " * @see Unrelated1#add(Number)\r\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) is undefined for the type Unrelated1\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\r\n" +
- " * @see Unrelated1#Unrelated1(Number)\r\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Number) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 8)\r\n" +
- " public class Test<T>{\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 9)\r\n" +
- " Test(T t) {}\r\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 10)\r\n" +
- " public boolean add(T t) {\r\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 14)\r\n" +
- " class Sub<E extends Number> extends Test<E> {\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 14)\r\n" +
- " class Sub<E extends Number> extends Test<E> {\r\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 14)\r\n" +
- " class Sub<E extends Number> extends Test<E> {\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 15)\r\n" +
- " Sub (E e) {super(null);}\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 15)\r\n" +
- " Sub (E e) {super(null);}\r\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 16)\r\n" +
- " public boolean add(E e) {\r\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127g() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Integer)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (Integer)\"\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Integer\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated1.java (at line 1)\n" +
- " public class Unrelated1<E extends Number> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated1.java (at line 2)\n" +
- " public Unrelated1(E e) {}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in Unrelated1.java (at line 3)\n" +
- " public boolean add(E e) { return false; }\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Integer)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Integer) is undefined for the type Unrelated1\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Integer) is undefined\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 9)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 10)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 11)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 16)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 17)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 17)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "11. ERROR in Test.java (at line 18)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127h() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated2.java",
- "public interface Unrelated2<E> {\n" +
- " boolean add(E e);\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated2#add(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Unrelated2.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " * -> Do we need to change this as T natually resolved to TypeVariable?\n" +
- " * As compiler raises a warning, it\'s perhaps not a problem now...\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Unrelated2.java (at line 1)\n" +
- " public interface Unrelated2<E> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Unrelated2.java (at line 2)\n" +
- " boolean add(E e);\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated2#add(T)\n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 10)\n" +
- " public class Test<T>{\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 11)\n" +
- " Test(T t) {}\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 12)\n" +
- " public boolean add(T t) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "6. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in Test.java (at line 17)\n" +
- " class Sub<E extends Number> extends Test<E> {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "8. ERROR in Test.java (at line 18)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in Test.java (at line 18)\n" +
- " Sub (E e) {super(null);}\n" +
- " ^^^^^^^^^^^^\n" +
- "The constructor Object(null) is undefined\n" +
- "----------\n" +
- "10. ERROR in Test.java (at line 19)\n" +
- " public boolean add(E e) {\n" +
- " ^\n" +
- "E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 83393: [1.5][javadoc] reference to vararg method also considers non-array type as correct
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83393"
- */
- public void testBug83393a() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public void foo(int a, int b) {} \n" +
- " public void foo(int a, int... args) {}\n" +
- " public void foo(String... args) {}\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- "}\n",
- "Valid.java",
- "/**\n" +
- " * @see Test#foo(int, int)\n" +
- " * @see Test#foo(int, int[])\n" +
- " * @see Test#foo(int, int...)\n" +
- " * @see Test#foo(String[])\n" +
- " * @see Test#foo(String...)\n" +
- " * @see Test#foo(Exception, boolean[])\n" +
- " * @see Test#foo(Exception, boolean...)\n" +
- " */\n" +
- "public class Valid {}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\r\n" +
- " public void foo(int a, int... args) {}\r\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\r\n" +
- " public void foo(String... args) {}\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\r\n" +
- " public void foo(Exception str, boolean... args) {}\r\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug83393b() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public void foo(int a, int b) {} \n" +
- " public void foo(int a, int... args) {}\n" +
- " public void foo(String... args) {}\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- "}\n",
- "Invalid.java",
- "/**\n" +
- " * @see Test#foo(int)\n" +
- " * @see Test#foo(int, int, int)\n" +
- " * @see Test#foo()\n" +
- " * @see Test#foo(String)\n" +
- " * @see Test#foo(String, String)\n" +
- " * @see Test#foo(Exception)\n" +
- " * @see Test#foo(Exception, boolean)\n" +
- " * @see Test#foo(Exception, boolean, boolean)\n" +
- " */\n" +
- "public class Invalid {}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " public void foo(int a, int... args) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\n" +
- " public void foo(String... args) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Syntax error, varargs are only available if source level is 5.0\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Invalid.java (at line 2)\n" +
- " * @see Test#foo(int)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int) in the type Test is not applicable for the arguments (int)\n" +
- "----------\n" +
- "2. ERROR in Invalid.java (at line 3)\n" +
- " * @see Test#foo(int, int, int)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int) in the type Test is not applicable for the arguments (int, int, int)\n" +
- "----------\n" +
- "3. ERROR in Invalid.java (at line 4)\n" +
- " * @see Test#foo()\n" +
- " ^^^\n" +
- "Javadoc: The method foo(String[]) in the type Test is not applicable for the arguments ()\n" +
- "----------\n" +
- "4. ERROR in Invalid.java (at line 5)\n" +
- " * @see Test#foo(String)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(String[]) in the type Test is not applicable for the arguments (String)\n" +
- "----------\n" +
- "5. ERROR in Invalid.java (at line 6)\n" +
- " * @see Test#foo(String, String)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int) in the type Test is not applicable for the arguments (String, String)\n" +
- "----------\n" +
- "6. ERROR in Invalid.java (at line 7)\n" +
- " * @see Test#foo(Exception)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean[]) in the type Test is not applicable for the arguments (Exception)\n" +
- "----------\n" +
- "7. ERROR in Invalid.java (at line 8)\n" +
- " * @see Test#foo(Exception, boolean)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean[]) in the type Test is not applicable for the arguments (Exception, boolean)\n" +
- "----------\n" +
- "8. ERROR in Invalid.java (at line 9)\n" +
- " * @see Test#foo(Exception, boolean, boolean)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean[]) in the type Test is not applicable for the arguments (Exception, boolean, boolean)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 83804: [1.5][javadoc] Missing Javadoc node for package declaration
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83804"
- */
- public void testBug83804() {
- runNegativeTest(
- new String[] {
- "pack/package-info.java",
- "/**\n" +
- " * Valid javadoc.\n" +
- " * @see Test\n" +
- " * @see Unknown\n" +
- " * @see Test#foo()\n" +
- " * @see Test#unknown()\n" +
- " * @see Test#field\n" +
- " * @see Test#unknown\n" +
- " * @param unexpected\n" +
- " * @throws unexpected\n" +
- " * @return unexpected \n" +
- " * @deprecated accepted by javadoc.exe although javadoc 1.5 spec does not say that's a valid tag\n" +
- " * @other-tags are valid\n" +
- " */\n" +
- "package pack;\n",
- "pack/Test.java",
- "/**\n" +
- " * Invalid javadoc\n" +
- " */\n" +
- "package pack;\n" +
- "public class Test {\n" +
- " public int field;\n" +
- " public void foo() {}\n" +
- "}\n"
- },
- ""
- );
- }
-
- /**
- * Bug 95286: [1.5][javadoc] package-info.java incorrectly flags "Missing comment for public declaration"
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=95286"
- */
- public void testBug95286_Default() {
- this.reportMissingJavadocComments = CompilerOptions.ERROR;
- this.reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
- runConformTest(
- new String[] {
- "test/package-info.java",
- "/**\n" +
- " * Javadoc for all package \n" +
- " */\n" +
- "package test;\n"
- }
- );
- }
- public void testBug95286_Private() {
- this.reportMissingJavadocComments = CompilerOptions.ERROR;
- this.reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/package-info.java",
- "/**\n" +
- " * Javadoc for all package \n" +
- " */\n" +
- "package test;\n"
- }
- );
- }
-
- /**
- * Bug 95521: [1.5][javadoc] validation with @see tag not working for generic method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=95521"
- */
- public void testBug95521() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "\n" +
- "/** Test */\n" +
- "public class X implements I {\n" +
- " /**\n" +
- " * @see test.I#foo(java.lang.Class)\n" +
- " */\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "/** Interface */\n" +
- "interface I {\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param stuffClass \n" +
- " * @return stuff\n" +
- " */\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- "}\n" +
- "/** \n" +
- " * @param <T>\n" +
- " */\n" +
- "class G<T> {}\n"
- },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 8)\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 15)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "10. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "11. ERROR in test\\X.java (at line 19)\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "12. ERROR in test\\X.java (at line 22)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "13. ERROR in test\\X.java (at line 24)\n" +
- " class G<T> {}\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug95521b() {
- runNegativeTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "\n" +
- "/** Test */\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param classT \n" +
- " */\n" +
- " public <T> X(Class<T> classT) {\n" +
- " }\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param classT\n" +
- " * @return classT\n" +
- " */\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " return classT;\n" +
- " }\n" +
- "}\n" +
- "/** Super class */\n" +
- "class Y extends X {\n" +
- " /**\n" +
- " * @see X#X(java.lang.Class)\n" +
- " */\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " super(classT);\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * @see X#foo(java.lang.Class)\n" +
- " */\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in test\\X.java (at line 6)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "2. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in test\\X.java (at line 9)\n" +
- " public <T> X(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in test\\X.java (at line 12)\n" +
- " * @param <T>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "6. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "7. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "8. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "9. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "10. ERROR in test\\X.java (at line 16)\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "11. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "12. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "13. ERROR in test\\X.java (at line 25)\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "14. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "15. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "16. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "17. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "Syntax error, parameterized types are only available if source level is 5.0\n" +
- "----------\n" +
- "18. ERROR in test\\X.java (at line 32)\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 96237: [javadoc] Inner types must be qualified
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237"
- */
- public void testBug96237_Public01() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "comment6/Valid.java",
- "package comment6;\n" +
- "public class Valid {\n" +
- " /**\n" +
- " * @see Valid.Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Valid.Inner}\n" +
- " */\n" +
- "class Sub2 extends Valid { }"
- }
- );
- }
- public void testBug96237_Public02() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6/Invalid.java",
- "package comment6;\n" +
- "public class Invalid {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Inner} \n" +
- " */\n" +
- "class Sub1 extends Invalid { }\n"
- },
- //comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6\\Invalid.java (at line 4)\r\n" +
- " * @see Inner\r\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public03() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6a/def/Test.java",
- "package comment6a.def;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6a/test/Invalid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * See also {@link Inner}\n" +
- " */\n" +
- "public class Invalid extends Test { \n" +
- "}",
- "comment6a/test/Invalid2.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Invalid2 extends Test { \n" +
- "}",
- "comment6a/test/Valid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see comment6a.def.Test.Inner\n" +
- " */\n" +
- "public class Valid extends Test { \n" +
- "}"
- },
- //comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
- //comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
- //comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner => bug ID: 4464323
- "----------\n" +
- "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
- " * See also {@link Inner}\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public04() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6b/Invalid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Inner\n" +
- " */\n" +
- "public class Invalid implements Test { \n" +
- "}",
- "comment6b/Test.java",
- "package comment6b;\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6b/Valid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Valid implements Test { \n" +
- "}"
- },
- //comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
- //comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6b\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public05() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/a/Test.java",
- "package test.a;\n" +
- "/**\n" +
- " * @see Inner\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Test {\n" +
- " class Inner {}\n" +
- "}\n"
- },
- //test\a\Test.java:6: warning - Tag @see: reference not found: Inner
- //test\a\Test.java:6: warning - Tag @see: reference not found: Test.Inner
- "----------\n" +
- "1. ERROR in test\\a\\Test.java (at line 3)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\a\\Test.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public06() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/b/Test.java",
- "package test.b;\n" +
- "/** \n" +
- " * @see Inner.Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- "public class Test {\n" +
- " /** \n" +
- " * @see Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- " public class Inner {\n" +
- " class Level2 {}\n" +
- " }\n" +
- "}\n"
- },
- //test\b\Test.java:6: warning - Tag @see: reference not found: Inner.Level2
- //test\b\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2
- //test\b\Test.java:11: warning - Tag @see: reference not found: Level2
- //test\b\Test.java:11: warning - Tag @see: reference not found: Test.Inner.Level2
- "----------\n" +
- "1. ERROR in test\\b\\Test.java (at line 3)\n" +
- " * @see Inner.Level2\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\b\\Test.java (at line 4)\n" +
- " * @see Test.Inner.Level2\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "3. ERROR in test\\b\\Test.java (at line 8)\n" +
- " * @see Level2\n" +
- " ^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "4. ERROR in test\\b\\Test.java (at line 9)\n" +
- " * @see Test.Inner.Level2\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public07() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/c/Test.java",
- "package test.c;\n" +
- "/**\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * @see Level3\n" +
- " * @see Level2.Level3\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- " public class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //test\c\Test.java:6: warning - Tag @see: reference not found: Inner.Level2.Level3
- //test\c\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Inner.Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
- "----------\n" +
- "1. ERROR in test\\c\\Test.java (at line 3)\n" +
- " * @see Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\c\\Test.java (at line 4)\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "3. ERROR in test\\c\\Test.java (at line 9)\n" +
- " * @see Level3\n" +
- " ^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "4. ERROR in test\\c\\Test.java (at line 10)\n" +
- " * @see Level2.Level3\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "5. ERROR in test\\c\\Test.java (at line 11)\n" +
- " * @see Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "6. ERROR in test\\c\\Test.java (at line 12)\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public08() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/d/Reference.java",
- "package test.d;\n" +
- "class Reference {\n" +
- "}\n",
- "test/d/Test.java",
- "package test.d;\n" +
- "/**\n" +
- " * @see Secondary\n" +
- " * @see Reference\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n" +
- "class Secondary {}"
- },
- "----------\n" +
- "1. ERROR in test\\d\\Test.java (at line 3)\n" +
- " * @see Secondary\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\d\\Test.java (at line 4)\n" +
- " * @see Reference\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private01() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "comment6/Valid.java",
- "package comment6;\n" +
- "public class Valid {\n" +
- " /**\n" +
- " * @see Valid.Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Valid.Inner}\n" +
- " */\n" +
- "class Sub2 extends Valid { }"
- }
- );
- }
- public void testBug96237_Private02() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6/Invalid.java",
- "package comment6;\n" +
- "public class Invalid {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Inner} \n" +
- " */\n" +
- "class Sub1 extends Invalid { }\n"
- },
- //comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
- //comment6\Invalid.java:11: warning - Tag @link: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in comment6\\Invalid.java (at line 9)\n" +
- " * See also {@link Inner} \n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private03() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6a/def/Test.java",
- "package comment6a.def;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6a/test/Invalid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * See also {@link Inner}\n" +
- " */\n" +
- "public class Invalid extends Test { \n" +
- "}",
- "comment6a/test/Invalid2.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Invalid2 extends Test { \n" +
- "}",
- "comment6a/test/Valid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see comment6a.def.Test.Inner\n" +
- " */\n" +
- "public class Valid extends Test { \n" +
- "}"
- },
- //comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
- //comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
- //comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner => bug ID: 4464323
- "----------\n" +
- "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
- " * See also {@link Inner}\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private04() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6b/Invalid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Inner\n" +
- " */\n" +
- "public class Invalid implements Test { \n" +
- "}",
- "comment6b/Test.java",
- "package comment6b;\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6b/Valid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Valid implements Test { \n" +
- "}"
- },
- //comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
- //comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in comment6b\\Test.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private05() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/a/Test.java",
- "package test.a;\n" +
- "/**\n" +
- " * @see Inner\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Test {\n" +
- " class Inner {}\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private06() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/b/Test.java",
- "package test.b;\n" +
- "/** \n" +
- " * @see Inner.Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- "public class Test {\n" +
- " /** \n" +
- " * @see Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- " public class Inner {\n" +
- " class Level2 {}\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private07() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/c/Test.java",
- "package test.c;\n" +
- "/**\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * @see Level3\n" +
- " * @see Level2.Level3\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- " public class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private08() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/d/Reference.java",
- "package test.d;\n" +
- "class Reference {\n" +
- "}\n",
- "test/d/Test.java",
- "package test.d;\n" +
- "/**\n" +
- " * @see Secondary\n" +
- " * @see Reference\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n" +
- "class Secondary {}"
- }
- );
- }
-
- /**
- * Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=101283"
- */
- public void testBug101283a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @param <T> \n" +
- " * @param <F>\n" +
- " */\n" +
- " static class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <T> \n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <F>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug101283b() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @see T Variable \n" +
- " * @see F Variable\n" +
- " */\n" +
- " static class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: F cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug101283c() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @param <T> \n" +
- " * @param <F>\n" +
- " */\n" +
- " class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param <T> \n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <F>\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- public void testBug101283d() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @see T Variable \n" +
- " * @see F Variable\n" +
- " */\n" +
- " class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T, F> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: T cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: F cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^^^^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
- // Verify that ProblemReasons.InheritedNameHidesEnclosingName is not reported as Javadoc error
- public void testBug101283g() {
- reportMissingJavadocTags = CompilerOptions.DISABLED;
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "public class X {\n" +
- " int foo() { return 0; }\n" +
- " class XX extends X2 {\n" +
- " int bar() {\n" +
- " return foo();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class X2 {\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n",
- "test/Y.java",
- "package test;\n" +
- "public class Y {\n" +
- " int foo;\n" +
- " class YY extends Y2 {\n" +
- " /**\n" +
- " * @see #foo\n" +
- " */\n" +
- " int bar() {\n" +
- " return foo;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class Y2 {\n" +
- " int foo;\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 112346: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=112346"
- */
- public void testBug112346() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Test references\n" +
- " * @see Test#field\n" +
- " * @see Test#foo()\n" +
- " */\n" +
- "public class Test<T> {\n" +
- " T field;\n" +
- " T foo() { return null; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 3)\n" +
- " * @see Test#field\n" +
- " ^^^^^\n" +
- "Javadoc: field cannot be resolved or is not a field\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 4)\n" +
- " * @see Test#foo()\n" +
- " ^^^\n" +
- "Javadoc: The method foo() is undefined for the type Test\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 6)\n" +
- " public class Test<T> {\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 7)\n" +
- " T field;\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n" +
- "5. ERROR in Test.java (at line 8)\n" +
- " T foo() { return null; }\n" +
- " ^\n" +
- "T cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 119857: [javadoc] Some inner class references should be flagged as unresolved
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=119857"
- */
- public void testBug119857() {
- runNegativeTest(
- new String[] {
- "DefaultInformationControl.java",
- "public class DefaultInformationControl {\n" +
- " public interface IInformationPresenter {\n" +
- " /**\n" +
- " * Updates the given presentation of the given information and\n" +
- " * thereby may manipulate the information to be displayed. The manipulation\n" +
- " * could be the extraction of textual encoded style information etc. Returns the\n" +
- " * manipulated information.\n" +
- " *\n" +
- " * @param hoverInfo the information to be presented\n" +
- " * @param maxWidth the maximal width in pixels\n" +
- " * @param maxHeight the maximal height in pixels\n" +
- " *\n" +
- " * @return the manipulated information\n" +
- " * @deprecated As of 3.2, replaced by {@link IInformationPresenterExtension#updatePresentation(String, int, int)}\n" +
- " * see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=38528 for details.\n" +
- " */\n" +
- " String updatePresentation(String hoverInfo, int maxWidth, int maxHeight);\n" +
- " }\n" +
- " /**\n" +
- " * An information presenter determines the style presentation\n" +
- " * of information displayed in the default information control.\n" +
- " * The interface can be implemented by clients.\n" +
- " * \n" +
- " * @since 3.2\n" +
- " */\n" +
- " public interface IInformationPresenterExtension {\n" +
- " \n" +
- " /**\n" +
- " * Updates the given presentation of the given information and\n" +
- " * thereby may manipulate the information to be displayed. The manipulation\n" +
- " * could be the extraction of textual encoded style information etc. Returns the\n" +
- " * manipulated information.\n" +
- " * <p>\n" +
- " * Replaces {@link IInformationPresenter#updatePresentation(String, int, int)}\n" +
- " * <em>Make sure that you do not pass in a <code>Display</code></em> until\n" +
- " * https://bugs.eclipse.org/bugs/show_bug.cgi?id=38528 is fixed.\n" +
- " * </p>\n" +
- " *\n" +
- " * @param hoverInfo the information to be presented\n" +
- " * @param maxWidth the maximal width in pixels\n" +
- " * @param maxHeight the maximal height in pixels\n" +
- " *\n" +
- " * @return the manipulated information\n" +
- " */\n" +
- " String updatePresentation(String hoverInfo, int maxWidth, int maxHeight);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in DefaultInformationControl.java (at line 14)\n" +
- " * @deprecated As of 3.2, replaced by {@link IInformationPresenterExtension#updatePresentation(String, int, int)}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in DefaultInformationControl.java (at line 34)\n" +
- " * Replaces {@link IInformationPresenter#updatePresentation(String, int, int)}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Fields() {
- runNegativeTest(
- new String[] {
- "TestFields.java",
- "/**\n" +
- " * @see MyInnerClass#foo\n" +
- " */\n" +
- "public class TestFields {\n" +
- " /**\n" +
- " * @see MyInnerClass#foo\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " Object foo;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestFields.java (at line 6)\n" +
- " * @see MyInnerClass#foo\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Methods() {
- runNegativeTest(
- new String[] {
- "TestMethods.java",
- "/**\n" +
- " * @see MyInnerClass#foo()\n" +
- " * @see MyInnerInterface#foo()\n" +
- " */\n" +
- "public class TestMethods {\n" +
- " /**\n" +
- " * @see MyInnerInterface#foo()\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " public void foo() {}\n" +
- " }\n" +
- " /**\n" +
- " * @see MyInnerClass#foo()\n" +
- " */\n" +
- " public interface MyInnerInterface {\n" +
- " public void foo();\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestMethods.java (at line 7)\n" +
- " * @see MyInnerInterface#foo()\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in TestMethods.java (at line 13)\n" +
- " * @see MyInnerClass#foo()\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Types() {
- runNegativeTest(
- new String[] {
- "TestTypes.java",
- "/**\n" +
- " * @see MyInnerClass\n" +
- " * @see MyInnerInterface\n" +
- " */\n" +
- "public class TestTypes {\n" +
- " /**\n" +
- " * @see MyInnerInterface\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " public void foo() {}\n" +
- " }\n" +
- " /**\n" +
- " * @see MyInnerClass\n" +
- " */\n" +
- " public interface MyInnerInterface {\n" +
- " public void foo();\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestTypes.java (at line 7)\n" +
- " * @see MyInnerInterface\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n" +
- "2. ERROR in TestTypes.java (at line 13)\n" +
- " * @see MyInnerClass\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Private01() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public Inner field;\n" +
- " /** \n" +
- " * @see Inner#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Public01() {
- this.reportMissingJavadocTags = CompilerOptions.DISABLED;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public Inner field;\n" +
- " /** \n" +
- " * @see Inner#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- "}\n"
- },
- //pack/Test.java:13: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in pack\\Test.java (at line 8)\r\n" +
- " * @see Inner#foo()\r\n" +
- " ^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n"
- );
- }
- public void testBug119857_Private02() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //pack\Test2.java:11: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in test\\Test.java (at line 9)\r\n" +
- " * @see Inner1#foo()\r\n" +
- " ^^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug119857_Public02() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Public03() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //pack/Test.java:13: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in pack\\Test.java (at line 9)\n" +
- " * @see Inner1#foo()\n" +
- " ^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 145007: [1.5][javadoc] Generics + Inner Class -> Javadoc "missing @throws" warning
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=145007"
- */
- public void testBug145007() {
- runNegativeTest(
- new String[] {
- "TestClass.java",
- "class TestClass<T> {\n" +
- " static class Test1 {\n" +
- " /**\n" +
- " * A simple method that demonstrates tag problems\n" +
- " * \n" +
- " * @return a string\n" +
- " * @throws MyException\n" +
- " * if something goes wrong\n" +
- " */\n" +
- " public String getString() throws MyException {\n" +
- " throw new MyException();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " static class MyException extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in TestClass.java (at line 1)\r\n" +
- " class TestClass<T> {\r\n" +
- " ^\n" +
- "Syntax error, type parameters are only available if source level is 5.0\n" +
- "----------\n"
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_5.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_5.java
deleted file mode 100644
index bd135cb..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_5.java
+++ /dev/null
@@ -1,2940 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavadocTest_1_5 extends JavadocTest {
-
- String docCommentSupport = CompilerOptions.ENABLED;
- String reportInvalidJavadoc = CompilerOptions.ERROR;
- String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- String reportMissingJavadocTags = CompilerOptions.ERROR;
- String reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- String reportMissingJavadocComments = null;
- String reportMissingJavadocCommentsVisibility = null;
-
- public JavadocTest_1_5(String name) {
- super(name);
- }
-
- public static Class testClass() {
- return JavadocTest_1_5.class;
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_PREFIX = "testBug95521";
-// TESTS_NAMES = new String[] { "testBug83127a" };
-// TESTS_NUMBERS = new int[] { 101283 };
-// TESTS_RANGE = new int[] { 23, -1 };
- }
- public static Test suite() {
- return buildMinimalComplianceTestSuite(testClass(), F_1_5);
- }
-
- protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
- if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
- }
- if (reportMissingJavadocComments != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
- else
- options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportInvalidJavadoc);
- if (reportMissingJavadocCommentsVisibility != null)
- options.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, reportMissingJavadocCommentsVisibility);
- if (reportMissingJavadocTags != null) {
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportMissingJavadocTags);
- if (this.reportMissingJavadocTagsOverriding != null) {
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, reportMissingJavadocTagsOverriding);
- }
- } else {
- options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportInvalidJavadoc);
- }
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
- return options;
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- this.docCommentSupport = CompilerOptions.ENABLED;
- this.reportInvalidJavadoc = CompilerOptions.ERROR;
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- this.reportMissingJavadocTags = CompilerOptions.ERROR;
- this.reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- this.reportMissingJavadocComments = CompilerOptions.IGNORE;
- }
-
- /**
- * Test fix for bug 70891: [1.5][javadoc] Compiler should accept new 1.5 syntax for @param
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=70891">70891</a>
- * These two tests fail for 1.5 source level but should pass for 1.3 or 1.4
- * @see JavadocTest_1_4
- */
- /* (non-Javadoc)
- * Test @param for generic class type parameter
- */
- public void test003() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type\n" +
- " */\n" +
- " public class X<E> {}"
- }
- );
- }
- public void test004() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type extends RuntimeException\n" +
- " */\n" +
- " public class X<E extends RuntimeException> {}"
- }
- );
- }
- public void test005() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- }
- );
- }
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public class X {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- }
- public void test007() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public class X<E, F> {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public class X<E, F> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter F\n" +
- "----------\n"
- );
- }
- public void test008() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: U cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^\n" +
- "Javadoc: V cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void test009() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: Parameter X is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void test010() {
- this.runConformTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <T> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- }
- );
- }
- public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <T> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n"
- );
- }
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter U\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter V\n" +
- "----------\n"
- );
- }
- public void test013() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter U\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter V\n" +
- "----------\n"
- );
- }
- public void test014() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter V\n" +
- "----------\n"
- );
- }
- public void test015() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <U> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n"
- );
- }
- public void test016() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter U\n" +
- "----------\n"
- );
- }
- public void test017() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param <U> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter V\n" +
- "----------\n"
- );
- }
- public void test018() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter U\n" +
- "----------\n"
- );
- }
- public void test019() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: Parameter X is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n"
- );
- }
- public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n"
- );
- }
- public void test021() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, , V> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: V cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^\n" +
- "Javadoc: U cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public class X<T, , V> {}\n" +
- " ^\n" +
- "Syntax error on token \",\", delete this token\n" +
- "----------\n"
- );
- }
- public void test022() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public class X<T, U, V extend Exception> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^^^^^^\n" +
- "Syntax error on token \"extend\", extends expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public class X<T, U, V extend Exception> {}\n" +
- " ^^^^^^\n" +
- "extend cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /* (non-Javadoc)
- * Test @param for generic method type parameter
- */
- public void test023() {
- this.runConformTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type\n" +
- " */\n" +
- " public <E> void foo() {}\n" +
- "}"
- }
- );
- }
- public void test024() {
- this.runConformTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <E> Type extends RuntimeException\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <E extends RuntimeException> void foo(int val, Object obj) {}\n" +
- "}"
- }
- );
- }
- public void test025() {
- this.runConformTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- }
- );
- }
- public void test026() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param val int\n" +
- " * @param <E> Type parameter\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <E> Type parameter\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- }
- public void test027() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E> Type parameter\n" +
- " */\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter F\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " public <E, F> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test028() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param xxx int\n" +
- " * @param Obj Object\n" +
- " */\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: U cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " * @param <V> Type parameter 3\n" +
- " ^\n" +
- "Javadoc: V cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " * @param xxx int\n" +
- " ^^^\n" +
- "Javadoc: Parameter xxx is not declared\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @param Obj Object\n" +
- " ^^^\n" +
- "Javadoc: Parameter Obj is not declared\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 10)\n" +
- " public <T> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test029() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 1\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param val int\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param obj Object\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: Parameter X is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void test030() {
- this.runConformTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Valid type parameter reference\n" +
- " * @param <V> Type parameter 3\n" +
- " * @param obj Object\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param val int\n" +
- " * @param <T> Type parameter 1\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- }
- );
- }
- public void test031() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter U\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter V\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 5)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test032() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <T> Type parameter 3\n" +
- " * @param val int\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter U\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter V\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test033() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param obj Object\n" +
- " * @param <U> Type parameter 3\n" +
- " * @param <V> Type parameter 3\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n"
- );
- }
- public void test034() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param val int\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <X> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param Object obj\n" +
- " * @param <E> Type parameter 2\n" +
- " * @param <U> Type parameter 2\n" +
- " * @param val int\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " * @param <X> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: Parameter X is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " * @param Object obj\n" +
- " ^^^^^^\n" +
- "Javadoc: Parameter Object is not declared\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 9)\n" +
- " * @param <E> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " * @param <U> Type parameter 2\n" +
- " ^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " * @param val int\n" +
- " ^^^\n" +
- "Javadoc: Duplicate tag for parameter\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 13)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- public void test035() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param\n" +
- " * @param <U> Type parameter 1\n" +
- " */\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @param\n" +
- " ^^^^^\n" +
- "Javadoc: Missing parameter name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter T\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter val\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " public <T, U, V> void foo(int val, Object obj) {}\n" +
- " ^^^\n" +
- "Javadoc: Missing tag for parameter obj\n" +
- "----------\n"
- );
- }
- // TODO (david) recovery seems not to work properly here:
- // we should have type parameters in method declaration.
- public void test036() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <T, , V> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> Type parameter 2\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <V> Type parameter 2\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * @param <U> Type parameter 1\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 10)\n" +
- " public <T, , V> void foo(int val, Object obj) {}\n" +
- " ^\n" +
- "Syntax error on token \",\", delete this token\n" +
- "----------\n"
- );
- }
- public void test037() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " /**\n" +
- " * Invalid type parameter reference: compile error\n" +
- " * @param <T> Type parameter 2\n" +
- " * @param <V> Type parameter 2\n" +
- " * @param <U> Type parameter 1\n" +
- " * @param val int\n" +
- " * @param obj Object\n" +
- " */\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " public <T, U, V extends Exceptions> void foo(int val, Object obj) {}\n" +
- " ^^^^^^^^^^\n" +
- "Exceptions cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void test038() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param < Type\n" +
- " * @param < Type for parameterization\n" +
- " * @param <> Type\n" +
- " * @param <?> Type\n" +
- " * @param <*> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param < Type\n" +
- " ^^^^^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param < Type for parameterization\n" +
- " ^^^^^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <> Type\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <?> Type\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <*> Type\n" +
- " ^^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<E> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter E\n" +
- "----------\n"
- );
- }
- public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " /**\n" +
- " * Invalid type parameter reference\n" +
- " * @param <E Type\n" +
- " * @param E> Type\n" +
- " * @param <<E> Type\n" +
- " * @param <<<E> Type\n" +
- " * @param <E>> Type\n" +
- " */\n" +
- " public class X<E> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " * @param <E Type\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " * @param E> Type\n" +
- " ^^\n" +
- "Javadoc: Invalid param tag name\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " * @param <<E> Type\n" +
- " ^^^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 6)\n" +
- " * @param <<<E> Type\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 7)\n" +
- " * @param <E>> Type\n" +
- " ^^^^\n" +
- "Javadoc: Invalid param tag type parameter name\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 9)\n" +
- " public class X<E> {}\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter E\n" +
- "----------\n"
- );
- }
-
- public void test040() {
- runConformReferenceTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @category\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Test fix for bug 80257: [javadoc] Invalid missing reference warning on @see or @link tags
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=80257"
- */
- public void testBug80257() {
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see G#G(Object)\n" +
- " * @see G#G(Exception)\n" +
- " */\n" +
- "public class X extends G<Exception> {\n" +
- " X(Exception exc) { super(exc);}\n" +
- "}\n" +
- "class G<E extends Exception> {\n" +
- " G(E e) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see G#G(Object)\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: The constructor G(Object) is undefined\n" +
- "----------\n"
- );
- }
-
- /**
- * Test fix for bug 82514: [1.5][javadoc] Problem with generics in javadoc
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=82514"
- */
- public void testBug82514() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class ComparableUtils {\n" +
- " public static <T extends Comparable< ? super T>> int compareTo(final Object first, final Object firstPrime, final Class<T> type) throws ClassCastException\n" +
- " {\n" +
- " return 0;\n" +
- " }\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " throws ClassCastException\n" +
- " {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n" +
- "public final class X { \n" +
- " /** Tests the method{@link ComparableUtils#compareTo(Object, Object, Class)} and\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " */\n" +
- " public void testCompareTo() {}\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 6)\n" +
- " public static <X extends Comparable< ? super X>> int compareTo(final X first, final X firstPrime)\n" +
- " ^\n" +
- "The type parameter X is hiding the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " * {@link ComparableUtils#compareTo(Object, Object)}.\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: Bound mismatch: The generic method compareTo(X, X) of type ComparableUtils is not applicable for the arguments (Object, Object). The inferred type Object is not a valid substitute for the bounded parameter <X extends Comparable<? super X>>\n" +
- "----------\n");
- }
-
- /**
- * Test fix for bug 83127: [1.5][javadoc][dom] Wrong / strange bindings for references in javadoc to methods with type variables as parameter types
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83127"
- */
- public void testBug83127a() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Test#add(T) \n" +
- " * @see #add(T)\n" +
- " * @see Test#Test(T)\n" +
- " * @see #Test(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Test.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " */\n" +
- "public class Test<T> {\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Test#add(T) \n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see #add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 4)\n" +
- " * @see Test#Test(T)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The constructor Test(T) is undefined\n" +
- "----------\n" +
- "4. ERROR in Test.java (at line 5)\n" +
- " * @see #Test(T)\n" +
- " ^^^^^^^\n" +
- "Javadoc: The constructor Test(T) is undefined\n" +
- "----------\n"
- );
- }
- public void testBug83127b() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Sub#add(T)\n" +
- " * @see Sub#Sub(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Test.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " * -> Do we need to change this as T natually resolved to TypeVariable?\n" +
- " * As compiler raises a warning, it\'s perhaps not a problem now...\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Test is not applicable for the arguments (T)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(T)\n" +
- " ^^^^^^\n" +
- "Javadoc: The constructor Sub(T) is undefined\n" +
- "----------\n"
- );
- }
- public void testBug83127c() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Test.java",
- "/** \n" +
- " * @see Sub#add(E) \n" +
- " * @see Sub#Sub(E)\n" +
- " * - warning = \"E cannot be resolved to a type\"\n" +
- " * - method binding = null\n" +
- " * - parameter binding = null\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Sub#add(E) \n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Sub#Sub(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127d() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(E)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " * - warning = \"E cannot be resolved to a type\"\n" +
- " * - method binding = null\n" +
- " * - parameter binding = null\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(E)\n" +
- " ^\n" +
- "Javadoc: E cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- public void testBug83127e() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Object)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (Object)\"\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Object\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Object)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Object)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Object)\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Object) is undefined\n" +
- "----------\n"
- );
- }
- public void testBug83127f() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Number)\n" +
- " * @see Unrelated1#Unrelated1(Number)\n" +
- " * - no warning\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Number\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug83127g() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated1.java",
- "public class Unrelated1<E extends Number> {\n" +
- " public Unrelated1(E e) {}\n" +
- " public boolean add(E e) { return false; }\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated1#add(Integer)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (Integer)\"\n" +
- " * - method binding = Unrelated1.add(Number)\n" +
- " * - parameter binding = java.lang.Integer\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated1#add(Integer)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Number) in the type Unrelated1 is not applicable for the arguments (Integer)\n" +
- "----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " * @see Unrelated1#Unrelated1(Integer)\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: The constructor Unrelated1(Integer) is undefined\n" +
- "----------\n"
- );
- }
- public void testBug83127h() {
- reportMissingJavadocTags = CompilerOptions.IGNORE;
- runNegativeTest(
- new String[] {
- "Unrelated2.java",
- "public interface Unrelated2<E> {\n" +
- " boolean add(E e);\n" +
- "}\n",
- "Test.java",
- "/** \n" +
- " * @see Unrelated2#add(T)\n" +
- " * - warning = \"The method add(Object) in the type Test is not applicable for\n" +
- " * the arguments (T)\"\n" +
- " * - method binding = Unrelated2.add(Object)\n" +
- " * - parameter binding = T of A\n" +
- " * -> Do we need to change this as T natually resolved to TypeVariable?\n" +
- " * As compiler raises a warning, it\'s perhaps not a problem now...\n" +
- " */\n" +
- "public class Test<T>{\n" +
- " Test(T t) {}\n" +
- " public boolean add(T t) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Sub<E extends Number> extends Test<E> {\n" +
- " Sub (E e) {super(null);}\n" +
- " public boolean add(E e) {\n" +
- " if (e.doubleValue() > 0)\n" +
- " return false;\n" +
- " return super.add(e);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 2)\n" +
- " * @see Unrelated2#add(T)\n" +
- " ^^^\n" +
- "Javadoc: The method add(Object) in the type Unrelated2 is not applicable for the arguments (T)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 83393: [1.5][javadoc] reference to vararg method also considers non-array type as correct
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83393"
- */
- public void testBug83393a() {
- runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public void foo(int a, int b) {} \n" +
- " public void foo(int a, int... args) {}\n" +
- " public void foo(String... args) {}\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- "}\n",
- "Valid.java",
- "/**\n" +
- " * @see Test#foo(int, int)\n" +
- " * @see Test#foo(int, int[])\n" +
- " * @see Test#foo(int, int...)\n" +
- " * @see Test#foo(String[])\n" +
- " * @see Test#foo(String...)\n" +
- " * @see Test#foo(Exception, boolean[])\n" +
- " * @see Test#foo(Exception, boolean...)\n" +
- " */\n" +
- "public class Valid {}\n"
- }
- );
- }
- public void testBug83393b() {
- runNegativeTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public void foo(int a, int b) {} \n" +
- " public void foo(int a, int... args) {}\n" +
- " public void foo(String... args) {}\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- "}\n",
- "Invalid.java",
- "/**\n" +
- " * @see Test#foo(int)\n" +
- " * @see Test#foo(int, int, int)\n" +
- " * @see Test#foo()\n" +
- " * @see Test#foo(String)\n" +
- " * @see Test#foo(String, String)\n" +
- " * @see Test#foo(Exception)\n" +
- " * @see Test#foo(Exception, boolean)\n" +
- " * @see Test#foo(Exception, boolean, boolean)\n" +
- " */\n" +
- "public class Invalid {}\n"
- },
- "----------\n" +
- "1. ERROR in Invalid.java (at line 2)\n" +
- " * @see Test#foo(int)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int...) in the type Test is not applicable for the arguments (int)\n" +
- "----------\n" +
- "2. ERROR in Invalid.java (at line 3)\n" +
- " * @see Test#foo(int, int, int)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(int, int...) in the type Test is not applicable for the arguments (int, int, int)\n" +
- "----------\n" +
- "3. ERROR in Invalid.java (at line 4)\n" +
- " * @see Test#foo()\n" +
- " ^^^\n" +
- "Javadoc: The method foo(String...) in the type Test is not applicable for the arguments ()\n" +
- "----------\n" +
- "4. ERROR in Invalid.java (at line 5)\n" +
- " * @see Test#foo(String)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(String...) in the type Test is not applicable for the arguments (String)\n" +
- "----------\n" +
- "5. ERROR in Invalid.java (at line 6)\n" +
- " * @see Test#foo(String, String)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(String...) in the type Test is not applicable for the arguments (String, String)\n" +
- "----------\n" +
- "6. ERROR in Invalid.java (at line 7)\n" +
- " * @see Test#foo(Exception)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean...) in the type Test is not applicable for the arguments (Exception)\n" +
- "----------\n" +
- "7. ERROR in Invalid.java (at line 8)\n" +
- " * @see Test#foo(Exception, boolean)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean...) in the type Test is not applicable for the arguments (Exception, boolean)\n" +
- "----------\n" +
- "8. ERROR in Invalid.java (at line 9)\n" +
- " * @see Test#foo(Exception, boolean, boolean)\n" +
- " ^^^\n" +
- "Javadoc: The method foo(Exception, boolean...) in the type Test is not applicable for the arguments (Exception, boolean, boolean)\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 83804: [1.5][javadoc] Missing Javadoc node for package declaration
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83804"
- */
- public void testBug83804() {
- runNegativeTest(
- new String[] {
- "pack/package-info.java",
- "/**\n" +
- " * Valid javadoc.\n" +
- " * @see Test\n" +
- " * @see Unknown\n" +
- " * @see Test#foo()\n" +
- " * @see Test#unknown()\n" +
- " * @see Test#field\n" +
- " * @see Test#unknown\n" +
- " * @param unexpected\n" +
- " * @throws unexpected\n" +
- " * @return unexpected \n" +
- " * @deprecated accepted by javadoc.exe although javadoc 1.5 spec does not say that's a valid tag\n" +
- " * @other-tags are valid\n" +
- " */\n" +
- "package pack;\n",
- "pack/Test.java",
- "/**\n" +
- " * Invalid javadoc\n" +
- " */\n" +
- "package pack;\n" +
- "public class Test {\n" +
- " public int field;\n" +
- " public void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in pack\\package-info.java (at line 4)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in pack\\package-info.java (at line 6)\n" +
- " * @see Test#unknown()\n" +
- " ^^^^^^^\n" +
- "Javadoc: The method unknown() is undefined for the type Test\n" +
- "----------\n" +
- "3. ERROR in pack\\package-info.java (at line 8)\n" +
- " * @see Test#unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: unknown cannot be resolved or is not a field\n" +
- "----------\n" +
- "4. ERROR in pack\\package-info.java (at line 9)\n" +
- " * @param unexpected\n" +
- " ^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "5. ERROR in pack\\package-info.java (at line 10)\n" +
- " * @throws unexpected\n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n" +
- "6. ERROR in pack\\package-info.java (at line 11)\n" +
- " * @return unexpected \n" +
- " ^^^^^^\n" +
- "Javadoc: Unexpected tag\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 95286: [1.5][javadoc] package-info.java incorrectly flags "Missing comment for public declaration"
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=95286"
- */
- public void testBug95286_Default() {
- this.reportMissingJavadocComments = CompilerOptions.ERROR;
- this.reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
- runConformTest(
- new String[] {
- "test/package-info.java",
- "/**\n" +
- " * Javadoc for all package \n" +
- " */\n" +
- "package test;\n"
- }
- );
- }
- public void testBug95286_Private() {
- this.reportMissingJavadocComments = CompilerOptions.ERROR;
- this.reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/package-info.java",
- "/**\n" +
- " * Javadoc for all package \n" +
- " */\n" +
- "package test;\n"
- }
- );
- }
-
- /**
- * Bug 95521: [1.5][javadoc] validation with @see tag not working for generic method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=95521"
- */
- public void testBug95521() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "\n" +
- "/** Test */\n" +
- "public class X implements I {\n" +
- " /**\n" +
- " * @see test.I#foo(java.lang.Class)\n" +
- " */\n" +
- " public <T> G<T> foo(Class<T> stuffClass) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "/** Interface */\n" +
- "interface I {\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param stuffClass \n" +
- " * @return stuff\n" +
- " */\n" +
- " public <T extends Object> G<T> foo(Class<T> stuffClass);\n" +
- "}\n" +
- "/** \n" +
- " * @param <T>\n" +
- " */\n" +
- "class G<T> {}\n"
- }
- );
- }
- public void testBug95521b() {
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "\n" +
- "/** Test */\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param classT \n" +
- " */\n" +
- " public <T> X(Class<T> classT) {\n" +
- " }\n" +
- " /**\n" +
- " * @param <T>\n" +
- " * @param classT\n" +
- " * @return classT\n" +
- " */\n" +
- " public <T> Class<T> foo(Class<T> classT) {\n" +
- " return classT;\n" +
- " }\n" +
- "}\n" +
- "/** Super class */\n" +
- "class Y extends X {\n" +
- " /**\n" +
- " * @see X#X(java.lang.Class)\n" +
- " */\n" +
- " public <T> Y(Class<T> classT) {\n" +
- " super(classT);\n" +
- " }\n" +
- "\n" +
- " /**\n" +
- " * @see X#foo(java.lang.Class)\n" +
- " */\n" +
- " public <T extends Object> Class<T> foo(Class<T> stuffClass) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 96237: [javadoc] Inner types must be qualified
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237"
- */
- public void testBug96237_Public01() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "comment6/Valid.java",
- "package comment6;\n" +
- "public class Valid {\n" +
- " /**\n" +
- " * @see Valid.Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Valid.Inner}\n" +
- " */\n" +
- "class Sub2 extends Valid { }"
- }
- );
- }
- public void testBug96237_Public02() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "comment6/Invalid.java",
- "package comment6;\n" +
- "public class Invalid {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Inner} \n" +
- " */\n" +
- "class Sub1 extends Invalid { }\n"
- }
- );
- }
- public void testBug96237_Public03() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6a/def/Test.java",
- "package comment6a.def;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6a/test/Invalid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * See also {@link Inner}\n" +
- " */\n" +
- "public class Invalid extends Test { \n" +
- "}",
- "comment6a/test/Invalid2.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Invalid2 extends Test { \n" +
- "}",
- "comment6a/test/Valid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see comment6a.def.Test.Inner\n" +
- " */\n" +
- "public class Valid extends Test { \n" +
- "}"
- },
- //comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
- //comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner => bug ID: 4464323
- "----------\n" +
- "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
- " * See also {@link Inner}\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public04() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "comment6b/Invalid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Inner\n" +
- " */\n" +
- "public class Invalid implements Test { \n" +
- "}",
- "comment6b/Test.java",
- "package comment6b;\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6b/Valid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Valid implements Test { \n" +
- "}"
- },
- //comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public05() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/a/Test.java",
- "package test.a;\n" +
- "/**\n" +
- " * @see Inner\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Test {\n" +
- " class Inner {}\n" +
- "}\n"
- },
- //test\a\Test.java:6: warning - Tag @see: reference not found: Inner
- //test\a\Test.java:6: warning - Tag @see: reference not found: Test.Inner
- "----------\n" +
- "1. ERROR in test\\a\\Test.java (at line 3)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\a\\Test.java (at line 4)\n" +
- " * @see Test.Inner\n" +
- " ^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public06() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/b/Test.java",
- "package test.b;\n" +
- "/** \n" +
- " * @see Inner.Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- "public class Test {\n" +
- " /** \n" +
- " * @see Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- " public class Inner {\n" +
- " class Level2 {}\n" +
- " }\n" +
- "}\n"
- },
- //test\b\Test.java:6: warning - Tag @see: reference not found: Inner.Level2
- //test\b\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2
- //test\b\Test.java:11: warning - Tag @see: reference not found: Level2
- //test\b\Test.java:11: warning - Tag @see: reference not found: Test.Inner.Level2
- "----------\n" +
- "1. ERROR in test\\b\\Test.java (at line 3)\n" +
- " * @see Inner.Level2\n" +
- " ^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\b\\Test.java (at line 4)\n" +
- " * @see Test.Inner.Level2\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "3. ERROR in test\\b\\Test.java (at line 8)\n" +
- " * @see Level2\n" +
- " ^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "4. ERROR in test\\b\\Test.java (at line 9)\n" +
- " * @see Test.Inner.Level2\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public07() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/c/Test.java",
- "package test.c;\n" +
- "/**\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * @see Level3\n" +
- " * @see Level2.Level3\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- " public class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //test\c\Test.java:6: warning - Tag @see: reference not found: Inner.Level2.Level3
- //test\c\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Inner.Level2.Level3
- //test\c\Test.java:14: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
- "----------\n" +
- "1. ERROR in test\\c\\Test.java (at line 3)\n" +
- " * @see Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\c\\Test.java (at line 4)\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "3. ERROR in test\\c\\Test.java (at line 9)\n" +
- " * @see Level3\n" +
- " ^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "4. ERROR in test\\c\\Test.java (at line 10)\n" +
- " * @see Level2.Level3\n" +
- " ^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "5. ERROR in test\\c\\Test.java (at line 11)\n" +
- " * @see Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "6. ERROR in test\\c\\Test.java (at line 12)\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Public08() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "test/d/Reference.java",
- "package test.d;\n" +
- "class Reference {\n" +
- "}\n",
- "test/d/Test.java",
- "package test.d;\n" +
- "/**\n" +
- " * @see Secondary\n" +
- " * @see Reference\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n" +
- "class Secondary {}"
- },
- "----------\n" +
- "1. ERROR in test\\d\\Test.java (at line 3)\n" +
- " * @see Secondary\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n" +
- "2. ERROR in test\\d\\Test.java (at line 4)\n" +
- " * @see Reference\n" +
- " ^^^^^^^^^\n" +
- "Javadoc: 'public' visibility for malformed doc comments hides this 'default' reference\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private01() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "comment6/Valid.java",
- "package comment6;\n" +
- "public class Valid {\n" +
- " /**\n" +
- " * @see Valid.Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Valid.Inner}\n" +
- " */\n" +
- "class Sub2 extends Valid { }"
- }
- );
- }
- public void testBug96237_Private02() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6/Invalid.java",
- "package comment6;\n" +
- "public class Invalid {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n" +
- "/**\n" +
- " * See also {@link Inner} \n" +
- " */\n" +
- "class Sub1 extends Invalid { }\n"
- },
- //comment6\Invalid.java:11: warning - Tag @link: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6\\Invalid.java (at line 9)\n" +
- " * See also {@link Inner} \n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private03() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6a/def/Test.java",
- "package comment6a.def;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6a/test/Invalid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * See also {@link Inner}\n" +
- " */\n" +
- "public class Invalid extends Test { \n" +
- "}",
- "comment6a/test/Invalid2.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Invalid2 extends Test { \n" +
- "}",
- "comment6a/test/Valid.java",
- "package comment6a.test;\n" +
- "import comment6a.def.Test;\n" +
- "/**\n" +
- " * @see comment6a.def.Test.Inner\n" +
- " */\n" +
- "public class Valid extends Test { \n" +
- "}"
- },
- //comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
- //comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner => bug ID: 4464323
- "----------\n" +
- "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
- " * See also {@link Inner}\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private04() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runNegativeTest(
- new String[] {
- "comment6b/Invalid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Inner\n" +
- " */\n" +
- "public class Invalid implements Test { \n" +
- "}",
- "comment6b/Test.java",
- "package comment6b;\n" +
- "public interface Test {\n" +
- " /**\n" +
- " * @see Inner\n" +
- " */\n" +
- " public class Inner { }\n" +
- "}\n",
- "comment6b/Valid.java",
- "package comment6b;\n" +
- "\n" +
- "/**\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Valid implements Test { \n" +
- "}"
- },
- //comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
- "----------\n" +
- "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
- " * @see Inner\n" +
- " ^^^^^\n" +
- "Javadoc: Invalid member type qualification\n" +
- "----------\n"
- );
- }
- public void testBug96237_Private05() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/a/Test.java",
- "package test.a;\n" +
- "/**\n" +
- " * @see Inner\n" +
- " * @see Test.Inner\n" +
- " */\n" +
- "public class Test {\n" +
- " class Inner {}\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private06() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/b/Test.java",
- "package test.b;\n" +
- "/** \n" +
- " * @see Inner.Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- "public class Test {\n" +
- " /** \n" +
- " * @see Level2\n" +
- " * @see Test.Inner.Level2\n" +
- " */\n" +
- " public class Inner {\n" +
- " class Level2 {}\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private07() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/c/Test.java",
- "package test.c;\n" +
- "/**\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- "public class Test {\n" +
- " public class Inner {\n" +
- " /**\n" +
- " * @see Level3\n" +
- " * @see Level2.Level3\n" +
- " * @see Inner.Level2.Level3\n" +
- " * @see Test.Inner.Level2.Level3\n" +
- " */\n" +
- " public class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug96237_Private08() {
- this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
- runConformTest(
- new String[] {
- "test/d/Reference.java",
- "package test.d;\n" +
- "class Reference {\n" +
- "}\n",
- "test/d/Test.java",
- "package test.d;\n" +
- "/**\n" +
- " * @see Secondary\n" +
- " * @see Reference\n" +
- " */\n" +
- "public class Test {\n" +
- "}\n" +
- "class Secondary {}"
- }
- );
- }
-
- /**
- * Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=101283"
- */
- public void testBug101283a() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @param <T> \n" +
- " * @param <F>\n" +
- " */\n" +
- " static class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> \n" +
- " ^\n" +
- "Javadoc: Parameter T is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <F>\n" +
- " ^\n" +
- "Javadoc: Parameter F is not declared\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter L\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter R\n" +
- "----------\n"
- );
- }
- public void testBug101283b() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @see T Variable \n" +
- " * @see F Variable\n" +
- " */\n" +
- " static class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter L\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " static class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter R\n" +
- "----------\n"
- );
- }
- public void testBug101283c() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @param <T> \n" +
- " * @param <F>\n" +
- " */\n" +
- " class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @param <T> \n" +
- " ^\n" +
- "Javadoc: Parameter T is not declared\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @param <F>\n" +
- " ^\n" +
- "Javadoc: Parameter F is not declared\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter L\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter R\n" +
- "----------\n"
- );
- }
- public void testBug101283d() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T, F> {\n" +
- "\n" +
- " /**\n" +
- " * @see T Variable \n" +
- " * @see F Variable\n" +
- " */\n" +
- " class Entry<L, R> {\n" +
- " // empty\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " * @see T Variable \n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @see F Variable\n" +
- " ^\n" +
- "Javadoc: Invalid reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter L\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 7)\n" +
- " class Entry<L, R> {\n" +
- " ^\n" +
- "Javadoc: Missing tag for parameter R\n" +
- "----------\n"
- );
- }
- // Verify duplicate test case: bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=102735
- public void testBug101283e() {
- reportMissingJavadocTags = CompilerOptions.DISABLED;
- runNegativeTest(
- new String[] {
- "Test.java",
- "public interface Test<V, R extends Component<?>, C extends\n" +
- "Test<V, R, C>> extends Control<SelectModel<V>, C>\n" +
- "{\n" +
- " public interface ValueRepresentationStrategy<VV, RR extends Component<?>> extends ComponentFactory<VV, RR>\n" +
- " {\n" +
- " /**This value must be equal to the ID of the component returned by the {@link\n" +
- " ComponentFactory#createComponent(V)} method.*/\n" +
- " public String getID(final VV value);\n" +
- " }\n" +
- "}\n" +
- "class Component<T> {}\n" +
- "interface Control<U, V> {}\n" +
- "class SelectModel<V> {}\n" +
- "interface ComponentFactory <U, V> {\n" +
- " public void createComponent(V v);\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Test.java (at line 7)\n" +
- " ComponentFactory#createComponent(V)} method.*/\n" +
- " ^\n" +
- "Javadoc: Cannot make a static reference to the non-static type variable V\n" +
- "----------\n"
- );
- }
- public void testBug101283f() {
- reportMissingJavadocTags = CompilerOptions.DISABLED;
- runConformTest(
- new String[] {
- "Test.java",
- "public interface Test<V, R extends Component<?>, C extends\n" +
- "Test<V, R, C>> extends Control<SelectModel<V>, C>\n" +
- "{\n" +
- " public interface ValueRepresentationStrategy<VV, RR extends Component<?>> extends ComponentFactory<VV, RR>\n" +
- " {\n" +
- " /**This value must be equal to the ID of the component returned by the {@link\n" +
- " ComponentFactory#createComponent(Object)} method.*/\n" +
- " public String getID(final VV value);\n" +
- " }\n" +
- "}\n" +
- "class Component<T> {}\n" +
- "interface Control<U, V> {}\n" +
- "class SelectModel<V> {}\n" +
- "interface ComponentFactory <U, V> {\n" +
- " public void createComponent(V v);\n" +
- "}\n"
- }
- );
- }
- // Verify that ProblemReasons.InheritedNameHidesEnclosingName is not reported as Javadoc error
- public void testBug101283g() {
- reportMissingJavadocTags = CompilerOptions.DISABLED;
- runConformTest(
- new String[] {
- "test/X.java",
- "package test;\n" +
- "public class X {\n" +
- " int foo() { return 0; }\n" +
- " class XX extends X2 {\n" +
- " int bar() {\n" +
- " return foo();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class X2 {\n" +
- " int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- "}\n",
- "test/Y.java",
- "package test;\n" +
- "public class Y {\n" +
- " int foo;\n" +
- " class YY extends Y2 {\n" +
- " /**\n" +
- " * @see #foo\n" +
- " */\n" +
- " int bar() {\n" +
- " return foo;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class Y2 {\n" +
- " int foo;\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 112346: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=112346"
- */
- public void testBug112346() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "Test.java",
- "/**\n" +
- " * Test references\n" +
- " * @see Test#field\n" +
- " * @see Test#foo()\n" +
- " */\n" +
- "public class Test<T> {\n" +
- " T field;\n" +
- " T foo() { return null; }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 119857: [javadoc] Some inner class references should be flagged as unresolved
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=119857"
- */
- public void testBug119857() {
- runConformTest(
- new String[] {
- "DefaultInformationControl.java",
- "public class DefaultInformationControl {\n" +
- " public interface IInformationPresenter {\n" +
- " /**\n" +
- " * Updates the given presentation of the given information and\n" +
- " * thereby may manipulate the information to be displayed. The manipulation\n" +
- " * could be the extraction of textual encoded style information etc. Returns the\n" +
- " * manipulated information.\n" +
- " *\n" +
- " * @param hoverInfo the information to be presented\n" +
- " * @param maxWidth the maximal width in pixels\n" +
- " * @param maxHeight the maximal height in pixels\n" +
- " *\n" +
- " * @return the manipulated information\n" +
- " * @deprecated As of 3.2, replaced by {@link IInformationPresenterExtension#updatePresentation(String, int, int)}\n" +
- " * see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=38528 for details.\n" +
- " */\n" +
- " String updatePresentation(String hoverInfo, int maxWidth, int maxHeight);\n" +
- " }\n" +
- " /**\n" +
- " * An information presenter determines the style presentation\n" +
- " * of information displayed in the default information control.\n" +
- " * The interface can be implemented by clients.\n" +
- " * \n" +
- " * @since 3.2\n" +
- " */\n" +
- " public interface IInformationPresenterExtension {\n" +
- " \n" +
- " /**\n" +
- " * Updates the given presentation of the given information and\n" +
- " * thereby may manipulate the information to be displayed. The manipulation\n" +
- " * could be the extraction of textual encoded style information etc. Returns the\n" +
- " * manipulated information.\n" +
- " * <p>\n" +
- " * Replaces {@link IInformationPresenter#updatePresentation(String, int, int)}\n" +
- " * <em>Make sure that you do not pass in a <code>Display</code></em> until\n" +
- " * https://bugs.eclipse.org/bugs/show_bug.cgi?id=38528 is fixed.\n" +
- " * </p>\n" +
- " *\n" +
- " * @param hoverInfo the information to be presented\n" +
- " * @param maxWidth the maximal width in pixels\n" +
- " * @param maxHeight the maximal height in pixels\n" +
- " *\n" +
- " * @return the manipulated information\n" +
- " */\n" +
- " String updatePresentation(String hoverInfo, int maxWidth, int maxHeight);\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Fields() {
- runConformTest(
- new String[] {
- "TestFields.java",
- "/**\n" +
- " * @see MyInnerClass#foo\n" +
- " */\n" +
- "public class TestFields {\n" +
- " /**\n" +
- " * @see MyInnerClass#foo\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " Object foo;\n" +
- " }\n" +
- "}"
- }
- );
- }
- public void testBug119857_Methods() {
- runConformTest(
- new String[] {
- "TestMethods.java",
- "/**\n" +
- " * @see MyInnerClass#foo()\n" +
- " * @see MyInnerInterface#foo()\n" +
- " */\n" +
- "public class TestMethods {\n" +
- " /**\n" +
- " * @see MyInnerInterface#foo()\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " public void foo() {}\n" +
- " }\n" +
- " /**\n" +
- " * @see MyInnerClass#foo()\n" +
- " */\n" +
- " public interface MyInnerInterface {\n" +
- " public void foo();\n" +
- " }\n" +
- "}"
- }
- );
- }
- public void testBug119857_Types() {
- runConformTest(
- new String[] {
- "TestTypes.java",
- "/**\n" +
- " * @see MyInnerClass\n" +
- " * @see MyInnerInterface\n" +
- " */\n" +
- "public class TestTypes {\n" +
- " /**\n" +
- " * @see MyInnerInterface\n" +
- " */\n" +
- " public class MyInnerClass {\n" +
- " public void foo() {}\n" +
- " }\n" +
- " /**\n" +
- " * @see MyInnerClass\n" +
- " */\n" +
- " public interface MyInnerInterface {\n" +
- " public void foo();\n" +
- " }\n" +
- "}"
- }
- );
- }
- public void testBug119857_Private01() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public Inner field;\n" +
- " /** \n" +
- " * @see Inner#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Public01() {
- this.reportMissingJavadocTags = CompilerOptions.DISABLED;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public Inner field;\n" +
- " /** \n" +
- " * @see Inner#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- "}\n"
- },
- //pack/Test.java:13: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in pack\\Test.java (at line 8)\r\n" +
- " * @see Inner#foo()\r\n" +
- " ^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n"
- );
- }
- public void testBug119857_Private02() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- runConformTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Public02() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runConformTest(
- new String[] {
- "test/Test.java",
- "package test;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug119857_Public03() {
- this.reportMissingJavadocTags = CompilerOptions.IGNORE;
- this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(
- new String[] {
- "pack/Test.java",
- "package pack;\n" +
- "public class Test {\n" +
- " static class Inner1 {\n" +
- " public Object foo() { return null; }\n" +
- " }\n" +
- " public static class Inner2 {\n" +
- " public Inner1 field;\n" +
- " /** \n" +
- " * @see Inner1#foo()\n" +
- " */\n" +
- " public Object foo() {\n" +
- " return field.foo();\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- //pack/Test.java:13: warning - Tag @see: reference not found: Inner1#foo()
- "----------\n" +
- "1. ERROR in pack\\Test.java (at line 9)\n" +
- " * @see Inner1#foo()\n" +
- " ^^^^^^\n" +
- "Javadoc: \'public\' visibility for malformed doc comments hides this \'default\' reference\n" +
- "----------\n"
- );
- }
-
- /**
- * Bug 132430: [1.5][javadoc] Unwanted missing tag warning for overridden method with parameter containing type variable
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=132430"
- */
- public void testBug132430() {
- runConformTest(
- new String[] {
- "A.java",
- "public class A<E> {\n" +
- " /**\n" +
- " * @param object\n" +
- " */\n" +
- " public void aMethod(E object) {}\n" +
- "}",
- "B.java",
- "public class B<E> extends A<E> {\n" +
- " /**\n" +
- " * @see A#aMethod(java.lang.Object)\n" +
- " */\n" +
- " @Override\n" +
- " public void aMethod(E object) {\n" +
- " super.aMethod(object);\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug132430b() {
- runConformTest(
- new String[] {
- "A.java",
- "public class A<E> {\n" +
- " /**\n" +
- " * @param object\n" +
- " */\n" +
- " public void aMethod(E object) {}\n" +
- "}",
- "B.java",
- "public class B<E> extends A<E> {\n" +
- " /**\n" +
- " * @see A#aMethod(java.lang.Object)\n" +
- " */\n" +
- " public void aMethod(E object) {\n" +
- " super.aMethod(object);\n" +
- " }\n" +
- "}\n"
- }
- );
- }
- public void testBug132430c() {
- runConformTest(
- new String[] {
- "A.java",
- "public class A<E> {\n" +
- " /**\n" +
- " * @param object\n" +
- " */\n" +
- " public void aMethod(E object) {}\n" +
- "}",
- "B.java",
- "public class B<E> extends A<E> {\n" +
- " /**\n" +
- " * Empty comment\n" +
- " */\n" +
- " @Override\n" +
- " public void aMethod(E object) {\n" +
- " super.aMethod(object);\n" +
- " }\n" +
- "}\n"
- }
- );
- }
-
- /**
- * Bug 145007: [1.5][javadoc] Generics + Inner Class -> Javadoc "missing @throws" warning
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=145007"
- */
- public void testBug145007() {
- runConformTest(
- new String[] {
- "TestClass.java",
- "class TestClass<T> {\n" +
- " static class Test1 {\n" +
- " /**\n" +
- " * A simple method that demonstrates tag problems\n" +
- " * \n" +
- " * @return a string\n" +
- " * @throws MyException\n" +
- " * if something goes wrong\n" +
- " */\n" +
- " public String getString() throws MyException {\n" +
- " throw new MyException();\n" +
- " }\n" +
- " }\n" +
- " static class MyException extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- "}"
- }
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LocalVariableTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LocalVariableTest.java
deleted file mode 100644
index 99c434f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LocalVariableTest.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-import junit.framework.Test;
-
-public class LocalVariableTest extends AbstractRegressionTest {
-
-public LocalVariableTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public void test001() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " int foo(){\n" +
- " int i;\n" +
- " return 1;\n" +
- " }\n" +
- "}\n",
- });
-}
-public void test002() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " String temp;\n" +
- " try {\n" +
- " return;\n" +
- " }\n" +
- " catch (Exception e){\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-public void test003() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " String temp;\n" +
- " try {\n" +
- " return;\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-public void test004() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int i = 1;\n" +
- " System.out.println(i);\n" +
- " }\n" +
- " X(int j){\n" +
- " }\n" +
- "}\n",
- });
-}
-public void test005() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " int j;\n" +
- " void f1() {\n" +
- " int l;\n" +
- " switch (j) {\n" +
- " case 0 :\n" +
- " l = 10;\n" +
- " l++;\n" + // at least one read usage
- " break;\n" +
- " case 1 :\n" +
- " l = 20;\n" +
- " break;\n" +
- " case 2 :\n" +
- " l = 30;\n" +
- " break;\n" +
- " default :\n" +
- " l = 10;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String args[]) {\n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test006() {
- this.runConformTest(new String[] {
- "p/Truc.java",
- "package p;\n" +
- "public class Truc{\n" +
- " void foo(){\n" +
- " final int i; \n" +
- " i = 1;\n" +
- " if (false) i = 2;\n" +
- " } \n" +
- " public static void main(java.lang.String[] args) {\n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- "}",
- },
- "SUCCESS");
-}
-
-public void test007() {
- this.runConformTest(new String[] {
- "p/A.java",
- "package p;\n" +
- "import p.helper.Y;\n" +
- "class A extends Y {\n" +
- " class Y {\n" +
- " int j = i;// i is a protected member inherited from Y\n" +
- " }\n" +
- "}",
-
- "p/helper/Y.java",
- "package p.helper;\n" +
- "public class Y {\n" +
- " protected int i = 10;\n" +
- " public inner in = new inner();\n" +
- " \n" +
- " protected class inner {\n" +
- " public int f() {\n" +
- " return 20;\n" +
- " }\n" +
- " }\n" +
- "}",
-
- });
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127078
-public void test008() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " class Y {\n" +
- " Y innerY;\n" +
- "\n" +
- " int longMemberName;\n" +
- " }\n" +
- "\n" +
- " static public void main(String args[]) {\n" +
- " Y y;\n" +
- " System.out.println(y.innerY.longMemberName);\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " System.out.println(y.innerY.longMemberName);\n" +
- " ^\n" +
- "The local variable y may not have been initialized\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127078
-public void test009() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " class Y {\n" +
- " int longMemberName;\n" +
- " }\n" +
- "\n" +
- " static public void main(String args[]) {\n" +
- " Y y;\n" +
- " System.out.println(y.longMemberName);\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " System.out.println(y.longMemberName);\n" +
- " ^\n" +
- "The local variable y may not have been initialized\n" +
- "----------\n");
-}
-public void test010() {
- Map options = getCompilerOptions();
- options.put(
- CompilerOptions.OPTION_DocCommentSupport,
- CompilerOptions.ENABLED);
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "/**\n" +
- " * @see Y\n" +
- " */\n" +
- "public class X {\n" +
- "}",
- "p/Y.java",
- "package p;\n" +
- "class Z {\n" +
- "}",
- },
- "",
- null,
- true,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=144426
-public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int x = 2;\n" +
- " if (true) {\n" +
- " int x = 4;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " int x = 4;\n" +
- " ^\n" +
- "Duplicate local variable x\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858
-public void test012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int x = x = 0;\n" +
- " if (true) {\n" +
- " int x = x = 1;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " int x = x = 0;\n" +
- " ^^^^^^^^^\n" +
- "The assignment to variable x has no effect\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " int x = x = 1;\n" +
- " ^\n" +
- "Duplicate local variable x\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " int x = x = 1;\n" +
- " ^^^^^^^^^\n" +
- "The assignment to variable x has no effect\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858 - variation
-//check variable collision resiliance (catch argument)
-// variable collision should not interfere with exception collision
-public void test013() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int x = 2;\n" +
- " try {\n" +
- " \n" +
- " } catch(Exception x) {\n" +
- " } catch(Exception e) {\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " } catch(Exception x) {\n" +
- " ^\n" +
- "Duplicate parameter x\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " } catch(Exception e) {\n" +
- " ^^^^^^^^^\n" +
- "Unreachable catch block for Exception. It is already handled by the catch block for Exception\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858 - variation
-public void test014() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 0;\n" +
- " String x = \"\";\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " String x = \"\";\n" +
- " ^\n" +
- "Duplicate local variable x\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157379
-public void test015() {
- Map options = getCompilerOptions();
- if (this.complianceLevel.equals(COMPLIANCE_1_3)) return;
- options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static boolean test() {\n" +
- " boolean b = false;\n" +
- " assert b = true;\n" +
- " return false;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " test();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS",
- null,
- true,
- null,
- options,
- null);
-}
-public static Class testClass() {
- return LocalVariableTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LookupTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LookupTest.java
deleted file mode 100644
index 959fcc1..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LookupTest.java
+++ /dev/null
@@ -1,2702 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.io.File;
-import java.util.Hashtable;
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-/**
- * Name Lookup within Inner Classes
- * Creation date: (8/2/00 12:04:53 PM)
- * @author Dennis Conway
- */
-public class LookupTest extends AbstractRegressionTest {
-public LookupTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-/**
- * Non-static member class
- */
-public void test001() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private static int value = 23; \n"+
- " class B { \n"+
- " private int value; \n"+
- " B (int val) { \n"+
- " value = (A.value * 2) + val; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String args[]) { \n"+
- " int result = new A().new B(12).value; \n"+
- " int expected = 58; \n"+
- " System.out.println( \n"+
- " result == expected \n"+
- " ? \"SUCCESS\" \n"+
- " : \"FAILED : got \"+result+\" instead of \"+ expected); \n"+
- " } \n"+
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- * Attempt to access non-static field from static inner class (illegal)
- */
-public void test002() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "class A { \n"+
- " private int value; \n"+
- " static class B { \n"+
- " B () { \n"+
- " value = 2; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " B result = new B(); \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. WARNING in p1\\A.java (at line 3)\n" +
- " private int value; \n" +
- " ^^^^^\n" +
- "The field A.value is never read locally\n" +
- "----------\n" +
- "2. ERROR in p1\\A.java (at line 6)\n" +
- " value = 2; \n" +
- " ^^^^^\n" +
- "Cannot make a static reference to the non-static field value\n" +
- "----------\n");
-}
-/**
- * Access static field from static inner class
- */
-public void test003() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private static int value; \n"+
- " static class B { \n"+
- " B () { \n"+
- " value = 2; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " B result = new B(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "}",
- "SUCCESS"
- }
- );
-}
-/**
- *
- */
-public void test004() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private String value; \n"+
- " private A (String strIn) { \n"+
- " value = new B(strIn, \"E\").str; \n"+
- " } \n"+
- " class B { \n"+
- " String str; \n"+
- " private B (String strFromA, String strIn) {\n"+
- " str = strFromA + strIn + new C(\"S\").str;\n"+
- " } \n"+
- " class C { \n"+
- " String str; \n"+
- " private C (String strIn) { \n"+
- " str = strIn + new D(\"S\").str; \n"+
- " } \n"+
- " class D { \n"+
- " String str; \n"+
- " private D (String strIn) { \n"+
- " str = strIn; \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " System.out.println(new A(\"SUCC\").value); \n"+
- " } \n"+
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- *
- */
-public void test005() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private static void doSomething(String showThis) {\n"+
- " System.out.print(showThis); \n"+
- " return; \n"+
- " } \n"+
- " class B { \n"+
- " void aMethod () { \n"+
- " p1.A.doSomething(\"SUCC\"); \n"+
- " A.doSomething(\"ES\"); \n"+
- " doSomething(\"S\"); \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " B foo = new A().new B(); \n"+
- " foo.aMethod(); \n"+
- " } \n"+
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- * jdk1.2.2 reports: No variable sucess defined in nested class p1.A. B.C.
- * jdk1.3 reports: success has private access in p1.A
- */
-public void test006() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "class A { \n"+
- " private static String success = \"SUCCESS\"; \n"+
- " public interface B { \n"+
- " public abstract void aTask(); \n"+
- " class C extends A implements B { \n"+
- " public void aTask() {System.out.println(this.success);}\n"+
- " } \n"+
- " } \n"+
- " public static void main (String[] argv) { \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. WARNING in p1\\A.java (at line 3)\n" +
- " private static String success = \"SUCCESS\"; \n" +
- " ^^^^^^^\n" +
- "The field A.success is never read locally\n" +
- "----------\n" +
- "2. ERROR in p1\\A.java (at line 7)\n" +
- " public void aTask() {System.out.println(this.success);}\n" +
- " ^^^^^^^\n" +
- "The field A.success is not visible\n" +
- "----------\n");
-}
-/**
- * No errors in jdk1.2.2, jdk1.3
- */
-public void test007() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private static String success = \"SUCCESS\"; \n"+
- " public interface B { \n"+
- " public abstract void aTask(); \n"+
- " class C extends A implements B { \n"+
- " public void aTask() {System.out.println(A.success);}\n"+
- " } \n"+
- " } \n"+
- " public static void main (String[] argv) { \n"+
- " } \n"+
- "}"
- }
- );
-}
-/**
- * jdk1.2.2 reports: Undefined variable: A.this
- * jdk1.3 reports: non-static variable this cannot be referenced from a static context
- */
-public void test008() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "class A { \n"+
- " private static String success = \"SUCCESS\"; \n"+
- " public interface B { \n"+
- " public abstract void aTask(); \n"+
- " class C extends A implements B { \n"+
- " public void aTask() {System.out.println(A.this.success);}\n"+
- " } \n"+
- " } \n"+
- " public static void main (String[] argv) { \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. ERROR in p1\\A.java (at line 7)\n" +
- " public void aTask() {System.out.println(A.this.success);}\n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type A is accessible in scope\n" +
- "----------\n" +
- "2. WARNING in p1\\A.java (at line 7)\n" +
- " public void aTask() {System.out.println(A.this.success);}\n" +
- " ^^^^^^^\n" +
- "The static field A.success should be accessed in a static way\n" +
- "----------\n"
- );
-}
-/**
- * jdk1.2.2 reports: No variable success defined in nested class p1.A. B.C
- * jdk1.3 reports: success has private access in p1.A
- */
-public void test009() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "class A { \n"+
- " private String success = \"SUCCESS\"; \n"+
- " public interface B { \n"+
- " public abstract void aTask(); \n"+
- " class C extends A implements B { \n"+
- " public void aTask() {System.out.println(this.success);}\n"+
- " } \n"+
- " } \n"+
- " public static void main (String[] argv) { \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. WARNING in p1\\A.java (at line 3)\n" +
- " private String success = \"SUCCESS\"; \n" +
- " ^^^^^^^\n" +
- "The field A.success is never read locally\n" +
- "----------\n" +
- "2. ERROR in p1\\A.java (at line 7)\n" +
- " public void aTask() {System.out.println(this.success);}\n" +
- " ^^^^^^^\n" +
- "The field A.success is not visible\n" +
- "----------\n");
-}
-/**
- * jdk1.2.2 reports: Can't make a static reference to nonstatic variable success in class p1.A
- * jdk1.3 reports: non-static variable success cannot be referenced from a static context
- */
-public void test010() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "class A { \n"+
- " private String success = \"SUCCESS\"; \n"+
- " public interface B { \n"+
- " public abstract void aTask(); \n"+
- " class C extends A implements B { \n"+
- " public void aTask() {System.out.println(A.success);}\n"+
- " } \n"+
- " } \n"+
- " public static void main (String[] argv) { \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. WARNING in p1\\A.java (at line 3)\n" +
- " private String success = \"SUCCESS\"; \n" +
- " ^^^^^^^\n" +
- "The field A.success is never read locally\n" +
- "----------\n" +
- "2. ERROR in p1\\A.java (at line 7)\n" +
- " public void aTask() {System.out.println(A.success);}\n" +
- " ^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static field A.success\n" +
- "----------\n");
-}
-/**
- *
- */
-public void test011() {
- this.runNegativeTest(
- new String[] {
- /* p2.Aa */
- "p2/Aa.java",
- "package p2; \n"+
- "class Aa extends p1.A{ \n"+
- " class B implements p1.A.C { \n"+
- " } \n"+
- " public static void main (String args[]) { \n"+
- " } \n"+
- "}",
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " public A() { \n"+
- " } \n"+
- " class B implements C { \n"+
- " public int sMethod() { \n"+
- " return 23; \n"+
- " } \n"+
- " } \n"+
- " public interface C { \n"+
- " public abstract int sMethod(); \n"+
- " } \n"+
- "}",
-
- },
- "----------\n" +
- "1. ERROR in p2\\Aa.java (at line 3)\n" +
- " class B implements p1.A.C { \n" +
- " ^\n" +
- "The type Aa.B must implement the inherited abstract method A.C.sMethod()\n" +
- "----------\n"
- );
-}
-/**
- *
- */
-public void test012() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " public interface B { \n"+
- " public abstract void aMethod (int A); \n"+
- " public interface C { \n"+
- " public abstract void anotherMethod(); \n"+
- " } \n"+
- " } \n"+
- " public class aClass implements B, B.C { \n"+
- " public void aMethod (int A) { \n"+
- " } \n"+
- " public void anotherMethod(){} \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- *
- */
-public void test013() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " public interface B { \n"+
- " public abstract void aMethod (int A); \n"+
- " public interface C { \n"+
- " public abstract void anotherMethod(int A);\n"+
- " } \n"+
- " } \n"+
- " public class aClass implements B, B.C { \n"+
- " public void aMethod (int A) { \n"+
- " public void anotherMethod(int A) {}; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. ERROR in p1\\A.java (at line 9)\n" +
- " public class aClass implements B, B.C { \n" +
- " ^^^^^^\n" +
- "The type A.aClass must implement the inherited abstract method A.B.C.anotherMethod(int)\n" +
- "----------\n" +
- "2. ERROR in p1\\A.java (at line 11)\n" +
- " public void anotherMethod(int A) {}; \n" +
- " ^\n" +
- "Syntax error on token \"(\", ; expected\n" +
- "----------\n" +
- "3. ERROR in p1\\A.java (at line 11)\n" +
- " public void anotherMethod(int A) {}; \n" +
- " ^\n" +
- "Syntax error on token \")\", ; expected\n" +
- "----------\n"
- );
-}
-/**
- *
- */
-public void test014() {
- this.runNegativeTest(
- new String[] {
- /* pack1.First */
- "pack1/First.java",
- "package pack1; \n"+
- "public class First { \n"+
- " public static void something() {} \n"+
- " class Inner {} \n"+
- " public static void main (String argv[]) { \n"+
- " First.Inner foo = new First().new Inner(); \n"+
- " foo.something(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. ERROR in pack1\\First.java (at line 7)\n" +
- " foo.something(); \n" +
- " ^^^^^^^^^\n" +
- "The method something() is undefined for the type First.Inner\n" +
- "----------\n"
- );
-}
-/**
- *
- */
-public void test015() {
- this.runConformTest(
- new String[] {
- /* pack1.First */
- "pack1/First.java",
- "package pack1; \n"+
- "public class First { \n"+
- " class Inner { \n"+
- " public void something() {} \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " First.Inner foo = new First().new Inner(); \n"+
- " foo.something(); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- *
- */
-public void test016() {
- this.runConformTest(
- new String[] {
- /* pack1.Outer */
- "pack1/Outer.java",
- "package pack1; \n"+
- "import pack2.*; \n"+
- "public class Outer { \n"+
- " int time, distance; \n"+
- " public Outer() { \n"+
- " } \n"+
- " public Outer(int d) { \n"+
- " distance = d; \n"+
- " } \n"+
- " public void aMethod() { \n"+
- " this.distance *= 2; \n"+
- " return; \n"+
- " } \n"+
- "}",
- /* pack2.OuterTwo */
- "pack2/OuterTwo.java",
- "package pack2; \n"+
- "import pack1.*; \n"+
- "public class OuterTwo extends Outer { \n"+
- " public OuterTwo(int bar) { \n"+
- " Outer A = new Outer(3) { \n"+
- " public void bMethod(){ \n"+
- " final class X { \n"+
- " int price; \n"+
- " public X(int inp) { \n"+
- " price = inp + 32; \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " System.out.println(\"\"); \n"+
- " OuterTwo foo = new OuterTwo(12); \n"+
- " Outer bar = new Outer(8); \n"+
- " } \n"+
- "}"
- }
- );
-}
-/**
- *
- */
-public void test017() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " int value; \n"+
- " public A(B bVal) { \n"+
- " bVal.sval += \"V\"; \n"+
- " } \n"+
- " static class B { \n"+
- " public static String sval; \n"+
- " public void aMethod() { \n"+
- " sval += \"S\"; \n"+
- " A bar = new A(this); \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " B foo = new B(); \n"+
- " foo.sval = \"U\"; \n"+
- " foo.aMethod(); \n"+
- " System.out.println(foo.sval); \n"+
- " } \n"+
- "}"
- },
- "USV"
- );
-}
-/**
- * member class
- */
-public void test018() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private String rating; \n"+
- " public class B { \n"+
- " String rating; \n"+
- " public B (A sth) { \n"+
- " sth.rating = \"m\"; \n"+
- " rating = \"er\"; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " A foo = new A(); \n"+
- " foo.rating = \"o\"; \n"+
- " B bar = foo.new B(foo); \n"+
- " System.out.println(foo.rating + bar.rating);\n"+
- " } \n"+
- "}"
- },
- "mer"
- );
-}
-/**
- * member class
- */
-public void test019() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private String rating; \n"+
- " public void setRating(A sth, String setTo) { \n"+
- " sth.rating = setTo; \n"+
- " return; \n"+
- " } \n"+
- " public class B { \n"+
- " public B (A sth) { \n"+
- " setRating(sth, \"m\"); \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " A foo = new A(); \n"+
- " foo.rating = \"o\"; \n"+
- " B bar = foo.new B(foo); \n"+
- " System.out.println(foo.rating + bar.other); \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. ERROR in p1\\A.java (at line 17)\n" +
- " System.out.println(foo.rating + bar.other); \n" +
- " ^^^^^^^^^\n" +
- "bar.other cannot be resolved or is not a field\n" +
- "----------\n"
- );
-}
-/**
- * member class
- */
-public void test020() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private String rating; \n"+
- " public class B { \n"+
- " public B (A sth) { \n"+
- " sth.rating = \"m\"; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " A foo = new A(); \n"+
- " foo.rating = \"o\"; \n"+
- " B bar = foo.new B(foo); \n"+
- " System.out.println(foo.rating + bar.other); \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. WARNING in p1\\A.java (at line 6)\n" +
- " sth.rating = \"m\"; \n" +
- " ^^^^^^\n" +
- "Write access to enclosing field A.rating is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" +
- "----------\n" +
- "2. ERROR in p1\\A.java (at line 13)\n" +
- " System.out.println(foo.rating + bar.other); \n" +
- " ^^^^^^^^^\n" +
- "bar.other cannot be resolved or is not a field\n" +
- "----------\n"
- );
-}
-/**
- * member class
- */
-public void test021() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " private String rating; \n"+
- " public class B { \n"+
- " public B (A sth) { \n"+
- " sth.rating = \"m\"; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " A foo = new A(); \n"+
- " foo.rating = \"o\"; \n"+
- " B bar = foo.new B(foo); \n"+
- " System.out.println(foo.rating); \n"+
- " } \n"+
- "}"
- }
- );
-}
-/**
- *
- */
-public void test022() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "import p2.*; \n"+
- "public class A { \n"+
- " public int aValue; \n"+
- " public A() {} \n"+
- " public static class C extends A { \n"+
- " public String aString; \n"+
- " public C() { \n"+
- " } \n"+
- " } \n"+
- "}",
- /* p2.B */
- "p2/B.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class B extends A.C { \n"+
- " public B() {} \n"+
- " public class D extends A { \n"+
- " public D() { \n"+
- " C val2 = new C(); \n"+
- " val2.aString = \"s\"; \n"+
- " A val = new A(); \n"+
- " val.aValue = 23; \n"+
- " } \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " D foo = new B().new D(); \n"+
- " } \n"+
- "}"
- }
- );
-}
-/**
- *
- */
-public void test023() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1;\n"+
- "public class A implements B { \n"+
- "} \n"+
- "interface B { \n"+
- " public class A implements B { \n"+
- " public static void main (String argv[]) { \n"+
- " class Ba { \n"+
- " int time; \n"+
- " } \n"+
- " Ba foo = new Ba(); \n"+
- " foo.time = 3; \n"+
- " } \n"+
- " interface C { \n"+
- " } \n"+
- " interface Bb extends C { \n"+
- " } \n"+
- " } \n"+
- "}"
- }
- );
-}
-/**
- *
- */
-public void test024() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " protected static String bleh; \n"+
- " interface B { \n"+
- " public String bleh(); \n"+
- " class C{ \n"+
- " public String bleh() {return \"B\";}\n"+
- " } \n"+
- " } \n"+
- " class C implements B { \n"+
- " public String bleh() {return \"A\";} \n"+
- " } \n"+
- " public static void main(String argv[]) { \n"+
- " C foo = new A().new C(); \n"+
- " } \n"+
- "}"
- }
- );
-}
-/**
- *
- */
-public void test025() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "import p2.*; \n"+
- "public class A { \n"+
- " public static class B { \n"+
- " public static int B; \n"+
- " } \n"+
- " public static void main(String argv[]) {\n"+
- " B foo = new A.B(); \n"+
- " B bar = new B(); \n"+
- " foo.B = 2; \n"+
- " p2.B bbar = new p2.B(); \n"+
- " if (bar.B == 35) { \n"+
- " System.out.println(\"SUCCESS\");\n"+
- " } \n"+
- " else { \n"+
- " System.out.println(bar.B); \n"+
- " } \n"+
- " } \n"+
- "}",
- "p2/B.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class B extends A { \n"+
- " public B() { \n"+
- " A.B bleh = new A.B(); \n"+
- " bleh.B = 35; \n"+
- " } \n"+
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- *
- */
-public void test026() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " public static class B { \n"+
- " protected static int B; \n"+
- " } \n"+
- " public static void main(String argv[]) {\n"+
- " B foo = new A.B(); \n"+
- " B bar = new B(); \n"+
- " B.B = 2; \n"+
- " p2.B bbar = new p2.B(); \n"+
- " if (B.B == 35) { \n"+
- " System.out.println(\"SUCCESS\");\n"+
- " } \n"+
- " else { \n"+
- " System.out.println(B.B); \n"+
- " } \n"+
- " } \n"+
- "}",
- "p2/B.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class B extends A { \n"+
- " public B() { \n"+
- " A.B bleh = new A.B(); \n"+
- " bleh.B = 35; \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. ERROR in p2\\B.java (at line 6)\n" +
- " bleh.B = 35; \n" +
- " ^\n" +
- "The field A.B.B is not visible\n" +
- "----------\n");
-}
-/**
- *
- */
-public void test027() {
- this.runNegativeTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " protected static class B { \n"+
- " public static int B; \n"+
- " } \n"+
- " public static void main(String argv[]) {\n"+
- " B foo = new A.B(); \n"+
- " B bar = new B(); \n"+
- " B.B = 2; \n"+
- " p2.B bbar = new p2.B(); \n"+
- " if (B.B == 35) { \n"+
- " System.out.println(\"SUCCESS\");\n"+
- " } \n"+
- " else { \n"+
- " System.out.println(B.B); \n"+
- " } \n"+
- " } \n"+
- "}",
- "p2/B.java",
- "package p2; \n"+
- "import p1.*; \n"+
- "public class B extends A { \n"+
- " public B() { \n"+
- " A.B bleh = new A.B(); \n"+
- " A.B.B = 35; \n"+
- " } \n"+
- "}"
- },
- "----------\n" +
- "1. ERROR in p2\\B.java (at line 5)\n" +
- " A.B bleh = new A.B(); \n" +
- " ^^^^^^^^^\n" +
- "The constructor A.B() is not visible\n" +
- "----------\n"
- );
-}
-/**
- *
- */
-public void test028() {
- this.runConformTest(
- new String[] {
- /* p1.A */
- "p1/A.java",
- "package p1; \n"+
- "public class A { \n"+
- " static class B { \n"+
- " public static class C { \n"+
- " private static int a; \n"+
- " private int b; \n"+
- " } \n"+
- " } \n"+
- " class D extends B { \n"+
- " int j = p1.A.B.C.a; \n"+
- " } \n"+
- " public static void main (String argv[]) { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "}"
- },
- "SUCCESS"
- );
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=10634
- */
-public void test029() {
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "import p2.Top; \n"+
- "public class X extends Top { \n"+
- " Member field; \n"+
- "} \n",
- "p2/Top.java",
- "package p2; \n"+
- "public class Top { \n"+
- " class Member { \n"+
- " void foo(){} \n"+
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " Member field; \n" +
- " ^^^^^^\n" +
- "The type Member is not visible\n" +
- "----------\n");
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11435
- * 1.3 compiler must accept classfiles without abstract method (target >=1.2)
- */
-public void test030() {
-
- Hashtable target1_2 = new Hashtable();
- target1_2.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
-
- this.runConformTest(
- new String[] {
- "p1/A.java",
- "package p1; \n"+
- "public abstract class A implements I { \n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- "} \n" +
- "interface I { \n" +
- " void foo(); \n" +
- "} \n",
- },
- "SUCCESS", // expected output
- null, // custom classpath
- true, // flush previous output dir content
- null, // special vm args
- target1_2, // custom options
- null/*no custom requestor*/);
-
- this.runConformTest(
- new String[] {
- "p1/C.java",
- "package p1; \n"+
- "public class C { \n" +
- " void bar(A a){ \n" +
- " a.foo(); \n" +
- " } \n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS", // expected output
- null, // custom classpath
- false, // flush previous output dir content
- null, // special vm args
- null, // custom options
- null/*no custom requestor*/);
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - must filter abstract methods when searching concrete methods
- */
-public void test031() {
-
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X extends AbstractY { \n"+
- " public void init() { \n"+
- " super.init(); \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().init(); \n"+
- " } \n"+
- "} \n"+
- "abstract class AbstractY extends AbstractZ implements I { \n"+
- " public void init(int i) { \n"+
- " } \n"+
- "} \n"+
- "abstract class AbstractZ implements I { \n"+
- " public void init() { \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- "} \n"+
- "interface I { \n"+
- " void init(); \n"+
- " void init(int i); \n"+
- "} \n"
- },
- "SUCCESS"); // expected output
-}
-
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=29211
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=29213
- */
-public void test032() {
- this.runNegativeTest(
- new String[] {
- "X.java", //--------------------------------
- "public class X {\n" +
- " public static void main(String[] arguments) {\n" +
- " System.out.println(p.Bar.array[0].length);\n" +
- " System.out.println(p.Bar.array.length);\n" +
- " System.out.println(p.Bar.array[0].foo());\n" +
- " }\n" +
- "}\n",
- "p/Bar.java", //----------------------------
- "package p;\n" +
- "public class Bar {\n" +
- " public static Z[] array;\n" +
- "}\n" +
- "class Z {\n" +
- " public String foo(){ \n" +
- " return \"\";\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(p.Bar.array[0].length);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The type Z is not visible\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " System.out.println(p.Bar.array.length);\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The type Z is not visible\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " System.out.println(p.Bar.array[0].foo());\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The type Z is not visible\n" +
- "----------\n");
-}
-
-// 30805 Abstract non-visible method diagnosis fooled by intermediate declarations
-public void test033() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //==================================
- "package p; \n" +
- "public abstract class X { \n" +
- " abstract void foo(); \n" +
- "} \n",
- "q/Y.java", //==================================
- "package q; \n" +
- "public class Y extends p.X { \n" +
- " void foo(){} \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in q\\Y.java (at line 2)\n" +
- " public class Y extends p.X { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method X.foo(), but cannot override it since it is not visible from Y. Either make the type abstract or make the inherited method visible\n" +
- "----------\n" +
- "2. WARNING in q\\Y.java (at line 3)\n" +
- " void foo(){} \n" +
- " ^^^^^\n" +
- "The method Y.foo() does not override the inherited method from X since it is private to a different package\n" +
- "----------\n");
-}
-
-// 30805 Abstract non-visible method diagnosis fooled by intermediate declarations
-public void test034() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //==================================
- "package p; \n" +
- "public abstract class X { \n" +
- " abstract void foo(); \n" +
- "} \n",
- "q/Y.java", //==================================
- "package q; \n" +
- "public abstract class Y extends p.X { \n" +
- " void foo(){} \n" +
- "} \n" +
- "class Z extends Y { \n" +
- "} \n",
- },
- "----------\n" +
- "1. WARNING in q\\Y.java (at line 3)\n" +
- " void foo(){} \n" +
- " ^^^^^\n" +
- "The method Y.foo() does not override the inherited method from X since it is private to a different package\n" +
- "----------\n" +
- "2. ERROR in q\\Y.java (at line 5)\n" +
- " class Z extends Y { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method X.foo(), but cannot override it since it is not visible from Z. Either make the type abstract or make the inherited method visible\n" +
- "----------\n"
-);
-}
-
-// 30805 Abstract non-visible method diagnosis fooled by intermediate declarations
-public void test035() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //==================================
- "package p; \n" +
- "public abstract class X { \n" +
- " abstract void foo(); \n" +
- " abstract void bar(); \n" +
- "} \n",
- "p/Y.java", //==================================
- "package p; \n" +
- "public abstract class Y extends X { \n" +
- " void foo(){}; \n" +
- "} \n",
- "q/Z.java", //==================================
- "package q; \n" +
- "class Z extends p.Y { \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in q\\Z.java (at line 2)\n" +
- " class Z extends p.Y { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method X.bar(), but cannot override it since it is not visible from Z. Either make the type abstract or make the inherited method visible\n" +
- "----------\n");
-}
-// 30805 Abstract non-visible method diagnosis fooled by intermediate declarations
-public void test036() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //==================================
- "package p; \n" +
- "public abstract class X { \n" +
- " abstract void foo(); \n" +
- " public interface I { \n" +
- " void foo(); \n" +
- " } \n" +
- "} \n",
- "q/Y.java", //==================================
- "package q; \n" +
- "public abstract class Y extends p.X { \n" +
- " void foo(){} \n" +
- "} \n" +
- "class Z extends Y implements p.X.I { \n" +
- "} \n",
- },
- "----------\n" +
- "1. WARNING in q\\Y.java (at line 3)\n" +
- " void foo(){} \n" +
- " ^^^^^\n" +
- "The method Y.foo() does not override the inherited method from X since it is private to a different package\n" +
- "----------\n" +
- "2. ERROR in q\\Y.java (at line 5)\n" +
- " class Z extends Y implements p.X.I { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method X.foo(), but cannot override it since it is not visible from Z. Either make the type abstract or make the inherited method visible\n" +
- "----------\n" + // TODO (philippe) should not have following error due to default abstract?
- "3. ERROR in q\\Y.java (at line 5)\n" +
- " class Z extends Y implements p.X.I { \n" +
- " ^\n" +
- "The inherited method Y.foo() cannot hide the public abstract method in X.I\n" +
- "----------\n");
-}
-// 30805 Abstract non-visible method diagnosis fooled by intermediate declarations
-public void test037() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //==================================
- "package p; \n" +
- "public abstract class X { \n" +
- " abstract void foo(); \n" +
- " void bar(){} \n" +
- "} \n",
- "q/Y.java", //==================================
- "package q; \n" +
- "public abstract class Y extends p.X { \n" +
- " void foo(){} //warn \n" +
- " void bar(){} //warn \n" +
- "} \n" +
- "class Z extends Y { \n" +
- " void bar(){} //nowarn \n" +
- "} \n",
- },
- "----------\n" +
- "1. WARNING in q\\Y.java (at line 3)\n" +
- " void foo(){} //warn \n" +
- " ^^^^^\n" +
- "The method Y.foo() does not override the inherited method from X since it is private to a different package\n" +
- "----------\n" +
- "2. WARNING in q\\Y.java (at line 4)\n" +
- " void bar(){} //warn \n" +
- " ^^^^^\n" +
- "The method Y.bar() does not override the inherited method from X since it is private to a different package\n" +
- "----------\n" +
- "3. ERROR in q\\Y.java (at line 6)\n" +
- " class Z extends Y { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method X.foo(), but cannot override it since it is not visible from Z. Either make the type abstract or make the inherited method visible\n" +
- "----------\n");
-}
-// 30805 Abstract non-visible method diagnosis fooled by intermediate declarations
-public void test038() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //==================================
- "package p; \n" +
- "public abstract class X { \n" +
- " abstract void foo(); \n" +
- "} \n",
- "q/Y.java", //==================================
- "package q; \n" +
- "public abstract class Y extends p.X { \n" +
- " void foo(){} //warn \n" +
- "} \n" +
- "class Z extends Y { \n" +
- " void foo(){} //error \n" +
- "} \n",
- },
- "----------\n" +
- "1. WARNING in q\\Y.java (at line 3)\n" +
- " void foo(){} //warn \n" +
- " ^^^^^\n" +
- "The method Y.foo() does not override the inherited method from X since it is private to a different package\n" +
- "----------\n" +
- "2. ERROR in q\\Y.java (at line 5)\n" +
- " class Z extends Y { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method X.foo(), but cannot override it since it is not visible from Z. Either make the type abstract or make the inherited method visible\n" +
- "----------\n");
-}
-
-// 31198 - regression after 30805 - Abstract non-visible method diagnosis fooled by intermediate declarations
-public void test039() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //==================================
- "package p; \n" +
- "public abstract class X { \n" +
- " abstract void foo(); \n" + // should not complain about this one in Z, since it has a visible implementation
- " abstract void bar(); \n" +
- "} \n",
- "p/Y.java", //==================================
- "package p; \n" +
- "public abstract class Y extends X { \n" +
- " public void foo(){}; \n" +
- "} \n",
- "q/Z.java", //==================================
- "package q; \n" +
- "class Z extends p.Y { \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in q\\Z.java (at line 2)\n" +
- " class Z extends p.Y { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method X.bar(), but cannot override it since it is not visible from Z. Either make the type abstract or make the inherited method visible\n" +
- "----------\n");
-}
-
-/*
- * 31398 - non-visible abstract method fooling method verification - should not complain about foo() or bar()
- */
-public void test040() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //================================
- "package p; \n" +
- "public class X extends q.Y.Member { \n" +
- " void baz(){} \n" + // doesn't hide Y.baz()
- "} \n",
- "q/Y.java", //================================
- "package q; \n" +
- "public abstract class Y { \n" +
- " abstract void foo(); \n" +
- " abstract void bar(); \n" +
- " abstract void baz(); \n" +
- " public static abstract class Member extends Y { \n" +
- " public void foo() {} \n" +
- " void bar(){} \n" +
- " } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " public class X extends q.Y.Member { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method Y.baz(), but cannot override it since it is not visible from X. Either make the type abstract or make the inherited method visible\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 3)\n" +
- " void baz(){} \n" +
- " ^^^^^\n" +
- "The method X.baz() does not override the inherited method from Y since it is private to a different package\n" +
- "----------\n");
-}
-
-/*
- * 31450 - non-visible abstract method fooling method verification - should not complain about foo()
- */
-public void test041() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //================================
- "package p; \n" +
- "public class X extends q.Y.Member { \n" +
- " public void foo() {} \n" +
- " public static class M extends X {} \n" +
- "} \n",
- "q/Y.java", //================================
- "package q; \n" +
- "public abstract class Y { \n" +
- " abstract void foo(); \n" +
- " abstract void bar(); \n" +
- " public static abstract class Member extends Y { \n" +
- " protected abstract void foo(); \n" + // takes precedence over inherited abstract Y.foo()
- " } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " public class X extends q.Y.Member { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method Y.bar(), but cannot override it since it is not visible from X. Either make the type abstract or make the inherited method visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 4)\n" +
- " public static class M extends X {} \n" +
- " ^\n" +
- "This class must implement the inherited abstract method Y.bar(), but cannot override it since it is not visible from M. Either make the type abstract or make the inherited method visible\n" +
- "----------\n");
-}
-
-/*
- * 31450 - non-visible abstract method fooling method verification - should not complain about foo()
- */
-public void test042() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //================================
- "package p; \n" +
- "public class X extends q.Y.Member { \n" +
- " public void foo() {} \n" +
- " public static class M extends X {} \n" +
- "} \n",
- "q/Y.java", //================================
- "package q; \n" +
- "public abstract class Y { \n" +
- " abstract void foo(); \n" +
- " abstract void bar(); \n" +
- " public static abstract class Member extends Y { \n" +
- " void foo(){} \n" +
- " } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " public class X extends q.Y.Member { \n" +
- " ^\n" +
- "This class must implement the inherited abstract method Y.bar(), but cannot override it since it is not visible from X. Either make the type abstract or make the inherited method visible\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 3)\n" +
- " public void foo() {} \n" +
- " ^^^^^\n" +
- "The method X.foo() does not override the inherited method from Y.Member since it is private to a different package\n" +
- "----------\n" +
- "3. ERROR in p\\X.java (at line 4)\n" +
- " public static class M extends X {} \n" +
- " ^\n" +
- "This class must implement the inherited abstract method Y.bar(), but cannot override it since it is not visible from M. Either make the type abstract or make the inherited method visible\n" +
- "----------\n");
-}
-
-public void test043() {
- this.runConformTest(
- new String[] {
- "X.java", //================================
- "public class X {\n" +
- " public interface Copyable extends Cloneable {\n" +
- " public Object clone() throws CloneNotSupportedException;\n" +
- " }\n" +
- "\n" +
- " public interface TestIf extends Copyable {\n" +
- " }\n" +
- "\n" +
- " public static class ClassA implements Copyable {\n" +
- " public Object clone() throws CloneNotSupportedException {\n" +
- " return super.clone();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static class ClassB implements TestIf {\n" +
- " public Object clone() throws CloneNotSupportedException {\n" +
- " return super.clone();\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Copyable o1 = new ClassA();\n" +
- " ClassB o2 = new ClassB();\n" +
- " TestIf o3 = o2;\n" +
- " Object clonedObject;\n" +
- " clonedObject = o1.clone();\n" +
- " clonedObject = o2.clone();\n" +
- " clonedObject = o3.clone();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-/*
- * 62639 - check that missing member type is not noticed if no direct connection with compiled type
- */
-public void test044() {
- this.runConformTest(
- new String[] {
- "p/Dumbo.java",
- "package p;\n" +
- "public class Dumbo {\n" +
- " public class Clyde { }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
- // delete binary file Dumbo$Clyde (i.e. simulate removing it from classpath for subsequent compile)
- Util.delete(new File(OUTPUT_DIR, "p" + File.separator + "Dumbo$Clyde.class"));
-
- this.runConformTest(
- new String[] {
- "q/Main.java",
- "package q;\n" +
- "public class Main extends p.Dumbo {\n" +
- " public static void main(String[] args) {\n" +
- " p.Dumbo d;\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS",
- null,
- false,
- null);
-}
-/*
- * ensure that can still found binary member types at depth >=2 (enclosing name Dumbo$Clyde $ Fred)
- */
-public void test045() {
- this.runConformTest(
- new String[] {
- "p/Dumbo.java",
- "package p;\n" +
- "public class Dumbo {\n" +
- " public class Clyde {\n" +
- " public class Fred {\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-
- this.runConformTest(
- new String[] {
- "q/Main.java",
- "package q;\n" +
- "public class Main extends p.Dumbo {\n" +
- " public static void main(String[] args) {\n" +
- " p.Dumbo.Clyde.Fred f;\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS",
- null,
- false,
- null);
-}
-public void test046() {
- this.runNegativeTest(
- new String[] {
- "X.java", //================================
- "public class X {\n" +
- " private XY foo(XY t) {\n" +
- " System.out.println(t);\n" +
- " return t;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new X() {\n" +
- " void run() {\n" +
- " foo(new XY());\n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- "}\n" +
- "class XY {\n" +
- " public String toString() {\n" +
- " return \"SUCCESS\";\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " foo(new XY());\n" +
- " ^^^\n" +
- "Cannot make a static reference to the non-static method foo(XY) from the type X\n" +
- "----------\n");
-}
-public void test047() {
- this.runConformTest(
- new String[] {
- "X.java", //================================
- "public class X extends SuperTest\n" +
- "{\n" +
- " public X()\n" +
- " {\n" +
- " super();\n" +
- " }\n" +
- " \n" +
- " static void print(Object obj)\n" +
- " {\n" +
- " System.out.println(\"Object:\" + obj.toString());\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " print(\"Hello world\");\n" +
- " }\n" +
- "}\n" +
- "class SuperTest\n" +
- "{\n" +
- " SuperTest(){};\n" +
- " static void print(String s)\n" +
- " {\n" +
- " System.out.println(\"String: \" + s);\n" +
- " }\n" +
- "}\n" },
- "String: Hello world");
-}
-// 76682 - ClassCastException in qualified name computeConversion
-public void test049() {
- this.runNegativeTest(
- new String[] {
- "X.java", //---------------------------
- "public class X\n" +
- "{\n" +
- " private String foo() {\n" +
- " return \"Started \" + java.text.DateFormat.format(new java.util.Date());\n" +
- " }\n" +
- "}\n" ,
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " return \"Started \" + java.text.DateFormat.format(new java.util.Date());\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static method format(Date) from the type DateFormat\n" +
- "----------\n");
-}
-public void test050() {
- this.runConformTest(
- new String[] {
- "X.java", //---------------------------
- "public class X {\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " X.Y.Z.foo();\n" +
- " }\n" +
- " static class Y {\n" +
- " static class Z {\n" +
- " static void foo() {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-
-public void test051() {
- this.runNegativeTest(
- new String[] {
- "X.java", //---------------------------
- "public class X {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " args.finalize();\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " args.finalize();\n" +
- " ^^^^^^^^\n" +
- "The method finalize() from the type Object is not visible\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87463
-public void test052() {
- this.runConformTest(
- new String[] {
- "X.java", //---------------------------
- "public class X {\n" +
- " public void test() {\n" +
- " class C {\n" +
- " public C() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
- " }\n" +
- " int n = 0;\n" +
- " switch (n) {\n" +
- " case 0 :\n" +
- " if (true) {\n" +
- " C c2 = new C();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87463 - variation
-public void test053() {
- this.runConformTest(
- new String[] {
- "X.java", //---------------------------
- "public class X {\n" +
- " public void test() {\n" +
- " int l = 1;\n" +
- " switch(l) {\n" +
- " case 1: \n" +
- " class C {\n" +
- " public C() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " System.out.println(\"hello\");\n" +
- " }\n" +
- " }\n" +
- " int n = 0;\n" +
- " switch (n) {\n" +
- " case 0 :\n" +
- " if (true) {\n" +
- " C c2 = new C();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93486
-public void test054() {
- this.runConformTest(
- new String[] {
- "X.java", //---------------------------
- "import java.util.LinkedHashMap;\n" +
- "import java.util.Map.Entry;\n" +
- "\n" +
- "public class X {\n" +
- " \n" +
- " private LinkedHashMap fCache;\n" +
- " \n" +
- " public X(final int cacheSize) {\n" +
- " // start with 100 elements but be able to grow until cacheSize\n" +
- " fCache= new LinkedHashMap(100, 0.75f, true) {\n" +
- " /** This class is not intended to be serialized. */\n" +
- " private static final long serialVersionUID= 1L;\n" +
- " protected boolean removeEldestEntry(Entry eldest) {\n" +
- " return size() > cacheSize;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n",
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106140
-public void test055() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "import p.*;\n" +
- "public class A {\n" +
- " public void errors() {\n" +
- " B b = new B();\n" +
- " String s1 = b.str;\n" +
- " String s2 = B.str;\n" +
- " }\n" +
- "}\n",
- "p/B.java",
- "package p;\n" +
- "class B {\n" +
- " public static String str;\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in A.java (at line 4)\r\n" +
- " B b = new B();\r\n" +
- " ^\n" +
- "The type B is not visible\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 4)\r\n" +
- " B b = new B();\r\n" +
- " ^\n" +
- "The type B is not visible\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 6)\r\n" +
- " String s2 = B.str;\r\n" +
- " ^\n" +
- "The type B is not visible\n" +
- "----------\n"
- );
-}
-// final method in static inner class still found in extending classes
-public void test056() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " I x = new Z();\n" +
- " x.foo();\n" +
- " }\n" +
- " static interface I {\n" +
- " Y foo();\n" +
- " }\n" +
- " static class Y {\n" +
- " public final Y foo() { \n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return null; \n" +
- " }\n" +
- " }\n" +
- " static class Z extends Y implements I {\n" +
- " // empty\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-// unresolved type does not fool methods signature comparison
-public void test057() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.awt.*;\n" +
- "public class X {\n" +
- " public void foo(Window w) {\n" +
- " // empty\n" +
- " }\n" +
- " public void foo(Applet a) {\n" +
- " // empty\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " public void foo(Applet a) {\n" +
- " ^^^^^^\n" +
- "Applet cannot be resolved to a type\n" +
- "----------\n"
- );
-}
-public void test058() {
- this.runConformTest(
- new String[] {
- "p/X.java", // =================
- "package p;\n" +
- "\n" +
- "import p.q.Z;\n" +
- "public class X { \n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(Z.z);\n" +
- " }\n" +
- "}", // =================
- "p/q/Z.java", // =================
- "package p.q;\n" +
- "\n" +
- "public class Z extends Y implements I { \n" +
- "}\n" +
- "class Y {\n" +
- " protected static int z = 1;\n" +
- "}\n" +
- "interface I {\n" +
- " int z = 0;\n" +
- "}", // =================
- },
- "0");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=132813
-public void test059() {
- this.runNegativeTest(
- new String[] {
- "X.java", // =================
- "public class X {\n" +
- " \n" +
- " void aa(int i) {\n" +
- " }\n" +
- " void aa(long l) {\n" +
- " }\n" +
- " Zork bb() {\n" +
- " }\n" +
- " void cc() {\n" +
- " this.bb();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Zork bb() {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " this.bb();\n" +
- " ^^\n" +
- "The method bb() is undefined for the type X\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=132813 - variation
-public void test060() {
- this.runNegativeTest(
- new String[] {
- "X.java", // =================
- "public class X {\n" +
- " \n" +
- " void aa(int i) {\n" +
- " }\n" +
- " Zork aa(long l) {\n" +
- " }\n" +
- " Zork bb() {\n" +
- " }\n" +
- " void cc() {\n" +
- " this.bb();\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Zork aa(long l) {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " Zork bb() {\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " this.bb();\n" +
- " ^^\n" +
- "The method bb() is undefined for the type X\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=134839
-public void test061() {
- Map options = this.getCompilerOptions();
- if (CompilerOptions.VERSION_1_3.equals(options.get(CompilerOptions.OPTION_Compliance))) {
- // ensure target is 1.1 for having default abstract methods involved
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
- }
- this.runConformTest(
- new String[] {
- "X.java", // =================
- "interface MyInterface {\n" +
- " public void writeToStream();\n" +
- " public void readFromStream();\n" +
- "}\n" +
- "\n" +
- "public abstract class X implements MyInterface {\n" +
- " public void b() {\n" +
- " }\n" +
- " public void a() {\n" +
- " writeTypeToStream();\n" +
- " }\n" +
- " private void writeTypeToStream() {\n" +
- " }\n" +
- "}\n", // =================
- },
- "",
- null,
- true,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=134839
-public void test062() {
- Map options = this.getCompilerOptions();
- if (CompilerOptions.VERSION_1_3.equals(options.get(CompilerOptions.OPTION_Compliance))) {
- // ensure target is 1.1 for having default abstract methods involved
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
- }
- this.runConformTest(
- new String[] {
- "X.java", // =================
- "interface MyInterface {\n" +
- " public void writeToStream();\n" +
- " public void readFromStream();\n" +
- "}\n" +
- "\n" +
- "public abstract class X implements MyInterface {\n" +
- " public void b() {\n" +
- " }\n" +
- " public void a() {\n" +
- " writeTypeToStream();\n" +
- " }\n" +
- " private void writeTypeToStream() {\n" +
- " }\n" +
- "}\n", // =================
- },
- "",
- null,
- true,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=135292
-public void test063() {
- this.runNegativeTest(
- new String[] {
- "X.java", // =================
- "class 56 {\n" +
- "\n" +
- " private static class B {\n" +
- " public static final String F = \"\";\n" +
- " }\n" +
- "\n" +
- " private static class C {\n" +
- " }\n" +
- "\n" +
- " public void foo() {\n" +
- " System.out.println(B.F);\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " class 56 {\n" +
- " ^^\n" +
- "Syntax error on token \"56\", Identifier expected\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " private static class B {\n" +
- " ^\n" +
- "Illegal modifier for the class B; only public, abstract & final are permitted\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " private static class C {\n" +
- " ^\n" +
- "Illegal modifier for the class C; only public, abstract & final are permitted\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error on token \"}\", delete this token\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 11)\n" +
- " System.out.println(B.F);\n" +
- " ^^^\n" +
- "The type B is not visible\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137744
-public void test064() {
- Map options = this.getCompilerOptions();
- if (CompilerOptions.VERSION_1_3.equals(options.get(CompilerOptions.OPTION_Compliance))) {
- // ensure target is 1.1 for having default abstract methods involved
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
- }
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " B a = new C();\n" +
- " \n" +
- " a.hasKursAt(1);\n" +
- " }\n" +
- "\n" +
- "}",
- "A.java",
- "abstract public class A implements IA0 {\n" +
- " int t;\n" +
- " public A() {\n" +
- " }\n" +
- "}",
- "B.java",
- "abstract public class B extends A implements IA3, IA1 {\n" +
- " int a;\n" +
- " public B() {\n" +
- " }\n" +
- " public void test() { \n" +
- " }\n" +
- "}",
- "C.java",
- "public class C extends B implements IA4, IA2{\n" +
- " int c;\n" +
- " public C() {\n" +
- " }\n" +
- " public boolean hasKursAt(int zeitpunkt) {\n" +
- " return false;\n" +
- " }\n" +
- "}",
- "IA0.java",
- "public interface IA0 {\n" +
- " public void test();\n" +
- "}",
- "IA1.java",
- "public interface IA1 extends IA0 {\n" +
- " public boolean hasKursAt(int zeitpunkt);\n" +
- "}",
- "IA2.java",
- "public interface IA2 extends IA0 {\n" +
- " public boolean hasKursAt(int zeitpunkt);\n" +
- "}",
- "IA3.java",
- "public interface IA3 extends IA2 {\n" +
- "}",
- "IA4.java",
- "public interface IA4 extends IA3 {\n" +
- "}"
- },
- "SUCCESS",
- null,
- true,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=135323
-public void test065() {
- this.runConformTest(
- new String[] {
- "com/internap/other/ScopeExample.java",//===================
- "package com.internap.other;\n" +
- "import com.internap.*;\n" +
- "public class ScopeExample {\n" +
- " private static final String LOGGER = \"SUCCESS\";\n" +
- " public static void main(String[] args) {\n" +
- " PublicAccessSubclass sub = new PublicAccessSubclass() {\n" +
- " public void implementMe() {\n" +
- " System.out.println(LOGGER);\n" +
- " }\n" +
- " };\n" +
- " sub.implementMe();\n" +
- " }\n" +
- "}",
- "com/internap/PublicAccessSubclass.java",//===================
- "package com.internap;\n" +
- "public abstract class PublicAccessSubclass extends DefaultAccessSuperclass {\n" +
- " public abstract void implementMe(); \n" +
- "}",
- "com/internap/DefaultAccessSuperclass.java",//===================
- "package com.internap;\n" +
- "class DefaultAccessSuperclass {\n" +
- " private static final String LOGGER = \"FAILED\";\n" +
- "}",
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=135323 - variation
-public void test066() {
- this.runConformTest(
- new String[] {
- "com/internap/other/ScopeExample.java",//===================
- "package com.internap.other;\n" +
- "import com.internap.*;\n" +
- "public class ScopeExample {\n" +
- " private static final String LOGGER() { return \"SUCCESS\"; }\n" +
- " public static void main(String[] args) {\n" +
- " PublicAccessSubclass sub = new PublicAccessSubclass() {\n" +
- " public void implementMe() {\n" +
- " System.out.println(LOGGER());\n" +
- " }\n" +
- " };\n" +
- " sub.implementMe();\n" +
- " }\n" +
- "}",
- "com/internap/PublicAccessSubclass.java",//===================
- "package com.internap;\n" +
- "public abstract class PublicAccessSubclass extends DefaultAccessSuperclass {\n" +
- " public abstract void implementMe(); \n" +
- "}",
- "com/internap/DefaultAccessSuperclass.java",//===================
- "package com.internap;\n" +
- "class DefaultAccessSuperclass {\n" +
- " private static final String LOGGER() { return \"FAILED\"; }\n" +
- "}",
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=135323 - variation
-public void test067() {
- Map options = this.getCompilerOptions();
- if (CompilerOptions.VERSION_1_3.equals(options.get(CompilerOptions.OPTION_Compliance))) {
- this.runNegativeTest(
- new String[] {
- "com/internap/other/ScopeExample.java",//===================
- "package com.internap.other;\n" +
- "import com.internap.*;\n" +
- "public class ScopeExample {\n" +
- " private static final String LOGGER = \"FAILED\";\n" +
- " public static void main(String[] args) {\n" +
- " PublicAccessSubclass sub = new PublicAccessSubclass() {\n" +
- " public void implementMe() {\n" +
- " System.out.println(LOGGER);\n" +
- " }\n" +
- " };\n" +
- " sub.implementMe();\n" +
- " }\n" +
- "}",
- "com/internap/PublicAccessSubclass.java",//===================
- "package com.internap;\n" +
- "public abstract class PublicAccessSubclass extends DefaultAccessSuperclass {\n" +
- " public abstract void implementMe(); \n" +
- "}",
- "com/internap/DefaultAccessSuperclass.java",//===================
- "package com.internap;\n" +
- "class DefaultAccessSuperclass {\n" +
- " public static final String LOGGER = \"SUCCESS\";\n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in com\\internap\\other\\ScopeExample.java (at line 4)\r\n" +
- " private static final String LOGGER = \"FAILED\";\r\n" +
- " ^^^^^^\n" +
- "The field ScopeExample.LOGGER is never read locally\n" +
- "----------\n" +
- "2. ERROR in com\\internap\\other\\ScopeExample.java (at line 8)\r\n" +
- " System.out.println(LOGGER);\r\n" +
- " ^^^^^^\n" +
- "The field LOGGER is defined in an inherited type and an enclosing scope \n" +
- "----------\n");
- return;
- }
- this.runConformTest(
- new String[] {
- "com/internap/other/ScopeExample.java",//===================
- "package com.internap.other;\n" +
- "import com.internap.*;\n" +
- "public class ScopeExample {\n" +
- " private static final String LOGGER = \"FAILED\";\n" +
- " public static void main(String[] args) {\n" +
- " PublicAccessSubclass sub = new PublicAccessSubclass() {\n" +
- " public void implementMe() {\n" +
- " System.out.println(LOGGER);\n" +
- " }\n" +
- " };\n" +
- " sub.implementMe();\n" +
- " }\n" +
- "}",
- "com/internap/PublicAccessSubclass.java",//===================
- "package com.internap;\n" +
- "public abstract class PublicAccessSubclass extends DefaultAccessSuperclass {\n" +
- " public abstract void implementMe(); \n" +
- "}",
- "com/internap/DefaultAccessSuperclass.java",//===================
- "package com.internap;\n" +
- "class DefaultAccessSuperclass {\n" +
- " public static final String LOGGER = \"SUCCESS\";\n" +
- "}",
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=139099
-public void test068() {
- Map options = this.getCompilerOptions();
- CompilerOptions compOptions = new CompilerOptions(options);
- if (compOptions.complianceLevel < ClassFileConstants.JDK1_5) return;
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
- this.runConformTest(
- new String[] {
- "X.java",//===================
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X l = new X();\n" +
- " StringBuffer sb = new StringBuffer();\n" +
- " sb.append(l);\n" +
- " }\n" +
- "}", // =================,
- },
- "",
- null,
- true,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=139099
-public void test068a() {
- Map options = this.getCompilerOptions();
- CompilerOptions compOptions = new CompilerOptions(options);
- if (compOptions.complianceLevel < ClassFileConstants.JDK1_5) return;
-
- this.runConformTest(
- new String[] {
- "X1.java",
- "public class X1 { X1 foo() { return null; } }\n" +
- "class X2 extends X1 { X2 foo() { return null; } }\n" +
- "class Y { public X2 foo() { return null; } }\n" +
- "interface I { X1 foo(); }\n" +
- "class Z extends Y implements I {}",
- },
- "");
- this.runConformTest(
- new String[] {
- "Test.java",//===================
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " X1 x = new X2().foo();\n" +
- " X2 xx = new X2().foo();\n" +
- " X1 z = new Z().foo();\n" +
- " X2 zz = new Z().foo();\n" +
- " }\n" +
- "}", // =================,
- },
- "",
- null,
- false,
- null);
-
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
- this.runConformTest(
- new String[] {
- "Test14.java",//===================
- "public class Test14 {\n" +
- " public static void main(String[] args) {\n" +
- " X1 x = new X2().foo();\n" +
- " X2 xx = new X2().foo();\n" +
- " X1 z = new Z().foo();\n" +
- " X2 zz = new Z().foo();\n" +
- " }\n" +
- "}", // =================,
- },
- "",
- null,
- false,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=139099 - variation
-public void test069() {
- this.runConformTest(
- new String[] {
- "X.java",//===================
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X l = new X();\n" +
- " StringBuffer sb = new StringBuffer();\n" +
- " sb.append(l);\n" +
- " }\n" +
- "}", // =================,
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140643
-public void test070() {
- this.runConformTest(
- new String[] {
- "X.java",//===================
- "public class X {\n" +
- " interface I {\n" +
- " }\n" +
- "\n" +
- " void test() {\n" +
- " new I() {\n" +
- " void foo() {\n" +
- " }\n" +
- " }.foo(); // compiles OK.\n" +
- " new I() {\n" +
- " void $foo() {\n" +
- " }\n" +
- " }.$foo(); // The method $foo() is undefined for the type new T.I(){}\n" +
- " }\n" +
- "}", // =================
- },
- "");
-}
-// using $ in the name of a class defined within another package
-public void test071() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- "}",
- "p/X$X.java",
- "package p;\n" +
- "public class X$X {\n" +
- "}",
- },
- "");
- this.runConformTest(
- new String[] {
- "Y.java",
- "import p.*;\n" +
- "public class Y {\n" +
- " X$X f = new X$X();\n" +
- "}",
- },
- "",
- null /* no extra class libraries */,
- false /* do not flush output directory */,
- null /* no vm arguments */,
- null /* no custom options*/,
- null /* no custom requestor*/,
- false /* do not skip javac for this peculiar test */);
-}
-public void test072() {
- this.runNegativeTest(
- new String[] {
- "X.java",//===================
- "public class X {\n" +
- " void bar(AX ax) {\n" +
- " ax.foo(null);\n" +
- " }\n" +
- " \n" +
- "}\n" +
- "interface IX {\n" +
- " void foo(String s);\n" +
- "}\n" +
- "interface JX {\n" +
- " void foo(Thread t);\n" +
- "}\n" +
- "abstract class AX implements IX, JX {\n" +
- " public void foo(String s) {}\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " ax.foo(null);\n" +
- " ^^^\n" +
- "The method foo(String) is ambiguous for the type AX\n" +
- "----------\n");
-}
-public void test073() {
- this.runNegativeTest(
- new String[] {
- "E.java",//===================
- "public class E {\n" +
- " void run(int i) {}\n" +
- " static class Inner {\n" +
- " void run() { run(1); }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in E.java (at line 4)\n" +
- " void run() { run(1); }\n" +
- " ^^^\n" +
- "The method run() in the type E.Inner is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-
-// was Compliance_1_x#test008
-public void test074() {
- String[] sources = new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "import Test2; \n" +
- "import Test2.Member; \n" +
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n"+
- "} \n",
- "Test2.java",
- "public class Test2 { \n"+
- " public class Member { \n" +
- " } \n"+
- "} \n"
- };
- if (this.complianceLevel.equals(COMPLIANCE_1_3)) {
- runConformTest(
- sources,
- "SUCCESS");
- } else {
- runNegativeTest(
- sources,
- "----------\n" +
- "1. ERROR in p1\\Test.java (at line 2)\n" +
- " import Test2; \n" +
- " ^^^^^\n" +
- "The import Test2 cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in p1\\Test.java (at line 3)\n" +
- " import Test2.Member; \n" +
- " ^^^^^\n" +
- "The import Test2 cannot be resolved\n" +
- "----------\n");
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150758
-public void test075() {
- this.runConformTest(
- new String[] {
- "package1/Test.java",//===================
- "package package1;\n" +
- "import package2.MyList;\n" +
- "public class Test {\n" +
- " public void reproduce(String sortKey, boolean isAscending) {\n" +
- " MyList recList = new MyList();\n" +
- " recList.add(null);\n" +
- " }\n" +
- "}\n",//===================
- "package2/MyList.java",//===================
- "package package2;\n" +
- "import java.util.AbstractList;\n" +
- "import java.util.List;\n" +
- "public class MyList extends AbstractList implements List {\n" +
- " void add(Integer i) {\n" +
- " }\n" +
- " public Object get(int index) {\n" +
- " return null;\n" +
- " }\n" +
- " public int size() {\n" +
- " return 0;\n" +
- " }\n" +
- "}", // =================
- },
- "");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159543
-public void test076() {
- if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
- this.runNegativeTest(
- new String[] {
- "p/Y.java", //===================
- "package p;\n" +
- "public class Y {\n" +
- " public static void foo(String s) {\n" +
- " }\n" +
- "}\n", //===================
- "q/X.java", //===================
- "package q;\n" +
- "import static p.Y.foo;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " foo(\"\");\n" +
- " }\n" +
- "}", // =================
- },
- "----------\n" +
- "1. ERROR in q\\X.java (at line 7)\n" +
- " foo(\"\");\n" +
- " ^^^\n" +
- "The method foo() in the type X is not applicable for the arguments (String)\n" +
- "----------\n");
- }
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=159893
-public void test077() {
- this.runConformTest(
- new String[] {
- "X.java", //===================
- "abstract class B {\n" +
- " public String getValue(){\n" +
- " return \"pippo\";\n" +
- " }\n" +
- "}\n" +
- "class D {\n" +
- " private String value;\n" +
- " public D(String p_Value){\n" +
- " value = p_Value;\n" +
- " }\n" +
- " private String getValue(){\n" +
- " return \"pippoD\";\n" +
- " }\n" +
- "}\n" +
- "public class X extends B {\n" +
- " class C extends D{\n" +
- " public C() {\n" +
- " super(getValue());\n" +
- " String s = getValue();\n" +
- " }\n" +
- " }\n" +
- "}\n", // =================
- },
- "");
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=159893 - variation
-public void test078() {
- this.runNegativeTest(
- new String[] {
- "X.java", //===================
- "class D {\n" +
- " private String value;\n" +
- " public D(String p_Value){\n" +
- " value = p_Value;\n" +
- " }\n" +
- " private String getValue(){\n" +
- " return \"pippoD\";\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " class C extends D{\n" +
- " public C() {\n" +
- " super(getValue());\n" +
- " String s = getValue();\n" +
- " }\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " private String value;\n" +
- " ^^^^^\n" +
- "The field D.value is never read locally\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " super(getValue());\n" +
- " ^^^^^^^^\n" +
- "The method getValue() from the type D is not visible\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " String s = getValue();\n" +
- " ^^^^^^^^\n" +
- "The method getValue() from the type D is not visible\n" +
- "----------\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166354
-// **
-public void test079() {
- this.runConformTest(
- new String[] {
- "X.java", //===================
- "abstract class Y {\n" +
- " private void foo(boolean b) {\n" +
- " System.out.println(\"Y\");\n" +
- " return;\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " private void foo(String s) {\n" +
- " System.out.println(\"X\");\n" +
- " return;\n" +
- " }\n" +
- " private class Z extends Y {\n" +
- " public void bar(boolean b) {\n" +
- " foo(\"Flag \" + b);\n" +
- " X.this.foo(\"Flag \" + b);\n" +
- " }\n" +
- " }\n" +
- " Z m = new Z();\n" +
- " public static void main(String args[]) {\n" +
- " new X().m.bar(true);\n" +
- " }\n" +
- "}", // =================
- },
- "X\nX");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166354
-// variant
-public void test080() {
- this.runConformTest(
- new String[] {
- "X.java", //===================
- "abstract class Y {\n" +
- " private void foo(String s) {\n" +
- " System.out.println(\"Y\");\n" +
- " return;\n" +
- " }\n" +
- "}\n" +
- "public class X {\n" +
- " private void foo(String s) {\n" +
- " System.out.println(\"X\");\n" +
- " return;\n" +
- " }\n" +
- " private class Z extends Y {\n" +
- " public void bar(boolean b) {\n" +
- " foo(\"Flag \" + b);\n" +
- " X.this.foo(\"Flag \" + b);\n" +
- " }\n" +
- " }\n" +
- " Z m = new Z();\n" +
- " public static void main(String args[]) {\n" +
- " new X().m.bar(true);\n" +
- " }\n" +
- "}", // =================
- },
- "X\nX");
-}
-public static Class testClass() { return LookupTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/MethodVerifyTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/MethodVerifyTest.java
deleted file mode 100644
index fdc6555..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/MethodVerifyTest.java
+++ /dev/null
@@ -1,7376 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class MethodVerifyTest extends AbstractComparableTest {
- static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 121 };
-// TESTS_RANGE = new int[] { 113, -1};
- }
-
- public MethodVerifyTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildComparableTestSuite(testClass());
- }
-
- public static Class testClass() {
- return MethodVerifyTest.class;
- }
-
- public void test001() {
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "public class Y<T> extends X<A> { public void foo(T t) {} }\n" +
- "class X<U> { public void foo(U u) {} }\n" +
- "class A {}\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " public class Y<T> extends X<A> { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type Y<T> has the same erasure as foo(U) of type X<U> but does not override it\n" +
- "----------\n"
- // name clash: foo(T) in Y<T> and foo(U) in X<A> have the same erasure, yet neither overrides the other
- );
- }
-
- public void test001a() {
- this.runNegativeTest(
- new String[] {
- "J.java",
- "public class J<T> implements I<A> { public void foo(T t) {} }\n" +
- "interface I<U> { public void foo(U u); }\n" +
- "class A {}\n"
- },
- "----------\n" +
- "1. ERROR in J.java (at line 1)\r\n" +
- " public class J<T> implements I<A> { public void foo(T t) {} }\r\n" +
- " ^\n" +
- "The type J<T> must implement the inherited abstract method I<A>.foo(A)\n" +
- "----------\n" +
- "2. ERROR in J.java (at line 1)\r\n" +
- " public class J<T> implements I<A> { public void foo(T t) {} }\r\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type J<T> has the same erasure as foo(U) of type I<U> but does not override it\n" +
- "----------\n"
- // J is not abstract and does not override abstract method foo(A) in I
- );
- }
- public void test001b() {
- this.runNegativeTest(
- new String[] {
- "YY.java",
- "public class YY<T> extends X { public void foo(T t) {} }\n" +
- "class X<U> { public void foo(U u) {} }\n"
- },
- "----------\n" +
- "1. WARNING in YY.java (at line 1)\n" +
- " public class YY<T> extends X { public void foo(T t) {} }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<U> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in YY.java (at line 1)\n" +
- " public class YY<T> extends X { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type YY<T> has the same erasure as foo(Object) of type X but does not override it\n" +
- "----------\n"
- // name clash: foo(T) in YY<T> and foo(U) in X have the same erasure, yet neither overrides the other
- );
- }
- public void test001c() {
- this.runNegativeTest(
- new String[] {
- "JJ.java",
- "public class JJ<T> implements I { public void foo(T t) {} }\n" +
- "interface I<U> { public void foo(U u); }\n"
- },
- "----------\n" +
- "1. ERROR in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^^\n" +
- "The type JJ<T> must implement the inherited abstract method I.foo(Object)\n" +
- "----------\n" +
- "2. WARNING in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<U> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type JJ<T> has the same erasure as foo(Object) of type I but does not override it\n" +
- "----------\n"
- // JJ is not abstract and does not override abstract method foo(java.lang.Object) in I
- );
- }
- public void test001d() {
- this.runConformTest(
- new String[] {
- "YYY.java",
- "public class YYY<T> extends X<T> { public void foo(T t) {} }\n" +
- "class X<U> { public void foo(U u) {} }\n"
- },
- ""
- );
- }
- public void test001e() {
- this.runConformTest(
- new String[] {
- "JJJ.java",
- "public class JJJ<T> implements I<T> { public void foo(T t) {} }\n" +
- "interface I<U> { public void foo(U u); }\n"
- },
- ""
- );
- }
-
- public void test002() { // separate files
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "public class Y<T> extends X<A> { public void foo(T t) {} }\n" +
- "class A {}\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " public class Y<T> extends X<A> { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type Y<T> has the same erasure as foo(U) of type X<U> but does not override it\n" +
- "----------\n"
- // name clash: foo(T) in Y<T> and foo(U) in X<A> have the same erasure, yet neither overrides the other
- );
- }
- public void test002a() { // separate files
- this.runNegativeTest(
- new String[] {
- "J.java",
- "public class J<T> implements I<A> { public void foo(T t) {} }\n" +
- "class A {}\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n"
- },
- "----------\n" +
- "1. ERROR in J.java (at line 1)\r\n" +
- " public class J<T> implements I<A> { public void foo(T t) {} }\r\n" +
- " ^\n" +
- "The type J<T> must implement the inherited abstract method I<A>.foo(A)\n" +
- "----------\n" +
- "2. ERROR in J.java (at line 1)\r\n" +
- " public class J<T> implements I<A> { public void foo(T t) {} }\r\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type J<T> has the same erasure as foo(U) of type I<U> but does not override it\n" +
- "----------\n"
- // J is not abstract and does not override abstract method foo(A) in I
- );
- }
- public void test002b() { // separate files
- this.runNegativeTest(
- new String[] {
- "YY.java",
- "public class YY<T> extends X { public void foo(T t) {} }\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n"
- },
- "----------\n" +
- "1. WARNING in YY.java (at line 1)\n" +
- " public class YY<T> extends X { public void foo(T t) {} }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<U> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in YY.java (at line 1)\n" +
- " public class YY<T> extends X { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type YY<T> has the same erasure as foo(Object) of type X but does not override it\n" +
- "----------\n"
- // name clash: foo(T) in YY<T> and foo(U) in X have the same erasure, yet neither overrides the other
- );
- }
- public void test002c() { // separate files
- this.runNegativeTest(
- new String[] {
- "JJ.java",
- "public class JJ<T> implements I { public void foo(T t) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n"
- },
- "----------\n" +
- "1. ERROR in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^^\n" +
- "The type JJ<T> must implement the inherited abstract method I.foo(Object)\n" +
- "----------\n" +
- "2. WARNING in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<U> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type JJ<T> has the same erasure as foo(Object) of type I but does not override it\n" +
- "----------\n"
- // JJ is not abstract and does not override abstract method foo(java.lang.Object) in I
- );
- }
- public void test002d() { // separate files
- this.runConformTest(
- new String[] {
- "YYY.java",
- "public class YYY<T> extends X<T> { public void foo(T t) {} }\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n"
- },
- ""
- );
- }
- public void test002e() { // separate files
- this.runConformTest(
- new String[] {
- "JJJ.java",
- "public class JJJ<T> implements I<T> { public void foo(T t) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n"
- },
- ""
- );
- }
-
- public void test003() { // pick up superTypes as binaries
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n",
- },
- ""
- );
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "public class Y<T> extends X<A> { public void foo(T t) {} }\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " public class Y<T> extends X<A> { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type Y<T> has the same erasure as foo(U) of type X<U> but does not override it\n" +
- "----------\n",
- // name clash: foo(T) in Y<T> and foo(U) in X<A> have the same erasure, yet neither overrides the other
- null,
- false,
- null
- );
- }
- public void test003a() { // pick up superTypes as binaries
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n",
- },
- ""
- );
- this.runNegativeTest(
- new String[] {
- "J.java",
- "public class J<T> implements I<A> { public void foo(T t) {} }\n"
- },
- "----------\n" +
- "1. ERROR in J.java (at line 1)\r\n" +
- " public class J<T> implements I<A> { public void foo(T t) {} }\r\n" +
- " ^\n" +
- "The type J<T> must implement the inherited abstract method I<A>.foo(A)\n" +
- "----------\n" +
- "2. ERROR in J.java (at line 1)\r\n" +
- " public class J<T> implements I<A> { public void foo(T t) {} }\r\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type J<T> has the same erasure as foo(U) of type I<U> but does not override it\n" +
- "----------\n",
- // J is not abstract and does not override abstract method foo(A) in I
- null,
- false,
- null
- );
- }
- public void test003b() {
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n",
- },
- ""
- );
- this.runNegativeTest(
- new String[] {
- "YY.java",
- "public class YY<T> extends X { public void foo(T t) {} }\n"
- },
- "----------\n" +
- "1. WARNING in YY.java (at line 1)\n" +
- " public class YY<T> extends X { public void foo(T t) {} }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<U> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in YY.java (at line 1)\n" +
- " public class YY<T> extends X { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type YY<T> has the same erasure as foo(Object) of type X but does not override it\n" +
- "----------\n",
- // name clash: foo(T) in YY<T> and foo(U) in X have the same erasure, yet neither overrides the other
- null,
- false,
- null
- );
- }
- public void test003c() {
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n",
- },
- ""
- );
- this.runNegativeTest(
- new String[] {
- "JJ.java",
- "public class JJ<T> implements I { public void foo(T t) {} }\n"
- },
- "----------\n" +
- "1. ERROR in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^^\n" +
- "The type JJ<T> must implement the inherited abstract method I.foo(Object)\n" +
- "----------\n" +
- "2. WARNING in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<U> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in JJ.java (at line 1)\n" +
- " public class JJ<T> implements I { public void foo(T t) {} }\n" +
- " ^^^^^^^^\n" +
- "Name clash: The method foo(T) of type JJ<T> has the same erasure as foo(Object) of type I but does not override it\n" +
- "----------\n",
- // JJ is not abstract and does not override abstract method foo(java.lang.Object) in I
- null,
- false,
- null
- );
- }
- public void test003d() {
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n",
- },
- ""
- );
- this.runConformTest(
- new String[] {
- "YYY.java",
- "public class YYY<T> extends X<T> { public void foo(T t) {} }\n"
- },
- "",
- null,
- false,
- null
- );
- }
- public void test003e() {
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public void foo(U u) {} }\n",
- "I.java",
- "interface I<U> { public void foo(U u); }\n",
- },
- ""
- );
- this.runConformTest(
- new String[] {
- "JJJ.java",
- "public class JJJ<T> implements I<T> { public void foo(T t) {} }\n"
- },
- "",
- null,
- false,
- null
- );
- }
-
- public void test004() { // all together
- this.runNegativeTest(
- new String[] {
- "ALL.java",
- "class A {}\n" +
- "class B {}\n" +
- "class X<U> { public U foo() {return null;} }\n" +
- "interface I<U> { public U foo(); }\n" +
-
- "class J<T> implements I<B> { public T foo() {return null;} }\n" +
- "class K<T> implements I<T> { public T foo() {return null;} }\n" +
- "class L<T> implements I { public T foo() {return null;} }\n" +
-
- "class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n" +
- "class Z<T> extends X<T> { @Override public T foo() { return super.foo(); } }\n" +
- "class W<T> extends X { @Override public T foo() { return super.foo(); } }\n",
- },
- "----------\n" +
- "1. ERROR in ALL.java (at line 5)\n" +
- " class J<T> implements I<B> { public T foo() {return null;} }\n" +
- " ^\n" +
- "The return type is incompatible with I<B>.foo()\n" +
- "----------\n" +
- "2. WARNING in ALL.java (at line 7)\n" +
- " class L<T> implements I { public T foo() {return null;} }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<U> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in ALL.java (at line 8)\n" +
- " class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n" +
- " ^\n" +
- "The return type is incompatible with X<A>.foo()\n" +
- "----------\n" +
- "4. ERROR in ALL.java (at line 8)\n" +
- " class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from A to T\n" +
- "----------\n" +
- "5. WARNING in ALL.java (at line 10)\n" +
- " class W<T> extends X { @Override public T foo() { return super.foo(); } }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<U> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in ALL.java (at line 10)\n" +
- " class W<T> extends X { @Override public T foo() { return super.foo(); } }\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to T\n" +
- "----------\n"
- /*
- ALL.java:5: J is not abstract and does not override abstract method foo() in I
- ALL.java:5: foo() in J cannot implement foo() in I; attempting to use incompatible return type
- ALL.java:8: foo() in Y cannot override foo() in X; attempting to use incompatible return type
- ALL.java:8: incompatible types
- found : A
- required: T
- class Y<T> extends X<A> { public T foo() { return super.foo(); } }
- ^
- ALL.java:10: incompatible types
- found : java.lang.Object
- required: T
- class W<T> extends X { public T foo() { return super.foo(); } }
- */
- );
- }
-
- public void test005() { // separate files
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public U foo() {return null;} }\n",
- "I.java",
- "interface I<U> { public U foo(); }\n",
-
- "J.java",
- "class J<T> implements I<B> { public T foo() {return null;} }\n",
- "K.java",
- "class K<T> implements I<T> { public T foo() {return null;} }\n",
- "L.java",
- "class L<T> implements I { public T foo() {return null;} }\n",
-
- "Y.java",
- "class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n",
- "Z.java",
- "class Z<T> extends X<T> { @Override public T foo() { return super.foo(); } }\n",
- "W.java",
- "class W<T> extends X { @Override public T foo() { return super.foo(); } }\n",
- },
- "----------\n" +
- "1. ERROR in J.java (at line 1)\n" +
- " class J<T> implements I<B> { public T foo() {return null;} }\n" +
- " ^\n" +
- "The return type is incompatible with I<B>.foo()\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in L.java (at line 1)\n" +
- " class L<T> implements I { public T foo() {return null;} }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<U> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n" +
- " ^\n" +
- "The return type is incompatible with X<A>.foo()\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 1)\n" +
- " class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from A to T\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in W.java (at line 1)\n" +
- " class W<T> extends X { @Override public T foo() { return super.foo(); } }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<U> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in W.java (at line 1)\n" +
- " class W<T> extends X { @Override public T foo() { return super.foo(); } }\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to T\n" +
- "----------\n"
- /*
- J.java:1: J is not abstract and does not override abstract method foo() in I
- J.java:1: foo() in J cannot implement foo() in I; attempting to use incompatible return type
- W.java:1: incompatible types
- found : java.lang.Object
- required: T
- class W<T> extends X { public T foo() { return super.foo(); } }
- Y.java:1: foo() in Y cannot override foo() in X; attempting to use incompatible return type
- Y.java:1: incompatible types
- found : A
- required: T
- class Y<T> extends X<A> { public T foo() { return super.foo(); } }
- */
- );
- }
-
- public void test006() { // pick up superTypes as binaries
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {}\n",
- "B.java",
- "class B {}\n",
- "X.java",
- "class X<U> { public U foo() {return null;} }\n",
- "I.java",
- "interface I<U> { public U foo(); }\n",
- },
- ""
- );
- this.runNegativeTest(
- new String[] {
- "J.java",
- "class J<T> implements I<B> { public T foo() {return null;} }\n",
- "K.java",
- "class K<T> implements I<T> { public T foo() {return null;} }\n",
- "L.java",
- "class L<T> implements I { public T foo() {return null;} }\n",
-
- "Y.java",
- "class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n",
- "Z.java",
- "class Z<T> extends X<T> { @Override public T foo() { return super.foo(); } }\n",
- "W.java",
- "class W<T> extends X { @Override public T foo() { return super.foo(); } }\n",
- },
- "----------\n" +
- "1. ERROR in J.java (at line 1)\n" +
- " class J<T> implements I<B> { public T foo() {return null;} }\n" +
- " ^\n" +
- "The return type is incompatible with I<B>.foo()\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in L.java (at line 1)\n" +
- " class L<T> implements I { public T foo() {return null;} }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<U> should be parameterized\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n" +
- " ^\n" +
- "The return type is incompatible with X<A>.foo()\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 1)\n" +
- " class Y<T> extends X<A> { @Override public T foo() { return super.foo(); } }\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from A to T\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in W.java (at line 1)\n" +
- " class W<T> extends X { @Override public T foo() { return super.foo(); } }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<U> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in W.java (at line 1)\n" +
- " class W<T> extends X { @Override public T foo() { return super.foo(); } }\n" +
- " ^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to T\n" +
- "----------\n",
- /*
- J.java:1: J is not abstract and does not override abstract method foo() in I
- J.java:1: foo() in J cannot implement foo() in I; attempting to use incompatible return type
- W.java:1: incompatible types
- found : java.lang.Object
- required: T
- class W<T> extends X { public T foo() { return super.foo(); } }
- Y.java:1: foo() in Y cannot override foo() in X; attempting to use incompatible return type
- Y.java:1: incompatible types
- found : A
- required: T
- class Y<T> extends X<A> { public T foo() { return super.foo(); } }
- */
- null,
- false,
- null
- );
- }
-
- public void test007() { // simple covariance cases
- this.runConformTest(
- new String[] {
- "A.java",
- "abstract class A implements I {}\n" +
- "interface I extends J { String foo(); }\n" +
- "interface J { Object foo(); }\n",
- "X.java",
- "abstract class X1 extends A implements J {}\n"
- },
- ""
- );
- }
- public void test007a() { // simple covariance cases
- this.runNegativeTest(
- new String[] {
- "A.java",
- "abstract class A implements I {}\n" +
- "interface I extends J { Object foo(); }\n" +
- "interface J { String foo(); }\n",
- "X.java",
- "abstract class X2 extends A implements J {}\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 1)\n" +
- " abstract class A implements I {}\n" +
- " ^\n" +
- "The return type is incompatible with J.foo(), I.foo()\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 2)\n" +
- " interface I extends J { Object foo(); }\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with J.foo()\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " abstract class X2 extends A implements J {}\n" +
- " ^^\n" +
- "The return type is incompatible with I.foo(), J.foo()\n" +
- "----------\n"
- );
- }
- public void test007b() { // simple covariance cases
- this.runConformTest(
- new String[] {
- "A.java",
- "abstract class A implements I {}\n" +
- "interface I { String foo(); }\n",
- "X.java",
- "abstract class X3 extends A implements J {}\n" +
- "interface J { Object foo(); }\n"
- },
- ""
- );
- }
- public void test007c() { // simple covariance cases
- this.runConformTest(
- new String[] {
- "A.java",
- "abstract class A implements I {}\n" +
- "interface I { Object foo(); }\n",
- "X.java",
- "abstract class X4 extends A implements J {}\n" +
- "interface J { String foo(); }\n"
- },
- ""
- );
- }
- public void test007d() { // simple covariance cases
- this.runConformTest(
- new String[] {
- "A.java",
- "class A { public String foo() { return null; } }\n" +
- "interface I { Object foo(); }\n",
- "X.java",
- "abstract class X5 extends A implements I {}\n"
- },
- ""
- );
- }
- public void test007e() { // simple covariance cases
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { public Object foo() { return null; } }\n" +
- "interface I { String foo(); }\n",
- "X.java",
- "abstract class X6 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " abstract class X6 extends A implements I {}\r\n" +
- " ^^\n" +
- "The return type is incompatible with I.foo(), A.foo()\n" +
- "----------\n"
- );
- }
- public void test007f() { // simple covariance cases
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { int get(short i, short s) { return i; } }\n" +
- "class B extends A { @Override short get(short i, short s) {return i; } }\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 2)\r\n" +
- " class B extends A { @Override short get(short i, short s) {return i; } }\r\n" +
- " ^^^^^\n" +
- "The return type is incompatible with A.get(short, short)\n" +
- "----------\n"
- );
- }
-
- public void test008() { // covariance test
- this.runNegativeTest(
- new String[] {
- "ALL.java",
- "interface I { I foo(); }\n" +
- "class A implements I { public A foo() { return null; } }\n" +
- "class B extends A { @Override public B foo() { return null; } }\n" +
- "class C extends B { @Override public A foo() { return null; } }\n" +
- "class D extends B implements I {}\n",
- },
- "----------\n" +
- "1. ERROR in ALL.java (at line 4)\r\n" +
- " class C extends B { @Override public A foo() { return null; } }\r\n" +
- " ^\n" +
- "The return type is incompatible with B.foo()\n" +
- "----------\n"
- // foo() in C cannot override foo() in B; attempting to use incompatible return type
- );
- }
-
- public void test009() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class G<T> {}\n" +
- "interface I { void foo(G<I> x); }\n" +
- "abstract class A implements I { void foo(G<A> x) {} }\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 3)\r\n" +
- " abstract class A implements I { void foo(G<A> x) {} }\r\n" +
- " ^^^^^^^^^^^\n" +
- "Name clash: The method foo(G<A>) of type A has the same erasure as foo(G<I>) of type I but does not override it\n" +
- "----------\n"
- // name clash: foo(G<A>) in A and foo(G<I>) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test009a() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class G<T> {}\n" +
- "interface I { I foo(G<I> x); }\n" +
- "abstract class A implements I { I foo(G<A> x) { return null; } }\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 3)\r\n" +
- " abstract class A implements I { I foo(G<A> x) { return null; } }\r\n" +
- " ^^^^^^^^^^^\n" +
- "Name clash: The method foo(G<A>) of type A has the same erasure as foo(G<I>) of type I but does not override it\n" +
- "----------\n"
- // name clash: foo(G<A>) in A and foo(G<I>) in I have the same erasure, yet neither overrides the other
- );
- }
-
- public void test010() { // executable bridge method case
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public X foo() {\n" +
- " System.out.println(\"Did NOT add bridge method\");\n" +
- " return this;\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " X x = new A();\n" +
- " x.foo();\n" +
- " System.out.print(\" + \");\n" +
- " I i = new A();\n" +
- " i.foo();\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " public I foo();\n" +
- "}\n" +
- "class A extends X implements I {\n" +
- " public A foo() {\n" +
- " System.out.print(\"Added bridge method\");\n" +
- " return this;\n" +
- " }\n" +
- "}\n"
- },
- "Added bridge method + Added bridge method"
- );
- }
-
- public void test011() {
- // javac 1.5.0 will only issue 1 name clash per compile... doesn't matter how many source files are involved
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T> void foo(T t) {} }\n" +
- "interface I { <T> void foo(T t); }\n",
- "X.java",
- "abstract class X1 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " abstract class X1 extends A implements I {}\r\n" +
- " ^^\n" +
- "The inherited method A.foo(T) cannot hide the public abstract method in I\n" +
- "----------\n"
- // <T>foo(T) in A cannot implement <T>foo(T) in I; attempting to assign weaker access privileges; was public
- );
- }
- public void test011a() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T, S> void foo(T t) {} }\n" +
- "interface I { <T> void foo(T t); }\n",
- "X.java",
- "abstract class X2 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " abstract class X2 extends A implements I {}\n" +
- " ^^\n" +
- "Name clash: The method foo(T) of type A has the same erasure as foo(T) of type I but does not override it\n" +
- "----------\n"
- // name clash: <T,S>foo(T) in A and <T>foo(T) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test011b() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T> void foo(T t) {} }\n" +
- "interface I { <T, S> void foo(T t); }\n",
- "X.java",
- "abstract class X3 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " abstract class X3 extends A implements I {}\n" +
- " ^^\n" +
- "Name clash: The method foo(T) of type A has the same erasure as foo(T) of type I but does not override it\n" +
- "----------\n"
- // name clash: <T>foo(T) in A and <T,S>foo(T) in I have the same erasure, yet neither overrides the other
- );
- }
-
- public void test012() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { public <T> void foo(T s) {} }\n" +
- "class Y1 extends A { @Override void foo(Object s) {} }\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 2)\n" +
- " class Y1 extends A { @Override void foo(Object s) {} }\n" +
- " ^^^^^^^^^^^^^\n" +
- "Cannot reduce the visibility of the inherited method from A\n" +
- "----------\n"
- // foo(java.lang.Object) in Y1 cannot override <T>foo(T) in A; attempting to assign weaker access privileges; was public
- );
- }
- public void test012a() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { public <T> void foo(T[] s) {} }\n" +
- "class Y2 extends A { @Override void foo(Object[] s) {} }\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 2)\n" +
- " class Y2 extends A { @Override void foo(Object[] s) {} }\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Cannot reduce the visibility of the inherited method from A\n" +
- "----------\n"
- // foo(java.lang.Object[]) in Y2 cannot override <T>foo(T[]) in A; attempting to assign weaker access privileges; was public
- );
- }
- public void test012b() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { public void foo(Class<Object> s) {} }\n" +
- "class Y3 extends A { @Override void foo(Class<Object> s) {} }\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 2)\r\n" +
- " class Y3 extends A { @Override void foo(Class<Object> s) {} }\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot reduce the visibility of the inherited method from A\n" +
- "----------\n"
- // foo(java.lang.Class<java.lang.Object>) in Y3 cannot override foo(java.lang.Class<java.lang.Object>) in A; attempting to assign weaker access privileges; was public
- );
- }
-
- public void test013() {
- // javac 1.5.0 will only issue 1 name clash per compile... doesn't matter how many source files are involved
- this.runConformTest(
- new String[] {
- "A.java",
- "class A { public <T> void foo(Class<T> s) {} }\n" +
- "interface I { <T> void foo(Class<T> s); }\n",
- "X.java",
- "abstract class X0 extends A implements I {}\n"
- },
- ""
- );
- }
- public void test013a() {
- // javac 1.5.0 will only issue 1 name clash per compile... doesn't matter how many source files are involved
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T, S> void foo(Class<T> s) {} }\n" +
- "interface I { <T> void foo(Class<T> s); }\n",
- "X.java",
- "abstract class X1 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " abstract class X1 extends A implements I {}\r\n" +
- " ^^\n" +
- "Name clash: The method foo(Class<T>) of type A has the same erasure as foo(Class<T>) of type I but does not override it\n" +
- "----------\n"
- // name clash: <T,S>foo(java.lang.Class<T>) in A and <T>foo(java.lang.Class<T>) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test013b() {
- // javac 1.5.0 will only issue 1 name clash per compile... doesn't matter how many source files are involved
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T> void foo(Class<T> s) {} }\n" +
- "interface I { <T, S> void foo(Class<T> s); }\n",
- "X.java",
- "abstract class X2 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " abstract class X2 extends A implements I {}\r\n" +
- " ^^\n" +
- "Name clash: The method foo(Class<T>) of type A has the same erasure as foo(Class<T>) of type I but does not override it\n" +
- "----------\n"
- // name clash: <T>foo(java.lang.Class<T>) in A and <T,S>foo(java.lang.Class<T>) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test013c() {
- // javac 1.5.0 will only issue 1 name clash per compile... doesn't matter how many source files are involved
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T, S> S foo(Class<T> s) { return null; } }\n" +
- "interface I { <T> Object foo(Class<T> s); }\n",
- "X.java",
- "abstract class X3 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " abstract class X3 extends A implements I {}\r\n" +
- " ^^\n" +
- "Name clash: The method foo(Class<T>) of type A has the same erasure as foo(Class<T>) of type I but does not override it\n" +
- "----------\n"
- // name clash: <T,S>foo(java.lang.Class<T>) in A and <T>foo(java.lang.Class<T>) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test013d() {
- // javac 1.5.0 will only issue 1 name clash per compile... doesn't matter how many source files are involved
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T> Object foo(Class<T> s) { return null; } }\n" +
- "interface I { <T, S> S foo(Class<T> s); }\n",
- "X.java",
- "abstract class X4 extends A implements I {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " abstract class X4 extends A implements I {}\r\n" +
- " ^^\n" +
- "Name clash: The method foo(Class<T>) of type A has the same erasure as foo(Class<T>) of type I but does not override it\n" +
- "----------\n"
- // name clash: <T>foo(java.lang.Class<T>) in A and <T,S>foo(java.lang.Class<T>) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test013e() {
- // javac 1.5.0 will only issue 1 name clash per compile... doesn't matter how many source files are involved
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { public <T, S> void foo(Class<T> s) {} }\n" +
- "interface I { <T> void foo(Class<T> s); }\n",
-
- "X.java",
- "class X5 extends A implements I { public <T> void foo(Class<T> s) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " class X5 extends A implements I { public <T> void foo(Class<T> s) {} }\r\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(Class<T>) of type X5 has the same erasure as foo(Class<T>) of type A but does not override it\n" +
- "----------\n"
- // name clash: <T>foo(java.lang.Class<T>) in X5 and <T,S>foo(java.lang.Class<T>) in A have the same erasure, yet neither overrides the other
- );
- }
-
- public void test014() { // name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "class X { void foo(A a) {} }\n" +
- "class Y extends X { void foo(A a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test014a() { // name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "class X { void foo(A[] a) {} }\n" +
- "class Y extends X { void foo(A[] a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test014b() { // name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "class X { void foo(A<String>[] a) {} }\n" +
- "class Y extends X { void foo(A[] a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test014c() { // name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "class X { void foo(A<String> a) {} }\n" +
- "class Y extends X { void foo(A a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test014d() { // name clash tests
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X { void foo(A a) {} }\n" +
- "class Y extends X { void foo(A<String> a) {} }\n" +
- "class A<T> {}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " class X { void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " class Y extends X { void foo(A<String> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type Y has the same erasure as foo(A) of type X but does not override it\n" +
- "----------\n"
- // name clash: foo(A<java.lang.String>) in Y and foo(A) in X have the same erasure, yet neither overrides the other
- );
- }
- public void test014e() { // name clash tests
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X { void foo(A[] a) {} }\n" +
- "class Y extends X { void foo(A<String>[] a) {} }\n" +
- "class A<T> {}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " class X { void foo(A[] a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " class Y extends X { void foo(A<String>[] a) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>[]) of type Y has the same erasure as foo(A[]) of type X but does not override it\n" +
- "----------\n"
- // name clash: foo(A<java.lang.String>[]) in Y and foo(A[]) in X have the same erasure, yet neither overrides the other
- );
- }
-
- public void test015() { // more name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A a); }\n" +
- "class Y { public void foo(A a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test015a() { // more name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A[] a); }\n" +
- "class Y { public void foo(A[] a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test015b() { // more name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A<String>[] a); }\n" +
- "class Y { public void foo(A[] a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test015c() { // more name clash tests
- this.runConformTest(
- new String[] {
- "X.java",
- "abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A<String> a); }\n" +
- "class Y { public void foo(A a) {} }\n" +
- "class A<T> {}\n"
- },
- ""
- );
- }
- public void test015d() { // more name clash tests
- this.runNegativeTest(
- new String[] {
- "X.java",
- "abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A a); }\n" +
- "class Y { public void foo(A<String> a) {} }\n" +
- "class A<T> {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " abstract class X extends Y implements I { }\n" +
- " ^\n" +
- "Name clash: The method foo(A<String>) of type Y has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " interface I { void foo(A a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n"
- // name clash: foo(A<java.lang.String>) in Y and foo(A) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test015e() { // more name clash tests
- this.runNegativeTest(
- new String[] {
- "X.java",
- "abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A[] a); }\n" +
- "class Y { public void foo(A<String>[] a) {} }\n" +
- "class A<T> {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " abstract class X extends Y implements I { }\n" +
- " ^\n" +
- "Name clash: The method foo(A<String>[]) of type Y has the same erasure as foo(A[]) of type I but does not override it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " interface I { void foo(A[] a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n"
- // name clash: foo(A<java.lang.String>[]) in Y and foo(A[]) in I have the same erasure, yet neither overrides the other
- );
- }
-
- public void test016() { // 73971
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <E extends A> void m(E e) { System.out.print(\"A=\"+e.getClass()); }\n" +
- " <E extends B> void m(E e) { System.out.print(\"B=\"+e.getClass()); }\n" +
- " public static void main(String[] args) {\n" +
- " new X().m(new A());\n" +
- " new X().m(new B());\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n"
- },
- "A=class AB=class B"
- );
- }
- public void test016b() { // 73971
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static <E extends A> void m(E e) { System.out.print(\"A=\"+e.getClass()); }\n" +
- " static <E extends B> void m(E e) { System.out.print(\"B=\"+e.getClass()); }\n" +
- " public static void main(String[] args) {\n" +
- " m(new A());\n" +
- " m(new B());\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n"
- },
- "A=class AB=class B"
- );
- }
-
- public void test017() { // 77785
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X<T> {}\n" +
- "class Y { void test(X<? extends Number> a) {} }\n" +
- "class Z extends Y { void test(X<Number> a) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " class Z extends Y { void test(X<Number> a) {} }\r\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method test(X<Number>) of type Z has the same erasure as test(X<? extends Number>) of type Y but does not override it\n" +
- "----------\n"
- // name clash: test(X<java.lang.Number>) in Z and test(X<? extends java.lang.Number>) in Y have the same erasure, yet neither overrides the other
- );
- }
- public void test017a() { // 77785
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X<T> {}\n" +
- "class Y { void test(X<Number> a) {} }\n" +
- "class Z extends Y { void test(X<? extends Number> a) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " class Z extends Y { void test(X<? extends Number> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method test(X<? extends Number>) of type Z has the same erasure as test(X<Number>) of type Y but does not override it\n" +
- "----------\n"
- // name clash: test(X<? extends java.lang.Number>) in Z and test(X<java.lang.Number>) in Y have the same erasure, yet neither overrides the other
- );
- }
-
- public void test018() { // 77861
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X implements Comparable<X> {\n" +
- " public int compareTo(Object o) { return 0; }\n" +
- " public int compareTo(X o) { return 1; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public int compareTo(Object o) { return 0; }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method compareTo(Object) of type X has the same erasure as compareTo(T) of type Comparable<T> but does not override it\n" +
- "----------\n"
- // name clash: compareTo(java.lang.Object) in X and compareTo(T) in java.lang.Comparable<X> have the same erasure, yet neither overrides the other
- );
- }
-
- public void test019() { // 78140
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " <T> T get() { return null; } \n" +
- "}\n" +
- "class B extends A {\n" +
- " <T> T get() { return null; } \n" +
- "}\n"
- },
- ""
- );
- }
-
- public void test020() { // 78232
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " AbstractBase ab = new AbstractBase();\n" +
- " Derived d = new Derived();\n" +
- " AbstractBase ab2 = new Derived();\n" +
- " Visitor<String, String> v = new MyVisitor();\n" +
- " System.out.print(ab.accept(v, ab.getClass().getName()));\n" +
- " System.out.print('+');\n" +
- " System.out.print(d.accept(v, d.getClass().getName()));\n" +
- " System.out.print('+');\n" +
- " System.out.print(ab2.accept(v, ab2.getClass().getName()));\n" +
- " }\n" +
- " static class MyVisitor implements Visitor<String, String> {\n" +
- " public String visitBase(AbstractBase ab, String obj) { return \"Visited base: \" + obj; }\n" +
- " public String visitDerived(Derived d, String obj) { return \"Visited derived: \" + obj; }\n" +
- " }\n" +
- "}\n" +
- "interface Visitor<R, T> {\n" +
- " R visitBase(AbstractBase ab, T obj);\n" +
- " R visitDerived(Derived d, T obj);\n" +
- "}\n" +
- "interface Visitable {\n" +
- " <R, T> R accept(Visitor<R, T> v, T obj);\n" +
- "}\n" +
- "class AbstractBase implements Visitable {\n" +
- " public <R, T> R accept(Visitor<R, T> v, T obj) { return v.visitBase(this, obj); }\n" +
- "}\n" +
- "class Derived extends AbstractBase implements Visitable {\n" +
- " public <R, T> R accept(Visitor<R, T> v, T obj) { return v.visitDerived(this, obj); }\n" +
- "}\n"
- },
- "Visited base: AbstractBase+Visited derived: Derived+Visited derived: Derived"
- );
- }
-
- public void test021() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " public void foo(java.util.Map<String, Class<?>> m) { } \n" +
- "}\n",
- "B.java",
- "class B extends A {\n" +
- " @Override void foo(java.util.Map<String, Class<?>> m) { } \n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in B.java (at line 2)\r\n" +
- " @Override void foo(java.util.Map<String, Class<?>> m) { } \r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot reduce the visibility of the inherited method from A\n" +
- "----------\n"
- );
- // now save A & pick it up as a binary type
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " public void foo(java.util.Map<String, Class<?>> m) { } \n" +
- "}\n"
- },
- ""
- );
- this.runNegativeTest(
- new String[] {
- "B.java",
- "class B extends A {\n" +
- " @Override void foo(java.util.Map<String, Class<?>> m) { } \n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in B.java (at line 2)\r\n" +
- " @Override void foo(java.util.Map<String, Class<?>> m) { } \r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Cannot reduce the visibility of the inherited method from A\n" +
- "----------\n",
- null,
- false,
- null
- );
- }
-
- public void test022() { // 77562
- this.runConformTest(
- new String[] {
- "A.java",
- "import java.util.*;\n" +
- "class A { List getList() { return null; } }\n" +
- "class B extends A { @Override List<String> getList() { return null; } }\n"
- },
- ""
- );
- }
- public void test022a() { // 77562
- this.runNegativeTest(
- new String[] {
- "A.java",
- "import java.util.*;\n" +
- "class A { List<String> getList() { return null; } }\n" +
- "class B extends A { @Override List getList() { return null; } }\n"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 3)\n" +
- " class B extends A { @Override List getList() { return null; } }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 3)\n" +
- " class B extends A { @Override List getList() { return null; } }\n" +
- " ^^^^\n" +
- "Type safety: The return type List for getList() from the type B needs unchecked conversion to conform to List<String> from the type A\n" +
- "----------\n"
- // unchecked warning on B.getList()
- );
- }
-
- public void test023() { // 80739
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A<T> {\n" +
- " void foo(T t) {}\n" +
- " void foo(String i) {}\n" +
- "}\n" +
- "class B extends A<String> {}\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 5)\r\n" +
- " class B extends A<String> {}\r\n" +
- " ^\n" +
- "Duplicate methods named foo with the parameters (String) and (T) are defined by the type A<String>\n" +
- "----------\n"
- // methods foo(T) from A<java.lang.String> and foo(java.lang.String) from A<java.lang.String> are inherited with the same signature
- );
- }
-
- public void test024() { // 80626
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {\n" +
- " public <E extends Object> void m(E e) {}\n" +
- "}\n" +
- "class B extends A {\n" +
- " public void m(Object e) {}\n" +
- "}\n"
- },
- ""
- // no complaint
- );
- }
- public void test024a() { // 80626
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A {\n" +
- " public void m(Object e) {}\n" +
- "}\n" +
- "class B extends A {\n" +
- " public <E extends Object> void m(E e) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 5)\r\n" +
- " public <E extends Object> void m(E e) {}\r\n" +
- " ^^^^^^\n" +
- "Name clash: The method m(E) of type B has the same erasure as m(Object) of type A but does not override it\n" +
- "----------\n"
- // name clash: <E>m(E) in B and m(java.lang.Object) in A have the same erasure, yet neither overrides the other
- );
- }
- public void test024b() { // 80626
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A {\n" +
- " public <E extends Object> void m(E e) {}\n" +
- "}\n" +
- "class B extends A {\n" +
- " @Override public void m(Object e) {}\n" +
- "}\n" +
- "class C extends B {\n" +
- " public <E extends Object> void m(E e) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 8)\r\n" +
- " public <E extends Object> void m(E e) {}\r\n" +
- " ^^^^^^\n" +
- "Name clash: The method m(E) of type C has the same erasure as m(Object) of type B but does not override it\n" +
- "----------\n"
- // name clash: <E>m(E) in C and m(java.lang.Object) in B have the same erasure, yet neither overrides the other
- );
- }
-
- public void test025() { // 81618
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new B().test();\n" +
- " }\n" +
- "}\n" +
- "class A {\n" +
- " <T extends Number> T test() { return null; }\n" +
- "}\n" +
- "class B extends A {\n" +
- " @Override Integer test() { return 1; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " @Override Integer test() { return 1; }\n" +
- " ^^^^^^^\n" +
- "Type safety: The return type Integer for test() from the type B needs unchecked conversion to conform to T from the type A\n" +
- "----------\n"
- // warning: test() in B overrides <T>test() in A; return type requires unchecked conversion
- );
- }
- public void test025a() { // 81618
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new B().test();\n" +
- " }\n" +
- "}\n" +
- "class A {\n" +
- " <T extends Number> T[] test() { return null; }\n" +
- "}\n" +
- "class B extends A {\n" +
- " @Override Integer[] test() { return new Integer[] {2}; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " @Override Integer[] test() { return new Integer[] {2}; }\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The return type Integer[] for test() from the type B needs unchecked conversion to conform to T[] from the type A\n" +
- "----------\n"
- // warning: test() in B overrides <T>test() in A; return type requires unchecked conversion
- );
- }
- public void test025b() { // 81618
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new B().<Integer>test(new Integer(1)));\n" +
- " }\n" +
- "}\n" +
- "class A {\n" +
- " <T> T test(T t) { return null; }\n" +
- "}\n" +
- "class B extends A {\n" +
- " @Override <T> T test(T t) { return t; }\n" +
- "}\n"
- },
- "1"
- );
- }
- public void test025c() { // 81618
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(new B().<Number>test(1));\n" +
- " }\n" +
- "}\n" +
- "class A<T> {\n" +
- " <U> T test(U u) { return null; }\n" +
- "}\n" +
- "class B extends A<Integer> {\n" +
- " @Override <U> Integer test(U u) { return 1; }\n" +
- "}\n"
- },
- "1"
- );
- }
- public void test025d() { // 81618
- this.runConformTest(
- new String[] {
- "A.java",
- "import java.util.concurrent.Callable;\n" +
- "public class A {\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Callable<Integer> integerCallable = new Callable<Integer>() {\n" +
- " public Integer call() { return new Integer(1); }\n" +
- " };\n" +
- " System.out.println(integerCallable.call());\n" +
- " }\n" +
- "}\n"
- },
- "1"
- );
- }
- public void test025e() { // 81618
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface X<T extends X> { T x(); }\n" +
- "abstract class Y<S extends X> implements X<S> { public abstract S x(); }\n" +
- "abstract class Z implements X { public abstract X x(); }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " interface X<T extends X> { T x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " abstract class Y<S extends X> implements X<S> { public abstract S x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n"
- );
- }
- public void test025f() { // 81618
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface X<T extends X> { T[] x(); }\n" +
- "abstract class Y<S extends X> implements X<S> { public abstract S[] x(); }\n" +
- "abstract class Z implements X { public abstract X[] x(); }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " interface X<T extends X> { T[] x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " abstract class Y<S extends X> implements X<S> { public abstract S[] x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X[] x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X[] x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n"
- );
- }
-
- public void test026() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(\n" +
- " new B().test().getClass() + \" & \"\n" +
- " + new C().test().getClass() + \" & \"\n" +
- " + new D().test().getClass());\n" +
- " }\n" +
- "}\n" +
- "class A<T extends Number> {\n" +
- " A<T> test() { return this; }\n" +
- "}\n" +
- "class B extends A {\n" +
- " A test() { return super.test(); }\n" +
- "}\n" +
- "class C extends A<Integer> {\n" +
- " A<Integer> test() { return super.test(); }\n" +
- "}\n" +
- "class D<U, V extends Number> extends A<V> {\n" +
- " A<V> test() { return super.test(); }\n" +
- "}\n"
- },
- "class B & class C & class D"
- );
- }
- public void test026a() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public abstract class A<E> {\n" +
- " public abstract A<E> test();\n" +
- "}\n" +
- "class H<K,V> {\n" +
- " class M extends A<K> {\n" +
- " public A<K> test() { return null; }\n" +
- " }\n" +
- "}\n"
- },
- ""
- );
- }
- public void test026b() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends java.util.AbstractMap {\n" +
- " public java.util.Set entrySet() { return null; }\n" +
- "}\n"
- },
- ""
- );
- }
- public void test026c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(new C().test().getClass());\n" +
- " }\n" +
- "}\n" +
- "class A<T extends Number> {\n" +
- " A<T> test() { return this; }\n" +
- "}\n" +
- "class C extends A<Integer> {\n" +
- " @Override A test() { return super.test(); }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " @Override A test() { return super.test(); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 10)\n" +
- " @Override A test() { return super.test(); }\n" +
- " ^\n" +
- "Type safety: The return type A for test() from the type C needs unchecked conversion to conform to A<T> from the type A<T>\n" +
- "----------\n"
- // warning: test() in C overrides test() in A; return type requires unchecked conversion
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82102
- public void test027() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { <T> void test() {} }\n" +
- "class Y extends X { void test() {} }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82102
- public void test027a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void test() {} }\n" +
- "class Y extends X { <T> void test() {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " class Y extends X { <T> void test() {} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type Y has the same erasure as test() of type X but does not override it\n" +
- "----------\n"
- // name clash: <T>foo() in Y and foo() in X have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82102
- public void test027b() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X<T> { void test(T o) {} }\n" +
- "class Y<T> extends X<T> { void test(Object o) {} }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82102
- public void test027c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T> { void test(T o, T t) {} }\n" +
- "class Y<T> extends X<T> { void test(Object o, T t) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " class Y<T> extends X<T> { void test(Object o, T t) {} }\r\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method test(Object, T) of type Y<T> has the same erasure as test(T, T) of type X<T> but does not override it\n" +
- "----------\n"
- // name clash: test(java.lang.Object,T) in Y<T> and test(T,T) in X<T> have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82102
- public void test027d() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void test() {\n" +
- " Pair<Double, Integer> p = new InvertedPair<Integer, Double>();\n" +
- " p.setA(new Double(1.1));\n" +
- " }\n" +
- "}\n" +
- "class Pair<A, B> {\n" +
- " public void setA(A a) {}\n" +
- "}\n" +
- "class InvertedPair<A, B> extends Pair<B, A> {\n" +
- " public void setA(A a) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " public void setA(A a) {}\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method setA(A) of type InvertedPair<A,B> has the same erasure as setA(A) of type Pair<A,B> but does not override it\n" +
- "----------\n"
- // name clash: setA(A) in InvertedPair<A,B> and setA(A) in Pair<B,A> have the same erasure, yet neither overrides the other
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81727
- public void test028() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X implements I<X>{\n" +
- " public X foo() { return null; }\n" +
- "}\n" +
- "interface I<T extends I> { T foo(); }\n"
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81568
- public void test029() {
- this.runConformTest(
- new String[] {
- "I.java",
- "public interface I {\n" +
- " public I clone();\n" +
- "}\n" +
- "interface J extends I {}\n"
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81535
- public void test030() {
- java.util.Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
-
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.OutputStreamWriter;\n" +
- "import java.io.PrintWriter;\n" +
- "public class X extends PrintWriter implements Runnable {\n" +
- " public X(OutputStreamWriter out, boolean flag) { super(out, flag); }\n" +
- " public void run() {}\n" +
- "}\n"
- },
- "",
- null, // use default class-path
- false, // do not flush previous output dir content
- null, // no special vm args
- options,
- null
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80743
- public void test031() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface X { long hashCode(); }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " interface X { long hashCode(); }\r\n" +
- " ^^^^\n" +
- "The return type is incompatible with Object.hashCode()\n" +
- "----------\n"
- // hashCode() in X cannot override hashCode() in java.lang.Object; attempting to use incompatible return type
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80736 & https://bugs.eclipse.org/bugs/show_bug.cgi?id=113273
- public void test032() {
- // NOTE: javac only reports these errors when the problem type follows the bounds
- // if the type X is defined first, then no errors are reported
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I { Integer foo(); }\n" +
- "interface J { Integer foo(); }\n" +
- "public class X<T extends I&J> implements I {\n" +
- " public Integer foo() { return null; }\n" +
- "}"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80736 & https://bugs.eclipse.org/bugs/show_bug.cgi?id=113273
- public void test032a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I { Float foo(); }\n" +
- "interface J { Integer foo(); }\n" +
- "public class X<T extends I&J> {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " public class X<T extends I&J> {}\r\n" +
- " ^\n" +
- "The return type is incompatible with J.foo(), I.foo()\n" +
- "----------\n"
- // types J and I are incompatible; both define foo(), but with unrelated return types
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80736 & https://bugs.eclipse.org/bugs/show_bug.cgi?id=113273
- public void test032b() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I { String foo(); }\n" +
- "class A { public Object foo() { return null; } }" +
- "public class X<T extends A&I> {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " class A { public Object foo() { return null; } }public class X<T extends A&I> {}\r\n" +
- " ^\n" +
- "The return type is incompatible with I.foo(), A.foo()\n" +
- "----------\n"
- // foo() in A cannot implement foo() in I; attempting to use incompatible return type
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80745
- public void test033() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I { Number foo(); }\n" +
- "interface J { Integer foo(); }\n" +
- "public class X implements I, J {\n" +
- " public Integer foo() {return 1;}\n" +
- " public static void main(String argv[]) {\n" +
- " I i = null;\n" +
- " J j = null;\n" +
- " System.out.print(i instanceof J);\n" +
- " System.out.print('=');\n" +
- " System.out.print(j instanceof I);\n" +
- " }\n" +
- "}\n"
- },
- "false=false"
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80745
- public void test033a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I { Number foo(A a); }\n" +
- "interface J<T> { Integer foo(A<T> a); }\n" +
- "class A<T>{}\n" +
- "public class X implements I, J {\n" +
- " public Integer foo(A a) {return 1;}\n" +
- " public static void main(String argv[]) {\n" +
- " I i = null;\n" +
- " J j = null;\n" +
- " System.out.print(i instanceof J);\n" +
- " System.out.print('=');\n" +
- " System.out.print(j instanceof I);\n" +
- " }\n" +
- "}\n"
- },
- "false=false"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81332
- public void test034() {
- this.runConformTest(
- new String[] {
- "B.java",
- "interface I<E extends Comparable<E>> { void test(E element); }\n" +
- "class A implements I<Integer> { public void test(Integer i) {} }\n" +
- "public class B extends A { public void test(String i) {} }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81332
- public void test034a() {
- this.runConformTest(
- new String[] {
- "B.java",
- "interface I<E extends Comparable> { void test(E element); }\n" +
- "class A { public void test(Integer i) {} }\n" +
- "public class B extends A implements I<Integer> {}\n" +
- "class C extends B { public void test(Object i) {} }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81332
- public void test034b() {
- this.runNegativeTest(
- new String[] {
- "B.java",
- "interface I<E extends Comparable> { void test(E element); }\n" +
- "class A { public void test(Integer i) {} }\n" +
- "public class B extends A implements I<Integer> { public void test(Comparable i) {} }\n"
- },
- "----------\n" +
- "1. WARNING in B.java (at line 1)\n" +
- " interface I<E extends Comparable> { void test(E element); }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 3)\n" +
- " public class B extends A implements I<Integer> { public void test(Comparable i) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method test(Comparable) of type B has the same erasure as test(E) of type I<E> but does not override it\n" +
- "----------\n" +
- "3. WARNING in B.java (at line 3)\n" +
- " public class B extends A implements I<Integer> { public void test(Comparable i) {} }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n"
- // name clash: test(java.lang.Comparable) in B and test(E) in I<java.lang.Integer> have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81332
- public void test034c() {
- this.runNegativeTest(
- new String[] {
- "B.java",
- "interface I<E extends Comparable<E>> { void test(E element); }\n" +
- "class A implements I<Integer> { public void test(Integer i) {} }\n" +
- "public class B extends A { public void test(Comparable i) {} }\n"
- },
- "----------\n" +
- "1. ERROR in B.java (at line 3)\n" +
- " public class B extends A { public void test(Comparable i) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method test(Comparable) of type B has the same erasure as test(E) of type I<E> but does not override it\n" +
- "----------\n" +
- "2. WARNING in B.java (at line 3)\n" +
- " public class B extends A { public void test(Comparable i) {} }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n"
- // name clash: test(java.lang.Comparable) in B and test(E) in I<java.lang.Integer> have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81332
- public void test034d() {
- this.runNegativeTest(
- new String[] {
- "B.java",
- "abstract class AA<E extends Comparable> { abstract void test(E element); }\n" +
- "class A extends AA<Integer> { @Override public void test(Integer i) {} }\n" +
- "public class B extends A { public void test(Comparable i) {} }\n"
- },
- "----------\n" +
- "1. WARNING in B.java (at line 1)\n" +
- " abstract class AA<E extends Comparable> { abstract void test(E element); }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 3)\n" +
- " public class B extends A { public void test(Comparable i) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method test(Comparable) of type B has the same erasure as test(E) of type AA<E> but does not override it\n" +
- "----------\n" +
- "3. WARNING in B.java (at line 3)\n" +
- " public class B extends A { public void test(Comparable i) {} }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n"
- // name clash: test(java.lang.Comparable) in B and test(E) in AA<java.lang.Integer> have the same erasure, yet neither overrides the other
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80626
- public void test035() {
- this.runNegativeTest(
- new String[] {
- "E.java",
- "interface I<U>{ int compareTo(U o); }\n" +
- "abstract class F<T extends F<T>> implements I<T>{ public final int compareTo(T o) { return 0; } }\n" +
- "public class E extends F<E> { public int compareTo(Object o) { return 0; } }\n"
- },
- "----------\n" +
- "1. ERROR in E.java (at line 3)\n" +
- " public class E extends F<E> { public int compareTo(Object o) { return 0; } }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method compareTo(Object) of type E has the same erasure as compareTo(U) of type I<U> but does not override it\n" +
- "----------\n"
- // name clash: compareTo(java.lang.Object) in E and compareTo(U) in I<E> have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80626
- public void test035a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public enum X {\n" +
- " ;\n" +
- " public int compareTo(Object o) { return 0; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " public int compareTo(Object o) { return 0; }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method compareTo(Object) of type X has the same erasure as compareTo(T) of type Comparable<T> but does not override it\n" +
- "----------\n"
- // name clash: compareTo(java.lang.Object) in X and compareTo(T) in java.lang.Comparable<X> have the same erasure, yet neither overrides the other
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036() { // 2 interface cases
- // no bridge methods are created in these conform cases so no name clashes can occur
- this.runConformTest(
- new String[] {
- "X.java",
- "class X implements Equivalent, EqualityComparable {\n" +
- " public boolean equalTo(Object other) { return true; }\n" +
- "}\n" +
- "abstract class Y implements Equivalent, EqualityComparable {}\n" +
- "class Z extends Y {\n" +
- " public boolean equalTo(Object other) { return true; }\n" +
- "}\n" +
- "interface Equivalent<T> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<T> { boolean equalTo(T other); }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036a() { // 2 interface cases
- this.runConformTest(
- new String[] {
- "X.java",
- "class X implements Equivalent, EqualityComparable {\n" +
- " public boolean equalTo(Comparable other) { return true; }\n" +
- " public boolean equalTo(Number other) { return true; }\n" +
- "}\n" +
- "abstract class Y implements Equivalent, EqualityComparable {}\n" +
- "class Z extends Y {\n" +
- " public boolean equalTo(Comparable other) { return true; }\n" +
- " public boolean equalTo(Number other) { return true; }\n" +
- "}\n" +
- "interface Equivalent<T extends Comparable> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<T extends Number> { boolean equalTo(T other); }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036b() { // 2 interface cases
- this.runConformTest(
- new String[] {
- "X.java",
- "class X<S> implements Equivalent<S>, EqualityComparable<S> {\n" +
- " public boolean equalTo(S other) { return true; }\n" +
- "}\n" +
- "abstract class Y<S> implements Equivalent<S>, EqualityComparable<S> {}\n" +
- "class Z<U> extends Y<U> {\n" +
- " public boolean equalTo(U other) { return true; }\n" +
- "}\n" +
- "interface Equivalent<T> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<T> { boolean equalTo(T other); }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036c() { // 2 interface cases
- this.runConformTest(
- new String[] {
- "X.java",
- "class X<T extends Comparable, S extends Number> implements Equivalent<T>, EqualityComparable<S> {\n" +
- " public boolean equalTo(T other) { return true; }\n" +
- " public boolean equalTo(S other) { return true; }\n" +
- "}\n" +
- "abstract class Y<T extends Comparable, S extends Number> implements Equivalent<T>, EqualityComparable<S> {}\n" +
- "class Z<U extends Comparable, V extends Number> extends Y<U, V> {\n" +
- " public boolean equalTo(U other) { return true; }\n" +
- " public boolean equalTo(V other) { return true; }\n" +
- "}\n" +
- "interface Equivalent<T extends Comparable> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<S extends Number> { boolean equalTo(S other); }\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036d() { // 2 interface cases
- // in these cases, bridge methods are needed once abstract/concrete methods are defiined (either in the abstract class or a concrete subclass)
- this.runConformTest(
- new String[] {
- "Y.java",
- "abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
- " public abstract boolean equalTo(Number other);\n" +
- "}\n" +
- "interface Equivalent<T> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<T> { boolean equalTo(T other); }\n"
- },
- ""
- // no bridge methods are created here since Y does not define an equalTo(?) method which equals an inherited equalTo method
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036e() { // 2 interface cases
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
- " public abstract boolean equalTo(Object other);\n" +
- "}\n" +
- "interface Equivalent<T> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<T> { boolean equalTo(T other); }\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 2)\n" +
- " public abstract boolean equalTo(Object other);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 2)\n" +
- " public abstract boolean equalTo(Object other);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" +
- "----------\n"
- // name clash: equalTo(java.lang.Object) in Y and equalTo(T) in Equivalent<java.lang.String> have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036f() { // 2 interface cases
- // NOTE: javac has a bug, reverse the implemented interfaces & the name clash goes away
- // but eventually when a concrete subclass must define the remaining method, the error shows up
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
- " public abstract boolean equalTo(String other);\n" +
- "}\n" +
- "interface Equivalent<T> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<T> { boolean equalTo(T other); }\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" +
- " ^\n" +
- "Name clash: The method equalTo(T) of type Equivalent<T> has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" +
- "----------\n"
- // name clash: equalTo(T) in Equivalent<java.lang.String> and equalTo(T) in EqualityComparable<java.lang.Integer> have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83162
- public void test036g() { // 2 interface cases
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "abstract class Y implements EqualityComparable<Integer>, Equivalent<String> {\n" +
- " public boolean equalTo(Integer other) { return true; }\n" +
- "}\n" +
- "interface Equivalent<T> { boolean equalTo(T other); }\n" +
- "interface EqualityComparable<T> { boolean equalTo(T other); }\n"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 1)\n" +
- " abstract class Y implements EqualityComparable<Integer>, Equivalent<String> {\n" +
- " ^\n" +
- "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" +
- "----------\n"
- // name clash: equalTo(T) in EqualityComparable<java.lang.Integer> and equalTo(T) in Equivalent<java.lang.String> have the same erasure, yet neither overrides the other
- );
- }
-
- public void test037() { // test inheritance scenarios
- this.runConformTest(
- new String[] {
- "X.java",
- "public abstract class X implements I, J { }\n" +
- "abstract class Y implements J, I { }\n" +
- "abstract class Z implements K { }\n" +
-
- "class YYY implements J, I { public void foo(A a) {} }\n" +
- "class XXX implements I, J { public void foo(A a) {} }\n" +
- "class ZZZ implements K { public void foo(A a) {} }\n" +
-
- "interface I { void foo(A a); }\n" +
- "interface J { void foo(A<String> a); }\n" +
- "interface K extends I { void foo(A<String> a); }\n" +
- "class A<T> {}"
- },
- ""
- );
- }
- public void test037a() { // test inheritance scenarios
- this.runNegativeTest(
- new String[] {
- "XX.java",
- "public abstract class XX implements I, J { public abstract void foo(A<String> a); }\n" +
- "interface I { void foo(A a); }\n" +
- "interface J { void foo(A<String> a); }\n" +
- "class A<T> {}"
- },
- "----------\n" +
- "1. ERROR in XX.java (at line 1)\n" +
- " public abstract class XX implements I, J { public abstract void foo(A<String> a); }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type XX has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "2. WARNING in XX.java (at line 2)\n" +
- " interface I { void foo(A a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n"
- // name clash: foo(A<java.lang.String>) in XX and foo(A) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test037b() { // test inheritance scenarios
- this.runNegativeTest(
- new String[] {
- "XX.java",
- "public class XX implements I, J { public void foo(A<String> a) {} }\n" +
- "class YY implements J, I { public void foo(A<String> a) {} }\n" +
- "class ZZ implements K { public void foo(A<String> a) {} }\n" +
-
- "interface I { void foo(A a); }\n" +
- "interface J { void foo(A<String> a); }\n" +
- "interface K extends I { void foo(A<String> a); }\n" +
- "class A<T> {}"
- },
- "----------\n" +
- "1. ERROR in XX.java (at line 1)\n" +
- " public class XX implements I, J { public void foo(A<String> a) {} }\n" +
- " ^^\n" +
- "The type XX must implement the inherited abstract method I.foo(A)\n" +
- "----------\n" +
- "2. ERROR in XX.java (at line 1)\n" +
- " public class XX implements I, J { public void foo(A<String> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type XX has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "3. ERROR in XX.java (at line 2)\n" +
- " class YY implements J, I { public void foo(A<String> a) {} }\n" +
- " ^^\n" +
- "The type YY must implement the inherited abstract method I.foo(A)\n" +
- "----------\n" +
- "4. ERROR in XX.java (at line 2)\n" +
- " class YY implements J, I { public void foo(A<String> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type YY has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "5. ERROR in XX.java (at line 3)\n" +
- " class ZZ implements K { public void foo(A<String> a) {} }\n" +
- " ^^\n" +
- "The type ZZ must implement the inherited abstract method I.foo(A)\n" +
- "----------\n" +
- "6. ERROR in XX.java (at line 3)\n" +
- " class ZZ implements K { public void foo(A<String> a) {} }\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<String>) of type ZZ has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "7. WARNING in XX.java (at line 4)\n" +
- " interface I { void foo(A a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n"
- // XX/YY/ZZ is not abstract and does not override abstract method foo(A) in I
- );
- }
- public void test037c() { // test inheritance scenarios
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A a); }\n" +
- "class Y { void foo(A<String> a) {} }\n" +
- "class A<T> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public abstract class X extends Y implements I { }\n" +
- " ^\n" +
- "Name clash: The method foo(A<String>) of type Y has the same erasure as foo(A) of type I but does not override it\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " interface I { void foo(A a); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n"
- // name clash: foo(A<java.lang.String>) in Y and foo(A) in I have the same erasure, yet neither overrides the other
- );
- }
- public void test037d() { // test inheritance scenarios
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X extends Y implements I { }\n" +
- "interface I { void foo(A<String> a); }\n" +
- "class Y { void foo(A a) {} }\n" +
- "class A<T> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public abstract class X extends Y implements I { }\n" +
- " ^\n" +
- "The inherited method Y.foo(A) cannot hide the public abstract method in I\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " class Y { void foo(A a) {} }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n"
- // foo(A) in Y cannot implement foo(A<java.lang.String>) in I; attempting to assign weaker access privileges; was public
- );
- }
- public void test037e() { // test inheritance scenarios
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X extends Y implements I { }\n" +
- "interface I { <T, S> void foo(T t); }\n" +
- "class Y { <T> void foo(T t) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " public abstract class X extends Y implements I { }\r\n" +
- " ^\n" +
- "Name clash: The method foo(T) of type Y has the same erasure as foo(T) of type I but does not override it\n" +
- "----------\n"
- // name clash: <T>foo(T) in Y and <T,S>foo(T) in I have the same erasure, yet neither overrides the other
- );
- }
-
- public void test038() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends H<Object> { void foo(A<?> a) { super.foo(a); } }\n" +
- "class H<T extends Object> { void foo(A<? extends T> a) {} }\n" +
- "class A<T> {}"
- },
- ""
- );
- }
- public void test038a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X extends H<Number> { void foo(A<?> a) {} }\n" +
- "class H<T extends Number> { void foo(A<? extends T> a) {} }\n" +
- "class A<T> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " public class X extends H<Number> { void foo(A<?> a) {} }\r\n" +
- " ^^^^^^^^^^^\n" +
- "Name clash: The method foo(A<?>) of type X has the same erasure as foo(A<? extends T>) of type H<T> but does not override it\n" +
- "----------\n"
- // name clash: foo(A<?>) in X and foo(A<? extends T>) in H<java.lang.Number> have the same erasure, yet neither overrides the other
- // with public class X extends H<Number> { void foo(A<?> a) { super.foo(a); } }
- // foo(A<? extends java.lang.Number>) in H<java.lang.Number> cannot be applied to (A<capture of ?>)
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83573
- public void test039() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Test test = new Test();\n" +
- " This test2 = new Test();\n" +
- " System.out.println(test.get());\n" +
- " }\n" +
- " interface This {\n" +
- " public Object get();\n" +
- " }\n" +
- " \n" +
- " interface That extends This {\n" +
- " public String get();\n" +
- " \n" +
- " }\n" +
- " \n" +
- " static class Test implements That {\n" +
- " \n" +
- " public String get() {\n" +
- " return \"That\";\n" +
- " \n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- "That"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83218
- public void test040() {
- this.runNegativeTest(
- new String[] {
- "Base.java",
- "interface Base<E> { Base<E> proc(); }\n" +
- "abstract class Derived<D> implements Base<D> { public abstract Derived<D> proc(); }\n"
- },
- "" // no warnings
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83218
- public void test040a() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T extends Number> T test() { return null; } }\n" +
- "class B extends A { @Override Integer test() { return 1; } }\n"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 2)\n" +
- " class B extends A { @Override Integer test() { return 1; } }\n" +
- " ^^^^^^^\n" +
- "Type safety: The return type Integer for test() from the type B needs unchecked conversion to conform to T from the type A\n" +
- "----------\n"
- // warning: test() in B overrides <T>test() in A; return type requires unchecked conversion
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83218
- public void test040b() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "import java.util.*;\n" +
- "class A { List<String> getList() { return null; } }\n" +
- "class B extends A { @Override List getList() { return null; } }\n"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 3)\n" +
- " class B extends A { @Override List getList() { return null; } }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 3)\n" +
- " class B extends A { @Override List getList() { return null; } }\n" +
- " ^^^^\n" +
- "Type safety: The return type List for getList() from the type B needs unchecked conversion to conform to List<String> from the type A\n" +
- "----------\n"
- // unchecked warning on B.getList()
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83218
- public void test040c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface X<T> { X<T> x(); }\n" +
- "abstract class Y<S> implements X<S> { public abstract X x(); }\n" + // warning: x() in Y implements x() in X; return type requires unchecked conversion
- "abstract class Z implements X { public abstract X x(); }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " abstract class Y<S> implements X<S> { public abstract X x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " abstract class Y<S> implements X<S> { public abstract X x(); }\n" +
- " ^\n" +
- "Type safety: The return type X for x() from the type Y<S> needs unchecked conversion to conform to X<T> from the type X<T>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n"
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83218
- public void test040d() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface X<T> { X<T>[] x(); }\n" +
- "abstract class Y<S> implements X<S> { public abstract X[] x(); }\n" + // warning: x() in Y implements x() in X; return type requires unchecked conversion
- "abstract class Z implements X { public abstract X[] x(); }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " abstract class Y<S> implements X<S> { public abstract X[] x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " abstract class Y<S> implements X<S> { public abstract X[] x(); }\n" +
- " ^^^\n" +
- "Type safety: The return type X[] for x() from the type Y<S> needs unchecked conversion to conform to X<T>[] from the type X<T>\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X[] x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\n" +
- " abstract class Z implements X { public abstract X[] x(); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<T> should be parameterized\n" +
- "----------\n"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83902
- public void test041() { // inherited cases for bridge methods, varargs clashes, return type conversion checks
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { public void foo(String... n) {} }\n" +
- "interface I { void foo(String[] n); }\n" +
- "class Y extends X implements I { }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class Y extends X implements I { }\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike X.foo(String...) and I.foo(String[])\n" +
- "----------\n"
- // warning: foo(java.lang.String...) in X cannot implement foo(java.lang.String[]) in I; overridden method has no '...'
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83902
- public void test041a() { // inherited cases for bridge methods, varargs clashes, return type conversion checks
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { public void foo(String[] n) {} }\n" +
- "interface I { void foo(String... n); }\n" +
- "class Y extends X implements I { }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class Y extends X implements I { }\n" +
- " ^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike X.foo(String[]) and I.foo(String...)\n" +
- "----------\n"
- // warning: foo(java.lang.String[]) in X cannot implement foo(java.lang.String...) in I; overriding method is missing '...'
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83902
- public void test041b() { // inherited cases for bridge methods, varargs clashes, return type conversion checks
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public Y foo() {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " ((I) new Y()).foo();\n" +
- " }\n" +
- "}\n" +
- "interface I { X foo(); }\n" +
- "class Y extends X implements I { }\n"
- },
- "SUCCESS"
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83902
- public void test041c() { // inherited cases for bridge methods, varargs clashes, return type conversion checks
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { public A foo() { return null; } }\n" +
- "interface I { A<String> foo(); }\n" +
- "class Y extends X implements I { }\n" +
- "class A<T> { }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " public class X { public A foo() { return null; } }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 3)\n" +
- " class Y extends X implements I { }\n" +
- " ^\n" +
- "Type safety: The return type A for foo() from the type X needs unchecked conversion to conform to A<String> from the type I\n" +
- "----------\n"
- // warning: foo() in X implements foo() in I; return type requires unchecked conversion
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83902
- public void test041d() { // inherited cases for bridge methods, varargs clashes, return type conversion checks
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { public Object foo() { return null; } }\n" +
- "interface I { <T> T foo(); }\n" +
- "class Y extends X implements I { }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class Y extends X implements I { }\n" +
- " ^\n" +
- "Type safety: The return type Object for foo() from the type X needs unchecked conversion to conform to T from the type I\n" +
- "----------\n"
- // NOTE: javac issues an error & a warning which contradict each other
- // if the method Object foo() is implemented in Y then only the warning is issued, so X should be allowed to implement the method
- // Y is not abstract and does not override abstract method <T>foo() in I
- // warning: foo() in X implements <T>foo() in I; return type requires unchecked conversion
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85930
- public void test042() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface Callable<T>\n" +
- "{\n" +
- " public enum Result { GOOD, BAD };\n" +
- " public Result call(T arg);\n" +
- "}\n" +
- "\n" +
- "public class X implements Callable<String>\n" +
- "{\n" +
- " public Result call(String arg) { return Result.GOOD; } // Warning line\n" +
- "}\n"
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=72704
- public void test043() { // ambiguous message sends because of substitution from 2 different type variables
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void test(E<Integer,Integer> e) { e.id(new Integer(1)); } }\n" +
- "abstract class C<A> { public abstract void id(A x); }\n" +
- "interface I<B> { void id(B x); }\n" +
- "abstract class E<A, B> extends C<A> implements I<B> {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " abstract class E<A, B> extends C<A> implements I<B> {}\n" +
- " ^\n" +
- "Name clash: The method id(A) of type C<A> has the same erasure as id(B) of type I<B> but does not override it\n" +
- "----------\n"
- // javac won't report it until C.id() is made concrete or implemented in E
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=72704
- public void test043a() { // ambiguous message sends because of substitution from 2 different type variables
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void test(E<Integer,Integer> e) { e.id(new Integer(2)); } }\n" +
- "abstract class C<A extends Number> { public abstract void id(A x); }\n" +
- "interface I<B> { void id(B x); }\n" +
- "abstract class E<A extends Number, B> extends C<A> implements I<B> {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " public class X { void test(E<Integer,Integer> e) { e.id(new Integer(2)); } }\r\n" +
- " ^^\n" +
- "The method id(Integer) is ambiguous for the type E<Integer,Integer>\n" +
- "----------\n"
- // reference to id is ambiguous, both method id(A) in C<java.lang.Integer> and method id(B) in I<java.lang.Integer> match
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=72704
- public void test043b() { // ambiguous message sends because of substitution from 2 different type variables
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void test(E<Integer,Integer> e) { e.id(new Integer(111)); } }\n" +
- "abstract class C<A extends Number> { public void id(A x) {} }\n" +
- "interface I<B> { void id(B x); }\n" +
- "class E<A extends Number, B> extends C<A> implements I<B> { public void id(B b) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " public class X { void test(E<Integer,Integer> e) { e.id(new Integer(111)); } }\r\n" +
- " ^^\n" +
- "The method id(Integer) is ambiguous for the type E<Integer,Integer>\n" +
- "----------\n"
- // reference to id is ambiguous, both method id(A) in C<java.lang.Integer> and method id(B) in E<java.lang.Integer,java.lang.Integer> match
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=72704
- public void test043c() { // ambiguous message sends because of substitution from 2 different type variables
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void test(E<Integer,Integer> e) { e.id(new Integer(111)); }\n" +
- " void test(M<Integer,Integer> m) {\n" +
- " m.id(new Integer(111));\n" +
- " ((E<Integer, Integer>) m).id(new Integer(111));\n" +
- " }\n" +
- " void test(N<Integer> n) { n.id(new Integer(111)); }\n" +
- "}\n" +
- "abstract class C<A extends Number> { public void id(A x) {} }\n" +
- "interface I<B> { void id(B x); }\n" +
- "abstract class E<A extends Number, B> extends C<A> implements I<B> {}\n" +
- "class M<A extends Number, B> extends E<A, B> { public void id(B b) {} }\n" +
- "abstract class N<T extends Number> extends E<T, Number> { @Override public void id(T n) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " m.id(new Integer(111));\r\n" +
- " ^^\n" +
- "The method id(Integer) is ambiguous for the type M<Integer,Integer>\n" +
- "----------\n"
- // reference to id is ambiguous, both method id(A) in C<java.lang.Integer> and method id(B) in M<java.lang.Integer,java.lang.Integer> match
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97161
- public void test043d() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p.Y.*;\n" +
- "import static p.Z.*;\n" +
- "public class X {\n" +
- " Y data = null;\n" +
- " public X() { foo(data.l); }\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "import java.util.List;\n" +
- "public class Y {\n" +
- " List l = null;\n" +
- " public static <T> void foo(T... e) {}\n" +
- "}\n",
- "p/Z.java",
- "package p;\n" +
- "import java.util.List;\n" +
- "public class Z {\n" +
- " public static <T> void foo(List<T>... e) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List...) of the generic method foo(List<T>...) of type Z\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 6)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 4)\n" +
- " List l = null;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n"
- // unchecked conversion warnings
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97161
- public void test043e() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p.Y.*;\n" +
- "public class X {\n" +
- " Y data = null;\n" +
- " public X() { foo(data.l); }\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "import java.util.List;\n" +
- "public class Y {\n" +
- " List l = null;\n" +
- " public static <T> void foo(T... e) {}\n" +
- " public static <T> void foo(List<T>... e) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation foo(List...) of the generic method foo(List<T>...) of type Y\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 5)\n" +
- " public X() { foo(data.l); }\n" +
- " ^^^^^^\n" +
- "Type safety: The expression of type List needs unchecked conversion to conform to List<T>\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in p\\Y.java (at line 4)\n" +
- " List l = null;\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n"
- // unchecked conversion warnings
- );
- }
-
- public void test043f() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void test(M<Integer,Integer> m) {\n" +
- " m.id(new Integer(111), new Integer(112));\n" +
- " }\n" +
- "}\n" +
- "abstract class C<T1 extends Number> { public <U1 extends Number> void id(T1 x, U1 u) {} }\n" +
- "interface I<T2> { }\n" +
- "abstract class E<T3 extends Number, T4> extends C<T3> implements I<T4> {}\n" +
- "class M<T5 extends Number, T6> extends E<T5, T6> { public <U2 extends Number> void id(T5 b, U2 u) {} }\n"
- },
- ""
- );
- }
- public void test043g() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void test(M<Integer,Integer> m) {\n" +
- " m.id(new Integer(111));\n" +
- " }\n" +
- "}\n" +
- "abstract class C<T1 extends Number> { public void id(T1 x) {} }\n" +
- "interface I<T2> { void id(T2 x); }\n" +
- "abstract class E<T3 extends Number, T4> extends C<T3> implements I<T4> {}\n" +
- "class M<T5 extends Number, T6> extends E<T5, T6> { public void id(T6 b) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " m.id(new Integer(111));\n" +
- " ^^\n" +
- "The method id(Integer) is ambiguous for the type M<Integer,Integer>\n" +
- "----------\n"
- // reference to id is ambiguous, both method id(A) in C<java.lang.Integer> and method id(B) in M<java.lang.Integer,java.lang.Integer> match
- );
- }
-
- // ensure AccOverriding remains when attempting to override final method
- public void test044() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { final void foo() {} }\n" +
- "class XS extends X { @Override void foo() {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " class XS extends X { @Override void foo() {} }\n" +
- " ^^^^^\n" +
- "Cannot override the final method from X\n" +
- "----------\n"
- );
- }
- // ensure AccOverriding remains when attempting to override final method
- public void test044a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { public void foo() {} }\n" +
- "class XS extends X { @Override void foo() {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " class XS extends X { @Override void foo() {} }\n" +
- " ^^^^^\n" +
- "Cannot reduce the visibility of the inherited method from X\n" +
- "----------\n"
- );
- }
- // ensure AccOverriding remains when attempting to override final method
- public void test044b() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void foo() {} }\n" +
- "class XS extends X { @Override void foo() throws ClassNotFoundException {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " class XS extends X { @Override void foo() throws ClassNotFoundException {} }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception ClassNotFoundException is not compatible with throws clause in X.foo()\n" +
- "----------\n"
- );
- }
- // ensure AccOverriding remains when attempting to override final method
- public void test044c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void foo() {} }\n" +
- "class XS extends X { @Override int foo() {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " class XS extends X { @Override int foo() {} }\n" +
- " ^^^\n" +
- "The return type is incompatible with X.foo()\n" +
- "----------\n"
- );
- }
-
- public void test045() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class Foo {}\n" +
- "\n" +
- "interface Bar {\n" +
- " Foo get(Class<?> c);\n" +
- "}\n" +
- "public class X implements Bar {\n" +
- " public Foo get(Class c) { return null; }\n" +
- "}\n"
- },
- ""
- );
- }
-
- // ensure no unchecked warning
- public void test046() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface IX <T> {\n" +
- " public T doSomething();\n" +
- "}\n" +
- "public class X implements IX<Integer> {\n" +
- " Zork z;\n" +
- " public Integer doSomething() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87157
- public void test047() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface Interface {\n" +
- " Number getValue();\n" +
- "}\n" +
- "class C1 {\n" +
- " public Double getValue() {\n" +
- " return 0.0;\n" +
- " }\n" +
- "}\n" +
- "public class X extends C1 implements Interface{\n" +
- " public static void main(String[] args) {\n" +
- " Interface i=new X();\n" +
- " System.out.println(i.getValue());\n" +
- " }\n" +
- "}\n"
- },
- "0.0");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048() {
- this.runConformTest(
- new String[] {
- "X1.java",
- "import java.util.*;\n" +
- "public class X1 extends LinkedHashMap<String, String> {\n" +
- " public Object putAll(Map<String,String> a) { return null; }\n" +
- "}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048a() {
- this.runConformTest(
- new String[] {
- "X2.java",
- "public class X2 extends Y<String> {\n" +
- " public Object foo(I<String> z) { return null; }\n" +
- "}\n" +
- "class Y<T> implements I<T> {\n" +
- " public void foo(I<? extends T> a) {}\n" +
- "}\n" +
- "interface I<T> {\n" +
- " public void foo(I<? extends T> a);\n" +
- "}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048b() {
- this.runNegativeTest(
- new String[] {
- "X3.java",
- "public class X3 extends Y<String> {\n" +
- " public void foo(I<String> z) {}\n" +
- "}\n" +
- "class Y<T> implements I<T> {\n" +
- " public void foo(I<? extends T> a) {}\n" +
- "}\n" +
- "interface I<T> {\n" +
- " public void foo(I<? extends T> a);\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X3.java (at line 2)\r\n" +
- " public void foo(I<String> z) {}\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X3 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
- "----------\n"
- // name clash: foo(I<java.lang.String>) in X and foo(I<? extends T>) in Y<java.lang.String> have the same erasure, yet neither overrides the other
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048c() {
- this.runConformTest(
- new String[] {
- "X4.java",
- "public class X4 extends Y<String> {\n" +
- " public String foo(I<String> z) { return null; }\n" +
- "}\n" +
- "class Y<T> implements I<T> {\n" +
- " public Object foo(I<? extends T> a) { return null; }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " public Object foo(I<? extends T> a);\n" +
- "}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048d() {
- this.runConformTest(
- new String[] {
- "X5.java",
- "public class X5 extends Y<String> {\n" +
- " public Object foo(I<String> z) { return null; }\n" +
- "}\n" +
- "class Y<T> implements I<T> {\n" +
- " public String foo(I<? extends T> a) { return null; }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " public String foo(I<? extends T> a);\n" +
- "}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048e() {
- this.runConformTest(
- new String[] {
- "X6.java",
- "public class X6 extends Y<String> {\n" +
- " public void foo(I<String> z) {}\n" +
- "}\n" +
- "class Y<T> implements I<T> {\n" +
- " public Object foo(I<? extends T> a) { return null; }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " public Object foo(I<? extends T> a);\n" +
- "}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048f() {
- this.runConformTest(
- new String[] {
- "X7.java",
- "public class X7 extends Y<String> {\n" +
- " public String foo(I<String> z) { return null; }\n" +
- "}\n" +
- "class Y<T> implements I<T> {\n" +
- " public T foo(I<? extends T> a) { return null; }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " public T foo(I<? extends T> a);\n" +
- "}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900
- public void test048g() {
- this.runNegativeTest(
- new String[] {
- "X8.java",
- "public class X8 extends Y<String> {\n" +
- " public Object foo(I<String> z) { return null; }\n" +
- "}\n" +
- "class Y<T> implements I<T> {\n" +
- " public T foo(I<? extends T> a) { return null; }\n" +
- "}\n" +
- "interface I<T> {\n" +
- " public T foo(I<? extends T> a);\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X8.java (at line 2)\r\n" +
- " public Object foo(I<String> z) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo(I<String>) of type X8 has the same erasure as foo(I<? extends T>) of type Y<T> but does not override it\n" +
- "----------\n"
- // name clash: foo(I<java.lang.String>) in X7 and foo(I<? extends T>) in Y<java.lang.String> have the same erasure, yet neither overrides the other
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88094
- public void test049() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T> {\n" +
- " T id(T x) { return x; }\n" +
- " A id(A x) { return x; }\n" +
- "}\n" +
- "class Y<T extends A> extends X<T> {\n" +
- " @Override T id(T x) { return x; }\n" +
- " @Override A id(A x) { return x; }\n" +
- "}\n" +
- "class A {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " class Y<T extends A> extends X<T> {\n" +
- " ^\n" +
- "Name clash: The method id(A) of type X<T> has the same erasure as id(T) of type X<T> but does not override it\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " @Override T id(T x) { return x; }\n" +
- " ^^^^^^^\n" +
- "Method id(T) has the same erasure id(A) as another method in type Y<T>\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " @Override A id(A x) { return x; }\n" +
- " ^^^^^^^\n" +
- "Duplicate method id(A) in type Y<T>\n" +
- "----------\n"
- // id(T) is already defined in Y
- // id(java.lang.String) in Y overrides id(T) in X; return type requires unchecked conversion
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754
- public void test050() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static <S extends A> S foo() { System.out.print(\"A\"); return null; }\n" +
- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
- " public static void main(String[] args) {\n" +
- " X.<A>foo();\n" +
- " X.<B>foo();\n" +
- " new X().<B>foo();\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B {}\n"
- },
- "ABB"
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754
- public void test050a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static <S extends A> void foo() { System.out.print(\"A\"); }\n" +
- " public static <N extends B> N foo() { System.out.print(\"B\"); return null; }\n" +
- " static void test () {\n" +
- " X.foo();\n" +
- " foo();\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\r\n" +
- " X.foo();\r\n" +
- " ^^^\n" +
- "The method foo() is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\r\n" +
- " foo();\r\n" +
- " ^^^\n" +
- "The method foo() is ambiguous for the type X\n" +
- "----------\n"
- // both references are ambiguous
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation
- public void test050b() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " class C1 {\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " Z foo(Object o) { return null; } // duplicate\n" +
- " }\n" +
- " class C2 {\n" +
- " <T extends Y> T foo(Object o) { return null; } // ok\n" +
- " <T extends Z> T foo(Object o) { return null; } // ok\n" +
- " }\n" +
- " class C3 {\n" +
- " A<Y> foo(Object o) { return null; } // duplicate\n" +
- " A<Z> foo(Object o) { return null; } // duplicate\n" +
- " }\n" +
- " class C4 {\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
- " }\n" +
- "}\n" +
- "class A<T> {}" +
- "class Y {}" +
- "class Z {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C1\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Z foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C1\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " A<Y> foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C3\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 12)\n" +
- " A<Z> foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C3\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 15)\n" +
- " Y foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C4\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 16)\n" +
- " <T extends Z> T foo(Object o) { return null; } // duplicate\n" +
- " ^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Object) in type X.C4\n" +
- "----------\n"
- // foo(java.lang.Object) is already defined in X.C1
- // foo(java.lang.Object) is already defined in X.C3
- // foo(java.lang.Object) is already defined in X.C4
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation
- public void test050c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " class C5 {\n" +
- " A<Y> foo(A<Y> o) { return null; } // duplicate\n" +
- " A<Z> foo(A<Z> o) { return null; } // duplicate\n" +
- " }\n" +
- " class C6 {\n" +
- " <T extends Y> T foo(A<Y> o) { return null; } // ok\n" +
- " <T extends Z> T foo(A<Z> o) { return null; } // ok\n" +
- " }\n" +
- "}\n" +
- "class A<T> {}" +
- "class Y {}" +
- "class Z {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " A<Y> foo(A<Y> o) { return null; } // duplicate\r\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method foo(A<Y>) in type X.C5\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " A<Z> foo(A<Z> o) { return null; } // duplicate\r\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method foo(A<Z>) in type X.C5\n" +
- "----------\n"
- // name clash: foo(A<Y>) and foo(A<Z>) have the same erasure
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation
- public void test050d() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " class C7 {\n" +
- " <T extends Y, U> T foo(Object o) { return null; } // ok\n" +
- " <T extends Z> T foo(Object o) { return null; } // ok\n" +
- " }\n" +
- "}\n" +
- "class A<T> {}" +
- "class Y {}" +
- "class Z {}"
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050e() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <N extends B> N a(A<String> s) { return null; }\n" +
- " <N> Object a(A<Number> n) { return null; }\n" +
- " <N extends B> void b(A<String> s) {}\n" +
- " <N extends B> B b(A<Number> n) { return null; }\n" +
- " void c(A<String> s) {}\n" +
- " B c(A<Number> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050f() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <N extends B> N a(A<String> s) { return null; }\n" +
- " <N> B a(A<Number> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <N extends B> N a(A<String> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<String>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <N> B a(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n"
- // name clash: <N>a(A<java.lang.String>) and <N>a(A<java.lang.Number>) have the same erasure
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050g() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <N extends B> N b(A<String> s) { return null; }\n" +
- " <N extends B> B b(A<Number> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " <N extends B> N b(A<String> s) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<String>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " <N extends B> B b(A<Number> n) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
- "----------\n"
- // name clash: <N>b(A<java.lang.String>) and <N>b(A<java.lang.Number>) have the same erasure
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050h() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " B c(A<String> s) { return null; }\n" +
- " B c(A<Number> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " B c(A<String> s) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method c(A<String>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " B c(A<Number> n) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method c(A<Number>) in type X\n" +
- "----------\n"
- // name clash: c(A<java.lang.String>) and c(A<java.lang.Number>) have the same erasure
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050i() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <N extends B> N a(A<Number> s) { return null; }\n" +
- " <N> Object a(A<Number> n) { return null; }\n" +
- " <N extends B> N b(A<Number> s) { return null; }\n" +
- " <N> Object b(A<String> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050j() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <N extends B> N a(A<Number> s) { return null; }\n" +
- " <N> B a(A<Number> n) { return null; }\n" +
- " <N extends B> N b(A<Number> s) { return null; }\n" +
- " <N> B b(A<String> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " <N extends B> N a(A<Number> s) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " <N> B a(A<Number> n) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\r\n" +
- " <N extends B> N b(A<Number> s) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\r\n" +
- " <N> B b(A<String> n) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<String>) in type X\n" +
- "----------\n"
- // name clash: <N>a(A<java.lang.Number>) and <N>a(A<java.lang.Number>) have the same erasure
- // name clash: <N>b(A<java.lang.Number>) and <N>b(A<java.lang.String>) have the same erasure
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050k() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <N extends B> void a(A<Number> s) {}\n" +
- " <N extends B> B a(A<Number> n) { return null; }\n" +
- " <N extends B> Object b(A<Number> s) { return null; }\n" +
- " <N extends B> B b(A<Number> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " <N extends B> void a(A<Number> s) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <N extends B> B a(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " <N extends B> Object b(A<Number> s) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " <N extends B> B b(A<Number> n) { return null; }\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
- "----------\n"
- // <N>a(A<java.lang.Number>) is already defined in X
- // <N>b(A<java.lang.Number>) is already defined in X
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423
- public void test050l() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void a(A<Number> s) {}\n" +
- " B a(A<Number> n) { return null; }\n" +
- " Object b(A<Number> s) {}\n" +
- " B b(A<Number> n) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " void a(A<Number> s) {}\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " B a(A<Number> n) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method a(A<Number>) in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\r\n" +
- " Object b(A<Number> s) {}\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\r\n" +
- " B b(A<Number> n) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Duplicate method b(A<Number>) in type X\n" +
- "----------\n"
- // a(A<java.lang.Number>) is already defined in X
- // b(A<java.lang.Number>) is already defined in X
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470
- public void test051() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X implements I {\n" +
- " public <T extends I> void foo(T t) {}\n" +
- "}\n" +
- "interface I {\n" +
- " <T> void foo(T t);\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " public class X implements I {\r\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method I.foo(T)\n" +
- "----------\n"
- // X is not abstract and does not override abstract method <T>foo(T) in I
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470
- public void test051a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(A<String> a) {}\n" +
- " void foo(A<Integer> a) {}\n" +
- "}\n" +
- "class A<T> {}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " void foo(A<String> a) {}\r\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Duplicate method foo(A<String>) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " void foo(A<Integer> a) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method foo(A<Integer>) in type X\n" +
- "----------\n"
- // name clash: foo(A<java.lang.String>) and foo(A<java.lang.Integer>) have the same erasure
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470
- public void test051b() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(A<String> a) {}\n" +
- " Object foo(A<Integer> a) { return null; }\n" +
- "}\n" +
- "class A<T> {}\n",
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=91728
- public void test052() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A<T> {\n" +
- " public A test() { return null; }\n" +
- " public A<T> test2() { return null; }\n" +
- " public A<X> test3() { return null; }\n" +
- " public <U> A<U> test4() { return null; }\n" +
- "}\n" +
- "class B extends A<X> {\n" +
- " @Override public B test() { return null; }\n" +
- " @Override public B test2() { return null; }\n" +
- " @Override public B test3() { return null; }\n" +
- " @Override public <U> A<U> test4() { return null; }\n" +
- "}\n" +
- "class X{}\n"
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=91728
- public void test052a() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "public class A<T> {\n" +
- " public <U> A<U> test() { return null; }\n" +
- " public <U> A<U> test2() { return null; }\n" +
- " public <U> A<U> test3() { return null; }\n" +
- "}\n" +
- "class B extends A<X> {\n" +
- " @Override public B test() { return null; }\n" +
- " @Override public A test2() { return null; }\n" +
- " @Override public A<X> test3() { return null; }\n" +
- "}\n" +
- "class X{}\n"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 7)\n" +
- " @Override public B test() { return null; }\n" +
- " ^\n" +
- "Type safety: The return type B for test() from the type B needs unchecked conversion to conform to A<Object> from the type A<X>\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 8)\n" +
- " @Override public A test2() { return null; }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 8)\n" +
- " @Override public A test2() { return null; }\n" +
- " ^\n" +
- "Type safety: The return type A for test2() from the type B needs unchecked conversion to conform to A<U> from the type A<T>\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 9)\n" +
- " @Override public A<X> test3() { return null; }\n" +
- " ^\n" +
- "Type safety: The return type A<X> for test3() from the type B needs unchecked conversion to conform to A<Object> from the type A<X>\n" +
- "----------\n"
- // warning: test() in B overrides <U>test() in A; return type requires unchecked conversion
- // warning: test2() in B overrides <U>test2() in A; return type requires unchecked conversion
- // warning: test3() in B overrides <U>test3() in A; return type requires unchecked conversion
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=91728
- public void test053() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void test(A a) { B b = a.foo(); }\n" +
- " void test2(A<X> a) { B b = a.foo(); }\n" +
- " void test3(B b) { B bb = b.foo(); }\n" +
- "}\n" +
- "class A<T> {\n" +
- " <U> A<U> foo() { return null; }\n" +
- "}\n" +
- "class B extends A<X> {\n" +
- " @Override B foo() { return null; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " void test(A a) { B b = a.foo(); }\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " void test(A a) { B b = a.foo(); }\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from A to B\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " void test2(A<X> a) { B b = a.foo(); }\n" +
- " ^^^^^^^\n" +
- "Type mismatch: cannot convert from A<Object> to B\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 10)\n" +
- " @Override B foo() { return null; }\n" +
- " ^\n" +
- "Type safety: The return type B for foo() from the type B needs unchecked conversion to conform to A<Object> from the type A<X>\n" +
- "----------\n"
- // 2: incompatible types
- // 3: incompatible types; no instance(s) of type variable(s) U exist so that A<U> conforms to B
- // 10 warning: foo() in B overrides <U>foo() in A; return type requires unchecked conversion
- );
- }
-
- // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
- public void test054() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void a(Object x) {}\n" +
- " <T> T a(T x) { return null; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void a(Object x) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Duplicate method a(Object) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " <T> T a(T x) { return null; }\n" +
- " ^^^^^^\n" +
- "Method a(T) has the same erasure a(Object) as another method in type X\n" +
- "----------\n"
- // a(X) is already defined in X
- );
- }
- // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
- public void test054a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <T1, T2> String aaa(X x) { return null; }\n" +
- " <T extends X> T aaa(T x) { return null; }\n" +
- " <T> String aa(X x) { return null; }\n" +
- " <T extends X> T aa(T x) { return null; }\n" +
- " String a(X x) { return null; }\n" + // dup
- " <T extends X> T a(T x) { return null; }\n" +
-
- " <T> String z(X x) { return null; }\n" +
- " <T, S> Object z(X x) { return null; }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\r\n" +
- " String a(X x) { return null; }\r\n" +
- " ^^^^^^\n" +
- "Duplicate method a(X) in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\r\n" +
- " <T extends X> T a(T x) { return null; }\r\n" +
- " ^^^^^^\n" +
- "Method a(T) has the same erasure a(X) as another method in type X\n" +
- "----------\n"
- // a(X) is already defined in X
- );
- }
- // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
- public void test054b() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X<T> {\n" +
- " Object foo(X<T> t) { return null; }\n" +
- " <S> String foo(X<T> s) { return null; }\n" +
- "}\n"
- },
- ""
- );
- }
- // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
- public void test054c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T> {\n" +
- " <T1 extends X<T1>> void dupT() {}\n" +
- " <T2 extends X<T2>> Object dupT() {return null;}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " <T1 extends X<T1>> void dupT() {}\r\n" +
- " ^^^^^^\n" +
- "Duplicate method dupT() in type X<T>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " <T2 extends X<T2>> Object dupT() {return null;}\r\n" +
- " ^^^^^^\n" +
- "Duplicate method dupT() in type X<T>\n" +
- "----------\n"
- // <T1>dupT() is already defined in X
- );
- }
- // more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897
- public void test054d() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <T> T a(A<T> t) {return null;}\n" +
- " <T> String a(A<Object> o) {return null;}\n" +
- " <T> T aa(A<T> t) {return null;}\n" +
- " String aa(A<Object> o) {return null;}\n" +
- "}\n" +
- "class A<T> {}\n",
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=95933
- public void test055() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " A a = new C();\n" +
- " try { a.f(new Object()); } catch (ClassCastException e) {\n" +
- " System.out.println(1);\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "interface A<T> { void f(T x); }\n" +
- "interface B extends A<String> { void f(String x); }\n" +
- "class C implements B { public void f(String x) {} }\n"
- },
- "1"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97809
- public void test056() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static String bind(String message, Object binding) { return null; }\n" +
- " public static String bind(String message, Object[] bindings) { return null; }\n" +
- "}\n" +
- "class Y extends X {\n" +
- " public static String bind(String message, Object binding) { return null; }\n" +
- " public static String bind(String message, Object[] bindings) { return null; }\n" +
- "}\n" +
- "class Z {\n" +
- " void bar() { Y.bind(\"\", new String[] {\"\"}); }\n" +
- "}\n"
- },
- "");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=84035
- public void test057() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " A<Integer> x = new A<Integer>();\n" +
- " B<Integer> y = new B<Integer>();\n" +
- " new X().print(x);\n" +
- " new X().print(y);\n" +
- " }\n" +
- " public <T extends IA<?>> void print(T a) { System.out.print(1); }\n" +
- " public <T extends IB<?>> void print(T a) { System.out.print(2); }\n" +
- "}\n" +
- "interface IA<E> {}\n" +
- "interface IB<E> extends IA<E> {}\n" +
- "class A<E> implements IA<E> {}\n" +
- "class B<E> implements IB<E> {}\n"
- },
- "12");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=84035
- public void test057a() {
- this.runConformTest(
- new String[] {
- "XX.java",
- "public class XX {\n" +
- " public static void main(String[] args) {\n" +
- " A<Integer> x = new A<Integer>();\n" +
- " B<Integer> y = new B<Integer>();\n" +
- " print(x);\n" +
- " print(y);\n" +
- " }\n" +
- " public static <T extends IA<?>> void print(T a) { System.out.print(3); }\n" +
- " public static <T extends IB<?>> void print(T a) { System.out.print(4); }\n" +
- "}\n" +
- "interface IA<E> {}\n" +
- "interface IB<E> extends IA<E> {}\n" +
- "class A<E> implements IA<E> {}\n" +
- "class B<E> implements IB<E> {}\n"
- },
- "34");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898
- public void test058() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X <B extends Number> {\n" +
- " public static void main(String[] args) {\n" +
- " X<Integer> x = new X<Integer>();\n" +
- " x.aaa(null);\n" +
- " x.aaa(15);\n" +
- " }\n" +
- " <T> T aaa(T t) { System.out.print('T'); return null; }\n" +
- " void aaa(B b) { System.out.print('B'); }\n" +
- "}\n"
- },
- "BB");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898
- public void test058a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<A> {\n" +
- " void test() {\n" +
- " new X<Object>().foo(\"X\");\n" +
- " new X<Object>().foo2(\"X\");\n" +
- " }\n" +
- " <T> T foo(T t) {return null;}\n" +
- " void foo(A a) {}\n" +
- " <T> T foo2(T t) {return null;}\n" +
- " <T> void foo2(A a) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " new X<Object>().foo(\"X\");\r\n" +
- " ^^^\n" +
- "The method foo(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " new X<Object>().foo2(\"X\");\r\n" +
- " ^^^^\n" +
- "The method foo2(String) is ambiguous for the type X<Object>\n" +
- "----------\n"
- // both references are ambiguous
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898
- public void test058b() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<A> extends Y<A> {\n" +
- " void test() {\n" +
- " new X<Object>().foo(\"X\");\n" +
- " new X<Object>().foo2(\"X\");\n" +
- " }\n" +
- " <T> T foo(T t) {return null;}\n" +
- " <T> T foo2(T t) {return null;}\n" +
- "}\n" +
- "class Y<A> {\n" +
- " void foo(A a) {}\n" +
- " <T> void foo2(A a) {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\r\n" +
- " new X<Object>().foo(\"X\");\r\n" +
- " ^^^\n" +
- "The method foo(String) is ambiguous for the type X<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " new X<Object>().foo2(\"X\");\r\n" +
- " ^^^^\n" +
- "The method foo2(String) is ambiguous for the type X<Object>\n" +
- "----------\n"
- // both references are ambiguous
- );
- }
-
- public void test059() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {new B().foo(\"aa\");}\n" +
- "}\n" +
- "class A { <U> void foo(U u) {System.out.print(false);} }\n" +
- "class B extends A { <V> void foo(String s) {System.out.print(true);} }\n"
- },
- "true");
- }
- public void test059a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {new B().foo(\"aa\");}\n" +
- "}\n" +
- "class A { <U> void foo(String s) {System.out.print(true);} }\n" +
- "class B extends A { <V> void foo(V v) {System.out.print(false);} }\n"
- },
- "true");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90619
- public void test060() {
- this.runConformTest(
- new String[] {
- "I.java",
- "import java.util.Iterator;\n" +
- "public interface I {\n" +
- " void method(Iterator<Object> iter);\n" +
- " public static class TestClass implements I {\n" +
- " public void method(Iterator iter) {}\n" +
- " }\n" +
- "}"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90619
- public void test060b() {
- this.runConformTest(
- new String[] {
- "I2.java",
- "import java.util.Iterator;\n" +
- "public interface I2 {\n" +
- " void method(Iterator<Object>[] iter);\n" +
- " public static class TestClass implements I2 {\n" +
- " public void method(Iterator[] iter) {}\n" +
- " }\n" +
- "}"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90619
- public void test060c() {
- this.runNegativeTest(
- new String[] {
- "I3.java",
- "import java.util.Iterator;\n" +
- "public interface I3 {\n" +
- " void method(Iterator<Object>[] iter);\n" +
- " public static class TestClass implements I3 {\n" +
- " public void method(Iterator[][] iter) {}\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in I3.java (at line 4)\n" +
- " public static class TestClass implements I3 {\n" +
- " ^^^^^^^^^\n" +
- "The type I3.TestClass must implement the inherited abstract method I3.method(Iterator<Object>[])\n" +
- "----------\n" +
- "2. WARNING in I3.java (at line 5)\n" +
- " public void method(Iterator[][] iter) {}\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n"
- // does not override abstract method method(java.util.Iterator<java.lang.Object>[]) in I3
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=99106
- public void test061() {
- this.runNegativeTest(
- new String[] {
- "Try.java",
- "public class Try {\n" +
- " public static void main(String[] args) {\n" +
- " Ex<String> ex = new Ex<String>();\n" +
- " ex.one(\"eclipse\", new Integer(1));\n" +
- " ex.two(new Integer(1));\n" +
- " ex.three(\"eclipse\");\n" +
- " ex.four(\"eclipse\");\n" +
- " System.out.print(',');\n" +
- " Ex ex2 = ex;\n" +
- " ex2.one(\"eclipse\", new Integer(1));\n" + // unchecked warning
- " ex2.two(new Integer(1));\n" + // unchecked warning
- " ex2.three(\"eclipse\");\n" + // unchecked warning
- " ex2.four(\"eclipse\");\n" + // unchecked warning
- " }\n" +
- "}\n" +
- "class Top<TC> {\n" +
- " <TM> void one(TC cTop, TM mTop) { System.out.print(-1); }\n" +
- " <TM> void two(TM mTop) { System.out.print(-2); }\n" +
- " void three(TC cTop) { System.out.print(-3); }\n" +
- " <TM> void four(TC cTop) { System.out.print(-4); }\n" +
- "}\n" +
- "class Ex<C> extends Top<C> {\n" +
- " @Override <M> void one(C cEx, M mEx) { System.out.print(1); }\n" +
- " @Override <M> void two(M mEx) { System.out.print(2); }\n" +
- " @Override void three(C cEx) { System.out.print(3); }\n" +
- " @Override <M> void four(C cEx) { System.out.print(4); }\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in Try.java (at line 9)\n" +
- " Ex ex2 = ex;\n" +
- " ^^\n" +
- "Ex is a raw type. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Try.java (at line 10)\n" +
- " ex2.one(\"eclipse\", new Integer(1));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method one(Object, Object) belongs to the raw type Ex. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Try.java (at line 11)\n" +
- " ex2.two(new Integer(1));\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method two(Object) belongs to the raw type Ex. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in Try.java (at line 12)\n" +
- " ex2.three(\"eclipse\");\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method three(Object) belongs to the raw type Ex. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in Try.java (at line 13)\n" +
- " ex2.four(\"eclipse\");\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method four(Object) belongs to the raw type Ex. References to generic type Ex<C> should be parameterized\n" +
- "----------\n"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=99106
- public void test062() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. ERROR in Errors.java (at line 6)\n" +
- " ex.six(\"eclipse\");\n" +
- " ^^^\n" +
- "The method six(String) is ambiguous for the type Ex<String>\n" +
- "----------\n" +
- "2. WARNING in Errors.java (at line 7)\n" +
- " Ex ex2 = ex;\n" +
- " ^^\n" +
- "Ex is a raw type. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Errors.java (at line 9)\n" +
- " ex2.five(\"eclipse\");\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method five(Object) belongs to the raw type Ex. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in Errors.java (at line 10)\n" +
- " ex2.six(\"eclipse\");\n" +
- " ^^^\n" +
- "The method six(Object) is ambiguous for the type Ex\n" +
- "----------\n" +
- "5. ERROR in Errors.java (at line 21)\n" +
- " @Override <M> void six(C cEx) {}\n" +
- " ^^^^^^^^^^\n" +
- "Name clash: The method six(C) of type Ex<C> has the same erasure as six(TC) of type Top<TC> but does not override it\n" +
- "----------\n" +
- "6. ERROR in Errors.java (at line 21)\n" +
- " @Override <M> void six(C cEx) {}\n" +
- " ^^^^^^^^^^\n" +
- "The method six(C) of type Ex<C> must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. ERROR in Errors.java (at line 6)\n" +
- " ex.six(\"eclipse\");\n" +
- " ^^^\n" +
- "The method six(String) is ambiguous for the type Ex<String>\n" +
- "----------\n" +
- "2. WARNING in Errors.java (at line 7)\n" +
- " Ex ex2 = ex;\n" +
- " ^^\n" +
- "Ex is a raw type. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Errors.java (at line 9)\n" +
- " ex2.five(\"eclipse\");\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method five(Object) belongs to the raw type Ex. References to generic type Ex<C> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in Errors.java (at line 10)\n" +
- " ex2.six(\"eclipse\");\n" +
- " ^^^\n" +
- "The method six(Object) is ambiguous for the type Ex\n" +
- "----------\n" +
- "5. ERROR in Errors.java (at line 21)\n" +
- " @Override <M> void six(C cEx) {}\n" +
- " ^^^^^^^^^^\n" +
- "Name clash: The method six(C) of type Ex<C> has the same erasure as six(TC) of type Top<TC> but does not override it\n" +
- "----------\n" +
- "6. ERROR in Errors.java (at line 21)\n" +
- " @Override <M> void six(C cEx) {}\n" +
- " ^^^^^^^^^^\n" +
- "The method six(C) of type Ex<C> must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "Errors.java",
- "public class Errors {\n" +
- " void foo() {\n" +
- " Ex<String> ex = new Ex<String>();\n" +
- " ex.proof(\"eclipse\");\n" +
- " ex.five(\"eclipse\");\n" +
- " ex.six(\"eclipse\");\n" +
- " Ex ex2 = ex;\n" +
- " ex2.proof(\"eclipse\");\n" +
- " ex2.five(\"eclipse\");\n" +
- " ex2.six(\"eclipse\");\n" +
- " }\n" +
- "}\n" +
- "class Top<TC> {\n" +
- " <TM> void proof(Object cTop) {}\n" +
- " <TM> void five(TC cTop) {}\n" +
- " void six(TC cTop) {}\n" +
- "}\n" +
- "class Ex<C> extends Top<C> {\n" +
- " @Override void proof(Object cTop) {}\n" +
- " @Override void five(C cEx) {}\n" +
- " @Override <M> void six(C cEx) {}\n" +
- "}"
- },
- expectedOutput
- // we disagree about the ambiguous errors on lines 5, 9 & 20, see the message sends to proof()
- // 5: reference to five is ambiguous, both method <TM>five(TC) in Top<java.lang.String> and method five(C) in Ex<java.lang.String> match
- // 6: reference to six is ambiguous, both method six(TC) in Top<java.lang.String> and method <M>six(C) in Ex<java.lang.String> match
- // 9: reference to five is ambiguous, both method <TM>five(TC) in Top and method five(C) in Ex match
- // 9: warning: [unchecked] unchecked call to <TM>five(TC) as a member of the raw type Top
- // 10: reference to six is ambiguous, both method six(TC) in Top and method <M>six(C) in Ex match
- // 10: warning: [unchecked] unchecked call to six(TC) as a member of the raw type Top
- // 20: method does not override a method from its superclass
- // 21: method does not override a method from its superclass
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104551
- public void test063() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface IStructuredContentProvider<I, E extends I> {\n" +
- " public E[] getElements(I inputElement);\n" +
- " public E[] getChildren(E parent);\n" +
- "}\n" +
- "\n" +
- "public class X implements IStructuredContentProvider {\n" +
- "// eclipse error: The type X must implement the inherited\n" +
- "// abstract method IStructuredContentProvider.getChildren(I)\n" +
- "\n" +
- " public Object[] getElements(Object inputElement) {\n" +
- " // eclipse error: The return type is incompatible with\n" +
- " // IStructuredContentProvider.getElements(Object)\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public Object[] getChildren(Object parent) {\n" +
- " // eclipse error: Name clash: The method getChildren(Object) of type\n" +
- " // X has the same erasure as getChildren(E) of type\n" +
- " // IStructuredContentProvider<I,E> but does not override it\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104551 - variation
- public void test064() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface IStructuredContentProvider<I, E extends I> {\n" +
- " public E[] getElements(I inputElement);\n" +
- " public E[] getChildren(E parent);\n" +
- "}\n" +
- "\n" +
- "public class X implements IStructuredContentProvider<Object,Object> {\n" +
- "// eclipse error: The type X must implement the inherited\n" +
- "// abstract method IStructuredContentProvider.getChildren(I)\n" +
- "\n" +
- " public Object[] getElements(Object inputElement) {\n" +
- " // eclipse error: The return type is incompatible with\n" +
- " // IStructuredContentProvider.getElements(Object)\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public Object[] getChildren(Object parent) {\n" +
- " // eclipse error: Name clash: The method getChildren(Object) of type\n" +
- " // X has the same erasure as getChildren(E) of type\n" +
- " // IStructuredContentProvider<I,E> but does not override it\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104551 - variation
- public void test065() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.List;\n" +
- "\n" +
- "interface IStructuredContentProvider<I, E extends List<String>> {\n" +
- " public E[] getElements(I inputElement);\n" +
- " public E[] getChildren(E parent);\n" +
- "}\n" +
- "\n" +
- "public class X implements IStructuredContentProvider {\n" +
- "// eclipse error: The type X must implement the inherited\n" +
- "// abstract method IStructuredContentProvider.getChildren(I)\n" +
- "\n" +
- " public List[] getElements(Object inputElement) {\n" +
- " // eclipse error: The return type is incompatible with\n" +
- " // IStructuredContentProvider.getElements(Object)\n" +
- " return null;\n" +
- " }\n" +
- "\n" +
- " public List[] getChildren(List parent) {\n" +
- " // eclipse error: Name clash: The method getChildren(Object) of type\n" +
- " // X has the same erasure as getChildren(E) of type\n" +
- " // IStructuredContentProvider<I,E> but does not override it\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103849
- public void test066() {
- this.runConformTest(
- new String[] {
- "JukeboxImpl.java",
- "public class JukeboxImpl implements Jukebox {\n" +
- " public <M extends Music,A extends Artist<M>> A getArtist (M music){return null;}\n" +
- " void test () { getArtist(new Rock()); }\n" +
- "}\n" +
- "interface Jukebox {\n" +
- " <M extends Music, A extends Artist<M>> A getArtist (M music);\n" +
- "}\n" +
- "interface Music {}\n" +
- "class Rock implements Music {}\n" +
- "interface Artist<M extends Music> {}\n"
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107098
- public void test067() {
- this.runConformTest(
- new String[] {
- "NoErrors.java",
- "public class NoErrors {\n" +
- " public static void main(String[] args) { new B().foo2(1, 10); }\n" +
- "}\n" +
- "class A<T> {\n" +
- " <S1 extends T> void foo2(Number t, S1 s) { System.out.print(false); }\n" +
- "}\n" +
- "class B extends A<Number> {\n" +
- " <S2 extends Number> void foo2(Number t, S2 s) { System.out.print(true); }\n" +
- "}\n"
- },
- "true");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107681
- public void test068() {
- this.runConformTest(
- new String[] {
- "ReflectionNavigator.java",
- "import java.lang.reflect.Type;\n" +
- "public class ReflectionNavigator implements Navigator<Type> {\n" +
- " public <T> Class<T> erasure(Type t) { return null; }\n" +
- "}\n" +
- "interface Navigator<TypeT> {\n" +
- " <T> TypeT erasure(TypeT x);\n" +
- "}\n" +
- "class Usage {\n" +
- " public void foo(ReflectionNavigator r, Type t) { r.erasure(t); }\n" +
- "}\n"
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=108203
- public void test069() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.lang.reflect.Type;\n" +
- "public class X implements I<A> {\n" +
- " public <N extends A> void x1() {}\n" +
- " public <N extends Number> void x2() {}\n" +
- " public <N extends Number> void x3() {}\n" +
- "}\n" +
- "interface I<V> {\n" +
- " <N extends V> void x1();\n" +
- " <N extends String> void x2();\n" +
- " <N extends Object> void x3();\n" +
- "}\n" +
- "class A {}\n" +
- "class B<T> {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " public class X implements I<A> {\r\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method I<A>.x3()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\r\n" +
- " public class X implements I<A> {\r\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method I<A>.x2()\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\r\n" +
- " public <N extends Number> void x2() {}\r\n" +
- " ^^^^\n" +
- "Name clash: The method x2() of type X has the same erasure as x2() of type I<V> but does not override it\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\r\n" +
- " public <N extends Number> void x3() {}\r\n" +
- " ^^^^\n" +
- "Name clash: The method x3() of type X has the same erasure as x3() of type I<V> but does not override it\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 9)\r\n" +
- " <N extends String> void x2();\r\n" +
- " ^^^^^^\n" +
- "The type parameter N should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=101049
- public void test070() {
- this.runNegativeTest(
- new String[] {
- "BooleanFactory.java",
- "interface Factory<T> {\n" +
- " <U extends T> U create(Class<U> c);\n" +
- "}\n" +
- "public class BooleanFactory implements Factory<Boolean> {\n" +
- " public <U extends Boolean> U create(Class<U> c) {\n" +
- " try { return c.newInstance(); } catch(Exception e) { return null; }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in BooleanFactory.java (at line 5)\n" +
- " public <U extends Boolean> U create(Class<U> c) {\n" +
- " ^^^^^^^\n" +
- "The type parameter U should not be bounded by the final type Boolean. Final types cannot be further extended\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107045
- public void test071() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. ERROR in D.java (at line 2)\r\n" +
- " @Override void m(Number t) {}\r\n" +
- " ^^^^^^^^^^^\n" +
- "Name clash: The method m(Number) of type D has the same erasure as m(T) of type A<T> but does not override it\n" +
- "----------\n" +
- "2. ERROR in D.java (at line 2)\r\n" +
- " @Override void m(Number t) {}\r\n" +
- " ^^^^^^^^^^^\n" +
- "The method m(Number) of type D must override a superclass method\n" +
- "----------\n" +
- "3. WARNING in D.java (at line 6)\r\n" +
- " class B<S extends Integer> extends A<S> { @Override void m(S t) {} }\r\n" +
- " ^^^^^^^\n" +
- "The type parameter S should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n"
- : "----------\n" +
- "1. ERROR in D.java (at line 2)\n" +
- " @Override void m(Number t) {}\n" +
- " ^^^^^^^^^^^\n" +
- "Name clash: The method m(Number) of type D has the same erasure as m(T) of type A<T> but does not override it\n" +
- "----------\n" +
- "2. ERROR in D.java (at line 2)\n" +
- " @Override void m(Number t) {}\n" +
- " ^^^^^^^^^^^\n" +
- "The method m(Number) of type D must override or implement a supertype method\n" +
- "----------\n" +
- "3. WARNING in D.java (at line 6)\n" +
- " class B<S extends Integer> extends A<S> { @Override void m(S t) {} }\n" +
- " ^^^^^^^\n" +
- "The type parameter S should not be bounded by the final type Integer. Final types cannot be further extended\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "D.java",
- "class D extends B<Integer> {\n" +
- " @Override void m(Number t) {}\n" +
- " @Override void m(Integer t) {}\n" +
- "}\n" +
- "class A<T extends Number> { void m(T t) {} }\n" +
- "class B<S extends Integer> extends A<S> { @Override void m(S t) {} }"
- },
- expectedOutput);
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=108780
- public void test072() {
- this.runConformTest(
- new String[] {
- "B.java",
- "class A<E> { E foo(E e) { return null; } }\n" +
- "class B<T> extends A<T> {\n" +
- " @Override T foo(Object arg0) { return null; }\n" +
- "}"
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111350
- public void test073() {
- this.runConformTest(
- new String[] {
- "NumericArray.java",
- "class Array<T> {\n" +
- " public void add(T t) { System.out.println(false); }\n" +
- "}\n" +
- "public class NumericArray<T extends Number> extends Array<T> {\n" +
- " public static void main(String[] s) { new NumericArray<Integer>().add(1); }\n" +
- " @Override public void add(Number n) { System.out.println(true); }\n" +
- "}"
- },
- "true"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111350
- public void test073a() {
- this.runConformTest(
- new String[] {
- "NumericArray2.java",
- "class Array<T> {\n" +
- " public T add(T t) { System.out.println(false); return null; }\n" +
- "}\n" +
- "public class NumericArray2<T extends Number> extends Array<T> {\n" +
- " public static void main(String[] s) { new NumericArray2<Integer>().add(1); }\n" +
- " @Override public T add(Number n) { System.out.println(true); return null; }\n" +
- "}"
- },
- "true"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111350
- public void test073b() {
- this.runConformTest(
- new String[] {
- "NumericArray3.java",
- "class Array<T> {\n" +
- " public <U extends Number> void add(U u) {}\n" +
- "}\n" +
- "public class NumericArray3<T extends Number> extends Array<T> {\n" +
- " public static void main(String[] s) { new NumericArray3<Integer>().add(1); }\n" +
- " @Override public void add(Number n) { System.out.println(true); }\n" +
- "}"
- },
- "true"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111350
- public void test073c() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. ERROR in NumericArray4.java (at line 5)\r\n" +
- " @Override public <U> void add(Number n) {}\r\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method add(Number) of type NumericArray4<T> must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. ERROR in NumericArray4.java (at line 5)\n" +
- " @Override public <U> void add(Number n) {}\n" +
- " ^^^^^^^^^^^^^\n" +
- "The method add(Number) of type NumericArray4<T> must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "NumericArray4.java",
- "class Array<T> {\n" +
- " public <U> void add(T t) {}\n" +
- "}\n" +
- "public class NumericArray4<T extends Number> extends Array<T> {\n" +
- " @Override public <U> void add(Number n) {}\n" +
- "}"
- },
- expectedOutput);
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111350
- public void test073d() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. ERROR in NumericArray5.java (at line 5)\r\n" +
- " @Override public void add(Number n, Integer i) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method add(Number, Integer) of type NumericArray5<T> must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. ERROR in NumericArray5.java (at line 5)\n" +
- " @Override public void add(Number n, Integer i) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The method add(Number, Integer) of type NumericArray5<T> must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "NumericArray5.java",
- "class Array<T> {\n" +
- " public <U> void add(T t, U u) {}\n" +
- "}\n" +
- "public class NumericArray5<T extends Number> extends Array<T> {\n" +
- " @Override public void add(Number n, Integer i) {}\n" +
- "}"
- },
- expectedOutput);
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100970
- public void test074() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. WARNING in I.java (at line 2)\n" +
- " interface J extends I { @Override void clone(); }\n" +
- " ^^^^\n" +
- "The return type is incompatible with Object.clone(), thus this interface cannot be implemented\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 2)\n" +
- " interface J extends I { @Override void clone(); }\n" +
- " ^^^^^^^\n" +
- "The method clone() of type J must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. WARNING in I.java (at line 2)\n" +
- " interface J extends I { @Override void clone(); }\n" +
- " ^^^^\n" +
- "The return type is incompatible with Object.clone(), thus this interface cannot be implemented\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 2)\n" +
- " interface J extends I { @Override void clone(); }\n" +
- " ^^^^^^^\n" +
- "The method clone() of type J must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "I.java",
- "interface I {}\n" +
- "interface J extends I { @Override void clone(); }"
- },
- expectedOutput);
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100970
- public void test074a() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. WARNING in I.java (at line 1)\n" +
- " interface I { @Override void clone(); }\n" +
- " ^^^^\n" +
- "The return type is incompatible with Object.clone(), thus this interface cannot be implemented\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 1)\n" +
- " interface I { @Override void clone(); }\n" +
- " ^^^^^^^\n" +
- "The method clone() of type I must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. WARNING in I.java (at line 1)\n" +
- " interface I { @Override void clone(); }\n" +
- " ^^^^\n" +
- "The return type is incompatible with Object.clone(), thus this interface cannot be implemented\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 1)\n" +
- " interface I { @Override void clone(); }\n" +
- " ^^^^^^^\n" +
- "The method clone() of type I must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "I.java",
- "interface I { @Override void clone(); }\n" +
- "interface J extends I {}"
- },
- expectedOutput);
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100970
- public void test074b() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "interface I {\n" +
- " int finalize();\n" +
- " float hashCode();\n" +
- "}\n" +
- "interface J extends I {}\n" +
- "abstract class A implements J {}"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 2)\n" +
- " int finalize();\n" +
- " ^^^\n" +
- "The return type is incompatible with Object.finalize(), thus this interface cannot be implemented\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 3)\n" +
- " float hashCode();\n" +
- " ^^^^^\n" +
- "The return type is incompatible with Object.hashCode()\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 6)\n" +
- " abstract class A implements J {}\n" +
- " ^\n" +
- "The return type is incompatible with I.finalize(), Object.finalize()\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 6)\n" +
- " abstract class A implements J {}\n" +
- " ^\n" +
- "The return type is incompatible with I.hashCode(), Object.hashCode()\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107105
- public void test075() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. ERROR in A.java (at line 2)\n" +
- " class B extends A { @Override <T1, S1 extends J & I<S1>> void foo() { } }\n" +
- " ^^^^^\n" +
- "Name clash: The method foo() of type B has the same erasure as foo() of type A but does not override it\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 2)\n" +
- " class B extends A { @Override <T1, S1 extends J & I<S1>> void foo() { } }\n" +
- " ^^^^^\n" +
- "The method foo() of type B must override a superclass method\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 3)\n" +
- " class C extends A { @Override <T2, S2 extends J & I> void foo() { } }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<TT> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 3)\n" +
- " class C extends A { @Override <T2, S2 extends J & I> void foo() { } }\n" +
- " ^^^^^\n" +
- "Name clash: The method foo() of type C has the same erasure as foo() of type A but does not override it\n" +
- "----------\n" +
- "5. ERROR in A.java (at line 3)\n" +
- " class C extends A { @Override <T2, S2 extends J & I> void foo() { } }\n" +
- " ^^^^^\n" +
- "The method foo() of type C must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. ERROR in A.java (at line 2)\n" +
- " class B extends A { @Override <T1, S1 extends J & I<S1>> void foo() { } }\n" +
- " ^^^^^\n" +
- "Name clash: The method foo() of type B has the same erasure as foo() of type A but does not override it\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 2)\n" +
- " class B extends A { @Override <T1, S1 extends J & I<S1>> void foo() { } }\n" +
- " ^^^^^\n" +
- "The method foo() of type B must override or implement a supertype method\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 3)\n" +
- " class C extends A { @Override <T2, S2 extends J & I> void foo() { } }\n" +
- " ^\n" +
- "I is a raw type. References to generic type I<TT> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in A.java (at line 3)\n" +
- " class C extends A { @Override <T2, S2 extends J & I> void foo() { } }\n" +
- " ^^^^^\n" +
- "Name clash: The method foo() of type C has the same erasure as foo() of type A but does not override it\n" +
- "----------\n" +
- "5. ERROR in A.java (at line 3)\n" +
- " class C extends A { @Override <T2, S2 extends J & I> void foo() { } }\n" +
- " ^^^^^\n" +
- "The method foo() of type C must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A { <T, S extends J & I<T>> void foo() { } }\n" +
- "class B extends A { @Override <T1, S1 extends J & I<S1>> void foo() { } }\n" + // fails, name clash only shows up when Override is removed
- "class C extends A { @Override <T2, S2 extends J & I> void foo() { } }\n" + // fails, name clash only shows up when Override is removed
- "class D extends A { @Override <T3, S3 extends J & I<T3>> void foo() { } }\n" +
- "class E extends A { @Override <T4, S4 extends I<T4> & J> void foo() { } }\n" +
- "interface I<TT> {}\n" +
- "interface J {}"
- },
- expectedOutput
- // A.java:2: method does not override a method from its superclass
- // A.java:3: method does not override a method from its superclass
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107105
- public void test075a() {
- this.runConformTest(
- // there is no name clash in this case AND no override error - there would be if the annotation was present
- new String[] {
- "A.java",
- "class A<U> { <S extends J> void foo(U u, S s) { } }\n" +
- "class B<V> extends A<V> { <S1 extends K> void foo(V v, S1 s) { } }\n" +
- "interface J {}\n" +
- "interface K extends J {}"
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107105
- public void test075b() {
- String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. ERROR in A.java (at line 2)\r\n" +
- " class B<V> extends A<V> { @Override <T1, S1 extends K & I<T1>> void foo(V v, T1 t, S1 s) { } }\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The method foo(V, T1, S1) of type B<V> must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. ERROR in A.java (at line 2)\n" +
- " class B<V> extends A<V> { @Override <T1, S1 extends K & I<T1>> void foo(V v, T1 t, S1 s) { } }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The method foo(V, T1, S1) of type B<V> must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A<U> { <T, S extends J & I<T>> void foo(U u, T t, S s) { } }\n" +
- "class B<V> extends A<V> { @Override <T1, S1 extends K & I<T1>> void foo(V v, T1 t, S1 s) { } }\n" +
- "interface I<TT> {}\n" +
- "interface J {}\n" +
- "interface K extends J {}"
- },
- expectedOutput
- // A.java:2: method does not override a method from its superclass
- );
- }
- public void test076() {
- this.runConformTest(
- new String[] {
- "A.java",
- "class A {\n" +
- " <T, S extends J & I<S>> void foo(S s) { }\n" +
- " <T, S extends I<T> & J > void foo(S s) { }\n" +
- "}\n" +
- "interface I<TT> {}\n" +
- "interface J {}\n"
- },
- ""
- );
- }
- public void test076a() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A {\n" +
- " <T, S extends J & I<T>> void foo() { }\n" +
- " <T, S extends I<T> & J> void foo() { }\n" +
- "}\n" +
- "interface I<TT> {}\n" +
- "interface J {}\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 2)\r\n" +
- " <T, S extends J & I<T>> void foo() { }\r\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type A\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 3)\r\n" +
- " <T, S extends I<T> & J> void foo() { }\r\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type A\n" +
- "----------\n"
- // <T,S>foo() is already defined in A
- );
- }
- public void test076b() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A {\n" +
- " <T, S extends J & I<T>> void foo() { }\n" +
- " <T, S extends I<T> & K> void foo() { }\n" +
- "}\n" +
- "interface I<TT> {}\n" +
- "interface J {}\n" +
- "interface K extends J {}"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 2)\r\n" +
- " <T, S extends J & I<T>> void foo() { }\r\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type A\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 3)\r\n" +
- " <T, S extends I<T> & K> void foo() { }\r\n" +
- " ^^^^^\n" +
- "Duplicate method foo() in type A\n" +
- "----------\n"
- // name clash: <T,S>foo() and <T,S>foo() have the same erasure
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122881
- public void test077() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o = new A<Integer>().foo(new Integer(1));\n" +
- "}\n" +
- "interface I<T1> { I<T1> foo(T1 t); }\n" +
- "interface J<T2> { J<T2> foo(T2 t); }\n" +
- "class B<T> { public A<T> foo(T t) { return new A<T>(); } }\n" +
- "class A<S> extends B<S> implements I<S>, J<S> {}"
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122881
- public void test077a() {
- this.runNegativeTest(
- new String[] {
- "I.java",
- "public interface I { I foo(); }\n" +
- "interface J { J foo(); }\n" +
- "interface K extends I, J { K foo(); }\n" +
- "interface L { K getI(); }\n" +
- "interface M { I getI(); }\n" +
- "interface N { J getI(); }\n" +
- "interface O extends L, M, N { K getI(); }\n" +
- "interface P extends L, M, N {}\n" +
- "class X implements L, M, N { public K getI() { return null; } }\n" +
- "abstract class Y implements L, M, N {}\n" +
- "abstract class Z implements L, M, N { public K getI() { return null; } }\n"
- },
- "----------\n" +
- "1. ERROR in I.java (at line 8)\n" +
- " interface P extends L, M, N {}\n" +
- " ^\n" +
- "The return type is incompatible with N.getI(), M.getI(), L.getI()\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 10)\n" +
- " abstract class Y implements L, M, N {}\n" +
- " ^\n" +
- "The return type is incompatible with N.getI(), M.getI(), L.getI()\n" +
- "----------\n"
-/* See addtional comments in https://bugs.eclipse.org/bugs/show_bug.cgi?id=122881
- "----------\n" +
- "1. ERROR in I.java (at line 3)\r\n" +
- " interface K extends I, J { K foo(); }\r\n" +
- " ^\n" +
- "The return type is incompatible with J.foo(), I.foo()\n" +
- "----------\n" +
- "2. ERROR in I.java (at line 7)\r\n" +
- " interface O extends L, M, N { K getI(); }\r\n" +
- " ^\n" +
- "The return type is incompatible with N.getI(), M.getI(), L.getI()\n" +
- "----------\n" +
- "3. ERROR in I.java (at line 8)\r\n" +
- " interface P extends L, M, N {}\r\n" +
- " ^\n" +
- "The return type is incompatible with N.getI(), M.getI(), L.getI()\n" +
- "----------\n" +
- "4. ERROR in I.java (at line 10)\r\n" +
- " abstract class Y implements L, M, N {}\r\n" +
- " ^\n" +
- "The return type is incompatible with N.getI(), M.getI(), L.getI()\n" +
- "----------\n"
-*/
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128560
- public void test078() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- customOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
- customOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X implements IAppendable {\n" +
- " public X append(char c) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "interface IAppendable {\n" +
- " IAppendable append(char c);\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public X append(char c) {\n" +
- " ^\n" +
- "The return type is incompatible with IAppendable.append(char)\n" +
- "----------\n",
- null,
- true,
- customOptions);
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=81222
- public void test079() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "class A<E> { void x(A<String> s) {} }\n" +
- "class B extends A { void x(A<String> s) {} }\n" +
- "class C extends A { @Override void x(A s) {} }\n" +
- "class D extends A { void x(A<Object> s) {} }"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 2)\r\n" +
- " class B extends A { void x(A<String> s) {} }\r\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<E> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 2)\r\n" +
- " class B extends A { void x(A<String> s) {} }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method x(A<String>) of type B has the same erasure as x(A) of type A but does not override it\n" +
- "----------\n" +
- "3. WARNING in A.java (at line 3)\r\n" +
- " class C extends A { @Override void x(A s) {} }\r\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in A.java (at line 3)\r\n" +
- " class C extends A { @Override void x(A s) {} }\r\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in A.java (at line 4)\r\n" +
- " class D extends A { void x(A<Object> s) {} }\r\n" +
- " ^\n" +
- "A is a raw type. References to generic type A<E> should be parameterized\n" +
- "----------\n" +
- "6. ERROR in A.java (at line 4)\r\n" +
- " class D extends A { void x(A<Object> s) {} }\r\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method x(A<Object>) of type D has the same erasure as x(A) of type A but does not override it\n" +
- "----------\n"
- // name clash: x(A<java.lang.String>) in B and x(A<java.lang.String>) in A have the same erasure, yet neither overrides the other
- // name clash: x(A<java.lang.Object>) in D and x(A<java.lang.String>) in A have the same erasure, yet neither overrides the other
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106880
- public void test080() {
- this.runNegativeTest(
- new String[] {
- "HashOrder.java",
- "public class HashOrder extends DoubleHash<String> {\n" +
- " public static HashOrder create() { return null; }\n" +
- "}\n" +
- "class DoubleHash<T> {\n" +
- " public static <U> DoubleHash<U> create() { return null; }\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in HashOrder.java (at line 2)\n" +
- " public static HashOrder create() { return null; }\n" +
- " ^^^^^^^^^\n" +
- "Type safety: The return type HashOrder for create() from the type HashOrder needs unchecked conversion to conform to DoubleHash<Object> from the type DoubleHash<String>\n" +
- "----------\n"
- // warning: create() in HashOrder overrides <U>create() in DoubleHash; return type requires unchecked conversion
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=125956
- public void test081() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X<U> implements I {\n" +
- " public A<String> foo() { return null; }\n" +
- " public <S> A<U> bar() { return null; }\n" +
- "}\n" +
- "interface I {\n" +
- " <T> A<T> foo();\n" +
- " <S> A<S> bar();\n" +
- "}\n" +
- "class A<V> {}"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 2)\r\n" +
- " public A<String> foo() { return null; }\r\n" +
- " ^\n" +
- "Type safety: The return type A<String> for foo() from the type X<U> needs unchecked conversion to conform to A<Object> from the type I\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " public <S> A<U> bar() { return null; }\r\n" +
- " ^^^^\n" +
- "The return type is incompatible with I.bar()\n" +
- "----------\n"
- // <S>bar() in X cannot implement <S>bar() in I; attempting to use incompatible return type
- // warning: foo() in X implements <T>foo() in I; return type requires unchecked conversion
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105339
- public void test082() {
- this.runNegativeTest(
- new String[] {
- "V.java",
- "public class V extends U { @Override public C<B> foo() { return null; } }\n" +
- "class U { public <T extends A> C<T> foo() { return null; } }\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C<T> {}"
- },
- "----------\n" +
- "1. WARNING in V.java (at line 1)\n" +
- " public class V extends U { @Override public C<B> foo() { return null; } }\n" +
- " ^\n" +
- "Type safety: The return type C<B> for foo() from the type V needs unchecked conversion to conform to C<A> from the type U\n" +
- "----------\n"
- // warning: foo() in V overrides <T>foo() in U; return type requires unchecked conversion
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=132831
- public void test083() {
- this.runConformTest(
- new String[] {
- "C.java",
- "public class C extends p.B {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(((p.I) new C()).m() == null);\n" +
- " }\n" +
- "}",
- "p/B.java",
- "package p;\n" +
- "public abstract class B extends A {}\n" +
- "abstract class A implements I {\n" +
- " public A m() { return null; }\n" +
- "}",
- "p/I.java",
- "package p;\n" +
- "public interface I { I m(); }\n"
- },
- "true"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=132841
- public void test084() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A<T1 extends A.M> implements I<T1> {\n" +
- " public java.util.List<T1> f(M n) { return null; }\n" +
- " static class M {}\n" +
- "}\n" +
- "interface I<T2> {\n" +
- " java.util.List<T2> f(T2 t);\n" +
- "}"
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=132841
- public void test084a() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A<T1 extends A.M> implements I<T1> {\n" +
- " public void foo(Number n, M m) {}\n" +
- " public void foo2(Number n, M m) {}\n" +
- " public void foo3(Number n, M m) {}\n" +
- " static class M {}\n" +
- "}\n" +
- "interface I<T2> {\n" +
- " <U extends Number> void foo(U u, T2 t);\n" +
- " void foo2(Number n, T2 t);\n" +
- " <U extends Number> void foo3(U u, A.M m);\n" +
- "}"
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=132841
- public void test084b() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "public class A<T1 extends A.M> implements I<T1> {\n" +
- " public void foo4(Number n, T1 m) {}\n" +
- " static class M {}\n" +
- "}\n" +
- "interface I<T2> {\n" +
- " <U extends Number> void foo4(U u, A.M m);\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 1)\r\n" +
- " public class A<T1 extends A.M> implements I<T1> {\r\n" +
- " ^\n" +
- "The type A<T1> must implement the inherited abstract method I<T1>.foo4(U, A.M)\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 2)\r\n" +
- " public void foo4(Number n, T1 m) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method foo4(Number, T1) of type A<T1> has the same erasure as foo4(U, A.M) of type I<T2> but does not override it\n" +
- "----------\n"
- // A is not abstract and does not override abstract method <U>foo4(U,A.M) in I
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=136543
- public void test085() {
- this.runNegativeTest(
- new String[] {
- "Parent.java",
- "import java.util.Collection;\n" +
- "public class Parent {\n" +
- " static void staticCase1(Collection c) {}\n" +
- " static void staticCase2(Collection<String> c) {}\n" +
- " void instanceCase1(Collection c) {}\n" +
- " void instanceCase2(Collection<String> c) {}\n" +
- "}\n" +
- "class Child extends Parent {\n" +
- " static void staticCase1(Collection<String> c) {}\n" +
- " static void staticCase2(Collection c) {}\n" +
- " void instanceCase1(Collection<String> c) {}\n" +
- " @Override void instanceCase2(Collection c) {}\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in Parent.java (at line 3)\n" +
- " static void staticCase1(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Parent.java (at line 5)\n" +
- " void instanceCase1(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "3. WARNING in Parent.java (at line 10)\n" +
- " static void staticCase2(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "4. ERROR in Parent.java (at line 11)\n" +
- " void instanceCase1(Collection<String> c) {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method instanceCase1(Collection<String>) of type Child has the same erasure as instanceCase1(Collection) of type Parent but does not override it\n" +
- "----------\n" +
- "5. WARNING in Parent.java (at line 12)\n" +
- " @Override void instanceCase2(Collection c) {}\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n"
- // @Override is an error for instanceCase1
- // name clash: instanceCase1(Collection<String>) in Child and instanceCase1(Collection) in Parent have the same erasure, yet neither overrides the other
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=136543 - case 2
- public void test085b() {
- this.runNegativeTest(
- new String[] {
- "Parent.java",
- "import java.util.Collection;\n" +
- "public class Parent {\n" +
- " static void staticMismatchCase1(Collection c) {}\n" +
- " static void staticMismatchCase2(Collection<String> c) {}\n" +
- " void mismatchCase1(Collection c) {}\n" +
- " void mismatchCase2(Collection<String> c) {}\n" +
- "}\n" +
- "class Child extends Parent {\n" +
- " void staticMismatchCase1(Collection c) {}\n" +
- " void staticMismatchCase2(Collection<String> c) {}\n" +
- " static void mismatchCase1(Collection c) {}\n" +
- " static void mismatchCase2(Collection<String> c) {}\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in Parent.java (at line 3)\r\n" +
- " static void staticMismatchCase1(Collection c) {}\r\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in Parent.java (at line 5)\r\n" +
- " void mismatchCase1(Collection c) {}\r\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in Parent.java (at line 9)\r\n" +
- " void staticMismatchCase1(Collection c) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "This instance method cannot override the static method from Parent\n" +
- "----------\n" +
- "4. WARNING in Parent.java (at line 9)\r\n" +
- " void staticMismatchCase1(Collection c) {}\r\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in Parent.java (at line 10)\r\n" +
- " void staticMismatchCase2(Collection<String> c) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "This instance method cannot override the static method from Parent\n" +
- "----------\n" +
- "6. ERROR in Parent.java (at line 11)\r\n" +
- " static void mismatchCase1(Collection c) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "This static method cannot hide the instance method from Parent\n" +
- "----------\n" +
- "7. WARNING in Parent.java (at line 11)\r\n" +
- " static void mismatchCase1(Collection c) {}\r\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "8. ERROR in Parent.java (at line 12)\r\n" +
- " static void mismatchCase2(Collection<String> c) {}\r\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "This static method cannot hide the instance method from Parent\n" +
- "----------\n"
- // staticMismatchCase1(java.util.Collection) in Child cannot override staticMismatchCase1(java.util.Collection) in Parent; overridden method is static
- // staticMismatchCase2(java.util.Collection<java.lang.String>) in Child cannot override staticMismatchCase2(java.util.Collection<java.lang.String>) in Parent; overridden method is static
- // mismatchCase1(java.util.Collection) in Child cannot override mismatchCase1(java.util.Collection) in Parent; overriding method is static
- // mismatchCase2(java.util.Collection<java.lang.String>) in Child cannot override mismatchCase2(java.util.Collection<java.lang.String>) in Parent; overriding method is static
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=136543 - case 3
- public void test085c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public abstract class X<V> extends CX<V> implements IX<V> {}\n" +
- "class CX<T> { public static void foo(Object o) {} }\n" +
- "abstract class X2 extends CX implements IX {}\n" +
- "interface IX<U> { void foo(U u); }"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public abstract class X<V> extends CX<V> implements IX<V> {}\n" +
- " ^\n" +
- "The static method foo(Object) conflicts with the abstract method in IX<V>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\r\n" +
- " abstract class X2 extends CX implements IX {}\r\n" +
- " ^^\n" +
- "The static method foo(Object) conflicts with the abstract method in IX\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\r\n" +
- " abstract class X2 extends CX implements IX {}\r\n" +
- " ^^\n" +
- "CX is a raw type. References to generic type CX<T> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\r\n" +
- " abstract class X2 extends CX implements IX {}\r\n" +
- " ^^\n" +
- "IX is a raw type. References to generic type IX<U> should be parameterized\n" +
- "----------\n"
- // line 1: foo(java.lang.Object) in CX cannot implement foo(U) in IX; overriding method is static
- // line 3: foo(java.lang.Object) in CX cannot implement foo(U) in IX; overriding method is static
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90438
- public void test086() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X implements I { public <T extends Object & Data> void copyData(T data) {} }\n" +
- "interface I { <A extends Data> void copyData(A data); }\n" +
- "interface Data {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements I { public <T extends Object & Data> void copyData(T data) {} }\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method I.copyData(A)\n" +
- "----------\n"
- // X is not abstract and does not override abstract method <A>copyData(A) in I
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90438 - case 2
- public void test086b() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X implements I { public <T> G<T> foo(Class<T> stuffClass) { return null; } }\n" +
- "interface I { <T extends Object> G<T> foo(Class<T> stuffClass); }\n" +
- "class G<T> {}"
- },
- ""
- );
- }
- public void test087() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Collection;\n" +
- "\n" +
- "interface Interface1 {\n" +
- "}\n" +
- "interface Interface2 extends Interface1 {\n" +
- "}\n" +
- "interface Interface3 {\n" +
- " <P extends Interface1> Collection<P> doStuff();\n" +
- "}\n" +
- "interface Interface4 extends Interface3 {\n" +
- " Collection<Interface2> doStuff();\n" +
- "}\n" +
- "public class X {\n" +
- " Zork z;\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 11)\r\n" +
- " Collection<Interface2> doStuff();\r\n" +
- " ^^^^^^^^^^\n" +
- "Type safety: The return type Collection<Interface2> for doStuff() from the type Interface4 needs unchecked conversion to conform to Collection<Interface1> from the type Interface3\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\r\n" +
- " Zork z;\r\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n"
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation
- public void test088() {
- this.runNegativeTest(
- new String[] {
- "X.java",//===================
- "import java.util.*;\n" +
- "public class X<T0> extends ArrayList<T0> implements I<T0>,Runnable {\n" +
- " \n" +
- " void foo() {\n" +
- " this.add(new Object());\n" +
- " this.add(null);\n" +
- " }\n" +
- "}\n" +
- "interface I<T1> extends Collection<String> {\n" +
- "}\n" , // =================, // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public class X<T0> extends ArrayList<T0> implements I<T0>,Runnable {\n" +
- " ^\n" +
- "The interface Collection cannot be implemented more than once with different arguments: Collection<T0> and Collection<String>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " public class X<T0> extends ArrayList<T0> implements I<T0>,Runnable {\n" +
- " ^\n" +
- "The type X<T0> must implement the inherited abstract method Runnable.run()\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 2)\n" +
- " public class X<T0> extends ArrayList<T0> implements I<T0>,Runnable {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " this.add(new Object());\n" +
- " ^^^\n" +
- "The method add(T0) in the type ArrayList<T0> is not applicable for the arguments (Object)\n" +
- "----------\n"
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation
- public void test089() {
- this.runNegativeTest(
- new String[] {
- "X.java",//===================
- "import java.util.*;\n" +
- "public class X extends X2 {}\n" +
- "abstract class X2 extends X3 implements List<String> {}\n" +
- "abstract class X3 implements List<Thread> {}", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " abstract class X2 extends X3 implements List<String> {}\n" +
- " ^^\n" +
- "The interface List cannot be implemented more than once with different arguments: List<Thread> and List<String>\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=147690
-// public void test090() {
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "class XSuper {\n" +
-// " Object foo() throws Exception { return null; }\n" +
-// " protected Object bar() throws Exception { return null; }\n" +
-// "}\n" +
-// "public class X extends XSuper {\n" +
-// " protected String foo() { return null; }\n" +
-// " public String bar() { return null; }\n" +
-// "}", // =================
-// },
-// "");
-// // ensure bridge methods have target method modifiers, and inherited thrown exceptions
-// String expectedOutput =
-// " // Method descriptor #17 ()Ljava/lang/Object;\n" +
-// " // Stack: 1, Locals: 1\n" +
-// " public bridge synthetic java.lang.Object bar() throws java.lang.Exception;\n" +
-// " 0 aload_0\n" +
-// " 1 invokevirtual X.bar() : java.lang.String [21]\n" +
-// " 4 areturn\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 1]\n" +
-// " \n" +
-// " // Method descriptor #17 ()Ljava/lang/Object;\n" +
-// " // Stack: 1, Locals: 1\n" +
-// " protected bridge synthetic java.lang.Object foo() throws java.lang.Exception;\n" +
-// " 0 aload_0\n" +
-// " 1 invokevirtual X.foo() : java.lang.String [23]\n" +
-// " 4 areturn\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 1]\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-// }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148783
- public void test091() {
- this.runNegativeTest(
- new String[] {
- "DataSet.java",//===================
- "import java.io.Serializable;\n" +
- "import java.util.*;\n" +
- "\n" +
- "class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " \n" +
- " public <S> S[] toArray(S[] s) {\n" +
- " return s;\n" +
- " }\n" +
- "\n" +
- " public boolean add(Object o) { return false; }\n" +
- " public void add(int index, Object element) {}\n" +
- " public boolean addAll(Collection c) { return false; }\n" +
- " public boolean addAll(int index, Collection c) { return false; }\n" +
- " public void clear() {}\n" +
- " public boolean contains(Object o) { return false; }\n" +
- " public boolean containsAll(Collection c) { return false; }\n" +
- " public Object get(int index) { return null; }\n" +
- " public int indexOf(Object o) { return 0; }\n" +
- " public boolean isEmpty() { return false; }\n" +
- " public Iterator iterator() { return null; }\n" +
- " public int lastIndexOf(Object o) { return 0; }\n" +
- " public ListIterator listIterator() { return null; }\n" +
- " public ListIterator listIterator(int index) { return null; }\n" +
- " public boolean remove(Object o) { return false; }\n" +
- " public Object remove(int index) { return null; }\n" +
- " public boolean removeAll(Collection c) { return false; }\n" +
- " public boolean retainAll(Collection c) { return false; }\n" +
- " public Object set(int index, Object element) { return false; }\n" +
- " public int size() { return 0; }\n" +
- " public List subList(int fromIndex, int toIndex) { return null; }\n" +
- " public Object[] toArray() { return null; }\n" +
- " public boolean hasNext() { return false; }\n" +
- " public Object next() { return null; }\n" +
- " public void remove() {}\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^\n" +
- "The type DataSet<T> must implement the inherited abstract method List.toArray(Object[])\n" +
- "----------\n" +
- "2. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^\n" +
- "The serializable class DataSet does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in DataSet.java (at line 6)\n" +
- " public <S> S[] toArray(S[] s) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method toArray(S[]) of type DataSet<T> has the same erasure as toArray(Object[]) of type List but does not override it\n" +
- "----------\n" +
- "6. ERROR in DataSet.java (at line 6)\n" +
- " public <S> S[] toArray(S[] s) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Name clash: The method toArray(S[]) of type DataSet<T> has the same erasure as toArray(Object[]) of type Collection but does not override it\n" +
- "----------\n" +
- "7. WARNING in DataSet.java (at line 12)\n" +
- " public boolean addAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in DataSet.java (at line 13)\n" +
- " public boolean addAll(int index, Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in DataSet.java (at line 16)\n" +
- " public boolean containsAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in DataSet.java (at line 20)\n" +
- " public Iterator iterator() { return null; }\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in DataSet.java (at line 22)\n" +
- " public ListIterator listIterator() { return null; }\n" +
- " ^^^^^^^^^^^^\n" +
- "ListIterator is a raw type. References to generic type ListIterator<E> should be parameterized\n" +
- "----------\n" +
- "12. WARNING in DataSet.java (at line 23)\n" +
- " public ListIterator listIterator(int index) { return null; }\n" +
- " ^^^^^^^^^^^^\n" +
- "ListIterator is a raw type. References to generic type ListIterator<E> should be parameterized\n" +
- "----------\n" +
- "13. WARNING in DataSet.java (at line 26)\n" +
- " public boolean removeAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "14. WARNING in DataSet.java (at line 27)\n" +
- " public boolean retainAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "15. WARNING in DataSet.java (at line 30)\n" +
- " public List subList(int fromIndex, int toIndex) { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n"
- );
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148783 - variation
- public void test092() {
- this.runNegativeTest(
- new String[] {
- "DataSet.java",//===================
- "import java.io.Serializable;\n" +
- "import java.util.*;\n" +
- "\n" +
- "class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " \n" +
- " public <S extends T> S[] toArray(S[] s) {\n" +
- " return s;\n" +
- " }\n" +
- "\n" +
- " public boolean add(Object o) { return false; }\n" +
- " public void add(int index, Object element) {}\n" +
- " public boolean addAll(Collection c) { return false; }\n" +
- " public boolean addAll(int index, Collection c) { return false; }\n" +
- " public void clear() {}\n" +
- " public boolean contains(Object o) { return false; }\n" +
- " public boolean containsAll(Collection c) { return false; }\n" +
- " public Object get(int index) { return null; }\n" +
- " public int indexOf(Object o) { return 0; }\n" +
- " public boolean isEmpty() { return false; }\n" +
- " public Iterator iterator() { return null; }\n" +
- " public int lastIndexOf(Object o) { return 0; }\n" +
- " public ListIterator listIterator() { return null; }\n" +
- " public ListIterator listIterator(int index) { return null; }\n" +
- " public boolean remove(Object o) { return false; }\n" +
- " public Object remove(int index) { return null; }\n" +
- " public boolean removeAll(Collection c) { return false; }\n" +
- " public boolean retainAll(Collection c) { return false; }\n" +
- " public Object set(int index, Object element) { return false; }\n" +
- " public int size() { return 0; }\n" +
- " public List subList(int fromIndex, int toIndex) { return null; }\n" +
- " public Object[] toArray() { return null; }\n" +
- " public boolean hasNext() { return false; }\n" +
- " public Object next() { return null; }\n" +
- " public void remove() {}\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^\n" +
- "The type DataSet<T> must implement the inherited abstract method List.toArray(Object[])\n" +
- "----------\n" +
- "2. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^\n" +
- "The serializable class DataSet does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in DataSet.java (at line 12)\n" +
- " public boolean addAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in DataSet.java (at line 13)\n" +
- " public boolean addAll(int index, Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in DataSet.java (at line 16)\n" +
- " public boolean containsAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in DataSet.java (at line 20)\n" +
- " public Iterator iterator() { return null; }\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in DataSet.java (at line 22)\n" +
- " public ListIterator listIterator() { return null; }\n" +
- " ^^^^^^^^^^^^\n" +
- "ListIterator is a raw type. References to generic type ListIterator<E> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in DataSet.java (at line 23)\n" +
- " public ListIterator listIterator(int index) { return null; }\n" +
- " ^^^^^^^^^^^^\n" +
- "ListIterator is a raw type. References to generic type ListIterator<E> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in DataSet.java (at line 26)\n" +
- " public boolean removeAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "12. WARNING in DataSet.java (at line 27)\n" +
- " public boolean retainAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "13. WARNING in DataSet.java (at line 30)\n" +
- " public List subList(int fromIndex, int toIndex) { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148783 - variation
- public void test093() {
- this.runNegativeTest(
- new String[] {
- "DataSet.java",//===================
- "import java.io.Serializable;\n" +
- "import java.util.*;\n" +
- "\n" +
- "class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " \n" +
- " public <S> S[] toArray(S[] s) {\n" +
- " return s;\n" +
- " }\n" +
- " public Object[] toArray(Object[] o) {\n" +
- " return o;\n" +
- " }\n" +
- " public boolean add(Object o) { return false; }\n" +
- " public void add(int index, Object element) {}\n" +
- " public boolean addAll(Collection c) { return false; }\n" +
- " public boolean addAll(int index, Collection c) { return false; }\n" +
- " public void clear() {}\n" +
- " public boolean contains(Object o) { return false; }\n" +
- " public boolean containsAll(Collection c) { return false; }\n" +
- " public Object get(int index) { return null; }\n" +
- " public int indexOf(Object o) { return 0; }\n" +
- " public boolean isEmpty() { return false; }\n" +
- " public Iterator iterator() { return null; }\n" +
- " public int lastIndexOf(Object o) { return 0; }\n" +
- " public ListIterator listIterator() { return null; }\n" +
- " public ListIterator listIterator(int index) { return null; }\n" +
- " public boolean remove(Object o) { return false; }\n" +
- " public Object remove(int index) { return null; }\n" +
- " public boolean removeAll(Collection c) { return false; }\n" +
- " public boolean retainAll(Collection c) { return false; }\n" +
- " public Object set(int index, Object element) { return false; }\n" +
- " public int size() { return 0; }\n" +
- " public List subList(int fromIndex, int toIndex) { return null; }\n" +
- " public Object[] toArray() { return null; }\n" +
- " public boolean hasNext() { return false; }\n" +
- " public Object next() { return null; }\n" +
- " public void remove() {}\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^\n" +
- "The type DataSet<T> must implement the inherited abstract method List.toArray(Object[])\n" +
- "----------\n" +
- "2. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^\n" +
- "The serializable class DataSet does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in DataSet.java (at line 4)\n" +
- " class DataSet<T extends Number> implements List, Iterator, Serializable {\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in DataSet.java (at line 6)\n" +
- " public <S> S[] toArray(S[] s) {\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Method toArray(S[]) has the same erasure toArray(Object[]) as another method in type DataSet<T>\n" +
- "----------\n" +
- "6. ERROR in DataSet.java (at line 9)\n" +
- " public Object[] toArray(Object[] o) {\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method toArray(Object[]) in type DataSet<T>\n" +
- "----------\n" +
- "7. WARNING in DataSet.java (at line 14)\n" +
- " public boolean addAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "8. WARNING in DataSet.java (at line 15)\n" +
- " public boolean addAll(int index, Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "9. WARNING in DataSet.java (at line 18)\n" +
- " public boolean containsAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "10. WARNING in DataSet.java (at line 22)\n" +
- " public Iterator iterator() { return null; }\n" +
- " ^^^^^^^^\n" +
- "Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
- "----------\n" +
- "11. WARNING in DataSet.java (at line 24)\n" +
- " public ListIterator listIterator() { return null; }\n" +
- " ^^^^^^^^^^^^\n" +
- "ListIterator is a raw type. References to generic type ListIterator<E> should be parameterized\n" +
- "----------\n" +
- "12. WARNING in DataSet.java (at line 25)\n" +
- " public ListIterator listIterator(int index) { return null; }\n" +
- " ^^^^^^^^^^^^\n" +
- "ListIterator is a raw type. References to generic type ListIterator<E> should be parameterized\n" +
- "----------\n" +
- "13. WARNING in DataSet.java (at line 28)\n" +
- " public boolean removeAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "14. WARNING in DataSet.java (at line 29)\n" +
- " public boolean retainAll(Collection c) { return false; }\n" +
- " ^^^^^^^^^^\n" +
- "Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
- "----------\n" +
- "15. WARNING in DataSet.java (at line 32)\n" +
- " public List subList(int fromIndex, int toIndex) { return null; }\n" +
- " ^^^^\n" +
- "List is a raw type. References to generic type List<E> should be parameterized\n" +
- "----------\n"
- );
- }
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=146383
-public void test094() {
- this.runNegativeTest(
- new String[] {
- "X.java",//===================
- "import java.util.ArrayList;\n" +
- "import java.util.Arrays;\n" +
- "class Y<T> {}\n" +
- "public class X\n" +
- "{\n" +
- " private static ArrayList<Y<X>> y = new ArrayList<Y<X>>();\n" +
- " void foo(Y[] array)\n" +
- " {\n" +
- " y.addAll(Arrays.asList(array));\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " void foo(Y[] array)\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<T> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " y.addAll(Arrays.asList(array));\n" +
- " ^^^^^^\n" +
- "The method addAll(Collection<? extends Y<X>>) in the type ArrayList<Y<X>> is not applicable for the arguments (List<Y>)\n" +
- "----------\n"
- );
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148957
-public void test096() {
- this.runNegativeTest(
- new String[] {
- "ProblemClass.java",//===================
- "import java.util.Collection;\n" +
- "import javax.swing.JLabel;\n" +
- "interface SuperInterface {\n" +
- " public <A extends JLabel> void doIt(Collection<A> as);\n" +
- "}\n" +
- "\n" +
- "public class ProblemClass implements SuperInterface {\n" +
- " public void doIt(Collection<? extends JLabel> as) {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in ProblemClass.java (at line 7)\n" +
- " public class ProblemClass implements SuperInterface {\n" +
- " ^^^^^^^^^^^^\n" +
- "The type ProblemClass must implement the inherited abstract method SuperInterface.doIt(Collection<A>)\n" +
- "----------\n" +
- "2. ERROR in ProblemClass.java (at line 8)\n" +
- " public void doIt(Collection<? extends JLabel> as) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method doIt(Collection<? extends JLabel>) of type ProblemClass has the same erasure as doIt(Collection<A>) of type SuperInterface but does not override it\n" +
- "----------\n");
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148957 - variation
-public void test097() {
- this.runConformTest(
- new String[] {
- "ProblemClass.java",//===================
- "import java.util.Collection;\n" +
- "import javax.swing.JLabel;\n" +
- "interface SuperInterface {\n" +
- " public <A extends JLabel> void doIt(Collection<A> as);\n" +
- "}\n" +
- "\n" +
- "public class ProblemClass implements SuperInterface {\n" +
- " public <B extends JLabel> void doIt(Collection<B> as) {\n" +
- " }\n" +
- "}\n"
- },
- ""
- );
-}
-
-// autoboxing mixed with type parameters substitution
-public void test098() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "public class X<A, B> {\n" +
- " public X(List<A> toAdd) {\n" +
- " }\n" +
- " public <L extends List<? super A>, LF extends Factory<L>> L \n" +
- " foo(B b, L l, LF lf) {\n" +
- " return l;\n" +
- " }\n" +
- " public static class ListFactory<T> implements Factory<List<T>> {\n" +
- " public List<T> create() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- " public static interface Factory<T> {\n" +
- " public T create();\n" +
- " }\n" +
- " public static void bar() {\n" +
- " (new X<Long, Number>(new ArrayList<Long>())).\n" +
- " foo(1, (List<Number>) null, new ListFactory<Number>());\n" +
- " }\n" +
- "}"
- },
- ""
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=153874
-public void test099() {
- Map customOptions= getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
- this.runConformTest(
- new String[] {
- "TestCharset.java",
- "import java.nio.charset.*;\n" +
- "public class TestCharset extends Charset {\n" +
- " protected TestCharset(String n, String[] a) { super(n, a); }\n" +
- " public boolean contains(Charset cs) { return false; }\n" +
- " public CharsetDecoder newDecoder() { return null; }\n" +
- " public CharsetEncoder newEncoder() { return null; }\n" +
- "}\n" ,
- },
- "",
- null,
- true,
- null,
- customOptions,
- null/*no custom requestor*/);
-}
-
-// name conflict
-public void test100() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.Collection;\n" +
- "public class X<E> {\n" +
- " boolean removeAll(Collection<? extends E> c) {\n" +
- " return false;\n" +
- " }\n" +
- "}\n",
- "Y.java",
- "import java.util.Collection;\n" +
- "public class Y<E> extends X<E>\n" +
- "{\n" +
- " <T extends E> boolean removeAll(Collection<T> c) {\n" +
- " return false;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in Y.java (at line 4)\n" +
- " <T extends E> boolean removeAll(Collection<T> c) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Name clash: The method removeAll(Collection<T>) of type Y<E> has the same erasure as removeAll(Collection<? extends E>) of type X<E> but does not override it\n" +
- "----------\n"
- );
-}
-
-// name conflict
-public void test101() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.List;\n" +
- "public class X {\n" +
- " Integer getX(List<Integer> l) {\n" +
- " return null;\n" +
- " }\n" +
- " String getX(List<String> l) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Integer getX(List<Integer> l) {\n" +
- " return null;\n" +
- " }\n" +
- " String getX(List<Integer> l) {\n" +
- " return null;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " Integer getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method getX(List<Integer>) in type Y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " String getX(List<Integer> l) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method getX(List<Integer>) in type Y\n" +
- "----------\n"
- );
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-public void test102() {
- Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " private interface ReturnBase {\n" +
- " }\n" +
- "\n" +
- " private interface ReturnDerived extends ReturnBase {\n" +
- " }\n" +
- "\n" +
- " private interface ReturnLeaf extends ReturnDerived {\n" +
- " }\n" +
- "\n" +
- " private interface Interface {\n" +
- " ReturnBase bar();\n" +
- " }\n" +
- "\n" +
- " private static class Implementation {\n" +
- " public final ReturnDerived bar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static class Child extends Implementation implements Interface {\n" +
- " }\n" +
- "\n" +
- " private static class Grandchild extends Child implements Interface {\n" +
- " @Override\n" +
- " public ReturnLeaf bar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new Grandchild();\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 26)\n" +
- " public ReturnLeaf bar() {\n" +
- " ^^^^^\n" +
- "Cannot override the final method from X.Implementation\n" +
- "----------\n",
- null,
- true,
- options
- );
-}
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test103() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface Interface {\n" +
-// " ReturnBase bar();\n" +
-// " }\n" +
-// "\n" +
-// " private static class Implementation {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild extends Child implements Interface {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child extends Implementation implements Interface {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertTrue("bar should be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test104() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface Interface {\n" +
-// " ReturnBase bar();\n" +
-// " }\n" +
-// "\n" +
-// " private static class Implementation {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child extends Implementation implements Interface {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild extends Child implements Interface {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertTrue("bar should be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//}
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test105() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Super {\n" +
-// " ReturnBase bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Implementation extends Super {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child extends Implementation {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild extends Child {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Implementation.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// int count = 0;
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// IMethodInfo methodInfo = methodInfos[i];
-// if (new String(methodInfo.getName()).equals("bar")) {
-// count++;
-// if (Flags.isBridge(methodInfo.getAccessFlags())) {
-// found = true;
-// }
-// }
-// }
-// assertEquals("Should have two method bar", 2, count);
-// assertTrue("should have one bridge method", found);
-//}
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test106() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Super {\n" +
-// " ReturnBase bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static abstract class Implementation extends Super {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child extends Implementation {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild extends Child {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Implementation.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// int count = 0;
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// IMethodInfo methodInfo = methodInfos[i];
-// if (new String(methodInfo.getName()).equals("bar")) {
-// count ++;
-// if (Flags.isBridge(methodInfo.getAccessFlags())) {
-// found = true;
-// }
-// }
-// }
-// assertEquals("should have two methods bar", 2, count);
-// assertTrue("should have one bridge method", found);
-//}
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test107() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface Interface<E> {\n" +
-// " ReturnBase bar();\n" +
-// " }\n" +
-// "\n" +
-// " private static class Implementation<T> {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child<U> extends Implementation<U> implements Interface<U> {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild<V> extends Child<V> implements Interface<V> {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertTrue("bar should be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-public void test108() {
- Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " private interface ReturnBase {\n" +
- " }\n" +
- "\n" +
- " private interface ReturnDerived extends ReturnBase {\n" +
- " }\n" +
- "\n" +
- " private interface ReturnLeaf extends ReturnDerived {\n" +
- " }\n" +
- "\n" +
- " private interface Interface<E> {\n" +
- " ReturnBase bar();\n" +
- " }\n" +
- "\n" +
- " private static class Implementation<T> {\n" +
- " public final ReturnDerived bar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " private static class Child<U> extends Implementation<U> implements Interface<U> {\n" +
- " }\n" +
- "\n" +
- " private static class Grandchild<V> extends Child<V> implements Interface<V> {\n" +
- " @Override\n" +
- " public ReturnLeaf bar() {\n" +
- " return null;\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " new Grandchild<String>();\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 26)\n" +
- " public ReturnLeaf bar() {\n" +
- " ^^^^^\n" +
- "Cannot override the final method from X.Implementation<V>\n" +
- "----------\n",
- null,
- true,
- options
- );
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test109() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface Interface<E> {\n" +
-// " ReturnBase bar();\n" +
-// " }\n" +
-// "\n" +
-// " private static class Implementation<T> {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild<V> extends Child<V> implements Interface<V> {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child<U> extends Implementation<U> implements Interface<U> {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertTrue("bar should be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//}
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test110() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface Interface<E> {\n" +
-// " ReturnBase bar();\n" +
-// " }\n" +
-// "\n" +
-// " private static class Implementation<T> {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child<U> extends Implementation<U> implements Interface<U> {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild<V> extends Child<V> implements Interface<V> {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertTrue("bar should be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//}
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test111() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Super<E> {\n" +
-// " ReturnBase bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Implementation<T> extends Super<T> {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child<U> extends Implementation<U> {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild<V> extends Child<V> {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Implementation.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// int count = 0;
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// IMethodInfo methodInfo = methodInfos[i];
-// if (new String(methodInfo.getName()).equals("bar")) {
-// count++;
-// if (Flags.isBridge(methodInfo.getAccessFlags())) {
-// found = true;
-// }
-// }
-// }
-// assertEquals("should have two methods bar", 2, count);
-// assertTrue("should have one bridge method", found);
-//}
-//// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159973
-//public void test112() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private interface ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private interface ReturnDerived extends ReturnBase {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Super<E> {\n" +
-// " ReturnBase bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static abstract class Implementation<T> extends Super<T> {\n" +
-// " public final ReturnDerived bar() {\n" +
-// " return null;\n" +
-// " }\n" +
-// " }\n" +
-// "\n" +
-// " private static class Child<U> extends Implementation<U> {\n" +
-// " }\n" +
-// "\n" +
-// " private static class Grandchild<V> extends Child<V> {\n" +
-// " }\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " new Grandchild();\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-// File fileX = new File(OUTPUT_DIR + File.separator +"X$Child.class");
-// IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// IMethodInfo[] methodInfos = reader.getMethodInfos();
-// boolean found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Grandchild.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// if (new String(methodInfos[i].getName()).equals("bar")) {
-// found = true;
-// break;
-// }
-// }
-// assertFalse("bar should not be there", found);
-//
-// fileX = new File(OUTPUT_DIR + File.separator +"X$Implementation.class");
-// reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.ALL_BUT_METHOD_BODIES);
-// methodInfos = reader.getMethodInfos();
-// int count = 0;
-// found = false;
-// for (int i = 0, max = methodInfos.length; i < max; i++) {
-// IMethodInfo methodInfo = methodInfos[i];
-// if (new String(methodInfo.getName()).equals("bar")) {
-// count++;
-// if (Flags.isBridge(methodInfo.getAccessFlags())) {
-// found = true;
-// }
-// }
-// }
-// assertEquals("should have two methods bar", 2, count);
-// assertTrue("should have one bridge method", found);
-//}
-////https://bugs.eclipse.org/bugs/show_bug.cgi?id=156736
-//public void test113() {
-// Map options = this.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.ERROR);
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "abstract class Y {\n" +
-// " abstract void foo();\n" +
-// "}\n" +
-// "public class X extends Y {\n" +
-// " void foo() {\n" +
-// " // should not complain for missing super call, since overriding \n" +
-// " // abstract method\n" +
-// " }\n" +
-// "}"
-// },
-// "",
-// null,
-// true,
-// null,
-// options,
-// null
-// );
-//}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156736
-public void test114() {
- Map options = this.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " void foo() {}\n" +
- "}\n" +
- "public class X extends Y {\n" +
- " @Override\n" +
- " void foo() {\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method X.foo() is overriding a method without making a super invocation\n" +
- "----------\n",
- null,
- true,
- options
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156736
-public void test115() {
- Map options = this.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.ERROR);
- this.runConformTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " void foo() {}\n" +
- "}\n" +
- "public class X extends Y {\n" +
- " @Override\n" +
- " void foo() {\n" +
- " super.foo();\n" +
- " }\n" +
- "}"
- },
- "",
- null,
- true,
- null,
- options,
- null
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156736
-public void test116() {
- Map options = this.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.ERROR);
- String expectedOutput = new CompilerOptions(options).sourceLevel < ClassFileConstants.JDK1_6
- ? "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork foo() {}\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Object foo() {\n" +
- " ^^^^^\n" +
- "The method foo() of type X must override a superclass method\n" +
- "----------\n"
- : "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork foo() {}\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Object foo() {\n" +
- " ^^^^^\n" +
- "The method foo() of type X must override or implement a supertype method\n" +
- "----------\n";
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " Zork foo() {}\n" +
- "}\n" +
- "public class X extends Y {\n" +
- " @Override\n" +
- " Object foo() {\n" +
- " return new Y() {\n" +
- " Object foo() {\n" +
- " return null;\n" +
- " }\n" +
- " };" +
- " }\n" +
- "}"
- },
- expectedOutput,
- null,
- true,
- options );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156736
-public void test117() {
- Map options = this.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Y {\n" +
- " Object foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "public class X extends Y {\n" +
- " @Override\n" +
- " Object foo() {\n" +
- " return new Y() {\n" +
- " @Override\n" +
- " Object foo() {\n" +
- " return null;\n" +
- " }\n" +
- " };" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " Object foo() {\n" +
- " ^^^^^\n" +
- "The method X.foo() is overriding a method without making a super invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " Object foo() {\n" +
- " ^^^^^\n" +
- "The method new Y(){}.foo() is overriding a method without making a super invocation\n" +
- "----------\n",
- null,
- true,
- options
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156736
-public void test118() {
- Map options = this.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Y<E> {\n" +
- " <U extends E> U foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X<T> extends Y<T> {\n" +
- " @Override\n" +
- " <V extends T> V foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " <V extends T> V foo() {\n" +
- " ^^^^^\n" +
- "The method X<T>.foo() is overriding a method without making a super invocation\n" +
- "----------\n",
- null,
- true,
- options
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156736
-public void test119() {
- Map options = this.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.ERROR);
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class Y<E> {\n" +
- " E foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X<T> extends Y<T> {\n" +
- " @Override\n" +
- " T foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " T foo() {\n" +
- " ^^^^^\n" +
- "The method X<T>.foo() is overriding a method without making a super invocation\n" +
- "----------\n",
- null,
- true,
- options
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=161541
-public void test120() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " abstract class M<T extends CharSequence, S> {\n" +
- " abstract void a(T t);\n" +
- " abstract void a(S s);\n" +
- " void a(String s) {}\n" +
- "\n" +
- " abstract void b(T t);\n" +
- " protected void b(String s) {}\n" +
- " protected abstract void b(S s);\n" +
- "\n" +
- " public void c(String s) {}\n" +
- " protected abstract void c(T t);\n" +
- " abstract void c(S s);\n" +
- "\n" +
- " protected abstract void d(T t);\n" +
- " public void d(S s) {}\n" +
- "\n" +
- " void e(T t) {}\n" +
- " void e(S s) {}\n" +
- " }\n" +
- " class N extends M<String, String> {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 21)\n" +
- " class N extends M<String, String> {}\n" +
- " ^\n" +
- "Duplicate methods named e with the parameters (S) and (T) are defined by the type X.M<String,String>\n" +
- "----------\n"
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=173477
-public void test121() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface Root {\n" +
- " public Root someMethod();\n" +
- "}\n" +
- "\n" +
- "interface Intermediary extends Root {\n" +
- " public Leaf someMethod();\n" +
- "}\n" +
- "\n" +
- "class Leaf implements Intermediary {\n" +
- " public Leaf someMethod() {\n" +
- " System.out.print(\"SUCCESS\");\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Leaf leafReference = new Leaf();\n" +
- " leafReference.someMethod();\n" +
- " Root rootReference = leafReference;\n" +
- " rootReference.someMethod(); /* throws error */\n" +
- " }\n" +
- "}"
- },
- "SUCCESSSUCCESS"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java
deleted file mode 100644
index 6ba9235..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class NonFatalErrorTest extends AbstractRegressionTest {
- public NonFatalErrorTest(String name) {
- super(name);
- }
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] { "test127" };
-// TESTS_NUMBERS = new int[] { 5 };
-// TESTS_RANGE = new int[] { 169, 180 };
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
- }
-
- public static Class testClass() {
- return NonFatalErrorTest.class;
- }
-
- public void test001() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED);
- this.runNegativeTestWithExecution(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import java.util.*;\n" +
- " ^^^^^^^^^\n" +
- "The import java.util is never used\n" +
- "----------\n",
- "SUCCESS",
- null,
- true,
- null,
- customOptions,
- null);
- }
-
- public void test002() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.ENABLED);
- this.runNegativeTestWithExecution(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import java.util.*;\n" +
- " ^^^^^^^^^\n" +
- "The import java.util is never used\n" +
- "----------\n",
- "Unexpected target error running resulting class file for X.java:\n" +
- "java.lang.Error: Unresolved compilation problem: \n" +
- "\n",
- null,
- true,
- null,
- customOptions,
- null);
- }
-
- public void test003() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED);
- customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
- this.runNegativeTestWithExecution(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " ^^^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n",
- "SUCCESS",
- null,
- true,
- null,
- customOptions,
- null);
- }
-
- public void test004() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED);
- customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR);
- this.runNegativeTestWithExecution(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void foo() {}\n" +
- " public static void main(String argv[]) {\n" +
- " foo();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static void foo() {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n",
- "SUCCESS",
- null,
- true,
- null,
- customOptions,
- null);
- }
-
- public void test005() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.ENABLED);
- customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR);
- this.runNegativeTestWithExecution(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void foo() {}\n" +
- " public static void main(String argv[]) {\n" +
- " foo();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public static void foo() {}\n" +
- " ^^\n" +
- "Empty block should be documented\n" +
- "----------\n",
- "Unexpected target error running resulting class file for X.java:\n" +
- "java.lang.Error: Unresolved compilation problem: \n" +
- " Empty block should be documented\n" +
- "\n",
- null,
- true,
- null,
- customOptions,
- null);
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTests.java
deleted file mode 100644
index f1c2039..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTests.java
+++ /dev/null
@@ -1,1889 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.eclipse.wst.jsdt.internal.compiler.flow.FlowInfo;
-import org.eclipse.wst.jsdt.internal.compiler.flow.NullInfoRegistry;
-import org.eclipse.wst.jsdt.internal.compiler.flow.UnconditionalFlowInfo;
-import org.eclipse.wst.jsdt.internal.compiler.flow.UnconditionalFlowInfo.AssertionFailedException;
-import org.eclipse.wst.jsdt.internal.compiler.impl.Constant;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * A tests series especially meant to validate the internals of our null
- * reference analysis. See NullReferenceTest for tests targetted at
- * the source code compiler behavior level.
- */
-public class NullReferenceImplTests extends NullReferenceTest {
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- // Only the highest compliance level is run; add the VM argument
- // -Dcompliance=1.4 (for example) to lower it if needed
- static {
-// TESTS_NAMES = new String[] { "test2050" };
-// TESTS_NUMBERS = new int[] { 2061 };
-// TESTS_NUMBERS = new int[] { 2999 };
-// TESTS_RANGE = new int[] { 2050, -1 };
- }
-
-/**
- * A class to hold states as seen by the low level validation tests and machinery.
- * State provides:
- * - singletons for all possible states given the number of bits for the said
- * states;
- * - semantic names for known states;
- * - printable representation of states as bit fields;
- * - coordination with other classes to perform transitive closure analysis, etc.
- */
- /*
- This is a tabular definition for states. It can be completed/leveraged by
- the Generator class so as to smoothen the transition between differing encodings
- of the states.
- // STATES DEFINITION START
- 000000 start
- 000001
- 000010
- 000011
- 000100 pot. unknown
- 000101
- 000110
- 000111
- 001000 pot. non null
- 001001
- 001010
- 001011
- 001100 pot. nn & pot. un
- 001101
- 001110
- 001111
- 010000 pot. null
- 010001
- 010010
- 010011
- 010100 pot. n & pot. un
- 010101
- 010110
- 010111
- 011000 pot. n & pot. nn
- 011001
- 011010
- 011011
- 011100
- 011101
- 011110
- 011111
- 100000
- 100001
- 100010
- 100011
- 100100 def. unknown
- 100101
- 100110
- 100111
- 101000 def. non null
- 101001
- 101010
- 101011
- 101100 pot. nn & prot. nn
- 101101
- 101110
- 101111
- 110000 def. null
- 110001
- 110010
- 110011
- 110100 pot. n & prot. n
- 110101
- 110110
- 110111
- 111000 prot. null
- 111001
- 111010
- 111011
- 111100 prot. non null
- 111101
- 111110
- 111111
- // STATES DEFINITION END
- */
- public static class State implements Comparable {
- // PREMATURE consider moving initialization to test setup/dispose
- public final static State[] states = {
- // STATES INITIALIZER START
- new State(0, "start"), // 000000
- new State(1), // 000001
- new State(2), // 000010
- new State(3), // 000011
- new State(4, "pot. unknown"), // 000100
- new State(5), // 000101
- new State(6), // 000110
- new State(7), // 000111
- new State(8, "pot. non null"), // 001000
- new State(9), // 001001
- new State(10), // 001010
- new State(11), // 001011
- new State(12, "pot. nn & pot. un"), // 001100
- new State(13), // 001101
- new State(14), // 001110
- new State(15), // 001111
- new State(16, "pot. null"), // 010000
- new State(17), // 010001
- new State(18), // 010010
- new State(19), // 010011
- new State(20, "pot. n & pot. un"), // 010100
- new State(21), // 010101
- new State(22), // 010110
- new State(23), // 010111
- new State(24, "pot. n & pot. nn"), // 011000
- new State(25), // 011001
- new State(26), // 011010
- new State(27), // 011011
- new State(28), // 011100
- new State(29), // 011101
- new State(30), // 011110
- new State(31), // 011111
- new State(32), // 100000
- new State(33), // 100001
- new State(34), // 100010
- new State(35), // 100011
- new State(36, "def. unknown"), // 100100
- new State(37), // 100101
- new State(38), // 100110
- new State(39), // 100111
- new State(40, "def. non null"), // 101000
- new State(41), // 101001
- new State(42), // 101010
- new State(43), // 101011
- new State(44, "pot. nn & prot. nn"), // 101100
- new State(45), // 101101
- new State(46), // 101110
- new State(47), // 101111
- new State(48, "def. null"), // 110000
- new State(49), // 110001
- new State(50), // 110010
- new State(51), // 110011
- new State(52, "pot. n & prot. n"), // 110100
- new State(53), // 110101
- new State(54), // 110110
- new State(55), // 110111
- new State(56, "prot. null"), // 111000
- new State(57), // 111001
- new State(58), // 111010
- new State(59), // 111011
- new State(60, "prot. non null"), // 111100
- new State(61), // 111101
- new State(62), // 111110
- new State(63), // 111111
- // STATES INITIALIZER END
- };
- public final static State start = states[0];
- public static final int
- stateMaxValue = 0x3F,
- stateWidth = 6,
- statesNb = stateMaxValue + 1;
- String name, printableBitsField, hexString;
- public byte value;
- boolean symbolic;
- private State() {
- }
- private State(int numericValue) {
- this(numericValue, null);
- }
- private State(int numericValue, String publicName) {
- if (numericValue > stateMaxValue) {
- throw new IllegalArgumentException("state value overflow");
- }
- this.value = (byte) numericValue;
- StringBuffer printableValue = new StringBuffer(6);
- for (int i = stateWidth - 1; i >= 0; i--) {
- printableValue.append((numericValue >>> i & 1) != 0 ? '1' : '0');
- }
- this.printableBitsField = printableValue.toString();
- if (this.value > 0xF) {
- this.hexString = "0x" + Integer.toHexString(this.value).toUpperCase();
- }
- else {
- this.hexString = "0x0" + Integer.toHexString(this.value).toUpperCase();
- }
- if (publicName != null) {
- this.name = publicName;
- this.symbolic = true;
- }
- else {
- this.name = this.printableBitsField;
- }
- }
- private State(String commentLine) {
- char current = ' '; // keep the initialization status quiet
- int cursor, length;
- for (cursor = 0, length = commentLine.length();
- cursor < length;
- cursor++) {
- if ((current = commentLine.charAt(cursor)) == '0' ||
- current == '1') {
- break;
- }
- }
- if (cursor == length) {
- throw new RuntimeException("bad state definition format (missing bits field): " + commentLine);
- // PREMATURE adopt consistent error policy
- }
- int valueDigits;
- for (valueDigits = 1; cursor < (length - 1) && valueDigits < stateWidth; valueDigits++) {
- this.value = (byte) ((this.value << 1) + (current - '0'));
- if ((current = commentLine.charAt(++cursor)) != '0' &&
- current != '1') {
- throw new RuntimeException("bad state definition format (inappropriate character in bits field): " + commentLine);
- // PREMATURE adopt consistent error policy
- }
- }
- if (valueDigits < stateWidth) {
- throw new RuntimeException("bad state definition format (bits field is too short): " + commentLine);
- // PREMATURE adopt consistent error policy
- }
- this.value = (byte) ((this.value << 1) + (current - '0'));
- this.printableBitsField = commentLine.substring(cursor - stateWidth + 1, cursor + 1);
- if (this.value > 0xF) {
- this.hexString = "0x" + Integer.toHexString(this.value).toUpperCase();
- }
- else {
- this.hexString = "0x0" + Integer.toHexString(this.value).toUpperCase();
- }
- while (++cursor < length && Character.isWhitespace(current = commentLine.charAt(++cursor)) && current != '\n') {
- // loop
- }
- if (cursor < length && current != '\n') {
- this.name = commentLine.substring(cursor, length);
- }
- if (this.name == null) {
- this.name = this.printableBitsField;
- } else {
- this.symbolic = true;
- }
- }
- private String asInitializer() {
- StringBuffer result = new StringBuffer(70);
- result.append(" new State(");
- result.append(this.value);
- char first;
- boolean nameIsSymbolic = (first = this.name.charAt(0)) != '0'
- && first != '1';
- if (nameIsSymbolic) {
- result.append(", \"");
- result.append(this.name);
- result.append('"');
- }
- result.append("), // ");
- result.append(this.printableBitsField);
- return result.toString();
- }
- long [] asLongArray() {
- long[] result = new long[stateWidth];
- for (int i = 0; i < stateWidth; i++) {
- result[i] = ((this.value >> (stateWidth - i - 1)) & 1) == 0 ? 0 : 1;
- }
- return result;
- }
- private String asSourceComment() {
- StringBuffer result = new StringBuffer(70);
- result.append("\t\t");
- result.append(this.printableBitsField);
- char first;
- boolean nameIsSymbolic = (first = this.name.charAt(0)) != '0'
- && first != '1';
- if (nameIsSymbolic) {
- result.append('\t');
- result.append(this.name);
- }
- return result.toString();
- }
- public int compareTo(Object o) {
- return this.value - ((State) o).value;
- }
- static State fromLongValues(long bit1, long bit2, long bit3, long bit4, long bit5, long bit6) {
- // PREMATURE consider taking an UnconditionalFlowInfo in parameter
- return states[(int)(
- (bit6 & 1) +
- 2 * ((bit5 & 1) +
- 2 * ((bit4 & 1) +
- 2 * ((bit3 & 1) +
- 2 * ((bit2 & 1) +
- 2 * (bit1 & 1))))))];
- }
- private static Map namesIndex;
- static State fromSymbolicName (String name) {
- if (namesIndex == null) {
- namesIndex = new HashMap(states.length);
- for (int i = 0; i < states.length; i++) {
- if (states[i].name != null) {
- namesIndex.put(states[i].name, states[i]);
- }
- }
- }
- return (State) namesIndex.get(name);
- }
- private static void grabDefinitionFromComment(BufferedReader input) {
- String line;
- State current;
- // use when the initializer is incomplete, hence needs to be reinitialized
- // states = new State[stateMaxValue + 1];
- // use when the states field is final, with the appropriate size:
- for (int i = 0; i <= stateMaxValue; i++) {
- states[i] = null;
- }
- try {
- while ((line = input.readLine()) != null && line.indexOf(definitionEndMarker) == -1) {
- current = new State(line);
- if (states[current.value] != null) {
- throw new RuntimeException("duplicate state for index: " + current.value);
- }
- else {
- states[current.value] = current;
- }
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- for (int i = 0; i < stateMaxValue; i++) {
- if (states[i] == null) {
- states[i] = new State(i);
- }
- }
- }
- // PREMATURE may decide to remove
- //private static void printAsInitializer() {
- // int i, length;
- // System.out.println(initializerStartMarker);
- // for (i = 0, length = states.length; i < length; i++) {
- // System.out.println(states[i].asInitializer());
- // }
- // for (/* continue */; i <= stateMaxValue; i++) {
- // System.out.println((new State(i)).asInitializer() + " CHECK");
- // }
- // System.out.println(initializerEndMarker);
- //}
- // PREMATURE may decide to remove
- //private static void printAsSourceComment() {
- // int i, length;
- // System.out.println("/*");
- // System.out.println(definitionStartMarker);
- // for (i = 0, length = states.length; i < length; i++) {
- // System.out.println(states[i].asSourceComment());
- // }
- // for (/* continue */; i <= stateMaxValue; i++) {
- // System.out.println((new State(i)).asSourceComment());
- // }
- // System.out.println(definitionEndMarker);
- // System.out.println("*/");
- //}
- private final static String
- definitionStartMarker = "// STATES " + CodeAnalysis.definitionStartMarker,
- definitionEndMarker = "// STATES " + CodeAnalysis.definitionEndMarker,
- initializerStartMarker = "// STATES " + CodeAnalysis.initializerStartMarker,
- initializerEndMarker = "// STATES " + CodeAnalysis.initializerEndMarker;
- static void reinitializeFromComment(BufferedReader input, BufferedWriter output) {
- String line, tab = "";
- int cursor;
- char c;
- try {
- while ((line = input.readLine()) != null) {
- output.write(line);
- output.write('\n');
- if ((cursor = line.indexOf(definitionStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- grabDefinitionFromComment(input); // consumes up to the END line
- int i, length;
- for (i = 0, length = states.length; i < length; i++) {
- output.write(states[i].asSourceComment());
- output.write('\n');
- }
- output.write(tab + definitionEndMarker + "\n");
- }
- }
- if ((cursor = line.indexOf(initializerStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- tab = "";
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(initializerEndMarker) == -1) {
- // loop
- }
- int i, length;
- for (i = 0, length = states.length; i < length; i++) {
- output.write(states[i].asInitializer());
- output.write('\n');
- }
- output.write(tab + initializerEndMarker + "\n");
- }
- }
- }
- output.flush();
- namesIndex = null;
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- static Iterator symbolicStates() {
- return new Iterator() {
- int nextSymbolic = -1;
- public boolean hasNext() {
- if (nextSymbolic == -1) {
- for (nextSymbolic = 0; nextSymbolic < states.length; nextSymbolic++) {
- if (states[nextSymbolic].symbolic) {
- break;
- }
- }
- } else {
- for (; nextSymbolic < states.length; nextSymbolic++) {
- if (states[nextSymbolic].symbolic) {
- break;
- }
- }
- }
- return nextSymbolic < states.length;
- }
- public Object next() {
- State result = null;
- if (nextSymbolic < states.length) {
- result = states[nextSymbolic];
- nextSymbolic++;
- }
- return result;
- }
- public void remove() {
- throw new RuntimeException("unimplemented");
- }
- };
- }
- public String toString() {
- return this.name;
- }
- }
-
-public NullReferenceImplTests(String name) {
- super(name);
-}
-
- // Tests tuning
- static final boolean
- skipHighOrderBits = false; // define to true when tuning encoding
- static final int
- combinationTestsloopsNb = 1; // define to 10000s to measure performances
-
-public static Test suite() {
- // we do not want to run for 1.3, 1.4, 1.5 but once only
- Class clazz = testClass();
- TestSuite all = new TestSuite(clazz.getName());
- List tests = buildTestsList(testClass());
- for (int i = 0, length = tests.size(); i < length; i++) {
- all.addTest((Test) tests.get(i));
- }
- return all;
-}
-
-public static Class testClass() {
- return NullReferenceImplTests.class;
-}
-
-public void test2050_markAsComparedEqualToNonNull() {
- int failures = NullReferenceImplTransformations.markAsComparedEqualToNonNull.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2051_markAsComparedEqualToNull() {
- int failures = NullReferenceImplTransformations.markAsComparedEqualToNull.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2055_markAsDefinitelyNonNull() {
- int failures = NullReferenceImplTransformations.markAsDefinitelyNonNull.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2056_markAsDefinitelyNull() {
- int failures = NullReferenceImplTransformations.markAsDefinitelyNull.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2057_markAsDefinitelyUnknown() {
- int failures = NullReferenceImplTransformations.markAsDefinitelyUnknown.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2060_addInitializationsFrom() {
- int failures = NullReferenceImplTransformations.addInitializationsFrom.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2061_addPotentialInitializationsFrom() {
- int failures = NullReferenceImplTransformations.addPotentialInitializationsFrom.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2062_mergedWith() {
- int failures = NullReferenceImplTransformations.mergedWith.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2070_newNullInfoRegistry() {
- int failures = NullReferenceImplTransformations.newNullInfoRegistry.test();
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-// PREMATURE rewrite from scratch
-//public void _test2058_recode() {
-// long [][][] testData = transitionsTablesData[recode];
-// int failures = 0;
-// long start;
-// if (combinationTestsloopsNb > 1) {
-// start = System.currentTimeMillis();
-// }
-// String header = "recode failures: ";
-// for (int l = 0; l < combinationTestsloopsNb ; l++) {
-// for (int i = 0; i < testData.length; i++) {
-// UnconditionalFlowInfoTestHarness result;
-// result = UnconditionalFlowInfoTestHarness.
-// testUnconditionalFlowInfo(testData[i][0]);
-// result.encode();
-// result.decode();
-//
-// if (!result.testEquals(UnconditionalFlowInfoTestHarness.
-// testUnconditionalFlowInfo(testData[i][0]))) {
-// if (failures == 0) {
-// System.out.println(header);
-// }
-// failures++;
-// System.out.println("\t\t{" + result.testString() +
-// "}, // instead of: " + testStringValueOf(testData[i][0]));
-// }
-// }
-// }
-// if (combinationTestsloopsNb > 1) {
-// System.out.println("mergedWith\t\t\t" + combinationTestsloopsNb + "\t" +
-// (System.currentTimeMillis() - start));
-// }
-// for (int i = 0; i < testData.length; i++) {
-// UnconditionalFlowInfoTestHarness result;
-// result = UnconditionalFlowInfoTestHarness.
-// testUnconditionalFlowInfo(testData[i][0], 64);
-// result.encode();
-// result.decode();
-//
-// if (!result.testEquals(UnconditionalFlowInfoTestHarness.
-// testUnconditionalFlowInfo(testData[i][0], 64))) {
-// if (failures == 0) {
-// System.out.println(header);
-// }
-// failures++;
-// System.out.println("\t\t{" + result.testString() +
-// "}, // (64) - instead of: " + testStringValueOf(testData[i][0]));
-// }
-// }
-// assertTrue("nb of failures: " + failures, failures == 0);
-//}
-
-public void test2400_state_consistency() {
- int failures = 0;
- long start;
- if (combinationTestsloopsNb > 1) {
- start = System.currentTimeMillis();
- }
- String header = "state consistency failures: ";
- for (int l = 0; l < combinationTestsloopsNb ; l++) {
- for (int i = 0; i < State.states.length; i++) {
- if (State.states[i].symbolic) {
- UnconditionalFlowInfoTestHarness
- state = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(State.states[i]);
- boolean
- isDefinitelyNonNull = state.isDefinitelyNonNull(TestLocalVariableBinding.local0),
- isDefinitelyNull = state.isDefinitelyNull(TestLocalVariableBinding.local0),
- isDefinitelyUnknown = state.isDefinitelyUnknown(TestLocalVariableBinding.local0),
- isPotentiallyNonNull = state.isPotentiallyNonNull(TestLocalVariableBinding.local0),
- isPotentiallyNull = state.isPotentiallyNull(TestLocalVariableBinding.local0),
- isPotentiallyUnknown = state.isPotentiallyUnknown(TestLocalVariableBinding.local0),
- isProtectedNonNull = state.isProtectedNonNull(TestLocalVariableBinding.local0),
- isProtectedNull = state.isProtectedNull(TestLocalVariableBinding.local0),
- cannotBeDefinitelyNullOrNonNull = state.cannotBeDefinitelyNullOrNonNull(TestLocalVariableBinding.local0),
- cannotBeNull = state.cannotBeNull(TestLocalVariableBinding.local0),
- canOnlyBeNull = state.canOnlyBeNull(TestLocalVariableBinding.local0);
- if (isDefinitelyNonNull
- && (isDefinitelyNull || isDefinitelyUnknown
- || isPotentiallyNull
- || isProtectedNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage for definitely non null state " + State.states[i].name);
- }
- if (isDefinitelyNull
- && (isDefinitelyNonNull || isDefinitelyUnknown
- || isPotentiallyUnknown || isProtectedNonNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage for definitely null state " + State.states[i].name);
- }
- if (isDefinitelyUnknown
- && (isDefinitelyNonNull || isDefinitelyNull
- || isPotentiallyNull || isProtectedNonNull
- || isProtectedNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage for definitely unknown state " + State.states[i].name);
- }
- if (isProtectedNonNull && !isDefinitelyNonNull
- || isProtectedNull && !isDefinitelyNull
- || i > 0 // not start
- && !State.states[i].name.equals("pot. non null")
- && !(isDefinitelyNonNull || isDefinitelyNull
- || isDefinitelyUnknown || isPotentiallyNull
- || isPotentiallyUnknown || isProtectedNonNull
- || isProtectedNull)
- || cannotBeDefinitelyNullOrNonNull !=
- (isPotentiallyUnknown ||
- isPotentiallyNull && isPotentiallyNonNull)
- || cannotBeNull != (isProtectedNonNull ||
- isDefinitelyNonNull)
- || canOnlyBeNull != (isProtectedNull ||
- isDefinitelyNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage for " + State.states[i].name);
- }
- }
- }
- }
- if (combinationTestsloopsNb > 1) {
- System.out.println("mergedWith\t\t\t" + combinationTestsloopsNb + "\t" +
- (System.currentTimeMillis() - start));
- }
- for (int i = 0; i < State.states.length; i++) {
- if (State.states[i].symbolic) {
- UnconditionalFlowInfoTestHarness state;
- state = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(State.states[i], 64);
- boolean
- isDefinitelyNonNull = state.isDefinitelyNonNull(TestLocalVariableBinding.local64),
- isDefinitelyNull = state.isDefinitelyNull(TestLocalVariableBinding.local64),
- isDefinitelyUnknown = state.isDefinitelyUnknown(TestLocalVariableBinding.local64),
- isPotentiallyNonNull = state.isPotentiallyNonNull(TestLocalVariableBinding.local64),
- isPotentiallyNull = state.isPotentiallyNull(TestLocalVariableBinding.local64),
- isPotentiallyUnknown = state.isPotentiallyUnknown(TestLocalVariableBinding.local64),
- isProtectedNonNull = state.isProtectedNonNull(TestLocalVariableBinding.local64),
- isProtectedNull = state.isProtectedNull(TestLocalVariableBinding.local64),
- cannotBeDefinitelyNullOrNonNull = state.cannotBeDefinitelyNullOrNonNull(TestLocalVariableBinding.local64),
- cannotBeNull = state.cannotBeNull(TestLocalVariableBinding.local64),
- canOnlyBeNull = state.canOnlyBeNull(TestLocalVariableBinding.local64);
- if (isDefinitelyNonNull
- && (isDefinitelyNull || isDefinitelyUnknown
- || isPotentiallyNull
- || isProtectedNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage (64) for definitely non null state " + State.states[i].name);
- }
- if (isDefinitelyNull
- && (isDefinitelyNonNull || isDefinitelyUnknown
- || isPotentiallyUnknown || isProtectedNonNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage (64) for definitely null state " + State.states[i].name);
- }
- if (isDefinitelyUnknown
- && (isDefinitelyNonNull || isDefinitelyNull
- || isPotentiallyNull || isProtectedNonNull
- || isProtectedNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage (64) for definitely unknown state " + State.states[i].name);
- }
- if (isProtectedNonNull && !isDefinitelyNonNull
- || isProtectedNull && !isDefinitelyNull
- || i > 0 // not start
- && !State.states[i].name.equals("pot. non null")
- && !(isDefinitelyNonNull || isDefinitelyNull
- || isDefinitelyUnknown || isPotentiallyNull
- || isPotentiallyUnknown || isProtectedNonNull
- || isProtectedNull)
- || cannotBeDefinitelyNullOrNonNull !=
- (isPotentiallyUnknown ||
- isPotentiallyNull &&
- isPotentiallyNonNull)
- || cannotBeNull != (isProtectedNonNull ||
- isDefinitelyNonNull)
- || canOnlyBeNull != (isProtectedNull ||
- isDefinitelyNull)) {
- if (failures == 0) {
- System.out.println(header);
- }
- failures++;
- System.out.println("\t\tconsistency breakage (64) for " + State.states[i].name);
- }
- }
- }
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-public void test2500_addInitializationsFrom_for_definites() {
- // when an added initialization is a def. something, it should
- // affect the left hand term as the markAsDefinite* method would
- // do
- int failures = 0;
- for (int i = 0; i < State.states.length; i++) {
- if (State.states[i].symbolic) {
- UnconditionalFlowInfoTestHarness source1, source2, result1, result2;
- source1 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(State.states[i]);
- for (int j = 0; j < State.states.length; j++) {
- if (State.states[j].symbolic) {
- source2 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(State.states[j]);
- result1 = (UnconditionalFlowInfoTestHarness) source1.copy();
- result2 = (UnconditionalFlowInfoTestHarness) source1.copy();
- if (source2.isDefinitelyNonNull(TestLocalVariableBinding.local0)) {
- if (! source2.isProtectedNonNull(TestLocalVariableBinding.local0)) {
- result1.markAsDefinitelyNonNull(TestLocalVariableBinding.local0);
- } else {
- continue;
- }
- }
- else if (source2.isDefinitelyNull(TestLocalVariableBinding.local0)) {
- if (! source2.isProtectedNull(TestLocalVariableBinding.local0)) {
- result1.markAsDefinitelyNull(TestLocalVariableBinding.local0);
- } else {
- continue;
- }
- }
- else if (source2.isDefinitelyUnknown(TestLocalVariableBinding.local0)) {
- result1.markAsDefinitelyUnknown(TestLocalVariableBinding.local0);
- }
- else if (source2.nullBit1 != 0) {
- if (failures == 0) {
- System.out.println("addInitializationsFrom_for_definites failures: "); //$NON-NLS-1$
- }
- failures++;
- System.out.println("\t\t" + State.states[j].name +
- " should answer true to at least one isDefinite* query");
- // PREMATURE move to specific queries test case
- }
- else {
- continue;
- }
- result2.addInitializationsFrom(source2);
- if (!result1.testEquals(result2)) {
- if (failures == 0) {
- System.out.println("addInitializationsFrom_for_definites failures: "); //$NON-NLS-1$
- }
- failures++;
- System.out.println("\t\t" + State.states[i].name +
- " + " + State.states[j].name +
- " => " + result2.asState().name +
- " instead of: " + result1.asState().name);
- }
- }
- }
- }
- }
- assertTrue("nb of failures: " + failures, failures == 0);
-}
-
-// Use for coverage tests only. Needs specific instrumentation of code,
-// that is controled by UnconditionalFlowInfo#coverageTestFlag.
-// Note: coverage tests tend to fill the console with messages, and the
-// instrumented code is slower, so never release code with active
-// coverage tests.
-private static int coveragePointsNb = 39;
-
-// PREMATURE reactivate coverage tests
-// Coverage by state transition tables methods.
-public void test2998_coverage() {
- if (UnconditionalFlowInfo.coverageTestFlag) {
- // sanity check: need to be sure that the tests execute properly when not
- // trying to check coverage
- UnconditionalFlowInfo.coverageTestId = 0;
- test0053_array();
- test0070_type_reference();
- test2050_markAsComparedEqualToNonNull();
- test2051_markAsComparedEqualToNull();
- test2055_markAsDefinitelyNonNull();
- test2056_markAsDefinitelyNull();
- test2057_markAsDefinitelyUnknown();
- test2060_addInitializationsFrom();
- test2061_addPotentialInitializationsFrom();
- test2062_mergedWith();
- // coverage check
- int failuresNb = 0;
- for (int i = 1; i <= coveragePointsNb; i++) {
- if (i == 11 || i == 12 || i == 14) {
- continue;
- // these can only be reached via a direct call to addPotentialNullInfoFrom,
- // which is not implemented in low level tests - all those go through
- // addPotentialInitsFrom
- }
- try {
- UnconditionalFlowInfo.coverageTestId = i;
- test0053_array();
- test0070_type_reference();
- test2050_markAsComparedEqualToNonNull();
- test2051_markAsComparedEqualToNull();
- test2055_markAsDefinitelyNonNull();
- test2056_markAsDefinitelyNull();
- test2057_markAsDefinitelyUnknown();
- test2060_addInitializationsFrom();
- test2061_addPotentialInitializationsFrom();
- test2062_mergedWith();
- }
- catch (AssertionFailedError e) {
- continue;
- }
- catch (AssertionFailedException e) {
- continue;
- }
- failuresNb++;
- System.out.println("Missing coverage point: " + i);
- }
- UnconditionalFlowInfo.coverageTestId = 0; // reset for other tests
- assertEquals(failuresNb + " missing coverage point(s)", failuresNb, 0);
- }
-}
-
-// Coverage by code samples.
-public void test2999_coverage() {
- if (UnconditionalFlowInfo.coverageTestFlag) {
- // sanity check: need to be sure that the tests execute properly when not
- // trying to check coverage
- UnconditionalFlowInfo.coverageTestId = 0;
- test0001_simple_local();
- test0053_array();
- test0070_type_reference();
- test0327_if_else();
- test0401_while();
- test0420_while();
- test0509_try_finally_embedded();
- test2000_flow_info();
- test2004_flow_info();
- test2008_flow_info();
- test2011_flow_info();
- test2013_flow_info();
- test2018_flow_info();
- test2019_flow_info();
- test2020_flow_info();
- // coverage check
- int failuresNb = 0;
- for (int i = 1; i <= coveragePointsNb; i++) {
- if (i < 3
- || 4 < i && i < 11
- || 11 < i && i < 16
- || 16 < i && i < 20
- || i == 21
- || 23 < i && i < 27
- || 29 < i && i < 33
- || 36 < i) { // TODO (maxime) complete coverage tests
- continue;
- }
- try {
- UnconditionalFlowInfo.coverageTestId = i;
- test0001_simple_local();
- test0053_array();
- test0070_type_reference();
- test0327_if_else();
- test0401_while();
- test0420_while();
- test0509_try_finally_embedded();
- test2000_flow_info();
- test2004_flow_info();
- test2008_flow_info();
- test2011_flow_info();
- test2013_flow_info();
- test2018_flow_info();
- test2019_flow_info();
- test2020_flow_info();
- }
- catch (AssertionFailedError e) {
- continue;
- }
- catch (AssertionFailedException e) {
- continue;
- }
- failuresNb++;
- System.out.println("Missing coverage point: " + i);
- }
- UnconditionalFlowInfo.coverageTestId = 0; // reset for other tests
- assertEquals(failuresNb + " missing coverage point(s)", failuresNb, 0);
- }
-}
-
-// only works for info coded on bit 0 - least significant
-String testCodedValueOf(long[] data) {
- int length;
- StringBuffer result = new StringBuffer(length = data.length);
- for (int i = 0; i < length; i++) {
- result.append(data[i] == 0 ? '0' : '1');
- }
- return result.toString();
-}
-
-static String testStringValueOf(long[] data) {
- int length;
- StringBuffer result = new StringBuffer((length = data.length) * 2 + 1);
- result.append('{');
- for (int i = 0; i < length; i++) {
- if (i > 0) {
- result.append(',');
- }
- result.append(data[i]);
- }
- result.append('}');
- return result.toString();
-}
-}
-
-/**
- * A specific extension of LocalVariableBinding suitable for flow info
- * manipulation at an implementation level.
- */
-class TestLocalVariableBinding extends LocalVariableBinding {
- static class TestTypeBinding extends TypeBinding {
- public TestTypeBinding() {
- tagBits = 0L;
- }
- public char[] constantPoolName() {
- return null;
- }
- public PackageBinding getPackage() {
- return null;
- }
- public boolean isCompatibleWith(TypeBinding right) {
- return false;
- }
- public char[] qualifiedSourceName() {
- return null;
- }
- public char[] sourceName() {
- return null;
- }
- public char[] readableName() {
- return null;
- }
- }
- final static TypeBinding testTypeBinding = new TestTypeBinding();
- final static char [] testName = {'t', 'e', 's', 't'};
- TestLocalVariableBinding(int id) {
- super(testName, testTypeBinding, 0, false);
- this.id = id;
- }
- public Constant constant() {
- return Constant.NotAConstant;
- }
- static final TestLocalVariableBinding
- local0 = new TestLocalVariableBinding(0),
- local64 = new TestLocalVariableBinding(64),
- local128 = new TestLocalVariableBinding(128);
-}
-
-/**
- * A class meant to augment
- * @link{org.eclipse.wst.jsdt.internal.compiler.flow.UnconditionalFlowInfo} with
- * capabilities in the test domain. It especially provides factories to build
- * fake flow info instances for use in state transitions validation.
- */
-/*
- * Moreover, this class defines the implementation of key operations for the
- * benefit of itself and NullInfoRegistryTestHarness. Given the fact that the
- * latter could not extend UnconditionalFlowInfoTestHarness and
- * NullInfoRegistry, the code is factorized into static methods.
- */
-class UnconditionalFlowInfoTestHarness extends UnconditionalFlowInfo {
- int testPosition;
- // Interface
-/**
- * Return the state represented by this.
- * @return the state represented by this
- */
-NullReferenceImplTests.State asState() {
- return asState(this, 0);
-}
-
-/**
- * Return the state represented by this for a variable encoded at a given position.
- * @param position - int the position of the considered variable
- * @return the state represented by this for a variable encoded at a given position
- */
-NullReferenceImplTests.State asState(int position) {
- return asState(this, position);
-}
-
-public FlowInfo copy() {
- UnconditionalFlowInfoTestHarness copy =
- new UnconditionalFlowInfoTestHarness();
- copy.testPosition = this.testPosition;
- copy(this, copy);
- return copy;
-}
-
-public void markAsDefinitelyNonNull(LocalVariableBinding local) {
- grow( getLocalID(local));
- super.markAsDefinitelyNonNull(local);
-}
-
-public void markAsDefinitelyNull(LocalVariableBinding local) {
- grow( getLocalID(local));
- super.markAsDefinitelyNull(local);
-}
-
-public void markAsDefinitelyUnknown(LocalVariableBinding local) {
- grow( getLocalID(local));
- super.markAsDefinitelyUnknown(local);
-}
-
-/**
- * Return a fake unconditional flow info which bit fields represent the given
- * null bits for a local variable of id 0 within a class that would have no
- * field.
- * @param nullBits the bits that must be set, given in the same order as the
- * nullAssignment* fields in UnconditionalFlowInfo definition; use 0
- * for a bit that is not set, 1 else
- * @return a fake unconditional flow info which bit fields represent the
- * null bits given in parameter
- */
-public static UnconditionalFlowInfoTestHarness testUnconditionalFlowInfo(
- long [] nullBits) {
- return testUnconditionalFlowInfo(nullBits, 0);
-}
-
-/**
- * Return a fake unconditional flow info which bit fields represent the given
- * null bits for a local variable of id position within a class that would have
- * no field.
- * @param nullBits the bits that must be set, given in the same order as the
- * nullAssignment* fields in UnconditionalFlowInfo definition; use 0
- * for a bit that is not set, 1 else
- * @param position the position of the variable within the bit fields; use
- * various values to test different parts of the bit fields, within
- * or beyond BitCacheSize
- * @return a fake unconditional flow info which bit fields represent the
- * null bits given in parameter
- */
-public static UnconditionalFlowInfoTestHarness testUnconditionalFlowInfo(
- long [] nullBits, int position) {
- UnconditionalFlowInfoTestHarness result =
- new UnconditionalFlowInfoTestHarness();
- result.testPosition = position;
- init(result, nullBits, position);
- return result;
-}
-
-/**
- * Return a fake unconditional flow info which bit fields represent the given
- * state for a local variable of id 0 within a class that would have
- * no field.
- * @param state - State the desired state for the variable
- * @return a fake unconditional flow info which bit fields represent the
- * state given in parameter
- */
-public static UnconditionalFlowInfoTestHarness testUnconditionalFlowInfo(NullReferenceImplTests.State state) {
- return testUnconditionalFlowInfo(state, 0);
-}
-
-/**
- * Return a fake unconditional flow info which bit fields represent the given
- * state for a local variable of id position within a class that would have
- * no field.
- * @param state - State the desired state for the variable
- * @param position the position of the variable within the bit fields; use
- * various values to test different parts of the bit fields, within
- * or beyond BitCacheSize
- * @return a fake unconditional flow info which bit fields represent the
- * state given in parameter
- */
-public static UnconditionalFlowInfoTestHarness testUnconditionalFlowInfo(
- NullReferenceImplTests.State state, int position) {
- UnconditionalFlowInfoTestHarness result =
- new UnconditionalFlowInfoTestHarness();
- long[] nullBits = state.asLongArray();
- result.testPosition = position;
- init(result, nullBits, position);
- return result;
-}
-
-/**
- * Return true iff this flow info can be considered as equal to the one passed
- * in parameter.
- * @param other the flow info to compare to
- * @return true iff this flow info compares equal to other
- */
-public boolean testEquals(UnconditionalFlowInfo other) {
- return testEquals(this, other);
-}
-
-/**
- * Return true iff this flow info can be considered as equal to the one passed
- * in parameter in respect with a single local variable which id would be
- * position in a class with no field.
- * @param other the flow info to compare to
- * @param position the position of the local to consider
- * @return true iff this flow info compares equal to other for a given local
- */
-public boolean testEquals(UnconditionalFlowInfo other, int position) {
- return testEquals(this, other, position);
-}
-
-/**
- * Return a string suitable for use as a representation of this flow info
- * within test series.
- * @return a string suitable for use as a representation of this flow info
- */
-public String testString() {
- if (this == DEAD_END) {
- return "FlowInfo.DEAD_END"; //$NON-NLS-1$
- }
- return testString(this, this.testPosition);
-}
-
-/**
- * Return a string suitable for use as a representation of this flow info
- * within test series.
- * @param position a position to consider instead of this flow info default
- * test position
- * @return a string suitable for use as a representation of this flow info
- */
-public String testString(int position) {
- return testString(this, position);
-}
-
- // Factorized implementation
-static NullReferenceImplTests.State asState(UnconditionalFlowInfo zis, int position) {
- if ((zis.tagBits & NULL_FLAG_MASK) == 0) {
- return NullReferenceImplTests.State.start;
- }
- if (position < BitCacheSize) {
- return NullReferenceImplTests.State.fromLongValues(
- (zis.nullBit1 >> position) & 1,
- (zis.nullBit2 >> position) & 1,
- (zis.nullBit3 >> position) & 1,
- (zis.nullBit4 >> position) & 1,
- 0,
- 0);
- }
- else {
- int vectorIndex = (position / BitCacheSize) - 1;
- position %= BitCacheSize;
- if (vectorIndex >= zis.extra[2].length) {
- return NullReferenceImplTests.State.start;
- }
- return NullReferenceImplTests.State.fromLongValues(
- (zis.extra[2][vectorIndex] >> position) & 1,
- (zis.extra[3][vectorIndex] >> position) & 1,
- (zis.extra[4][vectorIndex] >> position) & 1,
- (zis.extra[5][vectorIndex] >> position) & 1,
- 0 //(zis.extra[6][vectorIndex] >> position) & 1,
- , 0 //(zis.extra[7][vectorIndex] >> position) & 1
- );
- }
-}
-
-static void copy(UnconditionalFlowInfo source, UnconditionalFlowInfo target) {
- target.definiteInits = source.definiteInits;
- target.potentialInits = source.potentialInits;
- boolean hasNullInfo = (source.tagBits & NULL_FLAG_MASK) != 0;
- if (hasNullInfo) {
- target.nullBit1 = source.nullBit1;
- target.nullBit2 = source.nullBit2;
- target.nullBit3 = source.nullBit3;
- target.nullBit4 = source.nullBit4;
-// target.nullBit5 = source.nullBit5;
-// target.nullBit6 = source.nullBit6;
- }
- target.tagBits = source.tagBits;
- target.maxFieldCount = source.maxFieldCount;
- if (source.extra != null) {
- int length;
- target.extra = new long[extraLength][];
- System.arraycopy(source.extra[0], 0,
- (target.extra[0] = new long[length = source.extra[0].length]), 0, length);
- System.arraycopy(source.extra[1], 0,
- (target.extra[1] = new long[length]), 0, length);
- if (hasNullInfo) {
- for (int j = 0; j < extraLength; j++) {
- System.arraycopy(source.extra[j], 0,
- (target.extra[j] = new long[length]), 0, length);
- }
- }
- else {
- for (int j = 0; j < extraLength; j++) {
- target.extra[j] = new long[length];
- }
- }
- }
-}
-
-public void grow(int position) {
- int vectorIndex = ((position) / BitCacheSize) - 1;
- int length = vectorIndex + 1, oldLength;
- if (this.extra == null) {
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
- } else if (length > (oldLength = this.extra[2].length)) {
- for (int j = 0; j < extraLength; j++) {
- System.arraycopy(this.extra[j], 0,
- this.extra[j] = new long[length], 0, oldLength);
- }
- }
-}
-
-static void init(UnconditionalFlowInfo zis, long [] nullBits, int position) {
- if (position < BitCacheSize) {
- zis.nullBit1 = nullBits[0] << position;
- zis.nullBit2 = nullBits[1] << position;
- zis.nullBit3 = nullBits[2] << position;
- zis.nullBit4 = nullBits[3] << position;
-// zis.nullBit5 = nullBits[4] << position;
-// zis.nullBit6 = nullBits[5] << position;
- }
- else {
- int vectorIndex = (position / BitCacheSize) - 1,
- length = vectorIndex + 1;
- position %= BitCacheSize;
- zis.extra = new long[extraLength][];
- zis.extra[0] = new long[length];
- zis.extra[1] = new long[length];
- for (int j = 2; j < extraLength; j++) {
- zis.extra[j] = new long[length];
- zis.extra[j][vectorIndex] = nullBits[j - 2] << position;
- }
- }
- if (nullBits[0] != 0 || nullBits[1] != 0
- || nullBits[2] != 0 || nullBits[3] != 0
- || nullBits[4] != 0 || nullBits[5] != 0) {
- // cascade better than nullBits[0] | nullBits[1] | nullBits[2] | nullBits[3]
- // by 10%+
- // TODO (maxime) run stats to determine which is the better order
- zis.tagBits |= NULL_FLAG_MASK;
- }
- zis.maxFieldCount = 0;
-}
-
-static boolean testEquals(UnconditionalFlowInfo zis, UnconditionalFlowInfo other) {
- if (zis.tagBits != other.tagBits) {
- return false;
- }
- if (zis.nullBit1 != other.nullBit1
- || zis.nullBit2 != other.nullBit2
- || zis.nullBit3 != other.nullBit3
- || zis.nullBit4 != other.nullBit4
- /* || zis.nullBit5 != other.nullBit5
- || zis.nullBit6 != other.nullBit6 */) {
- return false;
- }
- int left = zis.extra == null ? 0 : zis.extra[2].length,
- right = other.extra == null ? 0 : other.extra[2].length,
- both = 0, i;
- if (left > right) {
- both = right;
- }
- else {
- both = left;
- }
- for (i = 0; i < both ; i++) {
- for (int j = 2; j < extraLength; j++) {
- if (zis.extra[j][i] !=
- other.extra[j][i]) {
- return false;
- }
- }
- }
- for (; i < left; i++) {
- for (int j = 2; j < extraLength; j++) {
- if (zis.extra[j][i] != 0) {
- return false;
- }
- }
- }
- for (; i < right; i++) {
- for (int j = 2; j < extraLength; j++) {
- if (other.extra[j][i] != 0) {
- return false;
- }
- }
- }
- return true;
-}
-
-static boolean testEquals(UnconditionalFlowInfo zis, UnconditionalFlowInfo other,
- int position) {
- int vectorIndex = position / BitCacheSize - 1;
- if ((zis.tagBits & other.tagBits & NULL_FLAG_MASK) == 0) {
- return true;
- }
- long mask;
- if (vectorIndex < 0) {
- return ((zis.nullBit1 & (mask = (1L << position))) ^
- (other.nullBit1 & mask)) == 0 &&
- ((zis.nullBit2 & mask) ^
- (other.nullBit2 & mask)) == 0 &&
- ((zis.nullBit3 & mask) ^
- (other.nullBit3 & mask)) == 0 &&
- ((zis.nullBit4 & mask) ^
- (other.nullBit4 & mask)) == 0 /* &&
- ((zis.nullBit5 & mask) ^
- (other.nullBit5 & mask)) == 0 &&
- ((zis.nullBit6 & mask) ^
- (other.nullBit6 & mask)) == 0 */;
- }
- else {
- int left = zis.extra == null ?
- 0 :
- zis.extra[0].length;
- int right = other.extra == null ?
- 0 :
- other.extra[0].length;
- int both = left < right ? left : right;
- if (vectorIndex < both) {
- mask = (1L << (position % BitCacheSize));
- for (int j = 2; j < extraLength; j++) {
- if (((zis.extra[j][vectorIndex] & mask)
- ^ (other.extra[j][vectorIndex] & mask)) != 0) {
- return false;
- }
- }
- return true;
- }
- if (vectorIndex < left) {
- return ((zis.extra[2][vectorIndex] |
- zis.extra[3][vectorIndex] |
- zis.extra[4][vectorIndex] |
- zis.extra[5][vectorIndex] |
- zis.extra[6][vectorIndex] |
- zis.extra[7][vectorIndex]) &
- (1L << (position % BitCacheSize))) == 0;
- }
- return ((other.extra[2][vectorIndex] |
- other.extra[3][vectorIndex] |
- other.extra[4][vectorIndex] |
- other.extra[5][vectorIndex] |
- other.extra[6][vectorIndex] |
- other.extra[7][vectorIndex]) &
- (1L << (position % BitCacheSize))) == 0;
- }
-}
-
-static String testString(UnconditionalFlowInfo zis, int position) {
- if (zis == DEAD_END) {
- return "FlowInfo.DEAD_END"; //$NON-NLS-1$
- }
- if (position < BitCacheSize) {
- return "{" + (zis.nullBit1 >> position) //$NON-NLS-1$
- + "," + (zis.nullBit2 >> position) //$NON-NLS-1$
- + "," + (zis.nullBit3 >> position) //$NON-NLS-1$
- + "," + (zis.nullBit4 >> position) //$NON-NLS-1$
-// + "," + (zis.nullBit5 >> position) //$NON-NLS-1$
-// + "," + (zis.nullBit6 >> position) //$NON-NLS-1$
- + "}"; //$NON-NLS-1$
- }
- else {
- int vectorIndex = position / BitCacheSize - 1,
- shift = position % BitCacheSize;
- return "{" + (zis.extra[2][vectorIndex] //$NON-NLS-1$
- >> shift)
- + "," + (zis.extra[3][vectorIndex] //$NON-NLS-1$
- >> shift)
- + "," + (zis.extra[4][vectorIndex] //$NON-NLS-1$
- >> shift)
- + "," + (zis.extra[5][vectorIndex] //$NON-NLS-1$
- >> shift)
-// + "," + (zis.extra[6][vectorIndex] //$NON-NLS-1$
-// >> shift)
-// + "," + (zis.extra[7][vectorIndex] //$NON-NLS-1$
-// >> shift)
- + "}"; //$NON-NLS-1$
- }
-}
-}
-/**
- * A class meant to augment
- * @link{org.eclipse.wst.jsdt.internal.compiler.flow.NullInfoRegistry} with
- * capabilities in the test domain. It especially provides factories to build
- * fake flow info instances for use in state transitions validation.
- */
-/*
- * The reason why UnconditionalFlowInfoTestHarness and this class were
- * separated is that NullInfoRegistry redefines part of the markAs* methods,
- * in effect preventing a harness extending NullInfoRegistry to access
- * UnconditionalFlowInfo implementations of the said methods.
- */
-class NullInfoRegistryTestHarness extends NullInfoRegistry {
- private int testPosition;
-
-private NullInfoRegistryTestHarness() {
- super(FlowInfo.DEAD_END);
-}
-
- // Interface
-/**
- * Return the state represented by this.
- * @return the state represented by this
- */
-NullReferenceImplTests.State asState() {
- return UnconditionalFlowInfoTestHarness.asState(this, 0);
-}
-
-/**
- * Return the state represented by this for a variable encoded at a given position.
- * @param position - int the position of the considered variable
- * @return the state represented by this for a variable encoded at a given position
- */
-NullReferenceImplTests.State asState(int position) {
- return UnconditionalFlowInfoTestHarness.asState(this, position);
-}
-
-public FlowInfo copy() {
- NullInfoRegistryTestHarness copy =
- new NullInfoRegistryTestHarness();
- copy.testPosition = this.testPosition;
- UnconditionalFlowInfoTestHarness.copy(this, copy);
- return copy;
-}
-
-/**
- * Return a fake null info registry derived from an unconditional flow
- * info.
- * @param upstream - UnconditionalFlowInfoTestHarness the upstream flow info
- * @return a fake null info registry derived from upstream
- */
-public static NullInfoRegistryTestHarness testNullInfoRegistry(
- UnconditionalFlowInfoTestHarness upstream) {
- NullInfoRegistry nullInfoRegistry = new NullInfoRegistry(upstream);
- NullInfoRegistryTestHarness result =
- new NullInfoRegistryTestHarness();
- result.testPosition = upstream.testPosition;
- if (result.testPosition < BitCacheSize) {
- result.nullBit1 = nullInfoRegistry.nullBit1;
- result.nullBit2 = nullInfoRegistry.nullBit2;
- result.nullBit3 = nullInfoRegistry.nullBit3;
- result.nullBit4 = nullInfoRegistry.nullBit4;
-// result.nullBit5 = nullInfoRegistry.nullBit5;
-// result.nullBit6 = nullInfoRegistry.nullBit6;
- }
- else if ((nullInfoRegistry.tagBits & NULL_FLAG_MASK) != 0){
- int vectorIndex = (result.testPosition / BitCacheSize) - 1,
- length = vectorIndex + 1;
- result.extra = new long[extraLength][];
- result.extra[0] = new long[length];
- result.extra[1] = new long[length];
- for (int j = 2; j < extraLength; j++) {
- result.extra[j] = new long[length];
- result.extra[j][vectorIndex] = nullInfoRegistry.extra[j][vectorIndex];
- }
- }
- if ((nullInfoRegistry.tagBits & NULL_FLAG_MASK) != 0) {
- result.tagBits |= NULL_FLAG_MASK;
- }
- result.maxFieldCount = 0;
- return result;
-}
-
-/**
- * Return true iff this flow info can be considered as equal to the one passed
- * in parameter.
- * @param other the flow info to compare to
- * @return true iff this flow info compares equal to other
- */
-public boolean testEquals(UnconditionalFlowInfo other) {
- return UnconditionalFlowInfoTestHarness.testEquals(this, other);
-}
-
-/**
- * Return true iff this flow info can be considered as equal to the one passed
- * in parameter in respect with a single local variable which id would be
- * position in a class with no field.
- * @param other the flow info to compare to
- * @param position the position of the local to consider
- * @return true iff this flow info compares equal to other for a given local
- */
-public boolean testEquals(UnconditionalFlowInfo other, int position) {
- return UnconditionalFlowInfoTestHarness.testEquals(this, other, position);
-}
-
-/**
- * Return a string suitable for use as a representation of this flow info
- * within test series.
- * @return a string suitable for use as a representation of this flow info
- */
-public String testString() {
- if (this == DEAD_END) {
- return "FlowInfo.DEAD_END"; //$NON-NLS-1$
- }
- return UnconditionalFlowInfoTestHarness.testString(this, this.testPosition);
-}
-
-/**
- * Return a string suitable for use as a representation of this flow info
- * within test series.
- * @param position a position to consider instead of this flow info default
- * test position
- * @return a string suitable for use as a representation of this flow info
- */
-public String testString(int position) {
- return UnconditionalFlowInfoTestHarness.testString(this, position);
-}
-}
-
-interface CodeAnalysis {
- public static final String
- definitionStartMarker = "DEFINITION START",
- definitionEndMarker = "DEFINITION END",
- initializerStartMarker = "INITIALIZER START",
- initializerEndMarker = "INITIALIZER END";
-}
-class TransitiveClosureHolder {
-static class Element {
- NullReferenceImplTests.State value;
- boolean alreadyKnown;
- Element(NullReferenceImplTests.State value) {
- if (value == null) {
- throw new IllegalArgumentException("not a valid element");
- }
- this.value = value;
- }
-}
-Map elements = new TreeMap();
-public TransitiveClosureHolder() {
- Element start = new Element(NullReferenceImplTests.State.start);
- this.elements.put(start.value, start);
-}
-void add(NullReferenceImplTests.State value) {
- if (value == null) {
- throw new IllegalArgumentException("not a valid state");
- }
- if (! this.elements.containsKey(value)) {
- this.elements.put(value, new Element(value));
- }
-}
-void add(NullReferenceImplTests.State[] values) {
- if (values == null) {
- throw new IllegalArgumentException("not a valid states set");
- }
- for (int i = 0, length = values.length; i < length; i++) {
- add(values[i]);
- }
-}
-NullReferenceImplTests.State[] asArray() {
- int length;
- NullReferenceImplTests.State[] result = new NullReferenceImplTests.State[length = this.elements.size()];
- Iterator elementsIterator = this.elements.keySet().iterator();
- for (int j = 0; j < length; j++) {
- result[j] = (NullReferenceImplTests.State) elementsIterator.next();
- }
- return result;
-}
-NullReferenceImplTests.State[] notAlreadyKnowns() {
- List resultAccumulator = new ArrayList(this.elements.size());
- Iterator i = this.elements.values().iterator();
- Element current;
- while (i.hasNext()) {
- if (! (current = (Element) i.next()).alreadyKnown) {
- resultAccumulator.add(current.value);
- }
- }
- int length;
- NullReferenceImplTests.State[] result = new NullReferenceImplTests.State[length = resultAccumulator.size()];
- for (int j = 0; j < length; j++) {
- result[j] = (NullReferenceImplTests.State) resultAccumulator.get(j);
- }
- return result;
-}
-void markAllAsAlreadyKnown() {
- Iterator i = this.elements.values().iterator();
- while (i.hasNext()) {
- ((Element) i.next()).alreadyKnown = true;
- }
-}
-public String toString() {
- StringBuffer output = new StringBuffer();
- output.append("Transitive closure:\n");
- SortedMap sorted = new TreeMap(this.elements);
- Iterator i = sorted.keySet().iterator();
- while (i.hasNext()) {
- output.append(i.next().toString());
- output.append('\n');
- }
- return output.toString();
-}
-}
-
-// PREMATURE segregate pure tooling into a separate project, keep tests only here
-/**
- * The Generator class is meant to generate the tabular data needed by the
- * flow information implementation level tests. While the tests should ensure
- * non regression by leveraging their initialization tables only, any change
- * into the flow information logic or encoding is due to yield considerable
- * changes into the literal values sets of the initializers themselves.
- * Tooling the production of those literals buys us flexibility.
- * {@link #printHelp printHelp} for details.
- */
-class Generator {
-static NullReferenceImplTests.State[] computeTransitiveClosure() {
- TransitiveClosureHolder transitiveClosure = new TransitiveClosureHolder();
- NullReferenceImplTests.State[] unknowns;
- unknowns = transitiveClosure.notAlreadyKnowns();
- while (unknowns.length != 0) {
- transitiveClosure.markAllAsAlreadyKnown();
- for (int i = 0, length = NullReferenceImplTransformations.transformations.length; i < length; i ++) {
- transitiveClosure.add(
- NullReferenceImplTransformations.transformations[i].
- computeOutputs(transitiveClosure.asArray()));
- }
- unknowns = transitiveClosure.notAlreadyKnowns();
- }
- return transitiveClosure.asArray();
-}
-public static void main(String[] args) {
- if (args.length == 0) {
- printHelp(false);
- System.exit(1);
- }
- switch (args.length) {
- case 1:
- if (args[0].equals("--help")) {
- printHelp(true);
- System.exit(0);
- }
- else {
- printHelp(false);
- System.exit(1);
- }
- case 2:
- if (args[0].equals("--printTruthTables")) {
- File outputDir = new File(args[1]);
- if (outputDir.isDirectory()) {
- for (int i = 0, length = NullReferenceImplTransformations.transformations.length; i < length; i++) {
- NullReferenceImplTransformations.transformations[i].printTruthTables(outputDir);
- }
- }
- else {
- // PREMATURE error handling
- }
- System.exit(0);
- }
- else {
- printHelp(false);
- System.exit(1);
- }
- case 3:
- if (args[0].equals("--reinitializeFromComputedValues")) {
- reinitializeFromComputedValues(args[1], args[2]);
- System.out.println("Generator generated new file into " + args[2]);
- System.exit(0);
- }
- case 5:
- if (args[0].equals("--reinitializeFromComments")) {
- reinitializeFromComments(args[1], args[2], args[3], args[4]);
- System.out.println("Generator generated new files into " + args[2]
- + " and " + args[4]);
- System.exit(0);
- }
- default:
- printHelp(false);
- System.exit(1);
- }
-}
-
-private static void reinitializeFromComments(
- String statesSource, String statesTarget,
- String transformationsSource, String transformationsTarget) {
- if (statesSource.equals(transformationsSource) ||
- statesTarget.equals(transformationsTarget)) {
- throw new RuntimeException();
- }
- try {
- BufferedReader in;
- BufferedWriter out;
- NullReferenceImplTests.State.reinitializeFromComment(
- in = new BufferedReader(
- new FileReader(statesSource)),
- out = new BufferedWriter(new FileWriter(statesTarget)));
- in.close();
- out.close();
- File[] tempFiles = new File[2];
- tempFiles[0] = File.createTempFile("generator", "java");
- tempFiles[1] = File.createTempFile("generator", "java");
- NullReferenceImplTransformations.transformations[0].reinitializeFromComments(
- in = new BufferedReader(
- new FileReader(transformationsSource)),
- out = new BufferedWriter(new FileWriter(tempFiles[0])));
- in.close();
- out.close();
- int i, length;
- for (i = 1, length = NullReferenceImplTransformations.transformations.length - 1; i < length; i++) {
- NullReferenceImplTransformations.transformations[i].reinitializeFromComments(
- in = new BufferedReader(
- new FileReader(tempFiles[(i + 1) % 2])),
- out = new BufferedWriter(new FileWriter(tempFiles[i % 2])));
- in.close();
- out.close();
- }
- NullReferenceImplTransformations.transformations[i].reinitializeFromComments(
- in = new BufferedReader(
- new FileReader(tempFiles[(i + 1) % 2])),
- out = new BufferedWriter(new FileWriter(transformationsTarget)));
- in.close();
- out.close();
- } catch (Throwable t) {
- System.err.println("Generator error:");
- t.printStackTrace(System.err);
- System.exit(2);
- }
-}
-
-private static void reinitializeFromComputedValues(String source, String target) {
- for (int i = 0, length = NullReferenceImplTransformations.transformations.length;
- i < length; i++) {
- NullReferenceImplTransformations.transformations[i].hydrate();
- }
- NullReferenceImplTests.State[] transitiveClosure = computeTransitiveClosure();
- try {
- BufferedReader in;
- BufferedWriter out;
- File[] tempFiles = new File[2];
- tempFiles[0] = File.createTempFile("generator", "java");
- tempFiles[1] = File.createTempFile("generator", "java");
- NullReferenceImplTransformations.transformations[0].reinitializeFromComputedValues(
- in = new BufferedReader(
- new FileReader(source)),
- out = new BufferedWriter(new FileWriter(tempFiles[0])),
- transitiveClosure);
- in.close();
- out.close();
- int i, length;
- for (i = 1, length = NullReferenceImplTransformations.transformations.length - 1; i < length; i++) {
- NullReferenceImplTransformations.transformations[i].reinitializeFromComputedValues(
- in = new BufferedReader(
- new FileReader(tempFiles[(i + 1) % 2])),
- out = new BufferedWriter(new FileWriter(tempFiles[i % 2])),
- transitiveClosure);
- in.close();
- out.close();
- }
- NullReferenceImplTransformations.transformations[i].reinitializeFromComputedValues(
- in = new BufferedReader(
- new FileReader(tempFiles[(i + 1) % 2])),
- out = new BufferedWriter(new FileWriter(target)),
- transitiveClosure);
- in.close();
- out.close();
- } catch (Throwable t) {
- System.err.println("Generator error:");
- t.printStackTrace(System.err);
- System.exit(2);
- }
-}
-
-private static void printHelp(boolean longText) {
- if (longText) {
- System.out.println(
- "Generator use cases\n" +
- " - when a brand new logic is experimented for the transitions, the best\n" +
- " way to go is to write explicit (inefficient) transformation code within\n" +
- " UnconditionalFlowInfo, then generate the literal initializers from\n" +
- " there; use the command\n" +
- " --reinitializeFromComputedValues <source file> <target file>\n" +
- " to this effect; in case of inconsistencies or errors, messages are\n" +
- " printed to the error output stream and the result should be considered as non reliable;\n" +
- " - when only a few changes are made to state names or a specific\n" +
- " transitions, it should be possible to get the test initializers fixed\n" +
- " before UnconditionalFlowInfo implements those changes; use the command\n" +
- " --reinitializeFromComments <states source file> <states target file> <transformations source file> <transformations target file>\n" +
- " to this effect;\n" +
- " - the same command can be used when, while the semantics of the system\n" +
- " are unchanged, the encoding is modified; it should then produce the\n" +
- " initializers according to the new encoding, as defined by the comment\n" +
- " for State.states, and the transformations as defined by their\n" +
- " respective comment;\n" +
- " - when a given encoding is retained, its optimization may leverage truth\n" +
- " tables; use the --printTruthTables command to this effect.\n" +
- " \n\n");
- printHelp(false);
- }
- else {
- System.out.println(
- "Usage:\n" +
- "Generator --help\n" +
- " prints a more detailed help message\n" +
- "Generator --printTruthTables\n" +
- " prints the truth tables of the transformations\n" +
- "Generator --reinitializeFromComments <source file> <target file>\n" +
- " generates into target file a copy of source file into which\n" +
- " transformations initializers have been reset from their definitions\n" +
- "Generator --reinitializeFromComputedValues <source file> <target file>\n" +
- " generates into target file a copy of source file into which\n" +
- " transformations definitions and initializers have been reset\n" +
- " according to the behavior of the current UnconditionalFlowInfo\n"
- );
- }
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTransformations.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTransformations.java
deleted file mode 100644
index 861b550..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTransformations.java
+++ /dev/null
@@ -1,3177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.NullReferenceImplTests.State;
-import org.eclipse.wst.jsdt.internal.compiler.flow.UnconditionalFlowInfo;
-public class NullReferenceImplTransformations {
- public static final Transformation
- markAsComparedEqualToNonNull =
- // markAsComparedEqualToNonNull DEFINITION START
- // start => prot. non null
- // prot. non null => prot. non null
- // prot. null => prot. non null
- // pot. unknown => pot. nn & prot. nn
- // pot. non null => pot. nn & prot. nn
- // pot. nn & prot. nn => pot. nn & prot. nn
- // pot. nn & pot. un => pot. nn & prot. nn
- // pot. null => prot. non null
- // pot. n & prot. n => prot. non null
- // pot. n & pot. un => pot. nn & prot. nn
- // pot. n & pot. nn => pot. nn & prot. nn
- // def. unknown => def. non null
- // def. non null => def. non null
- // def. null => prot. non null
- // markAsComparedEqualToNonNull DEFINITION END
- new TwoDimensionalTransformation("markAsComparedEqualToNonNull",
- new byte[][] {
- // markAsComparedEqualToNonNull INITIALIZER START
- {0x00,0x3C},
- {0x04,0x2C},
- {0x08,0x2C},
- {0x0C,0x2C},
- {0x10,0x3C},
- {0x14,0x2C},
- {0x18,0x2C},
- {0x24,0x28},
- {0x28,0x28},
- {0x2C,0x2C},
- {0x30,0x3C},
- {0x34,0x3C},
- {0x38,0x3C},
- {0x3C,0x3C},
- // markAsComparedEqualToNonNull INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input,
- TestLocalVariableBinding local) {
- UnconditionalFlowInfo result = (UnconditionalFlowInfo)input.copy();
- result.markAsComparedEqualToNonNull(local);
- return result;
- }
- },
- markAsComparedEqualToNull =
- // markAsComparedEqualToNull DEFINITION START
- // start => prot. null
- // prot. non null => prot. null
- // prot. null => prot. null
- // pot. unknown => pot. n & prot. n
- // pot. non null => prot. null
- // pot. nn & prot. nn => prot. null
- // pot. nn & pot. un => pot. n & prot. n
- // pot. null => pot. n & prot. n
- // pot. n & prot. n => pot. n & prot. n
- // pot. n & pot. un => pot. n & prot. n
- // pot. n & pot. nn => pot. n & prot. n
- // def. unknown => def. null
- // def. non null => prot. null
- // def. null => def. null
- // markAsComparedEqualToNull DEFINITION END
- new TwoDimensionalTransformation("markAsComparedEqualToNull",
- new byte[][] {
- // markAsComparedEqualToNull INITIALIZER START
- {0x00,0x38},
- {0x04,0x34},
- {0x08,0x38},
- {0x0C,0x34},
- {0x10,0x34},
- {0x14,0x34},
- {0x18,0x34},
- {0x24,0x30},
- {0x28,0x38},
- {0x2C,0x38},
- {0x30,0x30},
- {0x34,0x34},
- {0x38,0x38},
- {0x3C,0x38},
- // markAsComparedEqualToNull INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input,
- TestLocalVariableBinding local) {
- UnconditionalFlowInfo result = (UnconditionalFlowInfo)input.copy();
- result.markAsComparedEqualToNull(local);
- return result;
- }
- },
- markAsDefinitelyNonNull =
- // markAsDefinitelyNonNull DEFINITION START
- // start => def. non null
- // prot. non null => def. non null
- // prot. null => def. non null
- // pot. unknown => def. non null
- // pot. non null => def. non null
- // pot. nn & prot. nn => def. non null
- // pot. nn & pot. un => def. non null
- // pot. null => def. non null
- // pot. n & prot. n => def. non null
- // pot. n & pot. un => def. non null
- // pot. n & pot. nn => def. non null
- // def. unknown => def. non null
- // def. non null => def. non null
- // def. null => def. non null
- // markAsDefinitelyNonNull DEFINITION END
- new TwoDimensionalTransformation("markAsDefinitelyNonNull",
- new byte[][] {
- // markAsDefinitelyNonNull INITIALIZER START
- {0x00,0x28},
- {0x04,0x28},
- {0x08,0x28},
- {0x0C,0x28},
- {0x10,0x28},
- {0x14,0x28},
- {0x18,0x28},
- {0x24,0x28},
- {0x28,0x28},
- {0x2C,0x28},
- {0x30,0x28},
- {0x34,0x28},
- {0x38,0x28},
- {0x3C,0x28},
- // markAsDefinitelyNonNull INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input,
- TestLocalVariableBinding local) {
- UnconditionalFlowInfo result = (UnconditionalFlowInfo)input.copy();
- result.markAsDefinitelyNonNull(local);
- return result;
- }
- },
- markAsDefinitelyNull =
- // markAsDefinitelyNull DEFINITION START
- // start => def. null
- // prot. non null => def. null
- // prot. null => def. null
- // pot. unknown => def. null
- // pot. non null => def. null
- // pot. nn & prot. nn => def. null
- // pot. nn & pot. un => def. null
- // pot. null => def. null
- // pot. n & prot. n => def. null
- // pot. n & pot. un => def. null
- // pot. n & pot. nn => def. null
- // def. unknown => def. null
- // def. non null => def. null
- // def. null => def. null
- // markAsDefinitelyNull DEFINITION END
- // PREMATURE add 'catch rules'
- new TwoDimensionalTransformation("markAsDefinitelyNull",
- new byte[][] {
- // markAsDefinitelyNull INITIALIZER START
- {0x00,0x30},
- {0x04,0x30},
- {0x08,0x30},
- {0x0C,0x30},
- {0x10,0x30},
- {0x14,0x30},
- {0x18,0x30},
- {0x24,0x30},
- {0x28,0x30},
- {0x2C,0x30},
- {0x30,0x30},
- {0x34,0x30},
- {0x38,0x30},
- {0x3C,0x30},
- // markAsDefinitelyNull INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input,
- TestLocalVariableBinding local) {
- UnconditionalFlowInfo result = (UnconditionalFlowInfo)input.copy();
- result.markAsDefinitelyNull(local);
- return result;
- }
- },
- markAsDefinitelyUnknown =
- // markAsDefinitelyUnknown DEFINITION START
- // start => def. unknown
- // prot. non null => def. unknown
- // prot. null => def. unknown
- // pot. unknown => def. unknown
- // pot. non null => def. unknown
- // pot. nn & prot. nn => def. unknown
- // pot. nn & pot. un => def. unknown
- // pot. null => def. unknown
- // pot. n & prot. n => def. unknown
- // pot. n & pot. un => def. unknown
- // pot. n & pot. nn => def. unknown
- // def. unknown => def. unknown
- // def. non null => def. unknown
- // def. null => def. unknown
- // markAsDefinitelyUnknown DEFINITION END
- new TwoDimensionalTransformation("markAsDefinitelyUnknown",
- new byte[][] {
- // markAsDefinitelyUnknown INITIALIZER START
- {0x00,0x24},
- {0x04,0x24},
- {0x08,0x24},
- {0x0C,0x24},
- {0x10,0x24},
- {0x14,0x24},
- {0x18,0x24},
- {0x24,0x24},
- {0x28,0x24},
- {0x2C,0x24},
- {0x30,0x24},
- {0x34,0x24},
- {0x38,0x24},
- {0x3C,0x24},
- // markAsDefinitelyUnknown INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input,
- TestLocalVariableBinding local) {
- UnconditionalFlowInfo result = (UnconditionalFlowInfo)input.copy();
- result.markAsDefinitelyUnknown(local);
- return result;
- }
- },
- addInitializationsFrom =
- // addInitializationsFrom DEFINITION START
- // def. non null + def. non null => def. non null
- // def. non null + def. null => def. null
- // def. non null + def. unknown => def. unknown
- // def. non null + pot. n & pot. nn => pot. n & pot. nn
- // def. non null + pot. n & pot. un => pot. n & pot. nn
- // def. non null + pot. n & prot. n => pot. n & prot. n
- // def. non null + pot. nn & pot. un => def. unknown
- // def. non null + pot. nn & prot. nn => def. non null
- // def. non null + pot. non null => def. non null
- // def. non null + pot. null => pot. n & pot. nn
- // def. non null + pot. unknown => def. unknown // priv.
- // def. non null + prot. non null => def. non null
- // def. non null + prot. null => prot. null
- // def. non null + start => def. non null
- // def. null + def. non null => def. non null
- // def. null + def. null => def. null
- // def. null + def. unknown => def. unknown
- // def. null + pot. n & pot. nn => pot. n & pot. nn
- // def. null + pot. n & pot. un => pot. n & pot. un
- // def. null + pot. n & prot. n => def. null
- // def. null + pot. nn & pot. un => pot. n & pot. nn
- // def. null + pot. nn & prot. nn => pot. nn & prot. nn
- // def. null + pot. non null => pot. n & pot. nn
- // def. null + pot. null => def. null
- // def. null + pot. unknown => pot. n & pot. un // pot. null privileged over def. unknown
- // def. null + prot. non null => prot. non null
- // def. null + prot. null => def. null
- // def. null + start => def. null
- // def. unknown + def. non null => def. non null
- // def. unknown + def. null => def. null
- // def. unknown + def. unknown => def. unknown
- // def. unknown + pot. n & pot. nn => pot. n & pot. nn
- // def. unknown + pot. n & pot. un => pot. n & pot. un // we loose the def here, but we need the pot. null
- // def. unknown + pot. n & prot. n => def. null
- // def. unknown + pot. nn & pot. un => def. unknown // priv.
- // def. unknown + pot. nn & prot. nn => def. non null
- // def. unknown + pot. non null => def. unknown // privileging over pot. nn & pot. un
- // def. unknown + pot. null => pot. n & pot. un
- // def. unknown + pot. unknown => def. unknown
- // def. unknown + prot. non null => def. non null
- // def. unknown + prot. null => def. null
- // def. unknown + start => def. unknown
- // pot. n & pot. nn + def. non null => def. non null
- // pot. n & pot. nn + def. null => def. null
- // pot. n & pot. nn + def. unknown => def. unknown
- // pot. n & pot. nn + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & pot. nn + pot. n & pot. un => pot. n & pot. nn
- // pot. n & pot. nn + pot. n & prot. n => pot. n & prot. n
- // pot. n & pot. nn + pot. nn & pot. un => pot. n & pot. nn
- // pot. n & pot. nn + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. n & pot. nn + pot. non null => pot. n & pot. nn
- // pot. n & pot. nn + pot. null => pot. n & pot. nn
- // pot. n & pot. nn + pot. unknown => pot. n & pot. nn
- // pot. n & pot. nn + prot. non null => pot. nn & prot. nn
- // pot. n & pot. nn + prot. null => pot. n & prot. n
- // pot. n & pot. nn + start => pot. n & pot. nn
- // pot. n & pot. un + def. non null => def. non null
- // pot. n & pot. un + def. null => def. null
- // pot. n & pot. un + def. unknown => def. unknown
- // pot. n & pot. un + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & pot. un + pot. n & pot. un => pot. n & pot. un
- // pot. n & pot. un + pot. n & prot. n => pot. n & prot. n
- // pot. n & pot. un + pot. nn & pot. un => pot. n & pot. nn
- // pot. n & pot. un + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. n & pot. un + pot. non null => pot. n & pot. nn
- // pot. n & pot. un + pot. null => pot. n & pot. un
- // pot. n & pot. un + pot. unknown => pot. n & pot. un
- // pot. n & pot. un + prot. non null => pot. nn & prot. nn
- // pot. n & pot. un + prot. null => pot. n & prot. n
- // pot. n & pot. un + start => pot. n & pot. un
- // pot. n & prot. n + def. non null => def. non null
- // pot. n & prot. n + def. null => def. null
- // pot. n & prot. n + def. unknown => def. unknown
- // pot. n & prot. n + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & prot. n + pot. n & pot. un => pot. n & pot. un
- // pot. n & prot. n + pot. n & prot. n => pot. n & prot. n
- // pot. n & prot. n + pot. nn & pot. un => pot. n & pot. nn
- // pot. n & prot. n + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. n & prot. n + pot. non null => pot. n & pot. nn
- // pot. n & prot. n + pot. null => pot. n & prot. n
- // pot. n & prot. n + pot. unknown => pot. n & pot. un
- // pot. n & prot. n + prot. non null => prot. non null
- // pot. n & prot. n + prot. null => pot. n & prot. n
- // pot. n & prot. n + start => pot. n & prot. n
- // pot. nn & pot. un + def. non null => def. non null
- // pot. nn & pot. un + def. null => def. null
- // pot. nn & pot. un + def. unknown => def. unknown
- // pot. nn & pot. un + pot. n & pot. nn => pot. n & pot. nn
- // pot. nn & pot. un + pot. n & pot. un => pot. n & pot. nn
- // pot. nn & pot. un + pot. n & prot. n => pot. n & prot. n
- // pot. nn & pot. un + pot. nn & pot. un => pot. nn & pot. un
- // pot. nn & pot. un + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. nn & pot. un + pot. non null => pot. nn & pot. un
- // pot. nn & pot. un + pot. null => pot. n & pot. nn
- // pot. nn & pot. un + pot. unknown => pot. nn & pot. un
- // pot. nn & pot. un + prot. non null => pot. nn & prot. nn
- // pot. nn & pot. un + prot. null => pot. n & prot. n
- // pot. nn & pot. un + start => pot. nn & pot. un
- // pot. nn & prot. nn + def. non null => def. non null
- // pot. nn & prot. nn + def. null => def. null
- // pot. nn & prot. nn + def. unknown => def. unknown
- // pot. nn & prot. nn + pot. n & pot. nn => pot. n & pot. nn
- // pot. nn & prot. nn + pot. n & pot. un => pot. n & pot. nn
- // pot. nn & prot. nn + pot. n & prot. n => pot. n & prot. n
- // pot. nn & prot. nn + pot. nn & pot. un => pot. nn & pot. un
- // pot. nn & prot. nn + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. nn & prot. nn + pot. non null => pot. nn & prot. nn
- // pot. nn & prot. nn + pot. null => pot. n & pot. nn
- // pot. nn & prot. nn + pot. unknown => pot. nn & pot. un
- // pot. nn & prot. nn + prot. non null => pot. nn & prot. nn
- // pot. nn & prot. nn + prot. null => prot. null
- // pot. nn & prot. nn + start => pot. nn & prot. nn
- // pot. non null + def. non null => def. non null
- // pot. non null + def. null => def. null
- // pot. non null + def. unknown => def. unknown
- // pot. non null + pot. n & pot. nn => pot. n & pot. nn
- // pot. non null + pot. n & pot. un => pot. n & pot. nn
- // pot. non null + pot. n & prot. n => pot. n & prot. n
- // pot. non null + pot. nn & pot. un => pot. nn & pot. un
- // pot. non null + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. non null + pot. non null => pot. non null
- // pot. non null + pot. null => pot. n & pot. nn
- // pot. non null + pot. unknown => pot. nn & pot. un
- // pot. non null + prot. non null => pot. nn & prot. nn
- // pot. non null + prot. null => prot. null
- // pot. non null + start => pot. non null
- // pot. null + def. non null => def. non null
- // pot. null + def. null => def. null
- // pot. null + def. unknown => def. unknown
- // pot. null + pot. n & pot. nn => pot. n & pot. nn
- // pot. null + pot. n & pot. un => pot. n & pot. un
- // pot. null + pot. n & prot. n => pot. n & prot. n
- // pot. null + pot. nn & pot. un => pot. n & pot. nn
- // pot. null + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. null + pot. non null => pot. n & pot. nn
- // pot. null + pot. null => pot. null
- // pot. null + pot. unknown => pot. n & pot. un
- // pot. null + prot. non null => prot. non null
- // pot. null + prot. null => pot. n & prot. n
- // pot. null + start => pot. null
- // pot. unknown + def. non null => def. non null
- // pot. unknown + def. null => def. null
- // pot. unknown + def. unknown => def. unknown
- // pot. unknown + pot. n & pot. nn => pot. n & pot. nn
- // pot. unknown + pot. n & pot. un => pot. n & pot. un
- // pot. unknown + pot. n & prot. n => pot. n & prot. n
- // pot. unknown + pot. nn & pot. un => pot. nn & pot. un
- // pot. unknown + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. unknown + pot. non null => pot. nn & pot. un
- // pot. unknown + pot. null => pot. n & pot. un
- // pot. unknown + pot. unknown => pot. unknown
- // pot. unknown + prot. non null => pot. nn & prot. nn
- // pot. unknown + prot. null => pot. n & prot. n
- // pot. unknown + start => pot. unknown
- // prot. non null + def. non null => def. non null
- // prot. non null + def. null => def. null
- // prot. non null + def. unknown => def. unknown
- // prot. non null + pot. n & pot. nn => pot. n & pot. nn
- // prot. non null + pot. n & pot. un => pot. n & pot. un
- // prot. non null + pot. n & prot. n => pot. n & prot. n
- // prot. non null + pot. nn & pot. un => pot. nn & pot. un
- // prot. non null + pot. nn & prot. nn => pot. nn & prot. nn
- // prot. non null + pot. non null => pot. nn & prot. nn
- // prot. non null + pot. null => pot. null
- // prot. non null + pot. unknown => pot. unknown
- // prot. non null + prot. non null => prot. non null
- // prot. non null + prot. null => prot. null
- // prot. non null + start => prot. non null
- // prot. null + def. non null => def. non null
- // prot. null + def. null => def. null
- // prot. null + def. unknown => def. unknown
- // prot. null + pot. n & pot. nn => pot. n & pot. nn
- // prot. null + pot. n & pot. un => pot. n & pot. un
- // prot. null + pot. n & prot. n => pot. n & prot. n
- // prot. null + pot. nn & pot. un => pot. nn & pot. un
- // prot. null + pot. nn & prot. nn => pot. nn & prot. nn
- // prot. null + pot. non null => pot. non null
- // prot. null + pot. null => pot. n & prot. n
- // prot. null + pot. unknown => pot. unknown
- // prot. null + prot. non null => prot. non null
- // prot. null + prot. null => prot. null
- // prot. null + start => prot. null
- // start + def. non null => def. non null
- // start + def. null => def. null
- // start + def. unknown => def. unknown
- // start + pot. n & pot. nn => pot. n & pot. nn
- // start + pot. n & pot. un => pot. n & pot. un
- // start + pot. n & prot. n => pot. n & prot. n
- // start + pot. nn & pot. un => pot. nn & pot. un
- // start + pot. nn & prot. nn => pot. nn & prot. nn
- // start + pot. non null => pot. non null
- // start + pot. null => pot. null
- // start + pot. unknown => pot. unknown
- // start + prot. non null => prot. non null
- // start + prot. null => prot. null
- // start + start => start
- // addInitializationsFrom DEFINITION END
- new ThreeDimensionalTransformation("addInitializationsFrom",
- new byte[][] {
- // addInitializationsFrom INITIALIZER START
- {0x00,0x00,0x00},
- {0x00,0x04,0x04},
- {0x00,0x08,0x08},
- {0x00,0x0C,0x0C},
- {0x00,0x10,0x10},
- {0x00,0x14,0x14},
- {0x00,0x18,0x18},
- {0x00,0x24,0x24},
- {0x00,0x28,0x28},
- {0x00,0x2C,0x2C},
- {0x00,0x30,0x30},
- {0x00,0x34,0x34},
- {0x00,0x38,0x38},
- {0x00,0x3C,0x3C},
- {0x04,0x00,0x04},
- {0x04,0x04,0x04},
- {0x04,0x08,0x0C},
- {0x04,0x0C,0x0C},
- {0x04,0x10,0x14},
- {0x04,0x14,0x14},
- {0x04,0x18,0x18},
- {0x04,0x24,0x24},
- {0x04,0x28,0x28},
- {0x04,0x2C,0x2C},
- {0x04,0x30,0x30},
- {0x04,0x34,0x34},
- {0x04,0x38,0x34},
- {0x04,0x3C,0x2C},
- {0x08,0x00,0x08},
- {0x08,0x04,0x0C},
- {0x08,0x08,0x08},
- {0x08,0x0C,0x0C},
- {0x08,0x10,0x18},
- {0x08,0x14,0x18},
- {0x08,0x18,0x18},
- {0x08,0x24,0x24},
- {0x08,0x28,0x28},
- {0x08,0x2C,0x2C},
- {0x08,0x30,0x30},
- {0x08,0x34,0x34},
- {0x08,0x38,0x38},
- {0x08,0x3C,0x2C},
- {0x0C,0x00,0x0C},
- {0x0C,0x04,0x0C},
- {0x0C,0x08,0x0C},
- {0x0C,0x0C,0x0C},
- {0x0C,0x10,0x18},
- {0x0C,0x14,0x18},
- {0x0C,0x18,0x18},
- {0x0C,0x24,0x24},
- {0x0C,0x28,0x28},
- {0x0C,0x2C,0x2C},
- {0x0C,0x30,0x30},
- {0x0C,0x34,0x34},
- {0x0C,0x38,0x34},
- {0x0C,0x3C,0x2C},
- {0x10,0x00,0x10},
- {0x10,0x04,0x14},
- {0x10,0x08,0x18},
- {0x10,0x0C,0x18},
- {0x10,0x10,0x10},
- {0x10,0x14,0x14},
- {0x10,0x18,0x18},
- {0x10,0x24,0x24},
- {0x10,0x28,0x28},
- {0x10,0x2C,0x2C},
- {0x10,0x30,0x30},
- {0x10,0x34,0x34},
- {0x10,0x38,0x34},
- {0x10,0x3C,0x3C},
- {0x14,0x00,0x14},
- {0x14,0x04,0x14},
- {0x14,0x08,0x18},
- {0x14,0x0C,0x18},
- {0x14,0x10,0x14},
- {0x14,0x14,0x14},
- {0x14,0x18,0x18},
- {0x14,0x24,0x24},
- {0x14,0x28,0x28},
- {0x14,0x2C,0x2C},
- {0x14,0x30,0x30},
- {0x14,0x34,0x34},
- {0x14,0x38,0x34},
- {0x14,0x3C,0x2C},
- {0x18,0x00,0x18},
- {0x18,0x04,0x18},
- {0x18,0x08,0x18},
- {0x18,0x0C,0x18},
- {0x18,0x10,0x18},
- {0x18,0x14,0x18},
- {0x18,0x18,0x18},
- {0x18,0x24,0x24},
- {0x18,0x28,0x28},
- {0x18,0x2C,0x2C},
- {0x18,0x30,0x30},
- {0x18,0x34,0x34},
- {0x18,0x38,0x34},
- {0x18,0x3C,0x2C},
- {0x24,0x00,0x24},
- {0x24,0x04,0x24},
- {0x24,0x08,0x24},
- {0x24,0x0C,0x24},
- {0x24,0x10,0x14},
- {0x24,0x14,0x14},
- {0x24,0x18,0x18},
- {0x24,0x24,0x24},
- {0x24,0x28,0x28},
- {0x24,0x2C,0x28},
- {0x24,0x30,0x30},
- {0x24,0x34,0x30},
- {0x24,0x38,0x30},
- {0x24,0x3C,0x28},
- {0x28,0x00,0x28},
- {0x28,0x04,0x24},
- {0x28,0x08,0x28},
- {0x28,0x0C,0x24},
- {0x28,0x10,0x18},
- {0x28,0x14,0x18},
- {0x28,0x18,0x18},
- {0x28,0x24,0x24},
- {0x28,0x28,0x28},
- {0x28,0x2C,0x28},
- {0x28,0x30,0x30},
- {0x28,0x34,0x34},
- {0x28,0x38,0x38},
- {0x28,0x3C,0x28},
- {0x2C,0x00,0x2C},
- {0x2C,0x04,0x0C},
- {0x2C,0x08,0x2C},
- {0x2C,0x0C,0x0C},
- {0x2C,0x10,0x18},
- {0x2C,0x14,0x18},
- {0x2C,0x18,0x18},
- {0x2C,0x24,0x24},
- {0x2C,0x28,0x28},
- {0x2C,0x2C,0x2C},
- {0x2C,0x30,0x30},
- {0x2C,0x34,0x34},
- {0x2C,0x38,0x38},
- {0x2C,0x3C,0x2C},
- {0x30,0x00,0x30},
- {0x30,0x04,0x14},
- {0x30,0x08,0x18},
- {0x30,0x0C,0x18},
- {0x30,0x10,0x30},
- {0x30,0x14,0x14},
- {0x30,0x18,0x18},
- {0x30,0x24,0x24},
- {0x30,0x28,0x28},
- {0x30,0x2C,0x2C},
- {0x30,0x30,0x30},
- {0x30,0x34,0x30},
- {0x30,0x38,0x30},
- {0x30,0x3C,0x3C},
- {0x34,0x00,0x34},
- {0x34,0x04,0x14},
- {0x34,0x08,0x18},
- {0x34,0x0C,0x18},
- {0x34,0x10,0x34},
- {0x34,0x14,0x14},
- {0x34,0x18,0x18},
- {0x34,0x24,0x24},
- {0x34,0x28,0x28},
- {0x34,0x2C,0x2C},
- {0x34,0x30,0x30},
- {0x34,0x34,0x34},
- {0x34,0x38,0x34},
- {0x34,0x3C,0x3C},
- {0x38,0x00,0x38},
- {0x38,0x04,0x04},
- {0x38,0x08,0x08},
- {0x38,0x0C,0x0C},
- {0x38,0x10,0x34},
- {0x38,0x14,0x14},
- {0x38,0x18,0x18},
- {0x38,0x24,0x24},
- {0x38,0x28,0x28},
- {0x38,0x2C,0x2C},
- {0x38,0x30,0x30},
- {0x38,0x34,0x34},
- {0x38,0x38,0x38},
- {0x38,0x3C,0x3C},
- {0x3C,0x00,0x3C},
- {0x3C,0x04,0x04},
- {0x3C,0x08,0x2C},
- {0x3C,0x0C,0x0C},
- {0x3C,0x10,0x10},
- {0x3C,0x14,0x14},
- {0x3C,0x18,0x18},
- {0x3C,0x24,0x24},
- {0x3C,0x28,0x28},
- {0x3C,0x2C,0x2C},
- {0x3C,0x30,0x30},
- {0x3C,0x34,0x34},
- {0x3C,0x38,0x38},
- {0x3C,0x3C,0x3C},
- // addInitializationsFrom INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input1,
- UnconditionalFlowInfo input2) {
- return (UnconditionalFlowInfo)
- input1.copy().addInitializationsFrom(input2);
- }
- },
- // addPotentialInitializationsFrom DEFINITION START
- // def. non null + def. non null => def. non null
- // def. non null + def. null => pot. n & pot. nn
- // def. non null + def. unknown => def. unknown
- // def. non null + pot. n & pot. nn => pot. n & pot. nn
- // def. non null + pot. n & pot. un => pot. n & pot. nn
- // def. non null + pot. n & prot. n => pot. n & pot. nn
- // def. non null + pot. nn & pot. un => def. unknown
- // def. non null + pot. nn & prot. nn => def. non null
- // def. non null + pot. non null => def. non null
- // def. non null + pot. null => pot. n & pot. nn
- // def. non null + pot. unknown => def. unknown
- // def. non null + prot. non null => def. non null
- // def. non null + prot. null => def. non null
- // def. non null + start => def. non null
- // def. null + def. non null => pot. n & pot. nn
- // def. null + def. null => def. null
- // def. null + def. unknown => pot. n & pot. un
- // def. null + pot. n & pot. nn => pot. n & pot. nn
- // def. null + pot. n & pot. un => pot. n & pot. un
- // def. null + pot. n & prot. n => def. null
- // def. null + pot. nn & pot. un => pot. n & pot. nn
- // def. null + pot. nn & prot. nn => pot. n & pot. nn
- // def. null + pot. non null => pot. n & pot. nn
- // def. null + pot. null => def. null
- // def. null + pot. unknown => pot. n & pot. un
- // def. null + prot. non null => def. null
- // def. null + prot. null => def. null
- // def. null + start => def. null
- // def. unknown + def. non null => def. unknown
- // def. unknown + def. null => pot. n & pot. un
- // def. unknown + def. unknown => def. unknown
- // def. unknown + pot. n & pot. nn => pot. n & pot. nn
- // def. unknown + pot. n & pot. un => pot. n & pot. un
- // def. unknown + pot. n & prot. n => pot. n & pot. un
- // def. unknown + pot. nn & pot. un => def. unknown
- // def. unknown + pot. nn & prot. nn => def. unknown
- // def. unknown + pot. non null => def. unknown
- // def. unknown + pot. null => pot. n & pot. un
- // def. unknown + pot. unknown => def. unknown
- // def. unknown + prot. non null => def. unknown
- // def. unknown + prot. null => def. unknown
- // def. unknown + start => def. unknown
- // pot. n & pot. nn + def. non null => pot. n & pot. nn
- // pot. n & pot. nn + def. null => pot. n & pot. nn
- // pot. n & pot. nn + def. unknown => pot. n & pot. nn
- // pot. n & pot. nn + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & pot. nn + pot. n & pot. un => pot. n & pot. nn
- // pot. n & pot. nn + pot. n & prot. n => pot. n & pot. nn
- // pot. n & pot. nn + pot. nn & pot. un => pot. n & pot. nn
- // pot. n & pot. nn + pot. nn & prot. nn => pot. n & pot. nn
- // pot. n & pot. nn + pot. non null => pot. n & pot. nn
- // pot. n & pot. nn + pot. null => pot. n & pot. nn
- // pot. n & pot. nn + pot. unknown => pot. n & pot. nn
- // pot. n & pot. nn + prot. non null => pot. n & pot. nn
- // pot. n & pot. nn + prot. null => pot. n & pot. nn
- // pot. n & pot. nn + start => pot. n & pot. nn
- // pot. n & pot. un + def. non null => pot. n & pot. nn
- // pot. n & pot. un + def. null => pot. n & pot. un
- // pot. n & pot. un + def. unknown => pot. n & pot. un
- // pot. n & pot. un + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & pot. un + pot. n & pot. un => pot. n & pot. un
- // pot. n & pot. un + pot. n & prot. n => pot. n & pot. un
- // pot. n & pot. un + pot. nn & pot. un => pot. n & pot. nn
- // pot. n & pot. un + pot. nn & prot. nn => pot. n & pot. nn
- // pot. n & pot. un + pot. non null => pot. n & pot. nn
- // pot. n & pot. un + pot. null => pot. n & pot. un
- // pot. n & pot. un + pot. unknown => pot. n & pot. un
- // pot. n & pot. un + prot. non null => pot. n & pot. un
- // pot. n & pot. un + prot. null => pot. n & pot. un
- // pot. n & pot. un + start => pot. n & pot. un
- // pot. n & prot. n + def. non null => pot. n & pot. nn
- // pot. n & prot. n + def. null => pot. n & prot. n
- // pot. n & prot. n + def. unknown => pot. n & pot. un
- // pot. n & prot. n + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & prot. n + pot. n & pot. un => pot. n & pot. un
- // pot. n & prot. n + pot. n & prot. n => pot. n & prot. n
- // pot. n & prot. n + pot. nn & pot. un => pot. n & pot. nn
- // pot. n & prot. n + pot. nn & prot. nn => pot. n & pot. nn
- // pot. n & prot. n + pot. non null => pot. n & pot. nn
- // pot. n & prot. n + pot. null => pot. n & prot. n
- // pot. n & prot. n + pot. unknown => pot. n & pot. un
- // pot. n & prot. n + prot. non null => pot. n & prot. n
- // pot. n & prot. n + prot. null => pot. n & prot. n
- // pot. n & prot. n + start => pot. n & prot. n
- // pot. nn & pot. un + def. non null => pot. nn & pot. un
- // pot. nn & pot. un + def. null => pot. n & pot. nn
- // pot. nn & pot. un + def. unknown => pot. nn & pot. un
- // pot. nn & pot. un + pot. n & pot. nn => pot. n & pot. nn
- // pot. nn & pot. un + pot. n & pot. un => pot. n & pot. nn
- // pot. nn & pot. un + pot. n & prot. n => pot. n & pot. nn
- // pot. nn & pot. un + pot. nn & pot. un => pot. nn & pot. un
- // pot. nn & pot. un + pot. nn & prot. nn => pot. nn & pot. un
- // pot. nn & pot. un + pot. non null => pot. nn & pot. un
- // pot. nn & pot. un + pot. null => pot. n & pot. nn
- // pot. nn & pot. un + pot. unknown => pot. nn & pot. un
- // pot. nn & pot. un + prot. non null => pot. nn & pot. un
- // pot. nn & pot. un + prot. null => pot. nn & pot. un
- // pot. nn & pot. un + start => pot. nn & pot. un
- // pot. nn & prot. nn + def. non null => pot. nn & prot. nn
- // pot. nn & prot. nn + def. null => pot. n & pot. nn
- // pot. nn & prot. nn + def. unknown => pot. nn & pot. un
- // pot. nn & prot. nn + pot. n & pot. nn => pot. n & pot. nn
- // pot. nn & prot. nn + pot. n & pot. un => pot. n & pot. nn
- // pot. nn & prot. nn + pot. n & prot. n => pot. n & pot. nn
- // pot. nn & prot. nn + pot. nn & pot. un => pot. nn & pot. un // see test1501
- // pot. nn & prot. nn + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. nn & prot. nn + pot. non null => pot. nn & prot. nn
- // pot. nn & prot. nn + pot. null => pot. n & pot. nn
- // pot. nn & prot. nn + pot. unknown => pot. nn & pot. un
- // pot. nn & prot. nn + prot. non null => pot. nn & prot. nn
- // pot. nn & prot. nn + prot. null => pot. nn & prot. nn
- // pot. nn & prot. nn + start => pot. nn & prot. nn
- // pot. non null + def. non null => pot. non null
- // pot. non null + def. null => pot. n & pot. nn
- // pot. non null + def. unknown => pot. nn & pot. un
- // pot. non null + pot. n & pot. nn => pot. n & pot. nn
- // pot. non null + pot. n & pot. un => pot. n & pot. nn
- // pot. non null + pot. n & prot. n => pot. n & pot. nn
- // pot. non null + pot. nn & pot. un => pot. nn & pot. un
- // pot. non null + pot. nn & prot. nn => pot. non null
- // pot. non null + pot. non null => pot. non null
- // pot. non null + pot. null => pot. n & pot. nn
- // pot. non null + pot. unknown => pot. nn & pot. un
- // pot. non null + prot. non null => pot. non null
- // pot. non null + prot. null => pot. non null
- // pot. non null + start => pot. non null
- // pot. null + def. non null => pot. n & pot. nn
- // pot. null + def. null => pot. null
- // pot. null + def. unknown => pot. n & pot. un
- // pot. null + pot. n & pot. nn => pot. n & pot. nn
- // pot. null + pot. n & pot. un => pot. n & pot. un
- // pot. null + pot. n & prot. n => pot. null
- // pot. null + pot. nn & pot. un => pot. n & pot. nn
- // pot. null + pot. nn & prot. nn => pot. n & pot. nn
- // pot. null + pot. non null => pot. n & pot. nn
- // pot. null + pot. null => pot. null
- // pot. null + pot. unknown => pot. n & pot. un
- // pot. null + prot. non null => pot. null
- // pot. null + prot. null => pot. null
- // pot. null + start => pot. null
- // pot. unknown + def. non null => pot. nn & pot. un
- // pot. unknown + def. null => pot. n & pot. un
- // pot. unknown + def. unknown => pot. unknown
- // pot. unknown + pot. n & pot. nn => pot. n & pot. nn
- // pot. unknown + pot. n & pot. un => pot. n & pot. un
- // pot. unknown + pot. n & prot. n => pot. n & pot. un
- // pot. unknown + pot. nn & pot. un => pot. nn & pot. un
- // pot. unknown + pot. nn & prot. nn => pot. nn & pot. un
- // pot. unknown + pot. non null => pot. nn & pot. un
- // pot. unknown + pot. null => pot. n & pot. un
- // pot. unknown + pot. unknown => pot. unknown
- // pot. unknown + prot. non null => pot. unknown
- // pot. unknown + prot. null => pot. unknown
- // pot. unknown + start => pot. unknown
- // prot. non null + def. non null => pot. nn & prot. nn
- // prot. non null + def. null => pot. null
- // prot. non null + def. unknown => pot. unknown
- // prot. non null + pot. n & pot. nn => pot. n & pot. nn
- // prot. non null + pot. n & pot. un => pot. n & pot. un
- // prot. non null + pot. n & prot. n => pot. null
- // prot. non null + pot. nn & pot. un => pot. nn & pot. un // see test1500
- // prot. non null + pot. nn & prot. nn => pot. nn & prot. nn
- // prot. non null + pot. non null => pot. nn & prot. nn
- // prot. non null + pot. null => pot. null
- // prot. non null + pot. unknown => pot. unknown
- // prot. non null + prot. non null => prot. non null
- // prot. non null + prot. null => prot. non null
- // prot. non null + start => prot. non null
- // prot. null + def. non null => pot. non null
- // prot. null + def. null => pot. n & prot. n
- // prot. null + def. unknown => pot. unknown
- // prot. null + pot. n & pot. nn => pot. n & pot. nn
- // prot. null + pot. n & pot. un => pot. n & pot. un
- // prot. null + pot. n & prot. n => pot. n & prot. n
- // prot. null + pot. nn & pot. un => pot. nn & pot. un
- // prot. null + pot. nn & prot. nn => pot. non null
- // prot. null + pot. non null => pot. non null
- // prot. null + pot. null => pot. n & prot. n
- // prot. null + pot. unknown => pot. unknown
- // prot. null + prot. non null => prot. null
- // prot. null + prot. null => prot. null
- // prot. null + start => prot. null
- // start + def. non null => pot. non null
- // start + def. null => pot. null
- // start + def. unknown => pot. unknown
- // start + pot. n & pot. nn => pot. n & pot. nn
- // start + pot. n & pot. un => pot. n & pot. un
- // start + pot. n & prot. n => pot. null
- // start + pot. nn & pot. un => pot. nn & pot. un
- // start + pot. nn & prot. nn => pot. non null
- // start + pot. non null => pot. non null
- // start + pot. null => pot. null
- // start + pot. unknown => pot. unknown
- // start + prot. non null => start // PREMATURE may need to be tainted?
- // start + prot. null => start // PREMATURE may need to be tainted?
- // start + start => start
- // addPotentialInitializationsFrom DEFINITION END
- addPotentialInitializationsFrom =
- new ThreeDimensionalTransformation("addPotentialInitializationsFrom",
- new byte[][] {
- // addPotentialInitializationsFrom INITIALIZER START
- {0x00,0x00,0x00},
- {0x00,0x04,0x04},
- {0x00,0x08,0x08},
- {0x00,0x0C,0x0C},
- {0x00,0x10,0x10},
- {0x00,0x14,0x14},
- {0x00,0x18,0x18},
- {0x00,0x24,0x04},
- {0x00,0x28,0x08},
- {0x00,0x2C,0x08},
- {0x00,0x30,0x10},
- {0x00,0x34,0x10},
- {0x00,0x38,0x00},
- {0x00,0x3C,0x00},
- {0x04,0x00,0x04},
- {0x04,0x04,0x04},
- {0x04,0x08,0x0C},
- {0x04,0x0C,0x0C},
- {0x04,0x10,0x14},
- {0x04,0x14,0x14},
- {0x04,0x18,0x18},
- {0x04,0x24,0x04},
- {0x04,0x28,0x0C},
- {0x04,0x2C,0x0C},
- {0x04,0x30,0x14},
- {0x04,0x34,0x14},
- {0x04,0x38,0x04},
- {0x04,0x3C,0x04},
- {0x08,0x00,0x08},
- {0x08,0x04,0x0C},
- {0x08,0x08,0x08},
- {0x08,0x0C,0x0C},
- {0x08,0x10,0x18},
- {0x08,0x14,0x18},
- {0x08,0x18,0x18},
- {0x08,0x24,0x0C},
- {0x08,0x28,0x08},
- {0x08,0x2C,0x08},
- {0x08,0x30,0x18},
- {0x08,0x34,0x18},
- {0x08,0x38,0x08},
- {0x08,0x3C,0x08},
- {0x0C,0x00,0x0C},
- {0x0C,0x04,0x0C},
- {0x0C,0x08,0x0C},
- {0x0C,0x0C,0x0C},
- {0x0C,0x10,0x18},
- {0x0C,0x14,0x18},
- {0x0C,0x18,0x18},
- {0x0C,0x24,0x0C},
- {0x0C,0x28,0x0C},
- {0x0C,0x2C,0x0C},
- {0x0C,0x30,0x18},
- {0x0C,0x34,0x18},
- {0x0C,0x38,0x0C},
- {0x0C,0x3C,0x0C},
- {0x10,0x00,0x10},
- {0x10,0x04,0x14},
- {0x10,0x08,0x18},
- {0x10,0x0C,0x18},
- {0x10,0x10,0x10},
- {0x10,0x14,0x14},
- {0x10,0x18,0x18},
- {0x10,0x24,0x14},
- {0x10,0x28,0x18},
- {0x10,0x2C,0x18},
- {0x10,0x30,0x10},
- {0x10,0x34,0x10},
- {0x10,0x38,0x10},
- {0x10,0x3C,0x10},
- {0x14,0x00,0x14},
- {0x14,0x04,0x14},
- {0x14,0x08,0x18},
- {0x14,0x0C,0x18},
- {0x14,0x10,0x14},
- {0x14,0x14,0x14},
- {0x14,0x18,0x18},
- {0x14,0x24,0x14},
- {0x14,0x28,0x18},
- {0x14,0x2C,0x18},
- {0x14,0x30,0x14},
- {0x14,0x34,0x14},
- {0x14,0x38,0x14},
- {0x14,0x3C,0x14},
- {0x18,0x00,0x18},
- {0x18,0x04,0x18},
- {0x18,0x08,0x18},
- {0x18,0x0C,0x18},
- {0x18,0x10,0x18},
- {0x18,0x14,0x18},
- {0x18,0x18,0x18},
- {0x18,0x24,0x18},
- {0x18,0x28,0x18},
- {0x18,0x2C,0x18},
- {0x18,0x30,0x18},
- {0x18,0x34,0x18},
- {0x18,0x38,0x18},
- {0x18,0x3C,0x18},
- {0x24,0x00,0x24},
- {0x24,0x04,0x24},
- {0x24,0x08,0x24},
- {0x24,0x0C,0x24},
- {0x24,0x10,0x14},
- {0x24,0x14,0x14},
- {0x24,0x18,0x18},
- {0x24,0x24,0x24},
- {0x24,0x28,0x24},
- {0x24,0x2C,0x24},
- {0x24,0x30,0x14},
- {0x24,0x34,0x14},
- {0x24,0x38,0x24},
- {0x24,0x3C,0x24},
- {0x28,0x00,0x28},
- {0x28,0x04,0x24},
- {0x28,0x08,0x28},
- {0x28,0x0C,0x24},
- {0x28,0x10,0x18},
- {0x28,0x14,0x18},
- {0x28,0x18,0x18},
- {0x28,0x24,0x24},
- {0x28,0x28,0x28},
- {0x28,0x2C,0x28},
- {0x28,0x30,0x18},
- {0x28,0x34,0x18},
- {0x28,0x38,0x28},
- {0x28,0x3C,0x28},
- {0x2C,0x00,0x2C},
- {0x2C,0x04,0x0C},
- {0x2C,0x08,0x2C},
- {0x2C,0x0C,0x0C},
- {0x2C,0x10,0x18},
- {0x2C,0x14,0x18},
- {0x2C,0x18,0x18},
- {0x2C,0x24,0x0C},
- {0x2C,0x28,0x2C},
- {0x2C,0x2C,0x2C},
- {0x2C,0x30,0x18},
- {0x2C,0x34,0x18},
- {0x2C,0x38,0x2C},
- {0x2C,0x3C,0x2C},
- {0x30,0x00,0x30},
- {0x30,0x04,0x14},
- {0x30,0x08,0x18},
- {0x30,0x0C,0x18},
- {0x30,0x10,0x30},
- {0x30,0x14,0x14},
- {0x30,0x18,0x18},
- {0x30,0x24,0x14},
- {0x30,0x28,0x18},
- {0x30,0x2C,0x18},
- {0x30,0x30,0x30},
- {0x30,0x34,0x30},
- {0x30,0x38,0x30},
- {0x30,0x3C,0x30},
- {0x34,0x00,0x34},
- {0x34,0x04,0x14},
- {0x34,0x08,0x18},
- {0x34,0x0C,0x18},
- {0x34,0x10,0x34},
- {0x34,0x14,0x14},
- {0x34,0x18,0x18},
- {0x34,0x24,0x14},
- {0x34,0x28,0x18},
- {0x34,0x2C,0x18},
- {0x34,0x30,0x34},
- {0x34,0x34,0x34},
- {0x34,0x38,0x34},
- {0x34,0x3C,0x34},
- {0x38,0x00,0x38},
- {0x38,0x04,0x04},
- {0x38,0x08,0x08},
- {0x38,0x0C,0x0C},
- {0x38,0x10,0x34},
- {0x38,0x14,0x14},
- {0x38,0x18,0x18},
- {0x38,0x24,0x04},
- {0x38,0x28,0x08},
- {0x38,0x2C,0x08},
- {0x38,0x30,0x34},
- {0x38,0x34,0x34},
- {0x38,0x38,0x38},
- {0x38,0x3C,0x38},
- {0x3C,0x00,0x3C},
- {0x3C,0x04,0x04},
- {0x3C,0x08,0x2C},
- {0x3C,0x0C,0x0C},
- {0x3C,0x10,0x10},
- {0x3C,0x14,0x14},
- {0x3C,0x18,0x18},
- {0x3C,0x24,0x04},
- {0x3C,0x28,0x2C},
- {0x3C,0x2C,0x2C},
- {0x3C,0x30,0x10},
- {0x3C,0x34,0x10},
- {0x3C,0x38,0x3C},
- {0x3C,0x3C,0x3C},
- // addPotentialInitializationsFrom INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input1,
- UnconditionalFlowInfo input2) {
- return (UnconditionalFlowInfo)
- input1.copy().addPotentialInitializationsFrom(input2);
- }
- },
- mergedWith =
- // mergedWith DEFINITION START
- // def. non null + def. non null => def. non null
- // def. non null + def. null => pot. n & pot. nn
- // def. null + def. null => def. null
- // def. unknown + def. non null => def. unknown
- // def. unknown + def. null => pot. n & pot. un // pot. n priv. over def. unknown
- // def. unknown + def. unknown => def. unknown
- // pot. n & pot. nn + def. non null => pot. n & pot. nn
- // pot. n & pot. nn + def. null => pot. n & pot. nn
- // pot. n & pot. nn + def. unknown => pot. n & pot. nn
- // pot. n & pot. nn + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & pot. un + def. non null => pot. n & pot. nn
- // pot. n & pot. un + def. null => pot. n & pot. un
- // pot. n & pot. un + def. unknown => pot. n & pot. un
- // pot. n & pot. un + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & pot. un + pot. n & pot. un => pot. n & pot. un
- // pot. n & prot. n + def. non null => pot. n & pot. nn
- // pot. n & prot. n + def. null => pot. n & prot. n
- // pot. n & prot. n + def. unknown => pot. n & pot. un
- // pot. n & prot. n + pot. n & pot. nn => pot. n & pot. nn
- // pot. n & prot. n + pot. n & pot. un => pot. n & pot. un
- // pot. n & prot. n + pot. n & prot. n => pot. n & prot. n
- // pot. nn & pot. un + def. non null => pot. nn & pot. un
- // pot. nn & pot. un + def. null => pot. n & pot. nn
- // pot. nn & pot. un + def. unknown => pot. nn & pot. un
- // pot. nn & pot. un + pot. n & pot. nn => pot. n & pot. nn
- // pot. nn & pot. un + pot. n & pot. un => pot. n & pot. nn
- // pot. nn & pot. un + pot. n & prot. n => pot. n & pot. nn
- // pot. nn & pot. un + pot. nn & pot. un => pot. nn & pot. un
- // pot. nn & pot. un + pot. null => pot. n & pot. nn
- // pot. nn & prot. nn + def. non null => pot. nn & prot. nn
- // pot. nn & prot. nn + def. null => pot. n & pot. nn
- // pot. nn & prot. nn + def. unknown => pot. nn & pot. un
- // pot. nn & prot. nn + pot. n & pot. nn => pot. n & pot. nn
- // pot. nn & prot. nn + pot. n & pot. un => pot. n & pot. nn
- // pot. nn & prot. nn + pot. n & prot. n => pot. n & pot. nn
- // pot. nn & prot. nn + pot. nn & pot. un => pot. nn & pot. un
- // pot. nn & prot. nn + pot. nn & prot. nn => pot. nn & prot. nn
- // pot. nn & prot. nn + pot. null => pot. n & pot. nn
- // pot. non null + def. non null => pot. non null
- // pot. non null + def. null => pot. n & pot. nn
- // pot. non null + def. unknown => pot. nn & pot. un
- // pot. non null + pot. n & pot. nn => pot. n & pot. nn
- // pot. non null + pot. n & pot. un => pot. n & pot. nn
- // pot. non null + pot. n & prot. n => pot. n & pot. nn
- // pot. non null + pot. nn & pot. un => pot. nn & pot. un
- // pot. non null + pot. nn & prot. nn => pot. non null
- // pot. non null + pot. non null => pot. non null
- // pot. non null + pot. null => pot. n & pot. nn
- // pot. null + def. non null => pot. n & pot. nn
- // pot. null + def. null => pot. null
- // pot. null + def. unknown => pot. n & pot. un
- // pot. null + pot. n & pot. nn => pot. n & pot. nn
- // pot. null + pot. n & pot. un => pot. n & pot. un
- // pot. null + pot. n & prot. n => pot. null
- // pot. null + pot. null => pot. null
- // pot. unknown + def. non null => pot. nn & pot. un
- // pot. unknown + def. null => pot. n & pot. un
- // pot. unknown + def. unknown => pot. unknown
- // pot. unknown + pot. n & pot. nn => pot. n & pot. nn
- // pot. unknown + pot. n & pot. un => pot. n & pot. un
- // pot. unknown + pot. n & prot. n => pot. n & pot. un
- // pot. unknown + pot. nn & pot. un => pot. nn & pot. un
- // pot. unknown + pot. nn & prot. nn => pot. nn & pot. un
- // pot. unknown + pot. non null => pot. nn & pot. un
- // pot. unknown + pot. null => pot. n & pot. un
- // pot. unknown + pot. unknown => pot. unknown
- // prot. non null + def. non null => pot. nn & prot. nn
- // prot. non null + def. null => pot. null
- // prot. non null + def. unknown => def. unknown // test726
- // prot. non null + pot. n & pot. nn => pot. n & pot. nn
- // prot. non null + pot. n & pot. un => pot. n & pot. un
- // prot. non null + pot. n & prot. n => pot. null
- // prot. non null + pot. nn & pot. un => pot. nn & pot. un
- // prot. non null + pot. nn & prot. nn => pot. nn & prot. nn
- // prot. non null + pot. non null => pot. non null
- // prot. non null + pot. null => pot. null
- // prot. non null + pot. unknown => pot. unknown
- // prot. non null + prot. non null => prot. non null
- // prot. non null + prot. null => pot. null // PREMATURE use tainted instead
- // prot. null + def. non null => pot. non null // PREMATURE should become tainted null & pot. nn... not really, depends on the three way merge... or even on the conditions that got there (pb with no contrib prot. null branch)
- // prot. null + def. null => pot. n & prot. n
- // prot. null + def. unknown => pot. unknown // PREMATURE possibly wrong, but no test case yet
- // prot. null + pot. n & pot. nn => pot. n & pot. nn
- // prot. null + pot. n & pot. un => pot. n & pot. un
- // prot. null + pot. n & prot. n => pot. n & prot. n
- // prot. null + pot. nn & pot. un => pot. n & pot. nn
- // prot. null + pot. nn & prot. nn => pot. n & pot. nn
- // prot. null + pot. non null => pot. n & pot. nn
- // prot. null + pot. null => pot. null
- // prot. null + pot. unknown => pot. unknown // PREMATURE possibly wrong, but no test case yet
- // prot. null + prot. null => prot. null
- // start + def. non null => pot. non null
- // start + def. null => pot. null
- // start + def. unknown => pot. unknown
- // start + pot. n & pot. nn => pot. n & pot. nn
- // start + pot. n & pot. un => pot. n & pot. un
- // start + pot. n & prot. n => pot. null
- // start + pot. nn & pot. un => pot. nn & pot. un
- // start + pot. nn & prot. nn => pot. non null
- // start + pot. non null => pot. non null
- // start + pot. null => pot. null
- // start + pot. unknown => pot. unknown
- // start + prot. non null => start // PREMATURE should it taint?
- // start + prot. null => start
- // start + start => start
- // mergedWith DEFINITION END
- new SymmetricalThreeDimensionalTransformation("mergedWith",
- new byte[][] {
- // mergedWith INITIALIZER START
- {0x00,0x00,0x00},
- {0x00,0x04,0x04},
- {0x00,0x08,0x08},
- {0x00,0x0C,0x0C},
- {0x00,0x10,0x10},
- {0x00,0x14,0x14},
- {0x00,0x18,0x18},
- {0x00,0x24,0x04},
- {0x00,0x28,0x08},
- {0x00,0x2C,0x08},
- {0x00,0x30,0x10},
- {0x00,0x34,0x10},
- {0x00,0x38,0x00},
- {0x00,0x3C,0x00},
- {0x04,0x04,0x04},
- {0x04,0x08,0x0C},
- {0x04,0x0C,0x0C},
- {0x04,0x10,0x14},
- {0x04,0x14,0x14},
- {0x04,0x18,0x18},
- {0x04,0x24,0x04},
- {0x04,0x28,0x0C},
- {0x04,0x2C,0x0C},
- {0x04,0x30,0x14},
- {0x04,0x34,0x14},
- {0x08,0x08,0x08},
- {0x08,0x0C,0x0C},
- {0x08,0x10,0x18},
- {0x08,0x14,0x18},
- {0x08,0x18,0x18},
- {0x08,0x24,0x0C},
- {0x08,0x28,0x08},
- {0x08,0x2C,0x08},
- {0x08,0x30,0x18},
- {0x08,0x34,0x18},
- {0x0C,0x0C,0x0C},
- {0x0C,0x10,0x18},
- {0x0C,0x14,0x18},
- {0x0C,0x18,0x18},
- {0x0C,0x24,0x0C},
- {0x0C,0x28,0x0C},
- {0x0C,0x30,0x18},
- {0x0C,0x34,0x18},
- {0x10,0x10,0x10},
- {0x10,0x14,0x14},
- {0x10,0x18,0x18},
- {0x10,0x24,0x14},
- {0x10,0x28,0x18},
- {0x10,0x30,0x10},
- {0x10,0x34,0x10},
- {0x14,0x14,0x14},
- {0x14,0x18,0x18},
- {0x14,0x24,0x14},
- {0x14,0x28,0x18},
- {0x14,0x30,0x14},
- {0x18,0x18,0x18},
- {0x18,0x24,0x18},
- {0x18,0x28,0x18},
- {0x18,0x30,0x18},
- {0x24,0x24,0x24},
- {0x24,0x28,0x24},
- {0x24,0x30,0x14},
- {0x28,0x28,0x28},
- {0x28,0x30,0x18},
- {0x2C,0x0C,0x0C},
- {0x2C,0x10,0x18},
- {0x2C,0x14,0x18},
- {0x2C,0x18,0x18},
- {0x2C,0x24,0x0C},
- {0x2C,0x28,0x2C},
- {0x2C,0x2C,0x2C},
- {0x2C,0x30,0x18},
- {0x2C,0x34,0x18},
- {0x30,0x30,0x30},
- {0x34,0x14,0x14},
- {0x34,0x18,0x18},
- {0x34,0x24,0x14},
- {0x34,0x28,0x18},
- {0x34,0x30,0x34},
- {0x34,0x34,0x34},
- {0x38,0x04,0x04},
- {0x38,0x08,0x18},
- {0x38,0x0C,0x18},
- {0x38,0x10,0x10},
- {0x38,0x14,0x14},
- {0x38,0x18,0x18},
- {0x38,0x24,0x04},
- {0x38,0x28,0x08},
- {0x38,0x2C,0x18},
- {0x38,0x30,0x34},
- {0x38,0x34,0x34},
- {0x38,0x38,0x38},
- {0x3C,0x04,0x04},
- {0x3C,0x08,0x08},
- {0x3C,0x0C,0x0C},
- {0x3C,0x10,0x10},
- {0x3C,0x14,0x14},
- {0x3C,0x18,0x18},
- {0x3C,0x24,0x24},
- {0x3C,0x28,0x2C},
- {0x3C,0x2C,0x2C},
- {0x3C,0x30,0x10},
- {0x3C,0x34,0x10},
- {0x3C,0x38,0x10},
- {0x3C,0x3C,0x3C},
- // mergedWith INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input1,
- UnconditionalFlowInfo input2) {
- return input1.copy().mergedWith(input2);
- }
- },
- newNullInfoRegistry =
- // newNullInfoRegistry DEFINITION START
- // start => start
- // prot. non null => start
- // prot. null => start
- // pot. unknown => start
- // pot. non null => start
- // pot. nn & prot. nn => start
- // pot. nn & pot. un => start
- // pot. null => start
- // pot. n & prot. n => start
- // pot. n & pot. un => start
- // pot. n & pot. nn => start
- // def. unknown => pot. unknown
- // def. non null => pot. non null
- // def. null => pot. null
- // newNullInfoRegistry DEFINITION END
- new CreationalTransformation("newNullInfoRegistry",
- new byte[][] {
- // newNullInfoRegistry INITIALIZER START
- {0x00,0x00},
- {0x04,0x00},
- {0x08,0x00},
- {0x0C,0x00},
- {0x10,0x00},
- {0x14,0x00},
- {0x18,0x00},
- {0x24,0x04},
- {0x28,0x08},
- {0x2C,0x00},
- {0x30,0x10},
- {0x34,0x00},
- {0x38,0x00},
- {0x3C,0x00},
- // newNullInfoRegistry INITIALIZER END
- }) {
- UnconditionalFlowInfo output(UnconditionalFlowInfo input) {
- return NullInfoRegistryTestHarness.
- testNullInfoRegistry((UnconditionalFlowInfoTestHarness) input);
- }
- };
- public static final Transformation[] transformations = {
- markAsComparedEqualToNonNull,
- markAsComparedEqualToNull,
- markAsDefinitelyNonNull,
- markAsDefinitelyNull,
- markAsDefinitelyUnknown,
- addInitializationsFrom,
- addPotentialInitializationsFrom,
- mergedWith,
- newNullInfoRegistry
- };
-public abstract static class Transformation {
- public String name;
- String definitionStartMarker, definitionEndMarker,
- initializerStartMarker, initializerEndMarker;
- int dimension;
- public Map initializedTransitions, computedTransitions;
- // PREMATURE limit public access
- int failuresNb; // transient
-// PREMATURE complete the test coverage for NullInfoRegistry (need to consider several classes
-// of transitions so as to avoid considering NullInfoRegistry states and
-// UnconditionalFlowInfo states into the same pool; moreover, cross classes
-// transformations exist.
-Transformation(String name) {
- this.name = name;
- this.definitionStartMarker = "// " + name + " " + CodeAnalysis.definitionStartMarker;
- this.definitionEndMarker = "// " + name + " " + CodeAnalysis.definitionEndMarker;
- this.initializerStartMarker = "// " + name + " " + CodeAnalysis.initializerStartMarker;
- this.initializerEndMarker = "// " + name + " " + CodeAnalysis.initializerEndMarker;
-}
-abstract State[] computeOutputs(State[] inputs);
-abstract void hydrate();
-void fail() {
- if (this.failuresNb == 0) {
- System.out.println(this.name + " failures: ");
- }
- this.failuresNb++;
-}
-abstract void printTruthTables(File outputDirectory);
-
-static boolean checkContiguity(String a, String b) {
- int aLength;
- if ((aLength = a.length()) != b.length()) {
- System.out.println("inappropriate string length: " + a + " vs " + b);
- return false;
- }
- int status = 0;
- for (int i = 0; i < aLength; i++) {
- if (a.charAt(i) != b.charAt(i)) {
- status++;
- }
- }
- if (status != 1) {
- System.out.println("non contiguous strings: " + a + " vs " + b);
- return false;
- }
- return true;
-}
-
-final static String truthTableRowNames[] = { // need a specific order to yield simplication opportunities
- "000000",
- "000100",
- "001100",
- "001000",
- "011000",
- "011100",
- "010100",
- "010000",
- "110000",
- "110100",
- "111100",
- "111000",
- "101000",
- "101100",
- "100100",
- "100000",
- // PREMATURE cheated to group first four bits... reconsider
- "000001",
- "000011",
- "000010",
- "000110",
- "000111",
- "000101",
- "001101",
- "001111",
- "001110",
- "001010",
- "001011",
- "001001",
- "011001",
- "011011",
- "011010",
- "011110",
- "011111",
- "011101",
- "010101",
- "010111",
- "010110",
- "010010",
- "010011",
- "010001",
- "110001",
- "110011",
- "110010",
- "110110",
- "110111",
- "110101",
- "111101",
- "111111",
- "111110",
- "111010",
- "111011",
- "111001",
- "101001",
- "101011",
- "101010",
- "101110",
- "101111",
- "101101",
- "100101",
- "100111",
- "100110",
- "100010",
- "100011",
- "100001",
- };
-
-private static Map ranksForStates;
-int rankForState(State state) {
- int length;
- if (ranksForStates == null) {
- ranksForStates = new HashMap(length = truthTableRowNames.length);
- for (int i = 0; i < length; i++) {
- ranksForStates.put(truthTableRowNames[i], new Integer(i));
- }
- }
- Integer rank;
- if ((rank = (Integer) ranksForStates.get(state.printableBitsField)) != null) {
- return rank.intValue();
- }
- return 0;
-}
-
-abstract void reinitializeFromComments(BufferedReader input, BufferedWriter output);
-abstract void reinitializeFromComputedValues(BufferedReader input, BufferedWriter output,
- State[] consideredStates);
-/**
- * Run a test against UnconditionalFlowInfo by comparing the transitions as memorized
- * into the initializer and as delivered by UnconditionalFlowInfo for various positions
- * in the encoding and return the number of failures.
- * @return the number of failures, that is 0 if the results match the expectations
- */
-abstract int test();
-}
-abstract static class TwoDimensionalTransformation extends Transformation {
-TwoDimensionalTransformation(String name, byte[][] transitions) {
- super(name);
- this.dimension = 2;
- int length;
- this.initializedTransitions = new HashMap(length = transitions.length);
- State input1;
- for (int i = 0; i < length; i++) {
- if (transitions[i].length != 2) {
- throw new IllegalArgumentException("transitions should have two entries");
- }
- input1 = State.states[transitions[i][0]]; // array out of bounds exception if broken
- if (this.initializedTransitions.get(input1) != null) {
- throw new IllegalArgumentException("duplicate entry");
- }
- this.initializedTransitions.put(input1, State.states[transitions[i][1]]);
- }
-}
-State[] computeOutputs(State[] inputs) {
- Map resultAccumulator = new HashMap(State.stateMaxValue + 1);
- hydrate(); // pre-compute all possible combinations, then cache them
- for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++) {
- resultAccumulator.put(this.computedTransitions.get(inputs[i]), null);
- }
- int length;
- State[] result = new State[length = resultAccumulator.size()];
- Iterator resultIterator = resultAccumulator.keySet().iterator();
- for (int j = 0; j < length; j++) {
- result[j] = (State) resultIterator.next();
- }
- return result;
-}
-void hydrate() {
- if (this.computedTransitions == null) {
- State input, output;
- this.computedTransitions = new HashMap(State.stateMaxValue + 1);
- for (int i = 0, length = State.states.length; i < length; i++) {
- output = ((UnconditionalFlowInfoTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input = State.states[i]),
- TestLocalVariableBinding.local0)).asState();
- if (input.symbolic && !output.symbolic) {
- System.err.println(this.name + " generates non-symbolic state " +
- output + " upon entry: " + input);
- }
- this.computedTransitions.put(input, output);
- }
- }
-}
-abstract UnconditionalFlowInfo output(UnconditionalFlowInfo input, TestLocalVariableBinding local);
-
-void printTruthTables(File outputDirectory) {
- try {
- String outputFileName = outputDirectory.getPath() + File.separator + this.name + ".txt";
- PrintWriter out = new PrintWriter(new FileOutputStream(
- new File(outputFileName)));
- System.out.println("Printing " + outputFileName);
- out.println("======================================================");
- out.println("Truth table for " + this.name );
- char truthValues[][] = new char[State.statesNb][State.stateWidth];
- int row, column;
- for (row = 0; row < State.statesNb; row++) {
- for (column = 0; column < State.stateWidth; column++) {
- truthValues[row][column] = '.';
- }
- }
- boolean keepRow[] = new boolean[State.statesNb];
- Iterator i1 = this.initializedTransitions.entrySet().iterator();
- while (i1.hasNext()) {
- Map.Entry transitionsSet = (Map.Entry) i1.next();
- State input = (State) transitionsSet.getKey();
- keepRow[row = rankForState(input)] = true;
- for (int bit = 0; bit < State.stateWidth; bit++) {
- truthValues[row][bit] =
- ((State) transitionsSet.getValue()).printableBitsField.charAt(bit);
- }
- }
- StringBuffer line;
- line = new StringBuffer(140);
- line.append(" ");
- for (int i = 1; i <= State.stateWidth; i++) {
- line.append(i);
- line.append(' ');
- }
- out.println(line);
- line = new StringBuffer(140);
- line.append(" ---------------------");
- out.println(line);
- for (row = 0; row < State.statesNb; row++) {
- if (keepRow[row]) {
- line = new StringBuffer(140);
- line.append(truthTableRowNames[row]);
- line.append(" | ");
- for (int i = 0; i < State.stateWidth; i++) {
- line.append(truthValues[row][i]);
- line.append(' ');
- }
- out.println(line);
- }
- }
- out.println("======================================================");
- out.flush();
- out.close();
- }
- catch (Throwable t) {
- // PREMATURE improve error handling
- }
-}
-
-void reinitializeFromComments(BufferedReader input, BufferedWriter output) {
- String line, tab = "";
- int cursor;
- char c;
- this.initializedTransitions = new HashMap(State.stateMaxValue);
- int lineNumber = 0;
- try {
- while ((line = input.readLine()) != null) {
- lineNumber++;
- output.write(line);
- output.write('\n');
- if ((cursor = line.indexOf(definitionStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(definitionEndMarker) == -1) {
- lineNumber++;
- final int
- start = 0,
- commentStart = 1,
- commentFound = 2,
- firstState = 10,
- firstStateWS = 11,
- implies = 20,
- impliesWS = 21,
- secondState = 30,
- secondStateWS = 31, // caveat, multi-state
- error = 99;
- int state = start,
- firstStateStart = 0, firstStateEnd = 0, firstStateWhiteSpace = 0,
- secondStateStart = 0, secondStateEnd = 0, secondStateWhiteSpace = 0;
- char current;
- analysis: for (int i = 0, length = line.length(); i < length; i++) {
- current = line.charAt(i);
- switch (state) {
- case start:
- if (current == '/') {
- state = commentStart;
- } else if (! Character.isWhitespace(current)) {
- state = error;
- break analysis;
- }
- break;
- case commentStart:
- if (current == '/') {
- state = commentFound;
- } else {
- state = error;
- break analysis;
- }
- break;
- case commentFound:
- if (! Character.isWhitespace(current)) {
- firstStateStart = firstStateEnd = i;
- state = firstState;
- }
- break;
- case firstState:
- if (Character.isWhitespace(current)) {
- state = firstStateWS;
- firstStateWhiteSpace = 1;
- } else {
- firstStateEnd++;
- }
- break;
- case firstStateWS:
- if (current == '=') {
- state = implies;
- } else if (Character.isWhitespace(current)) {
- firstStateWhiteSpace++;
- } else {
- state = firstState;
- firstStateEnd += firstStateWhiteSpace + 1;
- }
- break;
- case implies:
- if (current == '>') {
- state = impliesWS;
- } else {
- state = error;
- break analysis;
- }
- break;
- case impliesWS:
- if (! Character.isWhitespace(current)) {
- secondStateStart = secondStateEnd = i;
- state = secondState;
- }
- break;
- case secondState:
- if (current == '/') {
- break analysis;
- } else if (Character.isWhitespace(current)) {
- state = secondStateWS;
- secondStateWhiteSpace = 1;
- } else {
- secondStateEnd++;
- }
- break;
- case secondStateWS:
- if (current == '/') {
- state = secondState;
- break analysis;
- } else if (current == 'C') {
- state++;
- } else if (Character.isWhitespace(current)) {
- secondStateWhiteSpace++;
- } else {
- state = secondState;
- secondStateEnd += secondStateWhiteSpace + 1;
- }
- break;
- case secondStateWS + 1:
- if (current == '/') {
- state = secondState;
- break analysis;
- } else if (current == 'H') {
- state++;
- } else {
- state = secondState;
- secondStateEnd += secondStateWhiteSpace + 2;
- }
- break;
- case secondStateWS + 2:
- if (current == '/') {
- state = secondState;
- break analysis;
- } else if (current == 'E') {
- state++;
- } else {
- state = secondState;
- secondStateEnd += secondStateWhiteSpace + 3;
- }
- break;
- case secondStateWS + 3:
- if (current == '/') {
- state = secondState;
- break analysis;
- } else if (current == 'C') {
- state++;
- } else {
- state = secondState;
- secondStateEnd += secondStateWhiteSpace + 4;
- }
- break;
- case secondStateWS + 4:
- if (current == '/' || current == 'K') {
- state = secondState;
- break analysis;
- } else {
- state = secondState;
- secondStateEnd += secondStateWhiteSpace + 5;
- }
- break;
-
- }
- }
- if (state == error || state < secondState) {
- System.err.println("Could not interpret comment definition"); // PREMATURE improve diagnostic
- } else {
- if (state > secondStateWS) {
- secondStateEnd += (state - secondState);
- }
- String stateName;
- State first, second;
- if ((first = State.fromSymbolicName(
- stateName = line.substring(firstStateStart, firstStateEnd + 1)))
- == null) {
- System.err.println("Could not find state: " + stateName); // PREMATURE improve diagnostic
- }
- if ((second = State.fromSymbolicName(
- stateName = line.substring(secondStateStart, secondStateEnd + 1)))
- == null) {
- System.err.println("Could not find state: " + stateName); // PREMATURE improve diagnostic
- }
- if (first != null && second != null) {
- if (this.initializedTransitions.get(first) != null) {
- System.err.println("Line " + lineNumber + ": Skipping duplicate entry for state: " + first); // PREMATURE improve diagnostic
- } else {
- this.initializedTransitions.put(first, second);
- }
- }
- }
- output.write(line);
- output.write('\n');
- }
- Iterator firsts = State.symbolicStates();
- State first;
- while (firsts.hasNext()) {
- first = (State) firsts.next();
- if (this.initializedTransitions.get(first) == null) {
- System.err.println("Adding missing transition for state: " + first);
- output.write(tab);
- output.write("// ");
- output.write(first.toString());
- output.write(" => start\t\t CHECK\n");
- }
- }
- }
- output.write(tab + definitionEndMarker + "\n");
- }
- if (line != null && (cursor = line.indexOf(initializerStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- tab = "";
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(initializerEndMarker) == -1) {
- // loop
- }
- SortedMap sorted = new TreeMap(this.initializedTransitions);
- Iterator transitions = sorted.entrySet().iterator();
- Map.Entry transition;
- while (transitions.hasNext()) {
- transition = (Map.Entry) transitions.next();
- output.write(tab);
- output.write('{');
- output.write(((State)transition.getKey()).hexString);
- output.write(',');
- output.write(((State)transition.getValue()).hexString);
- output.write("},");
- output.write('\n');
- }
- output.write(tab + initializerEndMarker + "\n");
- }
- }
- }
- output.flush();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-}
-
-void reinitializeFromComputedValues(BufferedReader input, BufferedWriter output,
- State[] consideredStates) {
- String line, tab = "";
- int cursor;
- char c;
- State result;
- try {
- while ((line = input.readLine()) != null) {
- output.write(line);
- output.write('\n');
- if ((cursor = line.indexOf(definitionStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(definitionEndMarker) == -1) {
- // loop
- }
- int i, length;
- for (i = 0, length = consideredStates.length; i < length; i++) {
- output.write(tab);
- output.write("// ");
- output.write(consideredStates[i].name);
- output.write(" => ");
- output.write(
- (result = (State) this.computedTransitions.get(consideredStates[i])).name);
- if (!result.symbolic ||
- result != this.initializedTransitions.get(consideredStates[i])) {
- output.write("\t\t CHECK");
- }
- output.write('\n');
- }
- output.write(tab + definitionEndMarker + "\n");
- }
- }
- if (line != null && (cursor = line.indexOf(initializerStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- tab = "";
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(initializerEndMarker) == -1) {
- // loop
- }
- int i, length;
- for (i = 0, length = consideredStates.length; i < length; i++) {
- output.write(tab);
- output.write('{');
- output.write(consideredStates[i].hexString);
- output.write(',');
- output.write(
- ((State) this.computedTransitions.get(consideredStates[i])).hexString);
- output.write("},");
- output.write('\n');
- }
- output.write(tab + initializerEndMarker + "\n");
- }
- }
- }
- output.flush();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-}
-int test() {
- Iterator transitions = this.initializedTransitions.entrySet().iterator();
- State input, expectedOutput, effectiveOutput;
- Map.Entry transition;
- this.failuresNb = 0; // reset
- while (transitions.hasNext()) {
- transition = (Map.Entry) transitions.next();
- input = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input),
- TestLocalVariableBinding.local0)).asState();
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " instead of: " + expectedOutput.printableBitsField);
- }
- }
- transitions = this.initializedTransitions.entrySet().iterator();
- while (transitions.hasNext()) {
- transition = (Map.Entry) transitions.next();
- input = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input, 64),
- TestLocalVariableBinding.local64)).asState(64);
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64) instead of: " + expectedOutput.printableBitsField);
- }
- if (input == State.start) {
- effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(expectedOutput),
- TestLocalVariableBinding.local64)).asState(64);
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 64) instead of: " + expectedOutput.printableBitsField);
- }
- }
- }
- transitions = this.initializedTransitions.entrySet().iterator();
- while (transitions.hasNext()) {
- transition = (Map.Entry) transitions.next();
- input = (State) transition.getKey();
- if (input == State.start) {
- expectedOutput = (State) transition.getValue();
- effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(expectedOutput, 64),
- TestLocalVariableBinding.local128)).asState(128);
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 128) instead of: " + expectedOutput.printableBitsField);
- }
- }
- }
- return this.failuresNb;
-}
-}
-abstract static class CreationalTransformation extends TwoDimensionalTransformation {
-CreationalTransformation(String name, byte[][] transitions) {
- super(name, transitions);
-}
-void hydrate() {
- if (this.computedTransitions == null) {
- State input, output;
- this.computedTransitions = new HashMap(State.stateMaxValue + 1);
- for (int i = 0, length = State.states.length; i < length; i++) {
- output = ((NullInfoRegistryTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input = State.states[i]),
- TestLocalVariableBinding.local0)).asState();
- if (input.symbolic && !output.symbolic) {
- System.err.println(this.name + " generates non-symbolic state " +
- output + " upon entry: " + input);
- }
- this.computedTransitions.put(input, output);
- }
- }
-}
-UnconditionalFlowInfo output(UnconditionalFlowInfo input, TestLocalVariableBinding local) {
- return output(input);
-}
-abstract UnconditionalFlowInfo output(UnconditionalFlowInfo input);
-int test() {
- Iterator transitions = this.initializedTransitions.entrySet().iterator();
- State input, expectedOutput, effectiveOutput;
- Map.Entry transition;
- this.failuresNb = 0; // reset
- while (transitions.hasNext()) {
- transition = (Map.Entry) transitions.next();
- input = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- effectiveOutput = ((NullInfoRegistryTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input),
- TestLocalVariableBinding.local0)).asState();
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " instead of: " + expectedOutput.printableBitsField);
- }
- }
- transitions = this.initializedTransitions.entrySet().iterator();
- while (transitions.hasNext()) {
- transition = (Map.Entry) transitions.next();
- input = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- effectiveOutput = ((NullInfoRegistryTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input, 64))).asState(64);
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64) instead of: " + expectedOutput.printableBitsField);
- }
- }
- return this.failuresNb;
-}
-}
-public abstract static class ThreeDimensionalTransformation extends Transformation {
-ThreeDimensionalTransformation(String name) {
- super(name);
- this.dimension = 3;
-}
-ThreeDimensionalTransformation(String name, byte[][] transitions) {
- super(name);
- this.dimension = 3;
- int length;
- this.initializedTransitions = new HashMap(length = transitions.length);
- State input1, input2;
- for (int i = 0; i < length; i++) {
- if (transitions[i].length != 3) {
- throw new IllegalArgumentException("transitions should have three entries");
- }
- input1 = State.states[transitions[i][0]]; // array out of bounds exception if broken
- input2 = State.states[transitions[i][1]];
- Map transitionsForInput1 = (Map) this.initializedTransitions.get(input1);
- if (transitionsForInput1 == null) {
- transitionsForInput1 = new HashMap(length);
- this.initializedTransitions.put(input1, transitionsForInput1);
- }
- if (transitionsForInput1.get(input2) != null) {
- throw new IllegalArgumentException("duplicate entry");
- }
- transitionsForInput1.put(input2, State.states[transitions[i][2]]);
- }
-}
-State[] computeOutputs(State[] inputs) {
- Map resultAccumulator = new HashMap(State.stateMaxValue + 1);
- hydrate(); // pre-compute all possible combinations, then cache them
- for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++) {
- for (int i2 = 0; i2 < inputsLength; i2++) {
- resultAccumulator.put(
- ((Map) this.computedTransitions.get(inputs[i])).get(inputs[i2]), null);
- }
- }
- int length;
- State[] result = new State[length = resultAccumulator.size()];
- Iterator resultIterator = resultAccumulator.keySet().iterator();
- for (int j = 0; j < length; j++) {
- result[j] = (State) resultIterator.next();
- }
- return result;
-}
-void hydrate() {
- if (this.computedTransitions == null) {
- State input1, input2, output;
- this.computedTransitions = new HashMap(State.stateMaxValue + 1);
- Map entry;
- for (int i = 0, length = State.states.length; i < length; i++) {
- entry = new HashMap(State.stateMaxValue + 1);
- this.computedTransitions.put(input1 = State.states[i], entry);
- for (int j = 0; j < length; j++) {
- output = ((UnconditionalFlowInfoTestHarness)
- output(UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input1),
- UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input2 = State.states[j]))).asState();
- if (input1.symbolic && input2.symbolic && !output.symbolic) {
- System.err.println(this.name + " generates non-symbolic state " +
- output + " upon entry: " + input1 + " + " + input2);
- }
- entry.put(input2, output);
- }
- }
- }
-}
-abstract UnconditionalFlowInfo output(UnconditionalFlowInfo input1, UnconditionalFlowInfo input2);
-void printDefinitions(BufferedWriter output, State[] consideredStates, String tab)
- throws IOException {
- int i, j, length;
- State result;
- for (i = 0, length = consideredStates.length; i < length; i++) {
- for (j = 0; j < length; j++) {
- output.write(tab);
- output.write("// ");
- output.write(consideredStates[i].name);
- output.write(" + ");
- output.write(consideredStates[j].name);
- output.write(" => ");
- output.write(
- (result = (State)
- ((Map) this.computedTransitions.get(consideredStates[i])).get(consideredStates[j])).name);
- if (!result.symbolic ||
- result != this.initializedTransitions.get(consideredStates[i])) {
- output.write("\t\t CHECK");
- }
- output.write('\n');
- }
- }
-}
-void printInitializers(BufferedWriter output, State[] consideredStates, String tab)
- throws IOException {
- int i, j, length;
- for (i = 0, length = consideredStates.length; i < length; i++) {
- for (j = 0; j < length; j++) {
- output.write(tab);
- output.write('{');
- output.write(consideredStates[i].hexString);
- output.write(',');
- output.write(consideredStates[j].hexString);
- output.write(',');
- output.write(
- ((State)
- ((Map) this.computedTransitions.get(consideredStates[i])).get(consideredStates[j])).hexString);
- output.write("},");
- output.write('\n');
- }
- }
-}
-void printMissingEntries(BufferedWriter output, String tab) throws IOException {
- Iterator firsts = State.symbolicStates(), seconds;
- State first, second;
- Map transitions;
- while (firsts.hasNext()) {
- first = (State) firsts.next();
- seconds = State.symbolicStates();
- if ((transitions = (Map) this.initializedTransitions.get(first))
- == null) {
- while (seconds.hasNext()) {
- second = (State) seconds.next();
- System.err.println("Adding missing transition for states (" + first + ", " + second + ")");
- output.write(tab);
- output.write("// ");
- output.write(first.toString());
- output.write(" + ");
- output.write(second.toString());
- output.write(" => start\t\t CHECK\n");
- }
- } else {
- while (seconds.hasNext()) {
- second = (State) seconds.next();
- if (transitions.get(second) == null) {
- System.err.println("Adding missing transition for states (" + first + ", " + second + ")");
- output.write(tab);
- output.write("// ");
- output.write(first.toString());
- output.write(" + ");
- output.write(second.toString());
- output.write(" => start\t\t CHECK\n");
- }
- }
- }
- }
-}
-void printTruthTables(File outputDirectory) {
- for (int bit = 1; bit <= State.stateWidth; bit++) {
- try {
- String outputFileName = outputDirectory.getPath() + File.separator + this.name + "_" + bit + ".txt";
- PrintWriter out = new PrintWriter(new FileOutputStream(
- new File(outputFileName)));
- System.out.println("Printing " + outputFileName);
- out.println("======================================================");
- out.println("Truth table for " + this.name + " null bit " + bit);
- char truthValues[][] = new char[State.statesNb][State.statesNb];
- int row, column;
- for (row = 0; row < State.statesNb; row++) {
- for (column = 0; column < State.statesNb; column++) {
- truthValues[row][column] = '.';
- }
- }
- if (false) { // checking row names
- boolean gotProblem = false;
- if (truthTableRowNames.length > State.statesNb) {
- System.out.println("row names table contains too many rows");
- gotProblem = true;
- }
- else if (truthTableRowNames.length < State.statesNb) {
- System.out.println("row names table contains too few rows");
- gotProblem = true;
- }
- Map check = new HashMap(State.statesNb);
- for (row = 0; row < truthTableRowNames.length; row++) {
- if (check.containsKey(truthTableRowNames[row])) {
- System.out.println("duplicate row: " + truthTableRowNames[row]);
- gotProblem = true;
- }
- else {
- check.put(truthTableRowNames[row], null);
- }
- if (row > 0 && !checkContiguity(truthTableRowNames[row - 1], truthTableRowNames[row])) {
- gotProblem = true;
- }
- }
- // assertFalse("invalid rows table", gotProblem);
- }
- boolean keepRow[] = new boolean[State.statesNb],
- keepColumn[] = new boolean[State.statesNb];
- Iterator i1 = this.initializedTransitions.entrySet().iterator();
- while (i1.hasNext()) {
- Map.Entry transitionsSet = (Map.Entry) i1.next();
- State first = (State) transitionsSet.getKey();
- Iterator i2 = ((Map) transitionsSet.getValue()).entrySet().iterator();
- while (i2.hasNext()) {
- Map.Entry transition = (Map.Entry) i2.next();
- mark(truthValues, keepRow, keepColumn, rankForState(first),
- rankForState((State) transition.getKey()),
- ((State) transition.getValue()).printableBitsField.charAt(bit - 1));
- }
- }
- for (row = 0; row < State.statesNb; row += 2) {
- if (keepRow[row]) {
- keepRow[row + 1] = true;
- }
- else if (keepRow[row + 1]) {
- keepRow[row] = true;
- }
- if (keepColumn[row]) {
- keepColumn[row + 1] = true;
- }
- else if (keepColumn[row + 1]) {
- keepColumn[row] = true;
- }
- }
- StringBuffer line;
- for (int i = 0; i < State.stateWidth; i++) {
- line = new StringBuffer(140);
- line.append(" ");
- for (column = 0; column < State.statesNb; column++) {
- if (keepColumn[column]) {
- line.append(truthTableRowNames[column].charAt(i));
- line.append(' ');
- }
- }
- out.println(line);
- }
- line = new StringBuffer(140);
- line.append(" --");
- for (column = 0; column < State.statesNb; column++) {
- if (keepColumn[column]) {
- line.append('-');
- line.append('-');
- }
- }
- out.println(line);
- for (row = 0; row < State.statesNb; row++) {
- if (keepRow[row]) {
- line = new StringBuffer(140);
- line.append(truthTableRowNames[row]);
- line.append(" | ");
- for (column = 0; column < State.statesNb; column++) {
- if (keepColumn[column]) {
- line.append(truthValues[row][column]);
- line.append(' ');
- }
- }
- out.println(line);
- }
- }
- out.println("======================================================");
- out.flush();
- out.close();
- }
- catch (Throwable t) {
- // PREMATURE improve error handling
- }
- }
-}
-
-void mark(char truthValues[][], boolean keepRow[], boolean keepColumn[],
- int row, int column, char value) {
- truthValues[row][column] = value;
- keepRow[row] = true;
- keepColumn[column] = true;
-}
-
-void reinitializeFromComments(BufferedReader input, BufferedWriter output) {
- String line, tab = "";
- int cursor;
- char c;
- this.initializedTransitions = new HashMap(State.stateMaxValue);
- int lineNumber = 0;
- try {
- while ((line = input.readLine()) != null) {
- lineNumber++;
- output.write(line);
- output.write('\n');
- if ((cursor = line.indexOf(definitionStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(definitionEndMarker) == -1) {
- lineNumber++;
- final int
- start = 0,
- commentStart = 1,
- commentFound = 2,
- firstState = 10,
- firstStateWS = 11,
- plus = 20,
- secondState = 30,
- secondStateWS = 31,
- implies = 40,
- impliesWS = 41,
- thirdState = 50,
- thirdStateWS = 51, // caveat, multi-state
- error = 99;
- int state = start,
- firstStateStart = 0, firstStateEnd = 0, firstStateWhiteSpace = 0,
- secondStateStart = 0, secondStateEnd = 0, secondStateWhiteSpace = 0,
- thirdStateStart = 0, thirdStateEnd = 0, thirdStateWhiteSpace = 0;
- char current;
- analysis: for (int i = 0, length = line.length(); i < length; i++) {
- current = line.charAt(i);
- switch (state) {
- case start:
- if (current == '/') {
- state = commentStart;
- } else if (! Character.isWhitespace(current)) {
- state = error;
- break analysis;
- }
- break;
- case commentStart:
- if (current == '/') {
- state = commentFound;
- } else {
- state = error;
- break analysis;
- }
- break;
- case commentFound:
- if (! Character.isWhitespace(current)) {
- firstStateStart = firstStateEnd = i;
- state = firstState;
- }
- break;
- case firstState:
- if (Character.isWhitespace(current)) {
- state = firstStateWS;
- firstStateWhiteSpace = 1;
- } else {
- firstStateEnd++;
- }
- break;
- case firstStateWS:
- if (current == '+') {
- state = plus;
- } else if (Character.isWhitespace(current)) {
- firstStateWhiteSpace++;
- } else {
- state = firstState;
- firstStateEnd += firstStateWhiteSpace + 1;
- }
- break;
- case plus:
- if (! Character.isWhitespace(current)) {
- secondStateStart = secondStateEnd = i;
- state = secondState;
- }
- break;
- case secondState:
- if (Character.isWhitespace(current)) {
- state = secondStateWS;
- secondStateWhiteSpace = 1;
- } else {
- secondStateEnd++;
- }
- break;
- case secondStateWS:
- if (current == '=') {
- state = implies;
- } else if (Character.isWhitespace(current)) {
- secondStateWhiteSpace++;
- } else {
- state = secondState;
- secondStateEnd += secondStateWhiteSpace + 1;
- }
- break;
- case implies:
- if (current == '>') {
- state = impliesWS;
- } else {
- state = error;
- break analysis;
- }
- break;
- case impliesWS:
- if (! Character.isWhitespace(current)) {
- thirdStateStart = thirdStateEnd = i;
- state = thirdState;
- }
- break;
- case thirdState:
- if (current == '/') {
- break analysis;
- } else if (Character.isWhitespace(current)) {
- state = thirdStateWS;
- thirdStateWhiteSpace = 1;
- } else {
- thirdStateEnd++;
- }
- break;
- case thirdStateWS:
- if (current == '/') {
- state = thirdState;
- break analysis;
- } else if (current == 'C') {
- state++;
- } else if (Character.isWhitespace(current)) {
- thirdStateWhiteSpace++;
- } else {
- state = thirdState;
- thirdStateEnd += thirdStateWhiteSpace + 1;
- }
- break;
- case thirdStateWS + 1:
- if (current == '/') {
- state = thirdState;
- break analysis;
- } else if (current == 'H') {
- state++;
- } else {
- state = thirdState;
- thirdStateEnd += thirdStateWhiteSpace + 2;
- }
- break;
- case thirdStateWS + 2:
- if (current == '/') {
- state = thirdState;
- break analysis;
- } else if (current == 'E') {
- state++;
- } else {
- state = thirdState;
- thirdStateEnd += thirdStateWhiteSpace + 3;
- }
- break;
- case thirdStateWS + 3:
- if (current == '/') {
- state = thirdState;
- break analysis;
- } else if (current == 'C') {
- state++;
- } else {
- state = thirdState;
- thirdStateEnd += thirdStateWhiteSpace + 4;
- }
- break;
- case thirdStateWS + 4:
- if (current == '/' || current == 'K') {
- state = thirdState;
- break analysis;
- } else {
- state = thirdState;
- thirdStateEnd += thirdStateWhiteSpace + 5;
- }
- break;
-
- }
- }
- if (state == error || state < thirdState) {
- System.err.println("Could not interpret comment definition"); // PREMATURE improve diagnostic
- } else {
- if (state > thirdStateWS) {
- thirdStateEnd += (state - thirdState);
- }
- String stateName;
- State first, second, third;
- if ((first = State.fromSymbolicName(
- stateName = line.substring(firstStateStart, firstStateEnd + 1)))
- == null) {
- System.err.println("Could not find state: " + stateName); // PREMATURE improve diagnostic
- }
- if ((second = State.fromSymbolicName(
- stateName = line.substring(secondStateStart, secondStateEnd + 1)))
- == null) {
- System.err.println("Could not find state: " + stateName); // PREMATURE improve diagnostic
- }
- if ((third = State.fromSymbolicName(
- stateName = line.substring(thirdStateStart, thirdStateEnd + 1)))
- == null) {
- System.err.println("Could not find state: " + stateName); // PREMATURE improve diagnostic
- }
- if (first != null && second != null && third != null) {
- Map transitions;
- if ((transitions = (Map) this.initializedTransitions.get(first)) == null) {
- transitions = new HashMap(State.stateMaxValue + 1);
- this.initializedTransitions.put(first, transitions);
- }
- if (transitions.get(second) != null) {
- System.err.println("Line " + lineNumber + ": Skipping duplicate entry for states: (" + first
- + ", " + second + ")"); // PREMATURE improve diagnostic
- } else {
- transitions.put(second, third);
- }
- }
- }
- output.write(line);
- output.write('\n');
- }
- }
- printMissingEntries(output, tab);
- output.write(tab + definitionEndMarker + "\n");
- }
- if (line != null && (cursor = line.indexOf(initializerStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- tab = "";
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(initializerEndMarker) == -1) {
- // loop
- }
- SortedMap sortedTransitionsSet = new TreeMap(this.initializedTransitions);
- Iterator transitionsSets = sortedTransitionsSet.entrySet().iterator();
- Map.Entry transitionsSet;
- while (transitionsSets.hasNext()) {
- transitionsSet = (Map.Entry) transitionsSets.next();
- SortedMap sortedTransitions = new TreeMap((Map) transitionsSet.getValue());
- Iterator transitions = sortedTransitions.entrySet().iterator();
- Map.Entry transition;
- while (transitions.hasNext()) {
- transition = (Map.Entry) transitions.next();
- output.write(tab);
- output.write('{');
- output.write(((State)transitionsSet.getKey()).hexString);
- output.write(',');
- output.write(((State)transition.getKey()).hexString);
- output.write(',');
- output.write(((State)transition.getValue()).hexString);
- output.write("},");
- output.write('\n');
- }
- }
- output.write(tab + initializerEndMarker + "\n");
- }
- }
- }
- output.flush();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-}
-void reinitializeFromComputedValues(BufferedReader input, BufferedWriter output,
- State[] consideredStates) {
- String line, tab = "";
- int cursor;
- char c;
- try {
- while ((line = input.readLine()) != null) {
- output.write(line);
- output.write('\n');
- if ((cursor = line.indexOf(definitionStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(definitionEndMarker) == -1) {
- // loop
- }
- printDefinitions(output, consideredStates, tab);
- output.write(tab + definitionEndMarker + "\n");
- }
- }
- if (line != null && (cursor = line.indexOf(initializerStartMarker)) != -1) {
- // check the line format
- boolean reachedStart = true;
- tab = "";
- for (int i = 0; i < cursor; i++) {
- if (!Character.isWhitespace(c = line.charAt(i))) {
- reachedStart = false;
- break;
- }
- else {
- tab += c;
- }
- }
- if (reachedStart) {
- while ((line = input.readLine()) != null &&
- line.indexOf(initializerEndMarker) == -1) {
- // loop
- }
- printInitializers(output, consideredStates, tab);
- output.write(tab + initializerEndMarker + "\n");
- }
- }
- }
- output.flush();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-}
-int test() {
- return test(1, false);
-}
-int test(int combinationTestsLoopsNb, boolean skipHighOrderBits) {
- Iterator transitionsSetsIterator, transitionsIterator;
- State input1, input2, expectedOutput, effectiveOutput;
- Map.Entry transition, transitionsSet;
- this.failuresNb = 0; // reset
- this.failuresNb = 0; // reset
- long start = 0;
- if (combinationTestsLoopsNb > 1) {
- start = System.currentTimeMillis();
- }
- for (int l = 0; l < combinationTestsLoopsNb ; l++) {
- transitionsSetsIterator = this.initializedTransitions.entrySet().iterator();
- while (transitionsSetsIterator.hasNext()) {
- transitionsSet = (Map.Entry) transitionsSetsIterator.next();
- input1 = (State) transitionsSet.getKey();
- transitionsIterator = ((Map) transitionsSet.getValue()).
- entrySet().iterator();
- while (transitionsIterator.hasNext()) {
- transition = (Map.Entry) transitionsIterator.next();
- input2 = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- effectiveOutput = ((UnconditionalFlowInfoTestHarness) output(
- UnconditionalFlowInfoTestHarness.testUnconditionalFlowInfo(input1),
- UnconditionalFlowInfoTestHarness.testUnconditionalFlowInfo(input2)))
- .asState();
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " instead of: " + expectedOutput.printableBitsField);
- }
- }
- }
- }
- if (combinationTestsLoopsNb > 1) {
- System.out.println(this.name + "...\t\t" + combinationTestsLoopsNb + "\t" +
- (System.currentTimeMillis() - start));
- }
- // PREMATURE optimize test (extraneous allocations and copies)
- // PREMATURE optimize test (extraneous iterations - undup)
- if (!skipHighOrderBits) {
- UnconditionalFlowInfoTestHarness
- zero = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(State.start),
- left, right, left64, right64, left128, right128,
- special = (UnconditionalFlowInfoTestHarness) zero.copy();
- special.grow(64); // allocates one extra without adding null info
- transitionsSetsIterator = this.initializedTransitions.entrySet().iterator();
- while (transitionsSetsIterator.hasNext()) {
- transitionsSet = (Map.Entry) transitionsSetsIterator.next();
- input1 = (State) transitionsSet.getKey();
- transitionsIterator = ((Map) transitionsSet.getValue()).
- entrySet().iterator();
- while (transitionsIterator.hasNext()) {
- transition = (Map.Entry) transitionsIterator.next();
- input2 = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- left = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input1);
- left64 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input1, 64);
- left128 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input1, 128);
- right = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input2);
- right64 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input2, 64);
- right128 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input2, 128);
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(left64, right64)).asState(64)) !=
- expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64, 64) - instead of: " + expectedOutput.printableBitsField);
- }
- if (input1 == State.start) {
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right128, right)).asState()) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 128, 1) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(zero, right64)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero, 64) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right128, right64)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 128, 64) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(zero, right128)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero, 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right64, right128)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 64, 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(special, right128)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (special zero, 128) - instead of: " + expectedOutput.printableBitsField);
- }
- }
- if (input2 == State.start) {
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(left, left128)).asState()) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (1, zero 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(left64, zero)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64, zero) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(left64, left128)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64, zero 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(left128, zero)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (128, zero) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(left128, left64)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (128, zero 64) - instead of: " + expectedOutput.printableBitsField);
- }
- }
- }
- }
- }
- return this.failuresNb;
-}
-}
-
-public abstract static class SymmetricalThreeDimensionalTransformation
- extends ThreeDimensionalTransformation{
-SymmetricalThreeDimensionalTransformation(String name, byte[][] transitions) {
- super(name);
- int length;
- this.initializedTransitions = new HashMap((length = transitions.length) * 2 - 1);
- State input1, input2;
- for (int i = 0; i < length; i++) {
- if (transitions[i].length != 3) {
- throw new IllegalArgumentException("transitions should have three entries");
- }
- if (transitions[i][0] <= transitions[i][1]) {
- input1 = State.states[transitions[i][0]]; // array out of bounds exception if broken
- input2 = State.states[transitions[i][1]];
- }
- else {
- input1 = State.states[transitions[i][1]];
- input2 = State.states[transitions[i][0]];
- }
- Map transitionsForInput1 = (Map) this.initializedTransitions.get(input1);
- if (transitionsForInput1 == null) {
- transitionsForInput1 = new HashMap(length);
- this.initializedTransitions.put(input1, transitionsForInput1);
- }
- if (transitionsForInput1.get(input2) != null) {
- throw new IllegalArgumentException("duplicate entry");
- }
- transitionsForInput1.put(input2, State.states[transitions[i][2]]);
- }
-}
-void hydrate() {
- super.hydrate();
- checkSymmetry(this.computedTransitions);
-}
-private void checkSymmetry(Map map) {
- State input1, input2, result;
- Map.Entry entry1, entry2;
- Map transition;
- Iterator transitions1 = map.entrySet().iterator(), transitions2;
- while (transitions1.hasNext()) {
- entry1 = (Map.Entry) transitions1.next();
- input1 = (State) entry1.getKey();
- transition = (Map) entry1.getValue();
- transitions2 = transition.entrySet().iterator();
- while (transitions2.hasNext()) {
- entry2 = (Map.Entry) transitions2.next();
- input2 = (State) entry2.getKey();
- result = (State) entry2.getValue();
- if (result != ((Map) map.get(input2)).get(input1) && input1.symbolic && input2.symbolic) {
- System.err.println("symmetry mismatch: " + input1 + " + " +
- input2 + " -> " + result + "/" + ((Map) map.get(input2)).get(input1));
- }
- }
- }
-}
-void mark(char truthValues[][], boolean keepRow[], boolean keepColumn[],
- int row, int column, char value) {
- truthValues[row][column] = truthValues[column][row] = value;
- keepRow[row] = true;
- keepColumn[column] = true;
- keepRow[column] = true;
- keepColumn[row] = true;
-}
-void printDefinitions(BufferedWriter output, State[] consideredStates, String tab)
- throws IOException {
- // only difference with parent is that we print only half of possible
- // combinations
- int i, j, length;
- State result;
- for (i = 0, length = consideredStates.length; i < length; i++) {
- for (j = i; j < length; j++) {
- output.write(tab);
- output.write("// ");
- output.write(consideredStates[i].name);
- output.write(" + ");
- output.write(consideredStates[j].name);
- output.write(" => ");
- output.write(
- (result = (State)
- ((Map) this.computedTransitions.get(consideredStates[i])).get(consideredStates[j])).name);
- if (!result.symbolic ||
- result != this.initializedTransitions.get(consideredStates[i])) {
- output.write("\t\t CHECK");
- }
- output.write('\n');
- }
- }
-}
-void printInitializers(BufferedWriter output, State[] consideredStates, String tab)
- throws IOException {
- // only difference with parent is that we print only half of possible
- // combinations
- int i, j, length;
- for (i = 0, length = consideredStates.length; i < length; i++) {
- for (j = i; j < length; j++) {
- output.write(tab);
- output.write('{');
- output.write(consideredStates[i].hexString);
- output.write(',');
- output.write(consideredStates[j].hexString);
- output.write(',');
- output.write(
- ((State)
- ((Map) this.computedTransitions.get(consideredStates[i])).get(consideredStates[j])).hexString);
- output.write("},");
- output.write('\n');
- }
- }
-}
-void printMissingEntries(BufferedWriter output, String tab) throws IOException {
- Iterator firsts = State.symbolicStates(), seconds;
- State first, second;
- while (firsts.hasNext()) {
- first = (State) firsts.next();
- seconds = State.symbolicStates();
- while (seconds.hasNext()) {
- second = (State) seconds.next();
- if (!checkPair(first, second)) {
- addPair(first, second);
- System.err.println("Adding missing transition for states (" + first + ", " + second + ")");
- output.write(tab);
- output.write("// ");
- output.write(first.toString());
- output.write(" + ");
- output.write(second.toString());
- output.write(" => start\t\t CHECK\n");
- }
- }
- }
-}
-private boolean checkPair(State s1, State s2) {
- Map transitions;
- if ((transitions = (Map) this.initializedTransitions.get(s1)) != null) {
- if (transitions.get(s2) != null) {
- return true;
- }
- }
- if ((transitions = (Map) this.initializedTransitions.get(s2)) != null) {
- if (transitions.get(s1) != null) {
- return true;
- }
- }
- return false;
-}
-private void addPair(State s1, State s2) {
- Map transitions;
- if ((transitions = (Map) this.initializedTransitions.get(s1)) == null) {
- transitions = new HashMap();
- this.initializedTransitions.put(s1, transitions);
- }
- transitions.put(s2, s2); // dummy, non null value
-}
-// PREMATURE factorize upward
-int test(int combinationTestsLoopsNb, boolean skipHighOrderBits) {
- Iterator transitionsSetsIterator, transitionsIterator;
- State input1, input2, expectedOutput, effectiveOutput;
- Map.Entry transition, transitionsSet;
- this.failuresNb = 0; // reset
- this.failuresNb = 0; // reset
- long start = 0;
- if (combinationTestsLoopsNb > 1) {
- start = System.currentTimeMillis();
- }
- for (int l = 0; l < combinationTestsLoopsNb ; l++) {
- transitionsSetsIterator = this.initializedTransitions.entrySet().iterator();
- while (transitionsSetsIterator.hasNext()) {
- transitionsSet = (Map.Entry) transitionsSetsIterator.next();
- input1 = (State) transitionsSet.getKey();
- transitionsIterator = ((Map) transitionsSet.getValue()).
- entrySet().iterator();
- while (transitionsIterator.hasNext()) {
- transition = (Map.Entry) transitionsIterator.next();
- input2 = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- effectiveOutput = ((UnconditionalFlowInfoTestHarness) output(
- UnconditionalFlowInfoTestHarness.testUnconditionalFlowInfo(input1),
- UnconditionalFlowInfoTestHarness.testUnconditionalFlowInfo(input2)))
- .asState();
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " instead of: " + expectedOutput.printableBitsField);
- }
- effectiveOutput = ((UnconditionalFlowInfoTestHarness) output(
- UnconditionalFlowInfoTestHarness.testUnconditionalFlowInfo(input2),
- UnconditionalFlowInfoTestHarness.testUnconditionalFlowInfo(input1)))
- .asState();
- if (effectiveOutput != expectedOutput) {
- fail();
- System.out.println("\t\t" + input2.printableBitsField +
- " + " + input1.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " instead of: " + expectedOutput.printableBitsField);
- }
- }
- }
- }
- if (combinationTestsLoopsNb > 1) {
- System.out.println(this.name + "...\t\t" + combinationTestsLoopsNb + "\t" +
- (System.currentTimeMillis() - start));
- }
- // PREMATURE optimize test (extraneous allocations and copies)
- // PREMATURE optimize test (extraneous iterations - undup)
- if (!skipHighOrderBits) {
- UnconditionalFlowInfoTestHarness
- zero = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(State.start),
- right, left64, right64, right128;
- transitionsSetsIterator = this.initializedTransitions.entrySet().iterator();
- while (transitionsSetsIterator.hasNext()) {
- transitionsSet = (Map.Entry) transitionsSetsIterator.next();
- input1 = (State) transitionsSet.getKey();
- transitionsIterator = ((Map) transitionsSet.getValue()).
- entrySet().iterator();
- while (transitionsIterator.hasNext()) {
- transition = (Map.Entry) transitionsIterator.next();
- input2 = (State) transition.getKey();
- expectedOutput = (State) transition.getValue();
- left64 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input1, 64);
- right = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input2);
- right64 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input2, 64);
- right128 = UnconditionalFlowInfoTestHarness.
- testUnconditionalFlowInfo(input2, 128);
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(left64, right64)).asState(64)) !=
- expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64, 64) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right64, left64)).asState(64)) !=
- expectedOutput) {
- fail();
- System.out.println("\t\t" + input2.printableBitsField +
- " + " + input1.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64, 64) - instead of: " + expectedOutput.printableBitsField);
- }
- if (input1 == State.start) {
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right128, right)).asState()) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 128, 1) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(zero, right64)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero, 64) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right128, right64)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 128, 64) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(zero, right128)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero, 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right64, right128)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input1.printableBitsField +
- " + " + input2.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (zero 64, 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right, right128)).asState()) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input2.printableBitsField +
- " + " + input1.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (1, zero 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right64, zero)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input2.printableBitsField +
- " + " + input1.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64, zero) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right64, right128)).asState(64)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input2.printableBitsField +
- " + " + input1.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (64, zero 128) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right128, zero)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input2.printableBitsField +
- " + " + input1.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (128, zero) - instead of: " + expectedOutput.printableBitsField);
- }
- if ((effectiveOutput = ((UnconditionalFlowInfoTestHarness)
- output(right128, right64)).asState(128)) != expectedOutput) {
- fail();
- System.out.println("\t\t" + input2.printableBitsField +
- " + " + input1.printableBitsField +
- " => " + effectiveOutput.printableBitsField +
- " (128, zero 64) - instead of: " + expectedOutput.printableBitsField);
- }
- }
- }
- }
- }
- return this.failuresNb;
-}
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceTest.java
deleted file mode 100644
index 8e8ef7f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceTest.java
+++ /dev/null
@@ -1,8710 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import junit.framework.Test;
-
-/* See also NullReferenceImplTests for low level, implementation dependent
- * tests. */
-public class NullReferenceTest extends AbstractRegressionTest {
-
-public NullReferenceTest(String name) {
- super(name);
-}
-
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- // Only the highest compliance level is run; add the VM argument
- // -Dcompliance=1.4 (for example) to lower it if needed
- static {
-// TESTS_NAMES = new String[] { "test011" };
-// TESTS_NUMBERS = new int[] { 561 };
-// TESTS_NUMBERS = new int[] { 2999 };
-// TESTS_RANGE = new int[] { 2050, -1 };
-// TESTS_RANGE = new int[] { 1, 2049 };
-// TESTS_RANGE = new int[] { 449, 451 };
-// TESTS_RANGE = new int[] { 900, 999 };
- }
-
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public static Class testClass() {
- return NullReferenceTest.class;
-}
-
-// Augment problem detection settings
-protected Map getCompilerOptions() {
- Map defaultOptions = super.getCompilerOptions();
-// defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING);
- defaultOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR);
- defaultOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
-// defaultOptions.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.WARNING);
- return defaultOptions;
-}
-
-// null analysis -- simple case for local
-public void test0001_simple_local() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- simple case for field
-// the current design leaves fields out of the analysis altogether
-public void test0002_simple_field() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo() {\n" +
- " o = null;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 5)\n" +
-// " o.toString();\n" +
-// " ^\n" +
-// "The field o is likely null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- simple case for parameter
-public void test0003_simple_parameter() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o = null;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- final local
-public void test0004_final_local() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " final Object o = null;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- final local
-public void test0005_final_local() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " final Object o;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The local variable o may not have been initialized\n" +
- // hides the null related message, but complains once, which is good
- "----------\n");
-}
-
-// null analysis -- final local
-public void test0006_final_local() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " final Object o = null;\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- local with member
-public void test0007_local_with_member() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m;\n" +
- " void foo() {\n" +
- " X x = null;\n" +
- " x.m.toString();\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x.m.toString();\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- local with member
-public void test0008_local_with_member() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m;\n" +
- " void foo() {\n" +
- " X x = null;\n" +
- " System.out.println(x.m);\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " System.out.println(x.m);\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- local with member
-public void test0009_local_with_member() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m;\n" +
- " void foo(X x) {\n" +
- " x.m.toString();\n" + // quiet
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- field
-public void test0010_field_with_method_call() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo() {\n" +
- " o = null;\n" +
- " bar();\n" + // defuses null by side effect
- " o.toString();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- field
-public void test0011_field_with_method_call() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static Object o;\n" +
- " void foo() {\n" +
- " o = null;\n" +
- " bar();\n" + // defuses null by side effect
- " o.toString();\n" +
- " }\n" +
- " static void bar() {\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- field
-public void test0012_field_with_method_call() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo() {\n" +
- " o = null;\n" +
- " bar();\n" +
- " o.toString();\n" +
- " }\n" +
- " static void bar() {\n" +
- " }\n" +
- "}\n"},
- "" // still ok because the class may hold a pointer to this
- );
-}
-
-// null analysis -- field
-public void test0013_field_with_method_call() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static Object o;\n" +
- " void foo() {\n" +
- " o = null;\n" +
- " bar();\n" +
- " o.toString();\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n"},
- "" // still ok because this may place a static call upon X
- );
-}
-
-// null analysis -- field
-public void test0014_field_with_explicit_this_access() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo() {\n" +
- " o = null;\n" +
- " this.o.toString();\n" +
- " }\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 5)\n" +
-// " this.o.toString();\n" +
-// " ^^^^^^\n" +
-// "The field o is likely null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- field
-public void test0015_field_with_explicit_this_access() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo() {\n" +
- " this.o = null;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 5)\n" +
-// " o.toString();\n" +
-// " ^\n" +
-// "The field o is likely null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- field
-public void test0016_field_of_another_object() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo() {\n" +
- " X other = new X();\n" +
- " other.o = null;\n" +
- " other.o.toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- field
-public void test0017_field_of_another_object() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo() {\n" +
- " X other = this;\n" +
- " o = null;\n" +
- " other.o.toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- field
-public void test0018_field_of_enclosing_object() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " public class Y {\n" +
- " void foo() {\n" +
- " X.this.o = null;\n" +
- " X.this.o.toString();\n" + // complain
- " }\n" +
- " }\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 6)\n" +
-// " X.this.o.toString();\n" +
-// " ^^^^^^^^\n" +
-// "The field o is likely null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- fields
-// check that fields that are protected against concurrent access
-// behave as locals when no call to further methods can affect them
-public void test0019_field_synchronized() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " public synchronized void foo() {\n" +
- " o = null;\n" +
- " o.toString();\n" +
- " }\n" +
- " void bar() {/* */}\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 5)\n" +
-// " o.toString();\n" +
-// " ^\n" +
-// "The field o is likely null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- field
-// check that final fields behave as locals despite calls to further
-// methods
-public void test0020_final_field() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " final Object o = null;\n" +
- " public synchronized void foo() {\n" +
- " bar();\n" +
- " o.toString();\n" +
- " }\n" +
- " void bar() {/* */}\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 5)\n" +
-// " o.toString();\n" +
-// " ^\n" +
-// "The field o is likely null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- field
-public void test0021_final_field() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " final Object o = null;\n" +
- " X () {\n" +
- " bar();\n" +
- " o.toString();\n" +
- " }\n" +
- " void bar() {/* */}\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 5)\n" +
-// " o.toString();\n" +
-// " ^\n" +
-// "The field o is likely null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- field
-public void test0022_final_field() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " final Object o = new Object();\n" +
- " X () {\n" +
- " bar();\n" +
- " if (o == null) { /* empty */ }\n" +
- " }\n" +
- " void bar() {/* */}\n" +
- "}\n"},
- ""
-// "----------\n" +
-// "1. ERROR in X.java (at line 5)\n" +
-// " if (o == null) { /* empty */ }\n" +
-// " ^\n" +
-// "The field o is likely non null; it was either set to a non-null value or assumed to be non-null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis -- field
-public void test0023_field_assignment() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m;\n" +
- " void foo(X x) {\n" +
- " Object o = x.m;\n" +
- " if (o == null) { /* */ };\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- field
-public void test0024_field_cast_assignment() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m;\n" +
- " void foo(Object x) {\n" +
- " Object o = ((X) x).m;\n" +
- " if (o == null) { /* */ };\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- parameter
-public void test0025_parameter() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o.toString();\n" + // quiet: parameters have unknown value
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- suppress warnings
-public void test0026_suppress_warnings() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- Map compilerOptions = getCompilerOptions();
- compilerOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.WARNING);
- this.runConformTest(
- new String[] {
- "X.java",
- "@SuppressWarnings(\"null\")\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "", null, true, null, compilerOptions, null);
- }
-}
-
-// null analysis -- embedded comparison
-public void test0027_embedded_comparison() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " boolean b = o != null;\n" + // shades doubts upon o
- " if (b) { /* */ }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- field
-public void test0028_field_as_initializer() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X f;\n" +
- " void foo() {\n" +
- " X x = f;\n" +
- " if (x == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- field
-public void test0029_field_assignment() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m;\n" +
- " void foo() {\n" +
- " X x = null;\n" +
- " x.m = new Object();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x.m = new Object();\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- conditional expression
-public void test0030_conditional_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = true ? null : null;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- conditional expression
-public void test0031_conditional_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = true ? null : new Object();\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- conditional expression
-public void test0032_conditional_expression() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = false ? null : new Object();\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- conditional expression
-public void test0033_conditional_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = (1 == 1) ? null : new Object();\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- conditional expression
-// TODO (maxime) fix - may consider simultaneous computation of expression null status
-// this case is one of those which raise the need for the simultaneous calculation of
-// the null status of an expression and the code analysis of the said expression; this
-// case is simplistic: we need a value (here, potentially null), that is *not* carried
-// by the current embodiment of the flow info; other cases are less trivial in which
-// side effects on variables could introduce errors into after the facts evaluations;
-// one possible trick would be to add a slot for this
-// other path: use a tainted unknown expression status; does not seem to cope well
-// with o = (o == null ? new Object() : o)
-// TODO (maxime) https://bugs.eclipse.org/bugs/show_bug.cgi?id=133125
-public void _test0034_conditional_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b;\n" +
- " void foo() {\n" +
- " Object o = b ? null : new Object();\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- conditional expression
-public void test0035_conditional_expression() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b;\n" +
- " void foo() {\n" +
- " Object o = b ? null : new Object();\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- conditional expression
-public void test0036_conditional_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b;\n" +
- " void foo() {\n" +
- " Object o = b ? null : null;\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- autoboxing
-public void test0040_autoboxing_compound_assignment() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Integer i = null;\n" +
- " i += 1;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " i += 1;\n" +
- " ^\n" +
- "The variable i can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- autoboxing
-public void test0041_autoboxing_increment_operator() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Integer i = null;\n" +
- " i++;\n" + // complain: this is null
- " ++i;\n" + // quiet (because previous step guards it)
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " i++;\n" +
- " ^\n" +
- "The variable i can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- autoboxing
-public void test0042_autoboxing_literal() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Integer i = 0;\n" +
- " if (i == null) {};\n" + // complain: this is non null
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (i == null) {};\n" +
- " ^\n" +
- "The variable i cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- autoboxing
-public void test0043_autoboxing_literal() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Integer i = null;\n" +
- " System.out.println(i + 4);\n" + // complain: this is null
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " System.out.println(i + 4);\n" +
- " ^\n" +
- "The variable i can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- autoboxing
-// origin: AssignmentTest#test020
-public void test0044_autoboxing() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " int i = 0;\n" +
- " boolean b = i < 10;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- autoboxing
-// variant of 42 for
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165346
-public void test0045_autoboxing_operator() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " int j = 5;" +
- " Integer i = 0 + j;\n" +
- " if (i == null) {}\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (i == null) {}\n" +
- " ^\n" +
- "The variable i cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- array
-public void test0050_array() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " args = new String[] {\"zero\"};\n" +
- " args[0] = null;\n" +
- " if (args[0] == null) {};\n" +
- // quiet: we don't keep track of all array elements
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- array
-public void test0051_array() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " args = null;\n" +
- " args[0].toString();\n" + // complain: args is null
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " args[0].toString();\n" +
- " ^^^^\n" +
- "The variable args can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- array
-public void test0052_array() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(String args[]) {\n" +
- " String s = args[0];\n" +
- " if (s == null) {};\n" +
- // quiet: we don't keep track of all array elements
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- array
-public void test0053_array() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(String args[]) {\n" +
- " for (int i = 0; i < args.length; i++) { /* */}\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- method call
-public void test0061_method_call_guard() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o.toString();\n" + // guards o from being null
- " if (o == null) {};\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) {};\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - method call
-public void test0062_method_call_isolation() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (bar(o = null)) {\n" +
- " if (o == null) {/* empty */}\n" + // complain
- " }\n" +
- " }\n" +
- " boolean bar(Object o) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) {/* empty */}\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - method call
-public void test0063_method_call_isolation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (bar(o == null ? new Object() : o)) {\n" +
- " if (o == null) {/* empty */}\n" + // quiet
- " }\n" +
- " }\n" +
- " boolean bar(Object o) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis - method call
-public void test0064_method_call_isolation() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (bar(o = new Object())) {\n" +
- " if (o == null) {/* empty */}\n" + // complain
- " }\n" +
- " }\n" +
- " boolean bar(Object o) {\n" +
- " return true;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) {/* empty */}\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - method call
-public void test0065_method_call_invocation_target() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " (o = new Object()).toString();\n" + // quiet
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis - method call
-public void test0066_method_call_invocation_target() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " (o = null).toString();\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " (o = null).toString();\n" +
- " ^^^^^^^^^^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - method call
-public void test0067_method_call_invocation_target() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " (o = new Object()).toString();\n" + // quiet
- " if (o == null) { /* */ }\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - method call
-public void test0068_method_call_assignment() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- " void foo(X x) {\n" +
- " x = x.bar();\n" +
- " if (x == null) { /* */ }\n" + // quiet
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- type reference
-public void test0070_type_reference() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " Class c = java.lang.Object.class;\n" +
- " if (c == null) {};\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (c == null) {};\n" +
- " ^\n" +
- "The variable c cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-public void test0080_shortcut_boolean_expressions() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1, Object o2) {\n" +
- " if (o1 != null && (o2 = o1) != null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (o1 != null && (o2 = o1) != null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "The variable o2 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n"
- );
-}
-
-public void test0081_shortcut_boolean_expressions() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1, Object o2) {\n" +
- " while (o1 != null && (o2 = o1) != null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " while (o1 != null && (o2 = o1) != null) { /* */ }\n" +
- " ^^^^^^^^^\n" +
- "The variable o2 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n"
- );
-}
-
-// null analysis - shortcut boolean expression
-public void test0082_shortcut_boolean_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null || o == null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (o == null || o == null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - shortcut boolean expression
-public void test0083_shortcut_boolean_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null && o == null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (o == null && o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - shortcut boolean expression
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=130311
-public void test0084_shortcut_boolean_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean foo(Integer i1, Integer i2) {\n" +
- " return (i1 == null && i2 == null)\n" +
- " || (i1.byteValue() == i2.byteValue());\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " || (i1.byteValue() == i2.byteValue());\n" +
- " ^^\n" +
- "The variable i1 may be null\n" +
- "----------\n");
-}
-
-// null analysis - shortcut boolean expression
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=130311
-public void test0085_shortcut_boolean_expression() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean foo(Integer i1, Integer i2) {\n" +
- " return (i1 == null & i2 == null)\n" +
- " || (i1.byteValue() == i2.byteValue());\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " || (i1.byteValue() == i2.byteValue());\n" +
- " ^^\n" +
- "The variable i1 may be null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " || (i1.byteValue() == i2.byteValue());\n" +
- " ^^\n" +
- "The variable i2 may be null\n" +
- "----------\n");
-}
-
-// null analysis -- instanceof
-// JLS: instanceof returns false if o turns out to be null
-public void test0090_instanceof() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo (Object o) {\n" +
- " if (dummy) {\n" +
- " o = null;\n" +
- " }\n" +
- " if (o instanceof X) { /* */ }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- instanceof
-public void test0091_instanceof() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo (Object o) {\n" +
- " if (dummy) {\n" +
- " o = null;\n" +
- " }\n" +
- " if (o instanceof X) { /* */ }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- instanceof
-// can only be null always yields false
-public void test0092_instanceof() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo () {\n" +
- " Object o = null;\n" +
- " if (o instanceof X) { /* */ }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o instanceof X) { /* */ }\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- instanceof
-public void test0093_instanceof() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object x) {\n" +
- " if (x instanceof X) {\n" +
- " if (x == null) { /* */ }\n" + // cannot happen
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (x == null) { /* */ }\n" +
- " ^\n" +
- "The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- instanceof
-public void test0094_instanceof() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object x) {\n" +
- " if (x instanceof X) {\n" +
- " return;\n" +
- " }\n" +
- " if (x != null) { /* */ }\n" +
- // cannot decide: could be null of new Object() for example
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- instanceof combined with conditional or
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=145202
-public void test0095_instanceof_conditional_or() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object x) {\n" +
- " if (! (x instanceof String)\n" +
- " || x == null) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " || x == null) {\n" +
- " ^\n" +
- "The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- strings concatenation
-// JLS 15.18.1: if one of the operands is null, it is replaced by "null"
-// Note: having the diagnostic could come handy when the initialization path
-// is non trivial; to get the diagnostic, simply put in place an
-// extraneous call to toString() -- and remove it before releasing.
-public void test0120_strings_concatenation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String foo(String s1, String s2) {\n" +
- " if (s1 == null) { /* */ };\n" +
- " return s1 + s2;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- strings concatenation
-public void test0121_strings_concatenation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String foo(String s1, String s2) {\n" +
- " if (s1 == null) { /* */ };\n" +
- " s1 += s2;\n" +
- " return s1;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- strings concatenation
-public void test0122_strings_concatenation() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String foo(String s1) {\n" +
- " if (s1 == null) { /* */ };\n" +
- " return s1.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " return s1.toString();\n" +
- " ^^\n" +
- "The variable s1 may be null\n" +
- "----------\n");
-}
-
-// null analysis -- strings concatenation
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127919
-// it should suffice that the return type is String to avoid
-// errors
-public void test0123_strings_concatenation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String foo(String s, Object o, Integer i) {\n" +
- " if (s == null || o == null || i == null) { /* */ };\n" +
- " if (bar()) {\n" +
- " return s + i;\n" + // quiet: i replaced by "null" if null
- " }\n" +
- " return o + s;\n" + // quiet: o replaced by "null" if null
- " }\n" +
- " boolean bar() {\n" +
- " return false;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- strings concatenation
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127919
-// variant
-public void test0124_strings_concatenation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String foo(String s, Object o, Integer i) {\n" +
- " if (s == null || o == null || i == null) { /* */ };\n" +
- " s += o;\n" + // quiet: o replaced by "null" if null
- " s += i;\n" + // quiet: i replaced by "null" if null
- " return s;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- strings concatenation
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127919
-// variant
-public void test0125_strings_concatenation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, Integer i) {\n" +
- " System.out.println(o + (o == null ? \"\" : o.toString()));\n" + // quiet: o replaced by "null" if null
- " System.out.println(i + (i == null ? \"\" : i.toString()));\n" + // quiet: o replaced by "null" if null
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- strings concatenation
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=132867
-public void test0126_strings_concatenation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " System.out.println(o + \"\");\n" +
- " if (o != null) { /* */ };\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- strings concatenation
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=132867
-public void test0127_strings_concatenation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " System.out.println(o + \"\");\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- if/else
-// check that obviously unreachable code does not modify the null
-// status of a local
-// the said code is not marked as unreachable per JLS 14.21 (the rationale
-// being the accommodation for the if (constant_flag_evaluating_to_false)
-// {code...} volontary code exclusion pattern)
-public void test0300_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo() {\n" +
- " Object o = null;\n" +
- " if (false) {\n" +
- " o = new Object();\n" + // skipped
- " }\n" +
- " if (true) {\n" +
- " //\n" +
- " }\n" +
- " else {\n" +
- " o = new Object();\n" + // skipped
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0301_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " if (o != null) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0302_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) throws Exception {\n" +
- " if (o == null) {\n" +
- " throw new Exception();\n" +
- " }\n" +
- " if (o != null) {\n" + // only get there if o non null
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0303_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null) {\n" +
- " return;\n" +
- " }\n" +
- " if (o != null) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0304_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0305_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null) {\n" +
- " // do nothing\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0306_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o.toString().equals(\"\")) {\n" +
- " if (o == null) {\n" + // complain: could not get here
- " // do nothing\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0307_if_else() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null) {\n" +
- " System.exit(0);\n" +
- " }\n" +
- " if (o == null) {\n" +
- // quiet
- // a direct call to System.exit() can be recognized as such; yet,
- // a lot of other methods may have the same property (aka calling
- // System.exit() themselves.)
- " // do nothing\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis - if/else
-public void test0308_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b;\n" +
- " void foo(Object o) {\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0309_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b1, b2;\n" +
- " void foo(Object o) {\n" +
- " if (b1) {\n" +
- " o = null;\n" +
- " }\n" +
- " if (b2) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0310_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b1, b2;\n" +
- " void foo(Object o) {\n" +
- " if (b1) {\n" +
- " o = null;\n" +
- " }\n" +
- " if (b2) {\n" +
- " o.toString();\n" + // complain
- " o.toString();\n" + // silent
- " }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0311_if_else() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null)\n" +
- " o = new Object();\n" +
- " o.toString();\n" + // quiet
- " }\n" +
- "}" },
- "");
-}
-
-// null analysis - if/else
-public void test0312_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " if (o == null) { /* */ }\n" + // complain
- " if (o != null) { /* */ }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0313_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null) {\n" + // quiet
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- // complain: o set to non null iff it was null
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0314_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o != null) {\n" + // quiet
- " o = null;\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0315_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o != null) {\n" + // quiet
- " o = null;\n" +
- " }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0316_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (o == null || b) { /* */ }\n" + // quiet
- " else { /* */ }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0317_if_else_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (o != null) {\n" + // quiet
- " if (b) {\n" + // quiet
- " o = null;\n" +
- " }\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" + // quiet
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-public void test0318_if_else_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (o != null) {\n" + // quiet
- " if (b) {\n" + // quiet
- " o = null;\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" + // quiet
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-// we do nothing to diagnose the contents of fake reachable code
-public void test0319_if_else_dead_branch() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (false) {\n" +
- " o = null;\n" +
- " if (o == null) { /* */ }\n" + // may have considered complaining here
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-public void test0320_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o.toString();\n" +
- " if (o == null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0321_if_else() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " Object other = new Object();\n" +
- " if (b) {\n" +
- " other = o;\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" + // quiet
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-public void test0322_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " o.toString();\n" +
- " if (b) { /* */ }\n" +
- " if (o == null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0323_if_else() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (o == null && b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" + // quiet
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-public void test0324_if_else_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo (boolean b) {\n" +
- " String s = null;\n" +
- " if (b) {\n" +
- " if (b) {\n" +
- " s = \"1\";\n" +
- " } \n" +
- " else {\n" +
- " s = \"2\";\n" +
- " }\n" +
- " } \n" +
- " else if (b) {\n" +
- " s = \"3\"; \n" +
- " } \n" +
- " else {\n" +
- " s = \"4\";\n" +
- " }\n" +
- " s.toString();\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-public void test0325_if_else_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo (boolean b) {\n" +
- " String s = null;\n" +
- " if (b) {\n" +
- " if (b) {\n" +
- " s = \"1\";\n" +
- " } \n" +
- " else {\n" +
- " s = \"2\";\n" +
- " }\n" +
- " } \n" +
- " else if (b) {\n" +
- " if (b) {\n" +
- " s = \"3\"; \n" +
- " }\n" +
- " } \n" +
- " else {\n" +
- " s = \"4\";\n" +
- " }\n" +
- " s.toString();\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " s.toString();\n" +
- " ^\n" +
- "The variable s may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-// limit: we cannot sync on external factors, even if this is a pattern
-// that is quite used
-public void test0326_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo (boolean b) {\n" +
- " String s1 = null;\n" +
- " if (b) {\n" +
- " s1 = \"1\";\n" +
- " }\n" +
- " s1.toString();\n" + // complain: can't guess if b means anything for s1 init
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " s1.toString();\n" +
- " ^^\n" +
- "The variable s1 may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-// limit: we cannot sync on external factors, even if this is a pattern
-// that is quite used
-public void test0327_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo (String s1) {\n" +
- " String s2 = null;\n" +
- " if (s1 == null) {\n" +
- " s1 = \"1\";\n" +
- " s2 = \"2\";\n" +
- " }\n" +
- " s1.toString();\n" + // quiet
- " s2.toString();\n" + // complain: can't guess whether s2 depends on s1 for init
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " s2.toString();\n" +
- " ^^\n" +
- "The variable s2 may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0328_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (o != null || b) {\n" +
- " if (b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" + // quiet
- " else { /* */ }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0329_if_else_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (b) {\n" +
- " if (o != null) { /* */ }\n" + // shade doubts on o
- " }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-public void test0330_if_else_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (b) {\n" +
- " if (o == null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " o.toString();\n" + // quiet
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-public void test0331_if_else_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1, Object o2) {\n" +
- " Object o3 = o2;\n" +
- " if (o1 != null) {\n" +
- " o3.toString(); // guards o3\n" +
- " }\n" +
- " o1 = o3;\n" +
- " if (o1 != null) { /* */ }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - if/else
-public void test0332_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " o = new Object();\n" +
- " if (b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128014
-// invalid analysis when redundant check is done
-public void test0333_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o = new Object();\n" +
- " if (o != null) {\n" + // complain
- " o.toString();\n" +
- " }\n" +
- " o.toString();\n" + // quiet asked
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128014
-// invalid analysis when redundant check is done - variant
-public void test0334_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o = new Object();\n" +
- " if (o != null) {\n" + // complain
- " o.toString();\n" +
- " }\n" +
- " else {\n" +
- " o.toString();\n" + // must complain anyway (could be quite distant from the if test)
- " }\n" +
- " o.toString();\n" + // quiet
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-// TODO (maxime) https://bugs.eclipse.org/bugs/show_bug.cgi?id=129581
-// this is a limit of the fix for bug 128014 - calls for a nuance
-// between potential null and tainted null
-public void _test0335_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o != null) {\n" +
- " if (o != null) {\n" + // complain
- " o.toString();\n" +
- " }\n" +
- " o.toString();\n" + // quiet
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128014
-// invalid analysis when redundant check is done - variant
-public void test0336_if_else() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o != null) {\n" +
- " if (o != null) {\n" + // complain
- " o.toString();\n" +
- " }\n" +
- " else {\n" +
- " o.toString();\n" + // must complain anyway (could be quite distant from the if test)
- " }\n" +
- " o.toString();\n" + // quiet
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-
-// null analysis - if/else nested with correlation
-// reconsider if we implement correlation
-// TODO (maxime) https://bugs.eclipse.org/bugs/show_bug.cgi?id=128861
-public void _test0337_if_else_nested_correlation() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public int foo (Object o1, Object o2) {\n" +
- " int result = 0;\n" +
- " if (o1 == null && o2 != null) {\n" +
- " result = -1;\n" +
- " } else {\n" +
- " if (o1 == null && o2 == null) {\n" +
- " result = 0;\n" +
- " } else {\n" +
- " if (o1 != null && o2 == null) {\n" +
- " result = 1;\n" +
- " } else {\n" +
- " int lhs = ((Y) o1).foo(); // may be null\n" +
- " int rhs = ((Y) o2).foo();\n" +
- " result = lhs - rhs;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "}\n" +
- "abstract class Y {\n" +
- " abstract int foo();\n" +
- "}\n" +
- "\n"},
- "");
-}
-
-// null analysis - if/else nested with correlation
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128861
-// workaround
-public void test0338_if_else_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public int foo (Object o1, Object o2) {\n" +
- " int result = 0;\n" +
- " if (o1 == null && o2 == null) {\n" +
- " result = 0;\n" +
- " } else {\n" +
- " if (o1 == null) {\n" +
- " result = -1;\n" +
- " } else {\n" +
- " if (o2 == null) {\n" +
- " result = 1;\n" +
- " } else {\n" +
- " int lhs = ((Y) o1).foo();\n" +
- " int rhs = ((Y) o2).foo();\n" +
- " result = lhs - rhs;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "}\n" +
- "abstract class Y {\n" +
- " abstract int foo();\n" +
- "}\n" +
- "\n"},
- "");
-}
-
-// null analysis - if/else nested with unknown protection: unknown cannot protect
-public void test0339_if_else_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (o == null || b) {\n" +
- " if (bar() == o) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " Object bar() {\n" +
- " return new Object();\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else nested
-public void test0340_if_else_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " if (o == null) {\n" +
- " if (bar() == o) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " Object bar() {\n" +
- " return new Object();\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - if/else nested
-public void test0341_if_else_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1, Object o2, boolean b) {\n" +
- " if (o1 == null || b) {\n" +
- " if (o1 == o2) {\n" +
- " o1.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o1.toString();\n" +
- " ^^\n" +
- "The variable o1 may be null\n" +
- "----------\n");
-}
-
-// null analysis - if/else nested
-public void test0342_if_else_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1, Object o2, boolean b) {\n" +
- " if (o1 == null || b) {\n" +
- " if (o2 == o1) {\n" +
- " o1.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o1.toString();\n" +
- " ^^\n" +
- "The variable o1 may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0401_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (o.toString() != null) {/* */}\n" +
- // complain: NPE
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " while (o.toString() != null) {/* */}\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0402_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (o != null) {/* */}\n" +
- // complain: get o null first time and forever
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " while (o != null) {/* */}\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0403_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (o == null) {\n" +
- // quiet: first iteration is sure to find o null,
- // but other iterations may change it
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0404_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (o == null) {\n" +
- // quiet: first iteration is sure to find o null,
- // but other iterations may change it
- " if (System.currentTimeMillis() > 10L) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0405_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bar() {\n" +
- " return true;\n" +
- " }\n" +
- " void foo(Object o) {\n" +
- " while (bar() && o == null) {\n" +
- " o.toString();\n" + // complain: NPE
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0406_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo(Object o) {\n" +
- " o = null;\n" +
- " while (dummy || o != null) { /* */ }\n" + // o can only be null
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " while (dummy || o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0407_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " o.toString();\n" + // complain: NPE on first iteration
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-// this test shows that, as long as we do not explore all possible
-// paths, we have to take potential initializations into account
-// even in branches that could be pruned in the first passes
-// first approximation is to stop pruning code conditioned by
-// variables
-// second approximation could still rely upon variables that are
-// never affected by the looping code (unassigned variables)
-// complete solution would call for multiple iterations in the
-// null analysis
-public void test0408_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null,\n" +
- " u = new Object(),\n" +
- " v = new Object();\n" +
- " while (o == null) {\n" +
- " if (v == null) {\n" +
- " o = new Object();\n" +
- " };\n" +
- " if (u == null) {\n" +
- " v = null;\n" +
- " };\n" +
- " u = null;\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0409_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (dummy || (o = new Object()).equals(o)) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0410_while_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " while (o != null) {\n" +
- " o.toString();\n" +
- " }\n" +
- " if (System.currentTimeMillis() > 10L) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0411_while_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null,\n" +
- " u = new Object(),\n" +
- " v = new Object();\n" +
- " while (o == null) {\n" +
- " if (v == null) {\n" +
- " o = new Object();\n" +
- " };\n" +
- " while (o == null) {\n" +
- " if (u == null) {\n" +
- " v = null;\n" +
- " };\n" +
- " u = null;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0412_while_if_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy, other;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " if (other) {\n" +
- " o.toString();\n" +
- " }\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0413_while_unknown_field() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object o;\n" +
- " void foo(boolean dummy) {\n" +
- " while (dummy) {\n" +
- " o = null;\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0414_while_unknown_parameter() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo(Object o) {\n" +
- " while (dummy) {\n" +
- " o = null;\n" + // quiet: first iteration doesn't know
- " }\n" +
- " o.toString();\n" + // complain: only get out of the loop with null
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0415_while_unknown_if_else() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " if (dummy) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " while (dummy) {\n" +
- // limit of the analysis: we do not correlate if and while conditions
- " if (o == null) {/* */}\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0416_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0417_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (dummy) { /* */ }\n" + // doesn't affect o
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-// origin AssignmentTest.testO22
-public void test0418_while_try() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bool() { return true; }\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (bool()) {\n" +
- " try {\n" +
- " if (o == null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " } finally { /* */ }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- while
-public void test0419_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bool;\n" +
- " void foo(Object o) {\n" +
- " while (bool) {\n" +
- " o.toString();" + // complain NPE because of second iteration
- " o = null;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o.toString(); o = null;\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0420_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bool;\n" +
- " void foo(Object compare) {\n" +
- " Object o = new Object();\n" +
- " while ((o = null) == compare) {\n" +
- " if (true) {\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" + // complain can only be null
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0421_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bool;\n" +
- " void foo(Object compare) {\n" +
- " Object o = null;\n" +
- " while (bool) {\n" +
- " o = new Object();\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- while
-public void test0422_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bool;\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " while (bool) {\n" +
- " o = new Object();\n" +
- " if (o == null) { /* */ }\n" +
- " o = null;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0423_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bool;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (bool) {\n" +
- " o = new Object();\n" +
- " if (o == null) { /* */ }\n" +
- " o = null;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0424_while_try() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = null;\n" +
- " while (o == null) {\n" +
- // quiet: first iteration is sure to find o null,
- // but other iterations may change it
- " try { /* */ }\n" +
- " finally {\n" +
- " if (b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- while
-public void test0425_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo(Object u) {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " o = u;\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0426_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo(Object o) {\n" +
- " o.toString();\n" +
- " while (dummy) { /* */ }\n" +
- " if (o == null) { /* */ }\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- while
-public void test0427_while_return() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " if (o == null) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-public void test0428_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- " void foo(X x) {\n" +
- " x.bar();\n" +
- " while (x != null) {\n" +
- " x = x.bar();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis - while
-public void test0429_while_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo (X[] xa) {\n" +
- " while (dummy) {\n" +
- " xa = null;\n" +
- " if (dummy) {\n" +
- " xa = new X[5];\n" +
- " }\n" +
- " if (xa != null) {\n" +
- " int i = 0;\n" +
- " while (dummy) {\n" +
- " X x = xa[i++];\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0430_while_for_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo (X[] xa) {\n" +
- " while (dummy) {\n" +
- " xa = null;\n" +
- " if (dummy) {\n" +
- " xa = new X[5];\n" +
- " }\n" +
- " if (xa != null) {\n" +
- " for (int i = 0; i < xa.length; i++) {\n" +
- " X x = xa[i];\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0431_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo (X x) {\n" +
- " x = null;\n" +
- " while (dummy) {\n" +
- " x = bar();\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0432_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo (X x) {\n" +
- " while (dummy) {\n" +
- " x = bar();\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0433_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean dummy;\n" +
- " void foo (X x) {\n" +
- " x = null;\n" +
- " while (dummy) {\n" +
- " x.toString();\n" + // complain and protect
- " x.toString();\n" + // quiet
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " x.toString();\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-// this one shows that we cannot project definitely unknown onto potentially unknown too soon
-public void test0434_while_switch_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " Object bar() {\n" +
- " return new Object();\n" +
- " }\n" +
- " void foo(boolean b, int selector) {\n" +
- " Object o = null;\n" +
- " while (b) {\n" +
- " switch (selector) {\n" +
- " case 0:\n" +
- " o = bar();\n" +
- " if (o != null) { \n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0435_while_init() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " int f1;\n" +
- " X f2;\n" +
- " void foo(X x1, boolean b) {\n" +
- " X x2;\n" +
- " x2 = x1;\n" +
- " while (b) {\n" +
-// " if (x2.f1 > 0) { /* */ }\n" +
- " if (x2.toString().equals(\"\")) { /* */ }\n" +
- " x2 = x2.f2;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0436_while_init() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " int f1;\n" +
- " X f2;\n" +
- " void foo(X x1, boolean b) {\n" +
- " X x2 = x1;\n" +
- " while (b) {\n" +
- " if (x2.f1 > 0) { /* */ }\n" +
- " x2 = x2.f2;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0437_while_exit() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = null;\n" +
- " while (b) {\n" +
- " if (b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o != null) {\n" +
- " throw new RuntimeException(); \n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-
-// null analysis - while
-public void test0438_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object o) {\n" +
- " while (o == null) { /* */ }\n" +
- " o.toString();\n" + // quiet
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-public void test0439_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object o) {\n" +
- " while (o == null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " o.toString();\n" + // quiet
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0440_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object o) {\n" +
- " while (o == null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-public void test0441_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " X bar() {\n" +
- " return new X();\n" +
- " }\n" +
- " void foo(Object o) {\n" +
- " while (o == null) {\n" +
- " o = bar();\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-public void test0442_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " boolean bar() {\n" +
- " return true;\n" +
- " }\n" +
- " void foo(Object o) {\n" +
- " while (o == null && bar()) { /* */ }\n" +
- " o.toString();\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - while
-public void test0443_while_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " ext: for (int i = 0; i < 5 ; i++) {\n" +
- " if (o != null) {\n" +
- " break;\n" +
- " }\n" +
- " o = new Object();\n" +
- " int j = 0;\n" +
- " while (j++ < 2) {\n" +
- " continue ext;\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0444_while_deeply_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = null;\n" +
- " ext: for (int i = 0; i < 5 ; i++) {\n" +
- " if (o != null) {\n" +
- " break;\n" +
- " }\n" +
- " do {\n" +
- " o = new Object();\n" +
- " int j = 0;\n" +
- " while (j++ < 2) {\n" +
- " continue ext;\n" +
- " }\n" +
- " } while (b);\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0445_while_deeply_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = null;\n" +
- " ext: for (int i = 0; i < 5 ; i++) {\n" +
- " if (o != null) {\n" +
- " break;\n" +
- " }\n" +
- " do {\n" +
- " // o = new Object();\n" +
- " int j = 0;\n" +
- " while (j++ < 2) {\n" +
- " continue ext;\n" +
- " }\n" +
- " } while (b);\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-public void test0446_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " while (o == null || b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-public void test0447_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " while (o == null & b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0448_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(boolean b[]) {\n" +
- " Object o = null;\n" +
- " ext: for (int i = 0; i < 5 ; i++) {\n" +
- " if (o != null) {\n" +
- " break;\n" +
- " }\n" +
- " while (b[1]) {\n" +
- " continue ext;\n" +
- " }\n" +
- " while (b[2]) {\n" +
- " continue ext;\n" +
- " }\n" +
- " while (b[3]) {\n" +
- " continue ext;\n" +
- " }\n" +
- " while (b[4]) {\n" +
- " continue ext;\n" +
- " }\n" +
- " while (b[5]) {\n" +
- " continue ext;\n" +
- " }\n" +
- " while (b[6]) {\n" +
- " continue ext;\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o != null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-// this series (up to 451) shows that the merge of the states
-// potential non null and potential unknown yields damages in
-// case of nested loops (unested loops still OK because we can
-// carry the definite non null property)
-public void test0449_while_nested() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object p, boolean b) {\n" +
- " Object o = new Object();\n" +
- " while (b) {\n" +
- " while (b) {\n" +
- " o = p;\n" + // now o is unknown
- " }\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-public void test0450_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = new Object();\n" +
- " while (b) {\n" +
- " o = new Object();\n" + // o still non null
- " }\n" +
- " if (o != null) { /* */ }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=133131
-public void test0451_while_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = new Object();\n" +
- " while (b) {\n" +
- " while (b) {\n" +
- " o = new Object();\n" + // o still non null
- " }\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123399
-// variant - the bug is not specific to the do while loop
-public void _test0452_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object doubt) {\n" +
- " Object o = null;\n" +
- " while (true) {\n" +
- " if (o == null) {\n" +
- " return;\n" +
- " }\n" +
- " o = doubt;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n"
- );
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123399
-// variant - cannot refine the diagnostic without engaging into conditionals
-// dedicated flow context
-public void _test0453_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object doubt, boolean b) {\n" +
- " Object o1 = null, o2 = null;\n" +
- " while (true) {\n" +
- " if (o1 == null) { /* empty */ }\n" +
- " if (b) {\n" +
- " if (o2 == null) {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " o1 = o2 = doubt;\n" +
- " }\n" +
- " }\n" +
- "}"},
- "ERROR: complain on line 7, but not on line 5"
- );
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=129122
-public void test0454_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object bar() {\n" +
- " return new Object();\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (true) {\n" +
- " o = bar();\n" +
- " if (o != null) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " o = null; // quiet pls\n" +
- " }\n" +
- " }\n" +
- "}"},
- ""
- );
-}
-
-// null analysis - while
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=133131
-// variant
-public void test0455_while_nested() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = new Object();\n" +
- " while (b) {\n" +
- " o = new Object();\n" + // o still non null
- " }\n" +
- " if (o != null) { /* */ }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - while
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=134848
-// false positive after nested loop with break to explicit label
-public void test0456_while_nested_explicit_label() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " while (true) {\n" +
- " if (o != null) {\n" +
- " o.toString();\n" +
- " loop: while (true) {\n" +
- " break loop;\n" +
- " }\n" +
- " o.toString();\n" + // must not complain here
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=154995
-public void test0457_while_nested_break() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void test(String p, String q, boolean b) {\n" +
- " while (b) {\n" +
- " String e = q;\n" +
- " e.trim();\n" +
- " while (true) {\n" +
- " if (b)\n" +
- " e = q;\n" +
- " else\n" +
- " e = null;\n" +
- " if (e == null || p != null) {\n" +
- " if (e != null) {\n" + // should not complain here
- " // Do something\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - while
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=134848
-// variant: no label yields no problem
-public void test0458_while_nested_explicit_label() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " while (true) {\n" +
- " if (o != null) {\n" +
- " o.toString();\n" +
- " while (true) {\n" +
- " break;\n" +
- " }\n" +
- " o.toString();\n" + // must not complain here
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- try/finally
-public void test0500_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o = m;\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "" // because finally assigns to unknown value
- );
-}
-
-// null analysis -- try/finally
-public void test0501_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o = null;\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" // because finally assigns to null
- );
-}
-
-// null analysis -- try/finally
-public void test0502_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " try {\n" +
- " System.out.println();\n" + // might throw a runtime exception
- " o = new Object();\n" +
- " }\n" +
- " finally { /* */ }\n" +
- " o.toString();\n" +
- // still OK because in case of exception this code is
- // not reached
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try/finally
-public void test0503_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = null;\n" +
- " try {\n" +
- " x = null;\n" + // complain, already null
- " } finally { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x = null;\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-public void test0504_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = null;\n" +
- " try {\n" +
- " } finally {\n" +
- " if (x != null) { /* */ }\n" + // complain null
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (x != null) { /* */ }\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// origin: AssignmentTest#test017
-// The whole issue here is whether or not to detect premature exits. We
-// follow JLS's conservative approach, which considers that the try
-// block may exit before the assignment is completed.
-// Note: conversely, without line 1, we would complain about x not being
-// initialized (for sure) on line 2.
-public void test0505_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = this;\n" + // 1
- " try {\n" +
- " x = null;\n" +
- " } finally {\n" +
- " if (x == null) {/* */}\n" + // 2
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try finally
-public void test0506_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try finally
-public void test0507_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o.toString();\n" + // protect
- " }\n" +
- " if (o == null) {\n" + // complain
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try finally
-public void test0508_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o = null;" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o.toString();\n" + // complain and protect
- " o.toString();\n" + // quiet
- " }\n" +
- " o.toString();\n" + // quiet
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try finally
-public void test0509_try_finally_embedded() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1) {\n" +
- " Object o2 = null;" +
- " while (true) {\n" +
- " // o2 = o1;\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o2.toString();\n" + // complain and protect
- " o2.toString();\n" + // quiet
- " }\n" +
- " o2.toString();\n" + // quiet
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o2.toString();\n" +
- " ^^\n" +
- "The variable o2 can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try finally
-public void test0510_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void bar() throws Exception {\n" +
- " // empty\n" +
- " }\n" +
- " void foo(Object o, boolean b) throws Exception {\n" +
- " try {\n" +
- " bar();\n" +
- " if (b) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " if (o != null) {\n" +
- " o.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try finally
-public void test0511_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1, boolean b) {\n" +
- " Object o2 = null;\n" +
- " if (b) {\n" +
- " o2 = new Object();\n" +
- " }\n" + // 0011
- " try { /* */ }\n" +
- " finally {\n" +
- " o2 = o1;\n" + // 1011
- " }\n" +
- " o2.toString();\n" + // 1011 -- quiet
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try/finally
-public void test0512_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = null;\n" +
- " try {\n" +
- " x = new X();\n" +
- " } finally {\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " x.toString();\n" +
- " ^\n" +
- "The variable x may be null\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128547
-public void test0513_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- " Object foo() {\n" +
- " X x = null;\n" +
- " try {\n" +
- " x = bar();\n" +
- " x.toString();\n" +
- " return x;\n" +
- " } finally {\n" +
- " if (x != null) {\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128547
-// embedded variant 1
-public void test0514_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- " Object foo() {\n" +
- " X x = null;\n" +
- " try {\n" +
- " try {\n" +
- " x = bar();\n" +
- " x.toString();\n" +
- " return x;\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " if (x != null) {\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128547
-// embedded variant 2
-public void test0515_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- " Object foo() {\n" +
- " X x = null;\n" +
- " try {\n" +
- " try {\n" +
- " x = bar();\n" +
- " x.toString();\n" +
- " return x;\n" +
- " }\n" +
- " finally {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- " finally {\n" +
- " if (x != null) {\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128547
-// variant
-public void test0516_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object foo() {\n" +
- " X x = null;\n" +
- " try {\n" +
- " x = new X();\n" +
- " return x;\n" +
- " }\n" +
- " finally {\n" +
- " if (x != null) {\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=132072
-// AIOOBE in null check compiling com.sun.org.apache.xalan.internal.res.XSLTErrorResources from JDK 1.5 source
-public void test0517_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object foo() {\n" +
- " String s00, s01, s02, s03, s04, s05, s06, s07, s08, s09;\n" +
- " String s10, s11, s12, s13, s14, s15, s16, s17, s18, s19;\n" +
- " String s20, s21, s22, s23, s24, s25, s26, s27, s28, s29;\n" +
- " String s30, s31, s32, s33, s34, s35, s36, s37, s38, s39;\n" +
- " String s40, s41, s42, s43, s44, s45, s46, s47, s48, s49;\n" +
- " String s50, s51, s52, s53, s54, s55, s56, s57, s58, s59;\n" +
- " String s60, s61, s62, s63, s64, s65, s66, s67, s68, s69;\n" +
- " String s100, s101, s102, s103, s104, s105, s106, s107, s108, s109;\n" +
- " String s110, s111, s112, s113, s114, s115, s116, s117, s118, s119;\n" +
- " String s120, s121, s122, s123, s124, s125, s126, s127, s128, s129;\n" +
- " String s130, s131, s132, s133, s134, s135, s136, s137, s138, s139;\n" +
- " String s140, s141, s142, s143, s144, s145, s146, s147, s148, s149;\n" +
- " String s150, s151, s152, s153, s154, s155, s156, s157, s158, s159;\n" +
- " String s160, s161, s162, s163, s164, s165, s166, s167, s168, s169;\n" +
- " String s200, s201, s202, s203, s204, s205, s206, s207, s208, s209;\n" +
- " String s210, s211, s212, s213, s214, s215, s216, s217, s218, s219;\n" +
- " String s220, s221, s222, s223, s224, s225, s226, s227, s228, s229;\n" +
- " String s230, s231, s232, s233, s234, s235, s236, s237, s238, s239;\n" +
- " String s240, s241, s242, s243, s244, s245, s246, s247, s248, s249;\n" +
- " String s250, s251, s252, s253, s254, s255, s256, s257, s258, s259;\n" +
- " String s260, s261, s262, s263, s264, s265, s266, s267, s268, s269;\n" +
- " X x = new X();\n" +
- " try {\n" +
- " return x;\n" +
- " }\n" +
- " finally {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=132120
-// [compiler][null] NPE batch compiling JDT/Core from HEAD
-public void test0518_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " String s00, s01, s02, s03, s04, s05, s06, s07, s08, s09;\n" +
- " String s10, s11, s12, s13, s14, s15, s16, s17, s18, s19;\n" +
- " String s20, s21, s22, s23, s24, s25, s26, s27, s28, s29;\n" +
- " String s30, s31, s32, s33, s34, s35, s36, s37, s38, s39;\n" +
- " String s40, s41, s42, s43, s44, s45, s46, s47, s48, s49;\n" +
- " String s50, s51, s52, s53, s54, s55, s56, s57, s58, s59;\n" +
- " String s60, s61, s62, s63, s64, s65, s66, s67, s68, s69;\n" +
- " String s100, s101, s102, s103, s104, s105, s106, s107, s108, s109;\n" +
- " String s110, s111, s112, s113, s114, s115, s116, s117, s118, s119;\n" +
- " String s120, s121, s122, s123, s124, s125, s126, s127, s128, s129;\n" +
- " String s130, s131, s132, s133, s134, s135, s136, s137, s138, s139;\n" +
- " String s140, s141, s142, s143, s144, s145, s146, s147, s148, s149;\n" +
- " String s150, s151, s152, s153, s154, s155, s156, s157, s158, s159;\n" +
- " String s160, s161, s162, s163, s164, s165, s166, s167, s168, s169;\n" +
- " String s200, s201, s202, s203, s204, s205, s206, s207, s208, s209;\n" +
- " String s210, s211, s212, s213, s214, s215, s216, s217, s218, s219;\n" +
- " String s220, s221, s222, s223, s224, s225, s226, s227, s228, s229;\n" +
- " String s230, s231, s232, s233, s234, s235, s236, s237, s238, s239;\n" +
- " String s240, s241, s242, s243, s244, s245, s246, s247, s248, s249;\n" +
- " String s250, s251, s252, s253, s254, s255, s256, s257, s258, s259;\n" +
- " String s260, s261, s262, s263, s264, s265, s266, s267, s268, s269;\n" +
- " X x = null;\n" +
- " try {\n" +
- " x = new X();\n" +
- " } finally {\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 28)\n" +
- " x.toString();\n" +
- " ^\n" +
- "The variable x may be null\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128962
-// incorrect analysis within try finally with a constructor throwing an exception
-public void test0519_try_finally_constructor_exc() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(Y y) throws E {\n" +
- " try {\n" +
- " new Y();\n" +
- " y.toString();\n" + // should be quiet
- " } finally {\n" +
- " y = null;\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y() throws E {\n" +
- " }\n" +
- "}\n" +
- "class E extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128962
-// incorrect analysis within try finally with a constructor throwing an exception
-// variant
-public void test0520_try_finally_constructor_exc() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(Y y) throws E { \n" +
- " try { \n" +
- " new Y() {\n" +
- " void bar() {\n" +
- " // do nothing\n" +
- " }\n" +
- " }; \n" +
- " y.toString();\n" +
- " } finally { \n" +
- " y = null; \n" +
- " } \n" +
- " } \n" +
- "}\n" +
- "abstract class Y {\n" +
- " Y() throws E { \n" +
- " }\n" +
- " abstract void bar();\n" +
- "} \n" +
- "class E extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- "}"},
- "");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=149665
-// incorrect analysis within try finally with an embedded && expression
-public void test0521_try_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X\n" +
- "{\n" +
- " X m;\n" +
- " public void foo() {\n" +
- " for(int j = 0; j < 10; j++) {\n" +
- " try {\n" +
- " j++;\n" +
- " } finally {\n" +
- " X t = m;\n" +
- " if( t != null && t.bar()) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " boolean bar() {\n" +
- " return false;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=149665
-// variant
-public void test0522_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X\n" +
- "{\n" +
- " X m;\n" +
- " public void foo() {\n" +
- " for(int j = 0; j < 10; j++) {\n" +
- " try {\n" +
- " j++;\n" +
- " } finally {\n" +
- " X t = null;\n" +
- " if(t.bar()) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " boolean bar() {\n" +
- " return false;\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " if(t.bar()) {\n" +
- " ^\n" +
- "The variable t can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=149665
-// variant
-public void test0523_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X\n" +
- "{\n" +
- " X m;\n" +
- " public void foo() {\n" +
- " for(int j = 0; j < 10; j++) {\n" +
- " try {\n" +
- " j++;\n" +
- " } finally {\n" +
- " X t = m;\n" +
- " if(t == null ? false : (t == null ? false : t.bar())) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " boolean bar() {\n" +
- " return false;\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " if(t == null ? false : (t == null ? false : t.bar())) {\n" +
- " ^\n" +
- "The variable t cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=149665
-// variant
-public void test0524_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X\n" +
- "{\n" +
- " X m;\n" +
- " public void foo() {\n" +
- " for(int j = 0; j < 10; j++) {\n" +
- " try {\n" +
- " j++;\n" +
- " } finally {\n" +
- " X t = m;\n" +
- " if(t != null ? false : (t == null ? false : t.bar())) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " boolean bar() {\n" +
- " return false;\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " if(t != null ? false : (t == null ? false : t.bar())) {\n" +
- " ^\n" +
- "The variable t can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=150082
-public void test0525_try_finally_unchecked_exception() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X\n" +
- "{\n" +
- " String foo(Object p) {\n" +
- " String s = null;\n" +
- " Object o = null;\n" +
- " try {\n" +
- " o = p;\n" +
- " if (o == null) {\n" +
- " return null;\n" +
- " }\n" +
- " s = o.getClass().getName();\n" +
- " } catch (RuntimeException e) {\n" +
- " o.toString();\n" +
- " s = null;\n" +
- " } finally {\n" +
- " if (o != null) {\n" +
- " }\n" +
- " }\n" +
- " return s;\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\r\n" +
- " o.toString();\r\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=150082
-// variant
-public void test0526_try_finally_unchecked_exception() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X\n" +
- "{\n" +
- " String foo(Object p) {\n" +
- " String s = null;\n" +
- " Object o = p;\n" +
- " try {\n" +
- " if (o == null) {\n" + // shades doubts upon o
- " return null;\n" + // may throw a RuntimeException by spec
- " }\n" +
- " s = o.getClass().getName();\n" +
- " } catch (RuntimeException e) {\n" +
- " o.toString();\n" +
- " s = null;\n" +
- " } finally {\n" +
- " if (o != null) {\n" +
- " }\n" +
- " }\n" +
- " return s;\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-//null analysis -- try/finally
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150082
-//variant
-public void test0527_try_finally_unchecked_exception() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X\n" +
- "{\n" +
- " String foo(Object p) {\n" +
- " String s = null;\n" +
- " Object o = p;\n" +
- " try {\n" +
- " if (o == null) {\n" + // shades doubts upon o
- " return null;\n" + // may throw a RuntimeException by spec
- " }\n" +
- " s = o.getClass().getName();\n" +
- " } catch (RuntimeException e) {\n" +
- " o.toString();\n" +
- " s = null;\n" +
- " }\n" +
- " return s;\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158000
-public void test0528_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = null;\n" +
- " X y = null;\n" +
- " try {\n" +
- " } finally {\n" +
- " if (x != null) { /* */ }\n" + // complain null
- " if (y != null) { /* */ }\n" + // complain null as well
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (x != null) { /* */ }\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " if (y != null) { /* */ }\n" +
- " ^\n" +
- "The variable y can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158000
-public void test0529_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " o = null;\n" +
- " Object o2 = null;\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o.toString();\n" + // complain
- " o2.toString();\n" + // complain
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " o2.toString();\n" +
- " ^^\n" +
- "The variable o2 can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158000
-public void test0530_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = null;\n" +
- " X y = null;\n" +
- " try {\n" +
- " x = new X();\n" +
- " } finally {\n" +
- " x.toString();\n" +
- " y.toString();\n" + // complain
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " x.toString();\n" +
- " ^\n" +
- "The variable x may be null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " y.toString();\n" +
- " ^\n" +
- "The variable y can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/finally
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158000
-public void test0531_try_finally() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " X x = new X();\n" +
- " X y = null;\n" +
- " try {\n" +
- " } finally {\n" +
- " if (x != null) {\n" +
- " x.toString();\n" +
- " }\n" +
- " y.toString();\n" + // complain
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (x != null) {\n" +
- " ^\n" +
- "The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " y.toString();\n" +
- " ^\n" +
- "The variable y can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- try/catch
-public void test0550_try_catch() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " try {\n" +
- " System.out.println();\n" + // might throw a runtime exception
- " o = new Object();\n" +
- " }\n" +
- " catch (Throwable t) {\n" + // catches everything
- " return;\n" + // gets out
- " }\n" +
- " o.toString();\n" + // non null
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis - try/catch
-public void test0551_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " System.out.println();\n" +
- " if (dummy) {\n" +
- " o = null;\n" +
- " throw new Exception();\n" +
- " }\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " o.toString();\n" + // complain
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-public void test0552_try_catch() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() throws Exception {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " if (dummy) {\n" +
- " o = null;\n" +
- " throw new Exception();\n" +
- " }\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " }\n" +
- " if (o != null) {\n" +
- // quiet: get out of try either through normal flow, leaves a new
- // object, or through Exception, leaves a null
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis - try/catch
-public void test0553_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy, other;\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " if (dummy) {\n" +
- " if (other) {\n" +
- " throw new LocalException();\n" + // may launch new exception
- " }\n" +
- " o = null;\n" +
- " throw new LocalException();\n" + // must launch new exception
- " }\n" +
- " }\n" +
- " catch (LocalException e) {\n" +
- " o.toString();\n" + // complain
- " }\n" +
- " }\n" +
- " class LocalException extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-public void test0554_try_catch() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) throws Exception {\n" +
- " try {\n" +
- " o = null;\n" +
- " throwLocalException();\n" +
- " throw new Exception();\n" +
- " }\n" +
- " catch (LocalException e) {\n" +
- " }\n" +
- " if (o != null) {\n" +
- // complain: only way to get out of try and get there is to go
- // through throwLocalException, after the assignment
- " }\n" +
- " }\n" +
- " class LocalException extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- " void throwLocalException() throws LocalException {\n" +
- " throw new LocalException();\n" +
- " }\n" +
- "}\n"},
- ""
- // conservative flow analysis suppresses the warning
-// "----------\n" +
-// "1. ERROR in X.java (at line 10)\n" +
-// " if (o != null) {\n" +
-// " ^\n" +
-// "The variable o can only be null; it was either set to null or checked for null when last used\n" +
-// "----------\n"
- );
-}
-
-// null analysis - try/catch
-public void test0555_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " o = null;\n" +
- " throwException();\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " o.toString();\n" + // complain NPE
- " }\n" +
- " }\n" +
- " void throwException() throws Exception {\n" +
- " throw new Exception();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-public void test0556_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " o = null;\n" +
- " throwException();\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " o.toString();\n" + // complain NPE
- " }\n" +
- " }\n" +
- " void throwException() throws Exception {\n" +
- " throw new Exception();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-public void test0557_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " if (dummy) {\n" +
- " o = null;\n" +
- " throw new Exception();\n" +
- " }\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " o.toString();\n" + // complain NPE
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-public void test0558_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " if (dummy) {\n" +
- " System.out.print(0);\n" + // may thow RuntimeException
- " o = null;\n" +
- " throw new LocalException();\n" +
- " }\n" +
- " }\n" +
- " catch (LocalException e) {\n" + // doesn't catch RuntimeException
- " o.toString();\n" + // complain NPE
- " }\n" +
- " }\n" +
- " class LocalException extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " o.toString();\n" +
- " ^\n" +
-// "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "The variable o may be null\n" +
- // conservative flow analysis softens the error
- "----------\n");
-}
-
-// null analysis - try/catch
-public void test0559_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " try {\n" +
- " if (dummy) {\n" +
- " o = null;\n" +
- " throw new SubException();\n" +
- " }\n" +
- " }\n" +
- " catch (LocalException e) {\n" + // must catch SubException
- " o.toString();\n" + // complain NPE
- " }\n" +
- " }\n" +
- " class LocalException extends Exception {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- " class SubException extends LocalException {\n" +
- " private static final long serialVersionUID = 1L;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " o.toString();\n" +
- " ^\n" +
-// "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "The variable o may be null\n" +
- // conservative flow analysis softens the error
- "----------\n");
-}
-
-// null analysis - try/catch
-public void test0560_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Class bar(boolean b) throws ClassNotFoundException {\n" +
- " if (b) {\n" +
- " throw new ClassNotFoundException();\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " public Class foo(Class c, boolean b) {\n" +
- " if (c != null)\n" +
- " return c;\n" +
- " if (b) {\n" +
- " try {\n" +
- " c = bar(b);\n" +
- " return c;\n" +
- " } catch (ClassNotFoundException e) {\n" +
- " // empty\n" +
- " }\n" +
- " }\n" +
- " if (c == null) { // should complain: c can only be null\n" +
- " }\n" +
- " return c;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 19)\n" +
- " if (c == null) { // should complain: c can only be null\n" +
- " ^\n" +
- "The variable c can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=130359
-public void test0561_try_catch_unchecked_exception() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " try {\n" +
- " o = bar();\n" +
- " } catch (RuntimeException e) {\n" +
- " o.toString();\n" + // may be null
- " }\n" +
- " }\n" +
- " private Object bar() {\n" +
- " return new Object();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=150854
-// (slightly different) variant of 561
-public void test0562_try_catch_unchecked_exception() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.*;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " LineNumberReader o = null;\n" +
- " try {\n" +
- " o = new LineNumberReader(new FileReader(\"dummy\"));\n" +
- " } catch (NumberFormatException e) {\n" +
- " o.toString();\n" + // may be null
- " } catch (IOException e) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=155117
-public void test0563_try_catch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo(boolean b) {\n" +
- " Exception ex = null;\n" +
- " if (b) {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " return;\n" +
- " } catch (Exception e) {\n" +
- " ex = e;\n" +
- " }\n" +
- " }\n" +
- " else {\n" +
- " try {\n" +
- " System.out.println();\n" +
- " return;\n" +
- " } catch (Exception e) {\n" +
- " ex = e;\n" +
- " }\n" +
- " }\n" +
- " if (ex == null) {\n" + // complain: ex cannot be null\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " if (ex == null) {\n" +
- " ^^\n" +
- "The variable ex cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - try/catch
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=150854
-public void test0564_try_catch_unchecked_exception() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static Object foo() {\n" +
- " Object result = null;\n" +
- " try {\n" +
- " result = new Object();\n" +
- " } catch (Exception e) {\n" +
- " result = null;\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - try/catch
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=150854
-// variant
-public void test0565_try_catch_unchecked_exception() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static Object foo() {\n" +
- " Object result = null;\n" +
- " try {\n" +
- " result = new Object();\n" +
- " result = new Object();\n" +
- " } catch (Exception e) {\n" +
- " result = null;\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - try/catch
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=150854
-// variant
-public void test0566_try_catch_unchecked_exception() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static Object foo(Y y) {\n" +
- " Object result = null;\n" +
- " try {\n" +
- " while (y.next()) {\n" +
- " result = y.getObject();\n" +
- " }\n" +
- " } catch (Exception e) {\n" +
- " result = null;\n" +
- " }\n" +
- " return result;\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " boolean next() {\n" +
- " return false;\n" +
- " }\n" +
- " Object getObject() {\n" +
- " return null;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- do while
-public void test0601_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {/* */}\n" +
- " while (o.toString() != null);\n" +
- // complain: NPE
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " while (o.toString() != null);\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- do while
-public void test0602_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {/* */}\n" +
- " while (o != null);\n" +
- // complain: get o null first time and forever
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " while (o != null);\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- do while
-public void test0603_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " o = new Object();\n" +
- " }\n" +
- " while (o == null);\n" +
- // complain: set it to non null before test, for each iteration
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " while (o == null);\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- do while
-public void test0604_do_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " if (System.currentTimeMillis() > 10L) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " while (o == null);\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- do while
-public void test0605_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo(Object o) {\n" +
- " o = null;\n" +
- " do {\n" +
- " // do nothing\n" +
- " }\n" +
- " while (dummy || o != null);\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " while (dummy || o != null);\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- do while
-public void test0606_do_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null,\n" +
- " u = new Object(),\n" +
- " v = new Object();\n" +
- " do {\n" +
- " if (v == null) {\n" +
- " o = new Object();\n" +
- " };\n" +
- " if (u == null) {\n" +
- " v = null;\n" +
- " };\n" +
- " u = null;\n" +
- " }\n" +
- " while (o == null);\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- do while
-public void test0607_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " o.toString();\n" +
- // complain: NPE
- " o = new Object();\n" +
- " }\n" +
- " while (dummy);\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- do while
-public void test0608_do_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " o = new Object();\n" +
- " }\n" +
- " while (dummy);\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- do while
-public void test0609_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do { /* */ }\n" +
- " while (dummy);\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - do while
-public void test0610_do_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X bar() {\n" +
- " return null;\n" +
- " }\n" +
- " void foo(X x) {\n" +
- " x.bar();\n" +
- " do {\n" +
- " x = x.bar();\n" +
- " } while (x != null);\n" + // quiet
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis - do while
-public void test0611_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " X bar() {\n" +
- " return new X();\n" +
- " }\n" +
- " void foo(Object o) {\n" +
- " do {\n" +
- " o = bar();\n" +
- " } while (o == null);\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// the problem here is that a single pass cannot know for the return
-// embedded into the if; prior approach did use the upstream flow
-// info to catch this, but this is inappropriate in many cases (eg
-// test0606)
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123399
-public void _test0612_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object doubt) {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " if (o == null) {\n" +
- " return;\n" +
- " }\n" +
- " o = doubt;\n" +
- " } while (true);\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n"
- );
-}
-
-// null analysis - do while
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=147118
-public void test0613_do_while() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String f;\n" +
- " void foo (boolean b) {\n" +
- " X x = new X();\n" +
- " do {\n" +
- " System.out.println(x.f);\n" +
- " if (b) {\n" +
- " x = null;\n" +
- " }\n" +
- " } while (x != null);\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123399
-// variant
-public void _test0614_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object doubt) {\n" +
- " Object o = null;\n" +
- " exit: do {\n" +
- " if (o == null) {\n" +
- " continue exit;\n" +
- " }\n" +
- " o = doubt;\n" +
- " } while (true);\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n"
- );
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123399
-// variant
-public void _test0615_do_while() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object doubt) {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " if (o == null) {\n" +
- " throw new RuntimeException();\n" +
- " }\n" +
- " o = doubt;\n" +
- " } while (true);\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n"
- );
-}
-
-// null analysis -- for
-public void test0701_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " for (;o.toString() != null;) {/* */}\n" +
- // complain: NPE
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " for (;o.toString() != null;) {/* */}\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0702_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " for (;o != null;) {/* */}\n" +
- // complain: get o null first time and forever
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " for (;o != null;) {/* */}\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0703_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " for (;o == null;) {\n" +
- // quiet: first iteration is sure to find it null,
- // but other iterations may change it
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0704_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " for (;o == null;) {\n" +
- // quiet: first iteration is sure to find it null,
- // but other iterations may change it
- " if (System.currentTimeMillis() > 10L) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0705_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bar() {\n" +
- " return true;\n" +
- " }\n" +
- " void foo(Object o) {\n" +
- " for (;bar() && o == null;) {\n" +
- " o.toString();\n" + // complain: NPE because of condition
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0707_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " for (;o == null; o.toString()) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0708_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " for (;o == null; o.toString()) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for (;o == null; o.toString()) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0709_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " for (o.toString(); o == null;) { /* */ }\n" + // complain: protected then unchanged
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " for (o.toString(); o == null;) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0710_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bar() {\n" +
- " return true;\n" +
- " }\n" +
- " void foo(Object o) {\n" +
- " o = null;\n" +
- " for (o.toString(); bar();) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " for (o.toString(); bar();) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0711_for() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object t[] = null;\n" +
- " for (Object o : t) {/* */}\n" +
- // complain: NPE
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " for (Object o : t) {/* */}\n" +
- " ^\n" +
- "The variable t can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- for
-public void test0712_for() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Iterable i = null;\n" +
- " for (Object o : i) {/* */}\n" +
- // complain: NPE
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " for (Object o : i) {/* */}\n" +
- " ^\n" +
- "The variable i can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- for
-public void test0713_for() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object t[] = new Object[1];\n" +
- " for (Object o : t) {/* */}\n" +
- " }\n" +
- "}\n"},
- "");
- }
-}
-
-// null analysis -- for
-public void test0714_for() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Iterable i = new java.util.Vector<Object>();\n" +
- " for (Object o : i) {/* */}\n" +
- " }\n" +
- "}\n"},
- "");
- }
-}
-
-// null analysis -- for
-public void test0715_for() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Iterable i = new java.util.Vector<Object>();\n" +
- " Object flag = null;\n" +
- " for (Object o : i) {\n" +
- " flag = new Object();\n" +
- " }\n" +
- " flag.toString();\n" +
- // complain: cannot know if at least one iteration got executed
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " flag.toString();\n" +
- " ^^^^\n" +
- "The variable flag may be null\n" +
- "----------\n");
- }
-}
-
-// null analysis -- for
-public void test0716_for() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Iterable i = new java.util.Vector<Object>();\n" +
- " Object flag = null;\n" +
- " for (Object o : i) { /* */ }\n" +
- " flag.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " flag.toString();\n" +
- " ^^^^\n" +
- "The variable flag can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- for
-public void test0717_for() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(boolean dummy) {\n" +
- " Object flag = null;\n" +
- " for (;dummy;) {\n" +
- " flag = new Object();\n" +
- " }\n" +
- " flag.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " flag.toString();\n" +
- " ^^^^\n" +
- "The variable flag may be null\n" +
- "----------\n");
- }
-}
-
-// null analysis -- for
-public void test0718_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(boolean dummy) {\n" +
- " Object flag = null;\n" +
- " for (;dummy;) { /* */ }\n" +
- " flag.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " flag.toString();\n" +
- " ^^^^\n" +
- "The variable flag can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-// origin: AssignmentTest#test019
-public void test0719_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static final char[] foo(char[] a, char c1, char c2) {\n" +
- " char[] r = null;\n" +
- " for (int i = 0, length = a.length; i < length; i++) {\n" +
- " char c = a[i];\n" +
- " if (c == c1) {\n" +
- " if (r == null) {\n" +
- " r = new char[length];\n" +
- " }\n" +
- " r[i] = c2;\n" +
- " } else if (r != null) {\n" +
- " r[i] = c;\n" +
- " }\n" +
- " }\n" +
- " if (r == null) return a;\n" +
- " return r;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0720_for_continue_break() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " for (int i = 0; i < 10; i++) {\n" +
- " if (o == null) {\n" + // complain: o cannot be null
- " continue;\n" +
- " }\n" +
- " o = null;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0721_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " Object o = null;\n" +
- " for (; b ? (o = new Object()).equals(o) : false ;) {\n" +
- // contrast this with test0238; here the condition shades doubts
- // upon o being null
- " /* */\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0722_for_return() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo (boolean b) {\n" +
- " Object o = null;\n" +
- " for (int i = 0; i < 25; i++) {\n" +
- " if (b) {\n" +
- " if (o == null) {\n" +
- " o = new Object();\n" + // cleared by return downstream
- " }\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0723_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo () {\n" +
- " Object o[] = new Object[1];\n" +
- " for (int i = 0; i < 1; i++) {\n" +
- " if (i < 1) {\n" +
- " o[i].toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0724_for_with_initialization() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X field;\n" +
- " void foo(X x1) {\n" +
- " // X x2;\n" +
- " outer: for (int i = 0; i < 30; i++) {\n" +
- " X x2 = x1;\n" +
- " do {\n" +
- " if (x2.equals(x1)) {\n" +
- " continue outer;\n" +
- " }\n" +
- " x2 = x2.field;\n" +
- " } while (x2 != null);\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0725_for_with_assignment() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X field;\n" +
- " void foo(X x1) {\n" +
- " X x2;\n" +
- " outer: for (int i = 0; i < 30; i++) {\n" +
- " x2 = x1;\n" +
- " do {\n" +
- " if (x2.equals(x1)) {\n" +
- " continue outer;\n" +
- " }\n" +
- " x2 = x2.field;\n" +
- " } while (x2 != null);\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-// changed with https://bugs.eclipse.org/bugs/show_bug.cgi?id=127570
-// we are now able to see that x2 is reinitialized with x1, which is unknown
-public void test0726_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x1) {\n" +
- " X x2 = null;\n" +
- " for (int i = 0; i < 5; i++) {\n" +
- " if (x2 == null) {\n" +
- " x2 = x1;\n" +
- " }\n" +
- " x2.toString();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0727_for() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " for (; true;) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- for
-public void test0728_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " for (; true; x.toString()) { /* */ }\n" +
- " if (x == null) { /* */ }\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (x == null) { /* */ }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-
-// null analysis -- for
-public void test0729_for_try_catch_finally() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.IOException;\n" +
- "class X {\n" +
- " X f;\n" +
- " void bar() throws IOException {\n" +
- " throw new IOException();\n" +
- " }\n" +
- " void foo(boolean b) {\n" +
- " for (int i = 0 ; i < 5 ; i++) {\n" +
- " X x = this.f;\n" +
- " if (x == null) { \n" +
- " continue;\n" +
- " }\n" +
- " if (b) {\n" +
- " try {\n" +
- " bar();\n" +
- " } \n" +
- " catch(IOException e) { /* */ }\n" +
- " finally {\n" +
- " x.toString();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - for
-public void test0730_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void foo(Object o) {\n" +
- " for ( ; o == null ; ) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - for
-public void test0731_for() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " X bar() {\n" +
- " return new X();\n" +
- " }\n" +
- " void foo(Object o) {\n" +
- " for ( ; o == null ; ) {\n" +
- " o = bar();\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" + // complain
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis - for nested with break
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=129371
-public void test0732_for_nested_break() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(String doubt) {\n" +
- " for(int i = 0; i < 10; i++) {\n" +
- " String s = doubt;\n" +
- " if(s != null) {\n" +
- " for(int j = 0; j < 1; j++) {\n" +
- " break;\n" +
- " }\n" +
- " s.length();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"},
- "");
-}
-
-// null analysis - for while with break
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=129371
-// variant
-public void test0733_for_while_break() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(String doubt, boolean b) {\n" +
- " for(int i = 0; i < 10; i++) {\n" +
- " String s = doubt;\n" +
- " if (s != null) {\n" +
- " while (b) {\n" +
- " break;\n" +
- " }\n" +
- " s.length();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"},
- "");
-}
-
-// null analysis - for while with break
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=129371
-// variant
-public void test0734_for_while_break() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(String doubt, boolean b) {\n" +
- " for(int i = 0; i < 10; i++) {\n" +
- " String s = doubt;\n" +
- " if (s != null) {\n" +
- " do {\n" +
- " break;\n" +
- " } while (b);\n" +
- " s.length();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"},
- "");
-}
-
-// null analysis - for nested with break
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=129371
-// variant
-public void test0735_for_nested_break() {
- if (COMPLIANCE_1_5.compareTo(this.complianceLevel) <= 0) {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object[] a, String doubt) {\n" +
- " for(int i = 0; i < 10; i++) {\n" +
- " String s = doubt;\n" +
- " if(s != null) {\n" +
- " for(Object o : a) {\n" +
- " break;\n" +
- " }\n" +
- " s.length();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"},
- "");
- }
-}
-
-// null analysis - for
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127570
-public void test0736_for_embedded_lazy_init() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " public boolean foo() {\n" +
- " Boolean b = null;\n" +
- " for (int i = 0; i < 1; i++) {\n" +
- " if (b == null) {\n" +
- " b = Boolean.TRUE;\n" +
- " }\n" +
- " if (b.booleanValue()) {\n" + // quiet
- " return b.booleanValue();\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis - for with unknown protection: unknown cannot protect anything
-// suggested by https://bugs.eclipse.org/bugs/show_bug.cgi?id=127570
-public void test0737_for_unknown_protection() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " public boolean foo(Boolean p) {\n" +
- " Boolean b = null;\n" +
- " for (int i = 0; i < 1; i++) {\n" +
- " if (b == p) {\n" + // tells us that p is null as well
- " // empty\n" +
- " }\n" +
- " else {\n" +
- " continue;\n" +
- " }\n" +
- " if (b.booleanValue()) {\n" + // complain b can only be null
- " return b.booleanValue();\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " if (b.booleanValue()) {\n" +
- " ^\n" +
- "The variable b can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis - for with unknown protection
-// suggested by https://bugs.eclipse.org/bugs/show_bug.cgi?id=127570
-// the issue is that we cannot do less than full aliasing analysis to
-// catch this one
-// TODO (maxime) reconsider when/if we bring full aliasing in
-public void _test0738_for_unknown_protection() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " public boolean foo(Boolean p) {\n" +
- " Boolean b = null;\n" +
- " for (int i = 0; i < 1; i++) {\n" +
- " if (b == p) {\n" +
- " // empty\n" +
- " }\n" +
- " else {\n" +
- " b = p;\n" +
- " }\n" +
- " if (b.booleanValue()) {\n" + // quiet because b is an alias for p, unknown
- " return b.booleanValue();\n" +
- " }\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "}"},
- "");
-}
-
-// null analysis -- switch
-public void test0800_switch() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int k;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " switch (k) {\n" +
- " case 0 :\n" +
- " o = new Object();\n" +
- " break;\n" +
- " case 2 :\n" +
- " return;\n" +
- " }\n" +
- " if(o == null) { /* */ }\n" + // quiet: don't know whether came from 0 or default
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- switch
-public void test0801_switch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int k;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " switch (k) {\n" +
- " case 0 :\n" +
- " o = new Object();\n" +
- " break;\n" +
- " default :\n" +
- " return;\n" +
- " }\n" +
- " if(o == null) { /* */ }\n" + // complain: only get there through 0, o non null
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " if(o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- switch
-public void test0802_switch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int k;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " switch (k) {\n" +
- " case 0 :\n" +
- " o.toString();\n" + // complain: o can only be null
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- switch
-public void test0803_switch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int k;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " switch (k) {\n" +
- " case 0 :\n" +
- " o = new Object();\n" +
- " case 1 :\n" +
- " o.toString();\n" + // complain: may come through 0 or 1
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- switch
-public void test0804_switch() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo (Object o, int info) {\n" +
- " o = null;\n" +
- " switch (info) {\n" +
- " case 0 :\n" +
- " o = new Object();\n" +
- " break;\n" +
- " case 1 :\n" +
- " o = new String();\n" +
- " break;\n" +
- " default :\n" +
- " o = new X();\n" +
- " break;\n" +
- " }\n" +
- " if(o != null) { /* */ }\n" + // complain: all branches allocate a new o
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " if(o != null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- switch
-public void test0805_switch() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X p) {\n" +
- " X x = this;\n" +
- " for (int i = 0; i < 5; i++) {\n" +
- " switch (i) {\n" +
- " case 1:\n" +
- " x = p;\n" +
- " }\n" +
- " }\n" +
- " if (x != null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- non null protection tag
-public void _test0900_non_null_protection_tag() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " boolean b = o != null;\n" + // shades doubts upon o
- " o/*NN*/.toString();\n" + // protection => do not complain
- " o.toString();\n" + // protected by previous line
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- non null protection tag
-public void _test0901_non_null_protection_tag() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*NN*/.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*\n" +
- " NN comment */.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/* NN\n" +
- " */.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o // NN \n" +
- " .toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- non null protection tag
-public void _test0902_non_null_protection_tag() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*NON-NULL*/.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/* NON-NULL comment */.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/* NON-NULL \n" +
- " */.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o // NON-NULL \n" +
- " .toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- non null protection tag
-public void test0903_non_null_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*N N*/.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*NNa*/.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*aNN */.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*NON NULL*/.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*Non-Null*/.toString();\n" +
- " if (b) {\n" +
- " o = null;\n" +
- " }\n" +
- " o/*aNON-NULL */.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " o/*N N*/.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " o/*NNa*/.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " o/*aNN */.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 18)\n" +
- " o/*NON NULL*/.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 22)\n" +
- " o/*Non-Null*/.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 26)\n" +
- " o/*aNON-NULL */.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-
-// null analysis -- non null protection tag
-public void test0905_non_null_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " boolean b = o != null;\n" + // shades doubts upon o
- " o.toString();/*NN*/\n" + // too late to protect => complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();/*NN*/\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- non null protection tag
-public void test0906_non_null_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " boolean b = o != null;\n" + // shades doubts upon o
- " /*NN*/o.toString();\n" + // too soon to protect => complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " /*NN*/o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127244
-// [compiler] Null reference analysis doesn't understand assertions
-public void test0950_assert() {
- if (COMPLIANCE_1_3.compareTo(this.complianceLevel) < 0) {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " boolean b = o != null;\n" + // shades doubts upon o
- " assert(o != null);\n" + // protection
- " o.toString();\n" + // quiet
- " }\n" +
- "}\n"},
- "");
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127244
-// [compiler] Null reference analysis doesn't understand assertions
-public void test0951_assert() {
- if (COMPLIANCE_1_3.compareTo(this.complianceLevel) < 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " assert(o == null);\n" + // forces null
- " o.toString();\n" + // can only be null
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127244
-// [compiler] Null reference analysis doesn't understand assertions
-public void test0952_assert() {
- if (COMPLIANCE_1_3.compareTo(this.complianceLevel) < 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, boolean b) {\n" +
- " assert(o != null || b);\n" + // shade doubts
- " o.toString();\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127244
-// [compiler] Null reference analysis doesn't understand assertions
-public void test0953_assert_combined() {
- if (COMPLIANCE_1_3.compareTo(this.complianceLevel) < 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o1, Object o2) {\n" +
- " assert(o1 != null && o2 == null);\n" +
- " if (o1 == null) { };\n" + // complain
- " if (o2 == null) { };\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o1 == null) { };\n" +
- " ^^\n" +
- "The variable o1 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " if (o2 == null) { };\n" +
- " ^^\n" +
- "The variable o2 can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127244
-// [compiler] Null reference analysis doesn't understand assertions
-public void test0954_assert_fake_reachable() {
- if (COMPLIANCE_1_3.compareTo(this.complianceLevel) < 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " assert(false && o != null);\n" +
- " if (o == null) { };\n" + // quiet
- " }\n" +
- "}\n"},
- "");
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127244
-// [compiler] Null reference analysis doesn't understand assertions
-public void test0955_assert_combined() {
- if (COMPLIANCE_1_3.compareTo(this.complianceLevel) < 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " assert(false || o != null);\n" +
- " if (o == null) { };\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (o == null) { };\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127244
-// [compiler] Null reference analysis doesn't understand assertions
-public void test0956_assert_combined() {
- if (COMPLIANCE_1_3.compareTo(this.complianceLevel) < 0) {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " assert(o != null);\n" + // complain
- " if (o == null) { };\n" + // complain
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " assert(o != null);\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " if (o == null) { };\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
- }
-}
-
-// null analysis -- notNull protection tag
-public void _test0900_notNull_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(/** @notNull */ Object o) {\n" +
- " boolean b = o != null;\n" +
- " }\n" +
- "}\n"},
- "ERR cannot be null");
-}
-
-// null analysis -- notNull protection tag
-public void _test0901_notNull_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " /** @notNull */ Object l = o;\n" +
- " }\n" +
- "}\n"},
- "ERR cannot be null... ou pas ?");
-}
-
-// null analysis -- notNull protection tag
-public void _test0902_notNull_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(/** @nullable */ Object o) {\n" +
- " /** @notNull */ Object l = o;\n" +
- " }\n" +
- "}\n"},
- "ERR cannot be null");
-}
-
-// null analysis -- notNull protection tag
-public void test0903_notNull_protection_tag() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object bar() {\n" +
- " return null;\n" +
- " }\n" +
- " void foo() {\n" +
- " /** @notNull */ Object l = bar();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- notNull protection tag
-public void _test0904_notNull_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /** @notNull */\n" +
- " Object bar() {\n" +
- " return new Object();\n" +
- " }\n" +
- " void foo() {\n" +
- " Object l = bar();\n" +
- " if (l == null) { /* empty */ }\n" +
- " }\n" +
- "}\n"},
- "ERR cannot be null");
-}
-
-// null analysis -- notNull protection tag
-public void _test0905_notNull_protection_tag() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /** @notNull */\n" +
- " Object bar() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"},
- "ERR cannot be null");
-}
-
-// null analysis -- nullable tag
-public void _test0950_nullable_tag() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(/** @nullable */ Object o) {\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "ERR may be null");
-}
-
-// null analysis -- nullable tag
-public void _test0951_nullable_tag() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(/** @nullable */ Object o) {\n" +
- " Object l = o;\n" +
- " l.toString();\n" +
- " }\n" +
- "}\n"},
- "ERR may be null");
-}
-
-// null analysis -- nullable tag
-public void _test0952_nullable_tag() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " /** @nullable */ Object o;\n" +
- " if (b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "ERR may be null");
-}
-
-// moved from AssignmentTest
-public void test1004() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X foo(X x) {\n" +
- " x.foo(null); // 0\n" +
- " if (x != null) { // 1\n" +
- " if (x == null) { // 2\n" +
- " x.foo(null); // 3\n" +
- " } else if (x instanceof X) { // 4\n" +
- " x.foo(null); // 5 \n" +
- " } else if (x != null) { // 6\n" +
- " x.foo(null); // 7\n" +
- " }\n" +
- " x.foo(null); // 8\n" +
- " }\n" +
- " return this;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (x != null) { // 1\n" +
- " ^\n" +
- "The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " if (x == null) { // 2\n" +
- " ^\n" +
- "The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " x.foo(null); // 3\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " } else if (x != null) { // 6\n" +
- " ^\n" +
- "The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " x.foo(null); // 8\n" +
- " ^\n" +
- "The variable x may be null\n" +
- "----------\n");
-}
-
-public void test1005() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Class c) {\n" +
- " if (c.isArray() ) {\n" +
- " } else if (c == java.lang.String.class ) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1006() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " if (x == this)\n" +
- " return;\n" +
- " x.foo(this);\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1007() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x, X x2) {\n" +
- " if (x != null)\n" +
- " return;\n" +
- " x = x2;\n" +
- " if (x == null) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1008() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x, X x2) {\n" +
- " if (x != null)\n" +
- " return;\n" +
- " try {\n" +
- " x = x2;\n" +
- " } catch(Exception e) {}\n" +
- " if (x == null) {\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1009() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.File;\n" +
- "\n" +
- "public class X {\n" +
- " boolean check(String name) { return true; }\n" +
- " Class bar(String name) throws ClassNotFoundException { return null; }\n" +
- " File baz(String name) { return null; }\n" +
- " \n" +
- " public Class foo(String name, boolean resolve) throws ClassNotFoundException {\n" +
- " \n" +
- " Class c = bar(name);\n" +
- " if (c != null)\n" +
- " return c;\n" +
- " if (check(name)) {\n" +
- " try {\n" +
- " c= bar(name);\n" +
- " return c;\n" +
- " } catch (ClassNotFoundException e) {\n" +
- " // keep searching\n" +
- " // only path to here left c unassigned from try block, means it was assumed to be null\n" +
- " }\n" +
- " }\n" +
- " if (c == null) {// should complain: c can only be null\n" +
- " File file= baz(name);\n" +
- " if (file == null)\n" +
- " throw new ClassNotFoundException();\n" +
- " }\n" +
- " return c;\n" +
- " }\n" +
- "\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 22)\n" +
- " if (c == null) {// should complain: c can only be null\n" +
- " ^\n" +
- "The variable c can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-public void test1010() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " X itself() { return this; }\n" +
- "\n" +
- " void bar() {\n" +
- " X itself = this.itself();\n" +
- " if (this == itself) {\n" +
- " System.out.println(itself.toString()); //1\n" +
- " } else {\n" +
- " System.out.println(itself.toString()); //2\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " X itself() { return this; }\n" +
- "\n" +
- " void bar() {\n" +
- " X itself = this.itself();\n" +
- " if (this == itself) {\n" +
- " X other = (X)itself;\n" +
- " if (other != null) {\n" +
- " }\n" +
- " if (other == null) {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " if (other != null) {\n" +
- " ^^^^^\n" +
- "The variable other cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-public void test1012() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " if (o == null) {\n" +
- " return;\n" +
- " }\n" +
- " // o = bar();\n" +
- " } while (true);\n" +
- " }\n" +
- " X bar() { \n" +
- " return null; \n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n"
- );
-}
-
-// x cannot equal this then null with no assignment in between
-// each diagnostic is locally sound though
-public void test1013() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " if (x == this) {\n" +
- " if (x == null) {\n" +
- " x.foo(this);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " if (x == null) {\n" +
- " ^\n" +
- "The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " x.foo(this);\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-public void test1014() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = null;\n" +
- " try {\n" +
- " x = this;\n" +
- " } finally {\n" +
- " x.foo(null);\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " x.foo(null);\n" +
- " ^\n" +
- "The variable x may be null\n" +
- "----------\n");
-}
-
-public void test1015() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " int i = 1;\n" +
- " switch (i) {\n" +
- " case 1:\n" +
- " o = new Object();\n" +
- " break;\n" +
- " }\n" +
- " if (o != null)\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1016() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = null;\n" +
- " try {\n" +
- " x = null;\n" +
- " } finally {\n" +
- " if (x != null) {\n" +
- " x.foo(null);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " x = null;\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " if (x != null) {\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-public void test1017() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(X x) {\n" +
- " x = this;\n" +
- " try {\n" +
- " x = null;\n" +
- " } finally {\n" +
- " if (x == null) {\n" +
- " x.foo(null);\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " x.foo(null);\n" +
- " ^\n" +
- "The variable x can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-public void test1018() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " do {\n" +
- " if (o != null) return;\n" +
- " o = null;\n" +
- " } while (true);\n" +
- " }\n" +
- " X bar() { \n" +
- " return null; \n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 6)\r\n" +
- " if (o != null) return;\r\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\r\n" +
- " o = null;\r\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-public void test1019() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static final char[] replaceOnCopy(\n" +
- " char[] array,\n" +
- " char toBeReplaced,\n" +
- " char replacementChar) {\n" +
- " \n" +
- " char[] result = null;\n" +
- " for (int i = 0, length = array.length; i < length; i++) {\n" +
- " char c = array[i];\n" +
- " if (c == toBeReplaced) {\n" +
- " if (result == null) {\n" +
- " result = new char[length];\n" +
- " System.arraycopy(array, 0, result, 0, i);\n" +
- " }\n" +
- " result[i] = replacementChar;\n" +
- " } else if (result != null) {\n" +
- " result[i] = c;\n" +
- " }\n" +
- " }\n" +
- " if (result == null) return array;\n" +
- " return result;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1021() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int kind;\n" +
- " X parent;\n" +
- " Object[] foo() { return null; }\n" +
- " void findTypeParameters(X scope) {\n" +
- " Object[] typeParameters = null;\n" +
- " while (scope != null) {\n" +
- " typeParameters = null;\n" +
- " switch (scope.kind) {\n" +
- " case 0 :\n" +
- " typeParameters = foo();\n" +
- " break;\n" +
- " case 1 :\n" +
- " typeParameters = foo();\n" +
- " break;\n" +
- " case 2 :\n" +
- " return;\n" +
- " }\n" +
- " if(typeParameters != null) {\n" +
- " foo();\n" +
- " }\n" +
- " scope = scope.parent;\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1022() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean bool() { return true; }\n" +
- " void doSomething() {}\n" +
- " \n" +
- " void foo() {\n" +
- " Object progressJob = null;\n" +
- " while (bool()) {\n" +
- " if (bool()) {\n" +
- " if (progressJob != null)\n" +
- " progressJob = null;\n" +
- " doSomething();\n" +
- " }\n" +
- " try {\n" +
- " if (progressJob == null) {\n" +
- " progressJob = new Object();\n" +
- " }\n" +
- " } finally {\n" +
- " doSomething();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "");
-}
-
-public void test1023() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " while (this != null) {\n" +
- " try {\n" +
- " o = null;\n" +
- " break;\n" +
- " } finally {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " if (o == null) return;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " if (o == null) return;\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-public void test1024() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " boolean bool() { return true; }\n" +
- " void doSomething() {}\n" +
- " \n" +
- " void foo() {\n" +
- " Object progressJob = null;\n" +
- " while (bool()) {\n" +
- " if (progressJob != null)\n" +
- " progressJob = null;\n" +
- " doSomething();\n" +
- " try {\n" +
- " if (progressJob == null) {\n" +
- " progressJob = new Object();\n" +
- " }\n" +
- " } finally {\n" +
- " doSomething();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"},
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " if (progressJob == null) {\n" +
- " ^^^^^^^^^^^\n" +
- "The variable progressJob can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-public void test1025() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo() {\n" +
- " Object o;\n" +
- " try {\n" +
- " o = null;\n" +
- " } finally {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) return;\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 10)\n" +
- " if (o == null) return;\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// TODO (philippe) reenable once fixed
-public void _test1026() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " Object o;\n" +
- " try {\n" +
- " o = null;\n" +
- " } finally {\n" +
- " if (args == null) o = new Object();\n" +
- " }\n" +
- " if (o == null) System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n"},
- "SUCCESS");
-}
-
-public void test1027() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (b) {\n" +
- " try {\n" +
- " o = null;\n" +
- " } finally {\n" +
- " if (o == null) \n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " if (o == null) return;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// TODO (philippe) reenable once fixed
-public void _test1028() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean b;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " while (b) {\n" +
- " try {\n" +
- " o = null;\n" +
- " break;\n" +
- " } finally {\n" +
- " if (o == null) \n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " if (o == null) return;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test1029() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " Object o = null;\n" +
- " int i = 0;\n" +
- " while (i++ < 2) {\n" +
- " try {\n" +
- " if (i == 2) return;\n" +
- " o = null;\n" +
- " } finally {\n" +
- " if (i == 2) System.out.println(o);\n" +
- " o = \"SUCCESS\";\n" +
- " }\n" +
- " }\n" +
- " if (o == null) return;\n" +
- " }\n" +
- "}\n"},
- "SUCCESS");
-}
-
-public void test1030() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo() {\n" +
- " Object a = null;\n" +
- " while (true) {\n" +
- " a = null;\n" +
- " if (a == null) {\n" +
- " System.out.println();\n" +
- " }\n" +
- " a = new Object();\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (a == null) {\n" +
- " ^\n" +
- "The variable a can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-public void test1031() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo() {\n" +
- " Object a = null;\n" +
- " while (true) {\n" +
- " a = null;\n" +
- " if (a == null) {\n" +
- " System.out.println();\n" +
- " }\n" +
- " a = new Object();\n" +
- " break;\n" +
- " }\n" +
- " if (a == null) {\n" +
- " System.out.println();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " if (a == null) {\n" +
- " ^\n" +
- "The variable a can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 13)\n" +
- " if (a == null) {\n" +
- " ^\n" +
- "The variable a cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-public void test1032() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object o1 = this;\n" +
- " Object o3;\n" +
- " while (o1 != null && (o3 = o1) != null) {\n" +
- " o1 = o3;\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " while (o1 != null && (o3 = o1) != null) {\n" +
- " ^^\n" +
- "The variable o1 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " while (o1 != null && (o3 = o1) != null) {\n" +
- " ^^^^^^^^^\n" +
- "The variable o3 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// (simplified to focus on nulls)
-public void test1033() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo() {\n" +
- " String a,b;\n" +
- " do{\n" +
- " a=\"Hello \";\n" +
- " }while(a!=null);\n" +
- " if(a!=null)\n" +
- " { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " }while(a!=null);\n" +
- " ^\n" +
- "The variable a cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " if(a!=null)\n" +
- " ^\n" +
- "The variable a can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// from AssignmentTest#test034, simplified
-public void test1034() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public final class X \n" +
- "{\n" +
- " void foo()\n" +
- " {\n" +
- " String rs = null;\n" +
- " try\n" +
- " {\n" +
- " rs = \"\";\n" +
- " return;\n" +
- " }\n" +
- " catch (Exception e)\n" +
- " {\n" +
- " }\n" +
- " finally\n" +
- " {\n" +
- " if (rs != null)\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " rs.toString();\n" +
- " }\n" +
- " catch (Exception e)\n" +
- " {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
- "}\n",
- },
- "");
-}
-
-public void test1036() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " void foo() {\n" +
- " Object o = new Object();\n" +
- " do {\n" +
- " o = null;\n" +
- " } while (o != null);\n" +
- " if (o == null) {\n" +
- " // throw new Exception();\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " } while (o != null);\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " if (o == null) {\n" +
- " ^\n" +
- "The variable o can only be null; it was either set to null or checked for null when last used\n" +
- "----------\n");
-}
-
-// encoding validation
-public void test1500() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, int i, boolean b, Object u) {\n" +
- " o.toString();\n" +
- " switch (i) {\n" +
- " case 0:\n" +
- " if (b) {\n" +
- " o = u;\n" +
- " } else {\n" +
- " o = new Object();\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " if (o == null) { /* empty */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// encoding validation
-public void test1501() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, int i, boolean b, Object u) {\n" +
- " if (b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " o.toString();\n" +
- " switch (i) {\n" +
- " case 0:\n" +
- " if (b) {\n" +
- " o = u;\n" +
- " } else {\n" +
- " o = new Object();\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " if (o == null) { /* empty */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// encoding validation
-public void test1502() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, int i, boolean b, Object u) {\n" +
- " if (b) {\n" +
- " o = u;\n" +
- " }\n" +
- " o.toString();\n" +
- " switch (i) {\n" +
- " case 0:\n" +
- " if (b) {\n" +
- " o = u;\n" +
- " } else {\n" +
- " o = new Object();\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " if (o == null) { /* empty */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// encoding validation
-public void test1503() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object o, int i, boolean b, Object u) {\n" +
- " if (b) {\n" +
- " o = u;\n" +
- " } else {\n" +
- " o = new Object();\n" +
- " }\n" +
- " o.toString();\n" +
- " switch (i) {\n" +
- " case 0:\n" +
- " if (b) {\n" +
- " o = u;\n" +
- " } else {\n" +
- " o = new Object();\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " if (o == null) { /* empty */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// flow info low-level validation
-public void test2000_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " void foo() {\n" +
- " Object o0 = new Object(), o1 = o0, o2 = o0, o3 = o0, o4 = o0,\n" +
- " o5 = o0, o6 = o0, o7 = o0, o8 = o0, o9 = o0,\n" +
- " o10 = o0, o11 = o0, o12 = o0, o13 = o0, o14 = o0,\n" +
- " o15 = o0, o16 = o0, o17 = o0, o18 = o0, o19 = o0,\n" +
- " o20 = o0, o21 = o0, o22 = o0, o23 = o0, o24 = o0,\n" +
- " o25 = o0, o26 = o0, o27 = o0, o28 = o0, o29 = o0,\n" +
- " o30 = o0, o31 = o0, o32 = o0, o33 = o0, o34 = o0,\n" +
- " o35 = o0, o36 = o0, o37 = o0, o38 = o0, o39 = o0,\n" +
- " o40 = o0, o41 = o0, o42 = o0, o43 = o0, o44 = o0,\n" +
- " o45 = o0, o46 = o0, o47 = o0, o48 = o0, o49 = o0,\n" +
- " o50 = o0, o51 = o0, o52 = o0, o53 = o0, o54 = o0,\n" +
- " o55 = o0, o56 = o0, o57 = o0, o58 = o0, o59 = o0,\n" +
- " o60 = o0, o61 = o0, o62 = o0, o63 = o0, o64 = o0,\n" +
- " o65 = o0, o66 = o0, o67 = o0, o68 = o0, o69 = o0;\n" +
- " if (o65 == null) { /* */ }\n" + // complain
- " if (o65 != null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " if (o65 == null) { /* */ }\n" +
- " ^^^\n" +
- "The variable o65 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-public void test2001_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " void foo(\n" +
- " Object o0, Object o1, Object o2, Object o3, Object o4,\n" +
- " Object o5, Object o6, Object o7, Object o8, Object o9,\n" +
- " Object o10, Object o11, Object o12, Object o13, Object o14,\n" +
- " Object o15, Object o16, Object o17, Object o18, Object o19,\n" +
- " Object o20, Object o21, Object o22, Object o23, Object o24,\n" +
- " Object o25, Object o26, Object o27, Object o28, Object o29,\n" +
- " Object o30, Object o31, Object o32, Object o33, Object o34,\n" +
- " Object o35, Object o36, Object o37, Object o38, Object o39,\n" +
- " Object o40, Object o41, Object o42, Object o43, Object o44,\n" +
- " Object o45, Object o46, Object o47, Object o48, Object o49,\n" +
- " Object o50, Object o51, Object o52, Object o53, Object o54,\n" +
- " Object o55, Object o56, Object o57, Object o58, Object o59,\n" +
- " Object o60, Object o61, Object o62, Object o63, Object o64,\n" +
- " Object o65, Object o66, Object o67, Object o68, Object o69) {\n" +
- " if (o65 == null) { /* */ }\n" +
- " if (o65 != null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test2002_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo(Object o) {\n" +
- " if (o == null) { /* */ }\n" +
- " if (o != null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test2003_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo(Object o) {\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test2004_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The local variable o may not have been initialized\n" +
- "----------\n");
-}
-
-public void test2005_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo(Object o) {\n" +
- " o = null;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test2006_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo() {\n" +
- " Object o = null;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test2007_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo() {\n" +
- " Object o[] = null;\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- flow info
-public void test2008_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo(boolean b) {\n" +
- " Object o = null;\n" +
- " while (o == null) {\n" +
- // quiet: first iteration is sure to find o null,
- // but other iterations may change it
- " try { /* */ }\n" +
- " finally {\n" +
- " if (b) {\n" +
- " o = new Object();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-// null analysis -- flow info
-public void test2009_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m0, m1, m2, m3, m4,\n" +
- " m5, m6, m7, m8, m9,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo(Object o) {\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 20)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- flow info
-public void test2010_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m00, m01, m02, m03, m04,\n" +
- " m05, m06, m07, m08, m09,\n" +
- " m10, m11, m12, m13, m14,\n" +
- " m15, m16, m17, m18, m19,\n" +
- " m20, m21, m22, m23, m24,\n" +
- " m25, m26, m27, m28, m29,\n" +
- " m30, m31, m32, m33, m34,\n" +
- " m35, m36, m37, m38, m39,\n" +
- " m40, m41, m42, m43, m44,\n" +
- " m45, m46, m47, m48, m49,\n" +
- " m50, m51, m52, m53, m54,\n" +
- " m55, m56, m57, m58, m59,\n" +
- " m60, m61, m62, m63;\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " try { /* */ }\n" +
- " finally {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 21)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- flow info
-public void test2011_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " void foo() {\n" +
- " Object o000, o001, o002, o003, o004, o005, o006, o007, o008, o009,\n" +
- " o010, o011, o012, o013, o014, o015, o016, o017, o018, o019,\n" +
- " o020, o021, o022, o023, o024, o025, o026, o027, o028, o029,\n" +
- " o030, o031, o032, o033, o034, o035, o036, o037, o038, o039,\n" +
- " o040, o041, o042, o043, o044, o045, o046, o047, o048, o049,\n" +
- " o050, o051, o052, o053, o054, o055, o056, o057, o058, o059,\n" +
- " o060, o061, o062, o063;\n" +
- " Object o;\n" +
- " try {\n" +
- " o000 = new Object();\n" +
- " }\n" +
- " finally {\n" +
- " o = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 24)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- flow info
-public void test2012_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " void foo() {\n" +
- " Object o000, o001, o002, o003, o004, o005, o006, o007, o008, o009,\n" +
- " o010, o011, o012, o013, o014, o015, o016, o017, o018, o019,\n" +
- " o020, o021, o022, o023, o024, o025, o026, o027, o028, o029,\n" +
- " o030, o031, o032, o033, o034, o035, o036, o037, o038, o039,\n" +
- " o040, o041, o042, o043, o044, o045, o046, o047, o048, o049,\n" +
- " o050, o051, o052, o053, o054, o055, o056, o057, o058, o059,\n" +
- " o060, o061, o062, o063;\n" +
- " Object o;\n" +
- " try {\n" +
- " o = new Object();\n" +
- " }\n" +
- " finally {\n" +
- " o000 = new Object();\n" +
- " }\n" +
- " if (o == null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 24)\n" +
- " if (o == null) { /* */ }\n" +
- " ^\n" +
- "The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" +
- "----------\n");
-}
-
-// null analysis -- flow info
-public void test2013_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " Object m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " void foo(Object u) {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " o = u;\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-// null analysis -- flow info
-public void test2014_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " int m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " final int m064;\n" +
- " X() {\n" +
- " m064 = 10;\n" +
- " class Inner extends X {\n" +
- " int m100, m101, m102, m103, m104, m105, m106, m107, m108, m109,\n" +
- " m110, m111, m112, m113, m114, m115, m116, m117, m118, m119,\n" +
- " m120, m121, m122, m123, m124, m125, m126, m127, m128, m129,\n" +
- " m130, m131, m132, m133, m134, m135, m136, m137, m138, m139,\n" +
- " m140, m141, m142, m143, m144, m145, m146, m147, m148, m149,\n" +
- " m150, m151, m152, m153, m154, m155, m156, m157, m158, m159,\n" +
- " m160, m161, m162, m163;\n" +
- " final int m164;\n" +
- " int bar() {\n" +
- " return m100 + m101 + m102 + m103 + m104 +\n" +
- " m105 + m106 + m107 + m108 + m109 +\n" +
- " m110 + m111 + m112 + m113 + m114 +\n" +
- " m115 + m116 + m117 + m118 + m119 +\n" +
- " m120 + m121 + m122 + m123 + m124 +\n" +
- " m125 + m126 + m127 + m128 + m129 +\n" +
- " m130 + m131 + m132 + m133 + m134 +\n" +
- " m135 + m136 + m137 + m138 + m139 +\n" +
- " m140 + m141 + m142 + m143 + m144 +\n" +
- " m145 + m146 + m147 + m148 + m149 +\n" +
- " m150 + m151 + m152 + m153 + m154 +\n" +
- " m155 + m156 + m157 + m158 + m159 +\n" +
- " m160 + m161 + m162 + m163 + m164;\n" +
- " }\n" +
- " };\n" +
- " System.out.println((new Inner()).bar());\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 12)\n" +
- " class Inner extends X {\n" +
- " ^^^^^\n" +
- "The blank final field m164 may not have been initialized\n" +
- "----------\n");
-}
-
-// null analysis -- flow info
-public void test2015_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " int m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " final int m200;\n" +
- " int m201, m202, m203, m204, m205, m206, m207, m208, m209,\n" +
- " m210, m211, m212, m213, m214, m215, m216, m217, m218, m219,\n" +
- " m220, m221, m222, m223, m224, m225, m226, m227, m228, m229,\n" +
- " m230, m231, m232, m233, m234, m235, m236, m237, m238, m239,\n" +
- " m240, m241, m242, m243, m244, m245, m246, m247, m248, m249,\n" +
- " m250, m251, m252, m253, m254, m255, m256, m257, m258, m259,\n" +
- " m260, m261, m262, m263;\n" +
- " int m301, m302, m303, m304, m305, m306, m307, m308, m309,\n" +
- " m310, m311, m312, m313, m314, m315, m316, m317, m318, m319,\n" +
- " m320, m321, m322, m323, m324, m325, m326, m327, m328, m329,\n" +
- " m330, m331, m332, m333, m334, m335, m336, m337, m338, m339,\n" +
- " m340, m341, m342, m343, m344, m345, m346, m347, m348, m349,\n" +
- " m350, m351, m352, m353, m354, m355, m356, m357, m358, m359,\n" +
- " m360, m361, m362, m363;\n" +
- " X() {\n" +
- " m200 = 10;\n" +
- " class Inner extends X {\n" +
- " int m100, m101, m102, m103, m104, m105, m106, m107, m108, m109,\n" +
- " m110, m111, m112, m113, m114, m115, m116, m117, m118, m119,\n" +
- " m120, m121, m122, m123, m124, m125, m126, m127, m128, m129,\n" +
- " m130, m131, m132, m133, m134, m135, m136, m137, m138, m139,\n" +
- " m140, m141, m142, m143, m144, m145, m146, m147, m148, m149,\n" +
- " m150, m151, m152, m153, m154, m155, m156, m157, m158, m159,\n" +
- " m160, m161, m162, m163;\n" +
- " final int m164;\n" +
- " int bar() {\n" +
- " return m100 + m101 + m102 + m103 + m104 +\n" +
- " m105 + m106 + m107 + m108 + m109 +\n" +
- " m110 + m111 + m112 + m113 + m114 +\n" +
- " m115 + m116 + m117 + m118 + m119 +\n" +
- " m120 + m121 + m122 + m123 + m124 +\n" +
- " m125 + m126 + m127 + m128 + m129 +\n" +
- " m130 + m131 + m132 + m133 + m134 +\n" +
- " m135 + m136 + m137 + m138 + m139 +\n" +
- " m140 + m141 + m142 + m143 + m144 +\n" +
- " m145 + m146 + m147 + m148 + m149 +\n" +
- " m150 + m151 + m152 + m153 + m154 +\n" +
- " m155 + m156 + m157 + m158 + m159 +\n" +
- " m160 + m161 + m162 + m163 + m164;\n" +
- " }\n" +
- " };\n" +
- " System.out.println((new Inner()).bar());\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 26)\n" +
- " class Inner extends X {\n" +
- " ^^^^^\n" +
- "The blank final field m164 may not have been initialized\n" +
- "----------\n");
-}
-
-// null analysis -- flow info
-public void test2016_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " int m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061;\n" +
- " final int m062;\n" +
- " {\n" +
- " int l063, m201 = 0, m202, m203, m204, m205, m206, m207, m208, m209,\n" +
- " m210, m211, m212, m213, m214, m215, m216, m217, m218, m219,\n" +
- " m220, m221, m222, m223, m224, m225, m226, m227, m228, m229,\n" +
- " m230, m231, m232, m233, m234, m235, m236, m237, m238, m239,\n" +
- " m240, m241, m242, m243, m244, m245, m246, m247, m248, m249,\n" +
- " m250, m251, m252, m253, m254, m255, m256, m257, m258, m259,\n" +
- " m260, m261, m262, m263;\n" +
- " int m301, m302, m303, m304, m305, m306, m307, m308, m309,\n" +
- " m310, m311, m312, m313, m314, m315, m316, m317, m318, m319,\n" +
- " m320, m321, m322, m323, m324, m325, m326, m327, m328, m329,\n" +
- " m330, m331, m332, m333, m334, m335, m336, m337, m338, m339,\n" +
- " m340, m341, m342, m343, m344, m345, m346, m347, m348, m349,\n" +
- " m350, m351, m352, m353, m354, m355, m356, m357, m358, m359,\n" +
- " m360 = 0, m361 = 0, m362 = 0, m363 = 0;\n" +
- " m062 = m360;\n" +
- " }\n" +
- " X() {\n" +
- " int l0, l1;\n" +
- " m000 = l1;\n" +
- " class Inner extends X {\n" +
- " int bar() {\n" +
- " return 0;\n" +
- " }\n" +
- " };\n" +
- " System.out.println((new Inner()).bar());\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 29)\n" +
- " m000 = l1;\n" +
- " ^^\n" +
- "The local variable l1 may not have been initialized\n" +
- "----------\n");
-}
-
-public void test2017_flow_info() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " Object m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " void foo(Object u) {\n" +
- " Object o = null;\n" +
- " while (dummy) {\n" +
- " if (dummy) {\n" + // uncorrelated
- " o = u;\n" +
- " continue;\n" +
- " }\n" +
- " }\n" +
- " if (o != null) { /* */ }\n" +
- " }\n" +
- "}\n"},
- "");
-}
-
-public void test2018_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " Object m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " while (dummy) {\n" +
- " if (dummy) {\n" + // uncorrelated
- " o = null;\n" +
- " continue;\n" +
- " }\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The local variable o may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-public void test2019_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " Object m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " while (dummy) {\n" +
- " if (dummy) {\n" + // uncorrelated
- " continue;\n" +
- " }\n" +
- " o = null;\n" +
- " }\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 18)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The local variable o may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 18)\n" +
- " o.toString();\n" +
- " ^\n" +
- "The variable o may be null\n" +
- "----------\n");
-}
-
-public void test2020_flow_info() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " boolean dummy;\n" +
- " Object m000, m001, m002, m003, m004, m005, m006, m007, m008, m009,\n" +
- " m010, m011, m012, m013, m014, m015, m016, m017, m018, m019,\n" +
- " m020, m021, m022, m023, m024, m025, m026, m027, m028, m029,\n" +
- " m030, m031, m032, m033, m034, m035, m036, m037, m038, m039,\n" +
- " m040, m041, m042, m043, m044, m045, m046, m047, m048, m049,\n" +
- " m050, m051, m052, m053, m054, m055, m056, m057, m058, m059,\n" +
- " m060, m061, m062, m063;\n" +
- " int m200, m201, m202, m203, m204, m205, m206, m207, m208, m209,\n" +
- " m210, m211, m212, m213, m214, m215, m216, m217, m218, m219,\n" +
- " m220, m221, m222, m223, m224, m225, m226, m227, m228, m229,\n" +
- " m230, m231, m232, m233, m234, m235, m236, m237, m238, m239,\n" +
- " m240, m241, m242, m243, m244, m245, m246, m247, m248, m249,\n" +
- " m250, m251, m252, m253, m254, m255, m256, m257, m258, m259,\n" +
- " m260, m261;\n" +
- " void foo() {\n" +
- " Object o0, o1;\n" +
- " while (dummy) {\n" +
- " o0 = new Object();\n" +
- " if (dummy) {\n" + // uncorrelated
- " o1 = null;\n" +
- " continue;\n" +
- " }\n" +
- " }\n" +
- " o1.toString();\n" +
- " }\n" +
- "}\n"},
- "----------\n" +
- "1. ERROR in X.java (at line 26)\n" +
- " o1.toString();\n" +
- " ^^\n" +
- "The local variable o1 may not have been initialized\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 26)\n" +
- " o1.toString();\n" +
- " ^^\n" +
- "The variable o1 may be null\n" +
- "----------\n");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NumericTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NumericTest.java
deleted file mode 100644
index 888e582..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NumericTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class NumericTest extends AbstractRegressionTest {
-
-public NumericTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public void test001() {
- this.runConformTest(new String[] {
- "p/B.java",
- "package p;\n" +
- "public class B {\n" +
- " public static void main(String[] args) {\n" +
- " int offset = -8;\n" +
- " int temp = 0 - offset;\n" +
- " offset = 0 - offset; // This is the problem line\n" +
- " System.out.println(\"offset: \" + offset);\n" +
- " System.out.println(\"temp: \" + temp);\n" +
- " if (offset != temp ) {\n" +
- " System.err.println(\"offset (\" + offset + \") should be equal to temp (\" + temp + \").\");\n" +
- " System.exit(-1);\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test002() {
- this.runConformTest(new String[] {
- "p/Y.java",
- "package p;\n" +
- "public class Y {\n" +
- " public static void main(String[] args) {\n" +
- " int clockend = 0;\n" +
- " clockend += 128;\n" +
- " if(clockend < 0) {\n" +
- " System.out.println(clockend);\n" +
- " System.exit(-1);\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=133738
-public void test003() {
- this.runNegativeTest(new String[] {
- "X.java",
- "public class X {\n" +
- " int i1 = -2147483648;\n" +
- " int i2 = -(2147483648);\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int i2 = -(2147483648);\n" +
- " ^^^^^^^^^^^^\n" +
- "The literal 2147483648 of type int is out of range \n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=133738
-public void test004() {
- this.runNegativeTest(new String[] {
- "X.java",
- "public class X {\n" +
- " long l1 = -9223372036854775808L;\n" +
- " long l2 = -(9223372036854775808L);\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " long l2 = -(9223372036854775808L);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The literal 9223372036854775808L of type long is out of range \n" +
- "----------\n");
-}
-public static Class testClass() {
- return NumericTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/OaaMetadataTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/OaaMetadataTests.java
deleted file mode 100644
index 2e71f10..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/OaaMetadataTests.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.HashMap;
-
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.oaametadata.ClassData;
-import org.eclipse.wst.jsdt.internal.oaametadata.IOAAMetaDataConstants;
-import org.eclipse.wst.jsdt.internal.oaametadata.LibraryAPIs;
-import org.eclipse.wst.jsdt.internal.oaametadata.MetadataReader;
-
-
-public class OaaMetadataTests extends AbstractRegressionTest {
-
-
- static final String LIB1=
- "<api xmlns=\"http://ns.openajax.org/api\" version=\"...\" apiType=\"JavaScript\">"
- +" <class name=\"libraryname.ClassName\" superclass=\"Object\">"
- +" <constructors>"
- +" <constructor scope=\"instance\">"
- +" <description>Constructor description</description>"
- +" <parameters>"
- +" <parameter name=\"message\" required=\"true\" datatype=\"String\">"
- +" <description>Parameter description</description>"
- +" </parameter>"
- +" </parameters>"
- +" <returns datatype=\"Object\">"
- +" <description>...</description>"
- +" </returns>"
- +" </constructor>"
- +" </constructors>"
- +" <fields>"
- +" <field name=\"propertyInstance\" readonly=\"false\" scope=\"instance\" datatype=\"String\">"
- +" <description>Property description</description>"
- +" </field>"
- +" <field name=\"propertyStatic\" readonly=\"false\" scope=\"static\" datatype=\"String\">"
- +" <description>Property description</description>"
- +" </field>"
- +" </fields>"
- +" <methods>"
- +" <method name=\"functionInstance\" scope=\"instance\">"
- +" <description>Method description</description>"
- +" <parameters>"
- +" <parameter name=\"param\" required=\"true\" datatype=\"String\">"
- +" <description>Parameter description</description>"
- +" </parameter>"
- +" </parameters>"
- +" <returns datatype=\"String\">"
- +" <description>...</description>"
- +" </returns>"
- +" </method>"
- +" <method name=\"functionStatic\" scope=\"static\">"
- +" <description>Method description</description>"
- +" <parameters/>"
- +" <returns datatype=\"String\">"
- +" <description>...</description>"
- +" </returns>"
- +" </method>"
- +" </methods>"
- +" </class>"
- +"</api>";
-
- public OaaMetadataTests(String name) {
- super(name);
-
- }
-
- protected void runNegativeTest(String[] testFiles,String[]classLib, String expectedProblemLog) {
- HashMap options = new HashMap();
- String[] defaultClassPaths = getDefaultClassPaths();
- String [] classLibs=new String[classLib.length+defaultClassPaths.length];
- System.arraycopy(classLib, 0, classLibs, 0, classLib.length);
- System.arraycopy(defaultClassPaths, 0, classLibs, classLib.length, defaultClassPaths.length);
- runNegativeTest(
- testFiles,
- expectedProblemLog,
- classLibs ,
- false /* flush output directory */,
- options /* no custom options */,
- false /* do not generate output */,
- false /* do not show category */,
- false /* do not show warning token */,
- false /* do not skip javac for this peculiar test */,
- false /* do not perform statements recovery */,
- null);
- }
-
-
-
- public void test001()
- {
-
- LibraryAPIs apis=MetadataReader.readAPIsFromString(LIB1,"");
- assertTrue(apis.classes!=null && apis.classes.length==1);
- }
-
-
- public void test003() { // local var
- String libDir=Util.copyToOutput("libDir/"+IOAAMetaDataConstants.METADATA_FILE, LIB1);
- this.runNegativeTest(
- new String[] {
- "X.js",
- "var i=new libraryname.ClassName(1);\n" +
- "var d=i.propertyInstance;\n" +
- "var e=i.functionInstance(1);\n" +
- "\n"
- },
- new String[]{libDir},
- ""
- );
- }
-
-
- public void testInclude1() {
- String base="<api xmlns=\"http://ns.openajax.org/api\" version=\"...\" apiType=\"JavaScript\">"
- +" <class name=\"cls1\" superclass=\"Object\">"
- +" <include src=\"incl2.xml\"/>"
- +" </class>"
- +" <include src=\"..\\incl1.xml\"/>"
- +"</api>";
- String incl1="<fragment xmlns=\"http://ns.openajax.org/api\">"
- +" <class name=\"cls2\" superclass=\"Object\">"
- +" </class>"
- +"</fragment>";
- String incl2="<fragment xmlns=\"http://ns.openajax.org/api\">"
- +" <method name=\"functionInstance\" scope=\"instance\"/>"
- +"</fragment>";
-
- String filePath=Util.copyToOutput("libDir/"+IOAAMetaDataConstants.METADATA_FILE, base);
- Util.copyToOutput("incl1.xml", incl1);
- Util.copyToOutput("libDir/incl2.xml", incl2);
-
- LibraryAPIs apis=MetadataReader.readAPIsFromFile(filePath);
- assertTrue(apis.classes!=null && apis.classes.length==2);
-
- ClassData classData = apis.classes[0];
- assertTrue(classData.methods!=null && classData.methods.length==1);
-
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemConstructorTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemConstructorTest.java
deleted file mode 100644
index 134221d..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemConstructorTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class ProblemConstructorTest extends AbstractRegressionTest {
-
-public ProblemConstructorTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-public static Class testClass() {
- return ProblemConstructorTest.class;
-}
-
-public void test001() {
- this.runNegativeTest(
- new String[] {
- "prs/Test1.java",
- "package prs; \n" +
- "import java.io.IOException; \n" +
- "public class Test1 { \n" +
- "String s = 3; \n" +
- "Test1() throws IOException { \n" +
- "} \n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in prs\\Test1.java (at line 4)\n" +
- " String s = 3; \n" +
- " ^\n" +
- "Type mismatch: cannot convert from int to String\n" +
- "----------\n",
- null,
- true,
- null,
- true,
- false,
- false);
-
- this.runNegativeTest(
- new String[] {
- "prs/Test2.java",
- "package prs; \n" +
- "import java.io.IOException; \n" +
- "public class Test2 { \n" +
- "public void foo() { \n" +
- "try { \n" +
- "Test1 t = new Test1(); \n" +
- "System.out.println(); \n" +
- "} catch(IOException e) \n" +
- "{ \n" +
- "e.printStackTrace(); \n" +
- "} \n" +
- "} \n" +
- "}"
- },
- "",
- null,
- false);
-}
-// 49843
-public void test002() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public X();\n" +
- " public Y();\n" +
- " \n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public X();\n" +
- " ^^^\n" +
- "This method requires a body instead of a semicolon\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " public Y();\n" +
- " ^^^\n" +
- "Return type for the method is missing\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " public Y();\n" +
- " ^^^\n" +
- "This method requires a body instead of a semicolon\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=163443
-public void test003() {
- this.runNegativeTest(
- new String[] {
- "Example.java",
- "class Example {\n" +
- " private Example() {\n" +
- " }\n" +
- " public Example(int i) {\n" +
- " }\n" +
- "}\n" +
- "class E1 {\n" +
- " private E1(int i) {}\n" +
- " private E1(long l) {}\n" +
- "}\n" +
- "class E2 {\n" +
- " private E2(int i) {}\n" +
- "}\n" +
- "class E3 {\n" +
- " public E3(int i) {}\n" +
- " Zork z;\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in Example.java (at line 2)\n" +
- " private Example() {\n" +
- " ^^^^^^^^^\n" +
- "The constructor Example() is never used locally\n" +
- "----------\n" +
- "2. ERROR in Example.java (at line 16)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java
deleted file mode 100644
index f94f6b1..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class ProblemTypeAndMethodTest extends AbstractRegressionTest {
-public ProblemTypeAndMethodTest(String name) {
- super(name);
-}
-// Static initializer to specify tests subset using TESTS_* static variables
-// All specified tests which does not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "test127" };
-// TESTS_NUMBERS = new int[] { 5 };
-// TESTS_RANGE = new int[] { 169, 180 };
-}
-
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public static Class testClass() {
- return ProblemTypeAndMethodTest.class;
-}
-
-public void test001() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " interface Moosh { void foo(); }\n" +
- "\n" +
- " static abstract class A implements Moosh {}\n" +
- "\n" +
- " static class W extends A {}\n" +
- " static class Y extends A {}\n" +
- " static class Z extends A {}\n" +
- " public static void main(String[] args) {\n" +
- " new W(); // throws ClassFormatError\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " static class W extends A {}\n" +
- " ^\n" +
- "The type X.W must implement the inherited abstract method X.Moosh.foo()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " static class Y extends A {}\n" +
- " ^\n" +
- "The type X.Y must implement the inherited abstract method X.Moosh.foo()\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " static class Z extends A {}\n" +
- " ^\n" +
- "The type X.Z must implement the inherited abstract method X.Moosh.foo()\n" +
- "----------\n",
- null /* no extra class libraries */,
- true /* flush output directory */,
- null /* no custom options */,
- true /* do not generate output */,
- false /* do not show category */,
- false /* do not show warning token */,
- false /* do not skip javac for this peculiar test */,
- false /* do not perform statements recovery */,
- null);
-// ClassFileReader reader = this.getClassFileReader(OUTPUT_DIR + File.separator +"X$W.class", "X$W");
-// IBinaryMethod[] methods = reader.getMethods();
-// assertEquals("Wrong size", 2, methods.length);
-// int counter = 0;
-// for (int i = 0; i < 2; i++) {
-// IBinaryMethod method = methods[i];
-// if (new String(method.getSelector()).equals("foo")) {
-// counter++;
-// }
-// }
-// assertEquals("Wrong number of foo method", 1, counter);
-//
-// reader = this.getClassFileReader(OUTPUT_DIR + File.separator +"X$Y.class", "X$Y");
-// methods = reader.getMethods();
-// assertEquals("Wrong size", 2, methods.length);
-// counter = 0;
-// for (int i = 0; i < 2; i++) {
-// IBinaryMethod method = methods[i];
-// if (new String(method.getSelector()).equals("foo")) {
-// counter++;
-// }
-// }
-// assertEquals("Wrong number of foo method", 1, counter);
-//
-// reader = this.getClassFileReader(OUTPUT_DIR + File.separator +"X$Z.class", "X$Z");
-// methods = reader.getMethods();
-// assertEquals("Wrong size", 2, methods.length);
-// counter = 0;
-// for (int i = 0; i < 2; i++) {
-// IBinaryMethod method = methods[i];
-// if (new String(method.getSelector()).equals("foo")) {
-// counter++;
-// }
-// }
-// assertEquals("Wrong number of foo method", 1, counter);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RegressionTestSetup.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RegressionTestSetup.java
deleted file mode 100644
index c32d341..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RegressionTestSetup.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import org.eclipse.wst.jsdt.core.tests.util.CompilerTestSetup;
-import org.eclipse.wst.jsdt.core.tests.util.TestVerifier;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.env.INameEnvironment;
-import org.eclipse.wst.jsdt.internal.compiler.batch.FileSystem;
-
-import junit.framework.*;
-
-public class RegressionTestSetup extends CompilerTestSetup {
-
- TestVerifier verifier = new TestVerifier(true);
- INameEnvironment javaClassLib;
-
- public RegressionTestSetup(Test test, String complianceLevel) {
- super(test, complianceLevel);
- }
-
- protected void setUp() {
- if (this.javaClassLib == null) {
- // Create name environment
- this.javaClassLib = new FileSystem(Util.getJavaClassLibs(), new String[0], null);
- }
- super.setUp();
- }
- protected void tearDown() {
- this.verifier.shutDown();
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/Requestor.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/Requestor.java
deleted file mode 100644
index 8e37c2a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/Requestor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Hashtable;
-
-import junit.framework.Assert;
-
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.internal.compiler.CompilationResult;
-import org.eclipse.wst.jsdt.internal.compiler.ICompilerRequestor;
-import org.eclipse.wst.jsdt.internal.compiler.IProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblem;
-import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
-
-public class Requestor extends Assert implements ICompilerRequestor {
- public boolean hasErrors = false;
- public IProblemFactory problemFactory;
- public String outputPath;
- private boolean generateOutput;
- public Hashtable expectedProblems = new Hashtable();
- public String problemLog = "";
- public ICompilerRequestor clientRequestor;
- public boolean showCategory = false;
- public boolean showWarningToken = false;
-
-public Requestor(IProblemFactory problemFactory, String outputPath, boolean generateOutput, ICompilerRequestor clientRequestor, boolean showCategory, boolean showWarningToken) {
- this.problemFactory = problemFactory;
- this.outputPath = outputPath;
- this.generateOutput = generateOutput;
- this.clientRequestor = clientRequestor;
- this.showCategory = showCategory;
- this.showWarningToken = showWarningToken;
-}
-public void acceptResult(CompilationResult compilationResult) {
- StringBuffer buffer = new StringBuffer(100);
- hasErrors |= compilationResult.hasErrors();
- if (compilationResult.hasProblems() || compilationResult.hasTasks()) {
- CategorizedProblem[] problems = compilationResult.getAllProblems();
- int count = problems.length;
- int problemCount = 0;
- char[] unitSource = compilationResult.compilationUnit.getContents();
- for (int i = 0; i < count; i++) {
- DefaultProblem problem = (DefaultProblem) problems[i];
- if (problem != null) {
- if (problemCount == 0)
- buffer.append("----------\n");
- problemCount++;
- buffer.append(problemCount + (problem.isError() ? ". ERROR" : ". WARNING"));
- buffer.append(" in " + new String(problem.getOriginatingFileName()).replace('/', '\\'));
- try {
- buffer.append(problem.errorReportSource(unitSource));
- buffer.append("\n");
- if (showCategory) {
- String category = problem.getInternalCategoryMessage();
- if (category != null) {
- buffer.append("[@cat:").append(category).append("] ");
- }
- }
- if (showWarningToken) {
- long irritant = ProblemReporter.getIrritant(problem.getID());
- if (irritant != 0) {
- String warningToken = CompilerOptions.warningTokenFromIrritant(irritant);
- if (warningToken != null) {
- buffer.append("[@sup:").append(warningToken).append("] ");
- }
- }
- }
- buffer.append(problem.getMessage());
- buffer.append("\n");
- } catch (Exception e) {
- }
- buffer.append("----------\n");
- }
- }
- problemLog += buffer.toString();
- }
- if (this.clientRequestor != null) {
- this.clientRequestor.acceptResult(compilationResult);
- }
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RunComparableTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RunComparableTests.java
deleted file mode 100644
index aa940ce..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RunComparableTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
-import org.eclipse.wst.jsdt.core.tests.future.compiler.regression.AmbiguousMethodTest;
-import org.eclipse.wst.jsdt.core.tests.future.compiler.regression.Compliance_1_5;
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Run all compiler regression tests
- */
-public class RunComparableTests extends junit.framework.TestCase {
-
- public static ArrayList ALL_CLASSES = null;
- static {
- ALL_CLASSES = new ArrayList();
- ALL_CLASSES.add(AmbiguousMethodTest.class);
-// ALL_CLASSES.add(AutoBoxingTest.class);
- ALL_CLASSES.add(Compliance_1_5.class);
-// ALL_CLASSES.add(ForeachStatementTest.class);
- ALL_CLASSES.add(StaticImportTest.class);
- ALL_CLASSES.add(VarargsTest.class);
- ALL_CLASSES.add(MethodVerifyTest.class);
-// ALL_CLASSES.add(EnclosingMethodAttributeTest.class);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- }
-
- public RunComparableTests(String testName) {
- super(testName);
- }
-
- public static Test suite() {
- TestSuite ts = new TestSuite(RunComparableTests.class.getName());
- for (int i = 0, size=ALL_CLASSES.size(); i < size; i++) {
- Class testClass = (Class) ALL_CLASSES.get(i);
- try {
- Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
- Test suite = (Test)suiteMethod.invoke(null, new Object[0]);
- ts.addTest(suite);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- return ts;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RuntimeTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RuntimeTests.java
deleted file mode 100644
index f8d7019..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RuntimeTests.java
+++ /dev/null
@@ -1,540 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Here we focus on various aspects of the runtime behavior of the generated
- * code.
- */
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class RuntimeTests extends AbstractRegressionTest {
-
-public RuntimeTests(String name) {
- super(name);
-}
-
-// Static initializer to specify tests subset using TESTS_* static variables
-// All specified tests which does not belong to the class are skipped...
-// Only the highest compliance level is run; add the VM argument
-// -Dcompliance=1.4 (for example) to lower it if needed
-static {
-// TESTS_NAMES = new String[] { "test0001" };
-// TESTS_NUMBERS = new int[] { 1 };
-// TESTS_RANGE = new int[] { 1, -1 };
-}
-
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public static Class testClass() {
- return RuntimeTests.class;
-}
-
-// memory exhaustion - try to allocate too big an instance
-public void test0001_memory_exhaustion() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " try {" +
- " Y y = new Y(Integer.MAX_VALUE);\n" +
- " }" +
- " catch (OutOfMemoryError e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " return;\n" +
- " }\n" +
- " System.out.println(\"FAILURE\");\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " long storage[];\n" +
- " Y(int itemsNb) {\n" +
- " storage = new long[itemsNb];\n" +
- " }\n" +
- "}\n"},
- "SUCCESS"
- );
-}
-
-// synchronization - concurrent access to a resource with explicit and
-// implicit locks
-public void test0500_synchronization() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main (String args[]) {\n" +
- " new Lock().implicitLock();\n" +
- "}\n" +
- "}\n" +
- "class Lock extends Thread {\n" +
- " byte step = 0;\n" +
- " void logStep(String start) {\n" +
- " System.out.println(start + \" \" + this.step); //$NON-NLS-1$\n" +
- " }\n" +
- " public void run() {\n" +
- " for (int i = 1; i < 3; i++) {\n" +
- " logStep(\"explicit lock\"); //$NON-NLS-1$\n" +
- " synchronized (this) {\n" +
- " this.step++;\n" +
- " notify();\n" +
- " while(this.step < 2 * i) {\n" +
- " try {\n" +
- " wait();\n" +
- " } catch (InterruptedException e) {\n" +
- " System.out.println(\"EXCEPTION\"); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " synchronized void implicitLock() {\n" +
- " this.start();\n" +
- " for (int i = 0; i < 2; i++) {\n" +
- " while (this.step < 1 + i * 2) {\n" +
- " try {\n" +
- " wait();\n" +
- " } catch (InterruptedException e) {\n" +
- " System.out.println(\"EXCEPTION\"); //$NON-NLS-1$\n" +
- " }\n" +
- " }\n" +
- " logStep(\"implicit lock\"); //$NON-NLS-1$\n" +
- " this.step++;\n" +
- " notify();\n" +
- " }\n" +
- " return;\n" +
- " }\n" +
- "}\n"},
- "explicit lock 0\n" +
- "implicit lock 1\n" +
- "explicit lock 2\n" +
- "implicit lock 3"
- );
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=126712
-// reflection - access to a public method of a package visible
-// class through a public extending class
-public void _test0600_reflection() {
- if (COMPLIANCE_1_3.equals(this.complianceLevel) ||
- COMPLIANCE_1_4.equals(this.complianceLevel)) {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.lang.reflect.*;\n" +
- "import p.*;\n" +
- "public class X {\n" +
- "static public void main (String args[]) {\n" +
- " Y y = new Y();\n" +
- " try {\n" +
- " Method foo = Y.class.getMethod(\"foo\", null);\n" +
- " foo.invoke(y, null);\n" +
- " y.foo();\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " System.out.println(\"FAILURE: \" + t.getMessage());\n" +
- " t.printStackTrace(System.out);\n" +
- " }\n" +
- "}\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y extends Z {\n" +
- " /* empty */\n" +
- "}\n",
- "p/Z.java",
- "package p;\n" +
- "class Z {\n" +
- " public void foo() {\n" +
- " System.out.println(\"SUCCESS\"); //$NON-NLS-1$\n" +
- " }\n" +
- "}\n"},
- "SUCCESS\nSUCCESS"
- );
- }
- else {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.lang.reflect.*;\n" +
- "import p.*;\n" +
- "public class X {\n" +
- "static public void main (String args[]) {\n" +
- " Y y = new Y();\n" +
- " try {\n" +
- " Method foo = Y.class.getMethod(\"foo\");\n" +
- " foo.invoke(y);\n" +
- " y.foo();\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " System.out.println(\"FAILURE: \" + t.getMessage());\n" +
- " t.printStackTrace(System.out);\n" +
- " }\n" +
- "}\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y extends Z {\n" +
- " /* empty */\n" +
- "}\n",
- "p/Z.java",
- "package p;\n" +
- "class Z {\n" +
- " public void foo() {\n" +
- " System.out.println(\"SUCCESS\"); //$NON-NLS-1$\n" +
- " }\n" +
- "}\n"},
- "SUCCESS\nSUCCESS"
- );
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=126712
-// reflection - access to a public field of a package visible
-// class through a public extending class
-public void _test0601_reflection() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.lang.reflect.*;\n" +
- "import p.*;\n" +
- "public class X {\n" +
- "static public void main (String args[]) {\n" +
- " Y y = new Y();\n" +
- " try {\n" +
- " Field f = Y.class.getField(\"m\");\n" +
- " System.out.println(y.m);\n" +
- " System.out.println(f.get(y));\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " System.out.println(\"FAILURE: \" + t.getMessage());\n" +
- " t.printStackTrace(System.out);\n" +
- " }\n" +
- "}\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y extends Z {\n" +
- " /* empty */\n" +
- "}\n",
- "p/Z.java",
- "package p;\n" +
- "class Z {\n" +
- " public String m = \"SUCCESS\";\n" +
- "}\n"},
- "SUCCESS\nSUCCESS"
- );
-}
-
-// partial rebuild - method signature changed (return type)
-public void test1000_partial_rebuild() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " Z.go();\n" +
- "}\n" +
- "}\n",
- "Z.java",
- "public class Z {\n" +
- "static public void go() {\n" +
- " int flag = 0;\n" +
- " try {\n" +
- " new Y().random();\n" +
- " flag = 1;\n" +
- " }\n" +
- " catch (NoSuchMethodError e) {\n" +
- " flag = 2;\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " flag = 3;\n" +
- " }\n" +
- " System.out.println(flag);\n" +
- "}\n" +
- "}\n",
- "Y.java",
- "public class Y {\n" +
- "java.util.Random generator = new java.util.Random();" +
- "public byte random() {\n" +
- " return (byte) (generator.nextInt() % Byte.MAX_VALUE);\n" +
- "}\n" +
- "}\n",
- },
- "1");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " Z.go();\n" +
- "}\n" +
- "}\n",
- "Y.java",
- "public class Y {\n" +
- "java.util.Random generator = new java.util.Random();" +
- "public int random() {\n" + // random now returns an int
- " return generator.nextInt();\n" +
- "}\n" +
- "}\n",
- },
- "2",
- null,
- false, // do not purge output directory - pick old version of Z.class
- null);
-}
-
-// partial rebuild - method signature changed (parameter type)
-public void test1001_partial_rebuild() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " Z.go();\n" +
- "}\n" +
- "}\n",
- "Z.java",
- "public class Z {\n" +
- "static public void go() {\n" +
- " byte flag = 0;\n" +
- " try {\n" +
- " new Y().random(flag);\n" +
- " flag = 1;\n" +
- " }\n" +
- " catch (NoSuchMethodError e) {\n" +
- " flag = 2;\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " flag = 3;\n" +
- " }\n" +
- " System.out.println(flag);\n" +
- "}\n" +
- "}\n",
- "Y.java",
- "public class Y {\n" +
- "public int random(byte seed) {\n" +
- " return seed++;\n" +
- "}\n" +
- "}\n",
- },
- "1");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " Z.go();\n" +
- "}\n" +
- "}\n",
- "Y.java",
- "public class Y {\n" +
- "public int random(int seed) {\n" + // seed now of type int
- " return seed++;\n" +
- "}\n" +
- "}\n",
- },
- "2",
- null,
- false, // do not purge output directory - pick old version of Z.class
- null);
-}
-
-// partial rebuild - method signature changed (visibility)
-public void test1002_partial_rebuild() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " new Z().go();\n" +
- "}\n" +
- "}\n",
- "Z.java",
- "public class Z extends p.Y {\n" +
- " class ZInner extends YInner {\n" +
- " // empty\n" +
- " }\n" +
- "public void go() {\n" +
- " byte flag = 0;\n" +
- " try {\n" +
- " new ZInner().foo();\n" +
- " flag = 1;\n" +
- " }\n" +
- " catch (IllegalAccessError e) {\n" +
- " flag = 2;\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " flag = 3;\n" +
- " }\n" +
- " System.out.println(flag);\n" +
- "}\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y {\n" +
- " public class YInner {\n" +
- " public void foo() {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "1");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " new Z().go();\n" +
- "}\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y {\n" +
- " public class YInner {\n" +
- " void foo() {\n" + // now foo no more visible (package only)
- " return;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "2",
- null,
- false, // do not purge output directory - pick old version of Z.class
- null);
-}
-
-// partial rebuild - method signature changed (visibility)
-public void test1003_partial_rebuild() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " new Z().go();\n" +
- "}\n" +
- "}\n",
- "Z.java",
- "public class Z extends p.Y {\n" +
- " class ZInner extends YInner {\n" +
- " // empty\n" +
- " }\n" +
- "public void go() {\n" +
- " byte flag = 0;\n" +
- " try {\n" +
- " new ZInner().foo();\n" +
- " flag = 1;\n" +
- " }\n" +
- " catch (IllegalAccessError e) {\n" +
- " flag = 2;\n" +
- " }\n" +
- " catch (Throwable t) {\n" +
- " flag = 3;\n" +
- " }\n" +
- " System.out.println(flag);\n" +
- "}\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y {\n" +
- " public class YInner {\n" +
- " public void foo() {\n" +
- " return;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "1");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "static public void main(String args[]) {\n" +
- " new Z().go();\n" +
- "}\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y {\n" +
- " public class YInner {\n" +
- " protected void foo() {\n" +
- // now foo no more visible (package + inheriting classes only)
- " return;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "2",
- null,
- false, // do not purge output directory - pick old version of Z.class
- null);
-}
-
-// partial rebuild - extending class now redefines extended class fields and
-// methods
-// was Compliance_1_x#test009
-public void test1004_partial_rebuild() {
- this.runConformTest(
- new String[] {
- "p1/Z.java",
- "package p1; \n"+
- "public class Z { \n" +
- " public static void main(String[] arguments) { \n"+
- " Y y = new Y(); \n" +
- " System.out.print(y.field); \n" +
- " System.out.print(y.staticField); \n" +
- " System.out.print(y.method()); \n" +
- " System.out.println(y.staticMethod()); \n" +
- " } \n"+
- "} \n",
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " public String field = \"X.field-\"; \n" +
- " public static String staticField = \"X.staticField-\"; \n" +
- " public String method(){ return \"X.method()-\"; } \n" +
- " public static String staticMethod(){ return \"X.staticMethod()-\"; } \n" +
- "} \n",
- "p1/Y.java",
- "package p1; \n"+
- "public class Y extends X { \n"+
- "} \n"
- },
- "X.field-X.staticField-X.method()-X.staticMethod()-");
- String expectedOutput =
- this.complianceLevel.equals(COMPLIANCE_1_3) ?
- "X.field-X.staticField-Y.method()-X.staticMethod()-" :
- "Y.field-Y.staticField-Y.method()-Y.staticMethod()-";
- this.runConformTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n"+
- "public class Y extends X { \n"+
- " public static void main(String[] arguments) { \n"+
- " Z.main(arguments); \n" +
- " } \n" +
- " public String field = \"Y.field-\"; \n" +
- " public static String staticField = \"Y.staticField-\"; \n" +
- " public String method(){ return \"Y.method()-\"; } \n" +
- " public static String staticMethod(){ return \"Y.staticMethod()-\"; } \n" +
- "} \n"
- },
- expectedOutput, // expected output
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ScannerTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ScannerTest.java
deleted file mode 100644
index 483f01d..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ScannerTest.java
+++ /dev/null
@@ -1,1202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.ToolFactory;
-import org.eclipse.wst.jsdt.core.compiler.IScanner;
-import org.eclipse.wst.jsdt.core.compiler.ITerminalSymbols;
-import org.eclipse.wst.jsdt.core.compiler.InvalidInputException;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner;
-import org.eclipse.wst.jsdt.internal.compiler.parser.TerminalTokens;
-import org.eclipse.wst.jsdt.internal.core.util.PublicScanner;
-
-public class ScannerTest extends AbstractRegressionTest {
-
- public ScannerTest(String name) {
- super(name);
- }
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 42, 43, 44 };
-// TESTS_RANGE = new int[] { 11, -1 };
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
- }
-
- public static Class testClass() {
- return ScannerTest.class;
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23181
- */
- public void test001() {
- String sourceA001 = "\\u003b";
- IScanner scanner = ToolFactory.createScanner(false, true, false, false);
- scanner.setSource(sourceA001.toCharArray());
- int token = 0;
- try {
- token = scanner.getNextToken();
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameSEMICOLON, token);
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23181
- */
- public void test002() {
- String sourceA002 = "// tests\n ";
- IScanner scanner = ToolFactory.createScanner(false, true, false, false);
- scanner.setSource(sourceA002.toCharArray());
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameWHITESPACE, token);
- assertEquals("Wrong size", 2, scanner.getCurrentTokenSource().length);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23181
- */
- public void test003() {
- String sourceA003 = "// tests\n ";
- IScanner scanner = ToolFactory.createScanner(true, true, false, false);
- scanner.setSource(sourceA003.toCharArray());
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameCOMMENT_LINE, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameWHITESPACE, token);
- assertEquals("Wrong size", 2, scanner.getCurrentTokenSource().length);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- /**
- * float constant can have exponent part without dot: 01e0f
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=30704
- */
- public void test004() {
- String source = "01e0f";
- IScanner scanner = ToolFactory.createScanner(false, false, false, false);
- scanner.setSource(source.toCharArray());
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameFloatingPointLiteral, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=43437
- */
- public void test005() {
- StringBuffer buf = new StringBuffer();
- buf.append("\"Hello\"");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameStringLiteral, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=43485
- */
- public void test006() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, false);
- try {
- scanner.setSource(null);
- } catch (NullPointerException e) {
- assertTrue(false);
- }
- }
-
- /*
- * Check that bogus resetTo issues EOFs
- */
- public void test007() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, false);
- char[] source = "int i = 0;".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(source.length + 50, source.length - 1);
- int token = -1;
- try {
- token = scanner.getNextToken();
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Expecting EOF", ITerminalSymbols.TokenNameEOF, token);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test008() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0x11aa.aap-3333f".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int token = -1;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameFloatingPointLiteral, token);
- token = scanner.getNextToken();
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Expecting EOF", ITerminalSymbols.TokenNameEOF, token);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test009() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_4);
- char[] source = "0x11aa.aap-3333f".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 5, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test010() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0x11aa.aap-3333f".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test011() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0x.aap-3333f".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test012() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0xaap3f".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test013() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0xaapaf".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(true);
- return;
- }
- assertTrue(false);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test014() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0xaap.1f".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(true);
- return;
- }
- assertTrue(false);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test015() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0xaa.p1f".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test016() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0xaa.p1F".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test017() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0xaa.p1D".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74126
- */
- public void test018() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0xaa.p1d".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74934
- */
- public void test019() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_4);
- char[] source = "0x".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(true);
- return;
- }
- assertTrue(false);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74934
- */
- public void test020() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0x".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(true);
- return;
- }
- assertTrue(false);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74934
- */
- public void test021() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_4);
- char[] source = "0x1".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74934
- */
- public void test022() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0x1".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- assertEquals("Wrong number of tokens", 1, counter);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78905
- */
- public void test023() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_5);
- char[] source = "0x.p-2".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- }
- assertTrue(false);
- } catch (InvalidInputException e) {
- assertTrue(true);
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=84398
- */
- public void test024() {
- IScanner scanner = ToolFactory.createScanner(false, false, true, JavaScriptCore.VERSION_1_5);
- char[] source = "public class X {\n\n}".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- int counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- }
-
- assertEquals("wrong number of tokens", 5, counter);
- int[] lineEnds = scanner.getLineEnds();
- assertNotNull("No line ends", lineEnds);
- assertEquals("wrong length", 2, lineEnds.length);
- source = "public class X {}".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- lineEnds = scanner.getLineEnds();
- assertNotNull("No line ends", lineEnds);
- assertEquals("wrong length", 0, lineEnds.length);
-
- counter = 0;
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- counter++;
- }
- } catch (InvalidInputException e) {
- }
-
- assertEquals("wrong number of tokens", 5, counter);
- lineEnds = scanner.getLineEnds();
- assertNotNull("No line ends", lineEnds);
- assertEquals("wrong length", 0, lineEnds.length);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=84398
- */
- public void test025() {
- IScanner scanner = ToolFactory.createScanner(true, true, false, true);
- scanner.setSource("String\r\nwith\r\nmany\r\nmany\r\nline\r\nbreaks".toCharArray());
-
- try {
- while(scanner.getNextToken()!=ITerminalSymbols.TokenNameEOF){}
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
-
- assertEquals("Wrong size", 5, scanner.getLineEnds().length);
-
- scanner.setSource("No line breaks here".toCharArray()); // expecting line breaks to reset
- assertEquals("Wrong size", 0, scanner.getLineEnds().length);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86611
- */
- public void test026() {
- IScanner scanner = ToolFactory.createScanner(false, false, false, JavaScriptCore.VERSION_1_4);
- char[] source = "0x.p-2".toCharArray(); //$NON-NLS-1$
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- try {
- while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
- }
- assertTrue(false);
- } catch (InvalidInputException e) {
- assertTrue(true);
- }
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test027() {
- char[] source = ("class Test {\n" +
- " char C = \"\\u005Cn\";\n" +
- "}").toCharArray();
- Scanner scanner = new Scanner(false, false, false, ClassFileConstants.JDK1_4, null, null, false);
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- try {
- int token;
- StringBuffer buffer = new StringBuffer();
- while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- try {
- switch(token) {
- case TerminalTokens.TokenNameEOF :
- break;
- default :
- buffer.append(scanner.getCurrentTokenSource());
- break;
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- }
- }
- assertEquals("Wrong contents", "classTest{charC=\"\n\";}", String.valueOf(buffer));
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test028() {
- char[] source = ("class Test {\n" +
- " char C = \'\\u005Cn\';\n" +
- "}").toCharArray();
- Scanner scanner = new Scanner(false, false, false, ClassFileConstants.JDK1_4, null, null, false);
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- try {
- int token;
- StringBuffer buffer = new StringBuffer();
- while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- try {
- switch(token) {
- case TerminalTokens.TokenNameStringLiteral :
- buffer.append(new String(scanner.getCurrentTokenSourceString()));
- break;
- case TerminalTokens.TokenNameEOF :
- break;
- default :
- buffer.append(scanner.getCurrentTokenSource());
- break;
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- }
- }
- assertEquals("Wrong contents", "classTest{charC=\'\\n\';}", String.valueOf(buffer));
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test029() {
- char[] source = ("class Test {\n" +
- " char C = \"\\n\";\n" +
- "}").toCharArray();
- Scanner scanner = new Scanner(false, false, false, ClassFileConstants.JDK1_4, null, null, false);
- scanner.setSource(source);
- scanner.resetTo(0, source.length - 1);
- try {
- int token;
- StringBuffer buffer = new StringBuffer();
- while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- try {
- switch(token) {
- case TerminalTokens.TokenNameEOF :
- break;
- default :
- buffer.append(scanner.getCurrentTokenSource());
- break;
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- }
- }
- assertEquals("Wrong contents", "classTest{charC=\"\n\";}", String.valueOf(buffer));
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test030() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static String C = \"\\n\";\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(C.length());\n" +
- " System.out.print(C.charAt(0) == \'\\n\');\n" +
- " }\n" +
- "}"
- },
- "1true");
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test031() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static String C = \"\\u005Cn\";\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(C.length());\n" +
- " System.out.print(C.charAt(0) == \'\\n\');\n" +
- " }\n" +
- "}"
- },
- "1true");
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test032() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static char C = \'\\u005Cn\';\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(C == \'\\n\');\n" +
- " }\n" +
- "}"
- },
- "true");
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test033() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static char C = \\u0027\\u005Cn\\u0027;\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(C == \'\\n\');\n" +
- " }\n" +
- "}"
- },
- "true");
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test034() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " static String C = \"\u0043\\n\\u0043\";\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(C.length());\n" +
- " System.out.print(C.charAt(1) == \'\\n\');\n" +
- " }\n" +
- "}"
- },
- "3true");
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90414
- public void test035() {
- /*
- * Corresponding source:
- *
- * public class Test {
- * static String C = "\n";
- * public static void main(String[] args) {
- * System.out.print(C.length());
- * System.out.print(C.charAt(0) == '\n');
- * }
- * }
- */
- this.runConformTest(
- new String[] {
- "Test.java",
- "\\u0070\\u0075\\u0062\\u006c\\u0069\\u0063\\u0020\\u0063\\u006c\\u0061\\u0073\\u0073\\u0020\\u0054\\u0065\\u0073\\u0074\\u0020\\u007b\\u000A\n" +
- "\\u0020\\u0020\\u0073\\u0074\\u0061\\u0074\\u0069\\u0063\\u0020\\u0053\\u0074\\u0072\\u0069\\u006e\\u0067\\u0020\\u0043\\u0020\\u003d\\u0020\\u0022\\u005c\\u006e\\u0022\\u003b\\u000A\n" +
- "\\u0020\\u0020\\u000A\n" +
- "\\u0020\\u0020\\u0070\\u0075\\u0062\\u006c\\u0069\\u0063\\u0020\\u0073\\u0074\\u0061\\u0074\\u0069\\u0063\\u0020\\u0076\\u006f\\u0069\\u0064\\u0020\\u006d\\u0061\\u0069\\u006e\\u0028\\u0053\\u0074\\u0072\\u0069\\u006e\\u0067\\u005b\\u005d\\u0020\\u0061\\u0072\\u0067\\u0073\\u0029\\u0020\\u007b\\u000A\n" +
- "\\u0020\\u0020\\u0009\\u0053\\u0079\\u0073\\u0074\\u0065\\u006d\\u002e\\u006f\\u0075\\u0074\\u002e\\u0070\\u0072\\u0069\\u006e\\u0074\\u0028\\u0043\\u002e\\u006c\\u0065\\u006e\\u0067\\u0074\\u0068\\u0028\\u0029\\u0029\\u003b\\u000A\n" +
- "\\u0020\\u0020\\u0009\\u0053\\u0079\\u0073\\u0074\\u0065\\u006d\\u002e\\u006f\\u0075\\u0074\\u002e\\u0070\\u0072\\u0069\\u006e\\u0074\\u0028\\u0043\\u002e\\u0063\\u0068\\u0061\\u0072\\u0041\\u0074\\u0028\\u0030\\u0029\\u0020\\u003d\\u003d\\u0020\\u0027\\u005c\\u006e\\u0027\\u0029\\u003b\\u000A\n" +
- "\\u0020\\u0020\\u007d\\u0020\\u0009\\u000A\n" +
- "\\u007d"
- },
- "1true");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106403
- public void test036() {
- try {
- IScanner s = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- char[] source = { ';', ' ' };
- s.setSource(source);
- s.resetTo(0, 0);
- int token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameSEMICOLON, token);
- char[] tokenSource = s.getCurrentTokenSource();
- assertEquals("wront size", 1, tokenSource.length);
- assertEquals("Wrong character", ';', tokenSource[0]);
- token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue("Should not happen", false);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106403
- public void test037() {
- try {
- IScanner s = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- char[] source = { ';', ' ' };
- s.setSource(source);
- int token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameSEMICOLON, token);
- char[] tokenSource = s.getCurrentTokenSource();
- assertEquals("wront size", 1, tokenSource.length);
- assertEquals("Wrong character", ';', tokenSource[0]);
- token = s.getNextToken();
- tokenSource = s.getCurrentTokenSource();
- assertEquals("wront size", 1, tokenSource.length);
- assertEquals("Wrong character", ' ', tokenSource[0]);
- assertEquals("Wrong token", ITerminalSymbols.TokenNameWHITESPACE, token);
- token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue("Should not happen", false);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106403
- public void test038() {
- try {
- IScanner s = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- char[] source = { ';', ' ' };
- s.setSource(source);
- s.resetTo(0, 1);
- int token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameSEMICOLON, token);
- char[] tokenSource = s.getCurrentTokenSource();
- assertEquals("wront size", 1, tokenSource.length);
- assertEquals("Wrong character", ';', tokenSource[0]);
- token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameWHITESPACE, token);
- tokenSource = s.getCurrentTokenSource();
- assertEquals("wront size", 1, tokenSource.length);
- assertEquals("Wrong character", ' ', tokenSource[0]);
- token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue("Should not happen", false);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106403
- public void test039() {
- try {
- IScanner s = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- char[] source = { ';', ' ' };
- s.setSource(source);
- s.resetTo(1, 1);
- int token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameWHITESPACE, token);
- char[] tokenSource = s.getCurrentTokenSource();
- assertEquals("wront size", 1, tokenSource.length);
- assertEquals("Wrong character", ' ', tokenSource[0]);
- token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue("Should not happen", false);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106403
- public void test040() {
- try {
- IScanner s = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- char[] source = { ';', ' ' };
- s.setSource(source);
- s.resetTo(2, 1);
- int token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue("Should not happen", false);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106403
- public void test041() {
- try {
- IScanner s = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- char[] source = "\\u003B\\u0020".toCharArray();
- assertEquals("wrong size", 12, source.length);
- s.setSource(source);
- s.resetTo(0, 5);
- int token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameSEMICOLON, token);
- char[] tokenSource = s.getRawTokenSource();
- assertEquals("wront size", 6, tokenSource.length);
- assertEquals("Wrong character", "\\u003B", new String(tokenSource));
- token = s.getNextToken();
- assertEquals("Wrong token", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue("Should not happen", false);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=112223
- public void test042() {
- IScanner scanner = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- final char[] source = "\"a\\u000D\"".toCharArray();
- scanner.setSource(source);
- final StringBuffer buffer = new StringBuffer();
- try {
- int token;
- while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) {
- try {
- switch(token) {
- case ITerminalSymbols.TokenNameEOF :
- break;
- default :
- buffer.append(scanner.getCurrentTokenSource());
- break;
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- }
- }
- assertTrue("Should have failed", false);
- } catch (InvalidInputException e) {
- buffer.append(scanner.getRawTokenSource());
- assertEquals("Unexpected contents", "\"a\\u000D\"", String.valueOf(buffer));
- assertEquals("Wrong exception", PublicScanner.INVALID_CHAR_IN_STRING, e.getMessage());
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=112223
- public void test043() {
- IScanner scanner = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- final char[] source = "\"\\u004Ca\\u000D\"".toCharArray();
- scanner.setSource(source);
- final StringBuffer buffer = new StringBuffer();
- try {
- int token;
- while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) {
- try {
- switch(token) {
- case ITerminalSymbols.TokenNameEOF :
- break;
- default :
- buffer.append(scanner.getCurrentTokenSource());
- break;
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- }
- }
- assertTrue("Should have failed", false);
- } catch (InvalidInputException e) {
- buffer.append(scanner.getRawTokenSource());
- assertEquals("Unexpected contents", "\"\\u004Ca\\u000D\"", String.valueOf(buffer));
- assertEquals("Wrong exception", PublicScanner.INVALID_CHAR_IN_STRING, e.getMessage());
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=112223
- public void test044() {
- IScanner scanner = ToolFactory.createScanner(true, true, true, "1.5", "1.5");
- final char[] source = "\"\\u004Ca\\u000D\\u0022".toCharArray();
- scanner.setSource(source);
- final StringBuffer buffer = new StringBuffer();
- try {
- int token;
- while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) {
- try {
- switch(token) {
- case ITerminalSymbols.TokenNameEOF :
- break;
- default :
- buffer.append(scanner.getCurrentTokenSource());
- break;
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- }
- }
- assertTrue("Should have failed", false);
- } catch (InvalidInputException e) {
- buffer.append(scanner.getRawTokenSource());
- assertEquals("Unexpected contents", "\"\\u004Ca\\u000D\\u0022", String.valueOf(buffer));
- assertEquals("Wrong exception", PublicScanner.INVALID_CHAR_IN_STRING, e.getMessage());
- }
- }
-
- public void test045() {
- /*
- * Corresponding source:
- *
- * public class Test {
- * static String C = "\n";
- * public static void main(String[] args) {
- * System.out.print(C.length());
- * System.out.print(C.charAt(0) == '\n');
- * }
- * }
- */
- this.runConformTest(
- new String[] {
- "_X.java",
- "import java.lang.reflect.Field;\n" +
- "public class _X {\n" +
- " public static void main(String[] args) {\n" +
- " String i\\u0000;\n" +
- " String i\\u0001;\n" +
- " String i\\u0002;\n" +
- " String i\\u0003;\n" +
- " String i\\u0004;\n" +
- " String i\\u0005;\n" +
- " String i\\u0006;\n" +
- " String i\\u0007;\n" +
- " String i\\u0008;\n" +
- " String i\\u000e;\n" +
- " String i\\u000f;\n" +
- " String i\\u0010;\n" +
- " String i\\u0011;\n" +
- " String i\\u0012;\n" +
- " String i\\u0013;\n" +
- " String i\\u0014;\n" +
- " String i\\u0015;\n" +
- " String i\\u0016;\n" +
- " String i\\u0017;\n" +
- " String i\\u0018;\n" +
- " String i\\u0019;\n" +
- " String i\\u001a;\n" +
- " String i\\u001b;\n" +
- " String i\\u007f;\n" +
- " System.out.print(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
- }
-
- public void test046() {
- StringBuffer buf = new StringBuffer();
- buf.append("'Hello'");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameCharacterLiteral, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test047() {
- StringBuffer buf = new StringBuffer();
- buf.append("/=/g");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameRegExLiteral, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test048() {
- StringBuffer buf = new StringBuffer();
- buf.append("// test unicode \\u000a var a =1; \n");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameCOMMENT_LINE, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test049() {
- StringBuffer buf = new StringBuffer();
- buf.append("/* \n");
- buf.append("* test unicode \\u000a var a =1; \n ");
- buf.append("*/");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameCOMMENT_BLOCK, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameEOF, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test050() {
- StringBuffer buf = new StringBuffer();
- buf.append("\"a\\>\"");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameStringLiteral, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test051() {
- StringBuffer buf = new StringBuffer();
- buf.append("\"abc\\u000adef\";");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameStringLiteral, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameSEMICOLON, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test052() {
- StringBuffer buf = new StringBuffer();
- buf.append("\"abc\\u0022def\";\n");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameStringLiteral, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameSEMICOLON, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test053() {
- StringBuffer buf = new StringBuffer();
- buf.append("'abc\\u0027def';\n");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameCharacterLiteral, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameSEMICOLON, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test054() {
- StringBuffer buf = new StringBuffer();
- buf.append("\"\\u0022def\";\n");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameStringLiteral, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameSEMICOLON, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test055() {
- StringBuffer buf = new StringBuffer();
- buf.append("\"abc\\x22def\";\n");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameStringLiteral, token);
- char[] characters = scanner.getCurrentTokenSource();
- String results = String.valueOf(characters);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameSEMICOLON, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
- public void test056() {
- StringBuffer buf = new StringBuffer();
- buf.append("\"\\x22def\";\n");
- String str = buf.toString();
- IScanner scanner = ToolFactory.createScanner(true, false, false, false);
- scanner.setSource(str.toCharArray());
- scanner.resetTo(0, str.length() - 1);
- int token = 0;
- try {
- token = scanner.getNextToken();
- char[] characters = scanner.getCurrentTokenSource();
- String results = String.valueOf(characters);
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameStringLiteral, token);
- token = scanner.getNextToken();
- assertEquals("Wrong token type", ITerminalSymbols.TokenNameSEMICOLON, token);
- } catch (InvalidInputException e) {
- assertTrue(false);
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java
deleted file mode 100644
index 86d3397..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Here we focus on various aspects of the runtime behavior of the generated
- * code.
- */
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-public class SerialVersionUIDTests extends AbstractRegressionTest {
-
-public SerialVersionUIDTests(String name) {
- super(name);
-}
-// Static initializer to specify tests subset using TESTS_* static variables
-// All specified tests which does not belong to the class are skipped...
-// Only the highest compliance level is run; add the VM argument
-// -Dcompliance=1.4 (for example) to lower it if needed
-static {
-// TESTS_NAMES = new String[] { "test0001" };
-// TESTS_NUMBERS = new int[] { 1 };
-// TESTS_RANGE = new int[] { 1, -1 };
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-public static Class testClass() {
- return SerialVersionUIDTests.class;
-}
-protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
-// options.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.ERROR);
- return options;
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476
-public void test001() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "\n" +
- "public class X implements Serializable {\n" +
- " private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException {}\n" +
- " private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException {}\n" +
- "}"
- },
- ""
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476
-public void test002() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X implements java.io.Externalizable {\n" +
- " public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException {}\n" +
- " public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException {}\n" +
- "}"
- },
- ""
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476
-public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X implements java.io.Serializable {\n" +
- " private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements java.io.Serializable {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n"
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476
-public void test004() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X implements java.io.Serializable {\n" +
- " private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException {}\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements java.io.Serializable {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n"
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476
-public void test005() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X implements java.io.Serializable {\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X implements java.io.Serializable {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n"
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476
-public void test006() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X implements java.io.Serializable {\n" +
- " Object writeReplace() throws java.io.ObjectStreamException { return null;}\n" +
- "}"
- },
- ""
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/StaticImportTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/StaticImportTest.java
deleted file mode 100644
index 062ed3a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/StaticImportTest.java
+++ /dev/null
@@ -1,1875 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class StaticImportTest extends AbstractComparableTest {
-
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which do not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] { "test036" };
-// TESTS_NUMBERS = new int[] { 46 };
-// TESTS_RANGE = new int[] { 169, 180 };
- }
-
- public StaticImportTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildComparableTestSuite(testClass());
- }
-
- public static Class testClass() {
- return StaticImportTest.class;
- }
-
-
- public void test001() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static java.lang.Math.*;\n" +
- "import static java.lang.Math.PI;\n" +
- "public class X { double pi = abs(PI); }\n",
- },
- "");
- }
-
- public void test002() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p2.Y.*;\n" +
- "import static p2.Z.Zint;\n" +
- "import static p2.Z.ZMember;\n" +
- "public class X {\n" +
- " int x = y(1);\n" +
- " int y = Yint;\n" +
- " int z = Zint;\n" +
- " void m1(YMember m) {}\n" +
- " void m2(ZMember m) {}\n" +
- "}\n",
- "p2/Y.java",
- "package p2;\n" +
- "public class Y {\n" +
- " public static int Yint = 1;\n" +
- " public static int y(int y) { return y; }\n" +
- " public static class YMember {}\n" +
- "}\n",
- "p2/Z.java",
- "package p2;\n" +
- "public class Z {\n" +
- " public static int Zint = 1;\n" +
- " public static class ZMember {}\n" +
- "}\n",
- },
- "");
- }
-
- public void test003() { // test inheritance
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p2.Y.*;\n" +
- "import static p2.Z.Zint;\n" +
- "import static p2.Z.ZMember;\n" +
- "public class X {\n" +
- " int x = y(1);\n" +
- " int y = Yint;\n" +
- " int z = Zint;\n" +
- " void m1(YMember m) {}\n" +
- " void m2(ZMember m) {}\n" +
- "}\n",
- "p2/YY.java",
- "package p2;\n" +
- "public class YY {\n" +
- " public static int Yint = 1;\n" +
- " public static int y(int y) { return y; }\n" +
- " public static class YMember {}\n" +
- "}\n",
- "p2/Y.java",
- "package p2;\n" +
- "public class Y extends YY {}\n",
- "p2/ZZ.java",
- "package p2;\n" +
- "public class ZZ {\n" +
- " public static int Zint = 1;\n" +
- " public static class ZMember {}\n" +
- "}\n",
- "p2/Z.java",
- "package p2;\n" +
- "public class Z extends ZZ {}\n",
- },
- "");
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.C;\n" +
- "public class X { int i = C; }\n",
- "p/A.java",
- "package p;\n" +
- "public class A extends B implements I {}\n" +
- "class B implements I {}\n",
- "p/I.java",
- "package p;\n" +
- "public interface I { public static int C = 1; }\n"
- },
- ""
- );
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.C;\n" +
- "public class X { \n" +
- " int i = C; \n" +
- " int j = p.A.C; \n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A implements I {}\n" +
- "interface I { public static int C = 1; }\n"
- },
- "");
- }
-
- public void test004() { // test static vs. instance
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p2.Y.*;\n" +
- "import static p2.Z.Zint;\n" +
- "import static p2.Z.ZMember;\n" +
- "public class X {\n" +
- " int x = y(1);\n" +
- " int y = Yint;\n" +
- " int z = Zint;\n" +
- " void m1(YMember m) {}\n" +
- " void m2(ZMember m) {}\n" +
- "}\n",
- "p2/Y.java",
- "package p2;\n" +
- "public class Y {\n" +
- " public int Yint = 1;\n" +
- " public int y(int y) { return y; }\n" +
- " public class YMember {}\n" +
- "}\n",
- "p2/Z.java",
- "package p2;\n" +
- "public class Z {\n" +
- " public int Zint = 1;\n" +
- " public class ZMember {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 3)\n" +
- " import static p2.Z.Zint;\n" +
- " ^^^^^^^^^\n" +
- "The import p2.Z.Zint cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 4)\n" +
- " import static p2.Z.ZMember;\n" +
- " ^^^^^^^^^^^^\n" +
- "The import p2.Z.ZMember cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in p\\X.java (at line 6)\n" +
- " int x = y(1);\n" +
- " ^\n" +
- "The method y(int) is undefined for the type X\n" +
- "----------\n" +
- "4. ERROR in p\\X.java (at line 7)\n" +
- " int y = Yint;\n" +
- " ^^^^\n" +
- "Yint cannot be resolved\n" +
- "----------\n" +
- "5. ERROR in p\\X.java (at line 8)\n" +
- " int z = Zint;\n" +
- " ^^^^\n" +
- "Zint cannot be resolved\n" +
- "----------\n" +
- "6. ERROR in p\\X.java (at line 9)\n" +
- " void m1(YMember m) {}\n" +
- " ^^^^^^^\n" +
- "YMember cannot be resolved to a type\n" +
- "----------\n" +
- "7. ERROR in p\\X.java (at line 10)\n" +
- " void m2(ZMember m) {}\n" +
- " ^^^^^^^\n" +
- "ZMember cannot be resolved to a type\n" +
- "----------\n");
- }
-
- public void test005() { // test visibility
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p2.Y.*;\n" +
- "import static p2.Z.Zint;\n" +
- "import static p2.Z.ZMember;\n" +
- "public class X {\n" +
- " int x = y(1);\n" +
- " int y = Yint;\n" +
- " int z = Zint;\n" +
- " void m1(YMember m) {}\n" +
- " void m2(ZMember m) {}\n" +
- "}\n",
- "p2/Y.java",
- "package p2;\n" +
- "public class Y {\n" +
- " static int Yint = 1;\n" +
- " static int y(int y) { return y; }\n" +
- " static class YMember {}\n" +
- "}\n",
- "p2/Z.java",
- "package p2;\n" +
- "public class Z {\n" +
- " static int Zint = 1;\n" +
- " static class ZMember {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 3)\n" +
- " import static p2.Z.Zint;\n" +
- " ^^^^^^^^^\n" +
- "The field Z.p2.Z.Zint is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 4)\n" +
- " import static p2.Z.ZMember;\n" +
- " ^^^^^^^^^^^^\n" +
- "The type p2.Z.ZMember is not visible\n" +
- "----------\n" +
- "3. ERROR in p\\X.java (at line 6)\n" +
- " int x = y(1);\n" +
- " ^\n" +
- "The method y(int) from the type Y is not visible\n" +
- "----------\n" +
- "4. ERROR in p\\X.java (at line 7)\n" +
- " int y = Yint;\n" +
- " ^^^^\n" +
- "The field Y.Yint is not visible\n" +
- "----------\n" +
- "5. ERROR in p\\X.java (at line 8)\n" +
- " int z = Zint;\n" +
- " ^^^^\n" +
- "Zint cannot be resolved\n" +
- "----------\n" +
- "6. ERROR in p\\X.java (at line 9)\n" +
- " void m1(YMember m) {}\n" +
- " ^^^^^^^\n" +
- "The type YMember is not visible\n" +
- "----------\n" +
- "7. ERROR in p\\X.java (at line 10)\n" +
- " void m2(ZMember m) {}\n" +
- " ^^^^^^^\n" +
- "ZMember cannot be resolved to a type\n" +
- "----------\n");
- }
-
- public void test006() { // test non static member types
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p2.Z.ZStatic;\n" +
- "import static p2.Z.ZNonStatic;\n" +
- "import p2.Z.ZNonStatic;\n" +
- "public class X {\n" +
- " void m2(ZStatic m) {}\n" +
- " void m3(ZNonStatic m) {}\n" +
- "}\n",
- "p2/Z.java",
- "package p2;\n" +
- "public class Z {\n" +
- " public static class ZStatic {}\n" +
- " public class ZNonStatic {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 3)\n" +
- " import static p2.Z.ZNonStatic;\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The import p2.Z.ZNonStatic cannot be resolved\n" +
- "----------\n");
- }
-
- public void test007() { // test non static member types vs. static field
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p2.Z.ZFieldOverMember;\n" +
- "public class X {\n" +
- " int z = ZFieldOverMember;\n" +
- "}\n",
- "p2/Z.java",
- "package p2;\n" +
- "public class Z {\n" +
- " public static int ZFieldOverMember = 1;\n" +
- " public class ZFieldOverMember {}\n" +
- "}\n",
- },
- "");
- }
-
- public void test008() { // test static top level types
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static java.lang.System;\n" +
- "public class X {}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 2)\n" +
- " import static java.lang.System;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The static import java.lang.System must be a field or member type\n" +
- "----------\n");
- }
-
- public void test009() { // test static top level types
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static java.lang.reflect.Method.*;\n" +
- "public class X {Method m;}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 3)\n" +
- " public class X {Method m;}\n" +
- " ^^^^^^\n" +
- "Method cannot be resolved to a type\n" +
- "----------\n");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=76174
- public void test010() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static java.lang.System.*;\n" +
- "public class X {\n" +
- " void foo() { arraycopy(); }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " void foo() { arraycopy(); }\n" +
- " ^^^^^^^^^\n" +
- "The method arraycopy(Object, int, Object, int, int) in the type System is not applicable for the arguments ()\n" +
- "----------\n");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=76360
- public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.Y.*;\n" +
- "public class X extends p.Z {}\n" +
- "class XX extends M.N {}\n" +
- "class XXX extends M.Missing {}\n",
- "p/YY.java",
- "package p;\n" +
- "public class YY {\n" +
- " public static class M {\n" +
- " public static class N {}\n" +
- " }\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y extends YY {}\n",
- "p/Z.java",
- "package p;\n" +
- "public class Z {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " class XXX extends M.Missing {}\n" +
- " ^^^^^^^^^\n" +
- "M.Missing cannot be resolved to a type\n" +
- "----------\n");
- }
-
- public void test012() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static java.lang.Math.*;\n" +
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.println(max(1, 2));\n" +
- " }\n" +
- "}\n",
- },
- "2");
- this.runConformTest(
- new String[] {
- "X.java",
- "import static java.lang.Math.max;\n" +
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.println(max(1, 3));\n" +
- " }\n" +
- "}\n",
- },
- "3");
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p1.C.F;\n" +
- "import p2.*;\n" +
- "public class X implements F {" +
- " int i = F();" +
- "}\n",
- "p1/C.java",
- "package p1;\n" +
- "public class C {\n" +
- " public static int F() { return 0; }\n" +
- "}\n",
- "p2/F.java",
- "package p2;\n" +
- "public interface F {}\n"
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77955
- public void test013() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.Y.ZZ;\n" + // found if ZZ is static
- "import static p.Z.ZZ.WW;\n" + // found if WW is static
- "import static p.Z.Zz.WW;\n" + // found if WW is static
- "import static p.Z.Zz.*;\n" + // legal
- "import static p.Z.Zz.Zzz;\n" + // legal
-
- "import static p.Y.Zz;\n" + // Zz is not static
- "import static p.Z.Zz.WW.*;\n" + // import requires canonical name for p.W.WW
-
- "import p.Y.ZZ;\n" + // import requires canonical name for p.Z.ZZ
- "import static p.Y.ZZ.*;\n" + // import requires canonical name for p.Z.ZZ
- "import static p.Y.ZZ.WW;\n" + // import requires canonical name for p.Z.ZZ
- "import static p.Y.ZZ.WW.*;\n" + // import requires canonical name for p.W.WW
- "import static p.Y.ZZ.ZZZ;\n" + // import requires canonical name for p.Z.ZZ
- "import static p.Y.ZZ.WW.WWW;\n" + // import requires canonical name for p.W.WW
- "public class X {\n" +
- " int i = Zzz + Zzzz;\n" +
- " ZZ z;\n" +
- " WW w;\n" +
- "}\n",
- "p/Y.java",
- "package p;\n" +
- "public class Y extends Z {}\n",
- "p/Z.java",
- "package p;\n" +
- "public class Z {\n" +
- " public class Zz extends W { public static final int Zzz = 0; public static final int Zzzz = 1; }\n" +
- " public static class ZZ extends W { public static final int ZZZ = 0; }\n" +
- "}\n",
- "p/W.java",
- "package p;\n" +
- "public class W {\n" +
- " public static class WW { public static final int WWW = 0; }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\r\n" +
- " import static p.Y.Zz;\r\n" +
- " ^^^^^^\n" +
- "The import p.Y.Zz cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\r\n" +
- " import static p.Z.Zz.WW.*;\r\n" +
- " ^^^^^^^^^\n" +
- "The import p.Z.Zz.WW cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\r\n" +
- " import p.Y.ZZ;\r\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\r\n" +
- " import static p.Y.ZZ.*;\r\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\r\n" +
- " import static p.Y.ZZ.WW;\r\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\r\n" +
- " import static p.Y.ZZ.WW.*;\r\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 12)\r\n" +
- " import static p.Y.ZZ.ZZZ;\r\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 13)\r\n" +
- " import static p.Y.ZZ.WW.WWW;\r\n" +
- " ^^^^^^\n" +
- "The import p.Y.ZZ cannot be resolved\n" +
- "----------\n"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=78056
- public void test014() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.Z.ZZ.ZZZ;\n" +
- "public class X {}\n",
- "p/Z.java",
- "package p;\n" +
- "public class Z {\n" +
- " public class ZZ { public static final int ZZZ = 0; }\n" +
- "}\n",
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=78075
- public void test015() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import p.Z.*;\n" +
- "import static p.Z.*;\n" +
- "public class X { int i = COUNT; }\n",
- "p/Z.java",
- "package p;\n" +
- "public class Z {\n" +
- " public static final int COUNT = 0;\n" +
- "}\n",
- },
- ""
- );
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.Z.*;\n" +
- "import p.Z.*;\n" +
- "public class X { int i = COUNT; }\n",
- "p/Z.java",
- "package p;\n" +
- "public class Z {\n" +
- " public static final int COUNT = 0;\n" +
- "}\n",
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77630
- public void test016() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static java.lang.*;\n" +
- "public class X {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " import static java.lang.*;\r\n" +
- " ^^^^^^^^^\n" +
- "Only a type can be imported. java.lang resolves to a package\n" +
- "----------\n"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81724
- public void test017() {
- this.runConformTest(
- new String[] {
- "bug/A.java",
- "package bug;\n" +
- "import static bug.C.*;\n" +
- "public class A {\n" +
- " private B b;\n" +
- "}\n",
- "bug/B.java",
- "package bug;\n" +
- "import static bug.C.*;\n" +
- "public class B {\n" +
- "}\n",
- "bug/C.java",
- "package bug;\n" +
- "public class C {\n" +
- " private B b;\n" +
- "}\n",
- },
- ""
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81724 - variation
- public void test018() {
- this.runNegativeTest(
- new String[] {
- "bug/A.java",
- "package bug;\n" +
- "import static bug.C.*;\n" +
- "public class A {\n" +
- " private B b2 = b;\n" +
- "}\n",
- "bug/B.java",
- "package bug;\n" +
- "import static bug.C.*;\n" +
- "public class B {\n" +
- "}\n",
- "bug/C.java",
- "package bug;\n" +
- "public class C {\n" +
- " private static B b;\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in bug\\A.java (at line 4)\n" +
- " private B b2 = b;\n" +
- " ^\n" +
- "The field C.b is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in bug\\B.java (at line 2)\n" +
- " import static bug.C.*;\n" +
- " ^^^^^\n" +
- "The import bug.C is never used\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in bug\\C.java (at line 3)\n" +
- " private static B b;\n" +
- " ^\n" +
- "The field C.b is never read locally\n" +
- "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81718
- public void test019() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static java.lang.Math.PI;\n" +
- "\n" +
- "public class X {\n" +
- " boolean PI;\n" +
- " Zork z;\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82754
- public void test020() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static java.lang.Math.round;\n" +
- "public class X {\n" +
- " void foo() { cos(0); }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " void foo() { cos(0); }\n" +
- " ^^^\n" +
- "The method cos(int) is undefined for the type X\n" +
- "----------\n" );
- }
-
- public void test021() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.B.foo;\n" +
- "public class X {\n" +
- " void test() { foo(); }\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A { public static void foo() {} }\n",
- "p/B.java",
- "package p;\n" +
- "public class B extends A { }\n"
- },
- ""
- );
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.B.foo;\n" +
- "public class X {\n" +
- " void test() { foo(); }\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A { public void foo() {} }\n",
- "p/B.java",
- "package p;\n" +
- "public class B extends A { static void foo(int i) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static p.B.foo;\n" +
- " ^^^^^^^\n" +
- "The import p.B.foo cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " void test() { foo(); }\n" +
- " ^^^\n" +
- "The method foo() is undefined for the type X\n" +
- "----------\n"
- );
- }
-
- public void test022() { // test field/method collisions
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.F;\n" +
- "import static p.B.F;\n" +
- "public class X {\n" +
- " int i = F;\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A { public static class F {} }\n",
- "p/B.java",
- "package p;\n" +
- "public class B { public static int F = 2; }\n",
- },
- ""
- // no collision between field and member type
- );
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.F;\n" +
- "import static p.B.F;\n" +
- "public class X {\n" +
- " int i = F + F();\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A { public static int F() { return 1; } }\n",
- "p/B.java",
- "package p;\n" +
- "public class B { public static int F = 2; }\n",
- },
- ""
- // no collision between field and method
- );
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.F;\n" +
- "import static p.B.F;\n" +
- "public class X {\n" +
- " int i = F;\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A { public static int F = 1; }\n",
- "p/B.java",
- "package p;\n" +
- "public class B extends A {}\n",
- },
- ""
- // no collision between 2 fields that are the same
- );
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.A.F;\n" +
- "import static p.B.F;\n" +
- "public class X {\n" +
- " int i = F;\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A { public static int F = 1; }\n",
- "p/B.java",
- "package p;\n" +
- "public class B { public static int F = 2; }\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " import static p.B.F;\n" +
- " ^^^^^\n" +
- "The import p.B.F collides with another import statement\n" +
- "----------\n"
- // F is already defined in a single-type import
- );
- }
-
- public void test023() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.C;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(C);\n" +
- " System.out.print(C());\n" +
- " }\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A {\n" +
- " public static int C = 1;\n" +
- " public static int C() { return C + 3; }\n" +
- "}\n"
- },
- "14"
- );
- this.runConformTest( // extra inheritance hiccup for method lookup
- new String[] {
- "X.java",
- "import static p.A.C;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(C);\n" +
- " System.out.print(C());\n" +
- " }\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A extends B {\n" +
- " public static int C() { return C + 3; }\n" +
- "}\n",
- "p/B.java",
- "package p;\n" +
- "public class B {\n" +
- " public static int C = 1;\n" +
- "}\n"
- },
- "14"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83376
- public void test024() {
- this.runNegativeTest(
- new String[] {
- "p/B.java",
- "package p;\n" +
- "import static p.A.m;\n" +
- "import static p2.C.m;\n" +
- "class A { static void m() {} }\n" +
- "public class B { public static void main(String[] args) { m(); } }\n",
- "p2/C.java",
- "package p2;\n" +
- "public class C { public static void m() {} }\n"
- },
- "----------\n" +
- "1. ERROR in p\\B.java (at line 5)\r\n" +
- " public class B { public static void main(String[] args) { m(); } }\r\n" +
- " ^\n" +
- "The method m() is ambiguous for the type B\n" +
- "----------\n"
- );
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p.A.m;\n" +
- "import static p.B.m;\n" +
- "public class X { void test() { m(); } }\n" +
- "class B extends A {}\n",
- "p/A.java",
- "package p;\n" +
- "public class A { public static int m() { return 0; } }\n"
- },
- ""
- );
- }
-
- public void test025() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static java.lang.Math.*;\n" +
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print(max(PI, 4));\n" +
- " new Runnable() {\n" +
- " public void run() {\n" +
- " System.out.println(max(PI, 5));\n" +
- " }\n" +
- " }.run();\n" +
- " }\n" +
- "}\n"
- },
- "4.05.0"
- );
- }
-
- public void test026() { // ensure inherited problem fields do not stop package resolution
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends Y { static void test() { java.lang.String.valueOf(0); } }\n" +
- "class Y { private String java; }\n"
- },
- ""
- );
- }
-
- public void test027() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.ST.foo;\n" +
- "public class X {\n" +
- " \n" +
- " foo bar;\n" +
- "}\n",
- "p/ST.java",
- "package p; \n" +
- "public class ST {\n" +
- " public static int foo;\n" +
- "}\n" ,
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " foo bar;\n" +
- " ^^^\n" +
- "foo cannot be resolved to a type\n" +
- "----------\n");
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=87490
- public void test028() {
- this.runConformTest(
- new String[] {
- "p1/Z.java",//====================
- "package p1;\n" +
- "public class Z {\n" +
- " public interface I {\n" +
- " }\n" +
- "}\n",
- "q/Y.java",//====================
- "package q;\n" +
- "import static p.X.I;\n" +
- "import static p1.Z.I;\n" +
- "public class Y implements I {\n" +
- "}\n",
- "p/X.java",//====================
- "package p;\n" +
- "public enum X {\n" +
- " I, J, K\n" +
- "}\n" ,
- },
- "");
- // recompile Y against binaries
- this.runConformTest(
- new String[] {
- "q/Y.java",//====================
- "package q;\n" +
- "import static p.X.I;\n" +
- "import static p1.Z.I;\n" +
- "public class Y implements I {\n" +
- "}\n",
- },
- "",
- null,
- false,
- null);
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=93913
- public void test029() {
- this.runNegativeTest(
- new String[] {
- "p1/A.java",
- "package p1;\n" +
- "import static p2.C.B;\n" +
- "public class A extends B {\n" +
- " void test() {" +
- " int i = B();\n" +
- " B b = null;\n" +
- " b.fooB();\n" +
- " b.fooC();\n" +
- " fooC();\n" +
- " }\n" +
- "}\n",
- "p1/B.java",
- "package p1;\n" +
- "public class B {\n" +
- " public void fooB() {}\n" +
- "}\n",
- "p2/C.java",
- "package p2;\n" +
- "public class C {\n" +
- " public static class B { public void fooC() {} }\n" +
- " public static int B() { return 0; }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p1\\A.java (at line 6)\n" +
- " b.fooB();\n" +
- " ^^^^\n" +
- "The method fooB() is undefined for the type C.B\n" +
- "----------\n"
- );
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=94262
- public void test030() {
- this.runNegativeTest(
- new String[] {
- "p2/Test.java",
- "package p2;\n" +
- "import static p1.A.*;\n" +
- "public class Test {\n" +
- " Inner1 i; // not found\n" +
- " Inner2 j;\n" +
- "}\n",
- "p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " public class Inner1 {}\n" +
- " public static class Inner2 {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p2\\Test.java (at line 4)\n" +
- " Inner1 i; // not found\n" +
- " ^^^^^^\n" +
- "Inner1 cannot be resolved to a type\n" +
- "----------\n"
- );
- this.runConformTest(
- new String[] {
- "p2/Test.java",
- "package p2;\n" +
- "import p1.A.*;\n" +
- "import static p1.A.*;\n" +
- "import static p1.A.*;\n" +
- "public class Test {\n" +
- " Inner1 i;\n" +
- " Inner2 j;\n" +
- "}\n",
- "p1/A.java",
- "package p1;\n" +
- "public class A {\n" +
- " public class Inner1 {}\n" +
- " public static class Inner2 {}\n" +
- "}\n",
- },
- ""
- );
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95909
- public void test031() {
- this.runNegativeTest(
- new String[] {
- "PointRadius.java",
- "import static java.lang.Math.sqrt;\n" +
- "\n" +
- "public class PointRadius {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " double radius = 0;\n" +
- " radius = sqrt(pondArea / Math.PI);\n" +
- "\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in PointRadius.java (at line 7)\n" +
- " radius = sqrt(pondArea / Math.PI);\n" +
- " ^^^^^^^^\n" +
- "pondArea cannot be resolved\n" +
- "----------\n");
- }
-
- //http://bugs.eclipse.org/bugs/show_bug.cgi?id=97809
- public void test032() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.*;\n" +
- "import static p.B.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {foo();}\n" +
- "}\n",
- "p/A.java",
- "package p;" +
- "public class A {\n" +
- " public static void foo() {System.out.print(false);}\n" +
- "}\n",
- "p/B.java",
- "package p;" +
- "public class B extends A {\n" +
- " public static void foo() {System.out.print(true);}\n" +
- "}\n"
- },
- "true");
- }
-
- //http://bugs.eclipse.org/bugs/show_bug.cgi?id=97809
- public void test032b() {
- this.runNegativeTest(
- new String[] {
- "X2.java",
- "import static p2.A.*;\n" +
- "import static p2.B.*;\n" +
- "public class X2 { void test() {foo();} }\n",
- "p2/A.java",
- "package p2;" +
- "public class A {\n" +
- " public static void foo() {}\n" +
- "}\n",
- "p2/B.java",
- "package p2;" +
- "public class B {\n" +
- " public static void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X2.java (at line 3)\r\n" +
- " public class X2 { void test() {foo();} }\r\n" +
- " ^^^\n" +
- "The method foo() is ambiguous for the type X2\n" +
- "----------\n"
- // reference to foo is ambiguous, both method foo() in p.B and method foo() in p.A match
- );
- }
-
- //http://bugs.eclipse.org/bugs/show_bug.cgi?id=97809
- public void test032c() {
- this.runConformTest(
- new String[] {
- "X3.java",
- "import static p3.A.*;\n" +
- "import static p3.B.foo;\n" +
- "public class X3 {\n" +
- " public static void main(String[] args) {foo();}\n" +
- "}\n",
- "p3/A.java",
- "package p3;" +
- "public class A {\n" +
- " public static void foo() {System.out.print(false);}\n" +
- "}\n",
- "p3/B.java",
- "package p3;" +
- "public class B {\n" +
- " public static void foo() {System.out.print(true);}\n" +
- "}\n"
- },
- "true");
- }
-
- //http://bugs.eclipse.org/bugs/show_bug.cgi?id=97809
- public void test032d() {
- this.runConformTest(
- new String[] {
- "X4.java",
- "import static p4.A.foo;\n" +
- "import static p4.B.*;\n" +
- "public class X4 {\n" +
- " public static void main(String[] args) {foo();}\n" +
- "}\n",
- "p4/A.java",
- "package p4;" +
- "public class A {\n" +
- " public static void foo() {System.out.print(true);}\n" +
- "}\n",
- "p4/B.java",
- "package p4;" +
- "public class B extends A {\n" +
- " public static void foo() {System.out.print(false);}\n" +
- "}\n"
- },
- "true");
- }
-
- public void test033() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.*;\n" +
- "import static p.B.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {foo(\"aa\");}\n" +
- "}\n",
- "p/A.java",
- "package p;" +
- "public class A {\n" +
- " public static <U> void foo(U u) {System.out.print(false);}\n" +
- "}\n",
- "p/B.java",
- "package p;" +
- "public class B extends A {\n" +
- " public static <V> void foo(String s) {System.out.print(true);}\n" +
- "}\n"
- },
- "true");
- }
-
- public void test033b() {
- this.runConformTest(
- new String[] {
- "X2.java",
- "import static p2.A.*;\n" +
- "import static p2.B.*;\n" +
- "public class X2 {\n" +
- " public static void main(String[] args) {foo(\"aa\");}\n" +
- "}\n",
- "p2/A.java",
- "package p2;" +
- "public class A {\n" +
- " public static <U> void foo(String s) {System.out.print(true);}\n" +
- "}\n",
- "p2/B.java",
- "package p2;" +
- "public class B extends A {\n" +
- " public static <V> void foo(V v) {System.out.print(false);}\n" +
- "}\n"
- },
- "true");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104198
- public void test034() {
- this.runConformTest(
- new String[] {
- "test/AbstractTest.java",
- "package test;\n" +
- "public abstract class AbstractTest<Z> {\n" +
- " \n" +
- " public abstract MyEnum m(Z z);\n" +
- " \n" +
- " public enum MyEnum {\n" +
- " A,B\n" +
- " }\n" +
- "}\n",
- "test/X.java",
- "package test;\n" +
- "import static test.AbstractTest.MyEnum.*;\n" +
- "public class X extends AbstractTest<String> {\n" +
- " @Override public MyEnum m(String s) {\n" +
- " return A;\n" +
- " }\n" +
- "}\n"
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=117861
- public void test035() {
- this.runConformTest(
- new String[] {
- "Bug.java",
- "import static java.lang.String.format;\n" +
- "public class Bug extends p.TestCase {\n" +
- " public static void main(String[] args) {\n" +
- " String msg = \"test\";\n" +
- " System.out.print(format(msg));\n" +
- " System.out.print(format(msg, 1, 2));\n" +
- " }\n" +
- "}\n",
- "p/TestCase.java",
- "package p;\n" +
- "public class TestCase {\n" +
- " static String format(String message, Object expected, Object actual) {return null;}\n" +
- "}\n"
- },
- "testtest");
- this.runNegativeTest(
- new String[] {
- "C.java",
- "class A {\n" +
- " static class B { void foo(Object o, String s) {} }\n" +
- " void foo(int i) {}\n" +
- "}\n" +
- "class C extends A.B {\n" +
- " void test() { foo(1); }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in C.java (at line 6)\r\n" +
- " void test() { foo(1); }\r\n" +
- " ^^^\n" +
- "The method foo(Object, String) in the type A.B is not applicable for the arguments (int)\n" +
- "----------\n");
- this.runNegativeTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " void foo(int i, long j) {}\n" +
- " class B {\n" +
- " void foo() { foo(1, 1); }\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in A.java (at line 4)\n" +
- " void foo() { foo(1, 1); }\n" +
- " ^^^\n" +
- "The method foo() in the type A.B is not applicable for the arguments (int, int)\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564
- public void test036() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.A.CONSTANT_I;\n" +
- "import static p.A.CONSTANT_B;\n" +
- "public class X {\n" +
- " static int i = p.A.CONSTANT_I;\n" +
- " static int j = p.A.CONSTANT_B;\n" +
- " static int m = CONSTANT_I;\n" +
- " static int n = CONSTANT_B;\n" +
- "}",
- "p/A.java",
- "package p;\n" +
- "public class A extends B implements I {}\n" +
- "interface I { int CONSTANT_I = 1; }\n" +
- "class B { int CONSTANT_B = 1; }",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " import static p.A.CONSTANT_B;\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The field B.p.A.CONSTANT_B is not visible\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " static int j = p.A.CONSTANT_B;\n" +
- " ^^^^^^^^^^\n" +
- "The field B.CONSTANT_B is not visible\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " static int n = CONSTANT_B;\n" +
- " ^^^^^^^^^^\n" +
- "CONSTANT_B cannot be resolved\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564 - variation
- public void test037() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import static p.A.CONSTANT_I;\n" +
- "import static p.A.CONSTANT_B;\n" +
- "public class X {\n" +
- " static int i = p.A.CONSTANT_I;\n" +
- " static int j = p.A.CONSTANT_B;\n" +
- " static int m = CONSTANT_I;\n" +
- " static int n = CONSTANT_B;\n" +
- "}",
- "p/A.java",
- "package p;\n" +
- "public class A extends B implements I {}\n" +
- "interface I { int CONSTANT_I = 1; }\n" +
- "class B { public static int CONSTANT_B = 1; }",
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564 - variation
- public void test038() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.A.foo_I;\n" +
- "import static p.A.foo_B;\n" +
- "public class X {\n" +
- " static int i = p.A.foo_I();\n" +
- " static int j = p.A.foo_B();\n" +
- " static int m = foo_I();\n" +
- " static int n = foo_B();\n" +
- "}",
- "p/A.java",
- "package p;\n" +
- "public abstract class A extends B implements I {}\n" +
- "interface I { int foo_I(); }\n" +
- "class B { int foo_B() { return 2;} }",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static p.A.foo_I;\n" +
- " ^^^^^^^^^\n" +
- "The import p.A.foo_I cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 2)\n" +
- " import static p.A.foo_B;\n" +
- " ^^^^^^^^^\n" +
- "The import p.A.foo_B cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " static int i = p.A.foo_I();\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static method foo_I() from the type I\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 5)\n" +
- " static int j = p.A.foo_B();\n" +
- " ^^^^^\n" +
- "The method foo_B() from the type B is not visible\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 6)\n" +
- " static int m = foo_I();\n" +
- " ^^^^^\n" +
- "The method foo_I() is undefined for the type X\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 7)\n" +
- " static int n = foo_B();\n" +
- " ^^^^^\n" +
- "The method foo_B() is undefined for the type X\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126564 - variation
- public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static p.A.foo_I;\n" +
- "import static p.A.foo_B;\n" +
- "public class X {\n" +
- " static int i = p.A.foo_I();\n" +
- " static int j = p.A.foo_B();\n" +
- " static int m = foo_I();\n" +
- " static int n = foo_B();\n" +
- "}",
- "p/A.java",
- "package p;\n" +
- "public abstract class A extends B implements I {}\n" +
- "interface I { int foo_I(); }\n" +
- "class B { public static int foo_B() { return 2;} }",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\r\n" +
- " import static p.A.foo_I;\r\n" +
- " ^^^^^^^^^\n" +
- "The import p.A.foo_I cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\r\n" +
- " static int i = p.A.foo_I();\r\n" +
- " ^^^^^^^^^^^\n" +
- "Cannot make a static reference to the non-static method foo_I() from the type I\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\r\n" +
- " static int m = foo_I();\r\n" +
- " ^^^^^\n" +
- "The method foo_I() is undefined for the type X\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=87490 - variation
- public void test040() {
- this.runConformTest(
- new String[] {
- "p1/Z.java",//====================
- "package p1;\n" +
- "public class Z {\n" +
- " public interface I {\n" +
- " }\n" +
- "}\n",
- "q/Y.java",//====================
- "package q;\n" +
- "import static p.X.foo;\n" +
- "import static p1.Z.I;\n" +
- "public class Y implements I {\n" +
- "}\n",
- "p/X.java",//====================
- "package p;\n" +
- "public class X {\n" +
- " public static void foo() {}\n" +
- "}\n" ,
- },
- "");
- // recompile Y against binaries
- this.runConformTest(
- new String[] {
- "q/Y.java",//====================
- "package q;\n" +
- "import static p.X.foo;\n" +
- "import static p1.Z.I;\n" +
- "public class Y implements I {\n" +
- "}\n",
- },
- "",
- null,
- false,
- null);
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=134118
- public void test041() {
- this.runNegativeTest(
- new String[] {
- "Test.java",
- "import static p.I.*;\n" +
- "import static p.J.*;\n" +
- "public class Test {\n" +
- " int i = Constant;\n" +
- "}\n",
- "p/I.java",
- "package p;\n" +
- "public interface I { static int Constant = 1; }\n",
- "p/J.java",
- "package p;\n" +
- "public interface J extends I {}\n" ,
- },
- "----------\n" +
- "1. WARNING in Test.java (at line 2)\n" +
- " import static p.J.*;\n" +
- " ^^^\n" +
- "The import p.J is never used\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=133737
- public void test042() {
- this.runNegativeTest(
- new String[] {
- "ImportTest.java",
- "import static p.ArrayTest.toString2;\n" +
- "public class ImportTest extends SuperTest {\n" +
- " public static void main(String[] args) { printArgs(1, 2, 3, 4, 5); }\n" +
- " static void printArgs(Object... args) { toString2(args); }\n" +
- "}\n" +
- "class SuperTest {\n" +
- " static void toString2() {}\n" +
- "}\n",
- "p/ArrayTest.java",
- "package p;\n" +
- "public class ArrayTest {\n" +
- " public static void toString2(String[] args) {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in ImportTest.java (at line 4)\r\n" +
- " static void printArgs(Object... args) { toString2(args); }\r\n" +
- " ^^^^^^^^^\n" +
- "The method toString2() in the type SuperTest is not applicable for the arguments (Object[])\n" +
- "----------\n"
- // toString2() in SuperTest cannot be applied to (java.lang.Object[])
- );
- this.runNegativeTest(
- new String[] {
- "ImportTest.java",
- "import static java.util.Arrays.toString;\n" +
- "public class ImportTest {\n" +
- " public static void main(String[] args) { printArgs(1, 2, 3, 4, 5); }\n" +
- " static void printArgs(Object... args) { toString(args); }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in ImportTest.java (at line 4)\n" +
- " static void printArgs(Object... args) { toString(args); }\n" +
- " ^^^^^^^^\n" +
- "The method toString() in the type Object is not applicable for the arguments (Object[])\n" +
- "----------\n"
- // toString() in java.lang.Object cannot be applied to (java.lang.Object[])
- );
- }
- public void test042b() {
- this.runConformTest(
- new String[] {
- "ImportTest.java",
- "import static p.DefinesFoo.foo;\n" +
- "public class ImportTest extends SuperImportTest {\n" +
- " void test() { foo(\"fails?\"); }\n" +
- "}\n" +
- "class SuperImportTest {\n" +
- " private void foo() {}\n" +
- "}\n",
- "p/DefinesFoo.java",
- "package p;\n" +
- "public class DefinesFoo {\n" +
- " public static void foo(String s) {}\n" +
- "}\n",
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129388
- public void test043() {
- this.runConformTest(
- new String[] {
- "B.java",
- "import static java.lang.String.format;\n" +
- "public class B extends p.A {\n" +
- " void test() { format(\"fails?\"); }\n" +
- " void test2() { format(\"fails?\", null); }\n" +
- " void test3() { format(\"fails?\", null, null); }\n" +
- " void test4() { format(\"fails?\", null, null, null); }\n" +
- "}\n",
- "p/A.java",
- "package p;\n" +
- "public class A {\n" +
- " static String format(String message, Object expected, Object actual) { return null; }\n" +
- "}\n",
- },
- ""
- );
- }
- // names potential confusion
- public void test044() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import static p.X.B.E;\n" +
- "import static p.X.B.*;\n" +
- "\n" +
- "public class X {\n" +
- " public static class Y {\n" +
- " public enum E { FOO; }\n" +
- " public static Object E() { return null; }\n" +
- " public enum F { FOO; }\n" +
- " public static Object F() { return null; }\n" +
- " }\n" +
- " public static class B extends Y {}\n" +
- " Object f1 = E.FOO;\n" +
- " Object f2 = E();\n" +
- " Object f3 = F.FOO;\n" +
- " Object f4 = F();\n" +
- "}\n",
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142772
- public void test045() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import static test.Y.arrayList;\n" +
- "public class X { static void arrayList(int x) { arrayList(); } }\n",
- "test/Y.java",
- "package test;\n" +
- "public class Y { public static void arrayList() {} }\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " public class X { static void arrayList(int x) { arrayList(); } }\n" +
- " ^^^^^^^^^\n" +
- "The method arrayList(int) in the type X is not applicable for the arguments ()\n" +
- "----------\n"
- // arrayList(int) in X cannot be applied to ()
- );
- }
- public void test045b() {
- this.runNegativeTest(
- new String[] {
- "test/One.java",
- "package test;\n" +
- "public class One { public static void arrayList(String s) {} }\n",
- "test/Two.java",
- "package test;\n" +
- "public class Two { public void arrayList(int i) {} }\n",
- "test/Three.java",
- "package test;\n" +
- "import static test.One.arrayList;\n" +
- "public class Three extends Two { public static void test(String s) { arrayList(s); } }\n",
- },
- "----------\n" +
- "1. ERROR in test\\Three.java (at line 3)\n" +
- " public class Three extends Two { public static void test(String s) { arrayList(s); } }\n" +
- " ^^^^^^^^^\n" +
- "The method arrayList(int) in the type Two is not applicable for the arguments (String)\n" +
- "----------\n"
- // arrayList(int) in test.Two cannot be applied to (java.lang.String)
- );
- this.runNegativeTest(
- new String[] {
- "test/One.java",
- "package test;\n" +
- "public class One { public static void arrayList(String s) {} }\n",
- "test/Two.java",
- "package test;\n" +
- "public class Two { public static void arrayList(int i) {} }\n",
- "test/Three.java",
- "package test;\n" +
- "import static test.One.arrayList;\n" +
- "public class Three extends Two { public static void test(String s) { arrayList(s); } }\n",
- },
- "----------\n" +
- "1. ERROR in test\\Three.java (at line 3)\r\n" +
- " public class Three extends Two { public static void test(String s) { arrayList(s); } }\r\n" +
- " ^^^^^^^^^\n" +
- "The method arrayList(int) in the type Two is not applicable for the arguments (String)\n" +
- "----------\n"
- // arrayList(int) in test.Two cannot be applied to (java.lang.String)
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=133737
- public void test046() {
- this.runNegativeTest(
- new String[] {
- "error/Exporter.java",
- "package error;\n" +
- "public class Exporter {\n" +
- " public static String getName(Class<?> c) {\n" +
- " return null;\n" +
- " }\n" +
- "}",
- "error/Importer.java",
- "package error;\n" +
- "import static error.Exporter.getName;\n" +
- "public class Importer extends Base {\n" +
- " public void testSomething() {\n" +
- " getName();\n" +
- " getName(Importer.class);\n" +
- " }\n" +
- "}",
- "error/Base.java",
- "package error;\n" +
- "public class Base {\n" +
- " public String getName() {\n" +
- " return \"name\";\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in error\\Importer.java (at line 6)\n" +
- " getName(Importer.class);\n" +
- " ^^^^^^^\n" +
- "The method getName() in the type Base is not applicable for the arguments (Class<Importer>)\n" +
- "----------\n"
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165069
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165081
- public void test047() {
- this.runNegativeTest(
- new String[] {
- "sample/X.java",
- "package sample;\n" +
- "import static sample.X.TestEnum.V1;\n" +
- "import static sample.X.TestEnum.V2;\n" +
- "\n" +
- "public class X<T> {\n" +
- " public static enum TestEnum {\n" +
- " V1,\n" +
- " V2\n" +
- " }\n" +
- "\n" +
- " public void test(final TestEnum value) {\n" +
- " switch (value) {\n" +
- " case V1:\n" +
- " case V2:\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public void ref() {\n" +
- " final TestEnum v1 = TestEnum.V1;\n" +
- " final TestEnum v2 = TestEnum.V2;\n" +
- " int i;\n" +
- " i++;\n" +
- " }\n" +
- "}", // =================
- },
- "----------\n" +
- "1. WARNING in sample\\X.java (at line 2)\n" +
- " import static sample.X.TestEnum.V1;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The import sample.X.TestEnum.V1 is never used\n" +
- "----------\n" +
- "2. WARNING in sample\\X.java (at line 3)\n" +
- " import static sample.X.TestEnum.V2;\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The import sample.X.TestEnum.V2 is never used\n" +
- "----------\n" +
- "3. ERROR in sample\\X.java (at line 22)\n" +
- " i++;\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
- "----------\n");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165069 - variation
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165081 - variation
- public void test048() {
- this.runNegativeTest(
- new String[] {
- "sample/X.java",
- "package sample;\n" +
- "import static sample.X.TestEnum.*;\n" +
- "\n" +
- "public class X<T> {\n" +
- " public static enum TestEnum {\n" +
- " V1,\n" +
- " V2\n" +
- " }\n" +
- "\n" +
- " public void test(final TestEnum value) {\n" +
- " switch (value) {\n" +
- " case V1:\n" +
- " case V2:\n" +
- " }\n" +
- " }\n" +
- "\n" +
- " public void ref() {\n" +
- " final TestEnum v1 = TestEnum.V1;\n" +
- " final TestEnum v2 = TestEnum.V2;\n" +
- " int i;\n" +
- " i++;\n" +
- " }\n" +
- "}", // =================
- },
- "----------\n" +
- "1. WARNING in sample\\X.java (at line 2)\n" +
- " import static sample.X.TestEnum.*;\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The import sample.X.TestEnum is never used\n" +
- "----------\n" +
- "2. ERROR in sample\\X.java (at line 21)\n" +
- " i++;\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
- "----------\n");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165081 - variation
- public void test049() {
- this.runNegativeTest(
- new String[] {
- "sample/X.java",
- "package sample;\n" +
- "import static sample.X.*;\n" +
- "public class X {\n" +
- " public class Member {}\n" +
- " public void ref() {\n" +
- " int i;\n" +
- " i++;\n" +
- " }\n" +
- "}", // =================
- },
- "----------\n" +
- "1. WARNING in sample\\X.java (at line 2)\n" +
- " import static sample.X.*;\n" +
- " ^^^^^^^^\n" +
- "The import sample.X is never used\n" +
- "----------\n" +
- "2. ERROR in sample\\X.java (at line 7)\n" +
- " i++;\n" +
- " ^\n" +
- "The local variable i may not have been initialized\n" +
- "----------\n");
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SuperTypeTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SuperTypeTest.java
deleted file mode 100644
index 00ca596..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SuperTypeTest.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class SuperTypeTest extends AbstractRegressionTest {
-
- public SuperTypeTest(String name) {
- super(name);
- }
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 42, 43, 44 };
-// TESTS_RANGE = new int[] { 11, -1 };
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
- }
-
- public static Class testClass() {
- return SuperTypeTest.class;
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=136106
- */
- public void test001() {
- this.runConformTest(
- new String[] {
- /* org.eclipse.curiosity.A */
- "org/eclipse/curiosity/A.java",
- "package org.eclipse.curiosity;\n" +
- "public abstract class A implements InterfaceA {\n" +
- " private void e() {\n" +
- " }\n" +
- " public void f() {\n" +
- " this.e();\n" +
- " }\n" +
- "}",
- /* org.eclipse.curiosity.InterfaceA */
- "org/eclipse/curiosity/InterfaceA.java",
- "package org.eclipse.curiosity;\n" +
- "public interface InterfaceA extends InterfaceBase {}\n",
- "org/eclipse/curiosity/InterfaceBase.java",
- /* org.eclipse.curiosity.InterfaceBase */
- "package org.eclipse.curiosity;\n" +
- "public interface InterfaceBase {\n" +
- " public void a();\n" +
- " public void b();\n" +
- " public void c();\n" +
- " public void d();\n" +
- "}"
- }
- );
- }
-// was Compliance_1_x#test001
-public void test002() {
- String[] sources = new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " class M { \n"+
- " } \n"+
- " void foo(){ \n"+
- " class Y extends Secondary { \n"+
- " M m; \n"+
- " }; \n"+
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " class M {} \n" +
- "} \n"
- };
- if (this.complianceLevel.equals(COMPLIANCE_1_3)) {
- runNegativeTest(
- sources,
- "----------\n" +
- "1. ERROR in p1\\Test.java (at line 10)\n" +
- " M m; \n" +
- " ^\n" +
- "The type M is defined in an inherited type and an enclosing scope\n" +
- "----------\n");
- } else {
- runConformTest(
- sources,
- "SUCCESS");
- }
-}
-
-// was Compliance_1_x#test002
-public void test003() {
- String[] sources = new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar() { \n"+
- " return \"FAILED\"; \n" +
- " } \n"+
- " void foo(){ \n"+
- " class Y extends Secondary { \n"+
- " String z = bar(); \n" +
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " String bar(){ return \"SUCCESS\"; } \n" +
- "} \n"
- };
- if (this.complianceLevel.equals(COMPLIANCE_1_3)) {
- runNegativeTest(
- sources,
- "----------\n" +
- "1. ERROR in p1\\Test.java (at line 11)\n" +
- " String z = bar(); \n" +
- " ^^^\n" +
- "The method bar is defined in an inherited type and an enclosing scope\n" +
- "----------\n");
- } else {
- runConformTest(
- sources,
- "SUCCESS");
- }
-}
-
-// was Compliance_1_x#test003
-public void test004() {
- String[] sources = new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar = \"FAILED\";"+
- " void foo(){ \n"+
- " class Y extends Secondary { \n"+
- " String z = bar; \n"+
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " String bar = \"SUCCESS\"; \n" +
- "} \n"
- };
- if (this.complianceLevel.equals(COMPLIANCE_1_3)) {
- runNegativeTest(
- sources,
- "----------\n" +
- "1. ERROR in p1\\Test.java (at line 8)\n" +
- " String z = bar; \n" +
- " ^^^\n" +
- "The field bar is defined in an inherited type and an enclosing scope \n" +
- "----------\n");
- } else {
- runConformTest(
- sources,
- "SUCCESS");
- }
-}
-
-// was Compliance_1_x#test004
-public void test005() {
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar() { \n"+
- " return \"SUCCESS\"; \n" +
- " } \n"+
- " void foo(){ \n"+
- " class Y extends Secondary { \n"+
- " String z = bar(); \n" +
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " private String bar(){ return \"FAILED\"; } \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-// was Compliance_1_x#test005
-public void test006() {
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar = \"SUCCESS\";"+
- " void foo(){ \n"+
- " class Y extends Secondary { \n"+
- " String z = bar; \n"+
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " private String bar = \"FAILED\"; \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-// was Compliance_1_x#test006
-public void test007() {
- this.runNegativeTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar() { \n"+
- " return \"FAILED\"; \n" +
- " } \n"+
- " void foo(){ \n"+
- " class Y extends Secondary { \n"+
- " String z = bar(); \n" +
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " String bar(int i){ return \"SUCCESS\"; } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\Test.java (at line 11)\n" +
- " String z = bar(); \n" +
- " ^^^\n" +
- "The method bar(int) in the type Secondary is not applicable for the arguments ()\n" +
- "----------\n"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SwitchTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SwitchTest.java
deleted file mode 100644
index bde73f6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SwitchTest.java
+++ /dev/null
@@ -1,576 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class SwitchTest extends AbstractRegressionTest {
-
-public SwitchTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public void test001() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " try {\n" +
- " switch(0) {\n" +
- " case 0 :\n" +
- " case 1 - (1 << 31) :\n" +
- " case (1 << 30) :\n" +
- " }\n" +
- " } catch (OutOfMemoryError e) {\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-public void test002() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " int k;\n" +
- " public void foo() {\n" +
- " int c;\n" +
- " switch (k) {\n" +
- " default :\n" +
- " c = 2;\n" +
- " break;\n" +
- " case 2 :\n" +
- " c = 3;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test003() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " int i = 0;\n" +
- " void foo() {\n" +
- " switch (i) {\n" +
- " case 1 :\n" +
- " {\n" +
- " int j;\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test004() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static int foo() {\n" +
- " int i = 0, j;\n" +
- " switch (i) {\n" +
- " default :\n" +
- " int k = 2;\n" +
- " j = k;\n" +
- " }\n" +
- " if (j != -2) {\n" +
- " return 1;\n" +
- " }\n" +
- " return 0;\n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test005() {
- this.runConformTest(new String[] {
- "p/BugJavaCase.java",
- "package p;\n" +
- "class BugJavaCase {\n" +
- " public static final int BC_ZERO_ARG = 1;\n" +
- " public void test01(int i) {\n" +
- " switch (i) {\n" +
- " case BC_ZERO_ARG :\n" +
- " System.out.println(\"i = \" + i);\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-
-
-public void test006() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " foo(); \n" +
- " } \n" +
- " \n" +
- " public static void foo() { \n" +
- " char x = 5;\n" +
- " final short b = 5;\n" +
- " int a;\n" +
- " \n" +
- " switch (x) {\n" +
- " case b: // compile time error\n" +
- " a = 0;\n" +
- " break; \n" +
- " default:\n" +
- " a=1;\n" +
- " }\n" +
- " \n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test007() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "class X {\n" +
- " void v() {\n" +
- " switch (1) {\n" +
- " case (int) (1.0 / 0.0) :\n" +
- " break;\n" +
- " case (int) (2.0 / 0.0) :\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 5)\n" +
- " case (int) (1.0 / 0.0) :\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 7)\n" +
- " case (int) (2.0 / 0.0) :\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate case\n" +
- "----------\n"
- );
-}
-public void test008() {
- this.runConformTest(new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " switch(args.length){\n" +
- " }\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-public void test009() {
- this.runConformTest(new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " switch (81391861) {\n" +
- " case (81391861) :\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " break;\n" +
- " default:\n" +
- " System.out.println(\"FAILED\");\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-public void test010() {
- this.runNegativeTest(new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo(){\n" +
- " switch(this){\n" +
- " case 0 : \n" +
- " Zork z;\n" +
- " }\n" +
- " }\n" +
- " \n" +
- " void bar(){\n" +
- " switch(x){\n" +
- " case 0 : \n" +
- " Zork z;\n" +
- " }\n" +
- " } \n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " switch(this){\n" +
- " ^^^^\n" +
- "Cannot switch on a value of type X. Only int values or enum constants are permitted\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 11)\n" +
- " switch(x){\n" +
- " ^\n" +
- "x cannot be resolved\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 13)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
-}
-public void test011() {
- this.runConformTest(new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " switch (args.length) {\n" +
- " case 1 :\n" +
- " System.out.println();\n" +
- " case 3 :\n" +
- " break;\n" +
- " default :\n" +
- " }\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86813
-//public void test012() {
-// this.runConformTest(new String[] {
-// "X.java",
-// "public class X {\n" +
-// " public static void main(String[] args) {\n" +
-// " boolean x= true;\n" +
-// " try {\n" +
-// " int i= 1;\n" +
-// " switch (i) { // <-- breakpoint here\n" +
-// " case 1:\n" +
-// " break; //step 1 \n" +
-// " case 2:\n" +
-// " x = false; //step 2 \n" +
-// " break;\n" +
-// " }\n" +
-// " }catch(Exception e) {\n" +
-// " }\n" +
-// " System.out.println(\"SUCCESS\");\n" +
-// " }\n" +
-// "}\n",
-// },
-// "SUCCESS");
-//
-// String expectedOutput =
-// " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
-// " // Stack: 2, Locals: 3\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 iconst_1\n" +
-// " 1 istore_1 [x]\n" +
-// " 2 iconst_1\n" +
-// " 3 istore_2 [i]\n" +
-// " 4 iload_2 [i]\n" +
-// " 5 tableswitch default: 33\n" +
-// " case 1: 28\n" +
-// " case 2: 31\n" +
-// " 28 goto 37\n" +
-// " 31 iconst_0\n" +
-// " 32 istore_1 [x]\n" +
-// " 33 goto 37\n" +
-// " 36 astore_2\n" +
-// " 37 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
-// " 40 ldc <String \"SUCCESS\"> [22]\n" +
-// " 42 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" +
-// " 45 return\n" +
-// " Exception Table:\n" +
-// " [pc: 2, pc: 33] -> 36 when : java.lang.Exception\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 3]\n" +
-// " [pc: 2, line: 5]\n" +
-// " [pc: 4, line: 6]\n" +
-// " [pc: 28, line: 8]\n" +
-// " [pc: 31, line: 10]\n" +
-// " [pc: 33, line: 12]\n" +
-// " [pc: 36, line: 13]\n" +
-// " [pc: 37, line: 15]\n" +
-// " [pc: 45, line: 16]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 46] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 2, pc: 46] local: x index: 1 type: boolean\n" +
-// " [pc: 4, pc: 36] local: i index: 2 type: int\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// e.printStackTrace();
-// assertTrue("ClassFormatException", false);
-// } catch (IOException e) {
-// e.printStackTrace();
-// assertTrue("IOException", false);
-// }
-//}
-//public void test013() {
-// this.runConformTest(new String[] {
-// "X.java",
-// "public class X {\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " X x;\n" +
-// " Object o = null;\n" +
-// " for (int i = 0; i < 10; i++) {\n" +
-// " if (i < 90) {\n" +
-// " x = new X();\n" +
-// " if (i > 4) {\n" +
-// " o = new Object();\n" +
-// " } else {\n" +
-// " o = null;\n" +
-// " }\n" +
-// " switch (2) {\n" +
-// " case 0:\n" +
-// " if (o instanceof String) {\n" +
-// " System.out.print(\"1\");\n" +
-// " return;\n" +
-// " } else {\n" +
-// " break;\n" +
-// " }\n" +
-// " default: {\n" +
-// " Object diff = o;\n" +
-// " if (diff != null) {\n" +
-// " System.out.print(\"2\");\n" +
-// " }\n" +
-// " break;\n" +
-// " }\n" +
-// " }\n" +
-// " System.out.print(\"3\"); \n" +
-// " }\n" +
-// " }\n" +
-// " }\n" +
-// "}\n",
-// },
-// "333332323232323");
-//
-// String expectedOutput = new CompilerOptions(this.getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_6
-// ? " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
-// " // Stack: 2, Locals: 5\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 aconst_null\n" +
-// " 1 astore_2 [o]\n" +
-// " 2 iconst_0\n" +
-// " 3 istore_3 [i]\n" +
-// " 4 goto 103\n" +
-// " 7 iload_3 [i]\n" +
-// " 8 bipush 90\n" +
-// " 10 if_icmpge 100\n" +
-// " 13 new X [1]\n" +
-// " 16 dup\n" +
-// " 17 invokespecial X() [16]\n" +
-// " 20 astore_1 [x]\n" +
-// " 21 iload_3 [i]\n" +
-// " 22 iconst_4\n" +
-// " 23 if_icmple 37\n" +
-// " 26 new java.lang.Object [3]\n" +
-// " 29 dup\n" +
-// " 30 invokespecial java.lang.Object() [8]\n" +
-// " 33 astore_2 [o]\n" +
-// " 34 goto 39\n" +
-// " 37 aconst_null\n" +
-// " 38 astore_2 [o]\n" +
-// " 39 iconst_2\n" +
-// " 40 tableswitch default: 76\n" +
-// " case 0: 60\n" +
-// " 60 aload_2 [o]\n" +
-// " 61 instanceof java.lang.String [17]\n" +
-// " 64 ifeq 92\n" +
-// " 67 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
-// " 70 ldc <String \"1\"> [25]\n" +
-// " 72 invokevirtual java.io.PrintStream.print(java.lang.String) : void [27]\n" +
-// " 75 return\n" +
-// " 76 aload_2 [o]\n" +
-// " 77 astore 4 [diff]\n" +
-// " 79 aload 4 [diff]\n" +
-// " 81 ifnull 92\n" +
-// " 84 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
-// " 87 ldc <String \"2\"> [33]\n" +
-// " 89 invokevirtual java.io.PrintStream.print(java.lang.String) : void [27]\n" +
-// " 92 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
-// " 95 ldc <String \"3\"> [35]\n" +
-// " 97 invokevirtual java.io.PrintStream.print(java.lang.String) : void [27]\n" +
-// " 100 iinc 3 1 [i]\n" +
-// " 103 iload_3 [i]\n" +
-// " 104 bipush 10\n" +
-// " 106 if_icmplt 7\n" +
-// " 109 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 5]\n" +
-// " [pc: 2, line: 6]\n" +
-// " [pc: 7, line: 7]\n" +
-// " [pc: 13, line: 8]\n" +
-// " [pc: 21, line: 9]\n" +
-// " [pc: 26, line: 10]\n" +
-// " [pc: 37, line: 12]\n" +
-// " [pc: 39, line: 14]\n" +
-// " [pc: 60, line: 16]\n" +
-// " [pc: 67, line: 17]\n" +
-// " [pc: 75, line: 18]\n" +
-// " [pc: 76, line: 23]\n" +
-// " [pc: 79, line: 24]\n" +
-// " [pc: 84, line: 25]\n" +
-// " [pc: 92, line: 30]\n" +
-// " [pc: 100, line: 6]\n" +
-// " [pc: 109, line: 33]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 110] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 21, pc: 100] local: x index: 1 type: X\n" +
-// " [pc: 2, pc: 110] local: o index: 2 type: java.lang.Object\n" +
-// " [pc: 4, pc: 109] local: i index: 3 type: int\n" +
-// " [pc: 79, pc: 92] local: diff index: 4 type: java.lang.Object\n"
-// :
-// " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
-// " // Stack: 2, Locals: 5\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 aconst_null\n" +
-// " 1 astore_2 [o]\n" +
-// " 2 iconst_0\n" +
-// " 3 istore_3 [i]\n" +
-// " 4 goto 103\n" +
-// " 7 iload_3 [i]\n" +
-// " 8 bipush 90\n" +
-// " 10 if_icmpge 100\n" +
-// " 13 new X [1]\n" +
-// " 16 dup\n" +
-// " 17 invokespecial X() [16]\n" +
-// " 20 astore_1 [x]\n" +
-// " 21 iload_3 [i]\n" +
-// " 22 iconst_4\n" +
-// " 23 if_icmple 37\n" +
-// " 26 new java.lang.Object [3]\n" +
-// " 29 dup\n" +
-// " 30 invokespecial java.lang.Object() [8]\n" +
-// " 33 astore_2 [o]\n" +
-// " 34 goto 39\n" +
-// " 37 aconst_null\n" +
-// " 38 astore_2 [o]\n" +
-// " 39 iconst_2\n" +
-// " 40 tableswitch default: 76\n" +
-// " case 0: 60\n" +
-// " 60 aload_2 [o]\n" +
-// " 61 instanceof java.lang.String [17]\n" +
-// " 64 ifeq 92\n" +
-// " 67 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
-// " 70 ldc <String \"1\"> [25]\n" +
-// " 72 invokevirtual java.io.PrintStream.print(java.lang.String) : void [27]\n" +
-// " 75 return\n" +
-// " 76 aload_2 [o]\n" +
-// " 77 astore 4 [diff]\n" +
-// " 79 aload 4 [diff]\n" +
-// " 81 ifnull 92\n" +
-// " 84 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
-// " 87 ldc <String \"2\"> [33]\n" +
-// " 89 invokevirtual java.io.PrintStream.print(java.lang.String) : void [27]\n" +
-// " 92 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
-// " 95 ldc <String \"3\"> [35]\n" +
-// " 97 invokevirtual java.io.PrintStream.print(java.lang.String) : void [27]\n" +
-// " 100 iinc 3 1 [i]\n" +
-// " 103 iload_3 [i]\n" +
-// " 104 bipush 10\n" +
-// " 106 if_icmplt 7\n" +
-// " 109 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 5]\n" +
-// " [pc: 2, line: 6]\n" +
-// " [pc: 7, line: 7]\n" +
-// " [pc: 13, line: 8]\n" +
-// " [pc: 21, line: 9]\n" +
-// " [pc: 26, line: 10]\n" +
-// " [pc: 37, line: 12]\n" +
-// " [pc: 39, line: 14]\n" +
-// " [pc: 60, line: 16]\n" +
-// " [pc: 67, line: 17]\n" +
-// " [pc: 75, line: 18]\n" +
-// " [pc: 76, line: 23]\n" +
-// " [pc: 79, line: 24]\n" +
-// " [pc: 84, line: 25]\n" +
-// " [pc: 92, line: 30]\n" +
-// " [pc: 100, line: 6]\n" +
-// " [pc: 109, line: 33]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 110] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 21, pc: 100] local: x index: 1 type: X\n" +
-// " [pc: 2, pc: 110] local: o index: 2 type: java.lang.Object\n" +
-// " [pc: 4, pc: 109] local: i index: 3 type: int\n" +
-// " [pc: 79, pc: 92] local: diff index: 4 type: java.lang.Object\n" +
-// " Stack map table: number of frames 8\n" +
-// " [pc: 7, full, stack: {}, locals: {java.lang.String[], _, java.lang.Object, int}]\n" +
-// " [pc: 37, full, stack: {}, locals: {java.lang.String[], X, java.lang.Object, int}]\n" +
-// " [pc: 39, same]\n" +
-// " [pc: 60, same]\n" +
-// " [pc: 76, same]\n" +
-// " [pc: 92, same]\n" +
-// " [pc: 100, full, stack: {}, locals: {java.lang.String[], _, java.lang.Object, int}]\n" +
-// " [pc: 103, same]\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// e.printStackTrace();
-// assertTrue("ClassFormatException", false);
-// } catch (IOException e) {
-// e.printStackTrace();
-// assertTrue("IOException", false);
-// }
-//}
-public static Class testClass() {
- return SwitchTest.class;
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java
deleted file mode 100644
index a50dd1f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.ArrayList;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.future.compiler.regression.ArrayTest;
-import org.eclipse.wst.jsdt.core.tests.future.compiler.regression.BooleanTest;
-import org.eclipse.wst.jsdt.core.tests.future.compiler.regression.Compliance_1_4;
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-
-/**
- * Run all compiler regression tests
- */
-public class TestAll extends junit.framework.TestCase {
-
-public TestAll(String testName) {
- super(testName);
-}
-public static Test suite() {
-
- // Common test suites
- ArrayList standardTests = new ArrayList();
- standardTests.add(ArrayTest.class);
- standardTests.add(AssignmentTest.class);
- standardTests.add(BooleanTest.class);
-// standardTests.add(ClassFileComparatorTest.class);
-// standardTests.add(CollisionCase.class);
-// standardTests.add(ConstantTest.class);
- standardTests.add(DeprecatedTest.class);
- standardTests.add(LocalVariableTest.class);
- standardTests.add(LookupTest.class);
- standardTests.add(NumericTest.class);
- standardTests.add(ProblemConstructorTest.class);
- standardTests.add(ProblemTypeAndMethodTest.class);
- standardTests.add(ScannerTest.class);
- standardTests.add(SwitchTest.class);
- standardTests.add(TryStatementTest.class);
- standardTests.add(UtilTest.class);
- standardTests.add(XLargeTest.class);
- standardTests.add(InternalScannerTest.class);
-// standardTests.add(ConditionalExpressionTest.class);
- standardTests.add(ExternalizeStringLiteralsTest.class);
- standardTests.add(NonFatalErrorTest.class);
- standardTests.add(FlowAnalysisTest.class);
- standardTests.add(CharOperationTest.class);
- standardTests.add(RuntimeTests.class);
-// standardTests.add(DebugAttributeTest.class);
- standardTests.add(NullReferenceTest.class);
- standardTests.add(CompilerInvocationTests.class);
- standardTests.add(InnerEmulationTest.class);
- standardTests.add(SuperTypeTest.class);
- standardTests.add(ForStatementTest.class);
- standardTests.add(FieldAccessTest.class);
- standardTests.add(SerialVersionUIDTests.class);
-// standardTests.add(LineNumberAttributeTest.class);
-
- // add all javadoc tests
- for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i<l; i++) {
- standardTests.add(JavadocTest.ALL_CLASSES.get(i));
- }
-
- // Tests to run when compliance is greater than 1.3
- ArrayList since_1_4 = new ArrayList();
-// since_1_4.add(AssertionTest.class);
-
- // Tests to run when compliance is greater than 1.4
- ArrayList since_1_5 = new ArrayList();
- since_1_5.addAll(RunComparableTests.ALL_CLASSES);
-// since_1_5.add(ClassFileReaderTest_1_5.class);
- since_1_5.add(InternalHexFloatTest.class);
- since_1_5.add(JavadocTest_1_5.class);
-// since_1_5.add(BatchCompilerTest.class);
- since_1_5.add(ExternalizeStringLiterals15Test.class);
-// since_1_5.add(Deprecated15Test.class);
-
- // Tests to run when compliance is greater than 1.5
- ArrayList since_1_6 = new ArrayList();
-// since_1_6.add(StackMapAttributeTest.class);
-
- // Build final test suite
- TestSuite all = new TestSuite(TestAll.class.getName());
- int possibleComplianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_3) != 0) {
- ArrayList tests_1_3 = (ArrayList)standardTests.clone();
- tests_1_3.add(Compliance_1_3.class);
- tests_1_3.add(JavadocTest_1_3.class);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_3, tests_1_3));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- ArrayList tests_1_4 = (ArrayList)standardTests.clone();
- tests_1_4.addAll(since_1_4);
- tests_1_4.add(Compliance_1_4.class);
-// tests_1_4.add(ClassFileReaderTest_1_4.class);
- tests_1_4.add(JavadocTest_1_4.class);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_4, tests_1_4));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- ArrayList tests_1_5 = (ArrayList)standardTests.clone();
- tests_1_5.addAll(since_1_4);
- tests_1_5.addAll(since_1_5);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_5, tests_1_5));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_6) != 0) {
- ArrayList tests_1_6 = (ArrayList)standardTests.clone();
- tests_1_6.addAll(since_1_4);
- tests_1_6.addAll(since_1_5);
- tests_1_6.addAll(since_1_6);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_6, tests_1_6));
- }
- if ((possibleComplianceLevels & AbstractCompilerTest.F_1_7) != 0) {
- ArrayList tests_1_7 = (ArrayList)standardTests.clone();
- tests_1_7.addAll(since_1_4);
- tests_1_7.addAll(since_1_5);
- tests_1_7.addAll(since_1_6);
- // Reset forgotten subsets tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS= null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
- all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_7, tests_1_7));
- }
- return all;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TryStatementTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TryStatementTest.java
deleted file mode 100644
index 96e3c3c..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TryStatementTest.java
+++ /dev/null
@@ -1,5366 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class TryStatementTest extends AbstractRegressionTest {
-
- static {
- // TESTS_NAMES = new String[] { "test000" };
- // TESTS_NUMBERS = new int[] { 54 };
- // TESTS_RANGE = new int[] { 11, -1 };
- }
-
- public TryStatementTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
- }
-
- public void test001() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" + "public class X {\n" + " public class X1 {\n"
- + " public X1() throws Exception {\n" + " }\n"
- + " }\n" + " public void method1(){\n"
- + " try {\n" + " new X1() {\n" + " };\n"
- + " } catch(Exception e){\n" + " }\n" + " }\n"
- + "}\n", });
- }
-
- public void test002() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" + "import java.io.*;\n"
- + "import java.util.zip.*;\n" + "class X {\n"
- + " void bar() throws ZipException, IOException {}\n"
- + " void foo() {\n" + " try {\n" + " bar();\n"
- + " } catch (ZipException e) {\n"
- + " } catch (IOException e) {\n" + " }\n"
- + " }\n" + "}\n", });
- }
-
- public void test003() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" + "public class X {\n" + " public class A1 {\n"
- + " public A1() throws Exception {\n" + " }\n"
- + " }\n" + " public void method1(){\n"
- + " try {\n" + " new A1() {\n" + " };\n"
- + " } catch(Exception e){\n" + " }\n" + " }\n"
- + "}\n", });
- }
-
- public void test004() {
- this.runConformTest(new String[] {
- "p/ATC.java",
- "package p;\n" + "public class ATC {\n" + " \n"
- + " public class B extends Exception {\n"
- + " public B(String msg) { super(msg); }\n"
- + " }\n" + " \n"
- + " void foo() throws ATC.B {\n"
- + " Object hello$1 = null;\n" + " try {\n"
- + " throw new B(\"Inside foo()\");\n"
- + " } catch(B e) {\n"
- + " System.out.println(\"Caught B\");\n"
- + " } \n" + " } \n" + "}\n", });
- }
-
- public void test005() {
- this
- .runConformTest(new String[] {
- "p/A.java",
- "package p;\n"
- + "import java.io.IOException;\n"
- + "import java.util.Vector;\n"
- + "/**\n"
- + " * This test0 should run without producing a java.lang.ClassFormatError\n"
- + " */\n"
- + "public class A {\n"
- + " public Vector getComponents () {\n"
- + " try{\n"
- + " throw new IOException();\n"
- + " }\n"
- + " catch (IOException ioe) {\n"
- + " }\n"
- + " return null;\n"
- + " }\n"
- + " public static void main(String[] args) {\n"
- + " new A().getComponents();\n" + " }\n"
- + "}\n", });
- }
-
- public void test006() {
- this
- .runConformTest(new String[] {
- "p/T.java",
- "package p;\n"
- + "import java.lang.reflect.*;\n"
- + "public class T extends InvocationTargetException {\n"
- + " public static void main(String[] args) {\n"
- + " T ct = new T();\n"
- + " ct.getTargetException();\n"
- + " }\n"
- + " public Throwable getTargetException() {\n"
- + " Runnable runnable = new Runnable() {\n"
- + " public void run() {\n"
- + " System.out.println(\"we got here\");\n"
- + " T.super.getTargetException();\n"
- + " }\n" + " };\n"
- + " runnable.run();\n"
- + " return new Throwable();\n" + " }\n"
- + "}\n", });
- }
-
- public void test007() {
- this
- .runConformTest(new String[] {
- "TryFinally.java",
- "class TryFinally { \n"
- + " public int readFile(String filename) throws Exception { \n"
- + " int interfaceID = -1; \n"
- + " int iNdx = 0; \n"
- + " try { \n"
- + " try { \n"
- + " return interfaceID; \n"
- + " } // end try \n"
- + " finally { \n"
- + " iNdx = 1; \n"
- + " } // end finally \n"
- + " } // end try \n"
- + " catch (Exception ex) { \n"
- + " throw new Exception(\"general exception \" + ex.getMessage() + \" on processing file \" + filename); \n"
- + " } // end catch \n" + " finally { \n"
- + " } // end finally \n"
- + " } // end readFile method \n" + "} \n" });
- }
-
- /*
- * 1FZR1TO: IVJCOM:WIN - Class does not compile in VAJava 3.02-Java2
- */
- public void test008() {
- this
- .runConformTest(
- new String[] {
- "RedundantException.java",
- "import java.io.*;\n"
- + "public class RedundantException {\n"
- + " /**\n"
- + " * Runs the class as an application.\n"
- + " */\n"
- + " public static void main(String[] args) {\n"
- + " RedundantException re = new RedundantException();\n"
- + " re.catchIt();\n"
- + " System.out.println(\"SUCCESS\");\n"
- + " }\n"
- + " /**\n"
- + " * Defines a method that lists an exception twice.\n"
- + " * This can be buried in a much longer list.\n"
- + " */\n"
- + " void throwIt() throws IOException, IOException {\n"
- + " throw new IOException();\n"
- + " }\n"
- + " /**\n"
- + " * Catches the redundantly defined exception.\n"
- + " */\n"
- + " void catchIt() {\n"
- + " try {\n"
- + " throwIt(); // compile error here\n"
- + " } catch (IOException e) {\n"
- + " System.out.println(\"Caught.\");\n"
- + " }\n" + " }\n" + "}" }, "Caught.\n"
- + "SUCCESS");
- }
-
- public void test009() {
- this.runConformTest(new String[] {
- "Test.java",
- "public class Test {\n" + "public void save() {\n"
- + " int a = 3;\n" + " try {\n"
- + " Object warnings = null;\n" + " try {\n"
- + " Object contexts = null;\n"
- + " try {\n"
- + " System.out.println(warnings);\n"
- + " return;\n"
- + " } catch (NullPointerException npe) {\n"
- + " System.out.println(contexts);\n"
- + " return;\n" + " }\n"
- + " } catch (Exception e) {\n" + " return;\n"
- + " }\n" + " } finally {\n" + " int b = 4;\n"
- + " System.out.println(\"#save -> \" + b + a);\n"
- + " }\n" + "}\n"
- + "public static void main(String[] args) {\n"
- + " new Test().save();\n" + "}\n" + "}" }, "null\n"
- + "#save -> 43");
- }
-
- public void test010() {
- this.runConformTest(new String[] {
- "Test.java",
- "public class Test {\n" + "public void save() {\n"
- + " int a = 3;\n" + " try {\n"
- + " Object warnings = null;\n" + " try {\n"
- + " Object contexts = null;\n"
- + " try {\n"
- + " System.out.println(warnings);\n"
- + " return;\n"
- + " } catch (NullPointerException npe) {\n"
- + " System.out.println(contexts);\n"
- + " return;\n" + " }\n"
- + " } catch (Exception e) {\n" + " return;\n"
- + " }\n" + " } catch(Exception e){\n"
- + " Object dummy1 = null;\n"
- + " System.out.println(dummy1);\n"
- + " Object dummy2 = null;\n"
- + " System.out.println(dummy2);\n" + " return;\n"
- + " } finally {\n" + " int b = 4;\n"
- + " System.out.println(\"#save -> \" + b + a);\n"
- + " }\n" + "}\n"
- + "public static void main(String[] args) {\n"
- + " new Test().save();\n" + "}\n" + "}" }, "null\n"
- + "#save -> 43");
- }
-
- public void test011() {
- this.runConformTest(new String[] {
- "Test.java",
- "public class Test {\n" + "public void save() {\n"
- + " int a = 3;\n" + " try {\n"
- + " Object warnings = null;\n" + " try {\n"
- + " Object contexts = null;\n"
- + " try {\n"
- + " System.out.println(warnings);\n"
- + " return;\n"
- + " } catch (NullPointerException npe) {\n"
- + " System.out.println(contexts);\n"
- + " return;\n" + " }\n"
- + " } catch (Exception e) {\n" + " return;\n"
- + " }\n" + " } catch(Exception e){\n"
- + " int dummy1 = 11;\n"
- + " System.out.println(dummy1);\n"
- + " int dummy2 = 12;\n"
- + " System.out.println(dummy2);\n" + " return;\n"
- + " } finally {\n" + " int b = 4;\n"
- + " System.out.println(\"#save -> \" + b + a);\n"
- + " }\n" + "}\n"
- + "public static void main(String[] args) {\n"
- + " new Test().save();\n" + "}\n" + "}" }, "null\n"
- + "#save -> 43");
- }
-
- /*
- * 4943 Verification error
- */
- public void test012() {
- this
- .runConformTest(
- new String[] {
- "X.java",
- "import java.io.*;\n"
- + "public class X {\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " new X().delete(args);\n"
- + " System.out.println(\"success\");\n"
- + " } catch (Exception e) {\n"
- + " }\n"
- + " }\n"
- + " void bar(int i) {\n"
- + " }\n"
- + " public Object delete(String[] resources) throws IOException {\n"
- + " try {\n"
- + " int totalWork = 3;\n"
- + " Object result = \"aaa\";\n"
- + " try {\n" + " return result;\n"
- + " } catch (Exception e) {\n"
- + " throw new IOException();\n"
- + " } finally {\n"
- + " bar(totalWork);\n" + " }\n"
- + " } finally {\n" + " bar(0);\n"
- + " }\n" + " }\n" + "}\n" }, "success");
- }
-
- /*
- * 4943 Verification error
- */
- public void test013() {
- this
- .runConformTest(
- new String[] {
- "X.java",
- "import java.io.*;\n"
- + "public class X {\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " new X().delete(args);\n"
- + " System.out.println(\"success\");\n"
- + " } catch (Exception e) {\n"
- + " }\n"
- + " }\n"
- + " void bar(int i) {\n"
- + " }\n"
- + " public Object delete(String[] resources) throws IOException {\n"
- + " try {\n"
- + " int totalWork = 3;\n"
- + " Object result = \"aaa\";\n"
- + " try {\n" + " return result;\n"
- + " } catch (Exception e) {\n"
- + " throw new IOException();\n"
- + " } finally {\n"
- + " bar(totalWork);\n" + " }\n"
- + " } finally {\n"
- + " int totalWork = 4;\n"
- + " bar(totalWork);\n" + " }\n"
- + " }\n" + "}\n" }, "success");
- }
-
- public void test014() {
- this
- .runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n"
- + "public void save() {\n"
- + " int a = 3;\n"
- + " try {\n"
- + " Object warnings = null;\n"
- + " try {\n"
- + " int contexts = 17;\n"
- + " try {\n"
- + " Object dummy = null;\n"
- + " System.out.println(warnings);\n"
- + " System.out.println(dummy);\n"
- + " return;\n"
- + " } catch (NullPointerException npe) {\n"
- + " System.out.println(contexts);\n"
- + " return;\n"
- + " }\n"
- + " } catch (Exception e) {\n"
- + " return;\n"
- + " } finally { \n"
- + " int c = 34; \n"
- + " System.out.println(\"#inner-finally ->\" + a + c);\n"
- + " }\n"
- + " } finally {\n"
- + " int b = 4;\n"
- + " System.out.println(\"#save -> \" + b + a);\n"
- + " }\n"
- + "}\n"
- + "public static void main(String[] args) {\n"
- + " new Test().save();\n" + "}\n" + "}" },
- "null\n" + "null\n" + "#inner-finally ->334\n"
- + "#save -> 43");
- }
-
- public void test015() {
- this.runConformTest(new String[] {
- "p1/X.java",
- "package p1; \n" + "import java.io.IOException; \n"
- + "public class X { \n"
- + " public static void main(String args[]) { \n"
- + " try { \n" + " new Object(){ \n" + " { \n"
- + " if (true) throw new IOException(); \n"
- + " if (true) throw new Exception(); \n"
- + " } \n" + " }; \n"
- + " System.out.println(\"FAILED\"); \n"
- + " } catch(Exception e){ \n"
- + " System.out.println(\"SUCCESS\"); \n" + " } \n"
- + " } \n" + "} \n", }, "SUCCESS");
- }
-
- public void test016() {
- this.runConformTest(new String[] {
- "p1/X.java",
- "package p1; \n" + "import java.io.IOException; \n"
- + "public class X { \n"
- + " public static void main(String args[]) { \n"
- + " class SomeClass { \n"
- + " SomeClass () throws IOException { \n" + " } \n"
- + " } \n" + " try { \n" + " new Object(){ \n"
- + " { \n"
- + " if (true) throw new IOException(); \n"
- + " if (true) throw new Exception(); \n"
- + " } \n" + " }; \n"
- + " System.out.println(\"FAILED\"); \n"
- + " } catch(Exception e){ \n"
- + " System.out.println(\"SUCCESS\"); \n" + " } \n"
- + " } \n" + "} \n", }, "SUCCESS");
- }
-
- public void test017() {
- this.runConformTest(new String[] {
- "p1/X.java",
- "package p1; \n" + "public class X { \n"
- + " public static void main(String args[]) { \n"
- + " try { \n" + " new Object(){ \n" + " { \n"
- + " foo(); \n" + " } \n" + " }; \n"
- + " System.out.println(\"FAILED\"); \n"
- + " } catch(Exception e){ \n"
- + " System.out.println(\"SUCCESS\"); \n" + " } \n"
- + " } \n" + " static class AEx extends Exception {} \n"
- + " static class BEx extends Exception {} \n"
- + " static void foo() throws AEx, BEx { \n"
- + " throw new AEx(); \n" + " } \n" + "} \n", },
- "SUCCESS");
- }
-
- // 8773 verification error
- public void test018() {
- this.runConformTest(new String[] {
- "VerifyEr.java",
- "public class VerifyEr { \n"
- + " protected boolean err(boolean b) { \n"
- + " try { \n"
- + " System.out.print(\"SUCC\"); \n"
- + " } catch (Throwable t) { \n"
- + " return b; \n" + " } finally { \n"
- + " try { \n" + " if (b) { \n"
- + " return b; \n"
- + " } \n" + " } finally { \n"
- + " System.out.println(\"ESS\"); \n"
- + " } \n" + " } \n"
- + " return false; \n" + " } \n"
- + " public static void main(String[] args) { \n"
- + " new VerifyEr().err(false); \n" + " } \n"
- + "} \n", }, "SUCCESS");
- }
-
- /*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=16279
- */
- public void test019() {
- this.runConformTest(new String[] {
- "X.java",
- "public class X { \n" + " String logger; \n"
- + " public static void main(String[] args) { \n"
- + " new X().foo(); \n" + " } \n"
- + " public void foo() { \n" + " try { \n"
- + " System.out.println(\"SUCCESS\"); \n"
- + " } catch (Exception ce) { \n"
- + " String s = null; \n" + " try { \n"
- + " return; \n" + " } catch (Exception ex) { \n"
- + " } \n" + " s.hashCode(); \n"
- + " } finally { \n"
- + " if (this.logger == null) { \n"
- + " String loggerManager = null; \n"
- + " System.out.println(loggerManager); \n"
- + " } \n" + " } \n" + " } \n" + "} \n" },
- "SUCCESS\n" + "null");
- }
-
- /*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=16279 shifting of finaly
- * scopes against try/catch ones makes the custom ret address shifting
- * unnecessary.
- */
- public void test020() {
- this.runConformTest(new String[] {
- "X.java",
- "public class X { \n" + " String logger; \n"
- + " public static void main(String[] args) { \n"
- + " new X().foo(); \n" + " } \n"
- + " public void foo() { \n" + " try { \n"
- + " System.out.println(\"try1\"); \n" + " try { \n"
- + " System.out.println(\"try2\"); \n"
- + " } finally { \n"
- + " System.out.println(\"finally2\"); \n"
- + " } \n" + " } catch (Exception ce) { \n"
- + " String s = null; \n" + " try { \n"
- + " return; \n" + " } catch (Exception ex) { \n"
- + " } \n" + " s.hashCode(); \n"
- + " } finally { \n"
- + " System.out.println(\"finally1\"); \n"
- + " try { \n"
- + " System.out.println(\"try3\"); \n"
- + " if (this.logger == null) { \n"
- + " String loggerManager = null; \n" + " } \n"
- + " } finally { \n"
- + " System.out.println(\"finally3\"); \n"
- + " } \n" + " } \n" + " int i1 = 0; \n"
- + " int i2 = 0; \n" + " int i3 = 0; \n"
- + " int i4 = 0; \n" + " int i5 = 0; \n"
- + " int i6 = 0; \n" + " int i7 = 0; \n"
- + " int i8 = 0; \n" + " int i9 = 0; \n" + " } \n"
- + "} \n" }, "try1\n" + "try2\n" + "finally2\n"
- + "finally1\n" + "try3\n" + "finally3");
- }
-
- /*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21116 protected type
- * visibility check
- */
- public void test021() {
- this.runConformTest(new String[] {
- "pa/A.java",
- "package pa; \n" + "public abstract class A { \n"
- + " public static void main(String[] args) { \n"
- + " System.out.println(\"SUCCESS\"); \n" + " } \n"
- + " protected AIC memberA; \n"
- + " protected class AIC { \n"
- + " public void methodAIC(String parameter) { \n"
- + " // ....do something \n" + " } \n" + " } \n"
- + "} \n",
- "pb/B.java",
- "package pb; \n" + "public class B extends pa.A { \n"
- + " private class BIC { \n"
- + " public void methodBIC(String param) { \n"
- + " memberA.methodAIC(param); \n" + " } \n"
- + " } \n" + "} \n" }, "SUCCESS");
- }
-
- /*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=19916 nested try/synchronized
- * statements (local var index alloc)
- */
- public void test022() {
- this.runConformTest(new String[] {
- "pa/A.java",
- "package pa; \n" + "public class A { \n"
- + " public static void main(String[] args) { \n"
- + " new A().f(); \n"
- + " System.out.println(\"SUCCESS\"); \n" + " } \n"
- + " boolean b = false; \n"
- + " private Integer f() { \n" + " while (true) { \n"
- + " try { \n" + " int x = 3; \n"
- + " synchronized (this) { \n"
- + " return null; \n" + " } \n"
- + " } finally { \n" + " if (b) \n"
- + " synchronized (this) { \n"
- + " int y = 3; \n" + " } \n" + " } \n"
- + " } \n" + " } \n" + "} \n" }, "SUCCESS");
- }
-
- public void test023() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportHiddenCatchBlock,
- CompilerOptions.ERROR);
- this
- .runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public static void main(String[] args) {\n"
- + " try {\n" + " throw new BX();\n"
- + " } catch(BX e) {\n"
- + " } catch(AX e) {\n" + " }\n"
- + " }\n" + "} \n"
- + "class AX extends Exception {}\n"
- + "class BX extends AX {}\n" },
- "----------\n"
- + "1. ERROR in X.java (at line 6)\n"
- + " } catch(AX e) {\n"
- + " ^^\n"
- + "Unreachable catch block for AX. Only more specific exceptions are thrown and handled by previous catch block(s).\n"
- + "----------\n"
- + "2. WARNING in X.java (at line 10)\n"
- + " class AX extends Exception {}\n"
- + " ^^\n"
- + "The serializable class AX does not declare a static final serialVersionUID field of type long\n"
- + "----------\n"
- + "3. WARNING in X.java (at line 11)\n"
- + " class BX extends AX {}\n"
- + " ^^\n"
- + "The serializable class BX does not declare a static final serialVersionUID field of type long\n"
- + "----------\n", null, true, customOptions);
- }
-
- /*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21203 NPE in
- * ExceptionFlowContext
- */
- public void test024() {
-
- this
- .runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n"
- + "public class X { \n"
- + " public void myMethod() { \n"
- + " System.out.println(\"starting\"); \n"
- + " try { \n"
- + " if (true) throw new LookupException(); \n"
- + " } catch(DataException de) { \n"
- + " System.out.println(\"DataException occurred\"); \n"
- + " } catch(LookupException le) { \n"
- + " System.out.println(\"LookupException occurred\"); \n"
- + " } catch(Throwable t) { \n"
- + " System.out.println(\"Throwable occurred\"); \n"
- + " } \n"
- + " System.out.println(\"SUCCESS\"); \n"
- + " } \n"
- + "} \n"
- + "class DataException extends Throwable { \n"
- + "} \n"
- + "class LookupException extends DataException { \n"
- + "} \n" },
- "----------\n"
- + "1. ERROR in p\\X.java (at line 9)\n"
- + " } catch(LookupException le) { \n"
- + " ^^^^^^^^^^^^^^^\n"
- + "Unreachable catch block for LookupException. It is already handled by the catch block for DataException\n"
- + "----------\n"
- + "2. WARNING in p\\X.java (at line 17)\n"
- + " class DataException extends Throwable { \n"
- + " ^^^^^^^^^^^^^\n"
- + "The serializable class DataException does not declare a static final serialVersionUID field of type long\n"
- + "----------\n"
- + "3. WARNING in p\\X.java (at line 19)\n"
- + " class LookupException extends DataException { \n"
- + " ^^^^^^^^^^^^^^^\n"
- + "The serializable class LookupException does not declare a static final serialVersionUID field of type long\n"
- + "----------\n");
- }
-
- // 60081
- public void test025() {
-
- this
- .runConformTest(
- new String[] {
- "X.java",
- "import java.io.*;\n"
- + "public class X\n"
- + "{\n"
- + " {\n"
- + " String licenseFileName = \"C:/Program Files/Jatt/bin/license.key\";\n"
- + " File licenseFile = new File(licenseFileName);\n"
- + " try {\n"
- + " BufferedReader licenseReader = new BufferedReader(\n"
- + " new FileReader(licenseFile));\n"
- + " StringBuffer buf = new StringBuffer();\n"
- + " String line = null;\n"
- + " while ((line = licenseReader.readLine()) != null) {\n"
- + " char[] chars = line.toCharArray();\n"
- + " for (int i = 0; i < line.length(); i++) {\n"
- + " if (!Character.isSpace(line.charAt(i))) {\n"
- + " buf.append(line.charAt(i));\n"
- + " }\n"
- + " }\n"
- + " }\n"
- + " \n"
- + " } catch (FileNotFoundException e) {\n"
- + " throw new Error(\"License file not found\", e);\n"
- + " } catch (IOException e) {\n"
- + " throw new Error(\"License file cannot be read\", e);\n"
- + " }\n"
- + " }\n"
- + " public X()\n"
- + " {\n"
- + " }\n"
- + " \n"
- + " public X(X r) \n"
- + " {\n"
- + " } \n"
- + " public static void main(String[] args) {\n"
- + " System.out.println(\"SUCCESS\");\n"
- + " }\n" + "}\n" }, "SUCCESS");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89710
- // public void test026() {
- //
- // Map customOptions = this.getCompilerOptions();
- // customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal,
- // CompilerOptions.PRESERVE);
- //
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "import java.util.*;\n" +
- // "\n" +
- // "public class X {\n" +
- // " \n" +
- // " static private ResourceBundle bundle = null;\n" +
- // " static {\n" +
- // " int i = 0;\n" +
- // " try {\n" +
- // " bundle = foo();\n" +
- // " } catch(Throwable e) {\n" +
- // " e.printStackTrace();\n" +
- // " }\n" +
- // " }\n" +
- // "\n" +
- // " static ResourceBundle foo() {\n" +
- // " return null;\n" +
- // " }\n" +
- // "}\n",
- // },
- // "",
- // null,
- // true,
- // null,
- // customOptions,
- // null); // custom requestor
- //
- // String expectedOutput =
- // " Local variable table:\n" +
- // " [pc: 6, pc: 21] local: i index: 0 type: int\n" +
- // " [pc: 16, pc: 20] local: e index: 1 type: java.lang.Throwable\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89710 - variation
- // public void test027() {
- //
- // Map customOptions = this.getCompilerOptions();
- // customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal,
- // CompilerOptions.PRESERVE);
- //
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "import java.util.*;\n" +
- // "\n" +
- // "public class X {\n" +
- // " \n" +
- // " void bar(boolean b) {\n" +
- // " if (b) {\n" +
- // " try {\n" +
- // " int i = 0;\n" +
- // " } catch(Exception e) {\n" +
- // " e.printStackTrace();\n" +
- // " }\n" +
- // " } else {\n" +
- // " int j = 0;\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "",
- // null,
- // true,
- // null,
- // customOptions,
- // null); // custom requestor
- //
- // String expectedOutput =
- // " Local variable table:\n" +
- // " [pc: 0, pc: 20] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 20] local: b index: 1 type: boolean\n" +
- // " [pc: 6, pc: 9] local: i index: 2 type: int\n" +
- // " [pc: 10, pc: 14] local: e index: 2 type: java.lang.Exception\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98892
- public void test028() {
-
- this
- .runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + "\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " new X().start();\n"
- + " } catch(Exception e) {\n"
- + " System.out.println(\"SUCCESS\");\n"
- + " }\n"
- + " }\n"
- + " public Object start() {\n"
- + " try {\n"
- + " return null;\n"
- + " } finally {\n"
- + " System.out.print(\"ONCE:\");\n"
- + " foo();\n"
- + " }\n"
- + " }\n"
- + "\n"
- + " private void foo() {\n"
- + " throw new IllegalStateException(\"Gah!\");\n"
- + " } \n" + "}\n", },
- "ONCE:SUCCESS");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98892 - variation
- public void test029() {
-
- this
- .runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + "\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " new X().start();\n"
- + " } catch(Exception e) {\n"
- + " System.out.println(\"SUCCESS\");\n"
- + " }\n"
- + " }\n"
- + " public Object start() {\n"
- + " try {\n"
- + " return null;\n"
- + " } finally {\n"
- + " System.out.print(\"ONCE:\");\n"
- + " foo();\n"
- + " return this;\n"
- + " }\n"
- + " }\n"
- + "\n"
- + " private void foo() {\n"
- + " throw new IllegalStateException(\"Gah!\");\n"
- + " } \n" + "}\n", },
- "ONCE:SUCCESS");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98892 - variation
- public void test030() {
-
- this
- .runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + "\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " new X().start();\n"
- + " } catch(Exception e) {\n"
- + " System.out.println(\"SUCCESS\");\n"
- + " }\n"
- + " }\n"
- + " public Object start() {\n"
- + " try {\n"
- + " Object o = null;\n"
- + " o.toString();\n"
- + " return null;\n"
- + " } catch(Exception e) {\n"
- + " System.out.print(\"EXCEPTION:\");\n"
- + " return e; \n"
- + " } finally {\n"
- + " System.out.print(\"ONCE:\");\n"
- + " foo();\n"
- + " }\n"
- + " }\n"
- + "\n"
- + " private void foo() {\n"
- + " throw new IllegalStateException(\"Gah!\");\n"
- + " } \n" + "}\n", },
- "EXCEPTION:ONCE:SUCCESS");
- }
-
- /*
- * Try block is never reached
- */
- public void test031() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember,
- CompilerOptions.IGNORE);
-
- this
- .runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.IOException;\n"
- + "\n"
- + "public class X {\n"
- + " static void foo(Object o) {}\n"
- + " \n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " foo(new Object() {\n"
- + " public void bar() throws IOException {\n"
- + " bar1();\n"
- + " }\n"
- + " });\n"
- + " } catch(IOException e) {\n"
- + " e.printStackTrace();\n"
- + " }\n"
- + " }\n"
- + " \n"
- + " static void bar1() throws IOException {}\n"
- + "}" },
- "----------\n"
- + "1. ERROR in X.java (at line 13)\n"
- + " } catch(IOException e) {\n"
- + " ^^^^^^^^^^^\n"
- + "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n"
- + "----------\n", null, true, customOptions);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=114855
- */
- public void test032() {
- this
- .runConformTest(
- new String[] {
- "X.java",
- "public class X\n"
- + "{\n"
- + " static int except_count;\n"
- + "\n"
- + " static boolean test_result = true;\n"
- + " \n"
- + " static Throwable all_except[] =\n"
- + " {\n"
- + " new AbstractMethodError(), // 0\n"
- + " new ArithmeticException(), // 1\n"
- + " new ArrayIndexOutOfBoundsException(), // 2\n"
- + " new ArrayStoreException(), // 3\n"
- + " new ClassCastException(), // 4\n"
- + " new ClassCircularityError(), // 5\n"
- + " new ClassFormatError(), // 6\n"
- + " new ClassNotFoundException(), // 7\n"
- + " new CloneNotSupportedException(), // 8\n"
- + " new Error(), // 9\n"
- + " new Exception(), // 10\n"
- + " new IllegalAccessError(), // 11\n"
- + " new IllegalAccessException(), // 12\n"
- + " new IllegalArgumentException(), // 13\n"
- + " new IllegalMonitorStateException(), // 14\n"
- + " new IllegalThreadStateException(), // 15\n"
- + " new IncompatibleClassChangeError(), // 16\n"
- + " new IndexOutOfBoundsException(), // 17\n"
- + " new InstantiationError(), // 18\n"
- + " new InstantiationException(), // 19\n"
- + " new InternalError(), // 20\n"
- + " new InterruptedException(), // 21\n"
- + " new LinkageError(), // 22\n"
- + " new NegativeArraySizeException(), // 23\n"
- + " new NoClassDefFoundError(), // 24\n"
- + " new NoSuchFieldError(), // 25\n"
- + " new NoSuchMethodError(), // 26\n"
- + " new NoSuchMethodException(), // 27\n"
- + " new NullPointerException(), // 28\n"
- + " new NumberFormatException(), // 29\n"
- + " new OutOfMemoryError(), // 30\n"
- + " new StackOverflowError(), // 31\n"
- + " new RuntimeException(), // 32\n"
- + " new SecurityException(), // 33\n"
- + " new StringIndexOutOfBoundsException(), // 34\n"
- + " new ThreadDeath(), // 35\n"
- + " new UnknownError(), // 36\n"
- + " new UnsatisfiedLinkError(), // 37\n"
- + " new VerifyError(), // 38\n"
- + " };\n"
- + "\n"
- + " private static void check_except(int i)\n"
- + " throws Throwable\n"
- + " {\n"
- + " if (except_count != i)\n"
- + " {\n"
- + " System.out.println(\"Error \"+except_count+\" != \"+i+\";\");\n"
- + " test_result=false;\n"
- + " }\n"
- + " throw all_except[++except_count];\n"
- + " }\n"
- + "\n"
- + " public static void main(String[] args) throws Throwable\n"
- + " {\n"
- + " try {\n"
- + " except_count = 0;\n"
- + " throw all_except[except_count];\n"
- + " } catch (AbstractMethodError e0) {\n"
- + " try {\n"
- + " check_except(0);\n"
- + " } catch (ArithmeticException e1) {\n"
- + " try {\n"
- + " check_except(1);\n"
- + " } catch (ArrayIndexOutOfBoundsException e2) {\n"
- + " try {\n"
- + " check_except(2);\n"
- + " } catch (ArrayStoreException e3) {\n"
- + " try {\n"
- + " check_except(3);\n"
- + " } catch (ClassCastException e4) {\n"
- + " try {\n"
- + " check_except(4);\n"
- + " } catch (ClassCircularityError e5) {\n"
- + " try {\n"
- + " check_except(5);\n"
- + " } catch (ClassFormatError e6) {\n"
- + " try {\n"
- + " check_except(6);\n"
- + " } catch (ClassNotFoundException e7) {\n"
- + " try {\n"
- + " check_except(7);\n"
- + " } catch (CloneNotSupportedException e8) {\n"
- + " try {\n"
- + " check_except(8);\n"
- + " } catch (Error e9) {\n"
- + " try {\n"
- + " check_except(9);\n"
- + " } catch (Exception e10) {\n"
- + " try {\n"
- + " check_except(10);\n"
- + " } catch (IllegalAccessError e11) {\n"
- + " try {\n"
- + " check_except(11);\n"
- + " } catch (IllegalAccessException e12) {\n"
- + " try {\n"
- + " check_except(12);\n"
- + " } catch (IllegalArgumentException e13) {\n"
- + " try {\n"
- + " check_except(13);\n"
- + " } catch (IllegalMonitorStateException e14) {\n"
- + " try {\n"
- + " check_except(14);\n"
- + " } catch (IllegalThreadStateException e15) {\n"
- + " try {\n"
- + " check_except(15);\n"
- + " } catch (IncompatibleClassChangeError e16) {\n"
- + " try {\n"
- + " check_except(16);\n"
- + " } catch (IndexOutOfBoundsException e17) {\n"
- + " try {\n"
- + " check_except(17);\n"
- + " } catch (InstantiationError e18) {\n"
- + " try {\n"
- + " check_except(18);\n"
- + " } catch (InstantiationException e19) {\n"
- + " try {\n"
- + " check_except(19);\n"
- + " } catch (InternalError e20) {\n"
- + " try {\n"
- + " check_except(20);\n"
- + " } catch (InterruptedException \n"
- + "e21) {\n"
- + " try {\n"
- + " check_except(21);\n"
- + " } catch (LinkageError e22) {\n"
- + " try {\n"
- + " check_except(22);\n"
- + " } catch \n"
- + "(NegativeArraySizeException e23) {\n"
- + " try {\n"
- + " check_except(23);\n"
- + " } catch \n"
- + "(NoClassDefFoundError e24) {\n"
- + " try {\n"
- + " check_except(24);\n"
- + " } catch (NoSuchFieldError \n"
- + "e25) {\n"
- + " try {\n"
- + " check_except(25);\n"
- + " } catch \n"
- + "(NoSuchMethodError e26) {\n"
- + " try {\n"
- + " check_except(26);\n"
- + " } catch \n"
- + "(NoSuchMethodException e27) {\n"
- + " try {\n"
- + " check_except(27);\n"
- + " } catch \n"
- + "(NullPointerException e28) {\n"
- + " try {\n"
- + " check_except\n"
- + "(28);\n"
- + " } catch \n"
- + "(NumberFormatException e29) {\n"
- + " try {\n"
- + " check_except\n"
- + "(29);\n"
- + " } catch \n"
- + "(OutOfMemoryError e30) {\n"
- + " try {\n"
- + " check_except\n"
- + "(30);\n"
- + " } catch \n"
- + "(StackOverflowError e31) {\n"
- + " try {\n"
- + " \n"
- + "check_except(31);\n"
- + " } catch \n"
- + "(RuntimeException e32) {\n"
- + " try {\n"
- + " \n"
- + "check_except(32);\n"
- + " } catch \n"
- + "(SecurityException e33) {\n"
- + " try {\n"
- + " \n"
- + "check_except(33);\n"
- + " } catch \n"
- + "(StringIndexOutOfBoundsException e34) {\n"
- + " try {\n"
- + " \n"
- + "check_except(34);\n"
- + " } \n"
- + "catch (ThreadDeath e35) {\n"
- + " try \n"
- + "{\n"
- + " \n"
- + "check_except(35);\n"
- + " } \n"
- + "catch (UnknownError e36) {\n"
- + " \n"
- + "try {\n"
- + " \n"
- + "check_except(36);\n"
- + " } \n"
- + "catch (UnsatisfiedLinkError e37) {\n"
- + " \n"
- + "try {\n"
- + " \n"
- + " check_except(37);\n"
- + " \n"
- + "} catch (VerifyError e38) {\n"
- + " \n"
- + " ++except_count;\n"
- + " \n"
- + "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\n"
- + " System.out.print(test_result & (except_count == all_except.length));\n"
- + " }\n" + "}", }, "true");
- }
-
- // public void test033() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " interface IActionSetContributionItem {\n" +
- // " String getActionSetId();\n" +
- // " }\n" +
- // " public interface IAction {\n" +
- // " }\n" +
- // " interface IContributionItem {\n" +
- // " String getId();\n" +
- // " boolean isSeparator();\n" +
- // " boolean isGroupMarker();\n" +
- // " }\n" +
- // " public static void findInsertionPoint(String startId,\n" +
- // " String sortId, IContributionItem[] items) {\n" +
- // " // Find the reference item.\n" +
- // " try {\n" +
- // " int insertIndex = 0;\n" +
- // " while (insertIndex < items.length) {\n" +
- // " if (startId.equals(items[insertIndex].getId()))\n" +
- // " break;\n" +
- // " ++insertIndex;\n" +
- // " }\n" +
- // " if (insertIndex >= items.length)\n" +
- // " return;\n" +
- // " \n" +
- // " int compareMetric = 0;\n" +
- // " \n" +
- // " // Find the insertion point for the new item.\n" +
- // " // We do this by iterating through all of the previous\n" +
- // " // action set contributions define within the current group.\n"
- // +
- // " for (int nX = insertIndex + 1; nX < items.length; nX++) {\n" +
- // " IContributionItem item = items[nX];\n" +
- // " if (item.isSeparator() || item.isGroupMarker()) {\n" +
- // " // Fix for bug report 18357\n" +
- // " break;\n" +
- // " }\n" +
- // " if (item instanceof IActionSetContributionItem) {\n" +
- // " if (sortId != null) {\n" +
- // " String testId = ((IActionSetContributionItem) item)\n"
- // +
- // " .getActionSetId();\n" +
- // " if (sortId.compareTo(testId) < compareMetric)\n" +
- // " break;\n" +
- // " }\n" +
- // " insertIndex = nX;\n" +
- // " } else {\n" +
- // " break;\n" +
- // " }\n" +
- // " }\n" +
- // " } catch(Exception e) {}\n" +
- // " }\n" +
- // " \n" +
- // " public static void main(String[] args) {\n" +
- // " findInsertionPoint(\"\", \"\", null);\n" +
- // " }\n" +
- // "}",
- // },
- // "");
- // String expectedOutput =
- // " // Method descriptor #15 (Ljava/lang/String;Ljava/lang/String;[LX$IContributionItem;)V\n"
- // +
- // " // Stack: 3, Locals: 8\n" +
- // " public static void findInsertionPoint(java.lang.String startId, java.lang.String sortId, X.IContributionItem[] items);\n"
- // +
- // " 0 iconst_0\n" +
- // " 1 istore_3 [insertIndex]\n" +
- // " 2 goto 26\n" +
- // " 5 aload_0 [startId]\n" +
- // " 6 aload_2 [items]\n" +
- // " 7 iload_3 [insertIndex]\n" +
- // " 8 aaload\n" +
- // " 9 invokeinterface X$IContributionItem.getId() : java.lang.String [16] [nargs: 1]\n"
- // +
- // " 14 invokevirtual java.lang.String.equals(java.lang.Object) : boolean [22]\n"
- // +
- // " 17 ifeq 23\n" +
- // " 20 goto 32\n" +
- // " 23 iinc 3 1 [insertIndex]\n" +
- // " 26 iload_3 [insertIndex]\n" +
- // " 27 aload_2 [items]\n" +
- // " 28 arraylength\n" +
- // " 29 if_icmplt 5\n" +
- // " 32 iload_3 [insertIndex]\n" +
- // " 33 aload_2 [items]\n" +
- // " 34 arraylength\n" +
- // " 35 if_icmplt 39\n" +
- // " 38 return\n" +
- // " 39 iconst_0\n" +
- // " 40 istore 4 [compareMetric]\n" +
- // " 42 iload_3 [insertIndex]\n" +
- // " 43 iconst_1\n" +
- // " 44 iadd\n" +
- // " 45 istore 5 [nX]\n" +
- // " 47 goto 123\n" +
- // " 50 aload_2 [items]\n" +
- // " 51 iload 5 [nX]\n" +
- // " 53 aaload\n" +
- // " 54 astore 6 [item]\n" +
- // " 56 aload 6 [item]\n" +
- // " 58 invokeinterface X$IContributionItem.isSeparator() : boolean [28] [nargs: 1]\n"
- // +
- // " 63 ifne 134\n" +
- // " 66 aload 6 [item]\n" +
- // " 68 invokeinterface X$IContributionItem.isGroupMarker() : boolean [32] [nargs: 1]\n"
- // +
- // " 73 ifeq 79\n" +
- // " 76 goto 134\n" +
- // " 79 aload 6 [item]\n" +
- // " 81 instanceof X$IActionSetContributionItem [35]\n" +
- // " 84 ifeq 134\n" +
- // " 87 aload_1 [sortId]\n" +
- // " 88 ifnull 117\n" +
- // " 91 aload 6 [item]\n" +
- // " 93 checkcast X$IActionSetContributionItem [35]\n" +
- // " 96 invokeinterface X$IActionSetContributionItem.getActionSetId() : java.lang.String [37] [nargs: 1]\n"
- // +
- // " 101 astore 7 [testId]\n" +
- // " 103 aload_1 [sortId]\n" +
- // " 104 aload 7 [testId]\n" +
- // " 106 invokevirtual java.lang.String.compareTo(java.lang.String) : int [40]\n"
- // +
- // " 109 iload 4 [compareMetric]\n" +
- // " 111 if_icmpge 117\n" +
- // " 114 goto 134\n" +
- // " 117 iload 5 [nX]\n" +
- // " 119 istore_3 [insertIndex]\n" +
- // " 120 iinc 5 1 [nX]\n" +
- // " 123 iload 5 [nX]\n" +
- // " 125 aload_2 [items]\n" +
- // " 126 arraylength\n" +
- // " 127 if_icmplt 50\n" +
- // " 130 goto 134\n" +
- // " 133 astore_3\n" +
- // " 134 return\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124853
- // public void test034() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " private static int scenario(){\n" +
- // " try {\n" +
- // " int i = 1;\n" +
- // " System.out.print(\"[i: \" + i+\"]\");\n" +
- // " if (i > 5) {\n" +
- // " return i;\n" +
- // " }\n" +
- // " return -i;\n" +
- // " } catch (Exception e) {\n" +
- // " System.out.print(\"[WRONG CATCH]\");\n" +
- // " return 2;\n" +
- // " } finally {\n" +
- // " System.out.print(\"[finally]\");\n" +
- // " try {\n" +
- // " throwRuntime();\n" +
- // " } finally {\n" +
- // " clean();\n" +
- // " }\n" +
- // " }\n" +
- // " }\n" +
- // "\n" +
- // " private static void throwRuntime() {\n" +
- // " throw new RuntimeException(\"error\");\n" +
- // " }\n" +
- // "\n" +
- // " private static void clean() {\n" +
- // " System.out.print(\"[clean]\");\n" +
- // " }\n" +
- // "\n" +
- // " public static void main(String[] args) {\n" +
- // " try {\n" +
- // " scenario();\n" +
- // " } catch(Exception e){\n" +
- // " System.out.println(\"[end]\");\n" +
- // " }\n" +
- // " }\n" +
- // "\n" +
- // "}\n",
- // },
- // "[i: 1][finally][clean][end]");
- //
- // // if (this.complianceLevel.compareTo(COMPLIANCE_1_6) >= 0) return;
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).inlineJsrBytecode
- // ? " // Method descriptor #15 ()I\n" +
- // " // Stack: 4, Locals: 4\n" +
- // " private static int scenario();\n" +
- // " 0 iconst_1\n" +
- // " 1 istore_0 [i]\n" +
- // " 2 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 5 new java.lang.StringBuilder [22]\n" +
- // " 8 dup\n" +
- // " 9 ldc <String \"[i: \"> [24]\n" +
- // " 11 invokespecial java.lang.StringBuilder(java.lang.String) [26]\n"
- // +
- // " 14 iload_0 [i]\n" +
- // " 15 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [29]\n"
- // +
- // " 18 ldc <String \"]\"> [33]\n" +
- // " 20 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [35]\n"
- // +
- // " 23 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 26 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 29 iload_0 [i]\n" +
- // " 30 iconst_5\n" +
- // " 31 if_icmple 61\n" +
- // " 34 iload_0 [i]\n" +
- // " 35 istore_2\n" +
- // " 36 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 39 ldc <String \"[finally]\"> [47]\n" +
- // " 41 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 44 invokestatic X.throwRuntime() : void [49]\n" +
- // " 47 goto 56\n" +
- // " 50 astore_3\n" +
- // " 51 invokestatic X.clean() : void [52]\n" +
- // " 54 aload_3\n" +
- // " 55 athrow\n" +
- // " 56 invokestatic X.clean() : void [52]\n" +
- // " 59 iload_2\n" +
- // " 60 ireturn\n" +
- // " 61 iload_0 [i]\n" +
- // " 62 ineg\n" +
- // " 63 istore_2\n" +
- // " 64 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 67 ldc <String \"[finally]\"> [47]\n" +
- // " 69 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 72 invokestatic X.throwRuntime() : void [49]\n" +
- // " 75 goto 84\n" +
- // " 78 astore_3\n" +
- // " 79 invokestatic X.clean() : void [52]\n" +
- // " 82 aload_3\n" +
- // " 83 athrow\n" +
- // " 84 invokestatic X.clean() : void [52]\n" +
- // " 87 iload_2\n" +
- // " 88 ireturn\n" +
- // " 89 astore_0 [e]\n" +
- // " 90 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 93 ldc <String \"[WRONG CATCH]\"> [55]\n" +
- // " 95 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 98 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 101 ldc <String \"[finally]\"> [47]\n" +
- // " 103 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 106 invokestatic X.throwRuntime() : void [49]\n" +
- // " 109 goto 118\n" +
- // " 112 astore_3\n" +
- // " 113 invokestatic X.clean() : void [52]\n" +
- // " 116 aload_3\n" +
- // " 117 athrow\n" +
- // " 118 invokestatic X.clean() : void [52]\n" +
- // " 121 iconst_2\n" +
- // " 122 ireturn\n" +
- // " 123 astore_1\n" +
- // " 124 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 127 ldc <String \"[finally]\"> [47]\n" +
- // " 129 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 132 invokestatic X.throwRuntime() : void [49]\n" +
- // " 135 goto 144\n" +
- // " 138 astore_3\n" +
- // " 139 invokestatic X.clean() : void [52]\n" +
- // " 142 aload_3\n" +
- // " 143 athrow\n" +
- // " 144 invokestatic X.clean() : void [52]\n" +
- // " 147 aload_1\n" +
- // " 148 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 44, pc: 50] -> 50 when : any\n" +
- // " [pc: 72, pc: 78] -> 78 when : any\n" +
- // " [pc: 0, pc: 36] -> 89 when : java.lang.Exception\n" +
- // " [pc: 61, pc: 64] -> 89 when : java.lang.Exception\n" +
- // " [pc: 106, pc: 112] -> 112 when : any\n" +
- // " [pc: 0, pc: 36] -> 123 when : any\n" +
- // " [pc: 61, pc: 64] -> 123 when : any\n" +
- // " [pc: 89, pc: 98] -> 123 when : any\n" +
- // " [pc: 132, pc: 138] -> 138 when : any\n"
- // : " // Method descriptor #15 ()I\n" +
- // " // Stack: 4, Locals: 6\n" +
- // " private static int scenario();\n" +
- // " 0 iconst_1\n" +
- // " 1 istore_0 [i]\n" +
- // " 2 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 5 new java.lang.StringBuffer [22]\n" +
- // " 8 dup\n" +
- // " 9 ldc <String \"[i: \"> [24]\n" +
- // " 11 invokespecial java.lang.StringBuffer(java.lang.String) [26]\n"
- // +
- // " 14 iload_0 [i]\n" +
- // " 15 invokevirtual java.lang.StringBuffer.append(int) : java.lang.StringBuffer [29]\n"
- // +
- // " 18 ldc <String \"]\"> [33]\n" +
- // " 20 invokevirtual java.lang.StringBuffer.append(java.lang.String) : java.lang.StringBuffer [35]\n"
- // +
- // " 23 invokevirtual java.lang.StringBuffer.toString() : java.lang.String [38]\n"
- // +
- // " 26 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 29 iload_0 [i]\n" +
- // " 30 iconst_5\n" +
- // " 31 if_icmple 41\n" +
- // " 34 iload_0 [i]\n" +
- // " 35 istore_3\n" +
- // " 36 jsr 69\n" +
- // " 39 iload_3\n" +
- // " 40 ireturn\n" +
- // " 41 iload_0 [i]\n" +
- // " 42 ineg\n" +
- // " 43 istore_3\n" +
- // " 44 jsr 69\n" +
- // " 47 iload_3\n" +
- // " 48 ireturn\n" +
- // " 49 astore_0 [e]\n" +
- // " 50 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 53 ldc <String \"[WRONG CATCH]\"> [47]\n" +
- // " 55 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 58 jsr 69\n" +
- // " 61 iconst_2\n" +
- // " 62 ireturn\n" +
- // " 63 astore_2\n" +
- // " 64 jsr 69\n" +
- // " 67 aload_2\n" +
- // " 68 athrow\n" +
- // " 69 astore_1\n" +
- // " 70 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 73 ldc <String \"[finally]\"> [49]\n" +
- // " 75 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 78 invokestatic X.throwRuntime() : void [51]\n" +
- // " 81 goto 99\n" +
- // " 84 astore 5\n" +
- // " 86 jsr 92\n" +
- // " 89 aload 5\n" +
- // " 91 athrow\n" +
- // " 92 astore 4\n" +
- // " 94 invokestatic X.clean() : void [54]\n" +
- // " 97 ret 4\n" +
- // " 99 jsr 92\n" +
- // " 102 ret 1\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 39] -> 49 when : java.lang.Exception\n" +
- // " [pc: 41, pc: 47] -> 49 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 39] -> 63 when : any\n" +
- // " [pc: 41, pc: 47] -> 63 when : any\n" +
- // " [pc: 49, pc: 61] -> 63 when : any\n" +
- // " [pc: 78, pc: 84] -> 84 when : any\n" +
- // " [pc: 99, pc: 102] -> 84 when : any\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124853 - variation
- public void test035() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public static void main(String[] args) {\n"
- + " try {\n" + " new X().bar();\n"
- + " } catch(Exception e){\n"
- + " System.out.println(\"[end]\");\n"
- + " }\n" + " }\n" + " Object bar() {\n"
- + " try {\n"
- + " System.out.print(\"[try]\");\n"
- + " return this;\n"
- + " } catch(Exception e){\n"
- + " System.out.print(\"[WRONG CATCH]\");\n"
- + " } finally {\n"
- + " System.out.print(\"[finally]\");\n"
- + " foo();\n" + " }\n" + " return this;\n"
- + " }\n" + " Object foo() {\n"
- + " throw new RuntimeException();\n" + " }\n"
- + "}\n", }, "[try][finally][end]");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124853 - variation
- public void test036() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public static void main(String[] args) {\n"
- + " try {\n" + " new X().bar();\n"
- + " } catch(Exception e){\n"
- + " System.out.println(\"[end]\");\n"
- + " }\n" + " }\n" + " Object bar() {\n"
- + " try {\n"
- + " System.out.print(\"[try]\");\n"
- + " throw new RuntimeException();\n"
- + " } catch(Exception e){\n"
- + " System.out.print(\"[catch]\");\n"
- + " return this;\n" + " } finally {\n"
- + " System.out.print(\"[finally]\");\n"
- + " foo();\n" + " }\n" + " }\n"
- + " Object foo() {\n"
- + " throw new RuntimeException();\n" + " }\n"
- + "}\n", }, "[try][catch][finally][end]");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124853 - variation
- public void test037() {
- this
- .runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + "\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " scenario();\n"
- + " } catch(Exception e){\n"
- + " System.out.println(\"[end]\");\n"
- + " }\n"
- + " }\n"
- + "\n"
- + " private static void scenario() throws Exception {\n"
- + " try {\n"
- + " System.out.print(\"[try1]\");\n"
- + " try {\n"
- + " System.out.print(\"[try2]\");\n"
- + " return;\n"
- + " } catch(Exception e) {\n"
- + " System.out.print(\"[catch2]\");\n"
- + " } finally {\n"
- + " System.out.print(\"[finally2]\");\n"
- + " throwRuntime();\n"
- + " }\n"
- + " } catch(Exception e) {\n"
- + " System.out.print(\"[catch1]\");\n"
- + " throw e;\n"
- + " } finally {\n"
- + " System.out.print(\"[finally1]\");\n"
- + " }\n"
- + " }\n"
- + "\n"
- + " private static void throwRuntime() {\n"
- + " throw new RuntimeException(\"error\");\n"
- + " }\n" + "}\n", },
- "[try1][try2][finally2][catch1][finally1][end]");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87423
- public void test038() {
- this.runConformTest(new String[] {
- "X.java",
- "public class X {\n" + "\n" + " int hasLoop() {\n"
- + " int l, m, n;\n" + " for (m = 0; m < 10; m++) {\n"
- + " n = 2;\n" + " try {\n" + " n = 3;\n"
- + " try {\n" + " n = 4;\n"
- + " } catch (ArithmeticException e1) {\n"
- + " n = 11;\n" + " } finally {\n"
- + " for (l = 0; l < 10; l++) {\n" + " n++;\n"
- + " }\n" + " if (n == 12) {\n"
- + " n = 13;\n" + " break;\n" + " }\n"
- + " n = 15;\n" + " }\n"
- + " } catch (OutOfMemoryError e2) {\n"
- + " n = 18;\n" + " }\n" + " }\n"
- + " return 0;\n" + " }\n" + "\n"
- + " public static void main(String args[]) {\n"
- + " System.out.println(\"Loaded fine\");\n"
- + " }\n" + "}\n", }, "Loaded fine");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=127603
- public void test039() {
- this
- .runConformTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public static void someMethod() {\n"
- + " int count = 0;\n"
- + " int code = -1;\n"
- + " while (count < 2 && (code == -1 || code == 2)) {\n"
- + " count++;\n"
- + " try {\n"
- + " {\n"
- + " System.out.print(\"[Try:\" + count + \";\" + code+\"]\");\n"
- + " }\n"
- + " code = 0;\n"
- + "\n"
- + " } finally {\n"
- + " System.out.print(\"[Finally\" + count + \";\" + code+\"]\");\n"
- + " }\n"
- + " }\n"
- + " System.out.print(\"[Outering\");\n"
- + "\n"
- + " if (code == 0) {\n"
- + " System.out.print(\"[Return:\" + count + \";\" + code+\"]\");\n"
- + " return;\n"
- + " }\n"
- + " throw new RuntimeException(null + \"a\");\n"
- + " }\n"
- + "\n"
- + " public static void main(String[] args) throws Exception {\n"
- + " for (int i = 0; i < 1; i++) {\n"
- + " someMethod();\n"
- + " System.out.println();\n"
- + " }\n" + " }\n" + "}\n", },
- "[Try:1;-1][Finally1;0][Outering[Return:1;0]");
- }
-
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128705
- // public void test040() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public void foo(boolean b) {\n" +
- // " try { \n" +
- // " if (b){ \n" +
- // " int i = 0;\n" +
- // " return;\n" +
- // " } else {\n" +
- // " Object o = null;\n" +
- // " return;\n" +
- // " }\n" +
- // " } finally {\n" +
- // " System.out.println(\"done\");\n" +
- // " }\n" +
- // " }\n" +
- // " public static void main(String[] args) {\n" +
- // " new X().foo(true);\n" +
- // " }\n" +
- // "}\n",
- // },
- // "done");
- //
- // CompilerOptions compilerOptions = new
- // CompilerOptions(this.getCompilerOptions());
- // String expectedOutput = !compilerOptions.inlineJsrBytecode
- // ? " // Method descriptor #15 (Z)V\n" +
- // " // Stack: 2, Locals: 5\n" +
- // " public void foo(boolean b);\n" +
- // " 0 iload_1 [b]\n" +
- // " 1 ifeq 10\n" +
- // " 4 iconst_0\n" +
- // " 5 istore_2 [i]\n" +
- // " 6 jsr 23\n" +
- // " 9 return\n" +
- // " 10 aconst_null\n" +
- // " 11 astore_2 [o]\n" +
- // " 12 goto 6\n" +
- // " 15 astore 4\n" +
- // " 17 jsr 23\n" +
- // " 20 aload 4\n" +
- // " 22 athrow\n" +
- // " 23 astore_3\n" +
- // " 24 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 27 ldc <String \"done\"> [22]\n" +
- // " 29 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 32 ret 3\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 9] -> 15 when : any\n" +
- // " [pc: 10, pc: 15] -> 15 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 4, line: 5]\n" +
- // " [pc: 6, line: 6]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 12, line: 9]\n" +
- // " [pc: 15, line: 11]\n" +
- // " [pc: 20, line: 13]\n" +
- // " [pc: 23, line: 11]\n" +
- // " [pc: 24, line: 12]\n" +
- // " [pc: 32, line: 13]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 34] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 34] local: b index: 1 type: boolean\n" +
- // " [pc: 6, pc: 10] local: i index: 2 type: int\n" +
- // " [pc: 12, pc: 15] local: o index: 2 type: java.lang.Object\n"
- // : null;
- // if (expectedOutput == null) {
- // if (compilerOptions.targetJDK == ClassFileConstants.JDK1_5) {
- // expectedOutput = " // Method descriptor #15 (Z)V\n" +
- // " // Stack: 2, Locals: 4\n" +
- // " public void foo(boolean b);\n" +
- // " 0 iload_1 [b]\n" +
- // " 1 ifeq 15\n" +
- // " 4 iconst_0\n" +
- // " 5 istore_2 [i]\n" +
- // " 6 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 9 ldc <String \"done\"> [22]\n" +
- // " 11 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 14 return\n" +
- // " 15 aconst_null\n" +
- // " 16 astore_2 [o]\n" +
- // " 17 goto 6\n" +
- // " 20 astore_3\n" +
- // " 21 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 24 ldc <String \"done\"> [22]\n" +
- // " 26 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 29 aload_3\n" +
- // " 30 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 6] -> 20 when : any\n" +
- // " [pc: 15, pc: 20] -> 20 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 4, line: 5]\n" +
- // " [pc: 6, line: 12]\n" +
- // " [pc: 14, line: 6]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 17, line: 9]\n" +
- // " [pc: 20, line: 11]\n" +
- // " [pc: 21, line: 12]\n" +
- // " [pc: 29, line: 13]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 31] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 31] local: b index: 1 type: boolean\n" +
- // " [pc: 6, pc: 15] local: i index: 2 type: int\n" +
- // " [pc: 17, pc: 20] local: o index: 2 type: java.lang.Object\n";
- // } else {
- // expectedOutput = " // Method descriptor #15 (Z)V\n" +
- // " // Stack: 2, Locals: 4\n" +
- // " public void foo(boolean b);\n" +
- // " 0 iload_1 [b]\n" +
- // " 1 ifeq 15\n" +
- // " 4 iconst_0\n" +
- // " 5 istore_2 [i]\n" +
- // " 6 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 9 ldc <String \"done\"> [22]\n" +
- // " 11 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 14 return\n" +
- // " 15 aconst_null\n" +
- // " 16 astore_2 [o]\n" +
- // " 17 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 20 ldc <String \"done\"> [22]\n" +
- // " 22 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 25 return\n" +
- // " 26 astore_3\n" +
- // " 27 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 30 ldc <String \"done\"> [22]\n" +
- // " 32 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 35 aload_3\n" +
- // " 36 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 6] -> 26 when : any\n" +
- // " [pc: 15, pc: 17] -> 26 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 4, line: 5]\n" +
- // " [pc: 6, line: 12]\n" +
- // " [pc: 14, line: 6]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 17, line: 12]\n" +
- // " [pc: 25, line: 9]\n" +
- // " [pc: 26, line: 11]\n" +
- // " [pc: 27, line: 12]\n" +
- // " [pc: 35, line: 13]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 37] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 37] local: b index: 1 type: boolean\n" +
- // " [pc: 6, pc: 15] local: i index: 2 type: int\n" +
- // " [pc: 17, pc: 26] local: o index: 2 type: java.lang.Object\n" +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 15, same]\n" +
- // " [pc: 26, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n";
- // }
- // }
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=128705 - variation
- // public void test041() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public void foo(boolean b) {\n" +
- // " try { \n" +
- // " int i = 0;\n" +
- // " return;\n" +
- // " } catch(Exception e) {\n" +
- // " return;\n" +
- // " } finally {\n" +
- // " System.out.println(\"done\");\n" +
- // " }\n" +
- // " }\n" +
- // " public static void main(String[] args) {\n" +
- // " new X().foo(true);\n" +
- // " }\n" +
- // "}\n",
- // },
- // "done");
- //
- // CompilerOptions compilerOptions = new
- // CompilerOptions(this.getCompilerOptions());
- // String expectedOutput = !compilerOptions.inlineJsrBytecode
- // ? " // Method descriptor #15 (Z)V\n" +
- // " // Stack: 2, Locals: 5\n" +
- // " public void foo(boolean b);\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_2 [i]\n" +
- // " 2 jsr 18\n" +
- // " 5 return\n" +
- // " 6 astore_2 [e]\n" +
- // " 7 goto 2\n" +
- // " 10 astore 4\n" +
- // " 12 jsr 18\n" +
- // " 15 aload 4\n" +
- // " 17 athrow\n" +
- // " 18 astore_3\n" +
- // " 19 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 22 ldc <String \"done\"> [22]\n" +
- // " 24 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 27 ret 3\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 5] -> 6 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 5] -> 10 when : any\n" +
- // " [pc: 6, pc: 10] -> 10 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 2, line: 5]\n" +
- // " [pc: 6, line: 6]\n" +
- // " [pc: 7, line: 7]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 15, line: 10]\n" +
- // " [pc: 18, line: 8]\n" +
- // " [pc: 19, line: 9]\n" +
- // " [pc: 27, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 29] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 29] local: b index: 1 type: boolean\n" +
- // " [pc: 2, pc: 6] local: i index: 2 type: int\n" +
- // " [pc: 7, pc: 10] local: e index: 2 type: java.lang.Exception\n"
- // : null;
- // if (expectedOutput == null) {
- // if (compilerOptions.targetJDK == ClassFileConstants.JDK1_5) {
- // expectedOutput = " // Method descriptor #15 (Z)V\n" +
- // " // Stack: 2, Locals: 4\n" +
- // " public void foo(boolean b);\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_2 [i]\n" +
- // " 2 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 5 ldc <String \"done\"> [22]\n" +
- // " 7 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 10 return\n" +
- // " 11 astore_2 [e]\n" +
- // " 12 goto 2\n" +
- // " 15 astore_3\n" +
- // " 16 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 19 ldc <String \"done\"> [22]\n" +
- // " 21 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 24 aload_3\n" +
- // " 25 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 2] -> 11 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 2] -> 15 when : any\n" +
- // " [pc: 11, pc: 15] -> 15 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 2, line: 9]\n" +
- // " [pc: 10, line: 5]\n" +
- // " [pc: 11, line: 6]\n" +
- // " [pc: 12, line: 7]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 16, line: 9]\n" +
- // " [pc: 24, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 26] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 26] local: b index: 1 type: boolean\n" +
- // " [pc: 2, pc: 11] local: i index: 2 type: int\n" +
- // " [pc: 12, pc: 15] local: e index: 2 type: java.lang.Exception\n";
- // } else {
- // expectedOutput = " // Method descriptor #15 (Z)V\n" +
- // " // Stack: 2, Locals: 4\n" +
- // " public void foo(boolean b);\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_2 [i]\n" +
- // " 2 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 5 ldc <String \"done\"> [22]\n" +
- // " 7 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 10 return\n" +
- // " 11 astore_2 [e]\n" +
- // " 12 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 15 ldc <String \"done\"> [22]\n" +
- // " 17 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 20 return\n" +
- // " 21 astore_3\n" +
- // " 22 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 25 ldc <String \"done\"> [22]\n" +
- // " 27 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n"
- // +
- // " 30 aload_3\n" +
- // " 31 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 2] -> 11 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 2] -> 21 when : any\n" +
- // " [pc: 11, pc: 12] -> 21 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 2, line: 9]\n" +
- // " [pc: 10, line: 5]\n" +
- // " [pc: 11, line: 6]\n" +
- // " [pc: 12, line: 9]\n" +
- // " [pc: 20, line: 7]\n" +
- // " [pc: 21, line: 8]\n" +
- // " [pc: 22, line: 9]\n" +
- // " [pc: 30, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 32] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 32] local: b index: 1 type: boolean\n" +
- // " [pc: 2, pc: 11] local: i index: 2 type: int\n" +
- // " [pc: 12, pc: 21] local: e index: 2 type: java.lang.Exception\n"
- // +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 11, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 21, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n";
- // }
- // }
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=128705 - variation
- // public void test042() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // " public class X {\n" +
- // " public static void main(String[] args) {\n" +
- // " System.out.println(new X().foo(args));\n" +
- // " }\n" +
- // " String foo(String[] args) {\n" +
- // " try {\n" +
- // " if (args == null) return \"KO\";\n" +
- // " switch(args.length) {\n" +
- // " case 0:\n" +
- // " return \"OK\";\n" +
- // " case 1:\n" +
- // " return \"KO\";\n" +
- // " case 3:\n" +
- // " return \"OK\";\n" +
- // " default:\n" +
- // " return \"KO\";\n" +
- // " }\n" +
- // " } finally {\n" +
- // " System.out.print(\"FINALLY:\");\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "FINALLY:OK");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).inlineJsrBytecode
- // ? " // Method descriptor #26 ([Ljava/lang/String;)Ljava/lang/String;\n"
- // +
- // " // Stack: 2, Locals: 3\n" +
- // " java.lang.String foo(java.lang.String[] args);\n" +
- // " 0 aload_1 [args]\n" +
- // " 1 ifnonnull 15\n" +
- // " 4 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 7 ldc <String \"FINALLY:\"> [35]\n" +
- // " 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n"
- // +
- // " 12 ldc <String \"KO\"> [40]\n" +
- // " 14 areturn\n" +
- // " 15 aload_1 [args]\n" +
- // " 16 arraylength\n" +
- // " 17 tableswitch default: 65\n" +
- // " case 0: 48\n" +
- // " case 1: 59\n" +
- // " case 2: 65\n" +
- // " case 3: 62\n" +
- // " 48 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 51 ldc <String \"FINALLY:\"> [35]\n" +
- // " 53 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n"
- // +
- // " 56 ldc <String \"OK\"> [42]\n" +
- // " 58 areturn\n" +
- // " 59 goto 4\n" +
- // " 62 goto 48\n" +
- // " 65 goto 4\n" +
- // " 68 astore_2\n" +
- // " 69 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 72 ldc <String \"FINALLY:\"> [35]\n" +
- // " 74 invokevirtual java.io.PrintStream.print(java.lang.String) : void [37]\n"
- // +
- // " 77 aload_2\n" +
- // " 78 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 4] -> 68 when : any\n" +
- // " [pc: 15, pc: 48] -> 68 when : any\n" +
- // " [pc: 59, pc: 68] -> 68 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 7]\n" +
- // " [pc: 4, line: 19]\n" +
- // " [pc: 12, line: 7]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 48, line: 19]\n" +
- // " [pc: 56, line: 10]\n" +
- // " [pc: 59, line: 12]\n" +
- // " [pc: 62, line: 14]\n" +
- // " [pc: 65, line: 16]\n" +
- // " [pc: 68, line: 18]\n" +
- // " [pc: 69, line: 19]\n" +
- // " [pc: 77, line: 20]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 79] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 79] local: args index: 1 type: java.lang.String[]\n"
- // : " // Method descriptor #26 ([Ljava/lang/String;)Ljava/lang/String;\n"
- // +
- // " // Stack: 2, Locals: 4\n" +
- // " java.lang.String foo(java.lang.String[] args);\n" +
- // " 0 aload_1 [args]\n" +
- // " 1 ifnonnull 10\n" +
- // " 4 jsr 65\n" +
- // " 7 ldc <String \"KO\"> [35]\n" +
- // " 9 areturn\n" +
- // " 10 aload_1 [args]\n" +
- // " 11 arraylength\n" +
- // " 12 tableswitch default: 56\n" +
- // " case 0: 44\n" +
- // " case 1: 50\n" +
- // " case 2: 56\n" +
- // " case 3: 53\n" +
- // " 44 jsr 65\n" +
- // " 47 ldc <String \"OK\"> [37]\n" +
- // " 49 areturn\n" +
- // " 50 goto 4\n" +
- // " 53 goto 44\n" +
- // " 56 goto 4\n" +
- // " 59 astore_3\n" +
- // " 60 jsr 65\n" +
- // " 63 aload_3\n" +
- // " 64 athrow\n" +
- // " 65 astore_2\n" +
- // " 66 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 69 ldc <String \"FINALLY:\"> [39]\n" +
- // " 71 invokevirtual java.io.PrintStream.print(java.lang.String) : void [41]\n"
- // +
- // " 74 ret 2\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 59 when : any\n" +
- // " [pc: 10, pc: 47] -> 59 when : any\n" +
- // " [pc: 50, pc: 59] -> 59 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 7]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 44, line: 10]\n" +
- // " [pc: 50, line: 12]\n" +
- // " [pc: 53, line: 14]\n" +
- // " [pc: 56, line: 16]\n" +
- // " [pc: 59, line: 18]\n" +
- // " [pc: 63, line: 20]\n" +
- // " [pc: 65, line: 18]\n" +
- // " [pc: 66, line: 19]\n" +
- // " [pc: 74, line: 20]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 76] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 76] local: args index: 1 type: java.lang.String[]\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128705 - variation
- // public void test043() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public void save() {\n" +
- // " int a = 3;\n" +
- // " try {\n" +
- // " Object warnings = null;\n" +
- // " Object contexts = null;\n" +
- // " try {\n" +
- // " System.out.print(warnings);\n" +
- // " return;\n" +
- // " } catch (NullPointerException npe) {\n" +
- // " System.out.print(contexts);\n" +
- // " return;\n" +
- // " } finally {\n" +
- // " System.out.print(\"#inner -> \" + a);\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " return;\n" +
- // " } finally {\n" +
- // " int var = 0;\n" +
- // " System.out.println(\"#save -> \" + a);\n" +
- // " }\n" +
- // " }\n" +
- // " public static void main(String[] args) {\n" +
- // " new X().save();\n" +
- // " }\n" +
- // "}\n",
- // },
- // "null#inner -> 3#save -> 3");
- //
- // CompilerOptions compilerOptions = new
- // CompilerOptions(this.getCompilerOptions());
- // String expectedOutput = !compilerOptions.inlineJsrBytecode
- // ? " // Method descriptor #6 ()V\n" +
- // " // Stack: 4, Locals: 10\n" +
- // " public void save();\n" +
- // " 0 iconst_3\n" +
- // " 1 istore_1 [a]\n" +
- // " 2 aconst_null\n" +
- // " 3 astore_2 [warnings]\n" +
- // " 4 aconst_null\n" +
- // " 5 astore_3 [contexts]\n" +
- // " 6 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 9 aload_2 [warnings]\n" +
- // " 10 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [21]\n"
- // +
- // " 13 jsr 40\n" +
- // " 16 jsr 78\n" +
- // " 19 return\n" +
- // " 20 astore 4 [npe]\n" +
- // " 22 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 25 aload_3 [contexts]\n" +
- // " 26 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [21]\n"
- // +
- // " 29 goto 13\n" +
- // " 32 astore 6\n" +
- // " 34 jsr 40\n" +
- // " 37 aload 6\n" +
- // " 39 athrow\n" +
- // " 40 astore 5\n" +
- // " 42 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 45 new java.lang.StringBuffer [27]\n" +
- // " 48 dup\n" +
- // " 49 ldc <String \"#inner -> \"> [29]\n" +
- // " 51 invokespecial java.lang.StringBuffer(java.lang.String) [31]\n"
- // +
- // " 54 iload_1 [a]\n" +
- // " 55 invokevirtual java.lang.StringBuffer.append(int) : java.lang.StringBuffer [34]\n"
- // +
- // " 58 invokevirtual java.lang.StringBuffer.toString() : java.lang.String [38]\n"
- // +
- // " 61 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 64 ret 5\n" +
- // " 66 astore_2 [e]\n" +
- // " 67 goto 16\n" +
- // " 70 astore 8\n" +
- // " 72 jsr 78\n" +
- // " 75 aload 8\n" +
- // " 77 athrow\n" +
- // " 78 astore 7\n" +
- // " 80 iconst_0\n" +
- // " 81 istore 9 [var]\n" +
- // " 83 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 86 new java.lang.StringBuffer [27]\n" +
- // " 89 dup\n" +
- // " 90 ldc <String \"#save -> \"> [44]\n" +
- // " 92 invokespecial java.lang.StringBuffer(java.lang.String) [31]\n"
- // +
- // " 95 iload_1 [a]\n" +
- // " 96 invokevirtual java.lang.StringBuffer.append(int) : java.lang.StringBuffer [34]\n"
- // +
- // " 99 invokevirtual java.lang.StringBuffer.toString() : java.lang.String [38]\n"
- // +
- // " 102 invokevirtual java.io.PrintStream.println(java.lang.String) : void [46]\n"
- // +
- // " 105 ret 7\n" +
- // " Exception Table:\n" +
- // " [pc: 6, pc: 16] -> 20 when : java.lang.NullPointerException\n" +
- // " [pc: 6, pc: 16] -> 32 when : any\n" +
- // " [pc: 20, pc: 32] -> 32 when : any\n" +
- // " [pc: 2, pc: 19] -> 66 when : java.lang.Exception\n" +
- // " [pc: 20, pc: 66] -> 66 when : java.lang.Exception\n" +
- // " [pc: 2, pc: 19] -> 70 when : any\n" +
- // " [pc: 20, pc: 70] -> 70 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 3]\n" +
- // " [pc: 2, line: 5]\n" +
- // " [pc: 4, line: 6]\n" +
- // " [pc: 6, line: 8]\n" +
- // " [pc: 13, line: 9]\n" +
- // " [pc: 20, line: 10]\n" +
- // " [pc: 22, line: 11]\n" +
- // " [pc: 29, line: 12]\n" +
- // " [pc: 32, line: 13]\n" +
- // " [pc: 37, line: 15]\n" +
- // " [pc: 40, line: 13]\n" +
- // " [pc: 42, line: 14]\n" +
- // " [pc: 64, line: 15]\n" +
- // " [pc: 66, line: 16]\n" +
- // " [pc: 67, line: 17]\n" +
- // " [pc: 70, line: 18]\n" +
- // " [pc: 75, line: 21]\n" +
- // " [pc: 78, line: 18]\n" +
- // " [pc: 80, line: 19]\n" +
- // " [pc: 83, line: 20]\n" +
- // " [pc: 105, line: 21]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 107] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 107] local: a index: 1 type: int\n" +
- // " [pc: 4, pc: 66] local: warnings index: 2 type: java.lang.Object\n"
- // +
- // " [pc: 6, pc: 66] local: contexts index: 3 type: java.lang.Object\n"
- // +
- // " [pc: 22, pc: 32] local: npe index: 4 type: java.lang.NullPointerException\n"
- // +
- // " [pc: 67, pc: 70] local: e index: 2 type: java.lang.Exception\n"
- // +
- // " [pc: 83, pc: 105] local: var index: 9 type: int\n"
- // : null;
- //
- // if (expectedOutput == null) {
- // if (compilerOptions.targetJDK == ClassFileConstants.JDK1_5) {
- // expectedOutput = " // Method descriptor #6 ()V\n" +
- // " // Stack: 4, Locals: 8\n" +
- // " public void save();\n" +
- // " 0 iconst_3\n" +
- // " 1 istore_1 [a]\n" +
- // " 2 aconst_null\n" +
- // " 3 astore_2 [warnings]\n" +
- // " 4 aconst_null\n" +
- // " 5 astore_3 [contexts]\n" +
- // " 6 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 9 aload_2 [warnings]\n" +
- // " 10 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [21]\n"
- // +
- // " 13 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 16 new java.lang.StringBuilder [27]\n" +
- // " 19 dup\n" +
- // " 20 ldc <String \"#inner -> \"> [29]\n" +
- // " 22 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 25 iload_1 [a]\n" +
- // " 26 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 29 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 32 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 35 iconst_0\n" +
- // " 36 istore 7 [var]\n" +
- // " 38 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 41 new java.lang.StringBuilder [27]\n" +
- // " 44 dup\n" +
- // " 45 ldc <String \"#save -> \"> [44]\n" +
- // " 47 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 50 iload_1 [a]\n" +
- // " 51 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 54 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 57 invokevirtual java.io.PrintStream.println(java.lang.String) : void [46]\n"
- // +
- // " 60 return\n" +
- // " 61 astore 4 [npe]\n" +
- // " 63 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 66 aload_3 [contexts]\n" +
- // " 67 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [21]\n"
- // +
- // " 70 goto 13\n" +
- // " 73 astore 5\n" +
- // " 75 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 78 new java.lang.StringBuilder [27]\n" +
- // " 81 dup\n" +
- // " 82 ldc <String \"#inner -> \"> [29]\n" +
- // " 84 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 87 iload_1 [a]\n" +
- // " 88 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 91 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 94 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 97 aload 5\n" +
- // " 99 athrow\n" +
- // " 100 astore_2 [e]\n" +
- // " 101 goto 35\n" +
- // " 104 astore 6\n" +
- // " 106 iconst_0\n" +
- // " 107 istore 7 [var]\n" +
- // " 109 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 112 new java.lang.StringBuilder [27]\n" +
- // " 115 dup\n" +
- // " 116 ldc <String \"#save -> \"> [44]\n" +
- // " 118 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 121 iload_1 [a]\n" +
- // " 122 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 125 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 128 invokevirtual java.io.PrintStream.println(java.lang.String) : void [46]\n"
- // +
- // " 131 aload 6\n" +
- // " 133 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 6, pc: 13] -> 61 when : java.lang.NullPointerException\n" +
- // " [pc: 6, pc: 13] -> 73 when : any\n" +
- // " [pc: 61, pc: 73] -> 73 when : any\n" +
- // " [pc: 2, pc: 35] -> 100 when : java.lang.Exception\n" +
- // " [pc: 61, pc: 100] -> 100 when : java.lang.Exception\n" +
- // " [pc: 2, pc: 35] -> 104 when : any\n" +
- // " [pc: 61, pc: 104] -> 104 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 3]\n" +
- // " [pc: 2, line: 5]\n" +
- // " [pc: 4, line: 6]\n" +
- // " [pc: 6, line: 8]\n" +
- // " [pc: 13, line: 14]\n" +
- // " [pc: 35, line: 19]\n" +
- // " [pc: 38, line: 20]\n" +
- // " [pc: 60, line: 9]\n" +
- // " [pc: 61, line: 10]\n" +
- // " [pc: 63, line: 11]\n" +
- // " [pc: 70, line: 12]\n" +
- // " [pc: 73, line: 13]\n" +
- // " [pc: 75, line: 14]\n" +
- // " [pc: 97, line: 15]\n" +
- // " [pc: 100, line: 16]\n" +
- // " [pc: 101, line: 17]\n" +
- // " [pc: 104, line: 18]\n" +
- // " [pc: 106, line: 19]\n" +
- // " [pc: 109, line: 20]\n" +
- // " [pc: 131, line: 21]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 134] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 134] local: a index: 1 type: int\n" +
- // " [pc: 4, pc: 100] local: warnings index: 2 type: java.lang.Object\n"
- // +
- // " [pc: 6, pc: 100] local: contexts index: 3 type: java.lang.Object\n"
- // +
- // " [pc: 63, pc: 73] local: npe index: 4 type: java.lang.NullPointerException\n"
- // +
- // " [pc: 101, pc: 104] local: e index: 2 type: java.lang.Exception\n"
- // +
- // " [pc: 38, pc: 60] local: var index: 7 type: int\n" +
- // " [pc: 109, pc: 131] local: var index: 7 type: int\n";
- // } else {
- // expectedOutput = " // Method descriptor #6 ()V\n" +
- // " // Stack: 4, Locals: 8\n" +
- // " public void save();\n" +
- // " 0 iconst_3\n" +
- // " 1 istore_1 [a]\n" +
- // " 2 aconst_null\n" +
- // " 3 astore_2 [warnings]\n" +
- // " 4 aconst_null\n" +
- // " 5 astore_3 [contexts]\n" +
- // " 6 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 9 aload_2 [warnings]\n" +
- // " 10 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [21]\n"
- // +
- // " 13 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 16 new java.lang.StringBuilder [27]\n" +
- // " 19 dup\n" +
- // " 20 ldc <String \"#inner -> \"> [29]\n" +
- // " 22 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 25 iload_1 [a]\n" +
- // " 26 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 29 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 32 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 35 iconst_0\n" +
- // " 36 istore 7 [var]\n" +
- // " 38 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 41 new java.lang.StringBuilder [27]\n" +
- // " 44 dup\n" +
- // " 45 ldc <String \"#save -> \"> [44]\n" +
- // " 47 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 50 iload_1 [a]\n" +
- // " 51 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 54 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 57 invokevirtual java.io.PrintStream.println(java.lang.String) : void [46]\n"
- // +
- // " 60 return\n" +
- // " 61 astore 4 [npe]\n" +
- // " 63 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 66 aload_3 [contexts]\n" +
- // " 67 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [21]\n"
- // +
- // " 70 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 73 new java.lang.StringBuilder [27]\n" +
- // " 76 dup\n" +
- // " 77 ldc <String \"#inner -> \"> [29]\n" +
- // " 79 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 82 iload_1 [a]\n" +
- // " 83 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 86 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 89 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 92 iconst_0\n" +
- // " 93 istore 7 [var]\n" +
- // " 95 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 98 new java.lang.StringBuilder [27]\n" +
- // " 101 dup\n" +
- // " 102 ldc <String \"#save -> \"> [44]\n" +
- // " 104 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 107 iload_1 [a]\n" +
- // " 108 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 111 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 114 invokevirtual java.io.PrintStream.println(java.lang.String) : void [46]\n"
- // +
- // " 117 return\n" +
- // " 118 astore 5\n" +
- // " 120 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 123 new java.lang.StringBuilder [27]\n" +
- // " 126 dup\n" +
- // " 127 ldc <String \"#inner -> \"> [29]\n" +
- // " 129 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 132 iload_1 [a]\n" +
- // " 133 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 136 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 139 invokevirtual java.io.PrintStream.print(java.lang.String) : void [42]\n"
- // +
- // " 142 aload 5\n" +
- // " 144 athrow\n" +
- // " 145 astore_2 [e]\n" +
- // " 146 iconst_0\n" +
- // " 147 istore 7 [var]\n" +
- // " 149 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 152 new java.lang.StringBuilder [27]\n" +
- // " 155 dup\n" +
- // " 156 ldc <String \"#save -> \"> [44]\n" +
- // " 158 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 161 iload_1 [a]\n" +
- // " 162 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 165 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 168 invokevirtual java.io.PrintStream.println(java.lang.String) : void [46]\n"
- // +
- // " 171 return\n" +
- // " 172 astore 6\n" +
- // " 174 iconst_0\n" +
- // " 175 istore 7 [var]\n" +
- // " 177 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 180 new java.lang.StringBuilder [27]\n" +
- // " 183 dup\n" +
- // " 184 ldc <String \"#save -> \"> [44]\n" +
- // " 186 invokespecial java.lang.StringBuilder(java.lang.String) [31]\n"
- // +
- // " 189 iload_1 [a]\n" +
- // " 190 invokevirtual java.lang.StringBuilder.append(int) : java.lang.StringBuilder [34]\n"
- // +
- // " 193 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [38]\n"
- // +
- // " 196 invokevirtual java.io.PrintStream.println(java.lang.String) : void [46]\n"
- // +
- // " 199 aload 6\n" +
- // " 201 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 6, pc: 13] -> 61 when : java.lang.NullPointerException\n" +
- // " [pc: 6, pc: 13] -> 118 when : any\n" +
- // " [pc: 61, pc: 70] -> 118 when : any\n" +
- // " [pc: 2, pc: 35] -> 145 when : java.lang.Exception\n" +
- // " [pc: 61, pc: 92] -> 145 when : java.lang.Exception\n" +
- // " [pc: 118, pc: 145] -> 145 when : java.lang.Exception\n" +
- // " [pc: 2, pc: 35] -> 172 when : any\n" +
- // " [pc: 61, pc: 92] -> 172 when : any\n" +
- // " [pc: 118, pc: 146] -> 172 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 3]\n" +
- // " [pc: 2, line: 5]\n" +
- // " [pc: 4, line: 6]\n" +
- // " [pc: 6, line: 8]\n" +
- // " [pc: 13, line: 14]\n" +
- // " [pc: 35, line: 19]\n" +
- // " [pc: 38, line: 20]\n" +
- // " [pc: 60, line: 9]\n" +
- // " [pc: 61, line: 10]\n" +
- // " [pc: 63, line: 11]\n" +
- // " [pc: 70, line: 14]\n" +
- // " [pc: 92, line: 19]\n" +
- // " [pc: 95, line: 20]\n" +
- // " [pc: 117, line: 12]\n" +
- // " [pc: 118, line: 13]\n" +
- // " [pc: 120, line: 14]\n" +
- // " [pc: 142, line: 15]\n" +
- // " [pc: 145, line: 16]\n" +
- // " [pc: 146, line: 19]\n" +
- // " [pc: 149, line: 20]\n" +
- // " [pc: 171, line: 17]\n" +
- // " [pc: 172, line: 18]\n" +
- // " [pc: 174, line: 19]\n" +
- // " [pc: 177, line: 20]\n" +
- // " [pc: 199, line: 21]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 202] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 202] local: a index: 1 type: int\n" +
- // " [pc: 4, pc: 145] local: warnings index: 2 type: java.lang.Object\n"
- // +
- // " [pc: 6, pc: 145] local: contexts index: 3 type: java.lang.Object\n"
- // +
- // " [pc: 63, pc: 118] local: npe index: 4 type: java.lang.NullPointerException\n"
- // +
- // " [pc: 146, pc: 172] local: e index: 2 type: java.lang.Exception\n"
- // +
- // " [pc: 38, pc: 60] local: var index: 7 type: int\n" +
- // " [pc: 95, pc: 117] local: var index: 7 type: int\n" +
- // " [pc: 149, pc: 171] local: var index: 7 type: int\n" +
- // " [pc: 177, pc: 199] local: var index: 7 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 61, full, stack: {java.lang.NullPointerException}, locals: {X, int, java.lang.Object, java.lang.Object}]\n"
- // +
- // " [pc: 118, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n"
- // +
- // " [pc: 145, full, stack: {java.lang.Exception}, locals: {X, int}]\n"
- // +
- // " [pc: 172, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n";
- // }
- // }
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129305
- // public void test044() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public static void main(String[] args) {\n" +
- // " foo();\n" +
- // " } \n" +
- // " static Object foo() {\n" +
- // " try {\n" +
- // " return null;\n" +
- // " } catch(Exception e) {\n" +
- // " return null;\n" +
- // " } finally {\n" +
- // " System.out.println(\"SUCCESS\");\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "SUCCESS");
- //
- // CompilerOptions compilerOptions = new
- // CompilerOptions(this.getCompilerOptions());
- // String expectedOutput = !compilerOptions.inlineJsrBytecode ?
- // " // Method descriptor #19 ()Ljava/lang/Object;\n" +
- // " // Stack: 2, Locals: 3\n" +
- // " static java.lang.Object foo();\n" +
- // " 0 jsr 15\n" +
- // " 3 aconst_null\n" +
- // " 4 areturn\n" +
- // " 5 astore_0 [e]\n" +
- // " 6 goto 0\n" +
- // " 9 astore_2\n" +
- // " 10 jsr 15\n" +
- // " 13 aload_2\n" +
- // " 14 athrow\n" +
- // " 15 astore_1\n" +
- // " 16 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- // " 19 ldc <String \"SUCCESS\"> [28]\n" +
- // " 21 invokevirtual java.io.PrintStream.println(java.lang.String) : void [30]\n"
- // +
- // " 24 ret 1\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 3] -> 5 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 3] -> 9 when : any\n" +
- // " [pc: 5, pc: 9] -> 9 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 7]\n" +
- // " [pc: 5, line: 8]\n" +
- // " [pc: 6, line: 9]\n" +
- // " [pc: 9, line: 10]\n" +
- // " [pc: 13, line: 12]\n" +
- // " [pc: 15, line: 10]\n" +
- // " [pc: 16, line: 11]\n" +
- // " [pc: 24, line: 12]\n" +
- // " Local variable table:\n" +
- // " [pc: 6, pc: 9] local: e index: 0 type: java.lang.Exception\n"
- // : null;
- //
- // if (expectedOutput == null) {
- // if (compilerOptions.targetJDK == ClassFileConstants.JDK1_5) {
- // expectedOutput = " // Method descriptor #19 ()Ljava/lang/Object;\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " static java.lang.Object foo();\n" +
- // " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- // " 3 ldc <String \"SUCCESS\"> [28]\n" +
- // " 5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [30]\n"
- // +
- // " 8 aconst_null\n" +
- // " 9 areturn\n" +
- // " 10 astore_0 [e]\n" +
- // " 11 goto 0\n" +
- // " 14 astore_1\n" +
- // " 15 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- // " 18 ldc <String \"SUCCESS\"> [28]\n" +
- // " 20 invokevirtual java.io.PrintStream.println(java.lang.String) : void [30]\n"
- // +
- // " 23 aload_1\n" +
- // " 24 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 10, pc: 14] -> 14 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 11]\n" +
- // " [pc: 8, line: 7]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 11, line: 9]\n" +
- // " [pc: 14, line: 10]\n" +
- // " [pc: 15, line: 11]\n" +
- // " [pc: 23, line: 12]\n" +
- // " Local variable table:\n" +
- // " [pc: 11, pc: 14] local: e index: 0 type: java.lang.Exception\n";
- // } else {
- // expectedOutput = " // Method descriptor #19 ()Ljava/lang/Object;\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " static java.lang.Object foo();\n" +
- // " 0 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- // " 3 ldc <String \"SUCCESS\"> [28]\n" +
- // " 5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [30]\n"
- // +
- // " 8 aconst_null\n" +
- // " 9 areturn\n" +
- // " 10 astore_0 [e]\n" +
- // " 11 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- // " 14 ldc <String \"SUCCESS\"> [28]\n" +
- // " 16 invokevirtual java.io.PrintStream.println(java.lang.String) : void [30]\n"
- // +
- // " 19 aconst_null\n" +
- // " 20 areturn\n" +
- // " 21 astore_1\n" +
- // " 22 getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
- // " 25 ldc <String \"SUCCESS\"> [28]\n" +
- // " 27 invokevirtual java.io.PrintStream.println(java.lang.String) : void [30]\n"
- // +
- // " 30 aload_1\n" +
- // " 31 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 10, pc: 11] -> 21 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 11]\n" +
- // " [pc: 8, line: 7]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 11, line: 11]\n" +
- // " [pc: 19, line: 9]\n" +
- // " [pc: 21, line: 10]\n" +
- // " [pc: 22, line: 11]\n" +
- // " [pc: 30, line: 12]\n" +
- // " Local variable table:\n" +
- // " [pc: 11, pc: 21] local: e index: 0 type: java.lang.Exception\n"
- // +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 10, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 21, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n";
- // }
- // }
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129306
- // public void test045() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public void save() {\n" +
- // " try {\n" +
- // " Object warnings = null;\n" +
- // " Object contexts = null;\n" +
- // " try {\n" +
- // " System.out.print(\"[try]\");\n" +
- // " System.out.print(warnings); \n" +
- // " return;\n" +
- // " } catch (NullPointerException npe) {\n" +
- // " System.out.print(\"[npe]\");\n" +
- // " System.out.print(contexts); \n" +
- // " return;\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " System.out.print(\"[e]\");\n" +
- // " return;\n" +
- // " } finally { \n" +
- // " int var = 0;\n" +
- // " System.out.print(\"[finally]\");\n" +
- // " Object o = null;\n" +
- // " o.toString();\n" +
- // " }\n" +
- // " }\n" +
- // " public static void main(String[] args) {\n" +
- // " try {\n" +
- // " new X().save();\n" +
- // " } catch(NullPointerException e) {\n" +
- // " System.out.println(\"[caught npe]\");\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "[try]null[finally][caught npe]");
- //
- // CompilerOptions compilerOptions = new
- // CompilerOptions(this.getCompilerOptions());
- // String expectedOutput = !compilerOptions.inlineJsrBytecode
- // ? " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 8\n" +
- // " public void save();\n" +
- // " 0 aconst_null\n" +
- // " 1 astore_1 [warnings]\n" +
- // " 2 aconst_null\n" +
- // " 3 astore_2 [contexts]\n" +
- // " 4 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 7 ldc <String \"[try]\"> [21]\n" +
- // " 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 12 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 15 aload_1 [warnings]\n" +
- // " 16 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [29]\n"
- // +
- // " 19 jsr 62\n" +
- // " 22 return\n" +
- // " 23 astore_3 [npe]\n" +
- // " 24 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 27 ldc <String \"[npe]\"> [32]\n" +
- // " 29 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 32 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 35 aload_2 [contexts]\n" +
- // " 36 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [29]\n"
- // +
- // " 39 goto 19\n" +
- // " 42 astore_1 [e]\n" +
- // " 43 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 46 ldc <String \"[e]\"> [34]\n" +
- // " 48 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 51 goto 19\n" +
- // " 54 astore 5\n" +
- // " 56 jsr 62\n" +
- // " 59 aload 5\n" +
- // " 61 athrow\n" +
- // " 62 astore 4\n" +
- // " 64 iconst_0\n" +
- // " 65 istore 6 [var]\n" +
- // " 67 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 70 ldc <String \"[finally]\"> [36]\n" +
- // " 72 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 75 aconst_null\n" +
- // " 76 astore 7 [o]\n" +
- // " 78 aload 7 [o]\n" +
- // " 80 invokevirtual java.lang.Object.toString() : java.lang.String [38]\n"
- // +
- // " 83 pop\n" +
- // " 84 ret 4\n" +
- // " Exception Table:\n" +
- // " [pc: 4, pc: 19] -> 23 when : java.lang.NullPointerException\n" +
- // " [pc: 0, pc: 22] -> 42 when : java.lang.Exception\n" +
- // " [pc: 23, pc: 42] -> 42 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 22] -> 54 when : any\n" +
- // " [pc: 23, pc: 54] -> 54 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 2, line: 5]\n" +
- // " [pc: 4, line: 7]\n" +
- // " [pc: 12, line: 8]\n" +
- // " [pc: 19, line: 9]\n" +
- // " [pc: 23, line: 10]\n" +
- // " [pc: 24, line: 11]\n" +
- // " [pc: 32, line: 12]\n" +
- // " [pc: 39, line: 13]\n" +
- // " [pc: 42, line: 15]\n" +
- // " [pc: 43, line: 16]\n" +
- // " [pc: 51, line: 17]\n" +
- // " [pc: 54, line: 18]\n" +
- // " [pc: 59, line: 23]\n" +
- // " [pc: 62, line: 18]\n" +
- // " [pc: 64, line: 19]\n" +
- // " [pc: 67, line: 20]\n" +
- // " [pc: 75, line: 21]\n" +
- // " [pc: 78, line: 22]\n" +
- // " [pc: 84, line: 23]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 86] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 42] local: warnings index: 1 type: java.lang.Object\n"
- // +
- // " [pc: 4, pc: 42] local: contexts index: 2 type: java.lang.Object\n"
- // +
- // " [pc: 24, pc: 42] local: npe index: 3 type: java.lang.NullPointerException\n"
- // +
- // " [pc: 43, pc: 54] local: e index: 1 type: java.lang.Exception\n"
- // +
- // " [pc: 67, pc: 84] local: var index: 6 type: int\n" +
- // " [pc: 78, pc: 84] local: o index: 7 type: java.lang.Object\n"
- // : null;
- //
- // if (expectedOutput == null) {
- // if (compilerOptions.targetJDK == ClassFileConstants.JDK1_5) {
- // expectedOutput = " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 7\n" +
- // " public void save();\n" +
- // " 0 aconst_null\n" +
- // " 1 astore_1 [warnings]\n" +
- // " 2 aconst_null\n" +
- // " 3 astore_2 [contexts]\n" +
- // " 4 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 7 ldc <String \"[try]\"> [21]\n" +
- // " 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 12 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 15 aload_1 [warnings]\n" +
- // " 16 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [29]\n"
- // +
- // " 19 iconst_0\n" +
- // " 20 istore 5 [var]\n" +
- // " 22 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 25 ldc <String \"[finally]\"> [32]\n" +
- // " 27 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 30 aconst_null\n" +
- // " 31 astore 6 [o]\n" +
- // " 33 aload 6 [o]\n" +
- // " 35 invokevirtual java.lang.Object.toString() : java.lang.String [34]\n"
- // +
- // " 38 pop\n" +
- // " 39 return\n" +
- // " 40 astore_3 [npe]\n" +
- // " 41 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 44 ldc <String \"[npe]\"> [38]\n" +
- // " 46 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 49 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 52 aload_2 [contexts]\n" +
- // " 53 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [29]\n"
- // +
- // " 56 goto 19\n" +
- // " 59 astore_1 [e]\n" +
- // " 60 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 63 ldc <String \"[e]\"> [40]\n" +
- // " 65 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 68 goto 19\n" +
- // " 71 astore 4\n" +
- // " 73 iconst_0\n" +
- // " 74 istore 5 [var]\n" +
- // " 76 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 79 ldc <String \"[finally]\"> [32]\n" +
- // " 81 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 84 aconst_null\n" +
- // " 85 astore 6 [o]\n" +
- // " 87 aload 6 [o]\n" +
- // " 89 invokevirtual java.lang.Object.toString() : java.lang.String [34]\n"
- // +
- // " 92 pop\n" +
- // " 93 aload 4\n" +
- // " 95 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 4, pc: 19] -> 40 when : java.lang.NullPointerException\n" +
- // " [pc: 0, pc: 19] -> 59 when : java.lang.Exception\n" +
- // " [pc: 40, pc: 59] -> 59 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 19] -> 71 when : any\n" +
- // " [pc: 40, pc: 71] -> 71 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 2, line: 5]\n" +
- // " [pc: 4, line: 7]\n" +
- // " [pc: 12, line: 8]\n" +
- // " [pc: 19, line: 19]\n" +
- // " [pc: 22, line: 20]\n" +
- // " [pc: 30, line: 21]\n" +
- // " [pc: 33, line: 22]\n" +
- // " [pc: 39, line: 9]\n" +
- // " [pc: 40, line: 10]\n" +
- // " [pc: 41, line: 11]\n" +
- // " [pc: 49, line: 12]\n" +
- // " [pc: 56, line: 13]\n" +
- // " [pc: 59, line: 15]\n" +
- // " [pc: 60, line: 16]\n" +
- // " [pc: 68, line: 17]\n" +
- // " [pc: 71, line: 18]\n" +
- // " [pc: 73, line: 19]\n" +
- // " [pc: 76, line: 20]\n" +
- // " [pc: 84, line: 21]\n" +
- // " [pc: 87, line: 22]\n" +
- // " [pc: 93, line: 23]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 96] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 59] local: warnings index: 1 type: java.lang.Object\n"
- // +
- // " [pc: 4, pc: 59] local: contexts index: 2 type: java.lang.Object\n"
- // +
- // " [pc: 41, pc: 59] local: npe index: 3 type: java.lang.NullPointerException\n"
- // +
- // " [pc: 60, pc: 71] local: e index: 1 type: java.lang.Exception\n"
- // +
- // " [pc: 22, pc: 39] local: var index: 5 type: int\n" +
- // " [pc: 76, pc: 93] local: var index: 5 type: int\n" +
- // " [pc: 33, pc: 39] local: o index: 6 type: java.lang.Object\n" +
- // " [pc: 87, pc: 93] local: o index: 6 type: java.lang.Object\n";
- // } else {
- // expectedOutput = " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 7\n" +
- // " public void save();\n" +
- // " 0 aconst_null\n" +
- // " 1 astore_1 [warnings]\n" +
- // " 2 aconst_null\n" +
- // " 3 astore_2 [contexts]\n" +
- // " 4 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 7 ldc <String \"[try]\"> [21]\n" +
- // " 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 12 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 15 aload_1 [warnings]\n" +
- // " 16 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [29]\n"
- // +
- // " 19 iconst_0\n" +
- // " 20 istore 5 [var]\n" +
- // " 22 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 25 ldc <String \"[finally]\"> [32]\n" +
- // " 27 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 30 aconst_null\n" +
- // " 31 astore 6 [o]\n" +
- // " 33 aload 6 [o]\n" +
- // " 35 invokevirtual java.lang.Object.toString() : java.lang.String [34]\n"
- // +
- // " 38 pop\n" +
- // " 39 return\n" +
- // " 40 astore_3 [npe]\n" +
- // " 41 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 44 ldc <String \"[npe]\"> [38]\n" +
- // " 46 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 49 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 52 aload_2 [contexts]\n" +
- // " 53 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [29]\n"
- // +
- // " 56 iconst_0\n" +
- // " 57 istore 5 [var]\n" +
- // " 59 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 62 ldc <String \"[finally]\"> [32]\n" +
- // " 64 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 67 aconst_null\n" +
- // " 68 astore 6 [o]\n" +
- // " 70 aload 6 [o]\n" +
- // " 72 invokevirtual java.lang.Object.toString() : java.lang.String [34]\n"
- // +
- // " 75 pop\n" +
- // " 76 return\n" +
- // " 77 astore_1 [e]\n" +
- // " 78 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 81 ldc <String \"[e]\"> [40]\n" +
- // " 83 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 86 iconst_0\n" +
- // " 87 istore 5 [var]\n" +
- // " 89 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 92 ldc <String \"[finally]\"> [32]\n" +
- // " 94 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 97 aconst_null\n" +
- // " 98 astore 6 [o]\n" +
- // " 100 aload 6 [o]\n" +
- // " 102 invokevirtual java.lang.Object.toString() : java.lang.String [34]\n"
- // +
- // " 105 pop\n" +
- // " 106 return\n" +
- // " 107 astore 4\n" +
- // " 109 iconst_0\n" +
- // " 110 istore 5 [var]\n" +
- // " 112 getstatic java.lang.System.out : java.io.PrintStream [15]\n" +
- // " 115 ldc <String \"[finally]\"> [32]\n" +
- // " 117 invokevirtual java.io.PrintStream.print(java.lang.String) : void [23]\n"
- // +
- // " 120 aconst_null\n" +
- // " 121 astore 6 [o]\n" +
- // " 123 aload 6 [o]\n" +
- // " 125 invokevirtual java.lang.Object.toString() : java.lang.String [34]\n"
- // +
- // " 128 pop\n" +
- // " 129 aload 4\n" +
- // " 131 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 4, pc: 19] -> 40 when : java.lang.NullPointerException\n" +
- // " [pc: 0, pc: 19] -> 77 when : java.lang.Exception\n" +
- // " [pc: 40, pc: 56] -> 77 when : java.lang.Exception\n" +
- // " [pc: 0, pc: 19] -> 107 when : any\n" +
- // " [pc: 40, pc: 56] -> 107 when : any\n" +
- // " [pc: 77, pc: 86] -> 107 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 2, line: 5]\n" +
- // " [pc: 4, line: 7]\n" +
- // " [pc: 12, line: 8]\n" +
- // " [pc: 19, line: 19]\n" +
- // " [pc: 22, line: 20]\n" +
- // " [pc: 30, line: 21]\n" +
- // " [pc: 33, line: 22]\n" +
- // " [pc: 39, line: 9]\n" +
- // " [pc: 40, line: 10]\n" +
- // " [pc: 41, line: 11]\n" +
- // " [pc: 49, line: 12]\n" +
- // " [pc: 56, line: 19]\n" +
- // " [pc: 59, line: 20]\n" +
- // " [pc: 67, line: 21]\n" +
- // " [pc: 70, line: 22]\n" +
- // " [pc: 76, line: 13]\n" +
- // " [pc: 77, line: 15]\n" +
- // " [pc: 78, line: 16]\n" +
- // " [pc: 86, line: 19]\n" +
- // " [pc: 89, line: 20]\n" +
- // " [pc: 97, line: 21]\n" +
- // " [pc: 100, line: 22]\n" +
- // " [pc: 106, line: 17]\n" +
- // " [pc: 107, line: 18]\n" +
- // " [pc: 109, line: 19]\n" +
- // " [pc: 112, line: 20]\n" +
- // " [pc: 120, line: 21]\n" +
- // " [pc: 123, line: 22]\n" +
- // " [pc: 129, line: 23]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 132] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 77] local: warnings index: 1 type: java.lang.Object\n"
- // +
- // " [pc: 4, pc: 77] local: contexts index: 2 type: java.lang.Object\n"
- // +
- // " [pc: 41, pc: 77] local: npe index: 3 type: java.lang.NullPointerException\n"
- // +
- // " [pc: 78, pc: 107] local: e index: 1 type: java.lang.Exception\n"
- // +
- // " [pc: 22, pc: 39] local: var index: 5 type: int\n" +
- // " [pc: 59, pc: 76] local: var index: 5 type: int\n" +
- // " [pc: 89, pc: 106] local: var index: 5 type: int\n" +
- // " [pc: 112, pc: 129] local: var index: 5 type: int\n" +
- // " [pc: 33, pc: 39] local: o index: 6 type: java.lang.Object\n" +
- // " [pc: 70, pc: 76] local: o index: 6 type: java.lang.Object\n" +
- // " [pc: 100, pc: 106] local: o index: 6 type: java.lang.Object\n" +
- // " [pc: 123, pc: 129] local: o index: 6 type: java.lang.Object\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 40, full, stack: {java.lang.NullPointerException}, locals: {X, java.lang.Object, java.lang.Object}]\n"
- // +
- // " [pc: 77, full, stack: {java.lang.Exception}, locals: {X}]\n" +
- // " [pc: 107, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n";
- // }
- // }
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=108180
- // public void test046() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public static Object sanityCheckBug() {\n" +
- // " Object obj;\n" +
- // " try {\n" +
- // " obj = new Object();\n" +
- // " return obj;\n" +
- // " } finally {\n" +
- // " obj = null;\n" +
- // " }\n" +
- // " }\n" +
- // " public static void main(String[] arguments) {\n" +
- // " X.sanityCheckBug();\n" +
- // " }\n" +
- // "}\n",
- // },
- // "");
- //
- // CompilerOptions compilerOptions = new
- // CompilerOptions(this.getCompilerOptions());
- // String expectedOutput = !compilerOptions.inlineJsrBytecode
- // ? " // Method descriptor #15 ()Ljava/lang/Object;\n" +
- // " // Stack: 2, Locals: 4\n" +
- // " public static java.lang.Object sanityCheckBug();\n" +
- // " 0 new java.lang.Object [3]\n" +
- // " 3 dup\n" +
- // " 4 invokespecial java.lang.Object() [8]\n" +
- // " 7 astore_0 [obj]\n" +
- // " 8 aload_0 [obj]\n" +
- // " 9 astore_3\n" +
- // " 10 jsr 21\n" +
- // " 13 aload_3\n" +
- // " 14 areturn\n" +
- // " 15 astore_2\n" +
- // " 16 jsr 21\n" +
- // " 19 aload_2\n" +
- // " 20 athrow\n" +
- // " 21 astore_1\n" +
- // " 22 aconst_null\n" +
- // " 23 astore_0 [obj]\n" +
- // " 24 ret 1\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 13] -> 15 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 8, line: 6]\n" +
- // " [pc: 15, line: 7]\n" +
- // " [pc: 19, line: 9]\n" +
- // " [pc: 21, line: 7]\n" +
- // " [pc: 22, line: 8]\n" +
- // " [pc: 24, line: 9]\n" +
- // " Local variable table:\n" +
- // " [pc: 8, pc: 15] local: obj index: 0 type: java.lang.Object\n" +
- // " [pc: 24, pc: 26] local: obj index: 0 type: java.lang.Object\n"
- // : null;
- //
- // if (expectedOutput == null) {
- // if (compilerOptions.targetJDK == ClassFileConstants.JDK1_5) {
- // expectedOutput = " // Method descriptor #15 ()Ljava/lang/Object;\n" +
- // " // Stack: 2, Locals: 3\n" +
- // " public static java.lang.Object sanityCheckBug();\n" +
- // " 0 new java.lang.Object [3]\n" +
- // " 3 dup\n" +
- // " 4 invokespecial java.lang.Object() [8]\n" +
- // " 7 astore_0 [obj]\n" +
- // " 8 aload_0 [obj]\n" +
- // " 9 astore_2\n" +
- // " 10 aconst_null\n" +
- // " 11 astore_0 [obj]\n" +
- // " 12 aload_2\n" +
- // " 13 areturn\n" +
- // " 14 astore_1\n" +
- // " 15 aconst_null\n" +
- // " 16 astore_0 [obj]\n" +
- // " 17 aload_1\n" +
- // " 18 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 10] -> 14 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 8, line: 6]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 12, line: 6]\n" +
- // " [pc: 14, line: 7]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 17, line: 9]\n" +
- // " Local variable table:\n" +
- // " [pc: 8, pc: 14] local: obj index: 0 type: java.lang.Object\n" +
- // " [pc: 17, pc: 19] local: obj index: 0 type: java.lang.Object\n";
- // } else {
- // expectedOutput = " // Method descriptor #15 ()Ljava/lang/Object;\n" +
- // " // Stack: 2, Locals: 3\n" +
- // " public static java.lang.Object sanityCheckBug();\n" +
- // " 0 new java.lang.Object [3]\n" +
- // " 3 dup\n" +
- // " 4 invokespecial java.lang.Object() [8]\n" +
- // " 7 astore_0 [obj]\n" +
- // " 8 aload_0 [obj]\n" +
- // " 9 astore_2\n" +
- // " 10 aconst_null\n" +
- // " 11 astore_0 [obj]\n" +
- // " 12 aload_2\n" +
- // " 13 areturn\n" +
- // " 14 astore_1\n" +
- // " 15 aconst_null\n" +
- // " 16 astore_0 [obj]\n" +
- // " 17 aload_1\n" +
- // " 18 athrow\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 10] -> 14 when : any\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 8, line: 6]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 12, line: 6]\n" +
- // " [pc: 14, line: 7]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 17, line: 9]\n" +
- // " Local variable table:\n" +
- // " [pc: 8, pc: 14] local: obj index: 0 type: java.lang.Object\n" +
- // " [pc: 17, pc: 19] local: obj index: 0 type: java.lang.Object\n";
- // }
- // }
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- public void test047() {
- if (new CompilerOptions(getCompilerOptions()).complianceLevel <= ClassFileConstants.JDK1_3) {
- this
- .runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " if (false) throw null;\n"
- + " throw new Object();\n"
- + " } catch(Object o) {\n"
- + " }\n"
- + " }\n" + "}\n", },
- "----------\n"
- + "1. ERROR in X.java (at line 4)\n"
- + " if (false) throw null;\n"
- + " ^^^^\n"
- + "Cannot throw null as an exception\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 5)\n"
- + " throw new Object();\n"
- + " ^^^^^^^^^^^^\n"
- + "No exception of type Object can be thrown; an exception type must be a subclass of Throwable\n"
- + "----------\n"
- + "3. ERROR in X.java (at line 6)\n"
- + " } catch(Object o) {\n"
- + " ^^^^^^\n"
- + "No exception of type Object can be thrown; an exception type must be a subclass of Throwable\n"
- + "----------\n");
- return;
- }
- this
- .runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n"
- + " public static void main(String[] args) {\n"
- + " try {\n"
- + " if (false) throw null;\n"
- + " throw new Object();\n"
- + " } catch(Object o) {\n"
- + " }\n" + " }\n"
- + "}\n", },
- "----------\n"
- + "1. ERROR in X.java (at line 5)\n"
- + " throw new Object();\n"
- + " ^^^^^^^^^^^^\n"
- + "No exception of type Object can be thrown; an exception type must be a subclass of Throwable\n"
- + "----------\n"
- + "2. ERROR in X.java (at line 6)\n"
- + " } catch(Object o) {\n"
- + " ^^^^^^\n"
- + "No exception of type Object can be thrown; an exception type must be a subclass of Throwable\n"
- + "----------\n");
- }
-
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894
- // public void test048() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " boolean bool() { return true; }\n" +
- // " void foo() {\n" +
- // " try {\n" +
- // " if (bool()) {\n" +
- // " return;\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " }\n" +
- // " int foo2() {\n" +
- // " try {\n" +
- // " while (bool()) {\n" +
- // " return 0;\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " return 1;\n" +
- // " }\n" +
- // " long foo3() {\n" +
- // " try {\n" +
- // " do {\n" +
- // " if (true) return 0L;\n" +
- // " } while (bool());\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " return 1L;\n" +
- // " } \n" +
- // " float foo4() {\n" +
- // " try {\n" +
- // " for (int i = 0; bool(); i++) {\n" +
- // " return 0.0F;\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " return 1.0F;\n" +
- // " } \n" +
- // " double bar() {\n" +
- // " if (bool()) {\n" +
- // " if (bool())\n" +
- // " return 0.0;\n" +
- // " } else {\n" +
- // " if (bool()) {\n" +
- // " throw new NullPointerException();\n" +
- // " }\n" +
- // " }\n" +
- // " return 1.0;\n" +
- // " }\n" +
- // " void baz(int i) {\n" +
- // " if (bool()) {\n" +
- // " switch(i) {\n" +
- // " case 0 : return;\n" +
- // " default : break;\n" +
- // " }\n" +
- // " } else {\n" +
- // " bool();\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 9\n" +
- // " 7 return\n" +
- // " 8 astore_1\n" +
- // " 9 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 8 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 8, line: 8]\n" +
- // " [pc: 9, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #22 ()I\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " int foo2();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 10\n" +
- // " 7 iconst_0\n" +
- // " 8 ireturn\n" +
- // " 9 astore_1\n" +
- // " 10 iconst_1\n" +
- // " 11 ireturn\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 9 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 13]\n" +
- // " [pc: 7, line: 14]\n" +
- // " [pc: 9, line: 16]\n" +
- // " [pc: 10, line: 18]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 12] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #24 ()J\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " long foo3();\n" +
- // " 0 lconst_0\n" +
- // " 1 lreturn\n" +
- // " 2 astore_1\n" +
- // " 3 lconst_1\n" +
- // " 4 lreturn\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 23]\n" +
- // " [pc: 2, line: 25]\n" +
- // " [pc: 3, line: 27]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #26 ()F\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " float foo4();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 goto 7\n" +
- // " 5 fconst_0\n" +
- // " 6 freturn\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifne 5\n" +
- // " 14 goto 18\n" +
- // " 17 astore_1\n" +
- // " 18 fconst_1\n" +
- // " 19 freturn\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 5] -> 17 when : java.lang.Exception\n" +
- // " [pc: 7, pc: 14] -> 17 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 31]\n" +
- // " [pc: 5, line: 32]\n" +
- // " [pc: 7, line: 31]\n" +
- // " [pc: 17, line: 34]\n" +
- // " [pc: 18, line: 36]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 20] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 14] local: i index: 1 type: int\n" +
- // " \n" +
- // " // Method descriptor #30 ()D\n" +
- // " // Stack: 2, Locals: 1\n" +
- // " double bar();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 16\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifeq 31\n" +
- // " 14 dconst_0\n" +
- // " 15 dreturn\n" +
- // " 16 aload_0 [this]\n" +
- // " 17 invokevirtual X.bool() : boolean [17]\n" +
- // " 20 ifeq 31\n" +
- // " 23 new java.lang.NullPointerException [31]\n" +
- // " 26 dup\n" +
- // " 27 invokespecial java.lang.NullPointerException() [33]\n" +
- // " 30 athrow\n" +
- // " 31 dconst_1\n" +
- // " 32 dreturn\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 39]\n" +
- // " [pc: 7, line: 40]\n" +
- // " [pc: 14, line: 41]\n" +
- // " [pc: 16, line: 43]\n" +
- // " [pc: 23, line: 44]\n" +
- // " [pc: 31, line: 47]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 33] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #35 (I)V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void baz(int i);\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 32\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 tableswitch default: 29\n" +
- // " case 0: 28\n" +
- // " 28 return\n" +
- // " 29 goto 37\n" +
- // " 32 aload_0 [this]\n" +
- // " 33 invokevirtual X.bool() : boolean [17]\n" +
- // " 36 pop\n" +
- // " 37 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 50]\n" +
- // " [pc: 7, line: 51]\n" +
- // " [pc: 28, line: 52]\n" +
- // " [pc: 29, line: 53]\n" +
- // " [pc: 32, line: 56]\n" +
- // " [pc: 37, line: 58]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 38] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 38] local: i index: 1 type: int\n"
- // :
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 9\n" +
- // " 7 return\n" +
- // " 8 astore_1\n" +
- // " 9 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 8 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 8, line: 8]\n" +
- // " [pc: 9, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 8, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 9, same]\n" +
- // " \n" +
- // " // Method descriptor #23 ()I\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " int foo2();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 10\n" +
- // " 7 iconst_0\n" +
- // " 8 ireturn\n" +
- // " 9 astore_1\n" +
- // " 10 iconst_1\n" +
- // " 11 ireturn\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 9 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 13]\n" +
- // " [pc: 7, line: 14]\n" +
- // " [pc: 9, line: 16]\n" +
- // " [pc: 10, line: 18]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 12] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 7, same]\n" +
- // " [pc: 9, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 10, same]\n" +
- // " \n" +
- // " // Method descriptor #25 ()J\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " long foo3();\n" +
- // " 0 lconst_0\n" +
- // " 1 lreturn\n" +
- // " 2 astore_1\n" +
- // " 3 lconst_1\n" +
- // " 4 lreturn\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 23]\n" +
- // " [pc: 2, line: 25]\n" +
- // " [pc: 3, line: 27]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 0, same]\n" +
- // " [pc: 2, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 3, same]\n" +
- // " \n" +
- // " // Method descriptor #27 ()F\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " float foo4();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 goto 7\n" +
- // " 5 fconst_0\n" +
- // " 6 freturn\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifne 5\n" +
- // " 14 goto 18\n" +
- // " 17 astore_1\n" +
- // " 18 fconst_1\n" +
- // " 19 freturn\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 5] -> 17 when : java.lang.Exception\n" +
- // " [pc: 7, pc: 14] -> 17 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 31]\n" +
- // " [pc: 5, line: 32]\n" +
- // " [pc: 7, line: 31]\n" +
- // " [pc: 17, line: 34]\n" +
- // " [pc: 18, line: 36]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 20] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 14] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 5, append: {int}]\n" +
- // " [pc: 7, same]\n" +
- // " [pc: 17, full, stack: {java.lang.Exception}, locals: {X}]\n" +
- // " [pc: 18, same]\n" +
- // " \n" +
- // " // Method descriptor #31 ()D\n" +
- // " // Stack: 2, Locals: 1\n" +
- // " double bar();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 16\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifeq 31\n" +
- // " 14 dconst_0\n" +
- // " 15 dreturn\n" +
- // " 16 aload_0 [this]\n" +
- // " 17 invokevirtual X.bool() : boolean [17]\n" +
- // " 20 ifeq 31\n" +
- // " 23 new java.lang.NullPointerException [32]\n" +
- // " 26 dup\n" +
- // " 27 invokespecial java.lang.NullPointerException() [34]\n" +
- // " 30 athrow\n" +
- // " 31 dconst_1\n" +
- // " 32 dreturn\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 39]\n" +
- // " [pc: 7, line: 40]\n" +
- // " [pc: 14, line: 41]\n" +
- // " [pc: 16, line: 43]\n" +
- // " [pc: 23, line: 44]\n" +
- // " [pc: 31, line: 47]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 33] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 16, same]\n" +
- // " [pc: 31, same]\n" +
- // " \n" +
- // " // Method descriptor #36 (I)V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void baz(int i);\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 32\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 tableswitch default: 29\n" +
- // " case 0: 28\n" +
- // " 28 return\n" +
- // " 29 goto 37\n" +
- // " 32 aload_0 [this]\n" +
- // " 33 invokevirtual X.bool() : boolean [17]\n" +
- // " 36 pop\n" +
- // " 37 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 50]\n" +
- // " [pc: 7, line: 51]\n" +
- // " [pc: 28, line: 52]\n" +
- // " [pc: 29, line: 53]\n" +
- // " [pc: 32, line: 56]\n" +
- // " [pc: 37, line: 58]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 38] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 38] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 28, same]\n" +
- // " [pc: 29, same]\n" +
- // " [pc: 32, same]\n" +
- // " [pc: 37, same]\n";
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- //
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894 - variation
- // public void test049() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " boolean bool() { return true; }\n" +
- // " void foo() {\n" +
- // " try {\n" +
- // " if (bool()) {\n" +
- // " throw new NullPointerException();\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " }\n" +
- // " void foo2() {\n" +
- // " try {\n" +
- // " while (bool()) {\n" +
- // " throw new NullPointerException();\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " }\n" +
- // " void foo3() {\n" +
- // " try {\n" +
- // " do {\n" +
- // " if (true) throw new NullPointerException();\n" +
- // " } while (bool());\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " } \n" +
- // " void foo4() {\n" +
- // " try {\n" +
- // " for (int i = 0; bool(); i++) {\n" +
- // " throw new NullPointerException();\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " } \n" +
- // " void bar() {\n" +
- // " if (bool()) {\n" +
- // " if (bool())\n" +
- // " throw new NullPointerException();\n" +
- // " } else {\n" +
- // " if (bool()) {\n" +
- // " throw new NullPointerException();\n" +
- // " }\n" +
- // " }\n" +
- // " }\n" +
- // " void baz(int i) {\n" +
- // " if (bool()) {\n" +
- // " switch(i) {\n" +
- // " case 0 : throw new NullPointerException();\n" +
- // " default : break;\n" +
- // " }\n" +
- // " } else {\n" +
- // " bool();\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 16\n" +
- // " 7 new java.lang.NullPointerException [19]\n" +
- // " 10 dup\n" +
- // " 11 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 14 athrow\n" +
- // " 15 astore_1\n" +
- // " 16 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 15] -> 15 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 16, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo2();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 16\n" +
- // " 7 new java.lang.NullPointerException [19]\n" +
- // " 10 dup\n" +
- // " 11 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 14 athrow\n" +
- // " 15 astore_1\n" +
- // " 16 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 15] -> 15 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 13]\n" +
- // " [pc: 7, line: 14]\n" +
- // " [pc: 15, line: 16]\n" +
- // " [pc: 16, line: 18]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo3();\n" +
- // " 0 new java.lang.NullPointerException [19]\n" +
- // " 3 dup\n" +
- // " 4 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 7 athrow\n" +
- // " 8 astore_1\n" +
- // " 9 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 8] -> 8 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 22]\n" +
- // " [pc: 8, line: 24]\n" +
- // " [pc: 9, line: 26]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo4();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 goto 13\n" +
- // " 5 new java.lang.NullPointerException [19]\n" +
- // " 8 dup\n" +
- // " 9 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 12 athrow\n" +
- // " 13 aload_0 [this]\n" +
- // " 14 invokevirtual X.bool() : boolean [17]\n" +
- // " 17 ifne 5\n" +
- // " 20 goto 24\n" +
- // " 23 astore_1\n" +
- // " 24 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 20] -> 23 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 29]\n" +
- // " [pc: 5, line: 30]\n" +
- // " [pc: 13, line: 29]\n" +
- // " [pc: 23, line: 32]\n" +
- // " [pc: 24, line: 34]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 20] local: i index: 1 type: int\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 1\n" +
- // " void bar();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 22\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifeq 37\n" +
- // " 14 new java.lang.NullPointerException [19]\n" +
- // " 17 dup\n" +
- // " 18 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 21 athrow\n" +
- // " 22 aload_0 [this]\n" +
- // " 23 invokevirtual X.bool() : boolean [17]\n" +
- // " 26 ifeq 37\n" +
- // " 29 new java.lang.NullPointerException [19]\n" +
- // " 32 dup\n" +
- // " 33 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 36 athrow\n" +
- // " 37 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 36]\n" +
- // " [pc: 7, line: 37]\n" +
- // " [pc: 14, line: 38]\n" +
- // " [pc: 22, line: 40]\n" +
- // " [pc: 29, line: 41]\n" +
- // " [pc: 37, line: 44]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 38] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #31 (I)V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void baz(int i);\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 39\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 tableswitch default: 36\n" +
- // " case 0: 28\n" +
- // " 28 new java.lang.NullPointerException [19]\n" +
- // " 31 dup\n" +
- // " 32 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 35 athrow\n" +
- // " 36 goto 44\n" +
- // " 39 aload_0 [this]\n" +
- // " 40 invokevirtual X.bool() : boolean [17]\n" +
- // " 43 pop\n" +
- // " 44 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 46]\n" +
- // " [pc: 7, line: 47]\n" +
- // " [pc: 28, line: 48]\n" +
- // " [pc: 36, line: 49]\n" +
- // " [pc: 39, line: 52]\n" +
- // " [pc: 44, line: 54]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 45] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 45] local: i index: 1 type: int\n"
- // :
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 16\n" +
- // " 7 new java.lang.NullPointerException [19]\n" +
- // " 10 dup\n" +
- // " 11 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 14 athrow\n" +
- // " 15 astore_1\n" +
- // " 16 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 15] -> 15 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 15, line: 8]\n" +
- // " [pc: 16, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 15, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 16, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo2();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 16\n" +
- // " 7 new java.lang.NullPointerException [19]\n" +
- // " 10 dup\n" +
- // " 11 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 14 athrow\n" +
- // " 15 astore_1\n" +
- // " 16 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 15] -> 15 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 13]\n" +
- // " [pc: 7, line: 14]\n" +
- // " [pc: 15, line: 16]\n" +
- // " [pc: 16, line: 18]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 17] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 7, same]\n" +
- // " [pc: 15, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 16, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo3();\n" +
- // " 0 new java.lang.NullPointerException [19]\n" +
- // " 3 dup\n" +
- // " 4 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 7 athrow\n" +
- // " 8 astore_1\n" +
- // " 9 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 8] -> 8 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 22]\n" +
- // " [pc: 8, line: 24]\n" +
- // " [pc: 9, line: 26]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 10] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 0, same]\n" +
- // " [pc: 8, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 9, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void foo4();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 goto 13\n" +
- // " 5 new java.lang.NullPointerException [19]\n" +
- // " 8 dup\n" +
- // " 9 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 12 athrow\n" +
- // " 13 aload_0 [this]\n" +
- // " 14 invokevirtual X.bool() : boolean [17]\n" +
- // " 17 ifne 5\n" +
- // " 20 goto 24\n" +
- // " 23 astore_1\n" +
- // " 24 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 20] -> 23 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 29]\n" +
- // " [pc: 5, line: 30]\n" +
- // " [pc: 13, line: 29]\n" +
- // " [pc: 23, line: 32]\n" +
- // " [pc: 24, line: 34]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 20] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 5, append: {int}]\n" +
- // " [pc: 13, same]\n" +
- // " [pc: 23, full, stack: {java.lang.Exception}, locals: {X}]\n" +
- // " [pc: 24, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 2, Locals: 1\n" +
- // " void bar();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 22\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifeq 37\n" +
- // " 14 new java.lang.NullPointerException [19]\n" +
- // " 17 dup\n" +
- // " 18 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 21 athrow\n" +
- // " 22 aload_0 [this]\n" +
- // " 23 invokevirtual X.bool() : boolean [17]\n" +
- // " 26 ifeq 37\n" +
- // " 29 new java.lang.NullPointerException [19]\n" +
- // " 32 dup\n" +
- // " 33 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 36 athrow\n" +
- // " 37 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 36]\n" +
- // " [pc: 7, line: 37]\n" +
- // " [pc: 14, line: 38]\n" +
- // " [pc: 22, line: 40]\n" +
- // " [pc: 29, line: 41]\n" +
- // " [pc: 37, line: 44]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 38] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 22, same]\n" +
- // " [pc: 37, same]\n" +
- // " \n" +
- // " // Method descriptor #32 (I)V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " void baz(int i);\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 39\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 tableswitch default: 36\n" +
- // " case 0: 28\n" +
- // " 28 new java.lang.NullPointerException [19]\n" +
- // " 31 dup\n" +
- // " 32 invokespecial java.lang.NullPointerException() [21]\n" +
- // " 35 athrow\n" +
- // " 36 goto 44\n" +
- // " 39 aload_0 [this]\n" +
- // " 40 invokevirtual X.bool() : boolean [17]\n" +
- // " 43 pop\n" +
- // " 44 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 46]\n" +
- // " [pc: 7, line: 47]\n" +
- // " [pc: 28, line: 48]\n" +
- // " [pc: 36, line: 49]\n" +
- // " [pc: 39, line: 52]\n" +
- // " [pc: 44, line: 54]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 45] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 45] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 28, same]\n" +
- // " [pc: 36, same]\n" +
- // " [pc: 39, same]\n" +
- // " [pc: 44, same]\n";
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894 - variation
- // public void test050() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " boolean bool() { return true; }\n" +
- // " void foo() {\n" +
- // " check: try {\n" +
- // " if (bool()) {\n" +
- // " break check;\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " }\n" +
- // " void foo2() {\n" +
- // " check: try {\n" +
- // " while (bool()) {\n" +
- // " break check;\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " }\n" +
- // " void foo3() {\n" +
- // " check: try {\n" +
- // " do {\n" +
- // " if (true) break check;\n" +
- // " } while (bool());\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " } \n" +
- // " void foo4() {\n" +
- // " check: try {\n" +
- // " for (int i = 0; bool(); i++) {\n" +
- // " break check;\n" +
- // " }\n" +
- // " } catch (Exception e) {\n" +
- // " }\n" +
- // " }\n" +
- // " void bar() {\n" +
- // " check: if (bool()) {\n" +
- // " if (bool())\n" +
- // " break check;\n" +
- // " } else {\n" +
- // " if (bool()) {\n" +
- // " break check;\n" +
- // " }\n" +
- // " }\n" +
- // " }\n" +
- // " void baz(int i) {\n" +
- // " check: if (bool()) {\n" +
- // " switch(i) {\n" +
- // " case 0 : break check;\n" +
- // " default : break;\n" +
- // " }\n" +
- // " } else {\n" +
- // " bool();\n" +
- // " }\n" +
- // " }\n" +
- // "}\n",
- // },
- // "");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 11\n" +
- // " 7 goto 11\n" +
- // " 10 astore_1\n" +
- // " 11 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 10 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 11, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 12] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo2();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 11\n" +
- // " 7 goto 11\n" +
- // " 10 astore_1\n" +
- // " 11 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 10 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 13]\n" +
- // " [pc: 7, line: 14]\n" +
- // " [pc: 10, line: 16]\n" +
- // " [pc: 11, line: 18]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 12] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo3();\n" +
- // " 0 goto 4\n" +
- // " 3 astore_1\n" +
- // " 4 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 22]\n" +
- // " [pc: 3, line: 24]\n" +
- // " [pc: 4, line: 26]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo4();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 aload_0 [this]\n" +
- // " 3 invokevirtual X.bool() : boolean [17]\n" +
- // " 6 ifne 13\n" +
- // " 9 goto 13\n" +
- // " 12 astore_1\n" +
- // " 13 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 9] -> 12 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 29]\n" +
- // " [pc: 12, line: 32]\n" +
- // " [pc: 13, line: 34]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 9] local: i index: 1 type: int\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 1\n" +
- // " void bar();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 17\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifeq 24\n" +
- // " 14 goto 24\n" +
- // " 17 aload_0 [this]\n" +
- // " 18 invokevirtual X.bool() : boolean [17]\n" +
- // " 21 ifeq 24\n" +
- // " 24 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 36]\n" +
- // " [pc: 7, line: 37]\n" +
- // " [pc: 14, line: 38]\n" +
- // " [pc: 17, line: 40]\n" +
- // " [pc: 24, line: 44]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
- // " \n" +
- // " // Method descriptor #28 (I)V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void baz(int i);\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 34\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 tableswitch default: 31\n" +
- // " case 0: 28\n" +
- // " 28 goto 39\n" +
- // " 31 goto 39\n" +
- // " 34 aload_0 [this]\n" +
- // " 35 invokevirtual X.bool() : boolean [17]\n" +
- // " 38 pop\n" +
- // " 39 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 46]\n" +
- // " [pc: 7, line: 47]\n" +
- // " [pc: 28, line: 48]\n" +
- // " [pc: 31, line: 49]\n" +
- // " [pc: 34, line: 52]\n" +
- // " [pc: 39, line: 54]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 40] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 40] local: i index: 1 type: int\n"
- // :
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 11\n" +
- // " 7 goto 11\n" +
- // " 10 astore_1\n" +
- // " 11 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 10 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 10, line: 8]\n" +
- // " [pc: 11, line: 10]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 12] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 10, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 11, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo2();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 11\n" +
- // " 7 goto 11\n" +
- // " 10 astore_1\n" +
- // " 11 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 7] -> 10 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 13]\n" +
- // " [pc: 7, line: 14]\n" +
- // " [pc: 10, line: 16]\n" +
- // " [pc: 11, line: 18]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 12] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 7, same]\n" +
- // " [pc: 10, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 11, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo3();\n" +
- // " 0 goto 4\n" +
- // " 3 astore_1\n" +
- // " 4 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 22]\n" +
- // " [pc: 3, line: 24]\n" +
- // " [pc: 4, line: 26]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 0, same]\n" +
- // " [pc: 3, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 4, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo4();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 aload_0 [this]\n" +
- // " 3 invokevirtual X.bool() : boolean [17]\n" +
- // " 6 ifne 13\n" +
- // " 9 goto 13\n" +
- // " 12 astore_1\n" +
- // " 13 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 9] -> 12 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 29]\n" +
- // " [pc: 12, line: 32]\n" +
- // " [pc: 13, line: 34]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 14] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 9] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 3\n" +
- // " [pc: 2, append: {int}]\n" +
- // " [pc: 12, full, stack: {java.lang.Exception}, locals: {X}]\n" +
- // " [pc: 13, same]\n" +
- // " \n" +
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 1, Locals: 1\n" +
- // " void bar();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 17\n" +
- // " 7 aload_0 [this]\n" +
- // " 8 invokevirtual X.bool() : boolean [17]\n" +
- // " 11 ifeq 24\n" +
- // " 14 goto 24\n" +
- // " 17 aload_0 [this]\n" +
- // " 18 invokevirtual X.bool() : boolean [17]\n" +
- // " 21 ifeq 24\n" +
- // " 24 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 36]\n" +
- // " [pc: 7, line: 37]\n" +
- // " [pc: 14, line: 38]\n" +
- // " [pc: 17, line: 40]\n" +
- // " [pc: 24, line: 44]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 25] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 2\n" +
- // " [pc: 17, same]\n" +
- // " [pc: 24, same]\n" +
- // " \n" +
- // " // Method descriptor #29 (I)V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void baz(int i);\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 invokevirtual X.bool() : boolean [17]\n" +
- // " 4 ifeq 34\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 tableswitch default: 31\n" +
- // " case 0: 28\n" +
- // " 28 goto 39\n" +
- // " 31 goto 39\n" +
- // " 34 aload_0 [this]\n" +
- // " 35 invokevirtual X.bool() : boolean [17]\n" +
- // " 38 pop\n" +
- // " 39 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 46]\n" +
- // " [pc: 7, line: 47]\n" +
- // " [pc: 28, line: 48]\n" +
- // " [pc: 31, line: 49]\n" +
- // " [pc: 34, line: 52]\n" +
- // " [pc: 39, line: 54]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 40] local: this index: 0 type: X\n" +
- // " [pc: 0, pc: 40] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 28, same]\n" +
- // " [pc: 31, same]\n" +
- // " [pc: 34, same]\n" +
- // " [pc: 39, same]\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894 - variation
- // public void test051() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public static void main(String argv[]) {\n" +
- // " System.out.println(\"[count=\" + count() + \"]\");\n" +
- // " }\n" +
- // " static int count() {\n" +
- // " int count = 0;\n" +
- // " try {\n" +
- // " for (int i = 0;;) {\n" +
- // " count++;\n" +
- // " if (i++ > 10) \n" +
- // " break; \n" +
- // " }\n" +
- // " } catch(Exception e) {\n" +
- // " }\n" +
- // " return count;\n" +
- // " }\n" +
- // "}\n",
- // },
- // "[count=12]");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #32 ()I\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " static int count();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_0 [count]\n" +
- // " 2 iconst_0\n" +
- // " 3 istore_1 [i]\n" +
- // " 4 iinc 0 1 [count]\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 iinc 1 1 [i]\n" +
- // " 11 bipush 10\n" +
- // " 13 if_icmple 4\n" +
- // " 16 goto 20\n" +
- // " 19 astore_1\n" +
- // " 20 iload_0 [count]\n" +
- // " 21 ireturn\n" +
- // " Exception Table:\n" +
- // " [pc: 2, pc: 16] -> 19 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 6]\n" +
- // " [pc: 2, line: 8]\n" +
- // " [pc: 4, line: 9]\n" +
- // " [pc: 7, line: 10]\n" +
- // " [pc: 16, line: 11]\n" +
- // " [pc: 19, line: 13]\n" +
- // " [pc: 20, line: 15]\n" +
- // " Local variable table:\n" +
- // " [pc: 2, pc: 22] local: count index: 0 type: int\n" +
- // " [pc: 4, pc: 16] local: i index: 1 type: int\n"
- // :
- // " // Method descriptor #32 ()I\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " static int count();\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_0 [count]\n" +
- // " 2 iconst_0\n" +
- // " 3 istore_1 [i]\n" +
- // " 4 iinc 0 1 [count]\n" +
- // " 7 iload_1 [i]\n" +
- // " 8 iinc 1 1 [i]\n" +
- // " 11 bipush 10\n" +
- // " 13 if_icmple 4\n" +
- // " 16 goto 20\n" +
- // " 19 astore_1\n" +
- // " 20 iload_0 [count]\n" +
- // " 21 ireturn\n" +
- // " Exception Table:\n" +
- // " [pc: 2, pc: 16] -> 19 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 6]\n" +
- // " [pc: 2, line: 8]\n" +
- // " [pc: 4, line: 9]\n" +
- // " [pc: 7, line: 10]\n" +
- // " [pc: 16, line: 11]\n" +
- // " [pc: 19, line: 13]\n" +
- // " [pc: 20, line: 15]\n" +
- // " Local variable table:\n" +
- // " [pc: 2, pc: 22] local: count index: 0 type: int\n" +
- // " [pc: 4, pc: 16] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 4, append: {int, int}]\n" +
- // " [pc: 16, chop 1 local(s)]\n" +
- // " [pc: 19, same_locals_1_stack_item, stack: {java.lang.Exception}]\n"
- // +
- // " [pc: 20, same]\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894 - variation
- // public void test052() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public static void main(String argv[]) {\n" +
- // " try {\n" +
- // " for (int i = 0; i < 0; i++)\n" +
- // " do ; while (true);\n" +
- // " } catch(Exception e) {\n" +
- // " }\n" +
- // " } \n" +
- // "}\n",
- // },
- // "");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " public static void main(java.lang.String[] argv);\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 goto 8\n" +
- // " 5 goto 5\n" +
- // " 8 iload_1 [i]\n" +
- // " 9 iflt 5\n" +
- // " 12 goto 16\n" +
- // " 15 astore_1\n" +
- // " 16 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 12] -> 15 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 5, line: 5]\n" +
- // " [pc: 8, line: 4]\n" +
- // " [pc: 15, line: 6]\n" +
- // " [pc: 16, line: 8]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 17] local: argv index: 0 type: java.lang.String[]\n"
- // +
- // " [pc: 2, pc: 12] local: i index: 1 type: int\n"
- // :
- // " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " public static void main(java.lang.String[] argv);\n" +
- // " 0 iconst_0\n" +
- // " 1 istore_1 [i]\n" +
- // " 2 goto 8\n" +
- // " 5 goto 5\n" +
- // " 8 iload_1 [i]\n" +
- // " 9 iflt 5\n" +
- // " 12 goto 16\n" +
- // " 15 astore_1\n" +
- // " 16 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 12] -> 15 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " [pc: 5, line: 5]\n" +
- // " [pc: 8, line: 4]\n" +
- // " [pc: 15, line: 6]\n" +
- // " [pc: 16, line: 8]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 17] local: argv index: 0 type: java.lang.String[]\n"
- // +
- // " [pc: 2, pc: 12] local: i index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 5, append: {int}]\n" +
- // " [pc: 8, same]\n" +
- // " [pc: 15, full, stack: {java.lang.Exception}, locals: {java.lang.String[]}]\n"
- // +
- // " [pc: 16, same]\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894 - variation
- // public void test053() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " public static void main(String[] args) {\n" +
- // " try {\n" +
- // " final int val;\n" +
- // " for (val = 7; val > 0;) break;\n" +
- // " System.out.println(val);\n" +
- // " } catch(Exception e) {\n" +
- // " }\n" +
- // " } \n" +
- // "}\n",
- // },
- // "7");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " public static void main(java.lang.String[] args);\n" +
- // " 0 bipush 7\n" +
- // " 2 istore_1 [val]\n" +
- // " 3 iload_1 [val]\n" +
- // " 4 ifgt 7\n" +
- // " 7 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 10 iload_1 [val]\n" +
- // " 11 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
- // " 14 goto 18\n" +
- // " 17 astore_1\n" +
- // " 18 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 14] -> 17 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 17, line: 7]\n" +
- // " [pc: 18, line: 9]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 19] local: args index: 0 type: java.lang.String[]\n"
- // +
- // " [pc: 3, pc: 17] local: val index: 1 type: int\n"
- // :
- // " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
- // " // Stack: 2, Locals: 2\n" +
- // " public static void main(java.lang.String[] args);\n" +
- // " 0 bipush 7\n" +
- // " 2 istore_1 [val]\n" +
- // " 3 iload_1 [val]\n" +
- // " 4 ifgt 7\n" +
- // " 7 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
- // " 10 iload_1 [val]\n" +
- // " 11 invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
- // " 14 goto 18\n" +
- // " 17 astore_1\n" +
- // " 18 return\n" +
- // " Exception Table:\n" +
- // " [pc: 0, pc: 14] -> 17 when : java.lang.Exception\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 5]\n" +
- // " [pc: 7, line: 6]\n" +
- // " [pc: 17, line: 7]\n" +
- // " [pc: 18, line: 9]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 19] local: args index: 0 type: java.lang.String[]\n"
- // +
- // " [pc: 3, pc: 17] local: val index: 1 type: int\n" +
- // " Stack map table: number of frames 4\n" +
- // " [pc: 3, append: {int}]\n" +
- // " [pc: 7, same]\n" +
- // " [pc: 17, full, stack: {java.lang.Exception}, locals: {java.lang.String[]}]\n"
- // +
- // " [pc: 18, same]\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894 - variation
- // public void test054() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // " X parent;\n" +
- // " int kind;\n" +
- // " static boolean F = false;\n" +
- // " public static void main(String[] args) {\n" +
- // " X x = new X();\n" +
- // " x.kind = 2; \n" +
- // " try {\n" +
- // " x.foo();\n" +
- // " } catch(NullPointerException e) { \n" +
- // " System.out.println(\"SUCCESS\");\n" +
- // " return;\n" +
- // " }\n" +
- // " System.out.println(\"FAILED\"); \n" +
- // " }\n" +
- // " void foo() {\n" +
- // " X x = this;\n" +
- // " done : while (true) {\n" +
- // " switch (x.kind) {\n" +
- // " case 2 :\n" +
- // " if (F) {\n" +
- // " return;\n" +
- // " }\n" +
- // " break;\n" +
- // " case 3 :\n" +
- // " break done;\n" +
- // " }\n" +
- // " x = x.parent; // should throw npe\n" +
- // " }\n" +
- // " } \n" +
- // "}\n",
- // },
- // "SUCCESS");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #12 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 astore_1 [x]\n" +
- // " 2 aload_1 [x]\n" +
- // " 3 getfield X.kind : int [25]\n" +
- // " 6 tableswitch default: 38\n" +
- // " case 2: 28\n" +
- // " case 3: 35\n" +
- // " 28 getstatic X.F : boolean [14]\n" +
- // " 31 ifeq 38\n" +
- // " 34 return\n" +
- // " 35 goto 46\n" +
- // " 38 aload_1 [x]\n" +
- // " 39 getfield X.parent : X [53]\n" +
- // " 42 astore_1 [x]\n" +
- // " 43 goto 2\n" +
- // " 46 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 17]\n" +
- // " [pc: 2, line: 19]\n" +
- // " [pc: 28, line: 21]\n" +
- // " [pc: 34, line: 22]\n" +
- // " [pc: 35, line: 26]\n" +
- // " [pc: 38, line: 27]\n" +
- // " [pc: 39, line: 28]\n" +
- // " [pc: 43, line: 18]\n" +
- // " [pc: 46, line: 30]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 47] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 47] local: x index: 1 type: X\n"
- // :
- // " // Method descriptor #12 ()V\n" +
- // " // Stack: 1, Locals: 2\n" +
- // " void foo();\n" +
- // " 0 aload_0 [this]\n" +
- // " 1 astore_1 [x]\n" +
- // " 2 aload_1 [x]\n" +
- // " 3 getfield X.kind : int [25]\n" +
- // " 6 tableswitch default: 38\n" +
- // " case 2: 28\n" +
- // " case 3: 35\n" +
- // " 28 getstatic X.F : boolean [14]\n" +
- // " 31 ifeq 38\n" +
- // " 34 return\n" +
- // " 35 goto 46\n" +
- // " 38 aload_1 [x]\n" +
- // " 39 getfield X.parent : X [55]\n" +
- // " 42 astore_1 [x]\n" +
- // " 43 goto 2\n" +
- // " 46 return\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 17]\n" +
- // " [pc: 2, line: 19]\n" +
- // " [pc: 28, line: 21]\n" +
- // " [pc: 34, line: 22]\n" +
- // " [pc: 35, line: 26]\n" +
- // " [pc: 38, line: 27]\n" +
- // " [pc: 39, line: 28]\n" +
- // " [pc: 43, line: 18]\n" +
- // " [pc: 46, line: 30]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 47] local: this index: 0 type: X\n" +
- // " [pc: 2, pc: 47] local: x index: 1 type: X\n" +
- // " Stack map table: number of frames 5\n" +
- // " [pc: 2, append: {X}]\n" +
- // " [pc: 28, same]\n" +
- // " [pc: 35, same]\n" +
- // " [pc: 38, same]\n" +
- // " [pc: 46, same]\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114894 - variation
- // public void test055() {
- // this.runConformTest(
- // new String[] {
- // "X.java",
- // "public class X {\n" +
- // "\n" +
- // "void foo5() {\n" +
- // " L : for (;;) {\n" +
- // " continue L; // good\n" +
- // " }\n" +
- // "}\n" +
- // "}\n",
- // },
- // "");
- //
- // String expectedOutput = new
- // CompilerOptions(this.getCompilerOptions()).complianceLevel <
- // ClassFileConstants.JDK1_6
- // ? " // Method descriptor #6 ()V\n" +
- // " // Stack: 0, Locals: 1\n" +
- // " void foo5();\n" +
- // " 0 goto 0\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 3] local: this index: 0 type: X\n"
- // :
- // " // Method descriptor #6 ()V\n" +
- // " // Stack: 0, Locals: 1\n" +
- // " void foo5();\n" +
- // " 0 goto 0\n" +
- // " Line numbers:\n" +
- // " [pc: 0, line: 4]\n" +
- // " Local variable table:\n" +
- // " [pc: 0, pc: 3] local: this index: 0 type: X\n" +
- // " Stack map table: number of frames 1\n" +
- // " [pc: 0, same]\n";
- //
- // try {
- // File f = new File(OUTPUT_DIR + File.separator + "X.class");
- // byte[] classFileBytes =
- // org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
- // ClassFileBytesDisassembler disassembler =
- // ToolFactory.createDefaultClassFileBytesDisassembler();
- // String result = disassembler.disassemble(classFileBytes, "\n",
- // ClassFileBytesDisassembler.DETAILED);
- // int index = result.indexOf(expectedOutput);
- // if (index == -1 || expectedOutput.length() == 0) {
- // System.out.println(Util.displayString(result, 3));
- // }
- // if (index == -1) {
- // assertEquals("Wrong contents", expectedOutput, result);
- // }
- // } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
- // assertTrue(false);
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
- public void _test056() {
- this
- .runNegativeTest(
- new String[] {
- "p/BytecodeA.java",
- "package p;\n"
- + "class BytecodeA {\n"
- + " \n"
- + "int foo() { // good\n"
- + " boolean b = true;\n"
- + " if (b) {\n"
- + " if (true)\n"
- + " return 0;\n"
- + " } else {\n"
- + " if (true)\n"
- + " return 1;\n"
- + " }\n"
- + " return 5;\n"
- + "}\n"
- + "int foo10() {\n"
- + " try {\n"
- + " //if (true)\n"
- + " return 0;\n"
- + " } catch (Exception e) {\n"
- + " if (true)\n"
- + " return 1;\n"
- + " } finally {\n"
- + " if (true)\n"
- + " return 2;\n"
- + " };\n"
- + " return 1;\n"
- + "} \n"
- + "int foo11() {\n"
- + " synchronized (this) {\n"
- + " if (true)\n"
- + " return 1;\n"
- + " };\n"
- + " return 2;\n"
- + "} \n"
- + "int foo12() {\n"
- + " for (;;)\n"
- + " return 1;\n"
- + "}\n"
- + "int foo13() {\n"
- + " for (;;)\n"
- + " if (true)\n"
- + " return 1;\n"
- + "}\n"
- + "int foo14() {\n"
- + " for (int i = 1; i < 10; i++)\n"
- + " if (true)\n"
- + " return 1;\n"
- + " return 2;\n"
- + "} \n"
- + "int foo15() {\n"
- + " for (int i = 1; i < 10; i++)\n"
- + " return 1;\n"
- + " return 2;\n"
- + "}\n"
- + "int foo16() {\n"
- + " final int i;\n"
- + " while (true) {\n"
- + " i = 1;\n"
- + " if (true)\n"
- + " break;\n"
- + " };\n"
- + " return 1;\n"
- + "} \n"
- + "int foo17() {\n"
- + " final int i;\n"
- + " for (;;) {\n"
- + " i = 1;\n"
- + " if (true)\n"
- + " break;\n"
- + " };\n"
- + " return 1;\n"
- + "} \n"
- + "void foo2() {\n"
- + " L1 :; // good\n"
- + "}\n"
- + "void foo20() {\n"
- + " if (true)\n"
- + " return;\n"
- + "} \n"
- + "void foo3() {\n"
- + " L : if (true) {\n"
- + " for (;;) {\n"
- + " continue L; // bad\n"
- + " }\n"
- + " }\n"
- + "} \n"
- + "void foo4() {\n"
- + " L : if (true) {\n"
- + " try {\n"
- + " for (;;) {\n"
- + " continue L; // bad\n"
- + " }\n"
- + " } finally {\n"
- + " return;\n"
- + " }\n"
- + " } \n"
- + "}\n"
- + "void foo5() {\n"
- + " L : for (;;) {\n"
- + " continue L; // good\n"
- + " }\n"
- + "}\n"
- + "void foo5bis() {\n"
- + " L : K : for (;;) {\n"
- + " continue L; // good\n"
- + " }\n"
- + "}\n"
- + "void foo6(){\n"
- + " int i;\n"
- + " boolean a[] = new boolean[5];\n"
- + " a[i=1] = i > 0; // good\n"
- + "} \n"
- + "void foo7(){\n"
- + " Object x[];\n"
- + " x [1] = (x = new Object[5]); // bad\n"
- + "} \n"
- + "void foo8() {\n"
- + " try {\n"
- + " } catch (java.io.IOException e) {\n"
- + " foo(); // unreachable\n"
- + " }\n"
- + "}\n"
- + "void foo9() {\n"
- + " try {\n"
- + " } catch (NullPointerException e) {\n"
- + " foo(); // ok\n"
- + " }\n"
- + "}\n"
- + " public static void main(String args[]) {\n"
- + " BytecodeA a = new BytecodeA();\n"
- + " a.foo10();\n" + " }\n"
- + "}", },
- "----------\n"
- + "1. WARNING in p\\BytecodeA.java (at line 74)\n"
- + " L1 :; // good\n"
- + " ^^\n"
- + "The label L1 is never explicitly referenced\n"
- + "----------\n"
- + "2. ERROR in p\\BytecodeA.java (at line 83)\n"
- + " continue L; // bad\n"
- + " ^^^^^^^^^^\n"
- + "continue cannot be used outside of a loop\n"
- + "----------\n"
- + "3. ERROR in p\\BytecodeA.java (at line 91)\n"
- + " continue L; // bad\n"
- + " ^^^^^^^^^^\n"
- + "continue cannot be used outside of a loop\n"
- + "----------\n"
- + "4. WARNING in p\\BytecodeA.java (at line 93)\n"
- + " } finally {\n"
- + " return;\n"
- + " }\n"
- + " ^^^^^^^^^^^^^^^^^^^^^\n"
- + "finally block does not complete normally\n"
- + "----------\n"
- + "5. WARNING in p\\BytecodeA.java (at line 104)\n"
- + " L : K : for (;;) {\n"
- + " ^\n"
- + "The label K is never explicitly referenced\n"
- + "----------\n"
- + "6. ERROR in p\\BytecodeA.java (at line 105)\n"
- + " continue L; // good\n"
- + " ^^^^^^^^^^\n"
- + "continue cannot be used outside of a loop\n"
- + "----------\n"
- + "7. ERROR in p\\BytecodeA.java (at line 115)\n"
- + " x [1] = (x = new Object[5]); // bad\n"
- + " ^\n"
- + "The local variable x may not have been initialized\n"
- + "----------\n"
- + "8. ERROR in p\\BytecodeA.java (at line 119)\n"
- + " } catch (java.io.IOException e) {\n"
- + " ^^^^^^^^^^^^^^^^^^^\n"
- + "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n"
- + "----------\n");
- }
-
- // was Compliance_1_x#test007
- public void test057() {
- String[] sources = new String[] {
- "p1/Test.java",
- "package p1; \n" + "public class Test { \n"
- + " public static void main(String[] arguments) { \n"
- + " try { \n" + " throw null; \n"
- + " } catch(NullPointerException e){ \n"
- + " System.out.println(\"SUCCESS\"); \n" + " } \n"
- + " } \n" + "} \n" };
- if (this.complianceLevel.equals(COMPLIANCE_1_3)) {
- runNegativeTest(sources, "----------\n"
- + "1. ERROR in p1\\Test.java (at line 5)\n"
- + " throw null; \n" + " ^^^^\n"
- + "Cannot throw null as an exception\n" + "----------\n");
- } else {
- runConformTest(sources, "SUCCESS");
- }
- }
-
- public static Class testClass() {
- return TryStatementTest.class;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/UtilTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/UtilTest.java
deleted file mode 100644
index 0b58ab1..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/UtilTest.java
+++ /dev/null
@@ -1,605 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.io.File;
-
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-
-public class UtilTest extends AbstractRegressionTest {
-
-StringBuffer camelCaseErrors;
-
-public UtilTest(String name) {
- super(name);
-}
-
-/**
- * Assert that a pattern and a name matches or not.
- * If result is invalid then store warning in buffer and display it.
- */
-void assertCamelCase(String pattern, String name, boolean match) {
- boolean camelCase = CharOperation.camelCaseMatch(pattern==null?null:pattern.toCharArray(), name==null?null:name.toCharArray());
- if (match != camelCase) {
- StringBuffer line = new StringBuffer("'");
- line.append(name);
- line.append("' SHOULD");
- if (!match) line.append(" NOT");
- line.append(" match pattern '");
- line.append(pattern);
- line.append("', but it DOES");
- if (!camelCase) line.append(" NOT");
- if (this.camelCaseErrors.length() == 0) {
- System.out.println("Invalid results in test "+getName()+":");
- }
- System.out.println(" - "+line);
- this.camelCaseErrors.append('\n');
- this.camelCaseErrors.append(line);
- }
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- this.camelCaseErrors = new StringBuffer();
-}
-
-public boolean checkPathMatch(char[] pattern, char[] path, boolean isCaseSensitive) {
-
- CharOperation.replace(pattern, '/', File.separatorChar);
- CharOperation.replace(pattern, '\\', File.separatorChar);
- CharOperation.replace(path, '/', File.separatorChar);
- CharOperation.replace(path, '\\', File.separatorChar);
-
- boolean result = CharOperation.pathMatch(pattern, path, isCaseSensitive, File.separatorChar);
-
-// boolean antResult = SelectorUtils.matchPath(new String(pattern), new String(path), isCaseSensitive);
-// if (antResult != result) {
-// new AssertionFailedError("WARNING : Ant expectation for patchMatch(\""+new String(pattern)+"\", \""+new String(path)+"\", ...) is: "+antResult).printStackTrace();
-// }
-
- return result;
-}
-
-public void test01() {
-
- assertTrue("Pattern matching failure",
- !CharOperation.match("X".toCharArray(), "Xyz".toCharArray(), true));
-}
-public void test02() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("X*".toCharArray(), "Xyz".toCharArray(), true));
-}
-public void test03() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("X".toCharArray(), "X".toCharArray(), true));
-}
-public void test04() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("X*X".toCharArray(), "XYX".toCharArray(), true));
-}
-public void test05() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("XY*".toCharArray(), "XYZ".toCharArray(), true));
-}
-public void test06() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*XY*".toCharArray(), "XYZ".toCharArray(), true));
-}
-public void test07() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*".toCharArray(), "XYZ".toCharArray(), true));
-}
-public void test08() {
-
- assertTrue("Pattern matching failure",
- !CharOperation.match("a*".toCharArray(), "XYZ".toCharArray(), true));
-}
-public void test09() {
-
- assertTrue("Pattern matching failure",
- !CharOperation.match("abc".toCharArray(), "XYZ".toCharArray(), true));
-}
-public void test10() {
-
- assertTrue("Pattern matching failure",
- !CharOperation.match("ab*c".toCharArray(), "abX".toCharArray(), true));
-}
-public void test11() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("a*b*c".toCharArray(), "aXXbYYc".toCharArray(), true));
-}
-public void test12() {
-
- assertTrue("Pattern matching failure",
- !CharOperation.match("*a*bc".toCharArray(), "aXXbYYc".toCharArray(), true));
-}
-public void test13() {
-
- assertTrue("Pattern matching failure",
- !CharOperation.match("*foo*bar".toCharArray(), "".toCharArray(), true));
-}
-public void test14() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*foo*bar".toCharArray(), "ffoobabar".toCharArray(), true));
-}
-public void test15() {
-
- assertTrue("Pattern matching failure",
- !CharOperation.match("*fol*bar".toCharArray(), "ffoobabar".toCharArray(), true));
-}
-public void test16() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*X*Y*".toCharArray(), "XY".toCharArray(), true));
-}
-public void test17() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*X*Y*".toCharArray(), "XYZ".toCharArray(), true));
-}
-public void test18() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("main(*)".toCharArray(), "main(argv)".toCharArray(), true));
-}
-public void test19() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*rr*".toCharArray(), "ARRAY".toCharArray(), false));
-}
-
-public void test20() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("hello*World".toCharArray(), "helloWorld".toCharArray(), true));
-}
-
-public void test21() {
- assertEquals("Trim failure", "hello", new String(CharOperation.trim("hello".toCharArray())));
-}
-public void test22() {
- assertEquals("Trim failure", "hello", new String(CharOperation.trim(" hello".toCharArray())));
-}
-public void test23() {
- assertEquals("Trim failure", "hello", new String(CharOperation.trim(" hello ".toCharArray())));
-}
-public void test24() {
- assertEquals("Trim failure", "hello", new String(CharOperation.trim("hello ".toCharArray())));
-}
-public void test25() {
- assertEquals("Trim failure", "", new String(CharOperation.trim(" ".toCharArray())));
-}
-public void test26() {
- assertEquals("Trim failure", "hello world", new String(CharOperation.trim(" hello world ".toCharArray())));
-}
-public void test27() {
- char [][] tokens = CharOperation.splitAndTrimOn(','," hello,world".toCharArray());
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < tokens.length; i++){
- buffer.append('[').append(tokens[i]).append(']');
- }
- assertEquals("SplitTrim failure", "[hello][world]", buffer.toString());
-}
-public void test28() {
- char [][] tokens = CharOperation.splitAndTrimOn(','," hello , world".toCharArray());
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < tokens.length; i++){
- buffer.append('[').append(tokens[i]).append(']');
- }
- assertEquals("SplitTrim failure", "[hello][world]", buffer.toString());
-}
-public void test29() {
- char [][] tokens = CharOperation.splitAndTrimOn(','," hello, world ".toCharArray());
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < tokens.length; i++){
- buffer.append('[').append(tokens[i]).append(']');
- }
- assertEquals("SplitTrim failure", "[hello][world]", buffer.toString());
-}
-public void test30() {
- char [][] tokens = CharOperation.splitAndTrimOn(','," hello, world ,zork/, aaa bbb".toCharArray());
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < tokens.length; i++){
- buffer.append('[').append(tokens[i]).append(']');
- }
- assertEquals("SplitTrim failure", "[hello][world][zork/][aaa bbb]", buffer.toString());
-}
-public void test31() {
- char [][] tokens = CharOperation.splitAndTrimOn(','," , ".toCharArray());
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < tokens.length; i++){
- buffer.append('[').append(tokens[i]).append(']');
- }
- assertEquals("SplitTrim failure", "[][]", buffer.toString());
-}
-public void test32() {
- char [][] tokens = CharOperation.splitAndTrimOn(','," ".toCharArray());
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < tokens.length; i++){
- buffer.append('[').append(tokens[i]).append(']');
- }
- assertEquals("SplitTrim failure", "[]", buffer.toString());
-}
-public void test33() {
- char [][] tokens = CharOperation.splitAndTrimOn(','," , hello ".toCharArray());
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < tokens.length; i++){
- buffer.append('[').append(tokens[i]).append(']');
- }
- assertEquals("SplitTrim failure", "[][hello]", buffer.toString());
-}
-
-public void test34() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("hello/*/World".toCharArray(), "hello/zzz/World".toCharArray(), true));
-}
-
-public void test35() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("hello/**/World".toCharArray(), "hello/x/y/z/World".toCharArray(), true));
-}
-
-public void test36() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("hello/**/World/**/*.java".toCharArray(), "hello/x/y/z/World/X.java".toCharArray(), true));
-}
-
-public void test37() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("**/World/**/*.java".toCharArray(), "hello/x/y/z/World/X.java".toCharArray(), true));
-}
-
-public void test38() {
-
- assertTrue("Path pattern matching failure",
- !checkPathMatch("/*.java".toCharArray(), "/hello/x/y/z/World/X.java".toCharArray(), true));
-}
-
-/*
- * From Ant pattern set examples
- */
-public void test39() {
-
- assertTrue("Path pattern matching failure-1",
- checkPathMatch("**/CVS/*".toCharArray(), "CVS/Repository".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- checkPathMatch("**/CVS/*".toCharArray(), "org/apache/CVS/Entries".toCharArray(), true));
- assertTrue("Path pattern matching failure-3",
- checkPathMatch("**/CVS/*".toCharArray(), "org/apache/jakarta/tools/ant/CVS/Entries".toCharArray(), true));
- assertTrue("Path pattern matching failure-4",
- !checkPathMatch("**/CVS/*".toCharArray(), "org/apache/CVS/foo/bar/Entries".toCharArray(), true));
-}
-
-/*
- * From Ant pattern set examples
- */
-public void test40() {
-
- assertTrue("Path pattern matching failure-1",
- checkPathMatch("org/apache/jakarta/**".toCharArray(), "org/apache/jakarta/tools/ant/docs/index.html".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- checkPathMatch("org/apache/jakarta/**".toCharArray(), "org/apache/jakarta/test.xml".toCharArray(), true));
- assertTrue("Path pattern matching failure-3",
- !checkPathMatch("org/apache/jakarta/**".toCharArray(), "org/apache/xyz.java".toCharArray(), true));
-}
-
-/*
- * From Ant pattern set examples
- */
-public void test41() {
-
- assertTrue("Path pattern matching failure-1",
- checkPathMatch("org/apache/**/CVS/*".toCharArray(), "org/apache/CVS/Entries".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- checkPathMatch("org/apache/**/CVS/*".toCharArray(), "org/apache/jakarta/tools/ant/CVS/Entries".toCharArray(), true));
- assertTrue("Path pattern matching failure-3",
- !checkPathMatch("org/apache/**/CVS/*".toCharArray(), "org/apache/CVS/foo/bar/Entries".toCharArray(), true));
-}
-
-/*
- * From Ant pattern set examples
- */
-public void test42() {
-
- assertTrue("Path pattern matching failure-1",
- checkPathMatch("**/test/**".toCharArray(), "org/apache/test/CVS/Entries".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- checkPathMatch("**/test/**".toCharArray(), "test".toCharArray(), true));
- assertTrue("Path pattern matching failure-3",
- checkPathMatch("**/test/**".toCharArray(), "a/test".toCharArray(), true));
- assertTrue("Path pattern matching failure-4",
- checkPathMatch("**/test/**".toCharArray(), "test/a.js".toCharArray(), true));
- assertTrue("Path pattern matching failure-5",
- !checkPathMatch("**/test/**".toCharArray(), "org/apache/test.js".toCharArray(), true));
-}
-/*
- * Corner cases
- */
-public void test43() {
-
- assertTrue("Path pattern matching failure-1",
- checkPathMatch("/test/".toCharArray(), "/test/CVS/Entries".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- checkPathMatch("/test/**".toCharArray(), "/test/CVS/Entries".toCharArray(), true));
-}
-/*
- * Corner cases
- */
-public void test44() {
-
- assertTrue("Path pattern matching failure-1",
- !checkPathMatch("test".toCharArray(), "test/CVS/Entries".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- !checkPathMatch("**/test".toCharArray(), "test/CVS/Entries".toCharArray(), true));
-}
-/*
- * Corner cases
- */
-public void test45() {
-
- assertTrue("Path pattern matching failure-1",
- checkPathMatch("/test/test1/".toCharArray(), "/test/test1/test/test1".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- !checkPathMatch("/test/test1".toCharArray(), "/test/test1/test/test1".toCharArray(), true));
-}
-public void test46() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("hello/**/World".toCharArray(), "hello/World".toCharArray(), true));
-}
-/*
- * Regression test for 28316 Missing references to constructor
- */
-public void test47() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*x".toCharArray(), "x.X".toCharArray(), false));
-}
-public void test48() {
-
- assertTrue("Pattern matching failure",
- CharOperation.match("*a*".toCharArray(), "abcd".toCharArray(), false));
-}
-public void test49() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("**/hello".toCharArray(), "hello/hello".toCharArray(), true));
-}
-public void test50() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("**/hello/**".toCharArray(), "hello/hello".toCharArray(), true));
-}
-public void test51() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("**/hello/".toCharArray(), "hello/hello".toCharArray(), true));
-}
-public void test52() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("hello/".toCharArray(), "hello/hello".toCharArray(), true));
-}
-public void test53() {
-
- assertTrue("Path pattern matching failure",
- !checkPathMatch("/".toCharArray(), "hello/hello".toCharArray(), true));
-}
-public void test54() {
-
- assertTrue("Path pattern matching failure-1",
- !checkPathMatch("x/".toCharArray(), "hello/x".toCharArray(), true)); // 29761
-
- assertTrue("Path pattern matching failure-2",
- checkPathMatch("**/x/".toCharArray(), "hello/x".toCharArray(), true));
-
- assertTrue("Path pattern matching failure-3",
- !checkPathMatch("/x/".toCharArray(), "hello/x".toCharArray(), true));
-}
-public void test56() {
-
- assertTrue("Path pattern matching failure",
- !checkPathMatch("/**".toCharArray(), "hello/hello".toCharArray(), true));
-}
-public void test57() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("/".toCharArray(), "/hello/hello".toCharArray(), true));
-}
-public void test58() {
-
- assertTrue("Path pattern matching failure",
- checkPathMatch("/**".toCharArray(), "/hello/hello".toCharArray(), true));
-}
-public void test59() {
-
- assertTrue("Path pattern matching failure",
- !checkPathMatch("**".toCharArray(), "/hello/hello".toCharArray(), true));
-}
-public void test60() {
-
- assertTrue("Path pattern matching failure-1",
- !checkPathMatch("/P/src".toCharArray(), "/P/src/X".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- !checkPathMatch("/P/**/src".toCharArray(), "/P/src/X".toCharArray(), true));
- assertTrue("Path pattern matching failure-3",
- checkPathMatch("/P/src".toCharArray(), "/P/src".toCharArray(), true));
- assertTrue("Path pattern matching failure-4",
- !checkPathMatch("A.java".toCharArray(), "/P/src/A.java".toCharArray(), true));
-}
-public void test61() {
-
- assertTrue("Path pattern matching failure-1",
- checkPathMatch("/P/src/**/CVS".toCharArray(), "/P/src/CVS".toCharArray(), true));
- assertTrue("Path pattern matching failure-2",
- checkPathMatch("/P/src/**/CVS/".toCharArray(), "/P/src/CVS".toCharArray(), true));
-}
-public void test62() {
- assertCamelCase("NPE", "NullPointerException", true/* should match */);
- assertCamelCase("NPExc", "NullPointerException", true/* should match */);
- assertCamelCase("NPoE", "NullPointerException", true/* should match */);
- assertCamelCase("NuPExc", "NullPointerException", true/* should match */);
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-public void test63() {
- assertCamelCase("NPEX", "NullPointerException", false/* should not match */);
- assertCamelCase("NPex", "NullPointerException", false/* should not match */);
- assertCamelCase("npe", "NullPointerException", false/* should not match */);
- assertCamelCase("npe", "NPException", false/* should not match */);
- assertCamelCase("NPointerE", "NullPointerException", true/* should match */);
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-public void test64() {
- assertCamelCase("IAE", "IgnoreAllErrorHandler", true/* should match */);
- assertCamelCase("IAE", "IAnchorElement", true/* should match */);
- assertCamelCase("IAnchorEleme", "IAnchorElement", true/* should match */);
- assertCamelCase("", "IAnchorElement", false/* should not match */);
- assertCamelCase(null, "IAnchorElement", true/* should match */);
- assertCamelCase("", "", true/* should match */);
- assertCamelCase("IAnchor", null, false/* should not match */);
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-public void test65() {
- assertCamelCase("iSCDCo", "invokeStringConcatenationDefaultConstructor", true/* should match */);
- assertCamelCase("inVOke", "invokeStringConcatenationDefaultConstructor", false/* should not match */);
- assertCamelCase("i", "invokeStringConcatenationDefaultConstructor", true/* should match */);
- assertCamelCase("I", "invokeStringConcatenationDefaultConstructor", false/* should not match */);
- assertCamelCase("iStringCD", "invokeStringConcatenationDefaultConstructor", true/* should match */);
- assertCamelCase("NPE", "NullPointerException/java.lang", true/* should match */);
- assertCamelCase("NPE", "NullPointer/lang.Exception", false/* should not match */);
- assertCamelCase("NPE", "Null_Pointer$Exception", true/* should match */);
- assertCamelCase("NPE", "Null1Pointer2Exception", true/* should match */);
- assertCamelCase("NPE", "Null.Pointer.Exception", false/* should not match */);
- assertCamelCase("NPE", "aNullPointerException", false/* should not match */);
- assertCamelCase("nullP", "nullPointerException", true/* should match */);
- assertCamelCase("nP", "nullPointerException", true/* should match */);
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-
-/**
- * Bug 130390: CamelCase algorithm cleanup and improvement
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=130390"
- */
-public void test66() {
- String[][] MATCHES = {
- {"TZ","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TiZ","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TiZon","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TZon","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TZone","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TimeZone","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TimeZ","TimeZ"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TZ","TimeZ"}, //$NON-NLS-1$//$NON-NLS-2$
- {"T","TimeZ"}, //$NON-NLS-1$//$NON-NLS-2$
- {"T","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"TZ","TZ"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aT","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTi","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTiZ","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTZ","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aT","artTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTi","artTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTiZ","artTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTZ","artTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- };
-
- for (int i = 0; i<MATCHES.length ; i++) {
- String[] match = MATCHES[i];
- assertCamelCase(match[0], match[1], true/*should match*/);
- }
-
- String[][] MIS_MATCHES = {
- {"TZ","Timezone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTZ","TimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aTZ","TZ"}, //$NON-NLS-1$//$NON-NLS-2$
- {"arT","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"arTi","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"arTiZ","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"arTZ","aTimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- {"aT","atimeZone"}, //$NON-NLS-1$//$NON-NLS-2$
- };
-
- for (int i = 0; i<MIS_MATCHES.length ; i++) {
- String[] match = MIS_MATCHES[i];
- assertCamelCase(match[0], match[1], false/*should not match*/);
- }
-
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-
-/**
- * Bug 137087: Open Type - missing matches when using mixed case pattern
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=137087"
- */
-public void test67() {
- assertCamelCase("runtimeEx", "RuntimeException", false/* should not match */);
- assertCamelCase("Runtimeex", "RuntimeException", false/* should not match */);
- assertCamelCase("runtimeexception", "RuntimeException", false/* should not match */);
- assertCamelCase("Runtimexception", "RuntimeException", false/* should not match */);
- assertCamelCase("illegalMSException", "IllegalMonitorStateException", false/* should not match */);
- assertCamelCase("illegalMsException", "IllegalMonitorStateException", false /* should not match */);
- assertCamelCase("IllegalMSException", "IllegalMonitorStateException", true/* should match */);
- assertCamelCase("IllegalMsException", "IllegalMonitorStateException", false /* should not match */);
- assertCamelCase("clonenotsupportedex", "CloneNotSupportedException", false/* should not match */);
- assertCamelCase("CloneNotSupportedEx", "CloneNotSupportedException", true/* should match */);
- assertCamelCase("cloneNotsupportedEx", "CloneNotSupportedException", false/* should not match */);
- assertCamelCase("ClonenotSupportedexc", "CloneNotSupportedException", false/* should not match */);
- assertCamelCase("cloneNotSupportedExcep", "CloneNotSupportedException", false/* should not match */);
- assertCamelCase("Clonenotsupportedexception", "CloneNotSupportedException", false/* should not match */);
- assertCamelCase("CloneNotSupportedException", "CloneNotSupportedException", true /* should match */);
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-// lower CamelCase
-public void test68() {
- assertCamelCase("aMe", "aMethod", true/* should match */);
- assertCamelCase("ame", "aMethod", false/* should not match */);
- assertCamelCase("longNOM", "longNameOfMethod", true/* should match */);
- assertCamelCase("longNOMeth", "longNameOfMethod", true/* should match */);
- assertCamelCase("longNOMethod", "longNameOfMethod", true/* should match */);
- assertCamelCase("longNoMethod", "longNameOfMethod", false/* should not match */);
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-// search tests
-public void test69() {
- assertCamelCase("aa", "AxxAyy", false /* should not match */);
- assertCamelCase("Aa", "AxxAyy", false /* should not match */);
- assertCamelCase("aA", "AxxAyy", false /* should not match */);
- assertCamelCase("AA", "AxxAyy", true /* should match */);
- assertCamelCase("aa", "AbcdAbcdefAbcAbcdefghAbAAzzzzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnAbcAbcdefghijklm", false /* should not match */);
- assertCamelCase("AA", "AbcdAbcdefAbcAbcdefghAbAAzzzzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnAbcAbcdefghijklm", true /* should match */);
- // Verify that there were no unexpected results
- assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
-}
-public static Class testClass() {
- return UtilTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/VarargsTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/VarargsTest.java
deleted file mode 100644
index c323074..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/VarargsTest.java
+++ /dev/null
@@ -1,2067 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import junit.framework.Test;
-
-public class VarargsTest extends AbstractComparableTest {
-
- public VarargsTest(String name) {
- super(name);
- }
-
- // Static initializer to specify tests subset using TESTS_* static variables
- // All specified tests which does not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] { "test000" };
-// TESTS_NUMBERS = new int[] { 30 };
-// TESTS_RANGE = new int[] { 11, -1 };
- }
- public static Test suite() {
- return buildComparableTestSuite(testClass());
- }
-
- public static Class testClass() {
- return VarargsTest.class;
- }
-
- public void test001() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y y = new Y();\n" +
- " y = new Y(null);\n" +
- " y = new Y(1);\n" +
- " y = new Y(1, 2, (byte) 3, 4);\n" +
- " y = new Y(new int[] {1, 2, 3, 4 });\n" +
- " \n" +
- " Y.count();\n" +
- " Y.count(null);\n" +
- " Y.count(1);\n" +
- " Y.count(1, 2, (byte) 3, 4);\n" +
- " Y.count(new int[] {1, 2, 3, 4 });\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public Y(int ... values) {\n" +
- " int result = 0;\n" +
- " for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
- " result += values[i];\n" +
- " System.out.print(result);\n" +
- " System.out.print(' ');\n" +
- " }\n" +
- " public static void count(int ... values) {\n" +
- " int result = 0;\n" +
- " for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
- " result += values[i];\n" +
- " System.out.print(result);\n" +
- " System.out.print(' ');\n" +
- " }\n" +
- "}\n",
- },
- "<0 0 1 10 10 0 0 1 10 10 >");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y y = new Y();\n" +
- " y = new Y(null);\n" +
- " y = new Y(1);\n" +
- " y = new Y(1, 2, (byte) 3, 4);\n" +
- " y = new Y(new int[] {1, 2, 3, 4 });\n" +
- " \n" +
- " Y.count();\n" +
- " Y.count(null);\n" +
- " Y.count(1);\n" +
- " Y.count(1, 2, (byte) 3, 4);\n" +
- " Y.count(new int[] {1, 2, 3, 4 });\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n",
- },
- "<0 0 1 10 10 0 0 1 10 10 >",
- null,
- false,
- null);
- }
-
- public void test002() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y y = new Y();\n" +
- " y = new Y(null);\n" +
- " y = new Y(1);\n" +
- " y = new Y(1, 2, (byte) 3, 4);\n" +
- " y = new Y(new int[] {1, 2, 3, 4 });\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y extends Z {\n" +
- " public Y(int ... values) { super(values); }\n" +
- "}\n" +
- "class Z {\n" +
- " public Z(int ... values) {\n" +
- " int result = 0;\n" +
- " for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
- " result += values[i];\n" +
- " System.out.print(result);\n" +
- " System.out.print(' ');\n" +
- " }\n" +
- "}\n",
- },
- "<0 0 1 10 10 >");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y y = new Y();\n" +
- " y = new Y(null);\n" +
- " y = new Y(1);\n" +
- " y = new Y(1, 2, (byte) 3, 4);\n" +
- " y = new Y(new int[] {1, 2, 3, 4 });\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n",
- },
- "<0 0 1 10 10 >",
- null,
- false,
- null);
- }
-
- public void test003() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.count();\n" +
- " Y.count((int[]) null);\n" +
- " Y.count((int[][]) null);\n" +
- " Y.count(new int[] {1});\n" +
- " Y.count(new int[] {1, 2}, new int[] {3, 4});\n" +
- " Y.count(new int[][] {new int[] {1, 2, 3}, new int[] {4}});\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static int count(int[] values) {\n" +
- " int result = 0;\n" +
- " for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
- " result += values[i];\n" +
- " System.out.print(' ');\n" +
- " System.out.print(result);\n" +
- " return result;\n" +
- " }\n" +
- " public static void count(int[] ... values) {\n" +
- " int result = 0;\n" +
- " for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
- " result += count(values[i]);\n" +
- " System.out.print('=');\n" +
- " System.out.print(result);\n" +
- " }\n" +
- "}\n",
- },
- "<=0 0=0 1 3 7=10 6 4=10>");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.count();\n" +
- " Y.count((int[]) null);\n" +
- " Y.count((int[][]) null);\n" +
- " Y.count(new int[] {1});\n" +
- " Y.count(new int[] {1, 2}, new int[] {3, 4});\n" +
- " Y.count(new int[][] {new int[] {1, 2, 3}, new int[] {4}});\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n"
- },
- "<=0 0=0 1 3 7=10 6 4=10>",
- null,
- false,
- null);
- }
-
- public void test004() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.count(0);\n" +
- " Y.count(-1, (int[]) null);\n" +
- " Y.count(-2, (int[][]) null);\n" +
- " Y.count(1);\n" +
- " Y.count(2, new int[] {1});\n" +
- " Y.count(3, new int[] {1}, new int[] {2, 3}, new int[] {4});\n" +
- " Y.count((byte) 4, new int[][] {new int[] {1}, new int[] {2, 3}, new int[] {4}});\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static int count(int j, int[] values) {\n" +
- " int result = j;\n" +
- " System.out.print(' ');\n" +
- " System.out.print('[');\n" +
- " for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
- " result += values[i];\n" +
- " System.out.print(result);\n" +
- " System.out.print(']');\n" +
- " return result;\n" +
- " }\n" +
- " public static void count(int j, int[] ... values) {\n" +
- " int result = j;\n" +
- " System.out.print(' ');\n" +
- " System.out.print(result);\n" +
- " System.out.print(':');\n" +
- " for (int i = 0, l = values == null ? 0 : values.length; i < l; i++)\n" +
- " result += count(j, values[i]);\n" +
- " System.out.print('=');\n" +
- " System.out.print(result);\n" +
- " }\n" +
- "}\n",
- },
- "< 0:=0 [-1] -2:=-2 1:=1 [3] 3: [4] [8] [7]=22 4: [5] [9] [8]=26>");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.count(0);\n" +
- " Y.count(-1, (int[]) null);\n" +
- " Y.count(-2, (int[][]) null);\n" +
- " Y.count(1);\n" +
- " Y.count(2, new int[] {1});\n" +
- " Y.count(3, new int[] {1}, new int[] {2, 3}, new int[] {4});\n" +
- " Y.count((byte) 4, new int[][] {new int[] {1}, new int[] {2, 3}, new int[] {4}});\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n"
- },
- "< 0:=0 [-1] -2:=-2 1:=1 [3] 3: [4] [8] [7]=22 4: [5] [9] [8]=26>",
- null,
- false,
- null);
- }
-
- public void test005() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.print();\n" +
- " Y.print(new Integer(1));\n" +
- " Y.print(new Integer(1), new Byte((byte) 3), new Integer(7));\n" +
- " Y.print(new Integer[] {new Integer(11) });\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void print(Number ... values) {\n" +
- " for (int i = 0, l = values.length; i < l; i++) {\n" +
- " System.out.print(' ');\n" +
- " System.out.print(values[i]);\n" +
- " }\n" +
- " System.out.print(',');\n" +
- " }\n" +
- "}\n",
- },
- "<, 1, 1 3 7, 11,>");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.print();\n" +
- " Y.print(new Integer(1));\n" +
- " Y.print(new Integer(1), new Byte((byte) 3), new Integer(7));\n" +
- " Y.print(new Integer[] {new Integer(11) });\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n",
- },
- "<, 1, 1 3 7, 11,>",
- null,
- false,
- null);
- }
-
- public void test006() { // 70056
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " String[] T_NAMES = new String[] {\"foo\"};\n" +
- " String error = \"error\";\n" +
- " Y.format(\"E_UNSUPPORTED_CONV\", new Integer(0));\n" +
- " Y.format(\"E_SAVE\", T_NAMES[0], error);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static String format(String key) { return null; }\n" +
- " public static String format(String key, Object ... args) { return null; }\n" +
- "}\n",
- },
- "");
- }
-
- public void test007() { // array dimension test compatibility with Object
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y.byte2(null);\n" + // warning: inexact argument type for last parameter
- " Y.byte2((byte) 1);\n" + // error
- " Y.byte2(new byte[] {});\n" +
- " Y.byte2(new byte[][] {});\n" +
- " Y.byte2(new byte[][][] {});\n" + // error
- "\n" +
- " Y.object(null);\n" + // warning
- " Y.object((byte) 1);\n" +
- " Y.object(new byte[] {});\n" +
- " Y.object(new byte[][] {});\n" + // warning
- " Y.object(new byte[][][] {});\n" + // warning
- "\n" +
- " Y.object(new String());\n" +
- " Y.object(new String[] {});\n" + // warning
- " Y.object(new String[][] {});\n" + // warning
- "\n" +
- " Y.object2(null);\n" + // warning
- " Y.object2((byte) 1);\n" + // error
- " Y.object2(new byte[] {});\n" + // error
- " Y.object2(new byte[][] {});\n" +
- " Y.object2(new byte[][][] {});\n" + // warning
- "\n" +
- " Y.object2(new String());\n" + // error
- " Y.object2(new String[] {});\n" +
- " Y.object2(new String[][] {});\n" + // warning
- "\n" +
- " Y.string(null);\n" + // warning
- " Y.string(new String());\n" +
- " Y.string(new String[] {});\n" +
- " Y.string(new String[][] {});\n" + // error
- "\n" +
- " Y.string(new Object());\n" + // error
- " Y.string(new Object[] {});\n" + // error
- " Y.string(new Object[][] {});\n" + // error
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void byte2(byte[] ... values) {}\n" +
- " public static void object(Object ... values) {}\n" +
- " public static void object2(Object[] ... values) {}\n" +
- " public static void string(String ... values) {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Y.byte2(null);\n" +
- " ^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to byte[][] for the invocation of the varargs method byte2(byte[]...) from type Y. It could alternatively be cast to byte[] for a varargs invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Y.byte2((byte) 1);\n" +
- " ^^^^^\n" +
- "The method byte2(byte[]...) in the type Y is not applicable for the arguments (byte)\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " Y.byte2(new byte[][][] {});\n" +
- " ^^^^^\n" +
- "The method byte2(byte[]...) in the type Y is not applicable for the arguments (byte[][][])\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 9)\n" +
- " Y.object(null);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Object[] for the invocation of the varargs method object(Object...) from type Y. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "5. WARNING in X.java (at line 12)\n" +
- " Y.object(new byte[][] {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type byte[][] should explicitly be cast to Object[] for the invocation of the varargs method object(Object...) from type Y. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "6. WARNING in X.java (at line 13)\n" +
- " Y.object(new byte[][][] {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type byte[][][] should explicitly be cast to Object[] for the invocation of the varargs method object(Object...) from type Y. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "7. WARNING in X.java (at line 16)\n" +
- " Y.object(new String[] {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type String[] should explicitly be cast to Object[] for the invocation of the varargs method object(Object...) from type Y. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 17)\n" +
- " Y.object(new String[][] {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type String[][] should explicitly be cast to Object[] for the invocation of the varargs method object(Object...) from type Y. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "9. WARNING in X.java (at line 19)\n" +
- " Y.object2(null);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Object[][] for the invocation of the varargs method object2(Object[]...) from type Y. It could alternatively be cast to Object[] for a varargs invocation\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 20)\n" +
- " Y.object2((byte) 1);\n" +
- " ^^^^^^^\n" +
- "The method object2(Object[]...) in the type Y is not applicable for the arguments (byte)\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 21)\n" +
- " Y.object2(new byte[] {});\n" +
- " ^^^^^^^\n" +
- "The method object2(Object[]...) in the type Y is not applicable for the arguments (byte[])\n" +
- "----------\n" +
- "12. WARNING in X.java (at line 23)\n" +
- " Y.object2(new byte[][][] {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type byte[][][] should explicitly be cast to Object[][] for the invocation of the varargs method object2(Object[]...) from type Y. It could alternatively be cast to Object[] for a varargs invocation\n" +
- "----------\n" +
- "13. ERROR in X.java (at line 25)\n" +
- " Y.object2(new String());\n" +
- " ^^^^^^^\n" +
- "The method object2(Object[]...) in the type Y is not applicable for the arguments (String)\n" +
- "----------\n" +
- "14. WARNING in X.java (at line 27)\n" +
- " Y.object2(new String[][] {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type String[][] should explicitly be cast to Object[][] for the invocation of the varargs method object2(Object[]...) from type Y. It could alternatively be cast to Object[] for a varargs invocation\n" +
- "----------\n" +
- "15. WARNING in X.java (at line 29)\n" +
- " Y.string(null);\n" +
- " ^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to String[] for the invocation of the varargs method string(String...) from type Y. It could alternatively be cast to String for a varargs invocation\n" +
- "----------\n" +
- "16. ERROR in X.java (at line 32)\n" +
- " Y.string(new String[][] {});\n" +
- " ^^^^^^\n" +
- "The method string(String...) in the type Y is not applicable for the arguments (String[][])\n" +
- "----------\n" +
- "17. ERROR in X.java (at line 34)\n" +
- " Y.string(new Object());\n" +
- " ^^^^^^\n" +
- "The method string(String...) in the type Y is not applicable for the arguments (Object)\n" +
- "----------\n" +
- "18. ERROR in X.java (at line 35)\n" +
- " Y.string(new Object[] {});\n" +
- " ^^^^^^\n" +
- "The method string(String...) in the type Y is not applicable for the arguments (Object[])\n" +
- "----------\n" +
- "19. ERROR in X.java (at line 36)\n" +
- " Y.string(new Object[][] {});\n" +
- " ^^^^^^\n" +
- "The method string(String...) in the type Y is not applicable for the arguments (Object[][])\n" +
- "----------\n");
- }
-
- public void test008() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y y = new Y(null);\n" +
- " y = new Y(true, null);\n" + // null warning
- " y = new Y('i', null);\n" + // null warning
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public Y(int ... values) {}\n" +
- " public Y(boolean b, Object ... values) {}\n" +
- " public Y(char c, int[] ... values) {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " y = new Y(true, null);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Object[] for the invocation of the varargs constructor Y(boolean, Object...). It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " y = new Y(\'i\', null);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to int[][] for the invocation of the varargs constructor Y(char, int[]...). It could alternatively be cast to int[] for a varargs invocation\n" +
- "----------\n");
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y y = new Y(null);\n" +
- " y = new Y(true, null);\n" + // null warning
- " y = new Y('i', null);\n" + // null warning
- " }\n" +
- "}\n" +
- "class Y extends Z {\n" +
- " public Y(int ... values) { super(values); }\n" +
- " public Y(boolean b, Object ... values) { super(b, values); }\n" +
- " public Y(char c, int[] ... values) {}\n" +
- "}\n" +
- "class Z {\n" +
- " public Z(int ... values) {}\n" +
- " public Z(boolean b, Object ... values) {}\n" +
- " public Z(char c, int[] ... values) {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " y = new Y(true, null);\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Object[] for the invocation of the varargs constructor Y(boolean, Object...). It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " y = new Y(\'i\', null);\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to int[][] for the invocation of the varargs constructor Y(char, int[]...). It could alternatively be cast to int[] for a varargs invocation\n" +
- "----------\n");
- }
-
- public void test009() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.count(null);\n" +
- " Y.count(1);\n" +
- " Y.count(1, 2);\n" +
- "\n" +
- " Z.count(1L, 1);\n" + // only choice is Z.count(long, int)
- " Z.count(1, 1);\n" + // chooses Z.count(long, long) over Z.count(int,int...)
- " Z.count(1, null);\n" + // only choice is Z.count(int,int...)
- " Z.count2(1, null);\n" + // better choice is Z.count(int,int[])
- " Z.count2(1L, null);\n" + // better choice is Z.count(long,int...)
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(int values) { System.out.print('1'); }\n" +
- " public static void count(int ... values) { System.out.print('2'); }\n" +
- "}\n" +
- "class Z {\n" +
- " public static void count(long l, long values) { System.out.print('3'); }\n" +
- " public static void count(int i, int ... values) { System.out.print('4'); }\n" +
- " public static void count2(int i, int values) { System.out.print('5'); }\n" +
- " public static void count2(long l, int ... values) { System.out.print('6'); }\n" +
- "}\n",
- },
- "<21233466>");
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.test((Object[]) null);\n" + // cast to avoid null warning
- " Y.test(null, null);\n" +
- " Y.test(null, null, null);\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void test(Object o, Object o2) { System.out.print('1'); }\n" +
- " public static void test(Object ... values) { System.out.print('2'); }\n" +
- "}\n",
- },
- "<212>");
- }
-
- public void test010() {
- // according to spec this should find count(Object) since it should consider count(Object...) as count(Object[]) until all fixed arity methods are ruled out
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.count((Object) new Integer(1));\n" +
- " Y.count(new Integer(1));\n" +
- "\n" +
- " Y.count((Object) null);\n" +
- " Y.count((Object[]) null);\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(Object values) { System.out.print('1'); }\n" +
- " public static void count(Object ... values) { System.out.print('2'); }\n" +
- "}\n",
- },
- "<1112>");
- // according to spec this should find count(Object[]) since it should consider count(Object[]...) as count(Object[][]) until all fixed arity methods are ruled out
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " System.out.print('<');\n" +
- " Y.count(new Object[] {new Integer(1)});\n" +
- " Y.count(new Integer[] {new Integer(1)});\n" +
- "\n" +
- " Y.count((Object[]) null);\n" +
- " Y.count((Object[][]) null);\n" +
- " System.out.print('>');\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(Object[] values) { System.out.print('1'); }\n" +
- " public static void count(Object[] ... values) { System.out.print('2'); }\n" +
- "}\n",
- },
- "<1112>");
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y.string(null);\n" +
- " Y.string2(null);\n" +
- " Y.int2(null);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void string(String values) { System.out.print('1'); }\n" +
- " public static void string(String ... values) { System.out.print('2'); }\n" +
- " public static void string2(String[] values) { System.out.print('1'); }\n" +
- " public static void string2(String[] ... values) { System.out.print('2'); }\n" +
- " public static void int2(int[] values) { System.out.print('1'); }\n" +
- " public static void int2(int[] ... values) { System.out.print('2'); }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y.string(null);\n" +
- " ^^^^^^\n" +
- "The method string(String) is ambiguous for the type Y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Y.string2(null);\n" +
- " ^^^^^^^\n" +
- "The method string2(String[]) is ambiguous for the type Y\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Y.int2(null);\n" +
- " ^^^^\n" +
- "The method int2(int[]) is ambiguous for the type Y\n" +
- "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83379
- public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void count(int ... values) {} }\n" +
- "class Y extends X { void count(int[] values) {} }\n" +
- "class Z extends Y { void count(int... values) {} }\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " class Y extends X { void count(int[] values) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike Y.count(int[]) and X.count(int...)\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 2)\n" +
- " class Y extends X { void count(int[] values) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "The method count(int[]) of type Y should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 3)\n" +
- " class Z extends Y { void count(int... values) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Varargs methods should only override or be overridden by other varargs methods unlike Z.count(int...) and Y.count(int[])\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 3)\n" +
- " class Z extends Y { void count(int... values) {} }\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "The method count(int...) of type Z should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77084
- public void test012() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main (String ... args) {\n" +
- " for (String a:args) {\n" +
- " System.out.println(a);\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"
- }
- );
- }
-
- public void test013() { // check behaviour of Scope.mostSpecificMethodBinding()
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y.count(1, 1);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(long i, int j) { System.out.print(1); }\n" +
- " public static void count(int ... values) { System.out.print(2); }\n" +
- "}\n",
- },
- "1");
- }
-
- public void test014() { // check behaviour of Scope.mostSpecificMethodBinding()
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y.count(new int[0], 1);\n" +
- " Y.count(new int[0], 1, 1);\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(int[] array, int ... values) { System.out.print(1); }\n" +
- " public static void count(Object o, int ... values) { System.out.print(2); }\n" +
- "}\n",
- },
- "11"
- );
- }
-
- public void test015() { // check behaviour of Scope.mostSpecificMethodBinding()
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y.count(new int[0]);\n" + // for some reason this is not ambiguous
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(int[] array, int ... values) { System.out.print(1); }\n" +
- " public static void count(int[] array, int[] ... values) { System.out.print(2); }\n" +
- "}\n",
- },
- "1"
- );
- }
-
- public void test016() { // check behaviour of Scope.mostSpecificMethodBinding()
- this.runNegativeTest( // but this call is ambiguous
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y.count(new int[0]);\n" + // reference to count is ambiguous, both method count(int[],int...) in Y and method count(int[],int[][]...) in Y match
- " Y.count(new int[0], null);\n" + // reference to count is ambiguous, both method count(int[],int...) in Y and method count(int[],int[]...) in Y match
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(int[] array, int ... values) { System.out.print(0); }\n" +
- " public static void count(int[] array, int[][] ... values) { System.out.print(1); }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y.count(new int[0]);\n" +
- " ^^^^^\n" +
- "The method count(int[], int[]) is ambiguous for the type Y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Y.count(new int[0], null);\n" +
- " ^^^^^\n" +
- "The method count(int[], int[]) is ambiguous for the type Y\n" +
- "----------\n"
- );
- }
-
- public void test017() { // check behaviour of Scope.mostSpecificMethodBinding()
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " Y.count(new int[0], 1);\n" + // reference to count is ambiguous, both method count(int[],int...) in Y and method count(int[],int,int...) in Y match
- " Y.count(new int[0], 1, 1);\n" + // reference to count is ambiguous, both method count(int[],int...) in Y and method count(int[],int,int...) in Y match
- " Y.count(new int[0], 1, 1, 1);\n" + // reference to count is ambiguous, both method count(int[],int...) in Y and method count(int[],int,int...) in Y match
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " public static void count(int[] array, int ... values) {}\n" +
- " public static void count(int[] array, int[] ... values) {}\n" +
- " public static void count(int[] array, int i, int ... values) {}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Y.count(new int[0], 1);\n" +
- " ^^^^^\n" +
- "The method count(int[], int[]) is ambiguous for the type Y\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " Y.count(new int[0], 1, 1);\n" +
- " ^^^^^\n" +
- "The method count(int[], int[]) is ambiguous for the type Y\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " Y.count(new int[0], 1, 1, 1);\n" +
- " ^^^^^\n" +
- "The method count(int[], int[]) is ambiguous for the type Y\n" +
- "----------\n"
- );
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81590
- public void test018() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String[][] x = {{\"X\"}, {\"Y\"}};\n" +
- " List l = Arrays.asList(x);\n" +
- " System.out.println(l.size() + \" \" + l.get(0).getClass().getName());\n" +
- " }\n" +
- "}\n",
- },
- "2 [Ljava.lang.String;");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81590 - variation
- public void test019() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String[][] x = {{\"X\"}, {\"Y\"}};\n" +
- " System.out.println(asList(x[0], x[1]).get(1).getClass().getName());\n" +
- " }\n" +
- " static <U> List<U> asList(U u1, U... us) {\n" +
- " List<U> result = new ArrayList<U>();\n" +
- " result.add(u1);\n" +
- " result.add(us[0]);\n" +
- " return result;\n" +
- " }\n" +
- "}\n",
- },
- "java.lang.String");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81590 - variation
- public void test020() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String[][] x = {{\"X\"}, {\"Y\"}};\n" +
- " System.out.println(asList(x[0], x).get(1).getClass().getName());\n" +
- " }\n" +
- " static <U> List<U> asList(U u1, U... us) {\n" +
- " List<U> result = new ArrayList<U>();\n" +
- " result.add(u1);\n" +
- " result.add(us[0]);\n" +
- " return result;\n" +
- " }\n" +
- "}\n",
- },
- "[Ljava.lang.String;");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81911
- public void test021() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.ArrayList;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String[][] arr = new String[][] { args };\n" +
- " ArrayList<String[]> al = new ArrayList<String[]>(Arrays.asList(arr));\n" +
- " }\n" +
- "}\n",
- },
- "");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83032
- public void test022() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " String[] args;\n" +
- " public X(String... args) {\n" +
- " this.args = args;\n" +
- " }\n" +
- " public static X foo() {\n" +
- " return new X(\"SU\", \"C\", \"CE\", \"SS\"){};\n" +
- " }\n" +
- " public String bar() {\n" +
- " if (this.args != null) {\n" +
- " StringBuffer buffer = new StringBuffer();\n" +
- " for (String s : this.args) {\n" +
- " buffer.append(s);\n" +
- " }\n" +
- " return String.valueOf(buffer);\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(foo().bar());\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=83536
- public void test023() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main (String[] args) {\n" +
- " new X().test (new byte[5]);\n" +
- " System.out.print(\"SUCCESS\");\n" +
- " }\n" +
- " private void test (Object... params) {\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87042
- public void test024() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static boolean foo(Object... args) {\n" +
- " return args == null;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(foo(null, null));\n" +
- " }\n" +
- "}",
- },
- "false");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87042
- public void test025() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static boolean foo(Object... args) {\n" +
- " return args == null;\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(foo(null));\n" +
- " }\n" +
- "}",
- },
- "true");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87318
- public void test026() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " static void foo(int[] intarray) {\n" +
- " List<int[]> l = Arrays.asList(intarray);\n" +
- " System.out.print(l.get(0).length);\n" +
- " }\n" +
- " static void foo(String[] strarray) {\n" +
- " List l = Arrays.asList(strarray);\n" +
- " System.out.print(l);\n" +
- " } \n" +
- " public static void main(String[] args) {\n" +
- " foo(new int[]{0, 1});\n" +
- " foo(new String[]{\"a\",\"b\"});\n" +
- " System.out.println(\"done\");\n" +
- " }\n" +
- "}\n",
- },
- "2[a, b]done");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87900
- public void test027() { // ensure AccVarargs does not collide
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " transient private X() {}\n" +
- " void test() { X x = new X(); }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " transient private X() {}\r\n" +
- " ^^^\n" +
- "Illegal modifier for the method X.X()\n" +
- "----------\n"
- );
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " transient private X(Object... o) {}\n" +
- " void test() { X x = new X(1, 2); }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " transient private X(Object... o) {}\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Illegal modifier for the method X.X()\n" +
- "----------\n"
- );
- }
- // check no offending unnecessary varargs cast gets diagnosed
- public void test028() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.lang.reflect.Method;\n" +
- "\n" +
- "public class X {\n" +
- " void test(Method method){ \n" +
- " try {\n" +
- " method.invoke(this);\n" +
- " method.invoke(this, new Class[0]);\n" +
- " method.invoke(this, (Object[])new Class[0]);\n" +
- " } catch (Exception e) {\n" +
- " } \n" +
- " }\n" +
- " Zork z;\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " method.invoke(this, new Class[0]);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type Class[] should explicitly be cast to Object[] for the invocation of the varargs method invoke(Object, Object...) from type Method. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 12)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=91467
- public void test029() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * Whatever you do, eclipse doesn\'t like it.\n" +
- " */\n" +
- "public class X {\n" +
- "\n" +
- " /**\n" +
- " * Passing a String vararg to a method needing an Object array makes eclipse\n" +
- " * either ask for a cast or complain that it is unnecessary. You cannot do\n" +
- " * it right.\n" +
- " * \n" +
- " * @param s\n" +
- " */\n" +
- " public static void q(String... s) {\n" +
- " // OK reports: Varargs argument String[] should be cast to Object[] when passed to the method printf(String, Object...) from type PrintStream\n" +
- " System.out.printf(\"\", s);\n" +
- " // WRONG reports: Unnecessary cast from String[] to Object[]\n" +
- " System.out.printf(\"\", (Object[]) s); \n" +
- " }\n" +
- " Zork z;\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 15)\n" +
- " System.out.printf(\"\", s);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type String[] should explicitly be cast to Object[] for the invocation of the varargs method printf(String, Object...) from type PrintStream. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=99260
- public void test030() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " audit(\"osvaldo\", \"localhost\", \"logged\", \"X\", new Integer(0));\n" +
- " audit(\"osvaldo\", \"localhost\", \"logged\", \"X\", \"Y\");\n" +
- " audit(\"osvaldo\", \"localhost\", \"logged\", new Float(0), new java.awt.Point(0, 0));\n" +
- " }\n" +
- " public static <A extends Serializable> void audit(String login,\n" +
- " String address, String event, A... args) {\n" +
- " for (A a : args) {\n" +
- " System.out.println(a.getClass());\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- "class java.lang.String\n" +
- "class java.lang.Integer\n" +
- "class java.lang.String\n" +
- "class java.lang.String\n" +
- "class java.lang.Float\n" +
- "class java.awt.Point");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=102181
- public void test031() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Test<String> t = new Tester();\n" +
- " t.method(\"SUCCESS\");\n" +
- " }\n" +
- "\n" +
- " static abstract class Test<A> {\n" +
- " abstract void method(A... args);\n" +
- " }\n" +
- "\n" +
- " static class Tester extends Test<String> {\n" +
- "\n" +
- " @Override void method(String... args) {\n" +
- " call(args);\n" +
- " }\n" +
- "\n" +
- " void call(String[] args) {\n" +
- " for (String str : args)\n" +
- " System.out.println(str);\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=102278
- public void test032() {
- this.runConformTest(
- new String[] {
- "Functor.java",
- "public class Functor<T> {\n" +
- " public void func(T... args) {\n" +
- " // do noting;\n" +
- " }\n" +
- " \n" +
- " public static void main(String... args) {\n" +
- " Functor<String> functor = new Functor<String>() {\n" +
- " public void func(String... args) {\n" +
- " System.out.println(args.length);\n" +
- " }\n" +
- " };\n" +
- " functor.func(\"Hello!\");\n" +
- " }\n" +
- "}\n",
- },
- "1");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=102631
- public void test033() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void a(boolean b, Object... o) {System.out.print(1);}\n" +
- " void a(Object... o) {System.out.print(2);}\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X();\n" +
- " x.a(true);\n" +
- " x.a(true, \"foobar\");\n" +
- " x.a(\"foo\", \"bar\");\n" +
- " }\n" +
- "}\n",
- },
- "112");
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void b(boolean b, Object... o) {}\n" +
- " void b(Boolean... o) {}\n" +
- " void c(boolean b, boolean b2, Object... o) {}\n" +
- " void c(Boolean b, Object... o) {}\n" +
- " public static void main(String[] args) {\n" +
- " X x = new X();\n" +
- " x.b(true);\n" +
- " x.b(true, false);\n" +
- " x.c(true, true, true);\n" +
- " x.c(Boolean.TRUE, Boolean.TRUE, Boolean.TRUE);\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\r\n" +
- " x.b(true);\r\n" +
- " ^\n" +
- "The method b(boolean, Object[]) is ambiguous for the type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\r\n" +
- " x.b(true, false);\r\n" +
- " ^\n" +
- "The method b(boolean, Object[]) is ambiguous for the type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\r\n" +
- " x.c(true, true, true);\r\n" +
- " ^\n" +
- "The method c(boolean, boolean, Object[]) is ambiguous for the type X\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 11)\r\n" +
- " x.c(Boolean.TRUE, Boolean.TRUE, Boolean.TRUE);\r\n" +
- " ^\n" +
- "The method c(boolean, boolean, Object[]) is ambiguous for the type X\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106106
- public void test034() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*; \n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " double[][] d = { { 1 } , { 2 } }; \n" +
- " List<double[]> l = Arrays.asList(d); // <T> List<T> asList(T... a)\n" +
- " System.out.println(\"List size: \" + l.size());\n" +
- " }\n" +
- "}\n",
- },
- "List size: 2");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=108095
- public void test035() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static <T> void foo(T ... values) {\n" +
- " System.out.print(values.getClass());\n" +
- " }\n" +
- " public static void main(String args[]) {\n" +
- " X.<String>foo(\"monkey\", \"cat\");\n" +
- " X.<String>foo(new String[] { \"monkey\", \"cat\" });\n" +
- " }\n" +
- "}",
- },
- "class [Ljava.lang.String;class [Ljava.lang.String;");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=110563
- public void test036() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " public void testBreak() {\n" +
- " Collection<Class> classes = new ArrayList<Class>();\n" +
- " classes.containsAll(Arrays.asList(String.class, Integer.class, Long.class));\n" +
- " }\n" +
- "}\n",
- },
- "");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=110783
- public void test037() {
- this.runConformTest(
- new String[] {
- "V.java",
- "public class V {\n" +
- " public static void main(String[] s) {\n" +
- " V v = new V();\n" +
- " v.foo(\"\", v, null, \"\");\n" +
- " v.foo(\"\", v, null, \"\", 1);\n" +
- " v.foo2(\"\");\n" +
- " v.foo2(\"\", null);\n" +
- " v.foo2(\"\", null, null);\n" +
- " v.foo3(\"\", v, null, \"\", null);\n" +
- " }\n" +
- " void foo(String s, V v, Object... obs) {System.out.print(1);}\n" +
- " void foo(String s, V v, String r, Object o, Object... obs) {System.out.print(2);}\n" +
- " void foo2(Object... a) {System.out.print(1);}\n" +
- " void foo2(String s, Object... a) {System.out.print(2);}\n" +
- " void foo2(String s, Object o, Object... a) {System.out.print(3);}\n" +
- " void foo3(String s, V v, String... obs) {System.out.print(1);}\n" +
- " void foo3(String s, V v, String r, Object o, Object... obs) {System.out.print(2);}\n" +
- "}\n",
- },
- "222232");
- this.runNegativeTest(
- new String[] {
- "V.java",
- "public class V {\n" +
- " public static void main(String[] s) {\n" +
- " V v = new V();\n" +
- " v.foo2(null, \"\");\n" +
- " v.foo2(null, \"\", \"\");\n" +
- " v.foo3(\"\", v, null, \"\");\n" +
- " }\n" +
- " void foo2(String s, Object... a) {System.out.print(2);}\n" +
- " void foo2(String s, Object o, Object... a) {System.out.print(3);}\n" +
- " void foo3(String s, V v, String... obs) {System.out.print(1);}\n" +
- " void foo3(String s, V v, String r, Object o, Object... obs) {System.out.print(2);}\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in V.java (at line 4)\r\n" +
- " v.foo2(null, \"\");\r\n" +
- " ^^^^\n" +
- "The method foo2(String, Object[]) is ambiguous for the type V\n" +
- "----------\n" +
- "2. ERROR in V.java (at line 5)\r\n" +
- " v.foo2(null, \"\", \"\");\r\n" +
- " ^^^^\n" +
- "The method foo2(String, Object[]) is ambiguous for the type V\n" +
- "----------\n" +
- "3. ERROR in V.java (at line 6)\r\n" +
- " v.foo3(\"\", v, null, \"\");\r\n" +
- " ^^^^\n" +
- "The method foo3(String, V, String[]) is ambiguous for the type V\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801
- public void test038() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void varargs(Serializable... items) {\n" +
- " System.out.println(Arrays.deepToString(items) + \" (argument wrapped)\");\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " varargs(new Object[] {1, 2}); //warns \"Varargs argument Object[] \n" +
- " //should be cast to Serializable[] ..\", but proposed cast to\n" +
- " //Serializable[] fails at runtime (javac does not warn here)\n" +
- " varargs((Serializable[])new Object[] {1, 2}); //warns \"Varargs argument Object[] \n" +
- " //should be cast to Serializable[] ..\", but proposed cast to\n" +
- " //Serializable[] fails at runtime (javac does not warn here)\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n",
- },
- // check no varargs warning
- "----------\n" +
- "1. WARNING in X.java (at line 13)\n" +
- " varargs((Serializable[])new Object[] {1, 2}); //warns \"Varargs argument Object[] \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Object[] to Serializable[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801 - variation
- public void test039() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void varargs(Serializable... items) {\n" +
- " System.out.print(Arrays.deepToString(items) + \" (argument wrapped)\");\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " varargs(new Object[] {1, 2}); //warns \"Varargs argument Object[] \n" +
- " //should be cast to Serializable[] ..\", but proposed cast to\n" +
- " //Serializable[] fails at runtime (javac does not warn here)\n" +
- " varargs((Serializable[])new Object[] {1, 2}); //warns \"Varargs argument Object[] \n" +
- " //should be cast to Serializable[] ..\", but proposed cast to\n" +
- " //Serializable[] fails at runtime (javac does not warn here)\n" +
- " } catch(ClassCastException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "[[1, 2]] (argument wrapped)SUCCESS");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801 - variation
- public void test040() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void array(Serializable... items) {\n" +
- " System.out.print(Arrays.deepToString(items));\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " array(new Serializable[] {3, 4});\n" +
- " array(new Integer[] {5, 6}); //warns (as javac does)\n" +
- " array(null); //warns (as javac does)\n" +
- " }\n" +
- "}\n",
- },
- "[3, 4][5, 6]null");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801 - variation
- public void test041() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void array(Serializable... items) {\n" +
- " System.out.print(Arrays.deepToString(items));\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " array(new Serializable[] {3, 4});\n" +
- " array(new Integer[] {5, 6}); //warns (as javac does)\n" +
- " array(null); //warns (as javac does)\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 11)\n" +
- " array(new Integer[] {5, 6}); //warns (as javac does)\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type Integer[] should explicitly be cast to Serializable[] for the invocation of the varargs method array(Serializable...) from type X. It could alternatively be cast to Serializable for a varargs invocation\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 12)\n" +
- " array(null); //warns (as javac does)\n" +
- " ^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Serializable[] for the invocation of the varargs method array(Serializable...) from type X. It could alternatively be cast to Serializable for a varargs invocation\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801 - variation
- public void test042() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void varargs(Serializable... items) {\n" +
- " System.out.print(Arrays.deepToString(items) + \" (argument wrapped)\");\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " varargs((Serializable) new Object[] {1, 2});\n" +
- " varargs((Serializable) new Serializable[] {3, 4}); //warns about\n" +
- " //unnecessary cast, although cast is necessary (causes varargs call)\n" +
- " varargs((Serializable) new Integer[] {5, 6});\n" +
- " varargs((Serializable) null);\n" +
- " }\n" +
- "}\n",
- },
- "[[1, 2]] (argument wrapped)[[3, 4]] (argument wrapped)[[5, 6]] (argument wrapped)[null] (argument wrapped)");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801 - variation
- public void test043() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void varargs(Serializable... items) {\n" +
- " System.out.print(Arrays.deepToString(items) + \" (argument wrapped)\");\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " varargs((Serializable) new Object[] {1, 2});\n" +
- " varargs((Serializable) new Serializable[] {3, 4}); //warns about\n" +
- " //unnecessary cast, although cast is necessary (causes varargs call)\n" +
- " varargs((Serializable) new Integer[] {5, 6});\n" +
- " varargs((Serializable) null);\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " varargs((Serializable) new Object[] {1, 2});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Object[] to Serializable\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801 - variation
- public void test044() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void array(Serializable... items) {\n" +
- " System.out.print(Arrays.deepToString(items));\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " array((Serializable[]) new Serializable[] {3, 4}); //warns about unnecessary cast\n" +
- " array((Serializable[]) new Integer[] {5, 6});\n" +
- " array((Serializable[]) null);\n" +
- " try {\n" +
- " array((Serializable[]) new Object[] {1, 2}); // CCE at run time\n" +
- " } catch(ClassCastException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "[3, 4][5, 6]nullSUCCESS");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105801 - variation
- public void test045() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.Serializable;\n" +
- "import java.util.Arrays;\n" +
- "\n" +
- "public class X {\n" +
- " static void array(Serializable... items) {\n" +
- " System.out.print(Arrays.deepToString(items));\n" +
- " }\n" +
- " @SuppressWarnings({\"boxing\"})\n" +
- " public static void main(String[] args) {\n" +
- " array((Serializable[]) new Serializable[] {3, 4}); //warns about unnecessary cast\n" +
- " array((Serializable[]) new Integer[] {5, 6});\n" +
- " array((Serializable[]) null);\n" +
- " array((Serializable[]) new Object[] {1, 2}); // CCE at run time\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " array((Serializable[]) new Serializable[] {3, 4}); //warns about unnecessary cast\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Serializable[] to Serializable[]\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 13)\n" +
- " array((Serializable[]) new Object[] {1, 2}); // CCE at run time\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Object[] to Serializable[]\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=133918
- public void test046() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Throwable... exceptions) {\n" +
- " }\n" +
- " void bar(Exception[] exceptions) {\n" +
- " foo((Throwable[])exceptions);\n" +
- " }\n" +
- " Zork z;\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " foo((Throwable[])exceptions);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Exception[] to Throwable[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=140168
- public void test047() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Object id, Object value, String... groups) {}\n" +
- " void foo(Y y, String... groups) {System.out.println(true);}\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo(new Y(), \"a\", \"b\");\n" +
- " }\n" +
- "}\n" +
- "class Y {}",
- },
- "true");
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Y y, Object value, String... groups) {}\n" +
- " void foo(Object id, String... groups) {}\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo(new Y(), \"a\", \"b\");\n" +
- " }\n" +
- "}\n" +
- "class Y {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\r\n" +
- " new X().foo(new Y(), \"a\", \"b\");\r\n" +
- " ^^^\n" +
- "The method foo(Y, Object, String[]) is ambiguous for the type X\n" +
- "----------\n"
- //reference to foo is ambiguous, both method foo(Y,java.lang.Object,java.lang.String...) in X and method foo(java.lang.Object,java.lang.String...) in X match
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=139931
- public void test048() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Y<String> [] foo() {\n" +
- " return null;\n" +
- " }\n" +
- " void bar(Y... y) {\n" +
- " }\n" +
- " void fred() {\n" +
- " bar(foo());\n" +
- " bar((Y[])foo());\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n" +
- "class Y<E> {\n" +
- "}\n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " void bar(Y... y) {\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<E> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 9)\n" +
- " bar((Y[])foo());\n" +
- " ^^^^^^^^^^\n" +
- "Unnecessary cast from Y<String>[] to Y[]\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 10)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141704
- public void test049() {
- this.runConformTest(
- new String[] {
- "Y.java",
- "public class Y extends X {\n" +
- " public static void main(String[] args) {\n" +
- " Y y = new Y();\n" +
- " y.a(null, \"\");\n" +
- " y.a(null);\n" +
- " y.a(y, \"\");\n" +
- " y.a(y);\n" +
- " y.a(y, \"\", y, y);\n" +
- " y.a(y, y, y);\n" +
- " }\n" +
- " @Override public void a(Object anObject, String aString, Object... args) { super.a(anObject, aString, this, args); }\n" +
- " @Override public void a(Object anObject, Object... args) { super.a(anObject, this, args); }\n" +
- "}\n" +
- "class X implements I {\n" +
- " public void a(Object anObject, String aString, Object... args) { System.out.print(1); }\n" +
- " public void a(Object anObject, Object... args) { System.out.print(2); }\n" +
- "}\n" +
- "interface I {\n" +
- " void a(Object anObject, String aString, Object... args);\n" +
- " void a(Object anObject, Object... args);\n" +
- "}\n",
- },
- "121212");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141800
- public void test050() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- " import java.util.Arrays;\n" +
- " public class X {\n" +
- " public static void main( String args[] ) {\n" +
- " Object test = new Object[] { \"Hello\", \"World\" };\n" +
- " System.out.println(Arrays.asList(test));\n" +
- " System.out.println(Arrays.asList((Object[])test)); // Warning here\n" +
- " Zork z;\n" +
- " }\n" +
- "}",
- },
- // ensure no complaint about unnecessary cast
- "----------\n" +
- "1. ERROR in X.java (at line 7)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141800 - variation
- public void test051() {
- this.runConformTest(
- new String[] {
- "X.java",
- " import java.util.Arrays;\n" +
- " public class X {\n" +
- " public static void main( String args[] ) {\n" +
- " Object test = new Object[] { \"Hello\", \"World\" };\n" +
- " System.out.print(Arrays.asList(test).size());\n" +
- " System.out.println(Arrays.asList((Object[])test).size()); // Warning here\n" +
- " }\n" +
- "}",
- },
- "12");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159607
- public void test052() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void addChildren(Widget w) {\n" +
- " if (w instanceof Composite) {\n" +
- " Composite composite = (Composite) w;\n" +
- " addAll((Widget[]) composite.getChildren());\n" +
- " addAll(composite.getChildren());\n" +
- " }\n" +
- " Zork z;\n" +
- " }\n" +
- " void addAll(Widget... widgets) {\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Widget {}\n" +
- "class Control extends Widget {}\n" +
- "class Composite extends Control {\n" +
- " Control[] getChildren() {\n" +
- " return null;\n" +
- " }\n" +
- "}", // =================,
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " addAll((Widget[]) composite.getChildren());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Control[] to Widget[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159607 - variation
- public void test053() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " void addChildren(Widget w) {\n" +
- " if (w instanceof Composite) {\n" +
- " Composite composite = (Composite) w;\n" +
- " addAll((Control[]) composite.getChildren());\n" +
- " addAll(composite.getChildren());\n" +
- " }\n" +
- " Zork z;\n" +
- " }\n" +
- " void addAll(Control... widgets) {\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class Widget {}\n" +
- "class Control extends Widget {}\n" +
- "class Composite extends Control {\n" +
- " Control[] getChildren() {\n" +
- " return null;\n" +
- " }\n" +
- "}", // =================,
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " addAll((Control[]) composite.getChildren());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from Control[] to Control[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- public void test054() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Zork z;\n" +
- " public static void varargs(Object... args) {\n" +
- " if (args == null) {\n" +
- " System.out.println(\"args is null\");\n" +
- " return;\n" +
- " }\n" +
- " if (args.length == 0) {\n" +
- " System.out.println(\"args is of length 0\");\n" +
- " return;\n" +
- " }\n" +
- "\n" +
- " System.out.println(args.length + \" \" + args[0]);\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " @SuppressWarnings(\"boxing\")\n" +
- " Integer[] i = { 0, 1, 2, 3, 4 };\n" +
- " varargs(i);\n" +
- " varargs((Object[]) i);\n" +
- " varargs((Object) i);\n" +
- " varargs(i.clone());\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 19)\n" +
- " varargs(i);\n" +
- " ^^^^^^^^^^\n" +
- "The argument of type Integer[] should explicitly be cast to Object[] for the invocation of the varargs method varargs(Object...) from type X. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 22)\n" +
- " varargs(i.clone());\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type Integer[] should explicitly be cast to Object[] for the invocation of the varargs method varargs(Object...) from type X. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n");
- }
- public void test055() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " private static int elementCount(Object... elements) {\n" +
- " return elements == null ? 0 : elements.length;\n" +
- " }\n" +
- " public static void main(String... args) {\n" +
- " System.out.print(\"null length array: \" + elementCount(null));\n" +
- " System.out.print(\"/[null] length array: \" + elementCount((Object)null));\n" +
- " System.out.print(\"/empty length array: \" + elementCount());\n" +
- " System.out.println(\"/[a,b,c] length array: \" + elementCount(\"a\", \"b\", \"c\"));\n" +
- " }\n" +
- "}", // =================
- },
- "null length array: 0/[null] length array: 1/empty length array: 0/[a,b,c] length array: 3");
- }
- public void test056() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Zork z;\n" +
- " private static int elementCount(Object... elements) {\n" +
- " return elements == null ? 0 : elements.length;\n" +
- " }\n" +
- " public static void main(String... args) {\n" +
- " System.out.print(\"null length array: \" + elementCount(null));\n" +
- " System.out.print(\"/[null] length array: \" + elementCount((Object)null));\n" +
- " System.out.print(\"/empty length array: \" + elementCount());\n" +
- " System.out.println(\"/[a,b,c] length array: \" + elementCount(\"a\", \"b\", \"c\"));\n" +
- " }\n" +
- "}", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 7)\n" +
- " System.out.print(\"null length array: \" + elementCount(null));\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Object[] for the invocation of the varargs method elementCount(Object...) from type X. It could alternatively be cast to Object for a varargs invocation\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=163889
- public void test057() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.lang.annotation.RetentionPolicy;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " void a(Enum<?>...enums) {}\n" +
- "\n" +
- " void b () {\n" +
- " RetentionPolicy[] t = null;\n" +
- " a(t);\n" +
- " a((Enum<?>[])t);\n" +
- " Zork z;\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " a((Enum<?>[])t);\n" +
- " ^^^^^^^^^^^^\n" +
- "Unnecessary cast from RetentionPolicy[] to Enum<?>[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 11)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=162171
- public void test058() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void testPassingSubclassArrayAsVararg() {\n" +
- " // The argument of type VarargsTest.Subclass[] should explicitly be\n" +
- " // cast to VarargsTest.Parent[] for the invocation of the varargs\n" +
- " // method processVararg(VarargsTest.Parent...) from type VarargsTest.\n" +
- " // It could alternatively be cast to VarargsTest.Parent for a varargs\n" +
- " // invocation\n" +
- " processVararg(new Subclass[] {});\n" +
- " }\n" +
- "\n" +
- " public void testPassingSubclassArrayAsVarargWithCast() {\n" +
- " // Unnecessary cast from VarargsTest.Subclass[] to\n" +
- " // VarargsTest.Parent[]\n" +
- " processVararg((Parent[]) new Subclass[] {});\n" +
- " processVararg(new Subclass[] {});\n" +
- " Zork z;\n" +
- " }\n" +
- "\n" +
- " private void processVararg(Parent... objs) {\n" +
- " }\n" +
- "\n" +
- " class Parent {\n" +
- " }\n" +
- "\n" +
- " class Subclass extends Parent {\n" +
- " }\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. WARNING in X.java (at line 14)\n" +
- " processVararg((Parent[]) new Subclass[] {});\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unnecessary cast from X.Subclass[] to X.Parent[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 16)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=170765
- public void test059() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public void foo() {\n" +
- " Integer[] array = null;\n" +
- " varargs(array);\n" +
- " }\n" +
- "\n" +
- " public void varargs(Number... o) {\n" +
- " }\n" +
- " Zork z;\n" +
- "}\n", // =================
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Zork z;\n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n");
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/XLargeTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/XLargeTest.java
deleted file mode 100644
index 8ef6041..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/XLargeTest.java
+++ /dev/null
@@ -1,11826 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.regression;
-
-import java.util.Map;
-import java.util.Random;
-
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-import junit.framework.Test;
-
-public class XLargeTest extends AbstractRegressionTest {
-
-public XLargeTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public void test001() {
- this.runConformTest(
- new String[] {
- "X.java",
- "\n" +
- "public class X {\n" +
- " public static int i,j;\n" +
- " public static long l;\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " }\n" +
- " \n" +
- " public static void foo() {\n" +
- " byte b = 0;\n" +
- " while ( b < 4 ) {\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " b++;\n" +
- " }\n" +
- " if (b == 4 && i == 0) System.out.println(\"SUCCESS\");\n" +
- " else System.out.println(\"FAILED\");\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-
-public void test002() {
- this.runConformTest(
- new String[] {
- "X2.java",
- "public class X2 {\n" +
- " public static boolean b = false;\n" +
- " public static int i, l, j;\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " }\n" +
- " \n" +
- " static {\n" +
- " while (b) {\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " b = false;\n" +
- " }\n" +
- " if (i == 0) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " } else {\n" +
- " System.out.println(\"FAILED\");\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-
-public void test003() {
- this.runConformTest(
- new String[] {
- "X3.java",
- "\n" +
- "public class X3 {\n" +
- " public int i,j;\n" +
- " public long l;\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " X3 x = new X3();\n" +
- " }\n" +
- " \n" +
- " public X3() {\n" +
- " byte b = 0;\n" +
- " i = j = 0;\n" +
- " l = 0L;\n" +
- " while ( b < 4 ) {\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " b++;\n" +
- " }\n" +
- " if (b == 4 && i == 0) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " } else {\n" +
- " System.out.println(\"FAILED\");\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-
-public void test004() {
- this.runConformTest(
- new String[] {
- "X.java",
- "\n" +
- "public class X {\n" +
- " public static int i,j;\n" +
- " public static long l;\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " }\n" +
- " \n" +
- " public static void foo() {\n" +
- " byte b = 0;\n" +
- " for (int i = 0; i < 1; i++) {\n" +
- " while ( b < 4 ) {\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " b++;\n" +
- " }\n" +
- " }\n" +
- " if (b == 4 && i == 0) System.out.println(\"SUCCESS\");\n" +
- " else System.out.println(\"FAILED\");\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-
-public void test005() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " System.out.println(\"\" + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' \n" +
- " + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\' + \'a\');\n" +
- " }\n" +
- "}\n",
- });
-}
-
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=26129
- */
-public void test006() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A {" + // $NON-NLS-1$
- " public static void main(String[] args) {" + // $NON-NLS-1$
- " int i = 1;" + // $NON-NLS-1$
- " try {" + // $NON-NLS-1$
- " if (i == 0)" + // $NON-NLS-1$
- " throw new Exception();" + // $NON-NLS-1$
- " return;" + // $NON-NLS-1$
- " } catch (Exception e) {" + // $NON-NLS-1$
- " i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;i = 366 * i % 534;" + // $NON-NLS-1$
- " } finally {" + // $NON-NLS-1$
- " if (i == 1)" + // $NON-NLS-1$
- " System.out.print(\"OK\");" + // $NON-NLS-1$
- " else" + // $NON-NLS-1$
- " System.out.print(\"FAIL\");" + // $NON-NLS-1$
- " }" + // $NON-NLS-1$
- " }" + // $NON-NLS-1$
- "}"// $NON-NLS-1$
- },
- "OK");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=31811
- */
-public void test007() {
- this.runConformTest(
- new String[] {
- "X.java",
- "\n" +
- "public class X {\n" +
- " public static int i,j;\n" +
- " public static long l;\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " \n" +
- " public static void foo() {\n" +
- " byte b = 0;\n" +
- " for(;;) {\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;i*=l+j;\n" +
- " b++;\n" +
- " if (b > 1) {\n" +
- " break;" +
- " };\n" +
- " };\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=115408
-public void test008() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE);
- options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE);
- options.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE);
- this.runConformTest(new String[] {
- "X.java",
- "public class X extends B implements IToken {\n" +
- " public X( int t, int endOffset, char [] filename, int line ) {\n" +
- " super( t, filename, line );\n" +
- " setOffsetAndLength( endOffset );\n" +
- " }\n" +
- " protected int offset;\n" +
- " public int getOffset() { \n" +
- " return offset; \n" +
- " }\n" +
- " public int getLength() {\n" +
- " return getCharImage().length;\n" +
- " }\n" +
- " protected void setOffsetAndLength( int endOffset ) {\n" +
- " this.offset = endOffset - getLength();\n" +
- " }\n" +
- " public String foo() { \n" +
- " switch ( getType() ) {\n" +
- " case IToken.tCOLONCOLON :\n" +
- " return \"::\" ; //$NON-NLS-1$\n" +
- " case IToken.tCOLON :\n" +
- " return \":\" ; //$NON-NLS-1$\n" +
- " case IToken.tSEMI :\n" +
- " return \";\" ; //$NON-NLS-1$\n" +
- " case IToken.tCOMMA :\n" +
- " return \",\" ; //$NON-NLS-1$\n" +
- " case IToken.tQUESTION :\n" +
- " return \"?\" ; //$NON-NLS-1$\n" +
- " case IToken.tLPAREN :\n" +
- " return \"(\" ; //$NON-NLS-1$\n" +
- " case IToken.tRPAREN :\n" +
- " return \")\" ; //$NON-NLS-1$\n" +
- " case IToken.tLBRACKET :\n" +
- " return \"[\" ; //$NON-NLS-1$\n" +
- " case IToken.tRBRACKET :\n" +
- " return \"]\" ; //$NON-NLS-1$\n" +
- " case IToken.tLBRACE :\n" +
- " return \"{\" ; //$NON-NLS-1$\n" +
- " case IToken.tRBRACE :\n" +
- " return \"}\"; //$NON-NLS-1$\n" +
- " case IToken.tPLUSASSIGN :\n" +
- " return \"+=\"; //$NON-NLS-1$\n" +
- " case IToken.tINCR :\n" +
- " return \"++\" ; //$NON-NLS-1$\n" +
- " case IToken.tPLUS :\n" +
- " return \"+\"; //$NON-NLS-1$\n" +
- " case IToken.tMINUSASSIGN :\n" +
- " return \"-=\" ; //$NON-NLS-1$\n" +
- " case IToken.tDECR :\n" +
- " return \"--\" ; //$NON-NLS-1$\n" +
- " case IToken.tARROWSTAR :\n" +
- " return \"->*\" ; //$NON-NLS-1$\n" +
- " case IToken.tARROW :\n" +
- " return \"->\" ; //$NON-NLS-1$\n" +
- " case IToken.tMINUS :\n" +
- " return \"-\" ; //$NON-NLS-1$\n" +
- " case IToken.tSTARASSIGN :\n" +
- " return \"*=\" ; //$NON-NLS-1$\n" +
- " case IToken.tSTAR :\n" +
- " return \"*\" ; //$NON-NLS-1$\n" +
- " case IToken.tMODASSIGN :\n" +
- " return \"%=\" ; //$NON-NLS-1$\n" +
- " case IToken.tMOD :\n" +
- " return \"%\" ; //$NON-NLS-1$\n" +
- " case IToken.tXORASSIGN :\n" +
- " return \"^=\" ; //$NON-NLS-1$\n" +
- " case IToken.tXOR :\n" +
- " return \"^\" ; //$NON-NLS-1$\n" +
- " case IToken.tAMPERASSIGN :\n" +
- " return \"&=\" ; //$NON-NLS-1$\n" +
- " case IToken.tAND :\n" +
- " return \"&&\" ; //$NON-NLS-1$\n" +
- " case IToken.tAMPER :\n" +
- " return \"&\" ; //$NON-NLS-1$\n" +
- " case IToken.tBITORASSIGN :\n" +
- " return \"|=\" ; //$NON-NLS-1$\n" +
- " case IToken.tOR :\n" +
- " return \"||\" ; //$NON-NLS-1$\n" +
- " case IToken.tBITOR :\n" +
- " return \"|\" ; //$NON-NLS-1$\n" +
- " case IToken.tCOMPL :\n" +
- " return \"~\" ; //$NON-NLS-1$\n" +
- " case IToken.tNOTEQUAL :\n" +
- " return \"!=\" ; //$NON-NLS-1$\n" +
- " case IToken.tNOT :\n" +
- " return \"!\" ; //$NON-NLS-1$\n" +
- " case IToken.tEQUAL :\n" +
- " return \"==\" ; //$NON-NLS-1$\n" +
- " case IToken.tASSIGN :\n" +
- " return \"=\" ; //$NON-NLS-1$\n" +
- " case IToken.tSHIFTL :\n" +
- " return \"<<\" ; //$NON-NLS-1$\n" +
- " case IToken.tLTEQUAL :\n" +
- " return \"<=\" ; //$NON-NLS-1$\n" +
- " case IToken.tLT :\n" +
- " return \"<\"; //$NON-NLS-1$\n" +
- " case IToken.tSHIFTRASSIGN :\n" +
- " return \">>=\" ; //$NON-NLS-1$\n" +
- " case IToken.tSHIFTR :\n" +
- " return \">>\" ; //$NON-NLS-1$\n" +
- " case IToken.tGTEQUAL :\n" +
- " return \">=\" ; //$NON-NLS-1$\n" +
- " case IToken.tGT :\n" +
- " return \">\" ; //$NON-NLS-1$\n" +
- " case IToken.tSHIFTLASSIGN :\n" +
- " return \"<<=\" ; //$NON-NLS-1$\n" +
- " case IToken.tELLIPSIS :\n" +
- " return \"...\" ; //$NON-NLS-1$\n" +
- " case IToken.tDOTSTAR :\n" +
- " return \".*\" ; //$NON-NLS-1$\n" +
- " case IToken.tDOT :\n" +
- " return \".\" ; //$NON-NLS-1$\n" +
- " case IToken.tDIVASSIGN :\n" +
- " return \"/=\" ; //$NON-NLS-1$\n" +
- " case IToken.tDIV :\n" +
- " return \"/\" ; //$NON-NLS-1$\n" +
- " case IToken.t_and :\n" +
- " return Keywords.AND;\n" +
- " case IToken.t_and_eq :\n" +
- " return Keywords.AND_EQ ;\n" +
- " case IToken.t_asm :\n" +
- " return Keywords.ASM ;\n" +
- " case IToken.t_auto :\n" +
- " return Keywords.AUTO ;\n" +
- " case IToken.t_bitand :\n" +
- " return Keywords.BITAND ;\n" +
- " case IToken.t_bitor :\n" +
- " return Keywords.BITOR ;\n" +
- " case IToken.t_bool :\n" +
- " return Keywords.BOOL ;\n" +
- " case IToken.t_break :\n" +
- " return Keywords.BREAK ;\n" +
- " case IToken.t_case :\n" +
- " return Keywords.CASE ;\n" +
- " case IToken.t_catch :\n" +
- " return Keywords.CATCH ;\n" +
- " case IToken.t_char :\n" +
- " return Keywords.CHAR ;\n" +
- " case IToken.t_class :\n" +
- " return Keywords.CLASS ;\n" +
- " case IToken.t_compl :\n" +
- " return Keywords.COMPL ;\n" +
- " case IToken.t_const :\n" +
- " return Keywords.CONST ;\n" +
- " case IToken.t_const_cast :\n" +
- " return Keywords.CONST_CAST ;\n" +
- " case IToken.t_continue :\n" +
- " return Keywords.CONTINUE ;\n" +
- " case IToken.t_default :\n" +
- " return Keywords.DEFAULT ;\n" +
- " case IToken.t_delete :\n" +
- " return Keywords.DELETE ;\n" +
- " case IToken.t_do :\n" +
- " return Keywords.DO;\n" +
- " case IToken.t_double :\n" +
- " return Keywords.DOUBLE ;\n" +
- " case IToken.t_dynamic_cast :\n" +
- " return Keywords.DYNAMIC_CAST ;\n" +
- " case IToken.t_else :\n" +
- " return Keywords.ELSE;\n" +
- " case IToken.t_enum :\n" +
- " return Keywords.ENUM ;\n" +
- " case IToken.t_explicit :\n" +
- " return Keywords.EXPLICIT ;\n" +
- " case IToken.t_export :\n" +
- " return Keywords.EXPORT ;\n" +
- " case IToken.t_extern :\n" +
- " return Keywords.EXTERN;\n" +
- " case IToken.t_false :\n" +
- " return Keywords.FALSE;\n" +
- " case IToken.t_float :\n" +
- " return Keywords.FLOAT;\n" +
- " case IToken.t_for :\n" +
- " return Keywords.FOR;\n" +
- " case IToken.t_friend :\n" +
- " return Keywords.FRIEND;\n" +
- " case IToken.t_goto :\n" +
- " return Keywords.GOTO;\n" +
- " case IToken.t_if :\n" +
- " return Keywords.IF ;\n" +
- " case IToken.t_inline :\n" +
- " return Keywords.INLINE ;\n" +
- " case IToken.t_int :\n" +
- " return Keywords.INT ;\n" +
- " case IToken.t_long :\n" +
- " return Keywords.LONG ;\n" +
- " case IToken.t_mutable :\n" +
- " return Keywords.MUTABLE ;\n" +
- " case IToken.t_namespace :\n" +
- " return Keywords.NAMESPACE ;\n" +
- " case IToken.t_new :\n" +
- " return Keywords.NEW ;\n" +
- " case IToken.t_not :\n" +
- " return Keywords.NOT ;\n" +
- " case IToken.t_not_eq :\n" +
- " return Keywords.NOT_EQ; \n" +
- " case IToken.t_operator :\n" +
- " return Keywords.OPERATOR ;\n" +
- " case IToken.t_or :\n" +
- " return Keywords.OR ;\n" +
- " case IToken.t_or_eq :\n" +
- " return Keywords.OR_EQ;\n" +
- " case IToken.t_private :\n" +
- " return Keywords.PRIVATE ;\n" +
- " case IToken.t_protected :\n" +
- " return Keywords.PROTECTED ;\n" +
- " case IToken.t_public :\n" +
- " return Keywords.PUBLIC ;\n" +
- " case IToken.t_register :\n" +
- " return Keywords.REGISTER ;\n" +
- " case IToken.t_reinterpret_cast :\n" +
- " return Keywords.REINTERPRET_CAST ;\n" +
- " case IToken.t_return :\n" +
- " return Keywords.RETURN ;\n" +
- " case IToken.t_short :\n" +
- " return Keywords.SHORT ;\n" +
- " case IToken.t_sizeof :\n" +
- " return Keywords.SIZEOF ;\n" +
- " case IToken.t_static :\n" +
- " return Keywords.STATIC ;\n" +
- " case IToken.t_static_cast :\n" +
- " return Keywords.STATIC_CAST ;\n" +
- " case IToken.t_signed :\n" +
- " return Keywords.SIGNED ;\n" +
- " case IToken.t_struct :\n" +
- " return Keywords.STRUCT ;\n" +
- " case IToken.t_switch :\n" +
- " return Keywords.SWITCH ;\n" +
- " case IToken.t_template :\n" +
- " return Keywords.TEMPLATE ;\n" +
- " case IToken.t_this :\n" +
- " return Keywords.THIS ;\n" +
- " case IToken.t_throw :\n" +
- " return Keywords.THROW ;\n" +
- " case IToken.t_true :\n" +
- " return Keywords.TRUE ;\n" +
- " case IToken.t_try :\n" +
- " return Keywords.TRY ;\n" +
- " case IToken.t_typedef :\n" +
- " return Keywords.TYPEDEF ;\n" +
- " case IToken.t_typeid :\n" +
- " return Keywords.TYPEID ;\n" +
- " case IToken.t_typename :\n" +
- " return Keywords.TYPENAME ;\n" +
- " case IToken.t_union :\n" +
- " return Keywords.UNION ;\n" +
- " case IToken.t_unsigned :\n" +
- " return Keywords.UNSIGNED ;\n" +
- " case IToken.t_using :\n" +
- " return Keywords.USING ;\n" +
- " case IToken.t_virtual :\n" +
- " return Keywords.VIRTUAL ;\n" +
- " case IToken.t_void :\n" +
- " return Keywords.VOID ;\n" +
- " case IToken.t_volatile :\n" +
- " return Keywords.VOLATILE;\n" +
- " case IToken.t_wchar_t :\n" +
- " return Keywords.WCHAR_T ;\n" +
- " case IToken.t_while :\n" +
- " return Keywords.WHILE ;\n" +
- " case IToken.t_xor :\n" +
- " return Keywords.XOR ;\n" +
- " case IToken.t_xor_eq :\n" +
- " return Keywords.XOR_EQ ;\n" +
- " case IToken.t__Bool :\n" +
- " return Keywords._BOOL ;\n" +
- " case IToken.t__Complex :\n" +
- " return Keywords._COMPLEX ;\n" +
- " case IToken.t__Imaginary :\n" +
- " return Keywords._IMAGINARY ;\n" +
- " case IToken.t_restrict :\n" +
- " return Keywords.RESTRICT ;\n" +
- " case IScanner.tPOUND:\n" +
- " return \"#\"; //$NON-NLS-1$\n" +
- " case IScanner.tPOUNDPOUND:\n" +
- " return \"##\"; //$NON-NLS-1$\n" +
- " case IToken.tEOC:\n" +
- " return \"EOC\"; //$NON-NLS-1$\n" +
- " default :\n" +
- " return \"\"; //$NON-NLS-1$ \n" +
- " } \n" +
- " }\n" +
- " public char[] getCharImage() {\n" +
- " return getCharImage( getType() );\n" +
- " }\n" +
- " static public char[] getCharImage( int type ){\n" +
- " return null;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n" +
- "interface IToken {\n" +
- " static public final int tIDENTIFIER = 1;\n" +
- " static public final int tINTEGER = 2;\n" +
- " static public final int tCOLONCOLON = 3;\n" +
- " static public final int tCOLON = 4;\n" +
- " static public final int tSEMI = 5;\n" +
- " static public final int tCOMMA = 6;\n" +
- " static public final int tQUESTION = 7;\n" +
- " static public final int tLPAREN = 8;\n" +
- " static public final int tRPAREN = 9;\n" +
- " static public final int tLBRACKET = 10;\n" +
- " static public final int tRBRACKET = 11;\n" +
- " static public final int tLBRACE = 12;\n" +
- " static public final int tRBRACE = 13;\n" +
- " static public final int tPLUSASSIGN = 14;\n" +
- " static public final int tINCR = 15;\n" +
- " static public final int tPLUS = 16;\n" +
- " static public final int tMINUSASSIGN = 17;\n" +
- " static public final int tDECR = 18;\n" +
- " static public final int tARROWSTAR = 19;\n" +
- " static public final int tARROW = 20;\n" +
- " static public final int tMINUS = 21;\n" +
- " static public final int tSTARASSIGN = 22;\n" +
- " static public final int tSTAR = 23;\n" +
- " static public final int tMODASSIGN = 24;\n" +
- " static public final int tMOD = 25;\n" +
- " static public final int tXORASSIGN = 26;\n" +
- " static public final int tXOR = 27;\n" +
- " static public final int tAMPERASSIGN = 28;\n" +
- " static public final int tAND = 29;\n" +
- " static public final int tAMPER = 30;\n" +
- " static public final int tBITORASSIGN = 31;\n" +
- " static public final int tOR = 32;\n" +
- " static public final int tBITOR = 33;\n" +
- " static public final int tCOMPL = 34;\n" +
- " static public final int tNOTEQUAL = 35;\n" +
- " static public final int tNOT = 36;\n" +
- " static public final int tEQUAL = 37;\n" +
- " static public final int tASSIGN = 38;\n" +
- " static public final int tSHIFTL = 40;\n" +
- " static public final int tLTEQUAL = 41;\n" +
- " static public final int tLT = 42;\n" +
- " static public final int tSHIFTRASSIGN = 43;\n" +
- " static public final int tSHIFTR = 44;\n" +
- " static public final int tGTEQUAL = 45;\n" +
- " static public final int tGT = 46;\n" +
- " static public final int tSHIFTLASSIGN = 47;\n" +
- " static public final int tELLIPSIS = 48;\n" +
- " static public final int tDOTSTAR = 49;\n" +
- " static public final int tDOT = 50;\n" +
- " static public final int tDIVASSIGN = 51;\n" +
- " static public final int tDIV = 52;\n" +
- " static public final int t_and = 54;\n" +
- " static public final int t_and_eq = 55;\n" +
- " static public final int t_asm = 56;\n" +
- " static public final int t_auto = 57;\n" +
- " static public final int t_bitand = 58;\n" +
- " static public final int t_bitor = 59;\n" +
- " static public final int t_bool = 60;\n" +
- " static public final int t_break = 61;\n" +
- " static public final int t_case = 62;\n" +
- " static public final int t_catch = 63;\n" +
- " static public final int t_char = 64;\n" +
- " static public final int t_class = 65;\n" +
- " static public final int t_compl = 66;\n" +
- " static public final int t_const = 67;\n" +
- " static public final int t_const_cast = 69;\n" +
- " static public final int t_continue = 70;\n" +
- " static public final int t_default = 71;\n" +
- " static public final int t_delete = 72;\n" +
- " static public final int t_do = 73;\n" +
- " static public final int t_double = 74;\n" +
- " static public final int t_dynamic_cast = 75;\n" +
- " static public final int t_else = 76;\n" +
- " static public final int t_enum = 77;\n" +
- " static public final int t_explicit = 78;\n" +
- " static public final int t_export = 79;\n" +
- " static public final int t_extern = 80;\n" +
- " static public final int t_false = 81;\n" +
- " static public final int t_float = 82;\n" +
- " static public final int t_for = 83;\n" +
- " static public final int t_friend = 84;\n" +
- " static public final int t_goto = 85;\n" +
- " static public final int t_if = 86;\n" +
- " static public final int t_inline = 87;\n" +
- " static public final int t_int = 88;\n" +
- " static public final int t_long = 89;\n" +
- " static public final int t_mutable = 90;\n" +
- " static public final int t_namespace = 91;\n" +
- " static public final int t_new = 92;\n" +
- " static public final int t_not = 93;\n" +
- " static public final int t_not_eq = 94;\n" +
- " static public final int t_operator = 95;\n" +
- " static public final int t_or = 96;\n" +
- " static public final int t_or_eq = 97;\n" +
- " static public final int t_private = 98;\n" +
- " static public final int t_protected = 99;\n" +
- " static public final int t_public = 100;\n" +
- " static public final int t_register = 101;\n" +
- " static public final int t_reinterpret_cast = 102;\n" +
- " static public final int t_return = 103;\n" +
- " static public final int t_short = 104;\n" +
- " static public final int t_sizeof = 105;\n" +
- " static public final int t_static = 106;\n" +
- " static public final int t_static_cast = 107;\n" +
- " static public final int t_signed = 108;\n" +
- " static public final int t_struct = 109;\n" +
- " static public final int t_switch = 110;\n" +
- " static public final int t_template = 111;\n" +
- " static public final int t_this = 112;\n" +
- " static public final int t_throw = 113;\n" +
- " static public final int t_true = 114;\n" +
- " static public final int t_try = 115;\n" +
- " static public final int t_typedef = 116;\n" +
- " static public final int t_typeid = 117;\n" +
- " static public final int t_typename = 118;\n" +
- " static public final int t_union = 119;\n" +
- " static public final int t_unsigned = 120;\n" +
- " static public final int t_using = 121;\n" +
- " static public final int t_virtual = 122;\n" +
- " static public final int t_void = 123;\n" +
- " static public final int t_volatile = 124;\n" +
- " static public final int t_wchar_t = 125;\n" +
- " static public final int t_while = 126;\n" +
- " static public final int t_xor = 127;\n" +
- " static public final int t_xor_eq = 128;\n" +
- " static public final int tFLOATINGPT = 129;\n" +
- " static public final int tSTRING = 130;\n" +
- " static public final int tLSTRING = 131;\n" +
- " static public final int tCHAR = 132;\n" +
- " static public final int tLCHAR = 133;\n" +
- " static public final int t__Bool = 134;\n" +
- " static public final int t__Complex = 135;\n" +
- " static public final int t__Imaginary = 136;\n" +
- " static public final int t_restrict = 137;\n" +
- " static public final int tMACROEXP = 138;\n" +
- " static public final int tPOUNDPOUND = 139;\n" +
- " static public final int tCOMPLETION = 140;\n" +
- " static public final int tEOC = 141; // End of Completion\\n\" + \n" +
- " static public final int tLAST = 141;\n" +
- "}\n" +
- "class Keywords {\n" +
- " public static final String CAST = \"cast\"; //$NON-NLS-1$\n" +
- " public static final String ALIGNOF = \"alignof\"; //$NON-NLS-1$\n" +
- " public static final String TYPEOF = \"typeof\"; //$NON-NLS-1$\n" +
- " public static final String cpMIN = \"<?\"; //$NON-NLS-1$\n" +
- " public static final String cpMAX = \">?\"; //$NON-NLS-1$\n" +
- " public static final String _BOOL = \"_Bool\"; //$NON-NLS-1$\n" +
- " public static final String _COMPLEX = \"_Complex\"; //$NON-NLS-1$\n" +
- " public static final String _IMAGINARY = \"_Imaginary\"; //$NON-NLS-1$\n" +
- " public static final String AND = \"and\"; //$NON-NLS-1$\n" +
- " public static final String AND_EQ = \"and_eq\"; //$NON-NLS-1$\n" +
- " public static final String ASM = \"asm\"; //$NON-NLS-1$\n" +
- " public static final String AUTO = \"auto\"; //$NON-NLS-1$\n" +
- " public static final String BITAND = \"bitand\"; //$NON-NLS-1$\n" +
- " public static final String BITOR = \"bitor\"; //$NON-NLS-1$\n" +
- " public static final String BOOL = \"bool\"; //$NON-NLS-1$\n" +
- " public static final String BREAK = \"break\"; //$NON-NLS-1$\n" +
- " public static final String CASE = \"case\"; //$NON-NLS-1$\n" +
- " public static final String CATCH = \"catch\"; //$NON-NLS-1$\n" +
- " public static final String CHAR = \"char\"; //$NON-NLS-1$\n" +
- " public static final String CLASS = \"class\"; //$NON-NLS-1$\n" +
- " public static final String COMPL = \"compl\"; //$NON-NLS-1$\n" +
- " public static final String CONST = \"const\"; //$NON-NLS-1$\n" +
- " public static final String CONST_CAST = \"const_cast\"; //$NON-NLS-1$\n" +
- " public static final String CONTINUE = \"continue\"; //$NON-NLS-1$\n" +
- " public static final String DEFAULT = \"default\"; //$NON-NLS-1$\n" +
- " public static final String DELETE = \"delete\"; //$NON-NLS-1$\n" +
- " public static final String DO = \"do\"; //$NON-NLS-1$\n" +
- " public static final String DOUBLE = \"double\"; //$NON-NLS-1$\n" +
- " public static final String DYNAMIC_CAST = \"dynamic_cast\"; //$NON-NLS-1$\n" +
- " public static final String ELSE = \"else\"; //$NON-NLS-1$\n" +
- " public static final String ENUM = \"enum\"; //$NON-NLS-1$\n" +
- " public static final String EXPLICIT = \"explicit\"; //$NON-NLS-1$\n" +
- " public static final String EXPORT = \"export\"; //$NON-NLS-1$\n" +
- " public static final String EXTERN = \"extern\"; //$NON-NLS-1$\n" +
- " public static final String FALSE = \"false\"; //$NON-NLS-1$\n" +
- " public static final String FLOAT = \"float\"; //$NON-NLS-1$\n" +
- " public static final String FOR = \"for\"; //$NON-NLS-1$\n" +
- " public static final String FRIEND = \"friend\"; //$NON-NLS-1$\n" +
- " public static final String GOTO = \"goto\"; //$NON-NLS-1$\n" +
- " public static final String IF = \"if\"; //$NON-NLS-1$\n" +
- " public static final String INLINE = \"inline\"; //$NON-NLS-1$\n" +
- " public static final String INT = \"int\"; //$NON-NLS-1$\n" +
- " public static final String LONG = \"long\"; //$NON-NLS-1$\n" +
- " public static final String LONG_LONG = \"long long\"; //$NON-NLS-1$\n" +
- " public static final String MUTABLE = \"mutable\"; //$NON-NLS-1$\n" +
- " public static final String NAMESPACE = \"namespace\"; //$NON-NLS-1$\n" +
- " public static final String NEW = \"new\"; //$NON-NLS-1$\n" +
- " public static final String NOT = \"not\"; //$NON-NLS-1$\n" +
- " public static final String NOT_EQ = \"not_eq\"; //$NON-NLS-1$\n" +
- " public static final String OPERATOR = \"operator\"; //$NON-NLS-1$\n" +
- " public static final String OR = \"or\"; //$NON-NLS-1$\n" +
- " public static final String OR_EQ = \"or_eq\"; //$NON-NLS-1$\n" +
- " public static final String PRIVATE = \"private\"; //$NON-NLS-1$\n" +
- " public static final String PROTECTED = \"protected\"; //$NON-NLS-1$\n" +
- " public static final String PUBLIC = \"public\"; //$NON-NLS-1$\n" +
- " public static final String REGISTER = \"register\"; //$NON-NLS-1$\n" +
- " public static final String REINTERPRET_CAST = \"reinterpret_cast\"; //$NON-NLS-1$\n" +
- " public static final String RESTRICT = \"restrict\"; //$NON-NLS-1$\n" +
- " public static final String RETURN = \"return\"; //$NON-NLS-1$\n" +
- " public static final String SHORT = \"short\"; //$NON-NLS-1$\n" +
- " public static final String SIGNED = \"signed\"; //$NON-NLS-1$\n" +
- " public static final String SIZEOF = \"sizeof\"; //$NON-NLS-1$\n" +
- " public static final String STATIC = \"static\"; //$NON-NLS-1$\n" +
- " public static final String STATIC_CAST = \"static_cast\"; //$NON-NLS-1$\n" +
- " public static final String STRUCT = \"struct\"; //$NON-NLS-1$\n" +
- " public static final String SWITCH = \"switch\"; //$NON-NLS-1$\n" +
- " public static final String TEMPLATE = \"template\"; //$NON-NLS-1$\n" +
- " public static final String THIS = \"this\"; //$NON-NLS-1$\n" +
- " public static final String THROW = \"throw\"; //$NON-NLS-1$\n" +
- " public static final String TRUE = \"true\"; //$NON-NLS-1$\n" +
- " public static final String TRY = \"try\"; //$NON-NLS-1$\n" +
- " public static final String TYPEDEF = \"typedef\"; //$NON-NLS-1$\n" +
- " public static final String TYPEID = \"typeid\"; //$NON-NLS-1$\n" +
- " public static final String TYPENAME = \"typename\"; //$NON-NLS-1$\n" +
- " public static final String UNION = \"union\"; //$NON-NLS-1$\n" +
- " public static final String UNSIGNED = \"unsigned\"; //$NON-NLS-1$\n" +
- " public static final String USING = \"using\"; //$NON-NLS-1$\n" +
- " public static final String VIRTUAL = \"virtual\"; //$NON-NLS-1$\n" +
- " public static final String VOID = \"void\"; //$NON-NLS-1$\n" +
- " public static final String VOLATILE = \"volatile\"; //$NON-NLS-1$\n" +
- " public static final String WCHAR_T = \"wchar_t\"; //$NON-NLS-1$\n" +
- " public static final String WHILE = \"while\"; //$NON-NLS-1$\n" +
- " public static final String XOR = \"xor\"; //$NON-NLS-1$\n" +
- " public static final String XOR_EQ = \"xor_eq\"; //$NON-NLS-1$\n" +
- " public static final char[] c_BOOL = \"_Bool\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] c_COMPLEX = \"_Complex\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] c_IMAGINARY = \"_Imaginary\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cAND = \"and\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cAND_EQ = \"and_eq\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cASM = \"asm\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cAUTO = \"auto\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cBITAND = \"bitand\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cBITOR = \"bitor\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cBOOL = \"bool\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cBREAK = \"break\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCASE = \"case\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCATCH = \"catch\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCHAR = \"char\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCLASS = \"class\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCOMPL = \"compl\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCONST = \"const\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCONST_CAST = \"const_cast\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cCONTINUE = \"continue\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cDEFAULT = \"default\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cDELETE = \"delete\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cDO = \"do\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cDOUBLE = \"double\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cDYNAMIC_CAST = \"dynamic_cast\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cELSE = \"else\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cENUM = \"enum\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cEXPLICIT = \"explicit\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cEXPORT = \"export\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cEXTERN = \"extern\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cFALSE = \"false\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cFLOAT = \"float\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cFOR = \"for\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cFRIEND = \"friend\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cGOTO = \"goto\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cIF = \"if\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cINLINE = \"inline\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cINT = \"int\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cLONG = \"long\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cMUTABLE = \"mutable\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cNAMESPACE = \"namespace\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cNEW = \"new\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cNOT = \"not\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cNOT_EQ = \"not_eq\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cOPERATOR = \"operator\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cOR = \"or\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cOR_EQ = \"or_eq\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cPRIVATE = \"private\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cPROTECTED = \"protected\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cPUBLIC = \"public\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cREGISTER = \"register\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cREINTERPRET_CAST = \"reinterpret_cast\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cRESTRICT = \"restrict\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cRETURN = \"return\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cSHORT = \"short\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cSIGNED = \"signed\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cSIZEOF = \"sizeof\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cSTATIC = \"static\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cSTATIC_CAST = \"static_cast\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cSTRUCT = \"struct\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cSWITCH = \"switch\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTEMPLATE = \"template\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTHIS = \"this\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTHROW = \"throw\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTRUE = \"true\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTRY = \"try\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTYPEDEF = \"typedef\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTYPEID = \"typeid\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cTYPENAME = \"typename\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cUNION = \"union\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cUNSIGNED = \"unsigned\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cUSING = \"using\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cVIRTUAL = \"virtual\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cVOID = \"void\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cVOLATILE = \"volatile\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cWCHAR_T = \"wchar_t\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cWHILE = \"while\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cXOR = \"xor\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cXOR_EQ = \"xor_eq\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpCOLONCOLON = \"::\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpCOLON = \":\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpSEMI = \";\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpCOMMA = \",\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpQUESTION = \"?\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpLPAREN = \"(\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpRPAREN = \")\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpLBRACKET = \"[\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpRBRACKET = \"]\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpLBRACE = \"{\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpRBRACE = \"}\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpPLUSASSIGN = \"+=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpINCR = \"++\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpPLUS = \"+\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpMINUSASSIGN = \"-=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpDECR = \"--\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpARROWSTAR = \"->*\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpARROW = \"->\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpMINUS = \"-\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpSTARASSIGN = \"*=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpSTAR = \"*\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpMODASSIGN = \"%=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpMOD = \"%\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpXORASSIGN = \"^=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpXOR = \"^\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpAMPERASSIGN = \"&=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpAND = \"&&\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpAMPER = \"&\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpBITORASSIGN = \"|=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpOR = \"||\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpBITOR = \"|\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpCOMPL = \"~\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpNOTEQUAL = \"!=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpNOT = \"!\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpEQUAL = \"==\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpASSIGN =\"=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpSHIFTL = \"<<\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpLTEQUAL = \"<=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpLT = \"<\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpSHIFTRASSIGN = \">>=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpSHIFTR = \">>\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpGTEQUAL = \">=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpGT = \">\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpSHIFTLASSIGN = \"<<=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpELLIPSIS = \"...\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpDOTSTAR = \".*\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpDOT = \".\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpDIVASSIGN = \"/=\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpDIV = \"/\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpPOUND = \"#\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cpPOUNDPOUND = \"##\".toCharArray(); //$NON-NLS-1$\n" +
- " // preprocessor keywords\\n\" + \n" +
- " public static final char[] cIFDEF = \"ifdef\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cIFNDEF = \"ifndef\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cELIF = \"elif\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cENDIF = \"endif\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cINCLUDE = \"include\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cDEFINE = \"define\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cUNDEF = \"undef\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cERROR = \"error\".toCharArray(); //$NON-NLS-1$\n" +
- " public static final char[] cINCLUDE_NEXT = \"include_next\".toCharArray(); //$NON-NLS-1$\n" +
- "}\n" +
- "interface IScanner {\n" +
- " public static final int tPOUNDPOUND = -6;\n" +
- " public static final int tPOUND = -7;\n" +
- "}\n" +
- "abstract class B {\n" +
- " public B( int type, char [] filename, int lineNumber ) {\n" +
- " }\n" +
- " public int getType() { return 0; }\n" +
- "}",
- },
- "SUCCESS",
- null,
- true,
- null,
- options,
- null);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=126744
-public void test009() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static String CONSTANT = \n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n" +
- " \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy12\";\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(CONSTANT == CONSTANT);\n" +
- " }\n" +
- "}"
- },
- "true");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// Failed before using a non recursive implementation of deep binary
-// expressions.
-public void test010() {
- StringBuffer sourceCode = new StringBuffer(
- "public class X {\n" +
- " void foo(String a, String b, String c, String d, String e) {\n" +
- " String s = \n");
- for (int i = 0; i < 350; i++) {
- sourceCode.append(
- " \"abcdef\" + a + b + c + d + e + " +
- "\" ghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno" +
- "pqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n");
- }
- sourceCode.append(
- " \"abcdef\" + a + b + c + d + e + \" ghijklmnopqrstuvwxyz" +
- "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" +
- "abcdefghijklmnopqrstuvwxy12\";\n" +
- " }\n" +
- "}");
- this.runConformTest(
- new String[] {
- "X.java",
- sourceCode.toString()
- },
- "");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// check if we hit the 64Kb limit on method code lenth in class files before
-// filling the stack
-// need to use a computed string (else this source file will get blown away
-// as well)
-public void test011() {
- int length = 3 * 54 * 1000;
- // the longer the slower, but still needs to reach the limit...
- StringBuffer veryLongString = new StringBuffer(length + 20);
- veryLongString.append('"');
- Random random = new Random();
- while (veryLongString.length() < length) {
- veryLongString.append("\"+a+\"");
- veryLongString.append(random.nextLong());
- }
- veryLongString.append('"');
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(String a, String b, String c, String d, String e) {\n" +
- " String s = \n" +
- veryLongString.toString() +
- " + \"abcdef\" + a + b + c + d + e + \" ghiABCDEFGHIJKLMNOPQRSTUVWXYZjklmnopqrstuvwxyzabcdefghiABCDEFGHIJKLMNOPQRSTUVWXYZjklmnopqrstuvwxyzabcdefghiABCDEFGHIJKLMNOPQRSTUVWXYZjklmnopqrstuvwxyzabcdefghiABCDEFGHIJKLMNOPQRSTUVWXYZjklmnopqrstuvwxy12\";\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void foo(String a, String b, String c, String d, String e) {\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "The code of method foo(String, String, String, String, String) is " +
- "exceeding the 65535 bytes limit\n" +
- "----------\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-// variant: right member of the topmost expression is left-deep
-public void test012() {
- StringBuffer sourceCode = new StringBuffer(
- "public class X {\n" +
- " void foo(String a, String b, String c, String d, String e) {\n" +
- " String s = a + (\n");
- for (int i = 0; i < 1000; i++) {
- sourceCode.append(
- " \"abcdef\" + a + b + c + d + e + " +
- "\" ghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno" +
- "pqrstuvwxyzabcdefghijklmnopqrstuvwxyz\" +\n");
- }
- sourceCode.append(
- " \"abcdef\" + a + b + c + d + e + \" ghijklmnopqrstuvwxyz" +
- "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" +
- "abcdefghijklmnopqrstuvwxy12\");\n" +
- " }\n" +
- "}");
- this.runConformTest(
- new String[] {
- "X.java",
- sourceCode.toString()
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
-//variant: right member of the topmost expression is left-deep
-public void test013() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " // left to right marker\n" +
- " protected static char LRM = \'\\u200e\';\n" +
- " // left to right embedding\n" +
- " protected static char LRE = \'\\u202a\';\n" +
- " // pop directional format \n" +
- " protected static char PDF = \'\\u202c\';\n" +
- "\n" +
- " private static String PATH_1_RESULT = LRE + \"d\" + PDF + \":\" + LRM + \"\\\\\" + LRM + LRE + \"test\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05d0\\u05d1\\u05d2\\u05d3 \\u05d4\\u05d5\" + PDF + \"\\\\\" + LRM + LRE + \"segment\" + PDF;\n" +
- " private static String PATH_2_RESULT = LRM + \"\\\\\" + LRM + LRE + \"test\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05d0\\u05d1\\u05d2\\u05d3 \\u05d4\\u05d5\" + PDF + \"\\\\\" + LRM + LRE + \"segment\" + PDF;\n" +
- " private static String PATH_3_RESULT = LRE + \"d\" + PDF + \":\" + LRM + \"\\\\\" + LRM + LRE + \"\\u05ea\\u05e9\\u05e8\\u05e7\\u05e6 abcdef-\\u05e5\\u05e4\\u05e3\" + PDF + \"\\\\\" + LRM + LRE + \"xyz\" + PDF + \"\\\\\" + LRM + LRE + \"abcdef\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05e2\\u05e1\\u05e0\" + PDF;\n" +
- " private static String PATH_4_RESULT = LRM + \"\\\\\" + LRM + LRE + \"\\u05ea\\u05e9\\u05e8\\u05e7\\u05e6 abcdef-\\u05e5\\u05e4\\u05e3\" + PDF + \"\\\\\" + LRM + LRE + \"xyz\" + PDF + \"\\\\\" + LRM + LRE + \"abcdef\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05e2\\u05e1\\05e0\" + PDF;\n" +
- " private static String PATH_5_RESULT = LRE + \"d\" + PDF + \":\" + LRM + \"\\\\\" + LRM + LRE + \"\\u05ea\\u05e9\\u05e8\\u05e7\\u05e6 abcdef-\\u05e5\\u05e4\\u05e3\" + PDF + \"\\\\\" + LRM + LRE + \"xyz\" + PDF + \"\\\\\" + LRM + LRE + \"abcdef\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05e2\\u05e1\\05e0\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05df\\u05fd\\u05dd\" + PDF + \".\" + LRM + LRE + \"java\" + PDF;\n" +
- " private static String PATH_6_RESULT = LRE + \"d\" + PDF + \":\" + LRM + \"\\\\\" + LRM + LRE + \"\\u05ea\\u05e9\\u05e8\\u05e7\\u05e6 abcdef-\\u05e5\\u05e4\\u05e3\" + PDF + \"\\\\\" + LRM + LRE + \"xyz\" + PDF + \"\\\\\" + LRM + LRE + \"abcdef\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05e2\\u05e1\\05e0\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05df\\u05fd\\u05dd\" + PDF + \".\" + LRM + LRE + \"\\u05dc\\u05db\\u05da\" + PDF;\n" +
- " private static String PATH_7_RESULT = LRE + \"d\" + PDF + \":\" + LRM + \"\\\\\" + LRM + LRE + \"\\u05ea\\u05e9\\u05e8\\u05e7\\u05e6 abcdef-\\u05e5\\u05e4\\u05e3\" + PDF + \"\\\\\" + LRM + LRE + \"xyz\" + PDF + \"\\\\\" + LRM + LRE + \"abcdef\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05e2\\u05e1\\05e0\" + PDF + \"\\\\\" + LRM + LRE + \"Test\" + PDF + \".\" + LRM + LRE + \"java\" + PDF;\n" +
- " private static String PATH_8_RESULT = LRM + \"\\\\\" + LRM + LRE + \"test\" + PDF + \"\\\\\" + LRM + LRE + \"jkl\\u05d0\\u05d1\\u05d2\\u05d3 \\u05d4\\u05d5\" + PDF + \"\\\\\" + LRM + LRE + \"segment\" + PDF;\n" +
- " private static String PATH_9_RESULT = LRM + \"\\\\\" + LRM + LRE + \"test\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05d0\\u05d1\\u05d2\\u05d3 \\u05d4\\u05d5jkl\" + PDF + \"\\\\\" + LRM + LRE + \"segment\" + PDF;\n" +
- " private static String PATH_10_RESULT = LRE + \"d\" + PDF + \":\" + LRM + \"\\\\\" + LRM + LRE + \"t\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05d0\" + PDF + \"\\\\\" + LRM + LRE + \"segment\" + PDF;\n" +
- " private static String PATH_11_RESULT = \"\\\\\" + LRM + LRE + \"t\" + PDF + \"\\\\\" + LRM + LRE + \"\\u05d0\" + PDF + \"\\\\\" + LRM + LRE + \"segment\" + PDF;\n" +
- " private static String PATH_12_RESULT = LRE + \"d\" + PDF + \":\" + LRM + \"\\\\\" + LRM;\n" +
- " private static String PATH_13_RESULT = LRM + \"\\\\\" + LRM + LRE + \"test\" + PDF;\n" +
- "\n" +
- " private static String OTHER_STRING_NO_DELIM = \"\\u05ea\\u05e9\\u05e8\\u05e7\\u05e6 abcdef-\\u05e5\\u05e4\\u05e3\";\n" +
- "\n" +
- " private static String OTHER_STRING_1_RESULT = LRM + \"*\" + LRM + \".\" + LRM + LRE + \"java\" + PDF;\n" +
- " private static String OTHER_STRING_2_RESULT = LRM + \"*\" + LRM + \".\" + LRM + LRE + \"\\u05d0\\u05d1\\u05d2\" + PDF;\n" +
- " private static String OTHER_STRING_3_RESULT = LRE + \"\\u05d0\\u05d1\\u05d2 \" + PDF + \"=\" + LRM + LRE + \" \\u05ea\\u05e9\\u05e8\\u05e7\\u05e6\" + PDF;\n" +
- " // result strings if null delimiter is passed for *.<string> texts\n" +
- " private static String OTHER_STRING_1_ND_RESULT = LRE + \"*\" + PDF + \".\" + LRM + LRE + \"java\" + PDF;\n" +
- " private static String OTHER_STRING_2_ND_RESULT = LRE + \"*\" + PDF + \".\" + LRM + LRE + \"\\u05d0\\u05d1\\u05d2\" + PDF;\n" +
- "\n" +
- " private static String[] RESULT_DEFAULT_PATHS = {PATH_1_RESULT, PATH_2_RESULT, PATH_3_RESULT, PATH_4_RESULT, PATH_5_RESULT, PATH_6_RESULT, PATH_7_RESULT, PATH_8_RESULT, PATH_9_RESULT, PATH_10_RESULT, PATH_11_RESULT, PATH_12_RESULT, PATH_13_RESULT};\n" +
- "\n" +
- " private static String[] RESULT_STAR_PATHS = {OTHER_STRING_1_RESULT, OTHER_STRING_2_RESULT};\n" +
- " private static String[] RESULT_EQUALS_PATHS = {OTHER_STRING_3_RESULT};\n" +
- " private static String[] RESULT_STAR_PATHS_ND = {OTHER_STRING_1_ND_RESULT, OTHER_STRING_2_ND_RESULT};\n" +
- "\n" +
- " /**\n" +
- " * Constructor.\n" +
- " * \n" +
- " * @param name test name\n" +
- " */\n" +
- " public X(String name) {\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(\"SUCCESS\");\n" +
- " }\n" +
- "}\n"
- },
- "SUCCESS");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124099
-// Undue partial reset of receiver in
-// UnconditionalFlowInfo#addInitializationsFrom.
-public void test014() {
- this.runConformTest(new String[] {
- "X.java",
- "class X {\n" +
- " int i01, i02, i03, i04, i05, i06, i07, i08, i09,\n" +
- " i10, i11, i12, i13, i14, i15, i16, i17, i18, i19,\n" +
- " i20, i21, i22, i23, i24, i25, i26, i27, i28, i29,\n" +
- " i30, i31, i32, i33, i34, i35, i36, i37, i38, i39,\n" +
- " i40, i41, i42, i43, i44, i45, i46, i47, i48, i49,\n" +
- " i50, i51, i52, i53, i54, i55, i56, i57, i58, i59,\n" +
- " i60, i61, i62, i63, i64, i65 = 1;\n" +
- "public X() {\n" +
- " new Object() {\n" +
- " int \n" +
- " k01, k02, k03, k04, k05, k06, k07, k08, k09,\n" +
- " k10, k11, k12, k13, k14, k15, k16, k17, k18, k19,\n" +
- " k20, k21, k22, k23, k24, k25, k26, k27, k28, k29,\n" +
- " k30, k31, k32, k33, k34, k35, k36, k37, k38, k39,\n" +
- " k40, k41, k42, k43, k44, k45, k46, k47, k48, k49,\n" +
- " k50, k51, k52, k53, k54, k55, k56, k57, k58, k59,\n" +
- " k60, k61, k62, k63, k64;\n" +
- " int \n" +
- " k101, k102, k103, k104, k105, k106, k107, k108, k109,\n" +
- " k110, k111, k112, k113, k114, k115, k116, k117, k118, k119,\n" +
- " k120, k121, k122, k123, k124, k125, k126, k127, k128, k129,\n" +
- " k130, k131, k132, k133, k134, k135, k136, k137, k138, k139,\n" +
- " k140, k141, k142, k143, k144, k145, k146, k147, k148, k149,\n" +
- " k150, k151, k152, k153, k154, k155, k156, k157, k158, k159,\n" +
- " k160, k161, k162, k163, k164;\n" +
- " final int l = 1;\n" +
- " public int hashCode() {\n" +
- " return\n" +
- " k01 + k02 + k03 + k04 + k05 + k06 + k07 + k08 + k09 +\n" +
- " k10 + k11 + k12 + k13 + k14 + k15 + k16 + k17 + k18 + k19 +\n" +
- " k20 + k21 + k22 + k23 + k24 + k25 + k26 + k27 + k28 + k29 +\n" +
- " k30 + k31 + k32 + k33 + k34 + k35 + k36 + k37 + k38 + k39 +\n" +
- " k40 + k41 + k42 + k43 + k44 + k45 + k46 + k47 + k48 + k49 +\n" +
- " k50 + k51 + k52 + k53 + k54 + k55 + k56 + k57 + k58 + k59 +\n" +
- " k60 + k61 + k62 + k63 + k64 +\n" +
- " k101 + k102 + k103 + k104 + k105 + k106 + k107 + k108 + k109 +\n" +
- " k110 + k111 + k112 + k113 + k114 + k115 + k116 + k117 + k118 + k119 +\n" +
- " k120 + k121 + k122 + k123 + k124 + k125 + k126 + k127 + k128 + k129 +\n" +
- " k130 + k131 + k132 + k133 + k134 + k135 + k136 + k137 + k138 + k139 +\n" +
- " k140 + k141 + k142 + k143 + k144 + k145 + k146 + k147 + k148 + k149 +\n" +
- " k150 + k151 + k152 + k153 + k154 + k155 + k156 + k157 + k158 + k159 +\n" +
- " k160 + k161 + k162 + k163 + k164 +\n" +
- " l;\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- "\n" +
- "}\n" +
- "\n",
- },
- "");
-}
-public void test015() {
- this.runConformTest(new String[] {
- "X.java",
- "public class X {\n" +
- " public static int foo(int i) {\n" +
- " try {\n" +
- " switch(i) {\n" +
- " case 0 :\n" +
- " return 3;\n" +
- " case 1 :\n" +
- " return 3;\n" +
- " case 2 :\n" +
- " return 3;\n" +
- " case 3 :\n" +
- " return 3;\n" +
- " case 4 :\n" +
- " return 3;\n" +
- " case 5 :\n" +
- " return 3;\n" +
- " case 6 :\n" +
- " return 3;\n" +
- " case 7 :\n" +
- " return 3;\n" +
- " case 8 :\n" +
- " return 3;\n" +
- " case 9 :\n" +
- " return 3;\n" +
- " case 10 :\n" +
- " return 3;\n" +
- " case 11 :\n" +
- " return 3;\n" +
- " case 12 :\n" +
- " return 3;\n" +
- " case 13 :\n" +
- " return 3;\n" +
- " case 14 :\n" +
- " return 3;\n" +
- " case 15 :\n" +
- " return 3;\n" +
- " case 16 :\n" +
- " return 3;\n" +
- " case 17 :\n" +
- " return 3;\n" +
- " case 18 :\n" +
- " return 3;\n" +
- " case 19 :\n" +
- " return 3;\n" +
- " case 20 :\n" +
- " return 3;\n" +
- " case 21 :\n" +
- " return 3;\n" +
- " case 22 :\n" +
- " return 3;\n" +
- " case 23 :\n" +
- " return 3;\n" +
- " case 24 :\n" +
- " return 3;\n" +
- " case 25 :\n" +
- " return 3;\n" +
- " case 26 :\n" +
- " return 3;\n" +
- " case 27 :\n" +
- " return 3;\n" +
- " case 28 :\n" +
- " return 3;\n" +
- " case 29 :\n" +
- " return 3;\n" +
- " case 30 :\n" +
- " return 3;\n" +
- " case 31 :\n" +
- " return 3;\n" +
- " case 32 :\n" +
- " return 3;\n" +
- " case 33 :\n" +
- " return 3;\n" +
- " case 34 :\n" +
- " return 3;\n" +
- " case 35 :\n" +
- " return 3;\n" +
- " case 36 :\n" +
- " return 3;\n" +
- " case 37 :\n" +
- " return 3;\n" +
- " case 38 :\n" +
- " return 3;\n" +
- " case 39 :\n" +
- " return 3;\n" +
- " case 40 :\n" +
- " return 3;\n" +
- " case 41 :\n" +
- " return 3;\n" +
- " case 42 :\n" +
- " return 3;\n" +
- " case 43 :\n" +
- " return 3;\n" +
- " case 44 :\n" +
- " return 3;\n" +
- " case 45 :\n" +
- " return 3;\n" +
- " case 46 :\n" +
- " return 3;\n" +
- " case 47 :\n" +
- " return 3;\n" +
- " case 48 :\n" +
- " return 3;\n" +
- " case 49 :\n" +
- " return 3;\n" +
- " case 50 :\n" +
- " return 3;\n" +
- " case 51 :\n" +
- " return 3;\n" +
- " case 52 :\n" +
- " return 3;\n" +
- " case 53 :\n" +
- " return 3;\n" +
- " case 54 :\n" +
- " return 3;\n" +
- " case 55 :\n" +
- " return 3;\n" +
- " case 56 :\n" +
- " return 3;\n" +
- " case 57 :\n" +
- " return 3;\n" +
- " case 58 :\n" +
- " return 3;\n" +
- " case 59 :\n" +
- " return 3;\n" +
- " case 60 :\n" +
- " return 3;\n" +
- " case 61 :\n" +
- " return 3;\n" +
- " case 62 :\n" +
- " return 3;\n" +
- " case 63 :\n" +
- " return 3;\n" +
- " case 64 :\n" +
- " return 3;\n" +
- " case 65 :\n" +
- " return 3;\n" +
- " case 66 :\n" +
- " return 3;\n" +
- " case 67 :\n" +
- " return 3;\n" +
- " case 68 :\n" +
- " return 3;\n" +
- " case 69 :\n" +
- " return 3;\n" +
- " case 70 :\n" +
- " return 3;\n" +
- " case 71 :\n" +
- " return 3;\n" +
- " case 72 :\n" +
- " return 3;\n" +
- " case 73 :\n" +
- " return 3;\n" +
- " case 74 :\n" +
- " return 3;\n" +
- " case 75 :\n" +
- " return 3;\n" +
- " case 76 :\n" +
- " return 3;\n" +
- " case 77 :\n" +
- " return 3;\n" +
- " case 78 :\n" +
- " return 3;\n" +
- " case 79 :\n" +
- " return 3;\n" +
- " case 80 :\n" +
- " return 3;\n" +
- " case 81 :\n" +
- " return 3;\n" +
- " case 82 :\n" +
- " return 3;\n" +
- " case 83 :\n" +
- " return 3;\n" +
- " case 84 :\n" +
- " return 3;\n" +
- " case 85 :\n" +
- " return 3;\n" +
- " case 86 :\n" +
- " return 3;\n" +
- " case 87 :\n" +
- " return 3;\n" +
- " case 88 :\n" +
- " return 3;\n" +
- " case 89 :\n" +
- " return 3;\n" +
- " case 90 :\n" +
- " return 3;\n" +
- " case 91 :\n" +
- " return 3;\n" +
- " case 92 :\n" +
- " return 3;\n" +
- " case 93 :\n" +
- " return 3;\n" +
- " case 94 :\n" +
- " return 3;\n" +
- " case 95 :\n" +
- " return 3;\n" +
- " case 96 :\n" +
- " return 3;\n" +
- " case 97 :\n" +
- " return 3;\n" +
- " case 98 :\n" +
- " return 3;\n" +
- " case 99 :\n" +
- " return 3;\n" +
- " case 100 :\n" +
- " return 3;\n" +
- " case 101 :\n" +
- " return 3;\n" +
- " case 102 :\n" +
- " return 3;\n" +
- " case 103 :\n" +
- " return 3;\n" +
- " case 104 :\n" +
- " return 3;\n" +
- " case 105 :\n" +
- " return 3;\n" +
- " case 106 :\n" +
- " return 3;\n" +
- " case 107 :\n" +
- " return 3;\n" +
- " case 108 :\n" +
- " return 3;\n" +
- " case 109 :\n" +
- " return 3;\n" +
- " case 110 :\n" +
- " return 3;\n" +
- " case 111 :\n" +
- " return 3;\n" +
- " case 112 :\n" +
- " return 3;\n" +
- " case 113 :\n" +
- " return 3;\n" +
- " case 114 :\n" +
- " return 3;\n" +
- " case 115 :\n" +
- " return 3;\n" +
- " case 116 :\n" +
- " return 3;\n" +
- " case 117 :\n" +
- " return 3;\n" +
- " case 118 :\n" +
- " return 3;\n" +
- " case 119 :\n" +
- " return 3;\n" +
- " case 120 :\n" +
- " return 3;\n" +
- " case 121 :\n" +
- " return 3;\n" +
- " case 122 :\n" +
- " return 3;\n" +
- " case 123 :\n" +
- " return 3;\n" +
- " case 124 :\n" +
- " return 3;\n" +
- " case 125 :\n" +
- " return 3;\n" +
- " case 126 :\n" +
- " return 3;\n" +
- " case 127 :\n" +
- " return 3;\n" +
- " case 128 :\n" +
- " return 3;\n" +
- " case 129 :\n" +
- " return 3;\n" +
- " case 130 :\n" +
- " return 3;\n" +
- " case 131 :\n" +
- " return 3;\n" +
- " case 132 :\n" +
- " return 3;\n" +
- " case 133 :\n" +
- " return 3;\n" +
- " case 134 :\n" +
- " return 3;\n" +
- " case 135 :\n" +
- " return 3;\n" +
- " case 136 :\n" +
- " return 3;\n" +
- " case 137 :\n" +
- " return 3;\n" +
- " case 138 :\n" +
- " return 3;\n" +
- " case 139 :\n" +
- " return 3;\n" +
- " case 140 :\n" +
- " return 3;\n" +
- " case 141 :\n" +
- " return 3;\n" +
- " case 142 :\n" +
- " return 3;\n" +
- " case 143 :\n" +
- " return 3;\n" +
- " case 144 :\n" +
- " return 3;\n" +
- " case 145 :\n" +
- " return 3;\n" +
- " case 146 :\n" +
- " return 3;\n" +
- " case 147 :\n" +
- " return 3;\n" +
- " case 148 :\n" +
- " return 3;\n" +
- " case 149 :\n" +
- " return 3;\n" +
- " case 150 :\n" +
- " return 3;\n" +
- " case 151 :\n" +
- " return 3;\n" +
- " case 152 :\n" +
- " return 3;\n" +
- " case 153 :\n" +
- " return 3;\n" +
- " case 154 :\n" +
- " return 3;\n" +
- " case 155 :\n" +
- " return 3;\n" +
- " case 156 :\n" +
- " return 3;\n" +
- " case 157 :\n" +
- " return 3;\n" +
- " case 158 :\n" +
- " return 3;\n" +
- " case 159 :\n" +
- " return 3;\n" +
- " case 160 :\n" +
- " return 3;\n" +
- " case 161 :\n" +
- " return 3;\n" +
- " case 162 :\n" +
- " return 3;\n" +
- " case 163 :\n" +
- " return 3;\n" +
- " case 164 :\n" +
- " return 3;\n" +
- " case 165 :\n" +
- " return 3;\n" +
- " case 166 :\n" +
- " return 3;\n" +
- " case 167 :\n" +
- " return 3;\n" +
- " case 168 :\n" +
- " return 3;\n" +
- " case 169 :\n" +
- " return 3;\n" +
- " case 170 :\n" +
- " return 3;\n" +
- " case 171 :\n" +
- " return 3;\n" +
- " case 172 :\n" +
- " return 3;\n" +
- " case 173 :\n" +
- " return 3;\n" +
- " case 174 :\n" +
- " return 3;\n" +
- " case 175 :\n" +
- " return 3;\n" +
- " case 176 :\n" +
- " return 3;\n" +
- " case 177 :\n" +
- " return 3;\n" +
- " case 178 :\n" +
- " return 3;\n" +
- " case 179 :\n" +
- " return 3;\n" +
- " case 180 :\n" +
- " return 3;\n" +
- " case 181 :\n" +
- " return 3;\n" +
- " case 182 :\n" +
- " return 3;\n" +
- " case 183 :\n" +
- " return 3;\n" +
- " case 184 :\n" +
- " return 3;\n" +
- " case 185 :\n" +
- " return 3;\n" +
- " case 186 :\n" +
- " return 3;\n" +
- " case 187 :\n" +
- " return 3;\n" +
- " case 188 :\n" +
- " return 3;\n" +
- " case 189 :\n" +
- " return 3;\n" +
- " case 190 :\n" +
- " return 3;\n" +
- " case 191 :\n" +
- " return 3;\n" +
- " case 192 :\n" +
- " return 3;\n" +
- " case 193 :\n" +
- " return 3;\n" +
- " case 194 :\n" +
- " return 3;\n" +
- " case 195 :\n" +
- " return 3;\n" +
- " case 196 :\n" +
- " return 3;\n" +
- " case 197 :\n" +
- " return 3;\n" +
- " case 198 :\n" +
- " return 3;\n" +
- " case 199 :\n" +
- " return 3;\n" +
- " case 200 :\n" +
- " return 3;\n" +
- " case 201 :\n" +
- " return 3;\n" +
- " case 202 :\n" +
- " return 3;\n" +
- " case 203 :\n" +
- " return 3;\n" +
- " case 204 :\n" +
- " return 3;\n" +
- " case 205 :\n" +
- " return 3;\n" +
- " case 206 :\n" +
- " return 3;\n" +
- " case 207 :\n" +
- " return 3;\n" +
- " case 208 :\n" +
- " return 3;\n" +
- " case 209 :\n" +
- " return 3;\n" +
- " case 210 :\n" +
- " return 3;\n" +
- " case 211 :\n" +
- " return 3;\n" +
- " case 212 :\n" +
- " return 3;\n" +
- " case 213 :\n" +
- " return 3;\n" +
- " case 214 :\n" +
- " return 3;\n" +
- " case 215 :\n" +
- " return 3;\n" +
- " case 216 :\n" +
- " return 3;\n" +
- " case 217 :\n" +
- " return 3;\n" +
- " case 218 :\n" +
- " return 3;\n" +
- " case 219 :\n" +
- " return 3;\n" +
- " case 220 :\n" +
- " return 3;\n" +
- " case 221 :\n" +
- " return 3;\n" +
- " case 222 :\n" +
- " return 3;\n" +
- " case 223 :\n" +
- " return 3;\n" +
- " case 224 :\n" +
- " return 3;\n" +
- " case 225 :\n" +
- " return 3;\n" +
- " case 226 :\n" +
- " return 3;\n" +
- " case 227 :\n" +
- " return 3;\n" +
- " case 228 :\n" +
- " return 3;\n" +
- " case 229 :\n" +
- " return 3;\n" +
- " case 230 :\n" +
- " return 3;\n" +
- " case 231 :\n" +
- " return 3;\n" +
- " case 232 :\n" +
- " return 3;\n" +
- " case 233 :\n" +
- " return 3;\n" +
- " case 234 :\n" +
- " return 3;\n" +
- " case 235 :\n" +
- " return 3;\n" +
- " case 236 :\n" +
- " return 3;\n" +
- " case 237 :\n" +
- " return 3;\n" +
- " case 238 :\n" +
- " return 3;\n" +
- " case 239 :\n" +
- " return 3;\n" +
- " case 240 :\n" +
- " return 3;\n" +
- " case 241 :\n" +
- " return 3;\n" +
- " case 242 :\n" +
- " return 3;\n" +
- " case 243 :\n" +
- " return 3;\n" +
- " case 244 :\n" +
- " return 3;\n" +
- " case 245 :\n" +
- " return 3;\n" +
- " case 246 :\n" +
- " return 3;\n" +
- " case 247 :\n" +
- " return 3;\n" +
- " case 248 :\n" +
- " return 3;\n" +
- " case 249 :\n" +
- " return 3;\n" +
- " case 250 :\n" +
- " return 3;\n" +
- " case 251 :\n" +
- " return 3;\n" +
- " case 252 :\n" +
- " return 3;\n" +
- " case 253 :\n" +
- " return 3;\n" +
- " case 254 :\n" +
- " return 3;\n" +
- " case 255 :\n" +
- " return 3;\n" +
- " case 256 :\n" +
- " return 3;\n" +
- " case 257 :\n" +
- " return 3;\n" +
- " case 258 :\n" +
- " return 3;\n" +
- " case 259 :\n" +
- " return 3;\n" +
- " case 260 :\n" +
- " return 3;\n" +
- " case 261 :\n" +
- " return 3;\n" +
- " case 262 :\n" +
- " return 3;\n" +
- " case 263 :\n" +
- " return 3;\n" +
- " case 264 :\n" +
- " return 3;\n" +
- " case 265 :\n" +
- " return 3;\n" +
- " case 266 :\n" +
- " return 3;\n" +
- " case 267 :\n" +
- " return 3;\n" +
- " case 268 :\n" +
- " return 3;\n" +
- " case 269 :\n" +
- " return 3;\n" +
- " case 270 :\n" +
- " return 3;\n" +
- " case 271 :\n" +
- " return 3;\n" +
- " case 272 :\n" +
- " return 3;\n" +
- " case 273 :\n" +
- " return 3;\n" +
- " case 274 :\n" +
- " return 3;\n" +
- " case 275 :\n" +
- " return 3;\n" +
- " case 276 :\n" +
- " return 3;\n" +
- " case 277 :\n" +
- " return 3;\n" +
- " case 278 :\n" +
- " return 3;\n" +
- " case 279 :\n" +
- " return 3;\n" +
- " case 280 :\n" +
- " return 3;\n" +
- " case 281 :\n" +
- " return 3;\n" +
- " case 282 :\n" +
- " return 3;\n" +
- " case 283 :\n" +
- " return 3;\n" +
- " case 284 :\n" +
- " return 3;\n" +
- " case 285 :\n" +
- " return 3;\n" +
- " case 286 :\n" +
- " return 3;\n" +
- " case 287 :\n" +
- " return 3;\n" +
- " case 288 :\n" +
- " return 3;\n" +
- " case 289 :\n" +
- " return 3;\n" +
- " case 290 :\n" +
- " return 3;\n" +
- " case 291 :\n" +
- " return 3;\n" +
- " case 292 :\n" +
- " return 3;\n" +
- " case 293 :\n" +
- " return 3;\n" +
- " case 294 :\n" +
- " return 3;\n" +
- " case 295 :\n" +
- " return 3;\n" +
- " case 296 :\n" +
- " return 3;\n" +
- " case 297 :\n" +
- " return 3;\n" +
- " case 298 :\n" +
- " return 3;\n" +
- " case 299 :\n" +
- " return 3;\n" +
- " case 300 :\n" +
- " return 3;\n" +
- " case 301 :\n" +
- " return 3;\n" +
- " case 302 :\n" +
- " return 3;\n" +
- " case 303 :\n" +
- " return 3;\n" +
- " case 304 :\n" +
- " return 3;\n" +
- " case 305 :\n" +
- " return 3;\n" +
- " case 306 :\n" +
- " return 3;\n" +
- " case 307 :\n" +
- " return 3;\n" +
- " case 308 :\n" +
- " return 3;\n" +
- " case 309 :\n" +
- " return 3;\n" +
- " case 310 :\n" +
- " return 3;\n" +
- " case 311 :\n" +
- " return 3;\n" +
- " case 312 :\n" +
- " return 3;\n" +
- " case 313 :\n" +
- " return 3;\n" +
- " case 314 :\n" +
- " return 3;\n" +
- " case 315 :\n" +
- " return 3;\n" +
- " case 316 :\n" +
- " return 3;\n" +
- " case 317 :\n" +
- " return 3;\n" +
- " case 318 :\n" +
- " return 3;\n" +
- " case 319 :\n" +
- " return 3;\n" +
- " case 320 :\n" +
- " return 3;\n" +
- " case 321 :\n" +
- " return 3;\n" +
- " case 322 :\n" +
- " return 3;\n" +
- " case 323 :\n" +
- " return 3;\n" +
- " case 324 :\n" +
- " return 3;\n" +
- " case 325 :\n" +
- " return 3;\n" +
- " case 326 :\n" +
- " return 3;\n" +
- " case 327 :\n" +
- " return 3;\n" +
- " case 328 :\n" +
- " return 3;\n" +
- " case 329 :\n" +
- " return 3;\n" +
- " case 330 :\n" +
- " return 3;\n" +
- " case 331 :\n" +
- " return 3;\n" +
- " case 332 :\n" +
- " return 3;\n" +
- " case 333 :\n" +
- " return 3;\n" +
- " case 334 :\n" +
- " return 3;\n" +
- " case 335 :\n" +
- " return 3;\n" +
- " case 336 :\n" +
- " return 3;\n" +
- " case 337 :\n" +
- " return 3;\n" +
- " case 338 :\n" +
- " return 3;\n" +
- " case 339 :\n" +
- " return 3;\n" +
- " case 340 :\n" +
- " return 3;\n" +
- " case 341 :\n" +
- " return 3;\n" +
- " case 342 :\n" +
- " return 3;\n" +
- " case 343 :\n" +
- " return 3;\n" +
- " case 344 :\n" +
- " return 3;\n" +
- " case 345 :\n" +
- " return 3;\n" +
- " case 346 :\n" +
- " return 3;\n" +
- " case 347 :\n" +
- " return 3;\n" +
- " case 348 :\n" +
- " return 3;\n" +
- " case 349 :\n" +
- " return 3;\n" +
- " case 350 :\n" +
- " return 3;\n" +
- " case 351 :\n" +
- " return 3;\n" +
- " case 352 :\n" +
- " return 3;\n" +
- " case 353 :\n" +
- " return 3;\n" +
- " case 354 :\n" +
- " return 3;\n" +
- " case 355 :\n" +
- " return 3;\n" +
- " case 356 :\n" +
- " return 3;\n" +
- " case 357 :\n" +
- " return 3;\n" +
- " case 358 :\n" +
- " return 3;\n" +
- " case 359 :\n" +
- " return 3;\n" +
- " case 360 :\n" +
- " return 3;\n" +
- " case 361 :\n" +
- " return 3;\n" +
- " case 362 :\n" +
- " return 3;\n" +
- " case 363 :\n" +
- " return 3;\n" +
- " case 364 :\n" +
- " return 3;\n" +
- " case 365 :\n" +
- " return 3;\n" +
- " case 366 :\n" +
- " return 3;\n" +
- " case 367 :\n" +
- " return 3;\n" +
- " case 368 :\n" +
- " return 3;\n" +
- " case 369 :\n" +
- " return 3;\n" +
- " case 370 :\n" +
- " return 3;\n" +
- " case 371 :\n" +
- " return 3;\n" +
- " case 372 :\n" +
- " return 3;\n" +
- " case 373 :\n" +
- " return 3;\n" +
- " case 374 :\n" +
- " return 3;\n" +
- " case 375 :\n" +
- " return 3;\n" +
- " case 376 :\n" +
- " return 3;\n" +
- " case 377 :\n" +
- " return 3;\n" +
- " case 378 :\n" +
- " return 3;\n" +
- " case 379 :\n" +
- " return 3;\n" +
- " case 380 :\n" +
- " return 3;\n" +
- " case 381 :\n" +
- " return 3;\n" +
- " case 382 :\n" +
- " return 3;\n" +
- " case 383 :\n" +
- " return 3;\n" +
- " case 384 :\n" +
- " return 3;\n" +
- " case 385 :\n" +
- " return 3;\n" +
- " case 386 :\n" +
- " return 3;\n" +
- " case 387 :\n" +
- " return 3;\n" +
- " case 388 :\n" +
- " return 3;\n" +
- " case 389 :\n" +
- " return 3;\n" +
- " case 390 :\n" +
- " return 3;\n" +
- " case 391 :\n" +
- " return 3;\n" +
- " case 392 :\n" +
- " return 3;\n" +
- " case 393 :\n" +
- " return 3;\n" +
- " case 394 :\n" +
- " return 3;\n" +
- " case 395 :\n" +
- " return 3;\n" +
- " case 396 :\n" +
- " return 3;\n" +
- " case 397 :\n" +
- " return 3;\n" +
- " case 398 :\n" +
- " return 3;\n" +
- " case 399 :\n" +
- " return 3;\n" +
- " case 400 :\n" +
- " return 3;\n" +
- " case 401 :\n" +
- " return 3;\n" +
- " case 402 :\n" +
- " return 3;\n" +
- " case 403 :\n" +
- " return 3;\n" +
- " case 404 :\n" +
- " return 3;\n" +
- " case 405 :\n" +
- " return 3;\n" +
- " case 406 :\n" +
- " return 3;\n" +
- " case 407 :\n" +
- " return 3;\n" +
- " case 408 :\n" +
- " return 3;\n" +
- " case 409 :\n" +
- " return 3;\n" +
- " case 410 :\n" +
- " return 3;\n" +
- " case 411 :\n" +
- " return 3;\n" +
- " case 412 :\n" +
- " return 3;\n" +
- " case 413 :\n" +
- " return 3;\n" +
- " case 414 :\n" +
- " return 3;\n" +
- " case 415 :\n" +
- " return 3;\n" +
- " case 416 :\n" +
- " return 3;\n" +
- " case 417 :\n" +
- " return 3;\n" +
- " case 418 :\n" +
- " return 3;\n" +
- " case 419 :\n" +
- " return 3;\n" +
- " case 420 :\n" +
- " return 3;\n" +
- " case 421 :\n" +
- " return 3;\n" +
- " case 422 :\n" +
- " return 3;\n" +
- " case 423 :\n" +
- " return 3;\n" +
- " case 424 :\n" +
- " return 3;\n" +
- " case 425 :\n" +
- " return 3;\n" +
- " case 426 :\n" +
- " return 3;\n" +
- " case 427 :\n" +
- " return 3;\n" +
- " case 428 :\n" +
- " return 3;\n" +
- " case 429 :\n" +
- " return 3;\n" +
- " case 430 :\n" +
- " return 3;\n" +
- " case 431 :\n" +
- " return 3;\n" +
- " case 432 :\n" +
- " return 3;\n" +
- " case 433 :\n" +
- " return 3;\n" +
- " case 434 :\n" +
- " return 3;\n" +
- " case 435 :\n" +
- " return 3;\n" +
- " case 436 :\n" +
- " return 3;\n" +
- " case 437 :\n" +
- " return 3;\n" +
- " case 438 :\n" +
- " return 3;\n" +
- " case 439 :\n" +
- " return 3;\n" +
- " case 440 :\n" +
- " return 3;\n" +
- " case 441 :\n" +
- " return 3;\n" +
- " case 442 :\n" +
- " return 3;\n" +
- " case 443 :\n" +
- " return 3;\n" +
- " case 444 :\n" +
- " return 3;\n" +
- " case 445 :\n" +
- " return 3;\n" +
- " case 446 :\n" +
- " return 3;\n" +
- " case 447 :\n" +
- " return 3;\n" +
- " case 448 :\n" +
- " return 3;\n" +
- " case 449 :\n" +
- " return 3;\n" +
- " case 450 :\n" +
- " return 3;\n" +
- " case 451 :\n" +
- " return 3;\n" +
- " case 452 :\n" +
- " return 3;\n" +
- " case 453 :\n" +
- " return 3;\n" +
- " case 454 :\n" +
- " return 3;\n" +
- " case 455 :\n" +
- " return 3;\n" +
- " case 456 :\n" +
- " return 3;\n" +
- " case 457 :\n" +
- " return 3;\n" +
- " case 458 :\n" +
- " return 3;\n" +
- " case 459 :\n" +
- " return 3;\n" +
- " case 460 :\n" +
- " return 3;\n" +
- " case 461 :\n" +
- " return 3;\n" +
- " case 462 :\n" +
- " return 3;\n" +
- " case 463 :\n" +
- " return 3;\n" +
- " case 464 :\n" +
- " return 3;\n" +
- " case 465 :\n" +
- " return 3;\n" +
- " case 466 :\n" +
- " return 3;\n" +
- " case 467 :\n" +
- " return 3;\n" +
- " case 468 :\n" +
- " return 3;\n" +
- " case 469 :\n" +
- " return 3;\n" +
- " case 470 :\n" +
- " return 3;\n" +
- " case 471 :\n" +
- " return 3;\n" +
- " case 472 :\n" +
- " return 3;\n" +
- " case 473 :\n" +
- " return 3;\n" +
- " case 474 :\n" +
- " return 3;\n" +
- " case 475 :\n" +
- " return 3;\n" +
- " case 476 :\n" +
- " return 3;\n" +
- " case 477 :\n" +
- " return 3;\n" +
- " case 478 :\n" +
- " return 3;\n" +
- " case 479 :\n" +
- " return 3;\n" +
- " case 480 :\n" +
- " return 3;\n" +
- " case 481 :\n" +
- " return 3;\n" +
- " case 482 :\n" +
- " return 3;\n" +
- " case 483 :\n" +
- " return 3;\n" +
- " case 484 :\n" +
- " return 3;\n" +
- " case 485 :\n" +
- " return 3;\n" +
- " case 486 :\n" +
- " return 3;\n" +
- " case 487 :\n" +
- " return 3;\n" +
- " case 488 :\n" +
- " return 3;\n" +
- " case 489 :\n" +
- " return 3;\n" +
- " case 490 :\n" +
- " return 3;\n" +
- " case 491 :\n" +
- " return 3;\n" +
- " case 492 :\n" +
- " return 3;\n" +
- " case 493 :\n" +
- " return 3;\n" +
- " case 494 :\n" +
- " return 3;\n" +
- " case 495 :\n" +
- " return 3;\n" +
- " case 496 :\n" +
- " return 3;\n" +
- " case 497 :\n" +
- " return 3;\n" +
- " case 498 :\n" +
- " return 3;\n" +
- " case 499 :\n" +
- " return 3;\n" +
- " case 500 :\n" +
- " return 3;\n" +
- " case 501 :\n" +
- " return 3;\n" +
- " case 502 :\n" +
- " return 3;\n" +
- " case 503 :\n" +
- " return 3;\n" +
- " case 504 :\n" +
- " return 3;\n" +
- " case 505 :\n" +
- " return 3;\n" +
- " case 506 :\n" +
- " return 3;\n" +
- " case 507 :\n" +
- " return 3;\n" +
- " case 508 :\n" +
- " return 3;\n" +
- " case 509 :\n" +
- " return 3;\n" +
- " case 510 :\n" +
- " return 3;\n" +
- " case 511 :\n" +
- " return 3;\n" +
- " case 512 :\n" +
- " return 3;\n" +
- " case 513 :\n" +
- " return 3;\n" +
- " case 514 :\n" +
- " return 3;\n" +
- " case 515 :\n" +
- " return 3;\n" +
- " case 516 :\n" +
- " return 3;\n" +
- " case 517 :\n" +
- " return 3;\n" +
- " case 518 :\n" +
- " return 3;\n" +
- " case 519 :\n" +
- " return 3;\n" +
- " case 520 :\n" +
- " return 3;\n" +
- " case 521 :\n" +
- " return 3;\n" +
- " case 522 :\n" +
- " return 3;\n" +
- " case 523 :\n" +
- " return 3;\n" +
- " case 524 :\n" +
- " return 3;\n" +
- " case 525 :\n" +
- " return 3;\n" +
- " case 526 :\n" +
- " return 3;\n" +
- " case 527 :\n" +
- " return 3;\n" +
- " case 528 :\n" +
- " return 3;\n" +
- " case 529 :\n" +
- " return 3;\n" +
- " case 530 :\n" +
- " return 3;\n" +
- " case 531 :\n" +
- " return 3;\n" +
- " case 532 :\n" +
- " return 3;\n" +
- " case 533 :\n" +
- " return 3;\n" +
- " case 534 :\n" +
- " return 3;\n" +
- " case 535 :\n" +
- " return 3;\n" +
- " case 536 :\n" +
- " return 3;\n" +
- " case 537 :\n" +
- " return 3;\n" +
- " case 538 :\n" +
- " return 3;\n" +
- " case 539 :\n" +
- " return 3;\n" +
- " case 540 :\n" +
- " return 3;\n" +
- " case 541 :\n" +
- " return 3;\n" +
- " case 542 :\n" +
- " return 3;\n" +
- " case 543 :\n" +
- " return 3;\n" +
- " case 544 :\n" +
- " return 3;\n" +
- " case 545 :\n" +
- " return 3;\n" +
- " case 546 :\n" +
- " return 3;\n" +
- " case 547 :\n" +
- " return 3;\n" +
- " case 548 :\n" +
- " return 3;\n" +
- " case 549 :\n" +
- " return 3;\n" +
- " case 550 :\n" +
- " return 3;\n" +
- " case 551 :\n" +
- " return 3;\n" +
- " case 552 :\n" +
- " return 3;\n" +
- " case 553 :\n" +
- " return 3;\n" +
- " case 554 :\n" +
- " return 3;\n" +
- " case 555 :\n" +
- " return 3;\n" +
- " case 556 :\n" +
- " return 3;\n" +
- " case 557 :\n" +
- " return 3;\n" +
- " case 558 :\n" +
- " return 3;\n" +
- " case 559 :\n" +
- " return 3;\n" +
- " case 560 :\n" +
- " return 3;\n" +
- " case 561 :\n" +
- " return 3;\n" +
- " case 562 :\n" +
- " return 3;\n" +
- " case 563 :\n" +
- " return 3;\n" +
- " case 564 :\n" +
- " return 3;\n" +
- " case 565 :\n" +
- " return 3;\n" +
- " case 566 :\n" +
- " return 3;\n" +
- " case 567 :\n" +
- " return 3;\n" +
- " case 568 :\n" +
- " return 3;\n" +
- " case 569 :\n" +
- " return 3;\n" +
- " case 570 :\n" +
- " return 3;\n" +
- " case 571 :\n" +
- " return 3;\n" +
- " case 572 :\n" +
- " return 3;\n" +
- " case 573 :\n" +
- " return 3;\n" +
- " case 574 :\n" +
- " return 3;\n" +
- " case 575 :\n" +
- " return 3;\n" +
- " case 576 :\n" +
- " return 3;\n" +
- " case 577 :\n" +
- " return 3;\n" +
- " case 578 :\n" +
- " return 3;\n" +
- " case 579 :\n" +
- " return 3;\n" +
- " case 580 :\n" +
- " return 3;\n" +
- " case 581 :\n" +
- " return 3;\n" +
- " case 582 :\n" +
- " return 3;\n" +
- " case 583 :\n" +
- " return 3;\n" +
- " case 584 :\n" +
- " return 3;\n" +
- " case 585 :\n" +
- " return 3;\n" +
- " case 586 :\n" +
- " return 3;\n" +
- " case 587 :\n" +
- " return 3;\n" +
- " case 588 :\n" +
- " return 3;\n" +
- " case 589 :\n" +
- " return 3;\n" +
- " case 590 :\n" +
- " return 3;\n" +
- " case 591 :\n" +
- " return 3;\n" +
- " case 592 :\n" +
- " return 3;\n" +
- " case 593 :\n" +
- " return 3;\n" +
- " case 594 :\n" +
- " return 3;\n" +
- " case 595 :\n" +
- " return 3;\n" +
- " case 596 :\n" +
- " return 3;\n" +
- " case 597 :\n" +
- " return 3;\n" +
- " case 598 :\n" +
- " return 3;\n" +
- " case 599 :\n" +
- " return 3;\n" +
- " case 600 :\n" +
- " return 3;\n" +
- " case 601 :\n" +
- " return 3;\n" +
- " case 602 :\n" +
- " return 3;\n" +
- " case 603 :\n" +
- " return 3;\n" +
- " case 604 :\n" +
- " return 3;\n" +
- " case 605 :\n" +
- " return 3;\n" +
- " case 606 :\n" +
- " return 3;\n" +
- " case 607 :\n" +
- " return 3;\n" +
- " case 608 :\n" +
- " return 3;\n" +
- " case 609 :\n" +
- " return 3;\n" +
- " case 610 :\n" +
- " return 3;\n" +
- " case 611 :\n" +
- " return 3;\n" +
- " case 612 :\n" +
- " return 3;\n" +
- " case 613 :\n" +
- " return 3;\n" +
- " case 614 :\n" +
- " return 3;\n" +
- " case 615 :\n" +
- " return 3;\n" +
- " case 616 :\n" +
- " return 3;\n" +
- " case 617 :\n" +
- " return 3;\n" +
- " case 618 :\n" +
- " return 3;\n" +
- " case 619 :\n" +
- " return 3;\n" +
- " case 620 :\n" +
- " return 3;\n" +
- " case 621 :\n" +
- " return 3;\n" +
- " case 622 :\n" +
- " return 3;\n" +
- " case 623 :\n" +
- " return 3;\n" +
- " case 624 :\n" +
- " return 3;\n" +
- " case 625 :\n" +
- " return 3;\n" +
- " case 626 :\n" +
- " return 3;\n" +
- " case 627 :\n" +
- " return 3;\n" +
- " case 628 :\n" +
- " return 3;\n" +
- " case 629 :\n" +
- " return 3;\n" +
- " case 630 :\n" +
- " return 3;\n" +
- " case 631 :\n" +
- " return 3;\n" +
- " case 632 :\n" +
- " return 3;\n" +
- " case 633 :\n" +
- " return 3;\n" +
- " case 634 :\n" +
- " return 3;\n" +
- " case 635 :\n" +
- " return 3;\n" +
- " case 636 :\n" +
- " return 3;\n" +
- " case 637 :\n" +
- " return 3;\n" +
- " case 638 :\n" +
- " return 3;\n" +
- " case 639 :\n" +
- " return 3;\n" +
- " case 640 :\n" +
- " return 3;\n" +
- " case 641 :\n" +
- " return 3;\n" +
- " case 642 :\n" +
- " return 3;\n" +
- " case 643 :\n" +
- " return 3;\n" +
- " case 644 :\n" +
- " return 3;\n" +
- " case 645 :\n" +
- " return 3;\n" +
- " case 646 :\n" +
- " return 3;\n" +
- " case 647 :\n" +
- " return 3;\n" +
- " case 648 :\n" +
- " return 3;\n" +
- " case 649 :\n" +
- " return 3;\n" +
- " case 650 :\n" +
- " return 3;\n" +
- " case 651 :\n" +
- " return 3;\n" +
- " case 652 :\n" +
- " return 3;\n" +
- " case 653 :\n" +
- " return 3;\n" +
- " case 654 :\n" +
- " return 3;\n" +
- " case 655 :\n" +
- " return 3;\n" +
- " case 656 :\n" +
- " return 3;\n" +
- " case 657 :\n" +
- " return 3;\n" +
- " case 658 :\n" +
- " return 3;\n" +
- " case 659 :\n" +
- " return 3;\n" +
- " case 660 :\n" +
- " return 3;\n" +
- " case 661 :\n" +
- " return 3;\n" +
- " case 662 :\n" +
- " return 3;\n" +
- " case 663 :\n" +
- " return 3;\n" +
- " case 664 :\n" +
- " return 3;\n" +
- " case 665 :\n" +
- " return 3;\n" +
- " case 666 :\n" +
- " return 3;\n" +
- " case 667 :\n" +
- " return 3;\n" +
- " case 668 :\n" +
- " return 3;\n" +
- " case 669 :\n" +
- " return 3;\n" +
- " case 670 :\n" +
- " return 3;\n" +
- " case 671 :\n" +
- " return 3;\n" +
- " case 672 :\n" +
- " return 3;\n" +
- " case 673 :\n" +
- " return 3;\n" +
- " case 674 :\n" +
- " return 3;\n" +
- " case 675 :\n" +
- " return 3;\n" +
- " case 676 :\n" +
- " return 3;\n" +
- " case 677 :\n" +
- " return 3;\n" +
- " case 678 :\n" +
- " return 3;\n" +
- " case 679 :\n" +
- " return 3;\n" +
- " case 680 :\n" +
- " return 3;\n" +
- " case 681 :\n" +
- " return 3;\n" +
- " case 682 :\n" +
- " return 3;\n" +
- " case 683 :\n" +
- " return 3;\n" +
- " case 684 :\n" +
- " return 3;\n" +
- " case 685 :\n" +
- " return 3;\n" +
- " case 686 :\n" +
- " return 3;\n" +
- " case 687 :\n" +
- " return 3;\n" +
- " case 688 :\n" +
- " return 3;\n" +
- " case 689 :\n" +
- " return 3;\n" +
- " case 690 :\n" +
- " return 3;\n" +
- " case 691 :\n" +
- " return 3;\n" +
- " case 692 :\n" +
- " return 3;\n" +
- " case 693 :\n" +
- " return 3;\n" +
- " case 694 :\n" +
- " return 3;\n" +
- " case 695 :\n" +
- " return 3;\n" +
- " case 696 :\n" +
- " return 3;\n" +
- " case 697 :\n" +
- " return 3;\n" +
- " case 698 :\n" +
- " return 3;\n" +
- " case 699 :\n" +
- " return 3;\n" +
- " case 700 :\n" +
- " return 3;\n" +
- " case 701 :\n" +
- " return 3;\n" +
- " case 702 :\n" +
- " return 3;\n" +
- " case 703 :\n" +
- " return 3;\n" +
- " case 704 :\n" +
- " return 3;\n" +
- " case 705 :\n" +
- " return 3;\n" +
- " case 706 :\n" +
- " return 3;\n" +
- " case 707 :\n" +
- " return 3;\n" +
- " case 708 :\n" +
- " return 3;\n" +
- " case 709 :\n" +
- " return 3;\n" +
- " case 710 :\n" +
- " return 3;\n" +
- " case 711 :\n" +
- " return 3;\n" +
- " case 712 :\n" +
- " return 3;\n" +
- " case 713 :\n" +
- " return 3;\n" +
- " case 714 :\n" +
- " return 3;\n" +
- " case 715 :\n" +
- " return 3;\n" +
- " case 716 :\n" +
- " return 3;\n" +
- " case 717 :\n" +
- " return 3;\n" +
- " case 718 :\n" +
- " return 3;\n" +
- " case 719 :\n" +
- " return 3;\n" +
- " case 720 :\n" +
- " return 3;\n" +
- " case 721 :\n" +
- " return 3;\n" +
- " case 722 :\n" +
- " return 3;\n" +
- " case 723 :\n" +
- " return 3;\n" +
- " case 724 :\n" +
- " return 3;\n" +
- " case 725 :\n" +
- " return 3;\n" +
- " case 726 :\n" +
- " return 3;\n" +
- " case 727 :\n" +
- " return 3;\n" +
- " case 728 :\n" +
- " return 3;\n" +
- " case 729 :\n" +
- " return 3;\n" +
- " case 730 :\n" +
- " return 3;\n" +
- " case 731 :\n" +
- " return 3;\n" +
- " case 732 :\n" +
- " return 3;\n" +
- " case 733 :\n" +
- " return 3;\n" +
- " case 734 :\n" +
- " return 3;\n" +
- " case 735 :\n" +
- " return 3;\n" +
- " case 736 :\n" +
- " return 3;\n" +
- " case 737 :\n" +
- " return 3;\n" +
- " case 738 :\n" +
- " return 3;\n" +
- " case 739 :\n" +
- " return 3;\n" +
- " case 740 :\n" +
- " return 3;\n" +
- " case 741 :\n" +
- " return 3;\n" +
- " case 742 :\n" +
- " return 3;\n" +
- " case 743 :\n" +
- " return 3;\n" +
- " case 744 :\n" +
- " return 3;\n" +
- " case 745 :\n" +
- " return 3;\n" +
- " case 746 :\n" +
- " return 3;\n" +
- " case 747 :\n" +
- " return 3;\n" +
- " case 748 :\n" +
- " return 3;\n" +
- " case 749 :\n" +
- " return 3;\n" +
- " case 750 :\n" +
- " return 3;\n" +
- " case 751 :\n" +
- " return 3;\n" +
- " case 752 :\n" +
- " return 3;\n" +
- " case 753 :\n" +
- " return 3;\n" +
- " case 754 :\n" +
- " return 3;\n" +
- " case 755 :\n" +
- " return 3;\n" +
- " case 756 :\n" +
- " return 3;\n" +
- " case 757 :\n" +
- " return 3;\n" +
- " case 758 :\n" +
- " return 3;\n" +
- " case 759 :\n" +
- " return 3;\n" +
- " case 760 :\n" +
- " return 3;\n" +
- " case 761 :\n" +
- " return 3;\n" +
- " case 762 :\n" +
- " return 3;\n" +
- " case 763 :\n" +
- " return 3;\n" +
- " case 764 :\n" +
- " return 3;\n" +
- " case 765 :\n" +
- " return 3;\n" +
- " case 766 :\n" +
- " return 3;\n" +
- " case 767 :\n" +
- " return 3;\n" +
- " case 768 :\n" +
- " return 3;\n" +
- " case 769 :\n" +
- " return 3;\n" +
- " case 770 :\n" +
- " return 3;\n" +
- " case 771 :\n" +
- " return 3;\n" +
- " case 772 :\n" +
- " return 3;\n" +
- " case 773 :\n" +
- " return 3;\n" +
- " case 774 :\n" +
- " return 3;\n" +
- " case 775 :\n" +
- " return 3;\n" +
- " case 776 :\n" +
- " return 3;\n" +
- " case 777 :\n" +
- " return 3;\n" +
- " case 778 :\n" +
- " return 3;\n" +
- " case 779 :\n" +
- " return 3;\n" +
- " case 780 :\n" +
- " return 3;\n" +
- " case 781 :\n" +
- " return 3;\n" +
- " case 782 :\n" +
- " return 3;\n" +
- " case 783 :\n" +
- " return 3;\n" +
- " case 784 :\n" +
- " return 3;\n" +
- " case 785 :\n" +
- " return 3;\n" +
- " case 786 :\n" +
- " return 3;\n" +
- " case 787 :\n" +
- " return 3;\n" +
- " case 788 :\n" +
- " return 3;\n" +
- " case 789 :\n" +
- " return 3;\n" +
- " case 790 :\n" +
- " return 3;\n" +
- " case 791 :\n" +
- " return 3;\n" +
- " case 792 :\n" +
- " return 3;\n" +
- " case 793 :\n" +
- " return 3;\n" +
- " case 794 :\n" +
- " return 3;\n" +
- " case 795 :\n" +
- " return 3;\n" +
- " case 796 :\n" +
- " return 3;\n" +
- " case 797 :\n" +
- " return 3;\n" +
- " case 798 :\n" +
- " return 3;\n" +
- " case 799 :\n" +
- " return 3;\n" +
- " case 800 :\n" +
- " return 3;\n" +
- " case 801 :\n" +
- " return 3;\n" +
- " case 802 :\n" +
- " return 3;\n" +
- " case 803 :\n" +
- " return 3;\n" +
- " case 804 :\n" +
- " return 3;\n" +
- " case 805 :\n" +
- " return 3;\n" +
- " case 806 :\n" +
- " return 3;\n" +
- " case 807 :\n" +
- " return 3;\n" +
- " case 808 :\n" +
- " return 3;\n" +
- " case 809 :\n" +
- " return 3;\n" +
- " case 810 :\n" +
- " return 3;\n" +
- " case 811 :\n" +
- " return 3;\n" +
- " case 812 :\n" +
- " return 3;\n" +
- " case 813 :\n" +
- " return 3;\n" +
- " case 814 :\n" +
- " return 3;\n" +
- " case 815 :\n" +
- " return 3;\n" +
- " case 816 :\n" +
- " return 3;\n" +
- " case 817 :\n" +
- " return 3;\n" +
- " case 818 :\n" +
- " return 3;\n" +
- " case 819 :\n" +
- " return 3;\n" +
- " case 820 :\n" +
- " return 3;\n" +
- " case 821 :\n" +
- " return 3;\n" +
- " case 822 :\n" +
- " return 3;\n" +
- " case 823 :\n" +
- " return 3;\n" +
- " case 824 :\n" +
- " return 3;\n" +
- " case 825 :\n" +
- " return 3;\n" +
- " case 826 :\n" +
- " return 3;\n" +
- " case 827 :\n" +
- " return 3;\n" +
- " case 828 :\n" +
- " return 3;\n" +
- " case 829 :\n" +
- " return 3;\n" +
- " case 830 :\n" +
- " return 3;\n" +
- " case 831 :\n" +
- " return 3;\n" +
- " case 832 :\n" +
- " return 3;\n" +
- " case 833 :\n" +
- " return 3;\n" +
- " case 834 :\n" +
- " return 3;\n" +
- " case 835 :\n" +
- " return 3;\n" +
- " case 836 :\n" +
- " return 3;\n" +
- " case 837 :\n" +
- " return 3;\n" +
- " case 838 :\n" +
- " return 3;\n" +
- " case 839 :\n" +
- " return 3;\n" +
- " case 840 :\n" +
- " return 3;\n" +
- " case 841 :\n" +
- " return 3;\n" +
- " case 842 :\n" +
- " return 3;\n" +
- " case 843 :\n" +
- " return 3;\n" +
- " case 844 :\n" +
- " return 3;\n" +
- " case 845 :\n" +
- " return 3;\n" +
- " case 846 :\n" +
- " return 3;\n" +
- " case 847 :\n" +
- " return 3;\n" +
- " case 848 :\n" +
- " return 3;\n" +
- " case 849 :\n" +
- " return 3;\n" +
- " case 850 :\n" +
- " return 3;\n" +
- " case 851 :\n" +
- " return 3;\n" +
- " case 852 :\n" +
- " return 3;\n" +
- " case 853 :\n" +
- " return 3;\n" +
- " case 854 :\n" +
- " return 3;\n" +
- " case 855 :\n" +
- " return 3;\n" +
- " case 856 :\n" +
- " return 3;\n" +
- " case 857 :\n" +
- " return 3;\n" +
- " case 858 :\n" +
- " return 3;\n" +
- " case 859 :\n" +
- " return 3;\n" +
- " case 860 :\n" +
- " return 3;\n" +
- " case 861 :\n" +
- " return 3;\n" +
- " case 862 :\n" +
- " return 3;\n" +
- " case 863 :\n" +
- " return 3;\n" +
- " case 864 :\n" +
- " return 3;\n" +
- " case 865 :\n" +
- " return 3;\n" +
- " case 866 :\n" +
- " return 3;\n" +
- " case 867 :\n" +
- " return 3;\n" +
- " case 868 :\n" +
- " return 3;\n" +
- " case 869 :\n" +
- " return 3;\n" +
- " case 870 :\n" +
- " return 3;\n" +
- " case 871 :\n" +
- " return 3;\n" +
- " case 872 :\n" +
- " return 3;\n" +
- " case 873 :\n" +
- " return 3;\n" +
- " case 874 :\n" +
- " return 3;\n" +
- " case 875 :\n" +
- " return 3;\n" +
- " case 876 :\n" +
- " return 3;\n" +
- " case 877 :\n" +
- " return 3;\n" +
- " case 878 :\n" +
- " return 3;\n" +
- " case 879 :\n" +
- " return 3;\n" +
- " case 880 :\n" +
- " return 3;\n" +
- " case 881 :\n" +
- " return 3;\n" +
- " case 882 :\n" +
- " return 3;\n" +
- " case 883 :\n" +
- " return 3;\n" +
- " case 884 :\n" +
- " return 3;\n" +
- " case 885 :\n" +
- " return 3;\n" +
- " case 886 :\n" +
- " return 3;\n" +
- " case 887 :\n" +
- " return 3;\n" +
- " case 888 :\n" +
- " return 3;\n" +
- " case 889 :\n" +
- " return 3;\n" +
- " case 890 :\n" +
- " return 3;\n" +
- " case 891 :\n" +
- " return 3;\n" +
- " case 892 :\n" +
- " return 3;\n" +
- " case 893 :\n" +
- " return 3;\n" +
- " case 894 :\n" +
- " return 3;\n" +
- " case 895 :\n" +
- " return 3;\n" +
- " case 896 :\n" +
- " return 3;\n" +
- " case 897 :\n" +
- " return 3;\n" +
- " case 898 :\n" +
- " return 3;\n" +
- " case 899 :\n" +
- " return 3;\n" +
- " case 900 :\n" +
- " return 3;\n" +
- " case 901 :\n" +
- " return 3;\n" +
- " case 902 :\n" +
- " return 3;\n" +
- " case 903 :\n" +
- " return 3;\n" +
- " case 904 :\n" +
- " return 3;\n" +
- " case 905 :\n" +
- " return 3;\n" +
- " case 906 :\n" +
- " return 3;\n" +
- " case 907 :\n" +
- " return 3;\n" +
- " case 908 :\n" +
- " return 3;\n" +
- " case 909 :\n" +
- " return 3;\n" +
- " case 910 :\n" +
- " return 3;\n" +
- " case 911 :\n" +
- " return 3;\n" +
- " case 912 :\n" +
- " return 3;\n" +
- " case 913 :\n" +
- " return 3;\n" +
- " case 914 :\n" +
- " return 3;\n" +
- " case 915 :\n" +
- " return 3;\n" +
- " case 916 :\n" +
- " return 3;\n" +
- " case 917 :\n" +
- " return 3;\n" +
- " case 918 :\n" +
- " return 3;\n" +
- " case 919 :\n" +
- " return 3;\n" +
- " case 920 :\n" +
- " return 3;\n" +
- " case 921 :\n" +
- " return 3;\n" +
- " case 922 :\n" +
- " return 3;\n" +
- " case 923 :\n" +
- " return 3;\n" +
- " case 924 :\n" +
- " return 3;\n" +
- " case 925 :\n" +
- " return 3;\n" +
- " case 926 :\n" +
- " return 3;\n" +
- " case 927 :\n" +
- " return 3;\n" +
- " case 928 :\n" +
- " return 3;\n" +
- " case 929 :\n" +
- " return 3;\n" +
- " case 930 :\n" +
- " return 3;\n" +
- " case 931 :\n" +
- " return 3;\n" +
- " case 932 :\n" +
- " return 3;\n" +
- " case 933 :\n" +
- " return 3;\n" +
- " case 934 :\n" +
- " return 3;\n" +
- " case 935 :\n" +
- " return 3;\n" +
- " case 936 :\n" +
- " return 3;\n" +
- " case 937 :\n" +
- " return 3;\n" +
- " case 938 :\n" +
- " return 3;\n" +
- " case 939 :\n" +
- " return 3;\n" +
- " case 940 :\n" +
- " return 3;\n" +
- " case 941 :\n" +
- " return 3;\n" +
- " case 942 :\n" +
- " return 3;\n" +
- " case 943 :\n" +
- " return 3;\n" +
- " case 944 :\n" +
- " return 3;\n" +
- " case 945 :\n" +
- " return 3;\n" +
- " case 946 :\n" +
- " return 3;\n" +
- " case 947 :\n" +
- " return 3;\n" +
- " case 948 :\n" +
- " return 3;\n" +
- " case 949 :\n" +
- " return 3;\n" +
- " case 950 :\n" +
- " return 3;\n" +
- " case 951 :\n" +
- " return 3;\n" +
- " case 952 :\n" +
- " return 3;\n" +
- " case 953 :\n" +
- " return 3;\n" +
- " case 954 :\n" +
- " return 3;\n" +
- " case 955 :\n" +
- " return 3;\n" +
- " case 956 :\n" +
- " return 3;\n" +
- " case 957 :\n" +
- " return 3;\n" +
- " case 958 :\n" +
- " return 3;\n" +
- " case 959 :\n" +
- " return 3;\n" +
- " case 960 :\n" +
- " return 3;\n" +
- " case 961 :\n" +
- " return 3;\n" +
- " case 962 :\n" +
- " return 3;\n" +
- " case 963 :\n" +
- " return 3;\n" +
- " case 964 :\n" +
- " return 3;\n" +
- " case 965 :\n" +
- " return 3;\n" +
- " case 966 :\n" +
- " return 3;\n" +
- " case 967 :\n" +
- " return 3;\n" +
- " case 968 :\n" +
- " return 3;\n" +
- " case 969 :\n" +
- " return 3;\n" +
- " case 970 :\n" +
- " return 3;\n" +
- " case 971 :\n" +
- " return 3;\n" +
- " case 972 :\n" +
- " return 3;\n" +
- " case 973 :\n" +
- " return 3;\n" +
- " case 974 :\n" +
- " return 3;\n" +
- " case 975 :\n" +
- " return 3;\n" +
- " case 976 :\n" +
- " return 3;\n" +
- " case 977 :\n" +
- " return 3;\n" +
- " case 978 :\n" +
- " return 3;\n" +
- " case 979 :\n" +
- " return 3;\n" +
- " case 980 :\n" +
- " return 3;\n" +
- " case 981 :\n" +
- " return 3;\n" +
- " case 982 :\n" +
- " return 3;\n" +
- " case 983 :\n" +
- " return 3;\n" +
- " case 984 :\n" +
- " return 3;\n" +
- " case 985 :\n" +
- " return 3;\n" +
- " case 986 :\n" +
- " return 3;\n" +
- " case 987 :\n" +
- " return 3;\n" +
- " case 988 :\n" +
- " return 3;\n" +
- " case 989 :\n" +
- " return 3;\n" +
- " case 990 :\n" +
- " return 3;\n" +
- " case 991 :\n" +
- " return 3;\n" +
- " case 992 :\n" +
- " return 3;\n" +
- " case 993 :\n" +
- " return 3;\n" +
- " case 994 :\n" +
- " return 3;\n" +
- " case 995 :\n" +
- " return 3;\n" +
- " case 996 :\n" +
- " return 3;\n" +
- " case 997 :\n" +
- " return 3;\n" +
- " case 998 :\n" +
- " return 3;\n" +
- " case 999 :\n" +
- " return 3;\n" +
- " case 1000 :\n" +
- " return 3;\n" +
- " case 1001 :\n" +
- " return 3;\n" +
- " case 1002 :\n" +
- " return 3;\n" +
- " case 1003 :\n" +
- " return 3;\n" +
- " case 1004 :\n" +
- " return 3;\n" +
- " case 1005 :\n" +
- " return 3;\n" +
- " case 1006 :\n" +
- " return 3;\n" +
- " case 1007 :\n" +
- " return 3;\n" +
- " case 1008 :\n" +
- " return 3;\n" +
- " case 1009 :\n" +
- " return 3;\n" +
- " case 1010 :\n" +
- " return 3;\n" +
- " case 1011 :\n" +
- " return 3;\n" +
- " case 1012 :\n" +
- " return 3;\n" +
- " case 1013 :\n" +
- " return 3;\n" +
- " case 1014 :\n" +
- " return 3;\n" +
- " case 1015 :\n" +
- " return 3;\n" +
- " case 1016 :\n" +
- " return 3;\n" +
- " case 1017 :\n" +
- " return 3;\n" +
- " case 1018 :\n" +
- " return 3;\n" +
- " case 1019 :\n" +
- " return 3;\n" +
- " case 1020 :\n" +
- " return 3;\n" +
- " case 1021 :\n" +
- " return 3;\n" +
- " case 1022 :\n" +
- " return 3;\n" +
- " case 1023 :\n" +
- " return 3;\n" +
- " case 1024 :\n" +
- " return 3;\n" +
- " case 1025 :\n" +
- " return 3;\n" +
- " case 1026 :\n" +
- " return 3;\n" +
- " case 1027 :\n" +
- " return 3;\n" +
- " case 1028 :\n" +
- " return 3;\n" +
- " case 1029 :\n" +
- " return 3;\n" +
- " case 1030 :\n" +
- " return 3;\n" +
- " case 1031 :\n" +
- " return 3;\n" +
- " case 1032 :\n" +
- " return 3;\n" +
- " case 1033 :\n" +
- " return 3;\n" +
- " case 1034 :\n" +
- " return 3;\n" +
- " case 1035 :\n" +
- " return 3;\n" +
- " case 1036 :\n" +
- " return 3;\n" +
- " case 1037 :\n" +
- " return 3;\n" +
- " case 1038 :\n" +
- " return 3;\n" +
- " case 1039 :\n" +
- " return 3;\n" +
- " case 1040 :\n" +
- " return 3;\n" +
- " case 1041 :\n" +
- " return 3;\n" +
- " case 1042 :\n" +
- " return 3;\n" +
- " case 1043 :\n" +
- " return 3;\n" +
- " case 1044 :\n" +
- " return 3;\n" +
- " case 1045 :\n" +
- " return 3;\n" +
- " case 1046 :\n" +
- " return 3;\n" +
- " case 1047 :\n" +
- " return 3;\n" +
- " case 1048 :\n" +
- " return 3;\n" +
- " case 1049 :\n" +
- " return 3;\n" +
- " case 1050 :\n" +
- " return 3;\n" +
- " case 1051 :\n" +
- " return 3;\n" +
- " case 1052 :\n" +
- " return 3;\n" +
- " case 1053 :\n" +
- " return 3;\n" +
- " case 1054 :\n" +
- " return 3;\n" +
- " case 1055 :\n" +
- " return 3;\n" +
- " case 1056 :\n" +
- " return 3;\n" +
- " case 1057 :\n" +
- " return 3;\n" +
- " case 1058 :\n" +
- " return 3;\n" +
- " case 1059 :\n" +
- " return 3;\n" +
- " case 1060 :\n" +
- " return 3;\n" +
- " case 1061 :\n" +
- " return 3;\n" +
- " case 1062 :\n" +
- " return 3;\n" +
- " case 1063 :\n" +
- " return 3;\n" +
- " case 1064 :\n" +
- " return 3;\n" +
- " case 1065 :\n" +
- " return 3;\n" +
- " case 1066 :\n" +
- " return 3;\n" +
- " case 1067 :\n" +
- " return 3;\n" +
- " case 1068 :\n" +
- " return 3;\n" +
- " case 1069 :\n" +
- " return 3;\n" +
- " case 1070 :\n" +
- " return 3;\n" +
- " case 1071 :\n" +
- " return 3;\n" +
- " case 1072 :\n" +
- " return 3;\n" +
- " case 1073 :\n" +
- " return 3;\n" +
- " case 1074 :\n" +
- " return 3;\n" +
- " case 1075 :\n" +
- " return 3;\n" +
- " case 1076 :\n" +
- " return 3;\n" +
- " case 1077 :\n" +
- " return 3;\n" +
- " case 1078 :\n" +
- " return 3;\n" +
- " case 1079 :\n" +
- " return 3;\n" +
- " case 1080 :\n" +
- " return 3;\n" +
- " case 1081 :\n" +
- " return 3;\n" +
- " case 1082 :\n" +
- " return 3;\n" +
- " case 1083 :\n" +
- " return 3;\n" +
- " case 1084 :\n" +
- " return 3;\n" +
- " case 1085 :\n" +
- " return 3;\n" +
- " case 1086 :\n" +
- " return 3;\n" +
- " case 1087 :\n" +
- " return 3;\n" +
- " case 1088 :\n" +
- " return 3;\n" +
- " case 1089 :\n" +
- " return 3;\n" +
- " case 1090 :\n" +
- " return 3;\n" +
- " case 1091 :\n" +
- " return 3;\n" +
- " case 1092 :\n" +
- " return 3;\n" +
- " case 1093 :\n" +
- " return 3;\n" +
- " case 1094 :\n" +
- " return 3;\n" +
- " case 1095 :\n" +
- " return 3;\n" +
- " case 1096 :\n" +
- " return 3;\n" +
- " case 1097 :\n" +
- " return 3;\n" +
- " case 1098 :\n" +
- " return 3;\n" +
- " case 1099 :\n" +
- " return 3;\n" +
- " case 1100 :\n" +
- " return 3;\n" +
- " case 1101 :\n" +
- " return 3;\n" +
- " case 1102 :\n" +
- " return 3;\n" +
- " case 1103 :\n" +
- " return 3;\n" +
- " case 1104 :\n" +
- " return 3;\n" +
- " case 1105 :\n" +
- " return 3;\n" +
- " case 1106 :\n" +
- " return 3;\n" +
- " case 1107 :\n" +
- " return 3;\n" +
- " case 1108 :\n" +
- " return 3;\n" +
- " case 1109 :\n" +
- " return 3;\n" +
- " case 1110 :\n" +
- " return 3;\n" +
- " case 1111 :\n" +
- " return 3;\n" +
- " case 1112 :\n" +
- " return 3;\n" +
- " case 1113 :\n" +
- " return 3;\n" +
- " case 1114 :\n" +
- " return 3;\n" +
- " case 1115 :\n" +
- " return 3;\n" +
- " case 1116 :\n" +
- " return 3;\n" +
- " case 1117 :\n" +
- " return 3;\n" +
- " case 1118 :\n" +
- " return 3;\n" +
- " case 1119 :\n" +
- " return 3;\n" +
- " case 1120 :\n" +
- " return 3;\n" +
- " case 1121 :\n" +
- " return 3;\n" +
- " case 1122 :\n" +
- " return 3;\n" +
- " case 1123 :\n" +
- " return 3;\n" +
- " case 1124 :\n" +
- " return 3;\n" +
- " case 1125 :\n" +
- " return 3;\n" +
- " case 1126 :\n" +
- " return 3;\n" +
- " case 1127 :\n" +
- " return 3;\n" +
- " case 1128 :\n" +
- " return 3;\n" +
- " case 1129 :\n" +
- " return 3;\n" +
- " case 1130 :\n" +
- " return 3;\n" +
- " case 1131 :\n" +
- " return 3;\n" +
- " case 1132 :\n" +
- " return 3;\n" +
- " case 1133 :\n" +
- " return 3;\n" +
- " case 1134 :\n" +
- " return 3;\n" +
- " case 1135 :\n" +
- " return 3;\n" +
- " case 1136 :\n" +
- " return 3;\n" +
- " case 1137 :\n" +
- " return 3;\n" +
- " case 1138 :\n" +
- " return 3;\n" +
- " case 1139 :\n" +
- " return 3;\n" +
- " case 1140 :\n" +
- " return 3;\n" +
- " case 1141 :\n" +
- " return 3;\n" +
- " case 1142 :\n" +
- " return 3;\n" +
- " case 1143 :\n" +
- " return 3;\n" +
- " case 1144 :\n" +
- " return 3;\n" +
- " case 1145 :\n" +
- " return 3;\n" +
- " case 1146 :\n" +
- " return 3;\n" +
- " case 1147 :\n" +
- " return 3;\n" +
- " case 1148 :\n" +
- " return 3;\n" +
- " case 1149 :\n" +
- " return 3;\n" +
- " case 1150 :\n" +
- " return 3;\n" +
- " case 1151 :\n" +
- " return 3;\n" +
- " case 1152 :\n" +
- " return 3;\n" +
- " case 1153 :\n" +
- " return 3;\n" +
- " case 1154 :\n" +
- " return 3;\n" +
- " case 1155 :\n" +
- " return 3;\n" +
- " case 1156 :\n" +
- " return 3;\n" +
- " case 1157 :\n" +
- " return 3;\n" +
- " case 1158 :\n" +
- " return 3;\n" +
- " case 1159 :\n" +
- " return 3;\n" +
- " case 1160 :\n" +
- " return 3;\n" +
- " case 1161 :\n" +
- " return 3;\n" +
- " case 1162 :\n" +
- " return 3;\n" +
- " case 1163 :\n" +
- " return 3;\n" +
- " case 1164 :\n" +
- " return 3;\n" +
- " case 1165 :\n" +
- " return 3;\n" +
- " case 1166 :\n" +
- " return 3;\n" +
- " case 1167 :\n" +
- " return 3;\n" +
- " case 1168 :\n" +
- " return 3;\n" +
- " case 1169 :\n" +
- " return 3;\n" +
- " case 1170 :\n" +
- " return 3;\n" +
- " case 1171 :\n" +
- " return 3;\n" +
- " case 1172 :\n" +
- " return 3;\n" +
- " case 1173 :\n" +
- " return 3;\n" +
- " case 1174 :\n" +
- " return 3;\n" +
- " case 1175 :\n" +
- " return 3;\n" +
- " case 1176 :\n" +
- " return 3;\n" +
- " case 1177 :\n" +
- " return 3;\n" +
- " case 1178 :\n" +
- " return 3;\n" +
- " case 1179 :\n" +
- " return 3;\n" +
- " case 1180 :\n" +
- " return 3;\n" +
- " case 1181 :\n" +
- " return 3;\n" +
- " case 1182 :\n" +
- " return 3;\n" +
- " case 1183 :\n" +
- " return 3;\n" +
- " case 1184 :\n" +
- " return 3;\n" +
- " case 1185 :\n" +
- " return 3;\n" +
- " case 1186 :\n" +
- " return 3;\n" +
- " case 1187 :\n" +
- " return 3;\n" +
- " case 1188 :\n" +
- " return 3;\n" +
- " case 1189 :\n" +
- " return 3;\n" +
- " case 1190 :\n" +
- " return 3;\n" +
- " case 1191 :\n" +
- " return 3;\n" +
- " case 1192 :\n" +
- " return 3;\n" +
- " case 1193 :\n" +
- " return 3;\n" +
- " case 1194 :\n" +
- " return 3;\n" +
- " case 1195 :\n" +
- " return 3;\n" +
- " case 1196 :\n" +
- " return 3;\n" +
- " case 1197 :\n" +
- " return 3;\n" +
- " case 1198 :\n" +
- " return 3;\n" +
- " case 1199 :\n" +
- " return 3;\n" +
- " case 1200 :\n" +
- " return 3;\n" +
- " case 1201 :\n" +
- " return 3;\n" +
- " case 1202 :\n" +
- " return 3;\n" +
- " case 1203 :\n" +
- " return 3;\n" +
- " case 1204 :\n" +
- " return 3;\n" +
- " case 1205 :\n" +
- " return 3;\n" +
- " case 1206 :\n" +
- " return 3;\n" +
- " case 1207 :\n" +
- " return 3;\n" +
- " case 1208 :\n" +
- " return 3;\n" +
- " case 1209 :\n" +
- " return 3;\n" +
- " case 1210 :\n" +
- " return 3;\n" +
- " case 1211 :\n" +
- " return 3;\n" +
- " case 1212 :\n" +
- " return 3;\n" +
- " case 1213 :\n" +
- " return 3;\n" +
- " case 1214 :\n" +
- " return 3;\n" +
- " case 1215 :\n" +
- " return 3;\n" +
- " case 1216 :\n" +
- " return 3;\n" +
- " case 1217 :\n" +
- " return 3;\n" +
- " case 1218 :\n" +
- " return 3;\n" +
- " case 1219 :\n" +
- " return 3;\n" +
- " case 1220 :\n" +
- " return 3;\n" +
- " case 1221 :\n" +
- " return 3;\n" +
- " case 1222 :\n" +
- " return 3;\n" +
- " case 1223 :\n" +
- " return 3;\n" +
- " case 1224 :\n" +
- " return 3;\n" +
- " case 1225 :\n" +
- " return 3;\n" +
- " case 1226 :\n" +
- " return 3;\n" +
- " case 1227 :\n" +
- " return 3;\n" +
- " case 1228 :\n" +
- " return 3;\n" +
- " case 1229 :\n" +
- " return 3;\n" +
- " case 1230 :\n" +
- " return 3;\n" +
- " case 1231 :\n" +
- " return 3;\n" +
- " case 1232 :\n" +
- " return 3;\n" +
- " case 1233 :\n" +
- " return 3;\n" +
- " case 1234 :\n" +
- " return 3;\n" +
- " case 1235 :\n" +
- " return 3;\n" +
- " case 1236 :\n" +
- " return 3;\n" +
- " case 1237 :\n" +
- " return 3;\n" +
- " case 1238 :\n" +
- " return 3;\n" +
- " case 1239 :\n" +
- " return 3;\n" +
- " case 1240 :\n" +
- " return 3;\n" +
- " case 1241 :\n" +
- " return 3;\n" +
- " case 1242 :\n" +
- " return 3;\n" +
- " case 1243 :\n" +
- " return 3;\n" +
- " case 1244 :\n" +
- " return 3;\n" +
- " case 1245 :\n" +
- " return 3;\n" +
- " case 1246 :\n" +
- " return 3;\n" +
- " case 1247 :\n" +
- " return 3;\n" +
- " case 1248 :\n" +
- " return 3;\n" +
- " case 1249 :\n" +
- " return 3;\n" +
- " case 1250 :\n" +
- " return 3;\n" +
- " case 1251 :\n" +
- " return 3;\n" +
- " case 1252 :\n" +
- " return 3;\n" +
- " case 1253 :\n" +
- " return 3;\n" +
- " case 1254 :\n" +
- " return 3;\n" +
- " case 1255 :\n" +
- " return 3;\n" +
- " case 1256 :\n" +
- " return 3;\n" +
- " case 1257 :\n" +
- " return 3;\n" +
- " case 1258 :\n" +
- " return 3;\n" +
- " case 1259 :\n" +
- " return 3;\n" +
- " case 1260 :\n" +
- " return 3;\n" +
- " case 1261 :\n" +
- " return 3;\n" +
- " case 1262 :\n" +
- " return 3;\n" +
- " case 1263 :\n" +
- " return 3;\n" +
- " case 1264 :\n" +
- " return 3;\n" +
- " case 1265 :\n" +
- " return 3;\n" +
- " case 1266 :\n" +
- " return 3;\n" +
- " case 1267 :\n" +
- " return 3;\n" +
- " case 1268 :\n" +
- " return 3;\n" +
- " case 1269 :\n" +
- " return 3;\n" +
- " case 1270 :\n" +
- " return 3;\n" +
- " case 1271 :\n" +
- " return 3;\n" +
- " case 1272 :\n" +
- " return 3;\n" +
- " case 1273 :\n" +
- " return 3;\n" +
- " case 1274 :\n" +
- " return 3;\n" +
- " case 1275 :\n" +
- " return 3;\n" +
- " case 1276 :\n" +
- " return 3;\n" +
- " case 1277 :\n" +
- " return 3;\n" +
- " case 1278 :\n" +
- " return 3;\n" +
- " case 1279 :\n" +
- " return 3;\n" +
- " case 1280 :\n" +
- " return 3;\n" +
- " case 1281 :\n" +
- " return 3;\n" +
- " case 1282 :\n" +
- " return 3;\n" +
- " case 1283 :\n" +
- " return 3;\n" +
- " case 1284 :\n" +
- " return 3;\n" +
- " case 1285 :\n" +
- " return 3;\n" +
- " case 1286 :\n" +
- " return 3;\n" +
- " case 1287 :\n" +
- " return 3;\n" +
- " case 1288 :\n" +
- " return 3;\n" +
- " case 1289 :\n" +
- " return 3;\n" +
- " case 1290 :\n" +
- " return 3;\n" +
- " case 1291 :\n" +
- " return 3;\n" +
- " case 1292 :\n" +
- " return 3;\n" +
- " case 1293 :\n" +
- " return 3;\n" +
- " case 1294 :\n" +
- " return 3;\n" +
- " case 1295 :\n" +
- " return 3;\n" +
- " case 1296 :\n" +
- " return 3;\n" +
- " case 1297 :\n" +
- " return 3;\n" +
- " case 1298 :\n" +
- " return 3;\n" +
- " case 1299 :\n" +
- " return 3;\n" +
- " case 1300 :\n" +
- " return 3;\n" +
- " case 1301 :\n" +
- " return 3;\n" +
- " case 1302 :\n" +
- " return 3;\n" +
- " case 1303 :\n" +
- " return 3;\n" +
- " case 1304 :\n" +
- " return 3;\n" +
- " case 1305 :\n" +
- " return 3;\n" +
- " case 1306 :\n" +
- " return 3;\n" +
- " case 1307 :\n" +
- " return 3;\n" +
- " case 1308 :\n" +
- " return 3;\n" +
- " case 1309 :\n" +
- " return 3;\n" +
- " case 1310 :\n" +
- " return 3;\n" +
- " case 1311 :\n" +
- " return 3;\n" +
- " case 1312 :\n" +
- " return 3;\n" +
- " case 1313 :\n" +
- " return 3;\n" +
- " case 1314 :\n" +
- " return 3;\n" +
- " case 1315 :\n" +
- " return 3;\n" +
- " case 1316 :\n" +
- " return 3;\n" +
- " case 1317 :\n" +
- " return 3;\n" +
- " case 1318 :\n" +
- " return 3;\n" +
- " case 1319 :\n" +
- " return 3;\n" +
- " case 1320 :\n" +
- " return 3;\n" +
- " case 1321 :\n" +
- " return 3;\n" +
- " case 1322 :\n" +
- " return 3;\n" +
- " case 1323 :\n" +
- " return 3;\n" +
- " case 1324 :\n" +
- " return 3;\n" +
- " case 1325 :\n" +
- " return 3;\n" +
- " case 1326 :\n" +
- " return 3;\n" +
- " case 1327 :\n" +
- " return 3;\n" +
- " case 1328 :\n" +
- " return 3;\n" +
- " case 1329 :\n" +
- " return 3;\n" +
- " case 1330 :\n" +
- " return 3;\n" +
- " case 1331 :\n" +
- " return 3;\n" +
- " case 1332 :\n" +
- " return 3;\n" +
- " case 1333 :\n" +
- " return 3;\n" +
- " case 1334 :\n" +
- " return 3;\n" +
- " case 1335 :\n" +
- " return 3;\n" +
- " case 1336 :\n" +
- " return 3;\n" +
- " case 1337 :\n" +
- " return 3;\n" +
- " case 1338 :\n" +
- " return 3;\n" +
- " case 1339 :\n" +
- " return 3;\n" +
- " case 1340 :\n" +
- " return 3;\n" +
- " case 1341 :\n" +
- " return 3;\n" +
- " case 1342 :\n" +
- " return 3;\n" +
- " case 1343 :\n" +
- " return 3;\n" +
- " case 1344 :\n" +
- " return 3;\n" +
- " case 1345 :\n" +
- " return 3;\n" +
- " case 1346 :\n" +
- " return 3;\n" +
- " case 1347 :\n" +
- " return 3;\n" +
- " case 1348 :\n" +
- " return 3;\n" +
- " case 1349 :\n" +
- " return 3;\n" +
- " case 1350 :\n" +
- " return 3;\n" +
- " case 1351 :\n" +
- " return 3;\n" +
- " case 1352 :\n" +
- " return 3;\n" +
- " case 1353 :\n" +
- " return 3;\n" +
- " case 1354 :\n" +
- " return 3;\n" +
- " case 1355 :\n" +
- " return 3;\n" +
- " case 1356 :\n" +
- " return 3;\n" +
- " case 1357 :\n" +
- " return 3;\n" +
- " case 1358 :\n" +
- " return 3;\n" +
- " case 1359 :\n" +
- " return 3;\n" +
- " case 1360 :\n" +
- " return 3;\n" +
- " case 1361 :\n" +
- " return 3;\n" +
- " case 1362 :\n" +
- " return 3;\n" +
- " case 1363 :\n" +
- " return 3;\n" +
- " case 1364 :\n" +
- " return 3;\n" +
- " case 1365 :\n" +
- " return 3;\n" +
- " case 1366 :\n" +
- " return 3;\n" +
- " case 1367 :\n" +
- " return 3;\n" +
- " case 1368 :\n" +
- " return 3;\n" +
- " case 1369 :\n" +
- " return 3;\n" +
- " case 1370 :\n" +
- " return 3;\n" +
- " case 1371 :\n" +
- " return 3;\n" +
- " case 1372 :\n" +
- " return 3;\n" +
- " case 1373 :\n" +
- " return 3;\n" +
- " case 1374 :\n" +
- " return 3;\n" +
- " case 1375 :\n" +
- " return 3;\n" +
- " case 1376 :\n" +
- " return 3;\n" +
- " case 1377 :\n" +
- " return 3;\n" +
- " case 1378 :\n" +
- " return 3;\n" +
- " case 1379 :\n" +
- " return 3;\n" +
- " case 1380 :\n" +
- " return 3;\n" +
- " case 1381 :\n" +
- " return 3;\n" +
- " case 1382 :\n" +
- " return 3;\n" +
- " case 1383 :\n" +
- " return 3;\n" +
- " case 1384 :\n" +
- " return 3;\n" +
- " case 1385 :\n" +
- " return 3;\n" +
- " case 1386 :\n" +
- " return 3;\n" +
- " case 1387 :\n" +
- " return 3;\n" +
- " case 1388 :\n" +
- " return 3;\n" +
- " case 1389 :\n" +
- " return 3;\n" +
- " case 1390 :\n" +
- " return 3;\n" +
- " case 1391 :\n" +
- " return 3;\n" +
- " case 1392 :\n" +
- " return 3;\n" +
- " case 1393 :\n" +
- " return 3;\n" +
- " case 1394 :\n" +
- " return 3;\n" +
- " case 1395 :\n" +
- " return 3;\n" +
- " case 1396 :\n" +
- " return 3;\n" +
- " case 1397 :\n" +
- " return 3;\n" +
- " case 1398 :\n" +
- " return 3;\n" +
- " case 1399 :\n" +
- " return 3;\n" +
- " case 1400 :\n" +
- " return 3;\n" +
- " case 1401 :\n" +
- " return 3;\n" +
- " case 1402 :\n" +
- " return 3;\n" +
- " case 1403 :\n" +
- " return 3;\n" +
- " case 1404 :\n" +
- " return 3;\n" +
- " case 1405 :\n" +
- " return 3;\n" +
- " case 1406 :\n" +
- " return 3;\n" +
- " case 1407 :\n" +
- " return 3;\n" +
- " case 1408 :\n" +
- " return 3;\n" +
- " case 1409 :\n" +
- " return 3;\n" +
- " case 1410 :\n" +
- " return 3;\n" +
- " case 1411 :\n" +
- " return 3;\n" +
- " case 1412 :\n" +
- " return 3;\n" +
- " case 1413 :\n" +
- " return 3;\n" +
- " case 1414 :\n" +
- " return 3;\n" +
- " case 1415 :\n" +
- " return 3;\n" +
- " case 1416 :\n" +
- " return 3;\n" +
- " case 1417 :\n" +
- " return 3;\n" +
- " case 1418 :\n" +
- " return 3;\n" +
- " case 1419 :\n" +
- " return 3;\n" +
- " case 1420 :\n" +
- " return 3;\n" +
- " case 1421 :\n" +
- " return 3;\n" +
- " case 1422 :\n" +
- " return 3;\n" +
- " case 1423 :\n" +
- " return 3;\n" +
- " case 1424 :\n" +
- " return 3;\n" +
- " case 1425 :\n" +
- " return 3;\n" +
- " case 1426 :\n" +
- " return 3;\n" +
- " case 1427 :\n" +
- " return 3;\n" +
- " case 1428 :\n" +
- " return 3;\n" +
- " case 1429 :\n" +
- " return 3;\n" +
- " case 1430 :\n" +
- " return 3;\n" +
- " case 1431 :\n" +
- " return 3;\n" +
- " case 1432 :\n" +
- " return 3;\n" +
- " case 1433 :\n" +
- " return 3;\n" +
- " case 1434 :\n" +
- " return 3;\n" +
- " case 1435 :\n" +
- " return 3;\n" +
- " case 1436 :\n" +
- " return 3;\n" +
- " case 1437 :\n" +
- " return 3;\n" +
- " case 1438 :\n" +
- " return 3;\n" +
- " case 1439 :\n" +
- " return 3;\n" +
- " case 1440 :\n" +
- " return 3;\n" +
- " case 1441 :\n" +
- " return 3;\n" +
- " case 1442 :\n" +
- " return 3;\n" +
- " case 1443 :\n" +
- " return 3;\n" +
- " case 1444 :\n" +
- " return 3;\n" +
- " case 1445 :\n" +
- " return 3;\n" +
- " case 1446 :\n" +
- " return 3;\n" +
- " case 1447 :\n" +
- " return 3;\n" +
- " case 1448 :\n" +
- " return 3;\n" +
- " case 1449 :\n" +
- " return 3;\n" +
- " case 1450 :\n" +
- " return 3;\n" +
- " case 1451 :\n" +
- " return 3;\n" +
- " case 1452 :\n" +
- " return 3;\n" +
- " case 1453 :\n" +
- " return 3;\n" +
- " case 1454 :\n" +
- " return 3;\n" +
- " case 1455 :\n" +
- " return 3;\n" +
- " case 1456 :\n" +
- " return 3;\n" +
- " case 1457 :\n" +
- " return 3;\n" +
- " case 1458 :\n" +
- " return 3;\n" +
- " case 1459 :\n" +
- " return 3;\n" +
- " case 1460 :\n" +
- " return 3;\n" +
- " case 1461 :\n" +
- " return 3;\n" +
- " case 1462 :\n" +
- " return 3;\n" +
- " case 1463 :\n" +
- " return 3;\n" +
- " case 1464 :\n" +
- " return 3;\n" +
- " case 1465 :\n" +
- " return 3;\n" +
- " case 1466 :\n" +
- " return 3;\n" +
- " case 1467 :\n" +
- " return 3;\n" +
- " case 1468 :\n" +
- " return 3;\n" +
- " case 1469 :\n" +
- " return 3;\n" +
- " case 1470 :\n" +
- " return 3;\n" +
- " case 1471 :\n" +
- " return 3;\n" +
- " case 1472 :\n" +
- " return 3;\n" +
- " case 1473 :\n" +
- " return 3;\n" +
- " case 1474 :\n" +
- " return 3;\n" +
- " case 1475 :\n" +
- " return 3;\n" +
- " case 1476 :\n" +
- " return 3;\n" +
- " case 1477 :\n" +
- " return 3;\n" +
- " case 1478 :\n" +
- " return 3;\n" +
- " case 1479 :\n" +
- " return 3;\n" +
- " case 1480 :\n" +
- " return 3;\n" +
- " case 1481 :\n" +
- " return 3;\n" +
- " case 1482 :\n" +
- " return 3;\n" +
- " case 1483 :\n" +
- " return 3;\n" +
- " case 1484 :\n" +
- " return 3;\n" +
- " case 1485 :\n" +
- " return 3;\n" +
- " case 1486 :\n" +
- " return 3;\n" +
- " case 1487 :\n" +
- " return 3;\n" +
- " case 1488 :\n" +
- " return 3;\n" +
- " case 1489 :\n" +
- " return 3;\n" +
- " case 1490 :\n" +
- " return 3;\n" +
- " case 1491 :\n" +
- " return 3;\n" +
- " case 1492 :\n" +
- " return 3;\n" +
- " case 1493 :\n" +
- " return 3;\n" +
- " case 1494 :\n" +
- " return 3;\n" +
- " case 1495 :\n" +
- " return 3;\n" +
- " case 1496 :\n" +
- " return 3;\n" +
- " case 1497 :\n" +
- " return 3;\n" +
- " case 1498 :\n" +
- " return 3;\n" +
- " case 1499 :\n" +
- " return 3;\n" +
- " case 1500 :\n" +
- " return 3;\n" +
- " case 1501 :\n" +
- " return 3;\n" +
- " case 1502 :\n" +
- " return 3;\n" +
- " case 1503 :\n" +
- " return 3;\n" +
- " case 1504 :\n" +
- " return 3;\n" +
- " case 1505 :\n" +
- " return 3;\n" +
- " case 1506 :\n" +
- " return 3;\n" +
- " case 1507 :\n" +
- " return 3;\n" +
- " case 1508 :\n" +
- " return 3;\n" +
- " case 1509 :\n" +
- " return 3;\n" +
- " case 1510 :\n" +
- " return 3;\n" +
- " case 1511 :\n" +
- " return 3;\n" +
- " case 1512 :\n" +
- " return 3;\n" +
- " case 1513 :\n" +
- " return 3;\n" +
- " case 1514 :\n" +
- " return 3;\n" +
- " case 1515 :\n" +
- " return 3;\n" +
- " case 1516 :\n" +
- " return 3;\n" +
- " case 1517 :\n" +
- " return 3;\n" +
- " case 1518 :\n" +
- " return 3;\n" +
- " case 1519 :\n" +
- " return 3;\n" +
- " case 1520 :\n" +
- " return 3;\n" +
- " case 1521 :\n" +
- " return 3;\n" +
- " case 1522 :\n" +
- " return 3;\n" +
- " case 1523 :\n" +
- " return 3;\n" +
- " case 1524 :\n" +
- " return 3;\n" +
- " case 1525 :\n" +
- " return 3;\n" +
- " case 1526 :\n" +
- " return 3;\n" +
- " case 1527 :\n" +
- " return 3;\n" +
- " case 1528 :\n" +
- " return 3;\n" +
- " case 1529 :\n" +
- " return 3;\n" +
- " case 1530 :\n" +
- " return 3;\n" +
- " case 1531 :\n" +
- " return 3;\n" +
- " case 1532 :\n" +
- " return 3;\n" +
- " case 1533 :\n" +
- " return 3;\n" +
- " case 1534 :\n" +
- " return 3;\n" +
- " case 1535 :\n" +
- " return 3;\n" +
- " case 1536 :\n" +
- " return 3;\n" +
- " case 1537 :\n" +
- " return 3;\n" +
- " case 1538 :\n" +
- " return 3;\n" +
- " case 1539 :\n" +
- " return 3;\n" +
- " case 1540 :\n" +
- " return 3;\n" +
- " case 1541 :\n" +
- " return 3;\n" +
- " case 1542 :\n" +
- " return 3;\n" +
- " case 1543 :\n" +
- " return 3;\n" +
- " case 1544 :\n" +
- " return 3;\n" +
- " case 1545 :\n" +
- " return 3;\n" +
- " case 1546 :\n" +
- " return 3;\n" +
- " case 1547 :\n" +
- " return 3;\n" +
- " case 1548 :\n" +
- " return 3;\n" +
- " case 1549 :\n" +
- " return 3;\n" +
- " case 1550 :\n" +
- " return 3;\n" +
- " case 1551 :\n" +
- " return 3;\n" +
- " case 1552 :\n" +
- " return 3;\n" +
- " case 1553 :\n" +
- " return 3;\n" +
- " case 1554 :\n" +
- " return 3;\n" +
- " case 1555 :\n" +
- " return 3;\n" +
- " case 1556 :\n" +
- " return 3;\n" +
- " case 1557 :\n" +
- " return 3;\n" +
- " case 1558 :\n" +
- " return 3;\n" +
- " case 1559 :\n" +
- " return 3;\n" +
- " case 1560 :\n" +
- " return 3;\n" +
- " case 1561 :\n" +
- " return 3;\n" +
- " case 1562 :\n" +
- " return 3;\n" +
- " case 1563 :\n" +
- " return 3;\n" +
- " case 1564 :\n" +
- " return 3;\n" +
- " case 1565 :\n" +
- " return 3;\n" +
- " case 1566 :\n" +
- " return 3;\n" +
- " case 1567 :\n" +
- " return 3;\n" +
- " case 1568 :\n" +
- " return 3;\n" +
- " case 1569 :\n" +
- " return 3;\n" +
- " case 1570 :\n" +
- " return 3;\n" +
- " case 1571 :\n" +
- " return 3;\n" +
- " case 1572 :\n" +
- " return 3;\n" +
- " case 1573 :\n" +
- " return 3;\n" +
- " case 1574 :\n" +
- " return 3;\n" +
- " case 1575 :\n" +
- " return 3;\n" +
- " case 1576 :\n" +
- " return 3;\n" +
- " case 1577 :\n" +
- " return 3;\n" +
- " case 1578 :\n" +
- " return 3;\n" +
- " case 1579 :\n" +
- " return 3;\n" +
- " case 1580 :\n" +
- " return 3;\n" +
- " case 1581 :\n" +
- " return 3;\n" +
- " case 1582 :\n" +
- " return 3;\n" +
- " case 1583 :\n" +
- " return 3;\n" +
- " case 1584 :\n" +
- " return 3;\n" +
- " case 1585 :\n" +
- " return 3;\n" +
- " case 1586 :\n" +
- " return 3;\n" +
- " case 1587 :\n" +
- " return 3;\n" +
- " case 1588 :\n" +
- " return 3;\n" +
- " case 1589 :\n" +
- " return 3;\n" +
- " case 1590 :\n" +
- " return 3;\n" +
- " case 1591 :\n" +
- " return 3;\n" +
- " case 1592 :\n" +
- " return 3;\n" +
- " case 1593 :\n" +
- " return 3;\n" +
- " case 1594 :\n" +
- " return 3;\n" +
- " case 1595 :\n" +
- " return 3;\n" +
- " case 1596 :\n" +
- " return 3;\n" +
- " case 1597 :\n" +
- " return 3;\n" +
- " case 1598 :\n" +
- " return 3;\n" +
- " case 1599 :\n" +
- " return 3;\n" +
- " case 1600 :\n" +
- " return 3;\n" +
- " case 1601 :\n" +
- " return 3;\n" +
- " case 1602 :\n" +
- " return 3;\n" +
- " case 1603 :\n" +
- " return 3;\n" +
- " case 1604 :\n" +
- " return 3;\n" +
- " case 1605 :\n" +
- " return 3;\n" +
- " case 1606 :\n" +
- " return 3;\n" +
- " case 1607 :\n" +
- " return 3;\n" +
- " case 1608 :\n" +
- " return 3;\n" +
- " case 1609 :\n" +
- " return 3;\n" +
- " case 1610 :\n" +
- " return 3;\n" +
- " case 1611 :\n" +
- " return 3;\n" +
- " case 1612 :\n" +
- " return 3;\n" +
- " case 1613 :\n" +
- " return 3;\n" +
- " case 1614 :\n" +
- " return 3;\n" +
- " case 1615 :\n" +
- " return 3;\n" +
- " case 1616 :\n" +
- " return 3;\n" +
- " case 1617 :\n" +
- " return 3;\n" +
- " case 1618 :\n" +
- " return 3;\n" +
- " case 1619 :\n" +
- " return 3;\n" +
- " case 1620 :\n" +
- " return 3;\n" +
- " case 1621 :\n" +
- " return 3;\n" +
- " case 1622 :\n" +
- " return 3;\n" +
- " case 1623 :\n" +
- " return 3;\n" +
- " case 1624 :\n" +
- " return 3;\n" +
- " case 1625 :\n" +
- " return 3;\n" +
- " case 1626 :\n" +
- " return 3;\n" +
- " case 1627 :\n" +
- " return 3;\n" +
- " case 1628 :\n" +
- " return 3;\n" +
- " case 1629 :\n" +
- " return 3;\n" +
- " case 1630 :\n" +
- " return 3;\n" +
- " case 1631 :\n" +
- " return 3;\n" +
- " case 1632 :\n" +
- " return 3;\n" +
- " case 1633 :\n" +
- " return 3;\n" +
- " case 1634 :\n" +
- " return 3;\n" +
- " case 1635 :\n" +
- " return 3;\n" +
- " case 1636 :\n" +
- " return 3;\n" +
- " case 1637 :\n" +
- " return 3;\n" +
- " case 1638 :\n" +
- " return 3;\n" +
- " case 1639 :\n" +
- " return 3;\n" +
- " case 1640 :\n" +
- " return 3;\n" +
- " case 1641 :\n" +
- " return 3;\n" +
- " case 1642 :\n" +
- " return 3;\n" +
- " case 1643 :\n" +
- " return 3;\n" +
- " case 1644 :\n" +
- " return 3;\n" +
- " case 1645 :\n" +
- " return 3;\n" +
- " case 1646 :\n" +
- " return 3;\n" +
- " case 1647 :\n" +
- " return 3;\n" +
- " case 1648 :\n" +
- " return 3;\n" +
- " case 1649 :\n" +
- " return 3;\n" +
- " case 1650 :\n" +
- " return 3;\n" +
- " case 1651 :\n" +
- " return 3;\n" +
- " case 1652 :\n" +
- " return 3;\n" +
- " case 1653 :\n" +
- " return 3;\n" +
- " case 1654 :\n" +
- " return 3;\n" +
- " case 1655 :\n" +
- " return 3;\n" +
- " case 1656 :\n" +
- " return 3;\n" +
- " case 1657 :\n" +
- " return 3;\n" +
- " case 1658 :\n" +
- " return 3;\n" +
- " case 1659 :\n" +
- " return 3;\n" +
- " case 1660 :\n" +
- " return 3;\n" +
- " case 1661 :\n" +
- " return 3;\n" +
- " case 1662 :\n" +
- " return 3;\n" +
- " case 1663 :\n" +
- " return 3;\n" +
- " case 1664 :\n" +
- " return 3;\n" +
- " case 1665 :\n" +
- " return 3;\n" +
- " case 1666 :\n" +
- " return 3;\n" +
- " case 1667 :\n" +
- " return 3;\n" +
- " case 1668 :\n" +
- " return 3;\n" +
- " case 1669 :\n" +
- " return 3;\n" +
- " case 1670 :\n" +
- " return 3;\n" +
- " case 1671 :\n" +
- " return 3;\n" +
- " case 1672 :\n" +
- " return 3;\n" +
- " case 1673 :\n" +
- " return 3;\n" +
- " case 1674 :\n" +
- " return 3;\n" +
- " case 1675 :\n" +
- " return 3;\n" +
- " case 1676 :\n" +
- " return 3;\n" +
- " case 1677 :\n" +
- " return 3;\n" +
- " case 1678 :\n" +
- " return 3;\n" +
- " case 1679 :\n" +
- " return 3;\n" +
- " case 1680 :\n" +
- " return 3;\n" +
- " case 1681 :\n" +
- " return 3;\n" +
- " case 1682 :\n" +
- " return 3;\n" +
- " case 1683 :\n" +
- " return 3;\n" +
- " case 1684 :\n" +
- " return 3;\n" +
- " case 1685 :\n" +
- " return 3;\n" +
- " case 1686 :\n" +
- " return 3;\n" +
- " case 1687 :\n" +
- " return 3;\n" +
- " case 1688 :\n" +
- " return 3;\n" +
- " case 1689 :\n" +
- " return 3;\n" +
- " case 1690 :\n" +
- " return 3;\n" +
- " case 1691 :\n" +
- " return 3;\n" +
- " case 1692 :\n" +
- " return 3;\n" +
- " case 1693 :\n" +
- " return 3;\n" +
- " case 1694 :\n" +
- " return 3;\n" +
- " case 1695 :\n" +
- " return 3;\n" +
- " case 1696 :\n" +
- " return 3;\n" +
- " case 1697 :\n" +
- " return 3;\n" +
- " case 1698 :\n" +
- " return 3;\n" +
- " case 1699 :\n" +
- " return 3;\n" +
- " case 1700 :\n" +
- " return 3;\n" +
- " case 1701 :\n" +
- " return 3;\n" +
- " case 1702 :\n" +
- " return 3;\n" +
- " case 1703 :\n" +
- " return 3;\n" +
- " case 1704 :\n" +
- " return 3;\n" +
- " case 1705 :\n" +
- " return 3;\n" +
- " case 1706 :\n" +
- " return 3;\n" +
- " case 1707 :\n" +
- " return 3;\n" +
- " case 1708 :\n" +
- " return 3;\n" +
- " case 1709 :\n" +
- " return 3;\n" +
- " case 1710 :\n" +
- " return 3;\n" +
- " case 1711 :\n" +
- " return 3;\n" +
- " case 1712 :\n" +
- " return 3;\n" +
- " case 1713 :\n" +
- " return 3;\n" +
- " case 1714 :\n" +
- " return 3;\n" +
- " case 1715 :\n" +
- " return 3;\n" +
- " case 1716 :\n" +
- " return 3;\n" +
- " case 1717 :\n" +
- " return 3;\n" +
- " case 1718 :\n" +
- " return 3;\n" +
- " case 1719 :\n" +
- " return 3;\n" +
- " case 1720 :\n" +
- " return 3;\n" +
- " case 1721 :\n" +
- " return 3;\n" +
- " case 1722 :\n" +
- " return 3;\n" +
- " case 1723 :\n" +
- " return 3;\n" +
- " case 1724 :\n" +
- " return 3;\n" +
- " case 1725 :\n" +
- " return 3;\n" +
- " case 1726 :\n" +
- " return 3;\n" +
- " case 1727 :\n" +
- " return 3;\n" +
- " case 1728 :\n" +
- " return 3;\n" +
- " case 1729 :\n" +
- " return 3;\n" +
- " case 1730 :\n" +
- " return 3;\n" +
- " case 1731 :\n" +
- " return 3;\n" +
- " case 1732 :\n" +
- " return 3;\n" +
- " case 1733 :\n" +
- " return 3;\n" +
- " case 1734 :\n" +
- " return 3;\n" +
- " case 1735 :\n" +
- " return 3;\n" +
- " case 1736 :\n" +
- " return 3;\n" +
- " case 1737 :\n" +
- " return 3;\n" +
- " case 1738 :\n" +
- " return 3;\n" +
- " case 1739 :\n" +
- " return 3;\n" +
- " case 1740 :\n" +
- " return 3;\n" +
- " case 1741 :\n" +
- " return 3;\n" +
- " case 1742 :\n" +
- " return 3;\n" +
- " case 1743 :\n" +
- " return 3;\n" +
- " case 1744 :\n" +
- " return 3;\n" +
- " case 1745 :\n" +
- " return 3;\n" +
- " case 1746 :\n" +
- " return 3;\n" +
- " case 1747 :\n" +
- " return 3;\n" +
- " case 1748 :\n" +
- " return 3;\n" +
- " case 1749 :\n" +
- " return 3;\n" +
- " case 1750 :\n" +
- " return 3;\n" +
- " case 1751 :\n" +
- " return 3;\n" +
- " case 1752 :\n" +
- " return 3;\n" +
- " case 1753 :\n" +
- " return 3;\n" +
- " case 1754 :\n" +
- " return 3;\n" +
- " case 1755 :\n" +
- " return 3;\n" +
- " case 1756 :\n" +
- " return 3;\n" +
- " case 1757 :\n" +
- " return 3;\n" +
- " case 1758 :\n" +
- " return 3;\n" +
- " case 1759 :\n" +
- " return 3;\n" +
- " case 1760 :\n" +
- " return 3;\n" +
- " case 1761 :\n" +
- " return 3;\n" +
- " case 1762 :\n" +
- " return 3;\n" +
- " case 1763 :\n" +
- " return 3;\n" +
- " case 1764 :\n" +
- " return 3;\n" +
- " case 1765 :\n" +
- " return 3;\n" +
- " case 1766 :\n" +
- " return 3;\n" +
- " case 1767 :\n" +
- " return 3;\n" +
- " case 1768 :\n" +
- " return 3;\n" +
- " case 1769 :\n" +
- " return 3;\n" +
- " case 1770 :\n" +
- " return 3;\n" +
- " case 1771 :\n" +
- " return 3;\n" +
- " case 1772 :\n" +
- " return 3;\n" +
- " case 1773 :\n" +
- " return 3;\n" +
- " case 1774 :\n" +
- " return 3;\n" +
- " case 1775 :\n" +
- " return 3;\n" +
- " case 1776 :\n" +
- " return 3;\n" +
- " case 1777 :\n" +
- " return 3;\n" +
- " case 1778 :\n" +
- " return 3;\n" +
- " case 1779 :\n" +
- " return 3;\n" +
- " case 1780 :\n" +
- " return 3;\n" +
- " case 1781 :\n" +
- " return 3;\n" +
- " case 1782 :\n" +
- " return 3;\n" +
- " case 1783 :\n" +
- " return 3;\n" +
- " case 1784 :\n" +
- " return 3;\n" +
- " case 1785 :\n" +
- " return 3;\n" +
- " case 1786 :\n" +
- " return 3;\n" +
- " case 1787 :\n" +
- " return 3;\n" +
- " case 1788 :\n" +
- " return 3;\n" +
- " case 1789 :\n" +
- " return 3;\n" +
- " case 1790 :\n" +
- " return 3;\n" +
- " case 1791 :\n" +
- " return 3;\n" +
- " case 1792 :\n" +
- " return 3;\n" +
- " case 1793 :\n" +
- " return 3;\n" +
- " case 1794 :\n" +
- " return 3;\n" +
- " case 1795 :\n" +
- " return 3;\n" +
- " case 1796 :\n" +
- " return 3;\n" +
- " case 1797 :\n" +
- " return 3;\n" +
- " case 1798 :\n" +
- " return 3;\n" +
- " case 1799 :\n" +
- " return 3;\n" +
- " case 1800 :\n" +
- " return 3;\n" +
- " case 1801 :\n" +
- " return 3;\n" +
- " case 1802 :\n" +
- " return 3;\n" +
- " case 1803 :\n" +
- " return 3;\n" +
- " case 1804 :\n" +
- " return 3;\n" +
- " case 1805 :\n" +
- " return 3;\n" +
- " case 1806 :\n" +
- " return 3;\n" +
- " case 1807 :\n" +
- " return 3;\n" +
- " case 1808 :\n" +
- " return 3;\n" +
- " case 1809 :\n" +
- " return 3;\n" +
- " case 1810 :\n" +
- " return 3;\n" +
- " case 1811 :\n" +
- " return 3;\n" +
- " case 1812 :\n" +
- " return 3;\n" +
- " case 1813 :\n" +
- " return 3;\n" +
- " case 1814 :\n" +
- " return 3;\n" +
- " case 1815 :\n" +
- " return 3;\n" +
- " case 1816 :\n" +
- " return 3;\n" +
- " case 1817 :\n" +
- " return 3;\n" +
- " case 1818 :\n" +
- " return 3;\n" +
- " case 1819 :\n" +
- " return 3;\n" +
- " case 1820 :\n" +
- " return 3;\n" +
- " case 1821 :\n" +
- " return 3;\n" +
- " case 1822 :\n" +
- " return 3;\n" +
- " case 1823 :\n" +
- " return 3;\n" +
- " case 1824 :\n" +
- " return 3;\n" +
- " case 1825 :\n" +
- " return 3;\n" +
- " case 1826 :\n" +
- " return 3;\n" +
- " case 1827 :\n" +
- " return 3;\n" +
- " case 1828 :\n" +
- " return 3;\n" +
- " case 1829 :\n" +
- " return 3;\n" +
- " case 1830 :\n" +
- " return 3;\n" +
- " case 1831 :\n" +
- " return 3;\n" +
- " case 1832 :\n" +
- " return 3;\n" +
- " case 1833 :\n" +
- " return 3;\n" +
- " case 1834 :\n" +
- " return 3;\n" +
- " case 1835 :\n" +
- " return 3;\n" +
- " case 1836 :\n" +
- " return 3;\n" +
- " case 1837 :\n" +
- " return 3;\n" +
- " case 1838 :\n" +
- " return 3;\n" +
- " case 1839 :\n" +
- " return 3;\n" +
- " case 1840 :\n" +
- " return 3;\n" +
- " case 1841 :\n" +
- " return 3;\n" +
- " case 1842 :\n" +
- " return 3;\n" +
- " case 1843 :\n" +
- " return 3;\n" +
- " case 1844 :\n" +
- " return 3;\n" +
- " case 1845 :\n" +
- " return 3;\n" +
- " case 1846 :\n" +
- " return 3;\n" +
- " case 1847 :\n" +
- " return 3;\n" +
- " case 1848 :\n" +
- " return 3;\n" +
- " case 1849 :\n" +
- " return 3;\n" +
- " case 1850 :\n" +
- " return 3;\n" +
- " case 1851 :\n" +
- " return 3;\n" +
- " case 1852 :\n" +
- " return 3;\n" +
- " case 1853 :\n" +
- " return 3;\n" +
- " case 1854 :\n" +
- " return 3;\n" +
- " case 1855 :\n" +
- " return 3;\n" +
- " case 1856 :\n" +
- " return 3;\n" +
- " case 1857 :\n" +
- " return 3;\n" +
- " case 1858 :\n" +
- " return 3;\n" +
- " case 1859 :\n" +
- " return 3;\n" +
- " case 1860 :\n" +
- " return 3;\n" +
- " case 1861 :\n" +
- " return 3;\n" +
- " case 1862 :\n" +
- " return 3;\n" +
- " case 1863 :\n" +
- " return 3;\n" +
- " case 1864 :\n" +
- " return 3;\n" +
- " case 1865 :\n" +
- " return 3;\n" +
- " case 1866 :\n" +
- " return 3;\n" +
- " case 1867 :\n" +
- " return 3;\n" +
- " case 1868 :\n" +
- " return 3;\n" +
- " case 1869 :\n" +
- " return 3;\n" +
- " case 1870 :\n" +
- " return 3;\n" +
- " case 1871 :\n" +
- " return 3;\n" +
- " case 1872 :\n" +
- " return 3;\n" +
- " case 1873 :\n" +
- " return 3;\n" +
- " case 1874 :\n" +
- " return 3;\n" +
- " case 1875 :\n" +
- " return 3;\n" +
- " case 1876 :\n" +
- " return 3;\n" +
- " case 1877 :\n" +
- " return 3;\n" +
- " case 1878 :\n" +
- " return 3;\n" +
- " case 1879 :\n" +
- " return 3;\n" +
- " case 1880 :\n" +
- " return 3;\n" +
- " case 1881 :\n" +
- " return 3;\n" +
- " case 1882 :\n" +
- " return 3;\n" +
- " case 1883 :\n" +
- " return 3;\n" +
- " case 1884 :\n" +
- " return 3;\n" +
- " case 1885 :\n" +
- " return 3;\n" +
- " case 1886 :\n" +
- " return 3;\n" +
- " case 1887 :\n" +
- " return 3;\n" +
- " case 1888 :\n" +
- " return 3;\n" +
- " case 1889 :\n" +
- " return 3;\n" +
- " case 1890 :\n" +
- " return 3;\n" +
- " case 1891 :\n" +
- " return 3;\n" +
- " case 1892 :\n" +
- " return 3;\n" +
- " case 1893 :\n" +
- " return 3;\n" +
- " case 1894 :\n" +
- " return 3;\n" +
- " case 1895 :\n" +
- " return 3;\n" +
- " case 1896 :\n" +
- " return 3;\n" +
- " case 1897 :\n" +
- " return 3;\n" +
- " case 1898 :\n" +
- " return 3;\n" +
- " case 1899 :\n" +
- " return 3;\n" +
- " case 1900 :\n" +
- " return 3;\n" +
- " case 1901 :\n" +
- " return 3;\n" +
- " case 1902 :\n" +
- " return 3;\n" +
- " case 1903 :\n" +
- " return 3;\n" +
- " case 1904 :\n" +
- " return 3;\n" +
- " case 1905 :\n" +
- " return 3;\n" +
- " case 1906 :\n" +
- " return 3;\n" +
- " case 1907 :\n" +
- " return 3;\n" +
- " case 1908 :\n" +
- " return 3;\n" +
- " case 1909 :\n" +
- " return 3;\n" +
- " case 1910 :\n" +
- " return 3;\n" +
- " case 1911 :\n" +
- " return 3;\n" +
- " case 1912 :\n" +
- " return 3;\n" +
- " case 1913 :\n" +
- " return 3;\n" +
- " case 1914 :\n" +
- " return 3;\n" +
- " case 1915 :\n" +
- " return 3;\n" +
- " case 1916 :\n" +
- " return 3;\n" +
- " case 1917 :\n" +
- " return 3;\n" +
- " case 1918 :\n" +
- " return 3;\n" +
- " case 1919 :\n" +
- " return 3;\n" +
- " case 1920 :\n" +
- " return 3;\n" +
- " case 1921 :\n" +
- " return 3;\n" +
- " case 1922 :\n" +
- " return 3;\n" +
- " case 1923 :\n" +
- " return 3;\n" +
- " case 1924 :\n" +
- " return 3;\n" +
- " case 1925 :\n" +
- " return 3;\n" +
- " case 1926 :\n" +
- " return 3;\n" +
- " case 1927 :\n" +
- " return 3;\n" +
- " case 1928 :\n" +
- " return 3;\n" +
- " case 1929 :\n" +
- " return 3;\n" +
- " case 1930 :\n" +
- " return 3;\n" +
- " case 1931 :\n" +
- " return 3;\n" +
- " case 1932 :\n" +
- " return 3;\n" +
- " case 1933 :\n" +
- " return 3;\n" +
- " case 1934 :\n" +
- " return 3;\n" +
- " case 1935 :\n" +
- " return 3;\n" +
- " case 1936 :\n" +
- " return 3;\n" +
- " case 1937 :\n" +
- " return 3;\n" +
- " case 1938 :\n" +
- " return 3;\n" +
- " case 1939 :\n" +
- " return 3;\n" +
- " case 1940 :\n" +
- " return 3;\n" +
- " case 1941 :\n" +
- " return 3;\n" +
- " case 1942 :\n" +
- " return 3;\n" +
- " case 1943 :\n" +
- " return 3;\n" +
- " case 1944 :\n" +
- " return 3;\n" +
- " case 1945 :\n" +
- " return 3;\n" +
- " case 1946 :\n" +
- " return 3;\n" +
- " case 1947 :\n" +
- " return 3;\n" +
- " case 1948 :\n" +
- " return 3;\n" +
- " case 1949 :\n" +
- " return 3;\n" +
- " case 1950 :\n" +
- " return 3;\n" +
- " case 1951 :\n" +
- " return 3;\n" +
- " case 1952 :\n" +
- " return 3;\n" +
- " case 1953 :\n" +
- " return 3;\n" +
- " case 1954 :\n" +
- " return 3;\n" +
- " case 1955 :\n" +
- " return 3;\n" +
- " case 1956 :\n" +
- " return 3;\n" +
- " case 1957 :\n" +
- " return 3;\n" +
- " case 1958 :\n" +
- " return 3;\n" +
- " case 1959 :\n" +
- " return 3;\n" +
- " case 1960 :\n" +
- " return 3;\n" +
- " case 1961 :\n" +
- " return 3;\n" +
- " case 1962 :\n" +
- " return 3;\n" +
- " case 1963 :\n" +
- " return 3;\n" +
- " case 1964 :\n" +
- " return 3;\n" +
- " case 1965 :\n" +
- " return 3;\n" +
- " case 1966 :\n" +
- " return 3;\n" +
- " case 1967 :\n" +
- " return 3;\n" +
- " case 1968 :\n" +
- " return 3;\n" +
- " case 1969 :\n" +
- " return 3;\n" +
- " case 1970 :\n" +
- " return 3;\n" +
- " case 1971 :\n" +
- " return 3;\n" +
- " case 1972 :\n" +
- " return 3;\n" +
- " case 1973 :\n" +
- " return 3;\n" +
- " case 1974 :\n" +
- " return 3;\n" +
- " case 1975 :\n" +
- " return 3;\n" +
- " case 1976 :\n" +
- " return 3;\n" +
- " case 1977 :\n" +
- " return 3;\n" +
- " case 1978 :\n" +
- " return 3;\n" +
- " case 1979 :\n" +
- " return 3;\n" +
- " case 1980 :\n" +
- " return 3;\n" +
- " case 1981 :\n" +
- " return 3;\n" +
- " case 1982 :\n" +
- " return 3;\n" +
- " case 1983 :\n" +
- " return 3;\n" +
- " case 1984 :\n" +
- " return 3;\n" +
- " case 1985 :\n" +
- " return 3;\n" +
- " case 1986 :\n" +
- " return 3;\n" +
- " case 1987 :\n" +
- " return 3;\n" +
- " case 1988 :\n" +
- " return 3;\n" +
- " case 1989 :\n" +
- " return 3;\n" +
- " case 1990 :\n" +
- " return 3;\n" +
- " case 1991 :\n" +
- " return 3;\n" +
- " case 1992 :\n" +
- " return 3;\n" +
- " case 1993 :\n" +
- " return 3;\n" +
- " case 1994 :\n" +
- " return 3;\n" +
- " case 1995 :\n" +
- " return 3;\n" +
- " case 1996 :\n" +
- " return 3;\n" +
- " case 1997 :\n" +
- " return 3;\n" +
- " case 1998 :\n" +
- " return 3;\n" +
- " case 1999 :\n" +
- " return 3;\n" +
- " case 2000 :\n" +
- " return 3;\n" +
- " case 2001 :\n" +
- " return 3;\n" +
- " case 2002 :\n" +
- " return 3;\n" +
- " case 2003 :\n" +
- " return 3;\n" +
- " case 2004 :\n" +
- " return 3;\n" +
- " case 2005 :\n" +
- " return 3;\n" +
- " case 2006 :\n" +
- " return 3;\n" +
- " case 2007 :\n" +
- " return 3;\n" +
- " case 2008 :\n" +
- " return 3;\n" +
- " case 2009 :\n" +
- " return 3;\n" +
- " case 2010 :\n" +
- " return 3;\n" +
- " case 2011 :\n" +
- " return 3;\n" +
- " case 2012 :\n" +
- " return 3;\n" +
- " case 2013 :\n" +
- " return 3;\n" +
- " case 2014 :\n" +
- " return 3;\n" +
- " case 2015 :\n" +
- " return 3;\n" +
- " case 2016 :\n" +
- " return 3;\n" +
- " case 2017 :\n" +
- " return 3;\n" +
- " case 2018 :\n" +
- " return 3;\n" +
- " case 2019 :\n" +
- " return 3;\n" +
- " case 2020 :\n" +
- " return 3;\n" +
- " case 2021 :\n" +
- " return 3;\n" +
- " case 2022 :\n" +
- " return 3;\n" +
- " case 2023 :\n" +
- " return 3;\n" +
- " case 2024 :\n" +
- " return 3;\n" +
- " case 2025 :\n" +
- " return 3;\n" +
- " case 2026 :\n" +
- " return 3;\n" +
- " case 2027 :\n" +
- " return 3;\n" +
- " case 2028 :\n" +
- " return 3;\n" +
- " case 2029 :\n" +
- " return 3;\n" +
- " case 2030 :\n" +
- " return 3;\n" +
- " case 2031 :\n" +
- " return 3;\n" +
- " case 2032 :\n" +
- " return 3;\n" +
- " case 2033 :\n" +
- " return 3;\n" +
- " case 2034 :\n" +
- " return 3;\n" +
- " case 2035 :\n" +
- " return 3;\n" +
- " case 2036 :\n" +
- " return 3;\n" +
- " case 2037 :\n" +
- " return 3;\n" +
- " case 2038 :\n" +
- " return 3;\n" +
- " case 2039 :\n" +
- " return 3;\n" +
- " case 2040 :\n" +
- " return 3;\n" +
- " case 2041 :\n" +
- " return 3;\n" +
- " case 2042 :\n" +
- " return 3;\n" +
- " case 2043 :\n" +
- " return 3;\n" +
- " case 2044 :\n" +
- " return 3;\n" +
- " case 2045 :\n" +
- " return 3;\n" +
- " case 2046 :\n" +
- " return 3;\n" +
- " case 2047 :\n" +
- " return 3;\n" +
- " case 2048 :\n" +
- " return 3;\n" +
- " case 2049 :\n" +
- " return 3;\n" +
- " case 2050 :\n" +
- " return 3;\n" +
- " case 2051 :\n" +
- " return 3;\n" +
- " case 2052 :\n" +
- " return 3;\n" +
- " case 2053 :\n" +
- " return 3;\n" +
- " case 2054 :\n" +
- " return 3;\n" +
- " case 2055 :\n" +
- " return 3;\n" +
- " case 2056 :\n" +
- " return 3;\n" +
- " case 2057 :\n" +
- " return 3;\n" +
- " case 2058 :\n" +
- " return 3;\n" +
- " case 2059 :\n" +
- " return 3;\n" +
- " case 2060 :\n" +
- " return 3;\n" +
- " case 2061 :\n" +
- " return 3;\n" +
- " case 2062 :\n" +
- " return 3;\n" +
- " case 2063 :\n" +
- " return 3;\n" +
- " case 2064 :\n" +
- " return 3;\n" +
- " case 2065 :\n" +
- " return 3;\n" +
- " case 2066 :\n" +
- " return 3;\n" +
- " case 2067 :\n" +
- " return 3;\n" +
- " case 2068 :\n" +
- " return 3;\n" +
- " case 2069 :\n" +
- " return 3;\n" +
- " case 2070 :\n" +
- " return 3;\n" +
- " case 2071 :\n" +
- " return 3;\n" +
- " case 2072 :\n" +
- " return 3;\n" +
- " case 2073 :\n" +
- " return 3;\n" +
- " case 2074 :\n" +
- " return 3;\n" +
- " case 2075 :\n" +
- " return 3;\n" +
- " case 2076 :\n" +
- " return 3;\n" +
- " case 2077 :\n" +
- " return 3;\n" +
- " case 2078 :\n" +
- " return 3;\n" +
- " case 2079 :\n" +
- " return 3;\n" +
- " case 2080 :\n" +
- " return 3;\n" +
- " case 2081 :\n" +
- " return 3;\n" +
- " case 2082 :\n" +
- " return 3;\n" +
- " case 2083 :\n" +
- " return 3;\n" +
- " case 2084 :\n" +
- " return 3;\n" +
- " case 2085 :\n" +
- " return 3;\n" +
- " case 2086 :\n" +
- " return 3;\n" +
- " case 2087 :\n" +
- " return 3;\n" +
- " case 2088 :\n" +
- " return 3;\n" +
- " case 2089 :\n" +
- " return 3;\n" +
- " case 2090 :\n" +
- " return 3;\n" +
- " case 2091 :\n" +
- " return 3;\n" +
- " case 2092 :\n" +
- " return 3;\n" +
- " case 2093 :\n" +
- " return 3;\n" +
- " case 2094 :\n" +
- " return 3;\n" +
- " case 2095 :\n" +
- " return 3;\n" +
- " case 2096 :\n" +
- " return 3;\n" +
- " case 2097 :\n" +
- " return 3;\n" +
- " case 2098 :\n" +
- " return 3;\n" +
- " case 2099 :\n" +
- " return 3;\n" +
- " case 2100 :\n" +
- " return 3;\n" +
- " case 2101 :\n" +
- " return 3;\n" +
- " case 2102 :\n" +
- " return 3;\n" +
- " case 2103 :\n" +
- " return 3;\n" +
- " case 2104 :\n" +
- " return 3;\n" +
- " case 2105 :\n" +
- " return 3;\n" +
- " case 2106 :\n" +
- " return 3;\n" +
- " case 2107 :\n" +
- " return 3;\n" +
- " case 2108 :\n" +
- " return 3;\n" +
- " case 2109 :\n" +
- " return 3;\n" +
- " case 2110 :\n" +
- " return 3;\n" +
- " case 2111 :\n" +
- " return 3;\n" +
- " case 2112 :\n" +
- " return 3;\n" +
- " case 2113 :\n" +
- " return 3;\n" +
- " case 2114 :\n" +
- " return 3;\n" +
- " case 2115 :\n" +
- " return 3;\n" +
- " case 2116 :\n" +
- " return 3;\n" +
- " case 2117 :\n" +
- " return 3;\n" +
- " case 2118 :\n" +
- " return 3;\n" +
- " case 2119 :\n" +
- " return 3;\n" +
- " case 2120 :\n" +
- " return 3;\n" +
- " case 2121 :\n" +
- " return 3;\n" +
- " case 2122 :\n" +
- " return 3;\n" +
- " case 2123 :\n" +
- " return 3;\n" +
- " case 2124 :\n" +
- " return 3;\n" +
- " case 2125 :\n" +
- " return 3;\n" +
- " case 2126 :\n" +
- " return 3;\n" +
- " case 2127 :\n" +
- " return 3;\n" +
- " case 2128 :\n" +
- " return 3;\n" +
- " case 2129 :\n" +
- " return 3;\n" +
- " case 2130 :\n" +
- " return 3;\n" +
- " case 2131 :\n" +
- " return 3;\n" +
- " case 2132 :\n" +
- " return 3;\n" +
- " case 2133 :\n" +
- " return 3;\n" +
- " case 2134 :\n" +
- " return 3;\n" +
- " case 2135 :\n" +
- " return 3;\n" +
- " case 2136 :\n" +
- " return 3;\n" +
- " case 2137 :\n" +
- " return 3;\n" +
- " case 2138 :\n" +
- " return 3;\n" +
- " case 2139 :\n" +
- " return 3;\n" +
- " case 2140 :\n" +
- " return 3;\n" +
- " case 2141 :\n" +
- " return 3;\n" +
- " case 2142 :\n" +
- " return 3;\n" +
- " case 2143 :\n" +
- " return 3;\n" +
- " case 2144 :\n" +
- " return 3;\n" +
- " case 2145 :\n" +
- " return 3;\n" +
- " case 2146 :\n" +
- " return 3;\n" +
- " case 2147 :\n" +
- " return 3;\n" +
- " case 2148 :\n" +
- " return 3;\n" +
- " case 2149 :\n" +
- " return 3;\n" +
- " case 2150 :\n" +
- " return 3;\n" +
- " case 2151 :\n" +
- " return 3;\n" +
- " case 2152 :\n" +
- " return 3;\n" +
- " case 2153 :\n" +
- " return 3;\n" +
- " case 2154 :\n" +
- " return 3;\n" +
- " case 2155 :\n" +
- " return 3;\n" +
- " case 2156 :\n" +
- " return 3;\n" +
- " case 2157 :\n" +
- " return 3;\n" +
- " case 2158 :\n" +
- " return 3;\n" +
- " case 2159 :\n" +
- " return 3;\n" +
- " case 2160 :\n" +
- " return 3;\n" +
- " case 2161 :\n" +
- " return 3;\n" +
- " case 2162 :\n" +
- " return 3;\n" +
- " case 2163 :\n" +
- " return 3;\n" +
- " case 2164 :\n" +
- " return 3;\n" +
- " case 2165 :\n" +
- " return 3;\n" +
- " case 2166 :\n" +
- " return 3;\n" +
- " case 2167 :\n" +
- " return 3;\n" +
- " case 2168 :\n" +
- " return 3;\n" +
- " case 2169 :\n" +
- " return 3;\n" +
- " case 2170 :\n" +
- " return 3;\n" +
- " case 2171 :\n" +
- " return 3;\n" +
- " case 2172 :\n" +
- " return 3;\n" +
- " case 2173 :\n" +
- " return 3;\n" +
- " case 2174 :\n" +
- " return 3;\n" +
- " case 2175 :\n" +
- " return 3;\n" +
- " case 2176 :\n" +
- " return 3;\n" +
- " case 2177 :\n" +
- " return 3;\n" +
- " case 2178 :\n" +
- " return 3;\n" +
- " case 2179 :\n" +
- " return 3;\n" +
- " case 2180 :\n" +
- " return 3;\n" +
- " case 2181 :\n" +
- " return 3;\n" +
- " case 2182 :\n" +
- " return 3;\n" +
- " case 2183 :\n" +
- " return 3;\n" +
- " case 2184 :\n" +
- " return 3;\n" +
- " case 2185 :\n" +
- " return 3;\n" +
- " case 2186 :\n" +
- " return 3;\n" +
- " case 2187 :\n" +
- " return 3;\n" +
- " case 2188 :\n" +
- " return 3;\n" +
- " case 2189 :\n" +
- " return 3;\n" +
- " case 2190 :\n" +
- " return 3;\n" +
- " case 2191 :\n" +
- " return 3;\n" +
- " case 2192 :\n" +
- " return 3;\n" +
- " case 2193 :\n" +
- " return 3;\n" +
- " case 2194 :\n" +
- " return 3;\n" +
- " case 2195 :\n" +
- " return 3;\n" +
- " case 2196 :\n" +
- " return 3;\n" +
- " case 2197 :\n" +
- " return 3;\n" +
- " case 2198 :\n" +
- " return 3;\n" +
- " case 2199 :\n" +
- " return 3;\n" +
- " case 2200 :\n" +
- " return 3;\n" +
- " case 2201 :\n" +
- " return 3;\n" +
- " case 2202 :\n" +
- " return 3;\n" +
- " case 2203 :\n" +
- " return 3;\n" +
- " case 2204 :\n" +
- " return 3;\n" +
- " case 2205 :\n" +
- " return 3;\n" +
- " case 2206 :\n" +
- " return 3;\n" +
- " case 2207 :\n" +
- " return 3;\n" +
- " case 2208 :\n" +
- " return 3;\n" +
- " case 2209 :\n" +
- " return 3;\n" +
- " case 2210 :\n" +
- " return 3;\n" +
- " case 2211 :\n" +
- " return 3;\n" +
- " case 2212 :\n" +
- " return 3;\n" +
- " case 2213 :\n" +
- " return 3;\n" +
- " case 2214 :\n" +
- " return 3;\n" +
- " case 2215 :\n" +
- " return 3;\n" +
- " case 2216 :\n" +
- " return 3;\n" +
- " case 2217 :\n" +
- " return 3;\n" +
- " case 2218 :\n" +
- " return 3;\n" +
- " case 2219 :\n" +
- " return 3;\n" +
- " case 2220 :\n" +
- " return 3;\n" +
- " case 2221 :\n" +
- " return 3;\n" +
- " case 2222 :\n" +
- " return 3;\n" +
- " case 2223 :\n" +
- " return 3;\n" +
- " case 2224 :\n" +
- " return 3;\n" +
- " case 2225 :\n" +
- " return 3;\n" +
- " case 2226 :\n" +
- " return 3;\n" +
- " case 2227 :\n" +
- " return 3;\n" +
- " case 2228 :\n" +
- " return 3;\n" +
- " case 2229 :\n" +
- " return 3;\n" +
- " case 2230 :\n" +
- " return 3;\n" +
- " case 2231 :\n" +
- " return 3;\n" +
- " case 2232 :\n" +
- " return 3;\n" +
- " case 2233 :\n" +
- " return 3;\n" +
- " case 2234 :\n" +
- " return 3;\n" +
- " case 2235 :\n" +
- " return 3;\n" +
- " case 2236 :\n" +
- " return 3;\n" +
- " case 2237 :\n" +
- " return 3;\n" +
- " case 2238 :\n" +
- " return 3;\n" +
- " case 2239 :\n" +
- " return 3;\n" +
- " case 2240 :\n" +
- " return 3;\n" +
- " case 2241 :\n" +
- " return 3;\n" +
- " case 2242 :\n" +
- " return 3;\n" +
- " case 2243 :\n" +
- " return 3;\n" +
- " case 2244 :\n" +
- " return 3;\n" +
- " case 2245 :\n" +
- " return 3;\n" +
- " case 2246 :\n" +
- " return 3;\n" +
- " case 2247 :\n" +
- " return 3;\n" +
- " case 2248 :\n" +
- " return 3;\n" +
- " case 2249 :\n" +
- " return 3;\n" +
- " case 2250 :\n" +
- " return 3;\n" +
- " case 2251 :\n" +
- " return 3;\n" +
- " case 2252 :\n" +
- " return 3;\n" +
- " case 2253 :\n" +
- " return 3;\n" +
- " case 2254 :\n" +
- " return 3;\n" +
- " case 2255 :\n" +
- " return 3;\n" +
- " case 2256 :\n" +
- " return 3;\n" +
- " case 2257 :\n" +
- " return 3;\n" +
- " case 2258 :\n" +
- " return 3;\n" +
- " case 2259 :\n" +
- " return 3;\n" +
- " case 2260 :\n" +
- " return 3;\n" +
- " case 2261 :\n" +
- " return 3;\n" +
- " case 2262 :\n" +
- " return 3;\n" +
- " case 2263 :\n" +
- " return 3;\n" +
- " case 2264 :\n" +
- " return 3;\n" +
- " case 2265 :\n" +
- " return 3;\n" +
- " case 2266 :\n" +
- " return 3;\n" +
- " case 2267 :\n" +
- " return 3;\n" +
- " case 2268 :\n" +
- " return 3;\n" +
- " case 2269 :\n" +
- " return 3;\n" +
- " case 2270 :\n" +
- " return 3;\n" +
- " case 2271 :\n" +
- " return 3;\n" +
- " case 2272 :\n" +
- " return 3;\n" +
- " case 2273 :\n" +
- " return 3;\n" +
- " case 2274 :\n" +
- " return 3;\n" +
- " case 2275 :\n" +
- " return 3;\n" +
- " case 2276 :\n" +
- " return 3;\n" +
- " case 2277 :\n" +
- " return 3;\n" +
- " case 2278 :\n" +
- " return 3;\n" +
- " case 2279 :\n" +
- " return 3;\n" +
- " case 2280 :\n" +
- " return 3;\n" +
- " case 2281 :\n" +
- " return 3;\n" +
- " case 2282 :\n" +
- " return 3;\n" +
- " case 2283 :\n" +
- " return 3;\n" +
- " case 2284 :\n" +
- " return 3;\n" +
- " case 2285 :\n" +
- " return 3;\n" +
- " case 2286 :\n" +
- " return 3;\n" +
- " case 2287 :\n" +
- " return 3;\n" +
- " case 2288 :\n" +
- " return 3;\n" +
- " case 2289 :\n" +
- " return 3;\n" +
- " case 2290 :\n" +
- " return 3;\n" +
- " case 2291 :\n" +
- " return 3;\n" +
- " case 2292 :\n" +
- " return 3;\n" +
- " case 2293 :\n" +
- " return 3;\n" +
- " case 2294 :\n" +
- " return 3;\n" +
- " case 2295 :\n" +
- " return 3;\n" +
- " case 2296 :\n" +
- " return 3;\n" +
- " case 2297 :\n" +
- " return 3;\n" +
- " case 2298 :\n" +
- " return 3;\n" +
- " case 2299 :\n" +
- " return 3;\n" +
- " case 2300 :\n" +
- " return 3;\n" +
- " case 2301 :\n" +
- " return 3;\n" +
- " case 2302 :\n" +
- " return 3;\n" +
- " case 2303 :\n" +
- " return 3;\n" +
- " case 2304 :\n" +
- " return 3;\n" +
- " case 2305 :\n" +
- " return 3;\n" +
- " case 2306 :\n" +
- " return 3;\n" +
- " case 2307 :\n" +
- " return 3;\n" +
- " case 2308 :\n" +
- " return 3;\n" +
- " case 2309 :\n" +
- " return 3;\n" +
- " case 2310 :\n" +
- " return 3;\n" +
- " case 2311 :\n" +
- " return 3;\n" +
- " case 2312 :\n" +
- " return 3;\n" +
- " case 2313 :\n" +
- " return 3;\n" +
- " case 2314 :\n" +
- " return 3;\n" +
- " case 2315 :\n" +
- " return 3;\n" +
- " case 2316 :\n" +
- " return 3;\n" +
- " case 2317 :\n" +
- " return 3;\n" +
- " case 2318 :\n" +
- " return 3;\n" +
- " case 2319 :\n" +
- " return 3;\n" +
- " case 2320 :\n" +
- " return 3;\n" +
- " case 2321 :\n" +
- " return 3;\n" +
- " case 2322 :\n" +
- " return 3;\n" +
- " case 2323 :\n" +
- " return 3;\n" +
- " case 2324 :\n" +
- " return 3;\n" +
- " case 2325 :\n" +
- " return 3;\n" +
- " case 2326 :\n" +
- " return 3;\n" +
- " case 2327 :\n" +
- " return 3;\n" +
- " case 2328 :\n" +
- " return 3;\n" +
- " case 2329 :\n" +
- " return 3;\n" +
- " case 2330 :\n" +
- " return 3;\n" +
- " case 2331 :\n" +
- " return 3;\n" +
- " case 2332 :\n" +
- " return 3;\n" +
- " case 2333 :\n" +
- " return 3;\n" +
- " case 2334 :\n" +
- " return 3;\n" +
- " case 2335 :\n" +
- " return 3;\n" +
- " case 2336 :\n" +
- " return 3;\n" +
- " case 2337 :\n" +
- " return 3;\n" +
- " case 2338 :\n" +
- " return 3;\n" +
- " case 2339 :\n" +
- " return 3;\n" +
- " case 2340 :\n" +
- " return 3;\n" +
- " case 2341 :\n" +
- " return 3;\n" +
- " case 2342 :\n" +
- " return 3;\n" +
- " case 2343 :\n" +
- " return 3;\n" +
- " case 2344 :\n" +
- " return 3;\n" +
- " case 2345 :\n" +
- " return 3;\n" +
- " case 2346 :\n" +
- " return 3;\n" +
- " case 2347 :\n" +
- " return 3;\n" +
- " case 2348 :\n" +
- " return 3;\n" +
- " case 2349 :\n" +
- " return 3;\n" +
- " case 2350 :\n" +
- " return 3;\n" +
- " case 2351 :\n" +
- " return 3;\n" +
- " case 2352 :\n" +
- " return 3;\n" +
- " case 2353 :\n" +
- " return 3;\n" +
- " case 2354 :\n" +
- " return 3;\n" +
- " case 2355 :\n" +
- " return 3;\n" +
- " case 2356 :\n" +
- " return 3;\n" +
- " case 2357 :\n" +
- " return 3;\n" +
- " case 2358 :\n" +
- " return 3;\n" +
- " case 2359 :\n" +
- " return 3;\n" +
- " case 2360 :\n" +
- " return 3;\n" +
- " case 2361 :\n" +
- " return 3;\n" +
- " case 2362 :\n" +
- " return 3;\n" +
- " case 2363 :\n" +
- " return 3;\n" +
- " case 2364 :\n" +
- " return 3;\n" +
- " case 2365 :\n" +
- " return 3;\n" +
- " case 2366 :\n" +
- " return 3;\n" +
- " case 2367 :\n" +
- " return 3;\n" +
- " case 2368 :\n" +
- " return 3;\n" +
- " case 2369 :\n" +
- " return 3;\n" +
- " case 2370 :\n" +
- " return 3;\n" +
- " case 2371 :\n" +
- " return 3;\n" +
- " case 2372 :\n" +
- " return 3;\n" +
- " case 2373 :\n" +
- " return 3;\n" +
- " case 2374 :\n" +
- " return 3;\n" +
- " case 2375 :\n" +
- " return 3;\n" +
- " case 2376 :\n" +
- " return 3;\n" +
- " case 2377 :\n" +
- " return 3;\n" +
- " case 2378 :\n" +
- " return 3;\n" +
- " case 2379 :\n" +
- " return 3;\n" +
- " case 2380 :\n" +
- " return 3;\n" +
- " case 2381 :\n" +
- " return 3;\n" +
- " case 2382 :\n" +
- " return 3;\n" +
- " case 2383 :\n" +
- " return 3;\n" +
- " case 2384 :\n" +
- " return 3;\n" +
- " case 2385 :\n" +
- " return 3;\n" +
- " case 2386 :\n" +
- " return 3;\n" +
- " case 2387 :\n" +
- " return 3;\n" +
- " case 2388 :\n" +
- " return 3;\n" +
- " case 2389 :\n" +
- " return 3;\n" +
- " case 2390 :\n" +
- " return 3;\n" +
- " case 2391 :\n" +
- " return 3;\n" +
- " case 2392 :\n" +
- " return 3;\n" +
- " case 2393 :\n" +
- " return 3;\n" +
- " case 2394 :\n" +
- " return 3;\n" +
- " case 2395 :\n" +
- " return 3;\n" +
- " case 2396 :\n" +
- " return 3;\n" +
- " case 2397 :\n" +
- " return 3;\n" +
- " case 2398 :\n" +
- " return 3;\n" +
- " case 2399 :\n" +
- " return 3;\n" +
- " case 2400 :\n" +
- " return 3;\n" +
- " case 2401 :\n" +
- " return 3;\n" +
- " case 2402 :\n" +
- " return 3;\n" +
- " case 2403 :\n" +
- " return 3;\n" +
- " case 2404 :\n" +
- " return 3;\n" +
- " case 2405 :\n" +
- " return 3;\n" +
- " case 2406 :\n" +
- " return 3;\n" +
- " case 2407 :\n" +
- " return 3;\n" +
- " case 2408 :\n" +
- " return 3;\n" +
- " case 2409 :\n" +
- " return 3;\n" +
- " case 2410 :\n" +
- " return 3;\n" +
- " case 2411 :\n" +
- " return 3;\n" +
- " case 2412 :\n" +
- " return 3;\n" +
- " case 2413 :\n" +
- " return 3;\n" +
- " case 2414 :\n" +
- " return 3;\n" +
- " case 2415 :\n" +
- " return 3;\n" +
- " case 2416 :\n" +
- " return 3;\n" +
- " case 2417 :\n" +
- " return 3;\n" +
- " case 2418 :\n" +
- " return 3;\n" +
- " case 2419 :\n" +
- " return 3;\n" +
- " case 2420 :\n" +
- " return 3;\n" +
- " case 2421 :\n" +
- " return 3;\n" +
- " case 2422 :\n" +
- " return 3;\n" +
- " case 2423 :\n" +
- " return 3;\n" +
- " case 2424 :\n" +
- " return 3;\n" +
- " case 2425 :\n" +
- " return 3;\n" +
- " case 2426 :\n" +
- " return 3;\n" +
- " case 2427 :\n" +
- " return 3;\n" +
- " case 2428 :\n" +
- " return 3;\n" +
- " case 2429 :\n" +
- " return 3;\n" +
- " case 2430 :\n" +
- " return 3;\n" +
- " case 2431 :\n" +
- " return 3;\n" +
- " case 2432 :\n" +
- " return 3;\n" +
- " case 2433 :\n" +
- " return 3;\n" +
- " case 2434 :\n" +
- " return 3;\n" +
- " case 2435 :\n" +
- " return 3;\n" +
- " case 2436 :\n" +
- " return 3;\n" +
- " case 2437 :\n" +
- " return 3;\n" +
- " case 2438 :\n" +
- " return 3;\n" +
- " case 2439 :\n" +
- " return 3;\n" +
- " case 2440 :\n" +
- " return 3;\n" +
- " case 2441 :\n" +
- " return 3;\n" +
- " case 2442 :\n" +
- " return 3;\n" +
- " case 2443 :\n" +
- " return 3;\n" +
- " case 2444 :\n" +
- " return 3;\n" +
- " case 2445 :\n" +
- " return 3;\n" +
- " case 2446 :\n" +
- " return 3;\n" +
- " case 2447 :\n" +
- " return 3;\n" +
- " case 2448 :\n" +
- " return 3;\n" +
- " case 2449 :\n" +
- " return 3;\n" +
- " case 2450 :\n" +
- " return 3;\n" +
- " case 2451 :\n" +
- " return 3;\n" +
- " case 2452 :\n" +
- " return 3;\n" +
- " case 2453 :\n" +
- " return 3;\n" +
- " case 2454 :\n" +
- " return 3;\n" +
- " case 2455 :\n" +
- " return 3;\n" +
- " case 2456 :\n" +
- " return 3;\n" +
- " case 2457 :\n" +
- " return 3;\n" +
- " case 2458 :\n" +
- " return 3;\n" +
- " case 2459 :\n" +
- " return 3;\n" +
- " case 2460 :\n" +
- " return 3;\n" +
- " case 2461 :\n" +
- " return 3;\n" +
- " case 2462 :\n" +
- " return 3;\n" +
- " case 2463 :\n" +
- " return 3;\n" +
- " case 2464 :\n" +
- " return 3;\n" +
- " case 2465 :\n" +
- " return 3;\n" +
- " case 2466 :\n" +
- " return 3;\n" +
- " case 2467 :\n" +
- " return 3;\n" +
- " case 2468 :\n" +
- " return 3;\n" +
- " case 2469 :\n" +
- " return 3;\n" +
- " case 2470 :\n" +
- " return 3;\n" +
- " case 2471 :\n" +
- " return 3;\n" +
- " case 2472 :\n" +
- " return 3;\n" +
- " case 2473 :\n" +
- " return 3;\n" +
- " case 2474 :\n" +
- " return 3;\n" +
- " case 2475 :\n" +
- " return 3;\n" +
- " case 2476 :\n" +
- " return 3;\n" +
- " case 2477 :\n" +
- " return 3;\n" +
- " case 2478 :\n" +
- " return 3;\n" +
- " case 2479 :\n" +
- " return 3;\n" +
- " case 2480 :\n" +
- " return 3;\n" +
- " case 2481 :\n" +
- " return 3;\n" +
- " case 2482 :\n" +
- " return 3;\n" +
- " case 2483 :\n" +
- " return 3;\n" +
- " case 2484 :\n" +
- " return 3;\n" +
- " case 2485 :\n" +
- " return 3;\n" +
- " case 2486 :\n" +
- " return 3;\n" +
- " case 2487 :\n" +
- " return 3;\n" +
- " case 2488 :\n" +
- " return 3;\n" +
- " case 2489 :\n" +
- " return 3;\n" +
- " case 2490 :\n" +
- " return 3;\n" +
- " case 2491 :\n" +
- " return 3;\n" +
- " case 2492 :\n" +
- " return 3;\n" +
- " case 2493 :\n" +
- " return 3;\n" +
- " case 2494 :\n" +
- " return 3;\n" +
- " case 2495 :\n" +
- " return 3;\n" +
- " case 2496 :\n" +
- " return 3;\n" +
- " case 2497 :\n" +
- " return 3;\n" +
- " case 2498 :\n" +
- " return 3;\n" +
- " case 2499 :\n" +
- " return 3;\n" +
- " case 2500 :\n" +
- " return 3;\n" +
- " case 2501 :\n" +
- " return 3;\n" +
- " case 2502 :\n" +
- " return 3;\n" +
- " case 2503 :\n" +
- " return 3;\n" +
- " case 2504 :\n" +
- " return 3;\n" +
- " case 2505 :\n" +
- " return 3;\n" +
- " case 2506 :\n" +
- " return 3;\n" +
- " case 2507 :\n" +
- " return 3;\n" +
- " case 2508 :\n" +
- " return 3;\n" +
- " case 2509 :\n" +
- " return 3;\n" +
- " case 2510 :\n" +
- " return 3;\n" +
- " case 2511 :\n" +
- " return 3;\n" +
- " case 2512 :\n" +
- " return 3;\n" +
- " case 2513 :\n" +
- " return 3;\n" +
- " case 2514 :\n" +
- " return 3;\n" +
- " case 2515 :\n" +
- " return 3;\n" +
- " case 2516 :\n" +
- " return 3;\n" +
- " case 2517 :\n" +
- " return 3;\n" +
- " case 2518 :\n" +
- " return 3;\n" +
- " case 2519 :\n" +
- " return 3;\n" +
- " case 2520 :\n" +
- " return 3;\n" +
- " case 2521 :\n" +
- " return 3;\n" +
- " case 2522 :\n" +
- " return 3;\n" +
- " case 2523 :\n" +
- " return 3;\n" +
- " case 2524 :\n" +
- " return 3;\n" +
- " case 2525 :\n" +
- " return 3;\n" +
- " case 2526 :\n" +
- " return 3;\n" +
- " case 2527 :\n" +
- " return 3;\n" +
- " case 2528 :\n" +
- " return 3;\n" +
- " case 2529 :\n" +
- " return 3;\n" +
- " case 2530 :\n" +
- " return 3;\n" +
- " case 2531 :\n" +
- " return 3;\n" +
- " case 2532 :\n" +
- " return 3;\n" +
- " case 2533 :\n" +
- " return 3;\n" +
- " case 2534 :\n" +
- " return 3;\n" +
- " case 2535 :\n" +
- " return 3;\n" +
- " case 2536 :\n" +
- " return 3;\n" +
- " case 2537 :\n" +
- " return 3;\n" +
- " case 2538 :\n" +
- " return 3;\n" +
- " case 2539 :\n" +
- " return 3;\n" +
- " case 2540 :\n" +
- " return 3;\n" +
- " case 2541 :\n" +
- " return 3;\n" +
- " case 2542 :\n" +
- " return 3;\n" +
- " case 2543 :\n" +
- " return 3;\n" +
- " case 2544 :\n" +
- " return 3;\n" +
- " case 2545 :\n" +
- " return 3;\n" +
- " case 2546 :\n" +
- " return 3;\n" +
- " case 2547 :\n" +
- " return 3;\n" +
- " case 2548 :\n" +
- " return 3;\n" +
- " case 2549 :\n" +
- " return 3;\n" +
- " case 2550 :\n" +
- " return 3;\n" +
- " case 2551 :\n" +
- " return 3;\n" +
- " case 2552 :\n" +
- " return 3;\n" +
- " case 2553 :\n" +
- " return 3;\n" +
- " case 2554 :\n" +
- " return 3;\n" +
- " case 2555 :\n" +
- " return 3;\n" +
- " case 2556 :\n" +
- " return 3;\n" +
- " case 2557 :\n" +
- " return 3;\n" +
- " case 2558 :\n" +
- " return 3;\n" +
- " case 2559 :\n" +
- " return 3;\n" +
- " case 2560 :\n" +
- " return 3;\n" +
- " case 2561 :\n" +
- " return 3;\n" +
- " case 2562 :\n" +
- " return 3;\n" +
- " case 2563 :\n" +
- " return 3;\n" +
- " case 2564 :\n" +
- " return 3;\n" +
- " case 2565 :\n" +
- " return 3;\n" +
- " case 2566 :\n" +
- " return 3;\n" +
- " case 2567 :\n" +
- " return 3;\n" +
- " case 2568 :\n" +
- " return 3;\n" +
- " case 2569 :\n" +
- " return 3;\n" +
- " case 2570 :\n" +
- " return 3;\n" +
- " case 2571 :\n" +
- " return 3;\n" +
- " case 2572 :\n" +
- " return 3;\n" +
- " case 2573 :\n" +
- " return 3;\n" +
- " case 2574 :\n" +
- " return 3;\n" +
- " case 2575 :\n" +
- " return 3;\n" +
- " case 2576 :\n" +
- " return 3;\n" +
- " case 2577 :\n" +
- " return 3;\n" +
- " case 2578 :\n" +
- " return 3;\n" +
- " case 2579 :\n" +
- " return 3;\n" +
- " case 2580 :\n" +
- " return 3;\n" +
- " case 2581 :\n" +
- " return 3;\n" +
- " case 2582 :\n" +
- " return 3;\n" +
- " case 2583 :\n" +
- " return 3;\n" +
- " case 2584 :\n" +
- " return 3;\n" +
- " case 2585 :\n" +
- " return 3;\n" +
- " case 2586 :\n" +
- " return 3;\n" +
- " case 2587 :\n" +
- " return 3;\n" +
- " case 2588 :\n" +
- " return 3;\n" +
- " case 2589 :\n" +
- " return 3;\n" +
- " case 2590 :\n" +
- " return 3;\n" +
- " case 2591 :\n" +
- " return 3;\n" +
- " case 2592 :\n" +
- " return 3;\n" +
- " case 2593 :\n" +
- " return 3;\n" +
- " case 2594 :\n" +
- " return 3;\n" +
- " case 2595 :\n" +
- " return 3;\n" +
- " case 2596 :\n" +
- " return 3;\n" +
- " case 2597 :\n" +
- " return 3;\n" +
- " case 2598 :\n" +
- " return 3;\n" +
- " case 2599 :\n" +
- " return 3;\n" +
- " case 2600 :\n" +
- " return 3;\n" +
- " case 2601 :\n" +
- " return 3;\n" +
- " case 2602 :\n" +
- " return 3;\n" +
- " case 2603 :\n" +
- " return 3;\n" +
- " case 2604 :\n" +
- " return 3;\n" +
- " case 2605 :\n" +
- " return 3;\n" +
- " case 2606 :\n" +
- " return 3;\n" +
- " case 2607 :\n" +
- " return 3;\n" +
- " case 2608 :\n" +
- " return 3;\n" +
- " case 2609 :\n" +
- " return 3;\n" +
- " case 2610 :\n" +
- " return 3;\n" +
- " case 2611 :\n" +
- " return 3;\n" +
- " case 2612 :\n" +
- " return 3;\n" +
- " case 2613 :\n" +
- " return 3;\n" +
- " case 2614 :\n" +
- " return 3;\n" +
- " case 2615 :\n" +
- " return 3;\n" +
- " case 2616 :\n" +
- " return 3;\n" +
- " case 2617 :\n" +
- " return 3;\n" +
- " case 2618 :\n" +
- " return 3;\n" +
- " case 2619 :\n" +
- " return 3;\n" +
- " case 2620 :\n" +
- " return 3;\n" +
- " case 2621 :\n" +
- " return 3;\n" +
- " case 2622 :\n" +
- " return 3;\n" +
- " case 2623 :\n" +
- " return 3;\n" +
- " case 2624 :\n" +
- " return 3;\n" +
- " case 2625 :\n" +
- " return 3;\n" +
- " case 2626 :\n" +
- " return 3;\n" +
- " case 2627 :\n" +
- " return 3;\n" +
- " case 2628 :\n" +
- " return 3;\n" +
- " case 2629 :\n" +
- " return 3;\n" +
- " case 2630 :\n" +
- " return 3;\n" +
- " case 2631 :\n" +
- " return 3;\n" +
- " case 2632 :\n" +
- " return 3;\n" +
- " case 2633 :\n" +
- " return 3;\n" +
- " case 2634 :\n" +
- " return 3;\n" +
- " case 2635 :\n" +
- " return 3;\n" +
- " case 2636 :\n" +
- " return 3;\n" +
- " case 2637 :\n" +
- " return 3;\n" +
- " case 2638 :\n" +
- " return 3;\n" +
- " case 2639 :\n" +
- " return 3;\n" +
- " case 2640 :\n" +
- " return 3;\n" +
- " case 2641 :\n" +
- " return 3;\n" +
- " case 2642 :\n" +
- " return 3;\n" +
- " case 2643 :\n" +
- " return 3;\n" +
- " case 2644 :\n" +
- " return 3;\n" +
- " case 2645 :\n" +
- " return 3;\n" +
- " case 2646 :\n" +
- " return 3;\n" +
- " case 2647 :\n" +
- " return 3;\n" +
- " case 2648 :\n" +
- " return 3;\n" +
- " case 2649 :\n" +
- " return 3;\n" +
- " case 2650 :\n" +
- " return 3;\n" +
- " case 2651 :\n" +
- " return 3;\n" +
- " case 2652 :\n" +
- " return 3;\n" +
- " case 2653 :\n" +
- " return 3;\n" +
- " case 2654 :\n" +
- " return 3;\n" +
- " case 2655 :\n" +
- " return 3;\n" +
- " case 2656 :\n" +
- " return 3;\n" +
- " case 2657 :\n" +
- " return 3;\n" +
- " case 2658 :\n" +
- " return 3;\n" +
- " case 2659 :\n" +
- " return 3;\n" +
- " case 2660 :\n" +
- " return 3;\n" +
- " case 2661 :\n" +
- " return 3;\n" +
- " case 2662 :\n" +
- " return 3;\n" +
- " case 2663 :\n" +
- " return 3;\n" +
- " case 2664 :\n" +
- " return 3;\n" +
- " case 2665 :\n" +
- " return 3;\n" +
- " case 2666 :\n" +
- " return 3;\n" +
- " case 2667 :\n" +
- " return 3;\n" +
- " case 2668 :\n" +
- " return 3;\n" +
- " case 2669 :\n" +
- " return 3;\n" +
- " case 2670 :\n" +
- " return 3;\n" +
- " case 2671 :\n" +
- " return 3;\n" +
- " case 2672 :\n" +
- " return 3;\n" +
- " case 2673 :\n" +
- " return 3;\n" +
- " case 2674 :\n" +
- " return 3;\n" +
- " case 2675 :\n" +
- " return 3;\n" +
- " case 2676 :\n" +
- " return 3;\n" +
- " case 2677 :\n" +
- " return 3;\n" +
- " case 2678 :\n" +
- " return 3;\n" +
- " case 2679 :\n" +
- " return 3;\n" +
- " case 2680 :\n" +
- " return 3;\n" +
- " case 2681 :\n" +
- " return 3;\n" +
- " case 2682 :\n" +
- " return 3;\n" +
- " case 2683 :\n" +
- " return 3;\n" +
- " case 2684 :\n" +
- " return 3;\n" +
- " case 2685 :\n" +
- " return 3;\n" +
- " case 2686 :\n" +
- " return 3;\n" +
- " case 2687 :\n" +
- " return 3;\n" +
- " case 2688 :\n" +
- " return 3;\n" +
- " case 2689 :\n" +
- " return 3;\n" +
- " case 2690 :\n" +
- " return 3;\n" +
- " case 2691 :\n" +
- " return 3;\n" +
- " case 2692 :\n" +
- " return 3;\n" +
- " case 2693 :\n" +
- " return 3;\n" +
- " case 2694 :\n" +
- " return 3;\n" +
- " case 2695 :\n" +
- " return 3;\n" +
- " case 2696 :\n" +
- " return 3;\n" +
- " case 2697 :\n" +
- " return 3;\n" +
- " case 2698 :\n" +
- " return 3;\n" +
- " case 2699 :\n" +
- " return 3;\n" +
- " case 2700 :\n" +
- " return 3;\n" +
- " case 2701 :\n" +
- " return 3;\n" +
- " case 2702 :\n" +
- " return 3;\n" +
- " case 2703 :\n" +
- " return 3;\n" +
- " case 2704 :\n" +
- " return 3;\n" +
- " case 2705 :\n" +
- " return 3;\n" +
- " case 2706 :\n" +
- " return 3;\n" +
- " case 2707 :\n" +
- " return 3;\n" +
- " case 2708 :\n" +
- " return 3;\n" +
- " case 2709 :\n" +
- " return 3;\n" +
- " case 2710 :\n" +
- " return 3;\n" +
- " case 2711 :\n" +
- " return 3;\n" +
- " case 2712 :\n" +
- " return 3;\n" +
- " case 2713 :\n" +
- " return 3;\n" +
- " case 2714 :\n" +
- " return 3;\n" +
- " case 2715 :\n" +
- " return 3;\n" +
- " case 2716 :\n" +
- " return 3;\n" +
- " case 2717 :\n" +
- " return 3;\n" +
- " case 2718 :\n" +
- " return 3;\n" +
- " case 2719 :\n" +
- " return 3;\n" +
- " case 2720 :\n" +
- " return 3;\n" +
- " case 2721 :\n" +
- " return 3;\n" +
- " case 2722 :\n" +
- " return 3;\n" +
- " case 2723 :\n" +
- " return 3;\n" +
- " case 2724 :\n" +
- " return 3;\n" +
- " case 2725 :\n" +
- " return 3;\n" +
- " case 2726 :\n" +
- " return 3;\n" +
- " case 2727 :\n" +
- " return 3;\n" +
- " case 2728 :\n" +
- " return 3;\n" +
- " case 2729 :\n" +
- " return 3;\n" +
- " case 2730 :\n" +
- " return 3;\n" +
- " case 2731 :\n" +
- " return 3;\n" +
- " case 2732 :\n" +
- " return 3;\n" +
- " case 2733 :\n" +
- " return 3;\n" +
- " case 2734 :\n" +
- " return 3;\n" +
- " case 2735 :\n" +
- " return 3;\n" +
- " case 2736 :\n" +
- " return 3;\n" +
- " case 2737 :\n" +
- " return 3;\n" +
- " case 2738 :\n" +
- " return 3;\n" +
- " case 2739 :\n" +
- " return 3;\n" +
- " case 2740 :\n" +
- " return 3;\n" +
- " case 2741 :\n" +
- " return 3;\n" +
- " case 2742 :\n" +
- " return 3;\n" +
- " case 2743 :\n" +
- " return 3;\n" +
- " case 2744 :\n" +
- " return 3;\n" +
- " case 2745 :\n" +
- " return 3;\n" +
- " case 2746 :\n" +
- " return 3;\n" +
- " case 2747 :\n" +
- " return 3;\n" +
- " case 2748 :\n" +
- " return 3;\n" +
- " case 2749 :\n" +
- " return 3;\n" +
- " case 2750 :\n" +
- " return 3;\n" +
- " case 2751 :\n" +
- " return 3;\n" +
- " case 2752 :\n" +
- " return 3;\n" +
- " case 2753 :\n" +
- " return 3;\n" +
- " case 2754 :\n" +
- " return 3;\n" +
- " case 2755 :\n" +
- " return 3;\n" +
- " case 2756 :\n" +
- " return 3;\n" +
- " case 2757 :\n" +
- " return 3;\n" +
- " case 2758 :\n" +
- " return 3;\n" +
- " case 2759 :\n" +
- " return 3;\n" +
- " case 2760 :\n" +
- " return 3;\n" +
- " case 2761 :\n" +
- " return 3;\n" +
- " case 2762 :\n" +
- " return 3;\n" +
- " case 2763 :\n" +
- " return 3;\n" +
- " case 2764 :\n" +
- " return 3;\n" +
- " case 2765 :\n" +
- " return 3;\n" +
- " case 2766 :\n" +
- " return 3;\n" +
- " case 2767 :\n" +
- " return 3;\n" +
- " case 2768 :\n" +
- " return 3;\n" +
- " case 2769 :\n" +
- " return 3;\n" +
- " case 2770 :\n" +
- " return 3;\n" +
- " case 2771 :\n" +
- " return 3;\n" +
- " case 2772 :\n" +
- " return 3;\n" +
- " case 2773 :\n" +
- " return 3;\n" +
- " case 2774 :\n" +
- " return 3;\n" +
- " case 2775 :\n" +
- " return 3;\n" +
- " case 2776 :\n" +
- " return 3;\n" +
- " case 2777 :\n" +
- " return 3;\n" +
- " case 2778 :\n" +
- " return 3;\n" +
- " case 2779 :\n" +
- " return 3;\n" +
- " case 2780 :\n" +
- " return 3;\n" +
- " case 2781 :\n" +
- " return 3;\n" +
- " case 2782 :\n" +
- " return 3;\n" +
- " case 2783 :\n" +
- " return 3;\n" +
- " case 2784 :\n" +
- " return 3;\n" +
- " case 2785 :\n" +
- " return 3;\n" +
- " case 2786 :\n" +
- " return 3;\n" +
- " case 2787 :\n" +
- " return 3;\n" +
- " case 2788 :\n" +
- " return 3;\n" +
- " case 2789 :\n" +
- " return 3;\n" +
- " case 2790 :\n" +
- " return 3;\n" +
- " case 2791 :\n" +
- " return 3;\n" +
- " case 2792 :\n" +
- " return 3;\n" +
- " case 2793 :\n" +
- " return 3;\n" +
- " case 2794 :\n" +
- " return 3;\n" +
- " case 2795 :\n" +
- " return 3;\n" +
- " case 2796 :\n" +
- " return 3;\n" +
- " case 2797 :\n" +
- " return 3;\n" +
- " case 2798 :\n" +
- " return 3;\n" +
- " case 2799 :\n" +
- " return 3;\n" +
- " case 2800 :\n" +
- " return 3;\n" +
- " case 2801 :\n" +
- " return 3;\n" +
- " case 2802 :\n" +
- " return 3;\n" +
- " case 2803 :\n" +
- " return 3;\n" +
- " case 2804 :\n" +
- " return 3;\n" +
- " case 2805 :\n" +
- " return 3;\n" +
- " case 2806 :\n" +
- " return 3;\n" +
- " case 2807 :\n" +
- " return 3;\n" +
- " case 2808 :\n" +
- " return 3;\n" +
- " case 2809 :\n" +
- " return 3;\n" +
- " case 2810 :\n" +
- " return 3;\n" +
- " case 2811 :\n" +
- " return 3;\n" +
- " case 2812 :\n" +
- " return 3;\n" +
- " case 2813 :\n" +
- " return 3;\n" +
- " case 2814 :\n" +
- " return 3;\n" +
- " case 2815 :\n" +
- " return 3;\n" +
- " case 2816 :\n" +
- " return 3;\n" +
- " case 2817 :\n" +
- " return 3;\n" +
- " case 2818 :\n" +
- " return 3;\n" +
- " case 2819 :\n" +
- " return 3;\n" +
- " case 2820 :\n" +
- " return 3;\n" +
- " case 2821 :\n" +
- " return 3;\n" +
- " case 2822 :\n" +
- " return 3;\n" +
- " case 2823 :\n" +
- " return 3;\n" +
- " case 2824 :\n" +
- " return 3;\n" +
- " case 2825 :\n" +
- " return 3;\n" +
- " case 2826 :\n" +
- " return 3;\n" +
- " case 2827 :\n" +
- " return 3;\n" +
- " case 2828 :\n" +
- " return 3;\n" +
- " case 2829 :\n" +
- " return 3;\n" +
- " case 2830 :\n" +
- " return 3;\n" +
- " case 2831 :\n" +
- " return 3;\n" +
- " case 2832 :\n" +
- " return 3;\n" +
- " case 2833 :\n" +
- " return 3;\n" +
- " case 2834 :\n" +
- " return 3;\n" +
- " case 2835 :\n" +
- " return 3;\n" +
- " case 2836 :\n" +
- " return 3;\n" +
- " case 2837 :\n" +
- " return 3;\n" +
- " case 2838 :\n" +
- " return 3;\n" +
- " case 2839 :\n" +
- " return 3;\n" +
- " case 2840 :\n" +
- " return 3;\n" +
- " case 2841 :\n" +
- " return 3;\n" +
- " case 2842 :\n" +
- " return 3;\n" +
- " case 2843 :\n" +
- " return 3;\n" +
- " case 2844 :\n" +
- " return 3;\n" +
- " case 2845 :\n" +
- " return 3;\n" +
- " case 2846 :\n" +
- " return 3;\n" +
- " case 2847 :\n" +
- " return 3;\n" +
- " case 2848 :\n" +
- " return 3;\n" +
- " case 2849 :\n" +
- " return 3;\n" +
- " case 2850 :\n" +
- " return 3;\n" +
- " case 2851 :\n" +
- " return 3;\n" +
- " case 2852 :\n" +
- " return 3;\n" +
- " case 2853 :\n" +
- " return 3;\n" +
- " case 2854 :\n" +
- " return 3;\n" +
- " case 2855 :\n" +
- " return 3;\n" +
- " case 2856 :\n" +
- " return 3;\n" +
- " case 2857 :\n" +
- " return 3;\n" +
- " case 2858 :\n" +
- " return 3;\n" +
- " case 2859 :\n" +
- " return 3;\n" +
- " case 2860 :\n" +
- " return 3;\n" +
- " case 2861 :\n" +
- " return 3;\n" +
- " case 2862 :\n" +
- " return 3;\n" +
- " case 2863 :\n" +
- " return 3;\n" +
- " case 2864 :\n" +
- " return 3;\n" +
- " case 2865 :\n" +
- " return 3;\n" +
- " case 2866 :\n" +
- " return 3;\n" +
- " case 2867 :\n" +
- " return 3;\n" +
- " case 2868 :\n" +
- " return 3;\n" +
- " case 2869 :\n" +
- " return 3;\n" +
- " case 2870 :\n" +
- " return 3;\n" +
- " case 2871 :\n" +
- " return 3;\n" +
- " case 2872 :\n" +
- " return 3;\n" +
- " case 2873 :\n" +
- " return 3;\n" +
- " case 2874 :\n" +
- " return 3;\n" +
- " case 2875 :\n" +
- " return 3;\n" +
- " case 2876 :\n" +
- " return 3;\n" +
- " case 2877 :\n" +
- " return 3;\n" +
- " case 2878 :\n" +
- " return 3;\n" +
- " case 2879 :\n" +
- " return 3;\n" +
- " case 2880 :\n" +
- " return 3;\n" +
- " case 2881 :\n" +
- " return 3;\n" +
- " case 2882 :\n" +
- " return 3;\n" +
- " case 2883 :\n" +
- " return 3;\n" +
- " case 2884 :\n" +
- " return 3;\n" +
- " case 2885 :\n" +
- " return 3;\n" +
- " case 2886 :\n" +
- " return 3;\n" +
- " case 2887 :\n" +
- " return 3;\n" +
- " case 2888 :\n" +
- " return 3;\n" +
- " case 2889 :\n" +
- " return 3;\n" +
- " case 2890 :\n" +
- " return 3;\n" +
- " case 2891 :\n" +
- " return 3;\n" +
- " case 2892 :\n" +
- " return 3;\n" +
- " case 2893 :\n" +
- " return 3;\n" +
- " case 2894 :\n" +
- " return 3;\n" +
- " case 2895 :\n" +
- " return 3;\n" +
- " case 2896 :\n" +
- " return 3;\n" +
- " case 2897 :\n" +
- " return 3;\n" +
- " case 2898 :\n" +
- " return 3;\n" +
- " case 2899 :\n" +
- " return 3;\n" +
- " case 2900 :\n" +
- " return 3;\n" +
- " case 2901 :\n" +
- " return 3;\n" +
- " case 2902 :\n" +
- " return 3;\n" +
- " case 2903 :\n" +
- " return 3;\n" +
- " case 2904 :\n" +
- " return 3;\n" +
- " case 2905 :\n" +
- " return 3;\n" +
- " case 2906 :\n" +
- " return 3;\n" +
- " case 2907 :\n" +
- " return 3;\n" +
- " case 2908 :\n" +
- " return 3;\n" +
- " case 2909 :\n" +
- " return 3;\n" +
- " case 2910 :\n" +
- " return 3;\n" +
- " case 2911 :\n" +
- " return 3;\n" +
- " case 2912 :\n" +
- " return 3;\n" +
- " case 2913 :\n" +
- " return 3;\n" +
- " case 2914 :\n" +
- " return 3;\n" +
- " case 2915 :\n" +
- " return 3;\n" +
- " case 2916 :\n" +
- " return 3;\n" +
- " case 2917 :\n" +
- " return 3;\n" +
- " case 2918 :\n" +
- " return 3;\n" +
- " case 2919 :\n" +
- " return 3;\n" +
- " case 2920 :\n" +
- " return 3;\n" +
- " case 2921 :\n" +
- " return 3;\n" +
- " case 2922 :\n" +
- " return 3;\n" +
- " case 2923 :\n" +
- " return 3;\n" +
- " case 2924 :\n" +
- " return 3;\n" +
- " case 2925 :\n" +
- " return 3;\n" +
- " case 2926 :\n" +
- " return 3;\n" +
- " case 2927 :\n" +
- " return 3;\n" +
- " case 2928 :\n" +
- " return 3;\n" +
- " case 2929 :\n" +
- " return 3;\n" +
- " case 2930 :\n" +
- " return 3;\n" +
- " case 2931 :\n" +
- " return 3;\n" +
- " case 2932 :\n" +
- " return 3;\n" +
- " case 2933 :\n" +
- " return 3;\n" +
- " case 2934 :\n" +
- " return 3;\n" +
- " case 2935 :\n" +
- " return 3;\n" +
- " case 2936 :\n" +
- " return 3;\n" +
- " case 2937 :\n" +
- " return 3;\n" +
- " case 2938 :\n" +
- " return 3;\n" +
- " case 2939 :\n" +
- " return 3;\n" +
- " case 2940 :\n" +
- " return 3;\n" +
- " case 2941 :\n" +
- " return 3;\n" +
- " case 2942 :\n" +
- " return 3;\n" +
- " case 2943 :\n" +
- " return 3;\n" +
- " case 2944 :\n" +
- " return 3;\n" +
- " case 2945 :\n" +
- " return 3;\n" +
- " case 2946 :\n" +
- " return 3;\n" +
- " case 2947 :\n" +
- " return 3;\n" +
- " case 2948 :\n" +
- " return 3;\n" +
- " case 2949 :\n" +
- " return 3;\n" +
- " case 2950 :\n" +
- " return 3;\n" +
- " case 2951 :\n" +
- " return 3;\n" +
- " case 2952 :\n" +
- " return 3;\n" +
- " case 2953 :\n" +
- " return 3;\n" +
- " case 2954 :\n" +
- " return 3;\n" +
- " case 2955 :\n" +
- " return 3;\n" +
- " case 2956 :\n" +
- " return 3;\n" +
- " case 2957 :\n" +
- " return 3;\n" +
- " case 2958 :\n" +
- " return 3;\n" +
- " case 2959 :\n" +
- " return 3;\n" +
- " case 2960 :\n" +
- " return 3;\n" +
- " case 2961 :\n" +
- " return 3;\n" +
- " case 2962 :\n" +
- " return 3;\n" +
- " case 2963 :\n" +
- " return 3;\n" +
- " case 2964 :\n" +
- " return 3;\n" +
- " case 2965 :\n" +
- " return 3;\n" +
- " case 2966 :\n" +
- " return 3;\n" +
- " case 2967 :\n" +
- " return 3;\n" +
- " case 2968 :\n" +
- " return 3;\n" +
- " case 2969 :\n" +
- " return 3;\n" +
- " case 2970 :\n" +
- " return 3;\n" +
- " case 2971 :\n" +
- " return 3;\n" +
- " case 2972 :\n" +
- " return 3;\n" +
- " case 2973 :\n" +
- " return 3;\n" +
- " case 2974 :\n" +
- " return 3;\n" +
- " case 2975 :\n" +
- " return 3;\n" +
- " case 2976 :\n" +
- " return 3;\n" +
- " case 2977 :\n" +
- " return 3;\n" +
- " case 2978 :\n" +
- " return 3;\n" +
- " case 2979 :\n" +
- " return 3;\n" +
- " case 2980 :\n" +
- " return 3;\n" +
- " case 2981 :\n" +
- " return 3;\n" +
- " case 2982 :\n" +
- " return 3;\n" +
- " case 2983 :\n" +
- " return 3;\n" +
- " case 2984 :\n" +
- " return 3;\n" +
- " case 2985 :\n" +
- " return 3;\n" +
- " case 2986 :\n" +
- " return 3;\n" +
- " case 2987 :\n" +
- " return 3;\n" +
- " case 2988 :\n" +
- " return 3;\n" +
- " case 2989 :\n" +
- " return 3;\n" +
- " case 2990 :\n" +
- " return 3;\n" +
- " case 2991 :\n" +
- " return 3;\n" +
- " case 2992 :\n" +
- " return 3;\n" +
- " case 2993 :\n" +
- " return 3;\n" +
- " case 2994 :\n" +
- " return 3;\n" +
- " case 2995 :\n" +
- " return 3;\n" +
- " case 2996 :\n" +
- " return 3;\n" +
- " case 2997 :\n" +
- " return 3;\n" +
- " case 2998 :\n" +
- " return 3;\n" +
- " case 2999 :\n" +
- " return 3;\n" +
- " case 3000 :\n" +
- " return 3;\n" +
- " case 3001 :\n" +
- " return 3;\n" +
- " case 3002 :\n" +
- " return 3;\n" +
- " case 3003 :\n" +
- " return 3;\n" +
- " case 3004 :\n" +
- " return 3;\n" +
- " case 3005 :\n" +
- " return 3;\n" +
- " case 3006 :\n" +
- " return 3;\n" +
- " case 3007 :\n" +
- " return 3;\n" +
- " case 3008 :\n" +
- " return 3;\n" +
- " case 3009 :\n" +
- " return 3;\n" +
- " case 3010 :\n" +
- " return 3;\n" +
- " case 3011 :\n" +
- " return 3;\n" +
- " case 3012 :\n" +
- " return 3;\n" +
- " case 3013 :\n" +
- " return 3;\n" +
- " case 3014 :\n" +
- " return 3;\n" +
- " case 3015 :\n" +
- " return 3;\n" +
- " case 3016 :\n" +
- " return 3;\n" +
- " case 3017 :\n" +
- " return 3;\n" +
- " case 3018 :\n" +
- " return 3;\n" +
- " case 3019 :\n" +
- " return 3;\n" +
- " case 3020 :\n" +
- " return 3;\n" +
- " case 3021 :\n" +
- " return 3;\n" +
- " case 3022 :\n" +
- " return 3;\n" +
- " case 3023 :\n" +
- " return 3;\n" +
- " case 3024 :\n" +
- " return 3;\n" +
- " case 3025 :\n" +
- " return 3;\n" +
- " case 3026 :\n" +
- " return 3;\n" +
- " case 3027 :\n" +
- " return 3;\n" +
- " case 3028 :\n" +
- " return 3;\n" +
- " case 3029 :\n" +
- " return 3;\n" +
- " case 3030 :\n" +
- " return 3;\n" +
- " case 3031 :\n" +
- " return 3;\n" +
- " case 3032 :\n" +
- " return 3;\n" +
- " case 3033 :\n" +
- " return 3;\n" +
- " case 3034 :\n" +
- " return 3;\n" +
- " case 3035 :\n" +
- " return 3;\n" +
- " case 3036 :\n" +
- " return 3;\n" +
- " case 3037 :\n" +
- " return 3;\n" +
- " case 3038 :\n" +
- " return 3;\n" +
- " case 3039 :\n" +
- " return 3;\n" +
- " case 3040 :\n" +
- " return 3;\n" +
- " case 3041 :\n" +
- " return 3;\n" +
- " case 3042 :\n" +
- " return 3;\n" +
- " case 3043 :\n" +
- " return 3;\n" +
- " case 3044 :\n" +
- " return 3;\n" +
- " case 3045 :\n" +
- " return 3;\n" +
- " case 3046 :\n" +
- " return 3;\n" +
- " case 3047 :\n" +
- " return 3;\n" +
- " case 3048 :\n" +
- " return 3;\n" +
- " case 3049 :\n" +
- " return 3;\n" +
- " case 3050 :\n" +
- " return 3;\n" +
- " case 3051 :\n" +
- " return 3;\n" +
- " case 3052 :\n" +
- " return 3;\n" +
- " case 3053 :\n" +
- " return 3;\n" +
- " case 3054 :\n" +
- " return 3;\n" +
- " case 3055 :\n" +
- " return 3;\n" +
- " case 3056 :\n" +
- " return 3;\n" +
- " case 3057 :\n" +
- " return 3;\n" +
- " case 3058 :\n" +
- " return 3;\n" +
- " case 3059 :\n" +
- " return 3;\n" +
- " case 3060 :\n" +
- " return 3;\n" +
- " case 3061 :\n" +
- " return 3;\n" +
- " case 3062 :\n" +
- " return 3;\n" +
- " case 3063 :\n" +
- " return 3;\n" +
- " case 3064 :\n" +
- " return 3;\n" +
- " case 3065 :\n" +
- " return 3;\n" +
- " case 3066 :\n" +
- " return 3;\n" +
- " case 3067 :\n" +
- " return 3;\n" +
- " case 3068 :\n" +
- " return 3;\n" +
- " case 3069 :\n" +
- " return 3;\n" +
- " case 3070 :\n" +
- " return 3;\n" +
- " case 3071 :\n" +
- " return 3;\n" +
- " case 3072 :\n" +
- " return 3;\n" +
- " case 3073 :\n" +
- " return 3;\n" +
- " case 3074 :\n" +
- " return 3;\n" +
- " case 3075 :\n" +
- " return 3;\n" +
- " case 3076 :\n" +
- " return 3;\n" +
- " case 3077 :\n" +
- " return 3;\n" +
- " case 3078 :\n" +
- " return 3;\n" +
- " case 3079 :\n" +
- " return 3;\n" +
- " case 3080 :\n" +
- " return 3;\n" +
- " case 3081 :\n" +
- " return 3;\n" +
- " case 3082 :\n" +
- " return 3;\n" +
- " case 3083 :\n" +
- " return 3;\n" +
- " case 3084 :\n" +
- " return 3;\n" +
- " case 3085 :\n" +
- " return 3;\n" +
- " case 3086 :\n" +
- " return 3;\n" +
- " case 3087 :\n" +
- " return 3;\n" +
- " case 3088 :\n" +
- " return 3;\n" +
- " case 3089 :\n" +
- " return 3;\n" +
- " case 3090 :\n" +
- " return 3;\n" +
- " case 3091 :\n" +
- " return 3;\n" +
- " case 3092 :\n" +
- " return 3;\n" +
- " case 3093 :\n" +
- " return 3;\n" +
- " case 3094 :\n" +
- " return 3;\n" +
- " case 3095 :\n" +
- " return 3;\n" +
- " case 3096 :\n" +
- " return 3;\n" +
- " case 3097 :\n" +
- " return 3;\n" +
- " case 3098 :\n" +
- " return 3;\n" +
- " case 3099 :\n" +
- " return 3;\n" +
- " case 3100 :\n" +
- " return 3;\n" +
- " case 3101 :\n" +
- " return 3;\n" +
- " case 3102 :\n" +
- " return 3;\n" +
- " case 3103 :\n" +
- " return 3;\n" +
- " case 3104 :\n" +
- " return 3;\n" +
- " case 3105 :\n" +
- " return 3;\n" +
- " case 3106 :\n" +
- " return 3;\n" +
- " case 3107 :\n" +
- " return 3;\n" +
- " case 3108 :\n" +
- " return 3;\n" +
- " case 3109 :\n" +
- " return 3;\n" +
- " case 3110 :\n" +
- " return 3;\n" +
- " case 3111 :\n" +
- " return 3;\n" +
- " case 3112 :\n" +
- " return 3;\n" +
- " case 3113 :\n" +
- " return 3;\n" +
- " case 3114 :\n" +
- " return 3;\n" +
- " case 3115 :\n" +
- " return 3;\n" +
- " case 3116 :\n" +
- " return 3;\n" +
- " case 3117 :\n" +
- " return 3;\n" +
- " case 3118 :\n" +
- " return 3;\n" +
- " case 3119 :\n" +
- " return 3;\n" +
- " case 3120 :\n" +
- " return 3;\n" +
- " case 3121 :\n" +
- " return 3;\n" +
- " case 3122 :\n" +
- " return 3;\n" +
- " case 3123 :\n" +
- " return 3;\n" +
- " case 3124 :\n" +
- " return 3;\n" +
- " case 3125 :\n" +
- " return 3;\n" +
- " case 3126 :\n" +
- " return 3;\n" +
- " case 3127 :\n" +
- " return 3;\n" +
- " case 3128 :\n" +
- " return 3;\n" +
- " case 3129 :\n" +
- " return 3;\n" +
- " case 3130 :\n" +
- " return 3;\n" +
- " case 3131 :\n" +
- " return 3;\n" +
- " case 3132 :\n" +
- " return 3;\n" +
- " case 3133 :\n" +
- " return 3;\n" +
- " case 3134 :\n" +
- " return 3;\n" +
- " case 3135 :\n" +
- " return 3;\n" +
- " case 3136 :\n" +
- " return 3;\n" +
- " case 3137 :\n" +
- " return 3;\n" +
- " case 3138 :\n" +
- " return 3;\n" +
- " case 3139 :\n" +
- " return 3;\n" +
- " case 3140 :\n" +
- " return 3;\n" +
- " case 3141 :\n" +
- " return 3;\n" +
- " case 3142 :\n" +
- " return 3;\n" +
- " case 3143 :\n" +
- " return 3;\n" +
- " case 3144 :\n" +
- " return 3;\n" +
- " case 3145 :\n" +
- " return 3;\n" +
- " case 3146 :\n" +
- " return 3;\n" +
- " case 3147 :\n" +
- " return 3;\n" +
- " case 3148 :\n" +
- " return 3;\n" +
- " case 3149 :\n" +
- " return 3;\n" +
- " case 3150 :\n" +
- " return 3;\n" +
- " case 3151 :\n" +
- " return 3;\n" +
- " case 3152 :\n" +
- " return 3;\n" +
- " case 3153 :\n" +
- " return 3;\n" +
- " case 3154 :\n" +
- " return 3;\n" +
- " case 3155 :\n" +
- " return 3;\n" +
- " case 3156 :\n" +
- " return 3;\n" +
- " case 3157 :\n" +
- " return 3;\n" +
- " case 3158 :\n" +
- " return 3;\n" +
- " case 3159 :\n" +
- " return 3;\n" +
- " case 3160 :\n" +
- " return 3;\n" +
- " case 3161 :\n" +
- " return 3;\n" +
- " case 3162 :\n" +
- " return 3;\n" +
- " case 3163 :\n" +
- " return 3;\n" +
- " case 3164 :\n" +
- " return 3;\n" +
- " case 3165 :\n" +
- " return 3;\n" +
- " case 3166 :\n" +
- " return 3;\n" +
- " case 3167 :\n" +
- " return 3;\n" +
- " case 3168 :\n" +
- " return 3;\n" +
- " case 3169 :\n" +
- " return 3;\n" +
- " case 3170 :\n" +
- " return 3;\n" +
- " case 3171 :\n" +
- " return 3;\n" +
- " case 3172 :\n" +
- " return 3;\n" +
- " case 3173 :\n" +
- " return 3;\n" +
- " case 3174 :\n" +
- " return 3;\n" +
- " case 3175 :\n" +
- " return 3;\n" +
- " case 3176 :\n" +
- " return 3;\n" +
- " case 3177 :\n" +
- " return 3;\n" +
- " case 3178 :\n" +
- " return 3;\n" +
- " case 3179 :\n" +
- " return 3;\n" +
- " case 3180 :\n" +
- " return 3;\n" +
- " case 3181 :\n" +
- " return 3;\n" +
- " case 3182 :\n" +
- " return 3;\n" +
- " case 3183 :\n" +
- " return 3;\n" +
- " case 3184 :\n" +
- " return 3;\n" +
- " case 3185 :\n" +
- " return 3;\n" +
- " case 3186 :\n" +
- " return 3;\n" +
- " case 3187 :\n" +
- " return 3;\n" +
- " case 3188 :\n" +
- " return 3;\n" +
- " case 3189 :\n" +
- " return 3;\n" +
- " case 3190 :\n" +
- " return 3;\n" +
- " case 3191 :\n" +
- " return 3;\n" +
- " case 3192 :\n" +
- " return 3;\n" +
- " case 3193 :\n" +
- " return 3;\n" +
- " case 3194 :\n" +
- " return 3;\n" +
- " case 3195 :\n" +
- " return 3;\n" +
- " case 3196 :\n" +
- " return 3;\n" +
- " case 3197 :\n" +
- " return 3;\n" +
- " case 3198 :\n" +
- " return 3;\n" +
- " case 3199 :\n" +
- " return 3;\n" +
- " case 3200 :\n" +
- " return 3;\n" +
- " case 3201 :\n" +
- " return 3;\n" +
- " case 3202 :\n" +
- " return 3;\n" +
- " case 3203 :\n" +
- " return 3;\n" +
- " case 3204 :\n" +
- " return 3;\n" +
- " case 3205 :\n" +
- " return 3;\n" +
- " case 3206 :\n" +
- " return 3;\n" +
- " case 3207 :\n" +
- " return 3;\n" +
- " case 3208 :\n" +
- " return 3;\n" +
- " case 3209 :\n" +
- " return 3;\n" +
- " case 3210 :\n" +
- " return 3;\n" +
- " case 3211 :\n" +
- " return 3;\n" +
- " case 3212 :\n" +
- " return 3;\n" +
- " case 3213 :\n" +
- " return 3;\n" +
- " case 3214 :\n" +
- " return 3;\n" +
- " case 3215 :\n" +
- " return 3;\n" +
- " case 3216 :\n" +
- " return 3;\n" +
- " case 3217 :\n" +
- " return 3;\n" +
- " case 3218 :\n" +
- " return 3;\n" +
- " case 3219 :\n" +
- " return 3;\n" +
- " case 3220 :\n" +
- " return 3;\n" +
- " case 3221 :\n" +
- " return 3;\n" +
- " case 3222 :\n" +
- " return 3;\n" +
- " case 3223 :\n" +
- " return 3;\n" +
- " case 3224 :\n" +
- " return 3;\n" +
- " case 3225 :\n" +
- " return 3;\n" +
- " case 3226 :\n" +
- " return 3;\n" +
- " case 3227 :\n" +
- " return 3;\n" +
- " case 3228 :\n" +
- " return 3;\n" +
- " case 3229 :\n" +
- " return 3;\n" +
- " case 3230 :\n" +
- " return 3;\n" +
- " case 3231 :\n" +
- " return 3;\n" +
- " case 3232 :\n" +
- " return 3;\n" +
- " case 3233 :\n" +
- " return 3;\n" +
- " case 3234 :\n" +
- " return 3;\n" +
- " case 3235 :\n" +
- " return 3;\n" +
- " case 3236 :\n" +
- " return 3;\n" +
- " case 3237 :\n" +
- " return 3;\n" +
- " case 3238 :\n" +
- " return 3;\n" +
- " case 3239 :\n" +
- " return 3;\n" +
- " case 3240 :\n" +
- " return 3;\n" +
- " case 3241 :\n" +
- " return 3;\n" +
- " case 3242 :\n" +
- " return 3;\n" +
- " case 3243 :\n" +
- " return 3;\n" +
- " case 3244 :\n" +
- " return 3;\n" +
- " case 3245 :\n" +
- " return 3;\n" +
- " case 3246 :\n" +
- " return 3;\n" +
- " case 3247 :\n" +
- " return 3;\n" +
- " case 3248 :\n" +
- " return 3;\n" +
- " case 3249 :\n" +
- " return 3;\n" +
- " case 3250 :\n" +
- " return 3;\n" +
- " case 3251 :\n" +
- " return 3;\n" +
- " case 3252 :\n" +
- " return 3;\n" +
- " case 3253 :\n" +
- " return 3;\n" +
- " case 3254 :\n" +
- " return 3;\n" +
- " case 3255 :\n" +
- " return 3;\n" +
- " case 3256 :\n" +
- " return 3;\n" +
- " case 3257 :\n" +
- " return 3;\n" +
- " case 3258 :\n" +
- " return 3;\n" +
- " case 3259 :\n" +
- " return 3;\n" +
- " case 3260 :\n" +
- " return 3;\n" +
- " case 3261 :\n" +
- " return 3;\n" +
- " case 3262 :\n" +
- " return 3;\n" +
- " case 3263 :\n" +
- " return 3;\n" +
- " case 3264 :\n" +
- " return 3;\n" +
- " case 3265 :\n" +
- " return 3;\n" +
- " case 3266 :\n" +
- " return 3;\n" +
- " case 3267 :\n" +
- " return 3;\n" +
- " case 3268 :\n" +
- " return 3;\n" +
- " case 3269 :\n" +
- " return 3;\n" +
- " case 3270 :\n" +
- " return 3;\n" +
- " case 3271 :\n" +
- " return 3;\n" +
- " case 3272 :\n" +
- " return 3;\n" +
- " case 3273 :\n" +
- " return 3;\n" +
- " case 3274 :\n" +
- " return 3;\n" +
- " case 3275 :\n" +
- " return 3;\n" +
- " case 3276 :\n" +
- " return 3;\n" +
- " case 3277 :\n" +
- " return 3;\n" +
- " case 3278 :\n" +
- " return 3;\n" +
- " case 3279 :\n" +
- " return 3;\n" +
- " case 3280 :\n" +
- " return 3;\n" +
- " case 3281 :\n" +
- " return 3;\n" +
- " case 3282 :\n" +
- " return 3;\n" +
- " case 3283 :\n" +
- " return 3;\n" +
- " case 3284 :\n" +
- " return 3;\n" +
- " case 3285 :\n" +
- " return 3;\n" +
- " case 3286 :\n" +
- " return 3;\n" +
- " case 3287 :\n" +
- " return 3;\n" +
- " case 3288 :\n" +
- " return 3;\n" +
- " case 3289 :\n" +
- " return 3;\n" +
- " case 3290 :\n" +
- " return 3;\n" +
- " case 3291 :\n" +
- " return 3;\n" +
- " case 3292 :\n" +
- " return 3;\n" +
- " case 3293 :\n" +
- " return 3;\n" +
- " case 3294 :\n" +
- " return 3;\n" +
- " case 3295 :\n" +
- " return 3;\n" +
- " case 3296 :\n" +
- " return 3;\n" +
- " case 3297 :\n" +
- " return 3;\n" +
- " case 3298 :\n" +
- " return 3;\n" +
- " case 3299 :\n" +
- " return 3;\n" +
- " case 3300 :\n" +
- " return 3;\n" +
- " case 3301 :\n" +
- " return 3;\n" +
- " case 3302 :\n" +
- " return 3;\n" +
- " case 3303 :\n" +
- " return 3;\n" +
- " case 3304 :\n" +
- " return 3;\n" +
- " case 3305 :\n" +
- " return 3;\n" +
- " case 3306 :\n" +
- " return 3;\n" +
- " case 3307 :\n" +
- " return 3;\n" +
- " case 3308 :\n" +
- " return 3;\n" +
- " case 3309 :\n" +
- " return 3;\n" +
- " case 3310 :\n" +
- " return 3;\n" +
- " case 3311 :\n" +
- " return 3;\n" +
- " case 3312 :\n" +
- " return 3;\n" +
- " case 3313 :\n" +
- " return 3;\n" +
- " case 3314 :\n" +
- " return 3;\n" +
- " case 3315 :\n" +
- " return 3;\n" +
- " case 3316 :\n" +
- " return 3;\n" +
- " case 3317 :\n" +
- " return 3;\n" +
- " case 3318 :\n" +
- " return 3;\n" +
- " case 3319 :\n" +
- " return 3;\n" +
- " case 3320 :\n" +
- " return 3;\n" +
- " case 3321 :\n" +
- " return 3;\n" +
- " case 3322 :\n" +
- " return 3;\n" +
- " case 3323 :\n" +
- " return 3;\n" +
- " case 3324 :\n" +
- " return 3;\n" +
- " case 3325 :\n" +
- " return 3;\n" +
- " case 3326 :\n" +
- " return 3;\n" +
- " case 3327 :\n" +
- " return 3;\n" +
- " case 3328 :\n" +
- " return 3;\n" +
- " case 3329 :\n" +
- " return 3;\n" +
- " case 3330 :\n" +
- " return 3;\n" +
- " case 3331 :\n" +
- " return 3;\n" +
- " case 3332 :\n" +
- " return 3;\n" +
- " case 3333 :\n" +
- " return 3;\n" +
- " case 3334 :\n" +
- " return 3;\n" +
- " case 3335 :\n" +
- " return 3;\n" +
- " case 3336 :\n" +
- " return 3;\n" +
- " case 3337 :\n" +
- " return 3;\n" +
- " case 3338 :\n" +
- " return 3;\n" +
- " case 3339 :\n" +
- " return 3;\n" +
- " case 3340 :\n" +
- " return 3;\n" +
- " case 3341 :\n" +
- " return 3;\n" +
- " case 3342 :\n" +
- " return 3;\n" +
- " case 3343 :\n" +
- " return 3;\n" +
- " case 3344 :\n" +
- " return 3;\n" +
- " case 3345 :\n" +
- " return 3;\n" +
- " case 3346 :\n" +
- " return 3;\n" +
- " case 3347 :\n" +
- " return 3;\n" +
- " case 3348 :\n" +
- " return 3;\n" +
- " case 3349 :\n" +
- " return 3;\n" +
- " case 3350 :\n" +
- " return 3;\n" +
- " case 3351 :\n" +
- " return 3;\n" +
- " case 3352 :\n" +
- " return 3;\n" +
- " case 3353 :\n" +
- " return 3;\n" +
- " case 3354 :\n" +
- " return 3;\n" +
- " case 3355 :\n" +
- " return 3;\n" +
- " case 3356 :\n" +
- " return 3;\n" +
- " case 3357 :\n" +
- " return 3;\n" +
- " case 3358 :\n" +
- " return 3;\n" +
- " case 3359 :\n" +
- " return 3;\n" +
- " case 3360 :\n" +
- " return 3;\n" +
- " case 3361 :\n" +
- " return 3;\n" +
- " case 3362 :\n" +
- " return 3;\n" +
- " case 3363 :\n" +
- " return 3;\n" +
- " case 3364 :\n" +
- " return 3;\n" +
- " case 3365 :\n" +
- " return 3;\n" +
- " case 3366 :\n" +
- " return 3;\n" +
- " case 3367 :\n" +
- " return 3;\n" +
- " case 3368 :\n" +
- " return 3;\n" +
- " case 3369 :\n" +
- " return 3;\n" +
- " case 3370 :\n" +
- " return 3;\n" +
- " case 3371 :\n" +
- " return 3;\n" +
- " case 3372 :\n" +
- " return 3;\n" +
- " case 3373 :\n" +
- " return 3;\n" +
- " case 3374 :\n" +
- " return 3;\n" +
- " case 3375 :\n" +
- " return 3;\n" +
- " case 3376 :\n" +
- " return 3;\n" +
- " case 3377 :\n" +
- " return 3;\n" +
- " case 3378 :\n" +
- " return 3;\n" +
- " case 3379 :\n" +
- " return 3;\n" +
- " case 3380 :\n" +
- " return 3;\n" +
- " case 3381 :\n" +
- " return 3;\n" +
- " case 3382 :\n" +
- " return 3;\n" +
- " case 3383 :\n" +
- " return 3;\n" +
- " case 3384 :\n" +
- " return 3;\n" +
- " case 3385 :\n" +
- " return 3;\n" +
- " case 3386 :\n" +
- " return 3;\n" +
- " case 3387 :\n" +
- " return 3;\n" +
- " case 3388 :\n" +
- " return 3;\n" +
- " case 3389 :\n" +
- " return 3;\n" +
- " case 3390 :\n" +
- " return 3;\n" +
- " case 3391 :\n" +
- " return 3;\n" +
- " case 3392 :\n" +
- " return 3;\n" +
- " case 3393 :\n" +
- " return 3;\n" +
- " case 3394 :\n" +
- " return 3;\n" +
- " case 3395 :\n" +
- " return 3;\n" +
- " case 3396 :\n" +
- " return 3;\n" +
- " case 3397 :\n" +
- " return 3;\n" +
- " case 3398 :\n" +
- " return 3;\n" +
- " case 3399 :\n" +
- " return 3;\n" +
- " case 3400 :\n" +
- " return 3;\n" +
- " case 3401 :\n" +
- " return 3;\n" +
- " case 3402 :\n" +
- " return 3;\n" +
- " case 3403 :\n" +
- " return 3;\n" +
- " case 3404 :\n" +
- " return 3;\n" +
- " case 3405 :\n" +
- " return 3;\n" +
- " case 3406 :\n" +
- " return 3;\n" +
- " case 3407 :\n" +
- " return 3;\n" +
- " case 3408 :\n" +
- " return 3;\n" +
- " case 3409 :\n" +
- " return 3;\n" +
- " case 3410 :\n" +
- " return 3;\n" +
- " case 3411 :\n" +
- " return 3;\n" +
- " case 3412 :\n" +
- " return 3;\n" +
- " case 3413 :\n" +
- " return 3;\n" +
- " case 3414 :\n" +
- " return 3;\n" +
- " case 3415 :\n" +
- " return 3;\n" +
- " case 3416 :\n" +
- " return 3;\n" +
- " case 3417 :\n" +
- " return 3;\n" +
- " case 3418 :\n" +
- " return 3;\n" +
- " case 3419 :\n" +
- " return 3;\n" +
- " case 3420 :\n" +
- " return 3;\n" +
- " case 3421 :\n" +
- " return 3;\n" +
- " case 3422 :\n" +
- " return 3;\n" +
- " case 3423 :\n" +
- " return 3;\n" +
- " case 3424 :\n" +
- " return 3;\n" +
- " case 3425 :\n" +
- " return 3;\n" +
- " case 3426 :\n" +
- " return 3;\n" +
- " case 3427 :\n" +
- " return 3;\n" +
- " case 3428 :\n" +
- " return 3;\n" +
- " case 3429 :\n" +
- " return 3;\n" +
- " case 3430 :\n" +
- " return 3;\n" +
- " case 3431 :\n" +
- " return 3;\n" +
- " case 3432 :\n" +
- " return 3;\n" +
- " case 3433 :\n" +
- " return 3;\n" +
- " case 3434 :\n" +
- " return 3;\n" +
- " case 3435 :\n" +
- " return 3;\n" +
- " case 3436 :\n" +
- " return 3;\n" +
- " case 3437 :\n" +
- " return 3;\n" +
- " case 3438 :\n" +
- " return 3;\n" +
- " case 3439 :\n" +
- " return 3;\n" +
- " case 3440 :\n" +
- " return 3;\n" +
- " case 3441 :\n" +
- " return 3;\n" +
- " case 3442 :\n" +
- " return 3;\n" +
- " case 3443 :\n" +
- " return 3;\n" +
- " case 3444 :\n" +
- " return 3;\n" +
- " case 3445 :\n" +
- " return 3;\n" +
- " case 3446 :\n" +
- " return 3;\n" +
- " case 3447 :\n" +
- " return 3;\n" +
- " case 3448 :\n" +
- " return 3;\n" +
- " case 3449 :\n" +
- " return 3;\n" +
- " case 3450 :\n" +
- " return 3;\n" +
- " case 3451 :\n" +
- " return 3;\n" +
- " case 3452 :\n" +
- " return 3;\n" +
- " case 3453 :\n" +
- " return 3;\n" +
- " case 3454 :\n" +
- " return 3;\n" +
- " case 3455 :\n" +
- " return 3;\n" +
- " case 3456 :\n" +
- " return 3;\n" +
- " case 3457 :\n" +
- " return 3;\n" +
- " case 3458 :\n" +
- " return 3;\n" +
- " case 3459 :\n" +
- " return 3;\n" +
- " case 3460 :\n" +
- " return 3;\n" +
- " case 3461 :\n" +
- " return 3;\n" +
- " case 3462 :\n" +
- " return 3;\n" +
- " case 3463 :\n" +
- " return 3;\n" +
- " case 3464 :\n" +
- " return 3;\n" +
- " case 3465 :\n" +
- " return 3;\n" +
- " case 3466 :\n" +
- " return 3;\n" +
- " case 3467 :\n" +
- " return 3;\n" +
- " case 3468 :\n" +
- " return 3;\n" +
- " case 3469 :\n" +
- " return 3;\n" +
- " case 3470 :\n" +
- " return 3;\n" +
- " case 3471 :\n" +
- " return 3;\n" +
- " case 3472 :\n" +
- " return 3;\n" +
- " case 3473 :\n" +
- " return 3;\n" +
- " case 3474 :\n" +
- " return 3;\n" +
- " case 3475 :\n" +
- " return 3;\n" +
- " case 3476 :\n" +
- " return 3;\n" +
- " case 3477 :\n" +
- " return 3;\n" +
- " case 3478 :\n" +
- " return 3;\n" +
- " case 3479 :\n" +
- " return 3;\n" +
- " case 3480 :\n" +
- " return 3;\n" +
- " case 3481 :\n" +
- " return 3;\n" +
- " case 3482 :\n" +
- " return 3;\n" +
- " case 3483 :\n" +
- " return 3;\n" +
- " case 3484 :\n" +
- " return 3;\n" +
- " case 3485 :\n" +
- " return 3;\n" +
- " case 3486 :\n" +
- " return 3;\n" +
- " case 3487 :\n" +
- " return 3;\n" +
- " case 3488 :\n" +
- " return 3;\n" +
- " case 3489 :\n" +
- " return 3;\n" +
- " case 3490 :\n" +
- " return 3;\n" +
- " case 3491 :\n" +
- " return 3;\n" +
- " case 3492 :\n" +
- " return 3;\n" +
- " case 3493 :\n" +
- " return 3;\n" +
- " case 3494 :\n" +
- " return 3;\n" +
- " case 3495 :\n" +
- " return 3;\n" +
- " case 3496 :\n" +
- " return 3;\n" +
- " case 3497 :\n" +
- " return 3;\n" +
- " case 3498 :\n" +
- " return 3;\n" +
- " case 3499 :\n" +
- " return 3;\n" +
- " case 3500 :\n" +
- " return 3;\n" +
- " case 3501 :\n" +
- " return 3;\n" +
- " case 3502 :\n" +
- " return 3;\n" +
- " case 3503 :\n" +
- " return 3;\n" +
- " case 3504 :\n" +
- " return 3;\n" +
- " case 3505 :\n" +
- " return 3;\n" +
- " case 3506 :\n" +
- " return 3;\n" +
- " case 3507 :\n" +
- " return 3;\n" +
- " case 3508 :\n" +
- " return 3;\n" +
- " case 3509 :\n" +
- " return 3;\n" +
- " case 3510 :\n" +
- " return 3;\n" +
- " case 3511 :\n" +
- " return 3;\n" +
- " case 3512 :\n" +
- " return 3;\n" +
- " case 3513 :\n" +
- " return 3;\n" +
- " case 3514 :\n" +
- " return 3;\n" +
- " case 3515 :\n" +
- " return 3;\n" +
- " case 3516 :\n" +
- " return 3;\n" +
- " case 3517 :\n" +
- " return 3;\n" +
- " case 3518 :\n" +
- " return 3;\n" +
- " case 3519 :\n" +
- " return 3;\n" +
- " case 3520 :\n" +
- " return 3;\n" +
- " case 3521 :\n" +
- " return 3;\n" +
- " case 3522 :\n" +
- " return 3;\n" +
- " case 3523 :\n" +
- " return 3;\n" +
- " case 3524 :\n" +
- " return 3;\n" +
- " case 3525 :\n" +
- " return 3;\n" +
- " case 3526 :\n" +
- " return 3;\n" +
- " case 3527 :\n" +
- " return 3;\n" +
- " case 3528 :\n" +
- " return 3;\n" +
- " case 3529 :\n" +
- " return 3;\n" +
- " case 3530 :\n" +
- " return 3;\n" +
- " case 3531 :\n" +
- " return 3;\n" +
- " case 3532 :\n" +
- " return 3;\n" +
- " case 3533 :\n" +
- " return 3;\n" +
- " case 3534 :\n" +
- " return 3;\n" +
- " case 3535 :\n" +
- " return 3;\n" +
- " case 3536 :\n" +
- " return 3;\n" +
- " case 3537 :\n" +
- " return 3;\n" +
- " case 3538 :\n" +
- " return 3;\n" +
- " case 3539 :\n" +
- " return 3;\n" +
- " case 3540 :\n" +
- " return 3;\n" +
- " case 3541 :\n" +
- " return 3;\n" +
- " case 3542 :\n" +
- " return 3;\n" +
- " case 3543 :\n" +
- " return 3;\n" +
- " case 3544 :\n" +
- " return 3;\n" +
- " case 3545 :\n" +
- " return 3;\n" +
- " case 3546 :\n" +
- " return 3;\n" +
- " case 3547 :\n" +
- " return 3;\n" +
- " case 3548 :\n" +
- " return 3;\n" +
- " case 3549 :\n" +
- " return 3;\n" +
- " case 3550 :\n" +
- " return 3;\n" +
- " case 3551 :\n" +
- " return 3;\n" +
- " case 3552 :\n" +
- " return 3;\n" +
- " case 3553 :\n" +
- " return 3;\n" +
- " case 3554 :\n" +
- " return 3;\n" +
- " case 3555 :\n" +
- " return 3;\n" +
- " case 3556 :\n" +
- " return 3;\n" +
- " case 3557 :\n" +
- " return 3;\n" +
- " case 3558 :\n" +
- " return 3;\n" +
- " case 3559 :\n" +
- " return 3;\n" +
- " case 3560 :\n" +
- " return 3;\n" +
- " case 3561 :\n" +
- " return 3;\n" +
- " case 3562 :\n" +
- " return 3;\n" +
- " case 3563 :\n" +
- " return 3;\n" +
- " case 3564 :\n" +
- " return 3;\n" +
- " case 3565 :\n" +
- " return 3;\n" +
- " case 3566 :\n" +
- " return 3;\n" +
- " case 3567 :\n" +
- " return 3;\n" +
- " case 3568 :\n" +
- " return 3;\n" +
- " case 3569 :\n" +
- " return 3;\n" +
- " case 3570 :\n" +
- " return 3;\n" +
- " case 3571 :\n" +
- " return 3;\n" +
- " case 3572 :\n" +
- " return 3;\n" +
- " case 3573 :\n" +
- " return 3;\n" +
- " case 3574 :\n" +
- " return 3;\n" +
- " case 3575 :\n" +
- " return 3;\n" +
- " case 3576 :\n" +
- " return 3;\n" +
- " case 3577 :\n" +
- " return 3;\n" +
- " case 3578 :\n" +
- " return 3;\n" +
- " case 3579 :\n" +
- " return 3;\n" +
- " case 3580 :\n" +
- " return 3;\n" +
- " case 3581 :\n" +
- " return 3;\n" +
- " case 3582 :\n" +
- " return 3;\n" +
- " case 3583 :\n" +
- " return 3;\n" +
- " case 3584 :\n" +
- " return 3;\n" +
- " case 3585 :\n" +
- " return 3;\n" +
- " case 3586 :\n" +
- " return 3;\n" +
- " case 3587 :\n" +
- " return 3;\n" +
- " case 3588 :\n" +
- " return 3;\n" +
- " case 3589 :\n" +
- " return 3;\n" +
- " case 3590 :\n" +
- " return 3;\n" +
- " case 3591 :\n" +
- " return 3;\n" +
- " case 3592 :\n" +
- " return 3;\n" +
- " case 3593 :\n" +
- " return 3;\n" +
- " case 3594 :\n" +
- " return 3;\n" +
- " case 3595 :\n" +
- " return 3;\n" +
- " case 3596 :\n" +
- " return 3;\n" +
- " case 3597 :\n" +
- " return 3;\n" +
- " case 3598 :\n" +
- " return 3;\n" +
- " case 3599 :\n" +
- " return 3;\n" +
- " case 3600 :\n" +
- " return 3;\n" +
- " case 3601 :\n" +
- " return 3;\n" +
- " case 3602 :\n" +
- " return 3;\n" +
- " case 3603 :\n" +
- " return 3;\n" +
- " case 3604 :\n" +
- " return 3;\n" +
- " case 3605 :\n" +
- " return 3;\n" +
- " case 3606 :\n" +
- " return 3;\n" +
- " case 3607 :\n" +
- " return 3;\n" +
- " case 3608 :\n" +
- " return 3;\n" +
- " case 3609 :\n" +
- " return 3;\n" +
- " case 3610 :\n" +
- " return 3;\n" +
- " case 3611 :\n" +
- " return 3;\n" +
- " case 3612 :\n" +
- " return 3;\n" +
- " case 3613 :\n" +
- " return 3;\n" +
- " case 3614 :\n" +
- " return 3;\n" +
- " case 3615 :\n" +
- " return 3;\n" +
- " case 3616 :\n" +
- " return 3;\n" +
- " case 3617 :\n" +
- " return 3;\n" +
- " case 3618 :\n" +
- " return 3;\n" +
- " case 3619 :\n" +
- " return 3;\n" +
- " case 3620 :\n" +
- " return 3;\n" +
- " case 3621 :\n" +
- " return 3;\n" +
- " case 3622 :\n" +
- " return 3;\n" +
- " case 3623 :\n" +
- " return 3;\n" +
- " case 3624 :\n" +
- " return 3;\n" +
- " case 3625 :\n" +
- " return 3;\n" +
- " case 3626 :\n" +
- " return 3;\n" +
- " case 3627 :\n" +
- " return 3;\n" +
- " case 3628 :\n" +
- " return 3;\n" +
- " case 3629 :\n" +
- " return 3;\n" +
- " case 3630 :\n" +
- " return 3;\n" +
- " case 3631 :\n" +
- " return 3;\n" +
- " case 3632 :\n" +
- " return 3;\n" +
- " case 3633 :\n" +
- " return 3;\n" +
- " case 3634 :\n" +
- " return 3;\n" +
- " case 3635 :\n" +
- " return 3;\n" +
- " case 3636 :\n" +
- " return 3;\n" +
- " case 3637 :\n" +
- " return 3;\n" +
- " case 3638 :\n" +
- " return 3;\n" +
- " case 3639 :\n" +
- " return 3;\n" +
- " case 3640 :\n" +
- " return 3;\n" +
- " case 3641 :\n" +
- " return 3;\n" +
- " case 3642 :\n" +
- " return 3;\n" +
- " case 3643 :\n" +
- " return 3;\n" +
- " case 3644 :\n" +
- " return 3;\n" +
- " case 3645 :\n" +
- " return 3;\n" +
- " case 3646 :\n" +
- " return 3;\n" +
- " case 3647 :\n" +
- " return 3;\n" +
- " case 3648 :\n" +
- " return 3;\n" +
- " case 3649 :\n" +
- " return 3;\n" +
- " case 3650 :\n" +
- " return 3;\n" +
- " case 3651 :\n" +
- " return 3;\n" +
- " case 3652 :\n" +
- " return 3;\n" +
- " case 3653 :\n" +
- " return 3;\n" +
- " case 3654 :\n" +
- " return 3;\n" +
- " case 3655 :\n" +
- " return 3;\n" +
- " case 3656 :\n" +
- " return 3;\n" +
- " case 3657 :\n" +
- " return 3;\n" +
- " case 3658 :\n" +
- " return 3;\n" +
- " case 3659 :\n" +
- " return 3;\n" +
- " case 3660 :\n" +
- " return 3;\n" +
- " case 3661 :\n" +
- " return 3;\n" +
- " case 3662 :\n" +
- " return 3;\n" +
- " case 3663 :\n" +
- " return 3;\n" +
- " case 3664 :\n" +
- " return 3;\n" +
- " case 3665 :\n" +
- " return 3;\n" +
- " case 3666 :\n" +
- " return 3;\n" +
- " case 3667 :\n" +
- " return 3;\n" +
- " case 3668 :\n" +
- " return 3;\n" +
- " case 3669 :\n" +
- " return 3;\n" +
- " case 3670 :\n" +
- " return 3;\n" +
- " case 3671 :\n" +
- " return 3;\n" +
- " case 3672 :\n" +
- " return 3;\n" +
- " case 3673 :\n" +
- " return 3;\n" +
- " case 3674 :\n" +
- " return 3;\n" +
- " case 3675 :\n" +
- " return 3;\n" +
- " case 3676 :\n" +
- " return 3;\n" +
- " case 3677 :\n" +
- " return 3;\n" +
- " case 3678 :\n" +
- " return 3;\n" +
- " case 3679 :\n" +
- " return 3;\n" +
- " case 3680 :\n" +
- " return 3;\n" +
- " case 3681 :\n" +
- " return 3;\n" +
- " case 3682 :\n" +
- " return 3;\n" +
- " case 3683 :\n" +
- " return 3;\n" +
- " case 3684 :\n" +
- " return 3;\n" +
- " case 3685 :\n" +
- " return 3;\n" +
- " case 3686 :\n" +
- " return 3;\n" +
- " case 3687 :\n" +
- " return 3;\n" +
- " case 3688 :\n" +
- " return 3;\n" +
- " case 3689 :\n" +
- " return 3;\n" +
- " case 3690 :\n" +
- " return 3;\n" +
- " case 3691 :\n" +
- " return 3;\n" +
- " case 3692 :\n" +
- " return 3;\n" +
- " case 3693 :\n" +
- " return 3;\n" +
- " case 3694 :\n" +
- " return 3;\n" +
- " case 3695 :\n" +
- " return 3;\n" +
- " case 3696 :\n" +
- " return 3;\n" +
- " case 3697 :\n" +
- " return 3;\n" +
- " case 3698 :\n" +
- " return 3;\n" +
- " case 3699 :\n" +
- " return 3;\n" +
- " case 3700 :\n" +
- " return 3;\n" +
- " case 3701 :\n" +
- " return 3;\n" +
- " case 3702 :\n" +
- " return 3;\n" +
- " case 3703 :\n" +
- " return 3;\n" +
- " case 3704 :\n" +
- " return 3;\n" +
- " case 3705 :\n" +
- " return 3;\n" +
- " case 3706 :\n" +
- " return 3;\n" +
- " case 3707 :\n" +
- " return 3;\n" +
- " case 3708 :\n" +
- " return 3;\n" +
- " case 3709 :\n" +
- " return 3;\n" +
- " case 3710 :\n" +
- " return 3;\n" +
- " case 3711 :\n" +
- " return 3;\n" +
- " case 3712 :\n" +
- " return 3;\n" +
- " case 3713 :\n" +
- " return 3;\n" +
- " case 3714 :\n" +
- " return 3;\n" +
- " case 3715 :\n" +
- " return 3;\n" +
- " case 3716 :\n" +
- " return 3;\n" +
- " case 3717 :\n" +
- " return 3;\n" +
- " case 3718 :\n" +
- " return 3;\n" +
- " case 3719 :\n" +
- " return 3;\n" +
- " case 3720 :\n" +
- " return 3;\n" +
- " case 3721 :\n" +
- " return 3;\n" +
- " case 3722 :\n" +
- " return 3;\n" +
- " case 3723 :\n" +
- " return 3;\n" +
- " case 3724 :\n" +
- " return 3;\n" +
- " case 3725 :\n" +
- " return 3;\n" +
- " case 3726 :\n" +
- " return 3;\n" +
- " case 3727 :\n" +
- " return 3;\n" +
- " case 3728 :\n" +
- " return 3;\n" +
- " case 3729 :\n" +
- " return 3;\n" +
- " case 3730 :\n" +
- " return 3;\n" +
- " case 3731 :\n" +
- " return 3;\n" +
- " case 3732 :\n" +
- " return 3;\n" +
- " case 3733 :\n" +
- " return 3;\n" +
- " case 3734 :\n" +
- " return 3;\n" +
- " case 3735 :\n" +
- " return 3;\n" +
- " case 3736 :\n" +
- " return 3;\n" +
- " case 3737 :\n" +
- " return 3;\n" +
- " case 3738 :\n" +
- " return 3;\n" +
- " case 3739 :\n" +
- " return 3;\n" +
- " case 3740 :\n" +
- " return 3;\n" +
- " case 3741 :\n" +
- " return 3;\n" +
- " case 3742 :\n" +
- " return 3;\n" +
- " case 3743 :\n" +
- " return 3;\n" +
- " case 3744 :\n" +
- " return 3;\n" +
- " case 3745 :\n" +
- " return 3;\n" +
- " case 3746 :\n" +
- " return 3;\n" +
- " case 3747 :\n" +
- " return 3;\n" +
- " case 3748 :\n" +
- " return 3;\n" +
- " case 3749 :\n" +
- " return 3;\n" +
- " case 3750 :\n" +
- " return 3;\n" +
- " case 3751 :\n" +
- " return 3;\n" +
- " case 3752 :\n" +
- " return 3;\n" +
- " case 3753 :\n" +
- " return 3;\n" +
- " case 3754 :\n" +
- " return 3;\n" +
- " case 3755 :\n" +
- " return 3;\n" +
- " case 3756 :\n" +
- " return 3;\n" +
- " case 3757 :\n" +
- " return 3;\n" +
- " case 3758 :\n" +
- " return 3;\n" +
- " case 3759 :\n" +
- " return 3;\n" +
- " case 3760 :\n" +
- " return 3;\n" +
- " case 3761 :\n" +
- " return 3;\n" +
- " case 3762 :\n" +
- " return 3;\n" +
- " case 3763 :\n" +
- " return 3;\n" +
- " case 3764 :\n" +
- " return 3;\n" +
- " case 3765 :\n" +
- " return 3;\n" +
- " case 3766 :\n" +
- " return 3;\n" +
- " case 3767 :\n" +
- " return 3;\n" +
- " case 3768 :\n" +
- " return 3;\n" +
- " case 3769 :\n" +
- " return 3;\n" +
- " case 3770 :\n" +
- " return 3;\n" +
- " case 3771 :\n" +
- " return 3;\n" +
- " case 3772 :\n" +
- " return 3;\n" +
- " case 3773 :\n" +
- " return 3;\n" +
- " case 3774 :\n" +
- " return 3;\n" +
- " case 3775 :\n" +
- " return 3;\n" +
- " case 3776 :\n" +
- " return 3;\n" +
- " case 3777 :\n" +
- " return 3;\n" +
- " case 3778 :\n" +
- " return 3;\n" +
- " case 3779 :\n" +
- " return 3;\n" +
- " case 3780 :\n" +
- " return 3;\n" +
- " case 3781 :\n" +
- " return 3;\n" +
- " case 3782 :\n" +
- " return 3;\n" +
- " case 3783 :\n" +
- " return 3;\n" +
- " case 3784 :\n" +
- " return 3;\n" +
- " case 3785 :\n" +
- " return 3;\n" +
- " case 3786 :\n" +
- " return 3;\n" +
- " case 3787 :\n" +
- " return 3;\n" +
- " case 3788 :\n" +
- " return 3;\n" +
- " case 3789 :\n" +
- " return 3;\n" +
- " case 3790 :\n" +
- " return 3;\n" +
- " case 3791 :\n" +
- " return 3;\n" +
- " case 3792 :\n" +
- " return 3;\n" +
- " case 3793 :\n" +
- " return 3;\n" +
- " case 3794 :\n" +
- " return 3;\n" +
- " case 3795 :\n" +
- " return 3;\n" +
- " case 3796 :\n" +
- " return 3;\n" +
- " case 3797 :\n" +
- " return 3;\n" +
- " case 3798 :\n" +
- " return 3;\n" +
- " case 3799 :\n" +
- " return 3;\n" +
- " case 3800 :\n" +
- " return 3;\n" +
- " case 3801 :\n" +
- " return 3;\n" +
- " case 3802 :\n" +
- " return 3;\n" +
- " case 3803 :\n" +
- " return 3;\n" +
- " case 3804 :\n" +
- " return 3;\n" +
- " case 3805 :\n" +
- " return 3;\n" +
- " case 3806 :\n" +
- " return 3;\n" +
- " case 3807 :\n" +
- " return 3;\n" +
- " case 3808 :\n" +
- " return 3;\n" +
- " case 3809 :\n" +
- " return 3;\n" +
- " case 3810 :\n" +
- " return 3;\n" +
- " case 3811 :\n" +
- " return 3;\n" +
- " case 3812 :\n" +
- " return 3;\n" +
- " case 3813 :\n" +
- " return 3;\n" +
- " case 3814 :\n" +
- " return 3;\n" +
- " case 3815 :\n" +
- " return 3;\n" +
- " case 3816 :\n" +
- " return 3;\n" +
- " case 3817 :\n" +
- " return 3;\n" +
- " case 3818 :\n" +
- " return 3;\n" +
- " case 3819 :\n" +
- " return 3;\n" +
- " case 3820 :\n" +
- " return 3;\n" +
- " case 3821 :\n" +
- " return 3;\n" +
- " case 3822 :\n" +
- " return 3;\n" +
- " case 3823 :\n" +
- " return 3;\n" +
- " case 3824 :\n" +
- " return 3;\n" +
- " case 3825 :\n" +
- " return 3;\n" +
- " case 3826 :\n" +
- " return 3;\n" +
- " case 3827 :\n" +
- " return 3;\n" +
- " case 3828 :\n" +
- " return 3;\n" +
- " case 3829 :\n" +
- " return 3;\n" +
- " case 3830 :\n" +
- " return 3;\n" +
- " case 3831 :\n" +
- " return 3;\n" +
- " case 3832 :\n" +
- " return 3;\n" +
- " case 3833 :\n" +
- " return 3;\n" +
- " case 3834 :\n" +
- " return 3;\n" +
- " case 3835 :\n" +
- " return 3;\n" +
- " case 3836 :\n" +
- " return 3;\n" +
- " case 3837 :\n" +
- " return 3;\n" +
- " case 3838 :\n" +
- " return 3;\n" +
- " case 3839 :\n" +
- " return 3;\n" +
- " case 3840 :\n" +
- " return 3;\n" +
- " case 3841 :\n" +
- " return 3;\n" +
- " case 3842 :\n" +
- " return 3;\n" +
- " case 3843 :\n" +
- " return 3;\n" +
- " case 3844 :\n" +
- " return 3;\n" +
- " case 3845 :\n" +
- " return 3;\n" +
- " case 3846 :\n" +
- " return 3;\n" +
- " case 3847 :\n" +
- " return 3;\n" +
- " case 3848 :\n" +
- " return 3;\n" +
- " case 3849 :\n" +
- " return 3;\n" +
- " case 3850 :\n" +
- " return 3;\n" +
- " case 3851 :\n" +
- " return 3;\n" +
- " case 3852 :\n" +
- " return 3;\n" +
- " case 3853 :\n" +
- " return 3;\n" +
- " case 3854 :\n" +
- " return 3;\n" +
- " case 3855 :\n" +
- " return 3;\n" +
- " case 3856 :\n" +
- " return 3;\n" +
- " case 3857 :\n" +
- " return 3;\n" +
- " case 3858 :\n" +
- " return 3;\n" +
- " case 3859 :\n" +
- " return 3;\n" +
- " case 3860 :\n" +
- " return 3;\n" +
- " case 3861 :\n" +
- " return 3;\n" +
- " case 3862 :\n" +
- " return 3;\n" +
- " case 3863 :\n" +
- " return 3;\n" +
- " case 3864 :\n" +
- " return 3;\n" +
- " case 3865 :\n" +
- " return 3;\n" +
- " case 3866 :\n" +
- " return 3;\n" +
- " case 3867 :\n" +
- " return 3;\n" +
- " case 3868 :\n" +
- " return 3;\n" +
- " case 3869 :\n" +
- " return 3;\n" +
- " case 3870 :\n" +
- " return 3;\n" +
- " case 3871 :\n" +
- " return 3;\n" +
- " case 3872 :\n" +
- " return 3;\n" +
- " case 3873 :\n" +
- " return 3;\n" +
- " case 3874 :\n" +
- " return 3;\n" +
- " case 3875 :\n" +
- " return 3;\n" +
- " case 3876 :\n" +
- " return 3;\n" +
- " case 3877 :\n" +
- " return 3;\n" +
- " case 3878 :\n" +
- " return 3;\n" +
- " case 3879 :\n" +
- " return 3;\n" +
- " case 3880 :\n" +
- " return 3;\n" +
- " case 3881 :\n" +
- " return 3;\n" +
- " case 3882 :\n" +
- " return 3;\n" +
- " case 3883 :\n" +
- " return 3;\n" +
- " case 3884 :\n" +
- " return 3;\n" +
- " case 3885 :\n" +
- " return 3;\n" +
- " case 3886 :\n" +
- " return 3;\n" +
- " case 3887 :\n" +
- " return 3;\n" +
- " case 3888 :\n" +
- " return 3;\n" +
- " case 3889 :\n" +
- " return 3;\n" +
- " case 3890 :\n" +
- " return 3;\n" +
- " case 3891 :\n" +
- " return 3;\n" +
- " case 3892 :\n" +
- " return 3;\n" +
- " case 3893 :\n" +
- " return 3;\n" +
- " case 3894 :\n" +
- " return 3;\n" +
- " case 3895 :\n" +
- " return 3;\n" +
- " case 3896 :\n" +
- " return 3;\n" +
- " case 3897 :\n" +
- " return 3;\n" +
- " case 3898 :\n" +
- " return 3;\n" +
- " case 3899 :\n" +
- " return 3;\n" +
- " case 3900 :\n" +
- " return 3;\n" +
- " case 3901 :\n" +
- " return 3;\n" +
- " case 3902 :\n" +
- " return 3;\n" +
- " case 3903 :\n" +
- " return 3;\n" +
- " case 3904 :\n" +
- " return 3;\n" +
- " case 3905 :\n" +
- " return 3;\n" +
- " case 3906 :\n" +
- " return 3;\n" +
- " case 3907 :\n" +
- " return 3;\n" +
- " case 3908 :\n" +
- " return 3;\n" +
- " case 3909 :\n" +
- " return 3;\n" +
- " case 3910 :\n" +
- " return 3;\n" +
- " case 3911 :\n" +
- " return 3;\n" +
- " case 3912 :\n" +
- " return 3;\n" +
- " case 3913 :\n" +
- " return 3;\n" +
- " case 3914 :\n" +
- " return 3;\n" +
- " case 3915 :\n" +
- " return 3;\n" +
- " case 3916 :\n" +
- " return 3;\n" +
- " case 3917 :\n" +
- " return 3;\n" +
- " case 3918 :\n" +
- " return 3;\n" +
- " case 3919 :\n" +
- " return 3;\n" +
- " case 3920 :\n" +
- " return 3;\n" +
- " case 3921 :\n" +
- " return 3;\n" +
- " case 3922 :\n" +
- " return 3;\n" +
- " case 3923 :\n" +
- " return 3;\n" +
- " case 3924 :\n" +
- " return 3;\n" +
- " case 3925 :\n" +
- " return 3;\n" +
- " case 3926 :\n" +
- " return 3;\n" +
- " case 3927 :\n" +
- " return 3;\n" +
- " case 3928 :\n" +
- " return 3;\n" +
- " case 3929 :\n" +
- " return 3;\n" +
- " case 3930 :\n" +
- " return 3;\n" +
- " case 3931 :\n" +
- " return 3;\n" +
- " case 3932 :\n" +
- " return 3;\n" +
- " case 3933 :\n" +
- " return 3;\n" +
- " case 3934 :\n" +
- " return 3;\n" +
- " case 3935 :\n" +
- " return 3;\n" +
- " case 3936 :\n" +
- " return 3;\n" +
- " case 3937 :\n" +
- " return 3;\n" +
- " case 3938 :\n" +
- " return 3;\n" +
- " case 3939 :\n" +
- " return 3;\n" +
- " case 3940 :\n" +
- " return 3;\n" +
- " case 3941 :\n" +
- " return 3;\n" +
- " case 3942 :\n" +
- " return 3;\n" +
- " case 3943 :\n" +
- " return 3;\n" +
- " case 3944 :\n" +
- " return 3;\n" +
- " case 3945 :\n" +
- " return 3;\n" +
- " case 3946 :\n" +
- " return 3;\n" +
- " case 3947 :\n" +
- " return 3;\n" +
- " case 3948 :\n" +
- " return 3;\n" +
- " case 3949 :\n" +
- " return 3;\n" +
- " case 3950 :\n" +
- " return 3;\n" +
- " case 3951 :\n" +
- " return 3;\n" +
- " case 3952 :\n" +
- " return 3;\n" +
- " case 3953 :\n" +
- " return 3;\n" +
- " case 3954 :\n" +
- " return 3;\n" +
- " case 3955 :\n" +
- " return 3;\n" +
- " case 3956 :\n" +
- " return 3;\n" +
- " case 3957 :\n" +
- " return 3;\n" +
- " case 3958 :\n" +
- " return 3;\n" +
- " case 3959 :\n" +
- " return 3;\n" +
- " case 3960 :\n" +
- " return 3;\n" +
- " case 3961 :\n" +
- " return 3;\n" +
- " case 3962 :\n" +
- " return 3;\n" +
- " case 3963 :\n" +
- " return 3;\n" +
- " case 3964 :\n" +
- " return 3;\n" +
- " case 3965 :\n" +
- " return 3;\n" +
- " case 3966 :\n" +
- " return 3;\n" +
- " case 3967 :\n" +
- " return 3;\n" +
- " case 3968 :\n" +
- " return 3;\n" +
- " case 3969 :\n" +
- " return 3;\n" +
- " case 3970 :\n" +
- " return 3;\n" +
- " case 3971 :\n" +
- " return 3;\n" +
- " case 3972 :\n" +
- " return 3;\n" +
- " case 3973 :\n" +
- " return 3;\n" +
- " case 3974 :\n" +
- " return 3;\n" +
- " case 3975 :\n" +
- " return 3;\n" +
- " case 3976 :\n" +
- " return 3;\n" +
- " case 3977 :\n" +
- " return 3;\n" +
- " case 3978 :\n" +
- " return 3;\n" +
- " case 3979 :\n" +
- " return 3;\n" +
- " case 3980 :\n" +
- " return 3;\n" +
- " case 3981 :\n" +
- " return 3;\n" +
- " case 3982 :\n" +
- " return 3;\n" +
- " case 3983 :\n" +
- " return 3;\n" +
- " case 3984 :\n" +
- " return 3;\n" +
- " case 3985 :\n" +
- " return 3;\n" +
- " case 3986 :\n" +
- " return 3;\n" +
- " case 3987 :\n" +
- " return 3;\n" +
- " case 3988 :\n" +
- " return 3;\n" +
- " case 3989 :\n" +
- " return 3;\n" +
- " case 3990 :\n" +
- " return 3;\n" +
- " case 3991 :\n" +
- " return 3;\n" +
- " case 3992 :\n" +
- " return 3;\n" +
- " case 3993 :\n" +
- " return 3;\n" +
- " case 3994 :\n" +
- " return 3;\n" +
- " case 3995 :\n" +
- " return 3;\n" +
- " case 3996 :\n" +
- " return 3;\n" +
- " case 3997 :\n" +
- " return 3;\n" +
- " case 3998 :\n" +
- " return 3;\n" +
- " case 3999 :\n" +
- " return 3;\n" +
- " default:\n" +
- " return -1;\n" +
- " }\n" +
- " } catch(Exception e) {\n" +
- " //ignore\n" +
- " } finally {\n" +
- " System.out.println(\"Enter finally block\");\n" +
- " System.out.println(\"Inside finally block\");\n" +
- " System.out.println(\"Leave finally block\");\n" +
- " }\n" +
- " return -1;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(foo(1));\n" +
- " }\n" +
- "}"},
- "Enter finally block\n" +
- "Inside finally block\n" +
- "Leave finally block\n" +
- "3");
-}
-public static Class testClass() {
- return XLargeTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetClassLoader.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetClassLoader.java
deleted file mode 100644
index e4ac955..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetClassLoader.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.eval.target;
-
-import java.util.*;
-
-/**
- * A code snippet class loader is a class loader that loads code snippet classes and global
- * variable classes.
- */
-public class CodeSnippetClassLoader extends ClassLoader {
- /**
- * Whether the code snippet support classes should be given by the IDE
- * or should be found on disk.
- */
- static boolean DEVELOPMENT_MODE = false;
-
- Hashtable loadedClasses = new Hashtable();
-/**
- * Asks the class loader that loaded this class to load the given class.
- * @throws ClassNotFoundException if it could not be loaded.
- */
-private Class delegateLoadClass(String name) throws ClassNotFoundException {
- ClassLoader myLoader = getClass().getClassLoader();
- if (myLoader == null) {
- return Class.forName(name);
- }
- return myLoader.loadClass(name);
-}
-/**
- * Loads the given class. If the class is known to this runner, returns it.
- * If only the class definition is known to this runner, makes it a class and returns it.
- * Otherwise delegates to the real class loader.
- */
-protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
- if (DEVELOPMENT_MODE) {
- try {
- return delegateLoadClass(name);
- } catch (ClassNotFoundException e) {
- Class clazz = makeClass(name, resolve);
- if (clazz == null) {
- throw e;
- }
- return clazz;
- }
- }
- Class clazz = makeClass(name, resolve);
- if (clazz == null) {
- return delegateLoadClass(name);
- }
- return clazz;
-}
-/**
- * Loads the given class either from the stored class definition or from the system.
- * Returns the existing class if it has already been loaded.
- * Returns null if no class definition can be found.
- */
-Class loadIfNeeded(String className) {
- Class clazz = null;
- if (!supportsHotCodeReplacement()) {
- clazz = findLoadedClass(className);
- }
- if (clazz == null) {
- try {
- clazz = loadClass(className, true);
- } catch (NoClassDefFoundError e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- }
- return clazz;
-}
-/**
- * Makes the class definition known by this code snippet runner a real class and
- * returns it.
- * Returns null if there is no class definition.
- */
-private Class makeClass(String name, boolean resolve) {
- Object o = this.loadedClasses.get(name);
- if (o == null) {
- return null;
- }
- if (o instanceof Class) {
- return (Class) o;
- }
- byte[] classDefinition = (byte[]) o;
- Class clazz = defineClass(null, classDefinition, 0, classDefinition.length);
- if (resolve) {
- resolveClass(clazz);
- }
- this.loadedClasses.put(name, clazz);
- return clazz;
-}
-/**
- * Stores the given class definition for the given class.
- */
-void storeClassDefinition(String className, byte[] classDefinition) {
- Object clazz = this.loadedClasses.get(className);
- if (clazz == null || supportsHotCodeReplacement()) {
- this.loadedClasses.put(className, classDefinition);
- }
-}
-/**
- * Returns whether this class loader supports Hot Code Replacement.
- */
-protected boolean supportsHotCodeReplacement() {
- return false;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetRunner.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetRunner.java
deleted file mode 100644
index 1024bc7..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetRunner.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.eval.target;
-
-import java.lang.reflect.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * A code snippet runner loads code snippet classes and global
- * variable classes, and that run the code snippet classes.
- * <p>
- * When started, this runner first connects using TCP/IP to the provided port number.
- * If a regular classpath directory is provided, it writes the class definitions it gets from the IDE
- * to this directory (or to the bootclasspath directory if the class name starts with "java") and it
- * lets the system class loader (or the bootstrap class loader if it is a "java" class) load
- * the class.
- * If the regular classpath directory is null, it uses a code snippet class loader to load the classes
- * it gets from the IDE.
- * <p>
- * IMPORTANT NOTE:
- * Using a code snippet class loader has the following limitation when the code snippet is ran:
- * <ul>
- * <li>The code snippet class can access only public classes, and public members or these classes.
- * This is because the "runtime package" of the code snippet class is always different from
- * the "runtime package" of the class it is trying to access since the class loaders are
- * different.
- * <li>The code snippet class cannot be defined in a "java.*" package. Only the bootstrap class
- * loader can load such a class.
- * </ul>
- */
-public class CodeSnippetRunner {
- public static CodeSnippetRunner theRunner;
- static final String CODE_SNIPPET_CLASS_NAME = "org.eclipse.wst.jsdt.internal.eval.target.CodeSnippet";
- static final String RUN_METHOD_NAME = "run";
- static final String GET_RESULT_TYPE_METHOD_NAME = "getResultType";
- static final String GET_RESULT_VALUE_METHOD_NAME = "getResultValue";
-
- IDEInterface ide;
- String classPathDirectory;
- String bootclassPathDirectory;
- CodeSnippetClassLoader loader;
- Class codeSnippetClass = null;
-/**
- * Creates a new code snippet runner.
- */
-public CodeSnippetRunner(int portNumber, String classPathDirectory, String bootclassPathDirectory) {
- this.ide = new IDEInterface(portNumber);
- if (classPathDirectory != null) {
- this.classPathDirectory = classPathDirectory;
- if (bootclassPathDirectory != null) {
- this.bootclassPathDirectory = bootclassPathDirectory;
- }
- } else {
- this.loader = new CodeSnippetClassLoader();
- }
-}
-/**
- * Returns the forward slash separated class name from the given class definition.
- */
-private String className(byte[] classDefinition) {
- // NB: The following code was copied from org.eclipse.wst.jsdt.internal.compiler.cfmt,
- // thus it is highly dependent on the class file format.
- int readOffset = 10;
- try {
- int constantPoolCount = u2At(8, classDefinition);
- int[] constantPoolOffsets = new int[constantPoolCount];
- for (int i = 1; i < constantPoolCount; i++) {
- int tag = u1At(readOffset, classDefinition);
- switch (tag) {
- case 1 : // Utf8Tag
- constantPoolOffsets[i] = readOffset;
- readOffset += u2At(readOffset + 1, classDefinition);
- readOffset += 3; // ConstantUtf8.fixedSize
- break;
- case 3 : // IntegerTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 5; // ConstantInteger.fixedSize
- break;
- case 4 : // FloatTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 5; // ConstantFloat.fixedSize
- break;
- case 5 : // LongTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 9; // ConstantLong.fixedSize
- i++;
- break;
- case 6 : // DoubleTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 9; // ConstantDouble.fixedSize
- i++;
- break;
- case 7 : // ClassTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 3; // ConstantClass.fixedSize
- break;
- case 8 : // StringTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 3; // ConstantString.fixedSize
- break;
- case 9 : // FieldRefTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 5; // ConstantFieldRef.fixedSize
- break;
- case 10 : // MethodRefTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 5; // ConstantMethodRef.fixedSize
- break;
- case 11 : // InterfaceMethodRefTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 5; // ConstantInterfaceMethodRef.fixedSize
- break;
- case 12 : // NameAndTypeTag
- constantPoolOffsets[i] = readOffset;
- readOffset += 5; // ConstantNameAndType.fixedSize
- }
- }
- // Skip access flags
- readOffset += 2;
-
- // Read the classname, use exception handlers to catch bad format
- int constantPoolIndex = u2At(readOffset, classDefinition);
- int utf8Offset = constantPoolOffsets[u2At(constantPoolOffsets[constantPoolIndex] + 1, classDefinition)];
- char[] className = utf8At(utf8Offset + 3, u2At(utf8Offset + 1, classDefinition), classDefinition);
- return new String(className);
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- return null;
- }
-}
-/**
- * Creates a new instance of the given class. It is
- * assumed that it is a subclass of CodeSnippet.
- */
-Object createCodeSnippet(Class snippetClass) {
- Object object = null;
- try {
- object = snippetClass.newInstance();
- } catch (InstantiationException e) {
- e.printStackTrace();
- this.ide.sendResult(void.class, null);
- return null;
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- this.ide.sendResult(void.class, null);
- return null;
- }
- return object;
-}
-/**
- * Whether this code snippet runner is currently running.
- */
-public boolean isRunning() {
- return this.ide.isConnected();
-}
-/**
- * Starts a new CodeSnippetRunner that will serve code snippets from the IDE.
- * It waits for a connection on the given evaluation port number.
- * <p>
- * Usage: java org.eclipse.wst.jsdt.tests.eval.target.CodeSnippetRunner -evalport <portNumber> [-options] [<mainClassName>] [<arguments>]
- * where options include:
- * -cscp <codeSnippetClasspath> the the classpath directory for the code snippet classes.
- * that are not defined in a "java.*" package.
- * -csbp <codeSnippetBootClasspath> the bootclasspath directory for the code snippet classes
- * that are defined in a "java.*" package.
- * <p>
- * The mainClassName and its arguments are optional: when not present only the server will start
- * and run until the VM is shut down, when present the server will start, the main class will run
- * but the server will exit when the main class has finished running.
- */
-public static void main(String[] args) {
- int length = args.length;
- if (length < 2 || !args[0].toLowerCase().equals("-evalport")) {
- printUsage();
- return;
- }
- int evalPort = Integer.parseInt(args[1]);
- String classPath = null;
- String bootPath = null;
- int mainClass = -1;
- for (int i = 2; i < length; i++) {
- String arg = args[i];
- if (arg.startsWith("-")) {
- if (arg.toLowerCase().equals("-cscp")) {
- if (++i < length) {
- classPath = args[i];
- } else {
- printUsage();
- return;
- }
- } else if (arg.toLowerCase().equals("-csbp")) {
- if (++i < length) {
- bootPath = args[i];
- } else {
- printUsage();
- return;
- }
- }
- } else {
- mainClass = i;
- break;
- }
- }
- theRunner = new CodeSnippetRunner(evalPort, classPath, bootPath);
- if (mainClass == -1) {
- theRunner.start();
- } else {
- Thread server = new Thread() {
- public void run() {
- theRunner.start();
- }
- };
- server.setDaemon(true);
- server.start();
- int mainArgsLength = length-mainClass-1;
- String[] mainArgs = new String[mainArgsLength];
- System.arraycopy(args, mainClass+1, mainArgs, 0, mainArgsLength);
- try {
- Class clazz = Class.forName(args[mainClass]);
- Method mainMethod = clazz.getMethod("main", new Class[] {String[].class});
- mainMethod.invoke(null, new String[][] {mainArgs});
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- }
-}
-private static void printUsage() {
- System.out.println("Usage: java org.eclipse.wst.jsdt.tests.eval.target.CodeSnippetRunner -evalport <portNumber> [-options] [<mainClassName>] [<arguments>]");
- System.out.println("where options include:");
- System.out.println("-cscp <codeSnippetClasspath> the the classpath directory for the code snippet classes.");
- System.out.println("that are not defined in a \"java.*\" package.");
- System.out.println("-csbp <codeSnippetBootClasspath> the bootclasspath directory for the code snippet classes");
- System.out.println("that are defined in a \"java.*\" package.");
-}
-/**
- * Loads the given class definitions. The way these class definitions are loaded is described
- * in the CodeSnippetRunner constructor.
- * The class definitions are code snippet classes and/or global variable classes.
- * Code snippet classes are assumed be direct or indirect subclasses of CodeSnippet and implement
- * only the run()V method.
- * They are instanciated and run.
- * Global variable classes are assumed to be direct subclasses of CodeSnippet. Their fields are assumed
- * to be static. The value of each field is sent back to the IDE.
- */
-void processClasses(boolean mustRun, byte[][] classDefinitions) {
- // store the class definitions (either in the code snippet class loader or on disk)
- String[] newClasses = new String[classDefinitions.length];
- for (int i = 0; i < classDefinitions.length; i++) {
- byte[] classDefinition = classDefinitions[i];
- String classFileName = className(classDefinition);
- String className = classFileName.replace('/', '.');
- if (this.loader != null) {
- this.loader.storeClassDefinition(className, classDefinition);
- } else {
- writeClassOnDisk(classFileName, classDefinition);
- }
- newClasses[i] = className;
- }
-
- // load the classes and collect code snippet classes
- Vector codeSnippetClasses = new Vector();
- for (int i = 0; i < newClasses.length; i++) {
- String className = newClasses[i];
- Class clazz = null;
- if (this.loader != null) {
- clazz = this.loader.loadIfNeeded(className);
- if (clazz == null) {
- System.err.println("Could not find class definition for " + className);
- break;
- }
- } else {
- // use the system class loader
- try {
- clazz = Class.forName(className);
- } catch (ClassNotFoundException e) {
- e.printStackTrace(); // should never happen since we just wrote it on disk
- this.ide.sendResult(void.class, null);
- break;
- }
- }
-
- Class superclass = clazz.getSuperclass();
- Method[] methods = clazz.getDeclaredMethods();
- if (this.codeSnippetClass == null) {
- if (superclass.equals(Object.class) && clazz.getName().equals(CODE_SNIPPET_CLASS_NAME)) {
- // The CodeSnippet class is being deployed
- this.codeSnippetClass = clazz;
- } else {
- System.out.println("Expecting CodeSnippet class to be deployed first");
- }
- } else if (superclass.equals(this.codeSnippetClass)) {
- // It may be a code snippet class with no global variable
- if (methods.length == 1 && methods[0].getName().equals(RUN_METHOD_NAME)) {
- codeSnippetClasses.addElement(clazz);
- }
- // Evaluate global variables and send result back
- Field[] fields = clazz.getDeclaredFields();
- for (int j = 0; j < fields.length; j++) {
- Field field = fields[j];
- if (Modifier.isPublic(field.getModifiers())) {
- try {
- this.ide.sendResult(field.getType(), field.get(null));
- } catch (IllegalAccessException e) {
- e.printStackTrace(); // Cannot happen because the field is public
- this.ide.sendResult(void.class, null);
- break;
- }
- }
- }
- } else if (this.codeSnippetClass.equals(superclass.getSuperclass()) && methods.length == 1 && methods[0].getName().equals("run")) {
- // It is a code snippet class with a global variable superclass
- codeSnippetClasses.addElement(clazz);
- }
- }
-
- // run the code snippet classes
- if (codeSnippetClasses.size() != 0 && mustRun) {
- for (Enumeration e = codeSnippetClasses.elements(); e.hasMoreElements();) {
- Object codeSnippet = this.createCodeSnippet((Class) e.nextElement());
- if (codeSnippet != null) {
- this.runCodeSnippet(codeSnippet);
- }
- }
- }
-}
-/**
- * Runs the given code snippet in a new thread and send the result back to the IDE.
- */
-void runCodeSnippet(final Object snippet) {
- Thread thread = new Thread() {
- public void run() {
- try {
- try {
- Method runMethod = codeSnippetClass.getMethod(RUN_METHOD_NAME, new Class[] {});
- runMethod.invoke(snippet, new Object[] {});
- } finally {
- Method getResultTypeMethod = codeSnippetClass.getMethod(GET_RESULT_TYPE_METHOD_NAME, new Class[] {});
- Class resultType = (Class)getResultTypeMethod.invoke(snippet, new Object[] {});
- Method getResultValueMethod = codeSnippetClass.getMethod(GET_RESULT_VALUE_METHOD_NAME, new Class[] {});
- Object resultValue = getResultValueMethod.invoke(snippet, new Object[] {});
- CodeSnippetRunner.this.ide.sendResult(resultType, resultValue);
- }
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- System.out.println("codeSnippetClass = " + codeSnippetClass.getName());
- System.out.println("snippet.class = " + snippet.getClass().getName());
- Class superclass = snippet.getClass().getSuperclass();
- System.out.println("snippet.superclass = " + (superclass == null ? "null" : superclass.getName()));
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
-}
-/**
- * Starts this code snippet runner in a different thread.
- */
-public void start() {
- Thread thread = new Thread("Code snippet runner") {
- public void run() {
- try {
- ide.connect();
- } catch (IOException e) {
- e.printStackTrace();
- }
- while (ide.isConnected()) {
- try {
- processClasses(ide.getRunFlag(), ide.getNextClasses());
- } catch (Error e) {
- ide.sendResult(void.class, null);
- e.printStackTrace();
- } catch (RuntimeException e) {
- ide.sendResult(void.class, null);
- e.printStackTrace();
- }
- }
- }
- };
- thread.start();
-}
-/**
- * Stops this code snippet runner.
- */
-public void stop() {
- this.ide.disconnect();
-}
-private int u1At(int position, byte[] bytes) {
- return bytes[position] & 0xFF;
-}
-private int u2At(int position, byte[] bytes) {
- return ((bytes[position++] & 0xFF) << 8) + (bytes[position] & 0xFF);
-}
-private char[] utf8At(int readOffset, int bytesAvailable, byte[] bytes) {
- int x, y, z;
- int length = bytesAvailable;
- char outputBuf[] = new char[bytesAvailable];
- int outputPos = 0;
- while (length != 0) {
- x = bytes[readOffset++] & 0xFF;
- length--;
- if ((0x80 & x) != 0) {
- y = bytes[readOffset++] & 0xFF;
- length--;
- if ((x & 0x20) != 0) {
- z = bytes[readOffset++] & 0xFF;
- length--;
- x = ((x & 0x1F) << 12) + ((y & 0x3F) << 6) + (z & 0x3F);
- } else {
- x = ((x & 0x1F) << 6) + (y & 0x3F);
- }
- }
- outputBuf[outputPos++] = (char) x;
- }
-
- if (outputPos != bytesAvailable) {
- System.arraycopy(outputBuf, 0, (outputBuf = new char[outputPos]), 0, outputPos);
- }
- return outputBuf;
-}
-/**
- * Writes the given class definition on disk. The give name is the forward slash separated
- * fully qualified name of the class.
- */
-private void writeClassOnDisk(String className, byte[] classDefinition) {
- try {
- String fileName = className.replace('/', File.separatorChar) + ".class";
- File classFile = new File(
- (this.bootclassPathDirectory != null &&
- (className.startsWith("java") || className.replace('/', '.').equals(CODE_SNIPPET_CLASS_NAME))) ?
- this.bootclassPathDirectory :
- this.classPathDirectory, fileName);
- File parent = new File(classFile.getParent());
- parent.mkdirs();
- if (!parent.exists()) {
- throw new IOException("Could not create directory " + parent.getPath());
- }
- FileOutputStream out = null;
- try {
- out = new FileOutputStream(classFile);
- out.write(classDefinition);
- } finally {
- if (out != null) {
- out.close();
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/IDEInterface.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/IDEInterface.java
deleted file mode 100644
index d96a4f0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/IDEInterface.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.eval.target;
-
-import java.io.*;
-import java.net.*;
-/**
- * The interface to the IDE. When connected, it uses TCP/IP sockets
- * to get code snippet classes and global variable classes from the IDE.
- * It sends the result of the evaluation back using the same socket.
- * <p>
- * The format from the socket input stream is the following:
- * <pre>
- * [run flag: boolean coded on 1 byte]
- * [number of class files: int coded on 4 bytes]
- * *[
- * [length of class file: int coded on 4 bytes]
- * [class file: Java Class file format]
- * ]
- * </pre>
- * This sequence is infinitely repeated until the input socket stream is closed.
- * <p>
- * The format from the socket output stream is the following:
- * <pre>
- * [has result flag: 1 if there is a result, 0 otherwise]
- * if there is a result:
- * [fully qualified type name of result: utf8 encoded string]
- * [toString representation of result: utf8 encoded string]
- * </pre>
- * This sequence is infinitely repeated until the output socket stream is closed.
- */
-public class IDEInterface {
- /**
- * Whether timing info should be printed to stdout
- */
- static final boolean TIMING = false;
- long startTime;
-
- int portNumber = 0;
- Socket socket;
-/**
- * Creates a new IDEInterface.
- */
-IDEInterface(int portNumber) {
- this.portNumber = portNumber;
-}
-/**
- * Waits for a connection from the ide on the given port.
- * @throws IOException if the connection could not be established.
- */
-void connect() throws IOException {
- ServerSocket server = new ServerSocket(this.portNumber);
- this.socket = server.accept();
- this.socket.setTcpNoDelay(true);
- server.close();
-}
-/**
- * Disconnects this interface from the IDE.
- */
-void disconnect() {
- if (this.socket != null) {
- try {
- this.socket.close();
- } catch (IOException e2) {
- // Ignore
- }
- this.socket = null;
- }
-}
-/**
- * Returns the class definitions of the classes that compose the next code snippet to evaluate.
- */
-protected byte[][] getNextClasses() {
- if (this.socket == null) {
- return new byte[0][];
- }
- if (TIMING) {
- this.startTime = System.currentTimeMillis();
- }
- try {
- DataInputStream in = new DataInputStream(this.socket.getInputStream());
- int numberOfClasses = in.readInt();
- byte[][] result = new byte[numberOfClasses][];
- for (int i = 0; i < numberOfClasses; i++) {
- int lengthOfClassFile = in.readInt();
- byte[] classFile = new byte[lengthOfClassFile];
- int read = 0;
- while (read < lengthOfClassFile && read != -1) {
- read += in.read(classFile, read, lengthOfClassFile - read);
- }
- result[i] = classFile;
- }
- return result;
- } catch (IOException e) {
- // The socket has likely been closed on the other end, close this end too.
- disconnect();
- return new byte[0][];
- }
-}
-/**
- * Returns whether the code snippet classes that follow should be run or just loaded.
- */
-protected boolean getRunFlag() {
- if (this.socket == null) {
- return false;
- }
- if (TIMING) {
- this.startTime = System.currentTimeMillis();
- }
- try {
- DataInputStream in = new DataInputStream(this.socket.getInputStream());
- return in.readBoolean();
- } catch (IOException e) {
- // The socket has likely been closed on the other end, close this end too.
- disconnect();
- return false;
- }
-}
-/**
- * Returns whether this interface is connected to the IDE.
- */
-boolean isConnected() {
- return this.socket != null;
-}
-/**
- * Sends the result of the evaluation to the IDE.
- */
-protected void sendResult(Class resultType, Object resultValue) {
- if (this.socket == null) {
- return;
- }
- try {
- DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());
- if (resultType == void.class) {
- out.writeBoolean(false);
- } else {
- out.writeBoolean(true);
- out.writeUTF(resultType.isPrimitive() ? resultType.toString() : resultType.getName());
- out.writeUTF(resultValue == null ? "null" : resultValue.toString());
- }
- } catch (IOException e) {
- // The socket has likely been closed on the other end, disconnect this end too
- disconnect();
- }
- if (TIMING) {
- System.out.println("Time to run on target is " + (System.currentTimeMillis() - this.startTime) + "ms");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AmbiguousMethodTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AmbiguousMethodTest.java
deleted file mode 100644
index 818ab8a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AmbiguousMethodTest.java
+++ /dev/null
@@ -1,1988 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.future.compiler.regression;
-
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractComparableTest;
-
-import junit.framework.*;
-
-public class AmbiguousMethodTest extends AbstractComparableTest {
-
- public AmbiguousMethodTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildComparableTestSuite(testClass());
- }
-
- public static Class testClass() {
- return AmbiguousMethodTest.class;
- }
-
- public void test000() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test { public static void main(String[] args) { new B().foo(new C()); } }\n" +
- "class A { void foo(A a) {} }\n" +
- "class B extends A { void foo(B b) { System.out.println(1); } }\n" +
- "class C extends B {}"
- },
- "1"
- );
- }
- public void test000a() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test { public static void main(String[] args) { new Subtype<String>().foo(1, \"works\"); } }\n" +
- "class Supertype<T1> { <U1> void foo(U1 u, T1 t) {} }\n" +
- "class Subtype <T2> extends Supertype<T2> { <U3> void foo(U3 u, T2 t) { System.out.println(t); } }"
- },
- "works"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122881
- public void test001() {
- this.runConformTest(
- new String[] {
- "C.java",
- "public class C { public static void main(String[] args) { new B().m(\"works\"); } }\n" +
- "class B extends A { @Override <T extends Comparable<T>> void m(T t) { System.out.println(t); } }\n" +
- "abstract class A { abstract <T extends Comparable<T>> void m(T t); }"
- },
- "works"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122881
- public void test002() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static interface I1<E1> { void method(E1 o); }\n" +
- " static interface I2<E2> { void method(E2 o); }\n" +
- " static interface I3<E3, E4> extends I1<E3>, I2<E4> {}\n" +
- " static class Class1 implements I3<String, String> {\n" +
- " public void method(String o) { System.out.println(o); }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I3<String, String> i = new Class1();\n" +
- " i.method(\"works\");\n" +
- " }\n" +
- "}"
- },
- "works"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122881
- public void test002a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static interface I1<E> { void method(E o); }\n" +
- " static interface I2<E> { void method(E o); }\n" +
- " static interface I3<E> extends I1<E>, I2<E> {}\n" +
- " static class Class1 implements I3<String> {\n" +
- " public void method(String o) { System.out.println(o); }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I3<String> i = new Class1();\n" +
- " i.method(\"works\");\n" +
- " }\n" +
- "}"
- },
- "works"
- );
- }
- public void test003() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { void foo() { new BB().test(); } }\n" +
- "class AA<T> { void test() {} }\n" +
- "class BB extends AA<CC> { <U> void test() {} }\n" +
- "class CC {}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X { void foo() { new BB().test(); } }\n" +
- " ^^^^\n" +
- "The method test() is ambiguous for the type BB\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " class BB extends AA<CC> { <U> void test() {} }\n" +
- " ^^^^^^\n" +
- "Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
- "----------\n"
- );
- }
- public void test003a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void singleMatch() { System.out.print(new BB().test(new N(), new Integer(1))); }\n" +
- " void betterMatch() { System.out.print(new CC().test(new N(), new Integer(1))); }\n" +
- " void worseMatch() { System.out.print(new DD().test(new N(), new Integer(1))); }\n" +
- " public static void main(String[] s) {\n" +
- " new X().singleMatch();\n" +
- " new X().betterMatch();\n" +
- " new X().worseMatch();\n" +
- " }\n" +
- "}\n" +
- "class AA<T> { int test(T t, Number num) { return 1; } }\n" +
- "class BB extends AA<N> { @Override int test(N n, Number num) { return 2; } }\n" +
- "class CC extends AA<M> { <U extends Number> int test(N n, U u) { return 3; } }\n" +
- "class DD extends AA<N> { <U extends Number> int test(M m, U u) { return 4; } }\n" +
- "class M {}\n" +
- "class N extends M {}",
- },
- "231"
- );
- }
- public void test003b() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void ambiguous() { new BB().test(new N()); }\n" +
- " void exactMatch() { new CC().test(new N()); }\n" +
- "}\n" +
- "class AA<T> { void test(T t) {} }\n" +
- "class BB extends AA<N> { <U> void test(N n) {} }\n" +
- "class CC extends AA<N> { @Override void test(N n) {} }\n" +
- "class M {}\n" +
- "class N extends M {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " void ambiguous() { new BB().test(new N()); }\r\n" +
- " ^^^^\n" +
- "The method test(N) is ambiguous for the type BB\n" +
- "----------\n"
- );
- }
- public void test003c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void ambiguous() { new BB().test(new N(), new Integer(1)); }\n" +
- "}\n" +
- "class AA<T> { void test(T t, Integer i) {} }\n" +
- "class BB extends AA<M> { <U extends Number> void test(N n, U u) {} }\n" +
- "class M {}\n" +
- "class N extends M {}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " void ambiguous() { new BB().test(new N(), new Integer(1)); }\n" +
- " ^^^^\n" +
- "The method test(N, Integer) is ambiguous for the type BB\n" +
- "----------\n"
- );
- }
- public void test004() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void test(M<Integer> m) {\n" +
- " m.id(new Integer(111));\n" +
- " }\n" +
- "}\n" +
- "class C<T extends Number> { public void id(T t) {} }\n" +
- "class M<TT> extends C<Integer> { public <ZZ> void id(Integer i) {} }\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " m.id(new Integer(111));\n" +
- " ^^\n" +
- "The method id(Integer) is ambiguous for the type M<Integer>\n" +
- "----------\n"
- // reference to id is ambiguous, both method id(A) in C<java.lang.Integer> and method id(B) in M<java.lang.Integer,java.lang.Integer> match
- );
- }
- public void test004a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void test(M<Integer> m) {\n" +
- " m.id(new Integer(111));\n" +
- " }\n" +
- "}\n" +
- "class C<T extends Number> { public void id(T t) {} }\n" +
- "class M<TT> extends C<Integer> { public void id(Integer i) {} }\n"
- },
- ""
- );
- }
- public void test005() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <S extends A> void foo() { }\n" +
- " <N extends B> N foo() { return null; }\n" +
- " void test () {\n" +
- " new X().foo();\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B {}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " new X().foo();\n" +
- " ^^^\n" +
- "The method foo() is ambiguous for the type X\n" +
- "----------\n"
- );
- }
- public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T> {\n" +
- " void test() {\n" +
- " new Y<Object>().foo(\"X\");\n" +
- " new Y<Object>().foo2(\"X\");\n" +
- " }\n" +
- " <U1> U1 foo(U1 t) {return null;}\n" +
- " <U2> U2 foo2(U2 t) {return null;}\n" +
- "}\n" +
- "class Y<T2> extends X<T2> {\n" +
- " void foo(T2 t) {}\n" +
- " <U3> void foo2(T2 t) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " new Y<Object>().foo(\"X\");\n" +
- " ^^^\n" +
- "The method foo(Object) is ambiguous for the type Y<Object>\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " new Y<Object>().foo2(\"X\");\n" +
- " ^^^^\n" +
- "The method foo2(Object) is ambiguous for the type Y<Object>\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129056
- public void test007() {
- this.runNegativeTest(
- new String[] {
- "B.java",
- "public class B {\n" +
- " public static void main(String[] args) {\n" +
- " new M().foo(new Integer(1), 2);\n" +
- " new N().foo(new Integer(1), 2);\n" +
- " }\n" +
- "}" +
- "interface I { void foo(Number arg1, Number arg2); }\n" +
- "class M {\n" +
- " public void foo(int arg1, int arg2) {}\n" +
- " public void foo(Number arg1, Number arg2) {}\n" +
- "}\n" +
- "class N implements I {\n" +
- " public void foo(int arg1, int arg2) {}\n" +
- " public void foo(Number arg1, Number arg2) {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in B.java (at line 3)\r\n" +
- " new M().foo(new Integer(1), 2);\r\n" +
- " ^^^\n" +
- "The method foo(int, int) is ambiguous for the type M\n" +
- "----------\n" +
- "2. ERROR in B.java (at line 4)\r\n" +
- " new N().foo(new Integer(1), 2);\r\n" +
- " ^^^\n" +
- "The method foo(int, int) is ambiguous for the type N\n" +
- "----------\n"
- // reference to foo is ambiguous, both method foo(int,int) in M and method foo(java.lang.Number,java.lang.Number) in M match
- // reference to foo is ambiguous, both method foo(int,int) in N and method foo(java.lang.Number,java.lang.Number) in N match
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=123943 - case 1
- public void test008() {
- this.runConformTest(
- new String[] {
- "AA.java",
- "public class AA {\n" +
- " public static void main(String[] a) { System.out.print(new C().test(new T())); }\n" +
- "}" +
- "class S {}\n" +
- "class T extends S {}\n" +
- "class B { <U extends S> int test(U u) {return -1;} }\n" +
- "class C extends B { @Override int test(S s) {return 1;} }"
- },
- "1"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=123943 - case 1
- public void test008a() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "public class A { void check() { new C().test(new T()); } }\n" +
- "class S {}\n" +
- "class T extends S {}\n" +
- "class B { int test(S s) {return 1;} }\n" +
- "class C extends B { <U extends S> int test(U u) {return -1;} }"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 1)\n" +
- " public class A { void check() { new C().test(new T()); } }\n" +
- " ^^^^\n" +
- "The method test(T) is ambiguous for the type C\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 5)\n" +
- " class C extends B { <U extends S> int test(U u) {return -1;} }\n" +
- " ^^^^^^^^^\n" +
- "Name clash: The method test(U) of type C has the same erasure as test(S) of type B but does not override it\n" +
- "----------\n"
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=123943 - case 2
- public void test009() {
- this.runConformTest(
- new String[] {
- "T.java",
- "import java.util.*;\n" +
- "public class T {\n" +
- " void test() {\n" +
- " OrderedSet<String> os = null;\n" +
- " os.add(\"hello\");\n" +
- " OrderedSet<Integer> os2 = null;\n" +
- " os2.add(1);\n" +
- " }\n" +
- "}" +
- "interface OrderedSet<E> extends List<E>, Set<E> { boolean add(E o); }\n"
- },
- ""
- );
- }
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=121024
-public void _test010a() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " interface Listener {}\n" +
- " interface ErrorListener {}\n" +
- " static <L1 extends Listener & ErrorListener> Object createParser(L1 l) { return null; }\n" +
- " static <L2 extends ErrorListener & Listener> Object createParser(L2 l) { return null; }\n" +
- " public static void main(String[] s) {\n" +
- " class A implements Listener, ErrorListener {}\n" +
- " createParser(new A());\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " static <L1 extends Listener & ErrorListener> Object createParser(L1 l) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Method createParser(L1) has the same erasure createParser(X.Listener) as another method in type X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\r\n" +
- " static <L2 extends ErrorListener & Listener> Object createParser(L2 l) { return null; }\r\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Method createParser(L2) has the same erasure createParser(X.ErrorListener) as another method in type X\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\r\n" +
- " createParser(new A());\r\n" +
- " ^^^^^^^^^^^^\n" +
- "The method createParser(A) is undefined for the type X\n" +
- "----------\n"
- );
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=121024
-public void _test010b() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " interface Listener {}\n" +
- " interface ErrorListener {}\n" +
- " static <L1 extends Listener> int createParser(L1 l) { return 1; }\n" +
- " static <L2 extends ErrorListener & Listener> int createParser(L2 l) { return 2; }\n" +
- " public static void main(String[] s) {\n" +
- " class A implements Listener, ErrorListener {}\n" +
- " System.out.print(createParser(new A()));\n" +
- " }\n" +
- "}"
- },
- "2"
- );
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=121024
-public void _test010c() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " interface Listener {}\n" +
- " interface ErrorListener {}\n" +
- " static int createParser(Listener l) { return 1; }\n" +
- " static <L extends ErrorListener & Listener> int createParser(L l) { return 2; }\n" +
- " public static void main(String[] s) {\n" +
- " class A implements Listener, ErrorListener {}\n" +
- " System.out.print(createParser(new A()));\n" +
- " }\n" +
- "}"
- },
- "2"
- );
-}
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106090
- public void test011() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<A extends Number> extends Y<A> {\n" +
- " <T> void foo(A n, T t) throws ExOne {}\n" +
- " void test(X<Integer> x) throws ExTwo { x.foo(new Integer(1), new Integer(2)); }\n" +
- " void test2(X x) throws ExTwo { x.foo(new Integer(1), new Integer(2)); }\n" +
- "}\n" +
- "class Y<C extends Number> {\n" +
- " void foo(C x, C n) throws ExTwo {}\n" +
- "}\n" +
- "class ExOne extends Exception {static final long serialVersionUID = 1;}\n" +
- "class ExTwo extends Exception {static final long serialVersionUID = 2;}"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " void test2(X x) throws ExTwo { x.foo(new Integer(1), new Integer(2)); }\n" +
- " ^\n" +
- "X is a raw type. References to generic type X<A> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " void test2(X x) throws ExTwo { x.foo(new Integer(1), new Integer(2)); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method foo(Number, Number) belongs to the raw type Y. References to generic type Y<C> should be parameterized\n" +
- "----------\n"
- // test2 - warning: [unchecked] unchecked call to foo(C,C) as a member of the raw type Y
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106090
- public void test011a() {
- this.runConformTest(
- new String[] {
- "Combined.java",
- "public class Combined<A, B> {\n" +
- " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
- " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
- " void pickOne(Combined<Integer,Integer> c) throws ExOne { c.pickOne(\"test\"); }\n" +
- " <T extends Number> void pickTwo(Number n, T t) throws ExOne {}\n" +
- " void pickTwo(A x, Number n) throws ExTwo {}\n" +
- " void pickTwo(Combined<Integer,Integer> c) throws ExTwo { c.pickTwo(new Integer(1), 2); }\n" +
- "}\n" +
- "class ExOne extends Exception {static final long serialVersionUID = 1;}\n" +
- "class ExTwo extends Exception {static final long serialVersionUID = 2;}"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106090
- public void test011b() {
- this.runNegativeTest(
- new String[] {
- "Test1.java",
- "public class Test1<AA, BB> {\n" +
- " <T extends Comparable<T>> void pickOne(T value) throws ExOne {}\n" +
- " <T> T pickOne(Comparable<T> value) throws ExTwo { return null;}\n" +
- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
- "}\n" +
- "class ExOne extends Exception {static final long serialVersionUID = 1;}\n" +
- "class ExTwo extends Exception {static final long serialVersionUID = 2;}"
- },
- "----------\n" +
- "1. WARNING in Test1.java (at line 4)\n" +
- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: Unchecked invocation pickOne(Comparable) of the generic method pickOne(T) of type Test1<Integer,Integer>\n" +
- "----------\n" +
- "2. WARNING in Test1.java (at line 4)\n" +
- " void pickOne2(Test1<Integer,Integer> c) throws ExOne { c.pickOne((Comparable) \"test\"); }\n" +
- " ^^^^^^^^^^\n" +
- "Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
- "----------\n"
- );
- }
- public void test012() {
- this.runConformTest(
- new String[] {
- "XX.java",
- "public class XX {\n" +
- " public static void main(String[] s) { System.out.println(new B().id(new Integer(1))); }\n" +
- "}\n" +
- "class A<T extends Number> { public int id(T t) {return 2;} }\n" +
- "class B extends A<Integer> { public int id(Integer i) {return 1;} }"
- },
- "1"
- );
- }
- public void test012a() {
- this.runNegativeTest(
- new String[] {
- "XX.java",
- "public class XX {\n" +
- " public static void main(String[] s) { System.out.println(new B().id(new Integer(1))); }\n" +
- "}\n" +
- "class A<T extends Number> { public int id(T t) {return 2;} }\n" +
- "class B extends A<Integer> { public <ZZ> int id(Integer i) {return 1;} }"
- },
- "----------\n" +
- "1. ERROR in XX.java (at line 2)\r\n" +
- " public static void main(String[] s) { System.out.println(new B().id(new Integer(1))); }\r\n" +
- " ^^\n" +
- "The method id(Integer) is ambiguous for the type B\n" +
- "----------\n"
- // reference to id is ambiguous, both method id(T) in A<java.lang.Integer> and method <ZZ>id(java.lang.Integer) in B match
- );
- }
- public void test013() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <E extends A> void m(E e) { System.out.print(1); }\n" +
- " <E extends B> void m(E e) { System.out.print(2); }\n" +
- " public static void main(String[] args) {\n" +
- " new X().m(new A());\n" +
- " new X().m(new B());\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n"
- },
- "12"
- );
- }
- public void test014() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void a(G x) { System.out.print(1); }\n" +
- " void b(F x) { System.out.print(2); }\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " G<C> g = null;\n" +
- " new X().a(h);\n" +
- " new X().a(g);\n" +
- " new X().b(h);\n" +
- " new X().b(g);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "1122"
- );
- }
- public void test014a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void a(G<C> x) { System.out.print(1); }\n" +
- " void b(F<C> x) { System.out.print(2); }\n" +
- " public static void main(String[] args) {\n" +
- " H h = null;\n" +
- " G g = null;\n" +
- " new X().a(h);\n" +
- " new X().a(g);\n" +
- " new X().b(h);\n" +
- " new X().b(g);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "1122"
- );
- }
- public void test014b() {
- this.runConformTest(
- new String[] {
- "X0.java",
- "public class X0 {\n" +
- " void two(G x) { System.out.print(1); }\n" +
- " void two(F<A> x) { System.out.print(2); }\n" +
- " void three(G x) { System.out.print(3); }\n" +
- " void three(F<B> x) { System.out.print(4); }\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " new X0().two(h);\n" +
- " new X0().three(h);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "13"
- );
- }
- public void test014c() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void a(G x) {}\n" +
- " void a(F<C> x) {}\n" +
- " void b(G<C> x) {}\n" +
- " void b(F x) {}\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " new X().a(h);\n" +
- " new X().b(h);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 2)\r\n" +
- " void a(G x) {}\r\n" +
- " ^\n" +
- "G is a raw type. References to generic type G<T2> should be parameterized\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\r\n" +
- " void b(F x) {}\r\n" +
- " ^\n" +
- "F is a raw type. References to generic type F<T1> should be parameterized\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\r\n" +
- " new X().a(h);\r\n" +
- " ^\n" +
- "The method a(G) is ambiguous for the type X\n" +
- "----------\n"
- // reference to a is ambiguous, both method a(G) in X and method a(F<C>) in X match
- );
- }
- public void test014d() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void one(G<B> x) {}\n" +
- " void one(F<B> x) {}\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " new X().one(h);\n" + // no match
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\r\n" +
- " new X().one(h);\r\n" +
- " ^^^\n" +
- "The method one(G<B>) in the type X is not applicable for the arguments (H<C>)\n" +
- "----------\n"
- );
- }
- public void test014e() {
- this.runConformTest(
- new String[] {
- "X1.java",
- "public class X1 {\n" +
- " void two(G<C> x) { System.out.print(1); }\n" +
- " void two(F<B> x) { System.out.print(2); }\n" +
- " void three(G<B> x) { System.out.print(3); }\n" +
- " void three(F<C> x) { System.out.print(4); }\n" +
- " void four(G<C> x) { System.out.print(5); }\n" +
- " void four(F<C> x) { System.out.print(6); }\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " new X1().two(h);\n" +
- " new X1().three(h);\n" +
- " new X1().four(h);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "145"
- );
- }
- public void test014f() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " <E1, E2 extends B> void three(G<E2> x) {}\n" +
- " <E3 extends C> void three(F<E3> x) {}\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " new X().three(h);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\r\n" +
- " new X().three(h);\r\n" +
- " ^^^^^\n" +
- "The method three(G<C>) is ambiguous for the type X\n" +
- "----------\n"
- );
- }
- public void test014g() {
- this.runConformTest(
- new String[] {
- "X3.java",
- "public class X3 {\n" +
- " <E1, E2 extends B> void one(G<E2> x) { System.out.print(1); }\n" +
- " <E3 extends B> void one(F<E3> x) { System.out.print(2); }\n" +
- " <E1, E2 extends C> void two(G<E2> x) { System.out.print(3); }\n" +
- " <E3 extends B> void two(F<E3> x) { System.out.print(4); }\n" +
- " <E1, E2 extends C> void four(G<E2> x) { System.out.print(5); }\n" +
- " <E3 extends C> void four(F<E3> x) { System.out.print(6); }\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " new X3().one(h);\n" +
- " new X3().two(h);\n" +
- " new X3().four(h);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "135"
- );
- }
- public void test014h() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void x(G x) { System.out.print(true); }\n" +
- " void x(F x) { System.out.print(false); }\n" +
- " void x2(G<C> x) { System.out.print(true); }\n" +
- " void x2(F<C> x) { System.out.print(false); }\n" +
- " void a(G x) {}\n" +
- " void a(F<C> x) {}\n" +
- " void a2(G x) {}\n" +
- " <T extends C> void a2(F<T> x) {}\n" +
- " void a3(G x) {}\n" +
- " <T extends F<C>> void a3(T x) {}\n" +
- " void a4(G x) {}\n" +
- " <T extends C, S extends F<T>> void a4(S x) {}\n" +
- " <T extends G> void a5(T x) {}\n" +
- " void a5(F<C> x) {}\n" +
- " void b(G<C> x) { System.out.print(true); }\n" +
- " void b(F x) { System.out.print(false); }\n" +
- " void b2(G<C> x) { System.out.print(true); }\n" +
- " <T extends F> void b2(T x) { System.out.print(false); }\n" +
- " <T extends C> void b3(G<T> x) { System.out.print(true); }\n" +
- " void b3(F x) { System.out.print(false); }\n" +
- " <T extends G<C>> void b4(T x) { System.out.print(true); }\n" +
- " void b4(F x) { System.out.print(false); }\n" +
- " <T extends C, S extends G<T>> void b5(S x) { System.out.print(true); }\n" +
- " void b5(F x) { System.out.print(false); }\n" +
- " void c(G x) { System.out.print(true); }\n" +
- " <T extends C> void c(F x) { System.out.print(false); }\n" +
- " public static void main(String[] args) {\n" +
- " H<C> h = null;\n" +
- " H hraw = null;\n" +
- " new X().x(h);\n" +
- " new X().x(hraw);\n" +
- " new X().x2(h);\n" +
- " new X().x2(hraw);\n" +
- " new X().b(h);\n" +
- " new X().b(hraw);\n" +
- " new X().b2(h);\n" +
- " new X().b2(hraw);\n" +
- " new X().b3(h);\n" +
- " new X().b3(hraw);\n" +
- " new X().b4(h);\n" +
- " new X().b4(hraw);\n" +
- " new X().b5(h);\n" +
- " new X().b5(hraw);\n" +
- " new X().c(h);\n" +
- " new X().c(hraw);\n" +
- " }\n" +
- "}\n" +
- "class A {}\n" +
- "class B extends A {}\n" +
- "class C extends B {}\n" +
- "class F<T1> {} \n" +
- "class G<T2> extends F<T2> {}\n" +
- "class H<T3> extends G<T3> {}"
- },
- "truetruetruetruetruetruetruetruetruetruetruetruetruetruetruetrue"
- );
- this.runNegativeTest(
- new String[] {
- "Y.java",
- "public class Y extends X {\n" +
- " public static void ambiguousCases() {\n" +
- " H<C> h = null;\n" +
- " H hraw = null;\n" +
- " new X().a(h);\n" +
- " new X().a(hraw);\n" +
- " new X().a2(h);\n" +
- " new X().a2(hraw);\n" +
- " new X().a3(h);\n" +
- " new X().a3(hraw);\n" +
- " new X().a4(h);\n" +
- " new X().a4(hraw);\n" +
- " new X().a5(h);\n" +
- " new X().a5(hraw);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in Y.java (at line 4)\n" +
- " H hraw = null;\n" +
- " ^\n" +
- "H is a raw type. References to generic type H<T3> should be parameterized\n" +
- "----------\n" +
- "2. ERROR in Y.java (at line 5)\n" +
- " new X().a(h);\n" +
- " ^\n" +
- "The method a(G) is ambiguous for the type X\n" +
- "----------\n" +
- "3. ERROR in Y.java (at line 6)\n" +
- " new X().a(hraw);\n" +
- " ^\n" +
- "The method a(G) is ambiguous for the type X\n" +
- "----------\n" +
- "4. ERROR in Y.java (at line 7)\n" +
- " new X().a2(h);\n" +
- " ^^\n" +
- "The method a2(G) is ambiguous for the type X\n" +
- "----------\n" +
- "5. ERROR in Y.java (at line 8)\n" +
- " new X().a2(hraw);\n" +
- " ^^\n" +
- "The method a2(G) is ambiguous for the type X\n" +
- "----------\n" +
- "6. ERROR in Y.java (at line 9)\n" +
- " new X().a3(h);\n" +
- " ^^\n" +
- "The method a3(G) is ambiguous for the type X\n" +
- "----------\n" +
- "7. ERROR in Y.java (at line 10)\n" +
- " new X().a3(hraw);\n" +
- " ^^\n" +
- "The method a3(G) is ambiguous for the type X\n" +
- "----------\n" +
- "8. ERROR in Y.java (at line 11)\n" +
- " new X().a4(h);\n" +
- " ^^\n" +
- "The method a4(G) is ambiguous for the type X\n" +
- "----------\n" +
- "9. ERROR in Y.java (at line 12)\n" +
- " new X().a4(hraw);\n" +
- " ^^\n" +
- "The method a4(G) is ambiguous for the type X\n" +
- "----------\n" +
- "10. ERROR in Y.java (at line 13)\n" +
- " new X().a5(h);\n" +
- " ^^\n" +
- "The method a5(H<C>) is ambiguous for the type X\n" +
- "----------\n" +
- "11. ERROR in Y.java (at line 14)\n" +
- " new X().a5(hraw);\n" +
- " ^^\n" +
- "The method a5(H) is ambiguous for the type X\n" +
- "----------\n",
- null,
- false
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=79798
- public void test015() {
- this.runConformTest(
- new String[] {
- "E.java",
- "public class E {\n" +
- " public static void main(String[] s) {\n" +
- " IJ ij = new K();\n" +
- " try { ij.m(); } catch(E11 e) {}\n" +
- " }\n" +
- "}\n" +
- "interface I { void m() throws E1; }\n" +
- "interface J { void m() throws E11; }\n" +
- "interface IJ extends I, J {}\n" +
- "class K implements IJ { public void m() {} }\n" +
- "class E1 extends Exception { static final long serialVersionUID = 1; }\n" +
- "class E11 extends E1 { static final long serialVersionUID = 2; }\n" +
- "class E2 extends Exception { static final long serialVersionUID = 3; }"
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=79798
- public void _test016() {
- this.runConformTest(
- new String[] {
- "E.java",
- "public class E {\n" +
- " public static void main(String[] s) {\n" +
- " IJ ij = new K();\n" +
- " try { ij.m(); } catch(E11 e) {}\n" +
- " }\n" +
- "}\n" +
- "interface I { void m() throws E1; }\n" +
- "interface J { void m() throws E2, E11; }\n" +
- "interface IJ extends I, J {}\n" +
- "class K implements IJ { public void m() {} }\n" +
- "class E1 extends Exception { static final long serialVersionUID = 1; }\n" +
- "class E11 extends E1 { static final long serialVersionUID = 2; }\n" +
- "class E2 extends Exception { static final long serialVersionUID = 3; }"
- },
- ""
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=79798
- public void _test016a() {
- this.runNegativeTest(
- new String[] {
- "E.java",
- "public class E {\n" +
- " public static void main(String[] s) {\n" +
- " IJ ij = new K();\n" +
- " ij.m();\n" +
- " try { ij.m(); } catch(E2 e) {}\n" +
- " }\n" +
- "}\n" +
- "interface I { void m() throws E1; }\n" +
- "interface J { void m() throws E2, E11; }\n" +
- "interface IJ extends I, J {}\n" +
- "class K implements IJ { public void m() {} }\n" +
- "class E1 extends Exception { static final long serialVersionUID = 1; }\n" +
- "class E11 extends E1 { static final long serialVersionUID = 2; }\n" +
- "class E2 extends Exception { static final long serialVersionUID = 3; }"
- },
- "----------\n" +
- "1. ERROR in E.java (at line 4)\r\n" +
- " ij.m();\r\n" +
- " ^^^^^^\n" +
- "Unhandled exception type E11\n" +
- "----------\n" +
- "2. ERROR in E.java (at line 5)\r\n" +
- " try { ij.m(); } catch(E2 e) {}\r\n" +
- " ^^^^^^\n" +
- "Unhandled exception type E11\n" +
- "----------\n" +
- "3. ERROR in E.java (at line 5)\r\n" +
- " try { ij.m(); } catch(E2 e) {}\r\n" +
- " ^^\n" +
- "Unreachable catch block for E2. This exception is never thrown from the try statement body\n" +
- "----------\n"
- // 4: unreported exception E11; must be caught or declared to be thrown
- // 5: exception E2 is never thrown in body of corresponding try statement
- // 5: unreported exception E11; must be caught or declared to be thrown
- );
- }
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=149893
- public void test017() {
- this.runConformTest(
- new String[] {
- "AbstractFilter.java",
- "import java.util.*;\n" +
- "public class AbstractFilter<T> implements IFilter<T> {\n" +
- " public final <E extends T> boolean selekt(E obj) { return true; }\n" +
- " public final <E extends T> List<E> filter(List<E> elements) {\n" +
- " if ((elements == null) || (elements.size() == 0)) return elements;\n" +
- " List<E> okElements = new ArrayList<E>(elements.size());\n" +
- " for (E obj : elements) {\n" +
- " if (selekt(obj)) okElements.add(obj);\n" +
- " }\n" +
- " return okElements;" +
- " }\n" +
- "}\n" +
- "interface IFilter<T> {\n" +
- " <E extends T> boolean selekt(E obj);\n" +
- " <E extends T> List<E> filter(List<E> elements);\n" +
- "}"
- },
- ""
- );
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=147647
- public void test018() {
- this.runConformTest(
- new String[] {
- "Y.java",
- "class X<T extends Object> {\n" +
- " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " System.out.print(false);\n" +
- " return new X<U>();\n" +
- " }\n" +
- "}\n" +
- "public class Y<V extends String> extends X<V> {\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " System.out.print(true);\n" +
- " return new Y<W>();\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Y.make(String.class);\n" +
- " }\n" +
- "}"
- },
- "true");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=147647
- // in fact, <W extends String> Y<W> make(Class<W> clazz) is the most
- // specific method according to JLS 15.12.2.5
- public void test019() {
- this.runConformTest(
- new String[] {
- "Y.java",
- "class X<T extends Object> {\n" +
- " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " System.out.print(false);\n" +
- " return new X<U>();\n" +
- " }\n" +
- "}\n" +
- "public class Y<V extends String> extends X<V> {\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " System.out.print(true);\n" +
- " return new Y<W>();\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Y.make(getClazz());\n" +
- " }\n" +
- " public static Class getClazz() {\n" +
- " return String.class;\n" +
- " }\n" +
- "}"
- },
- "true");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=147647
- public void test020() {
- this.runConformTest(
- new String[] {
- "Y.java",
- "class X<T extends Object> {\n" +
- " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " System.out.print(true);\n" +
- " return new X<U>();\n" +
- " }\n" +
- "}\n" +
- "public class Y<V extends String> extends X<V> {\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " System.out.print(false);\n" +
- " return new Y<W>();\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Y.make(getClazz().newInstance().getClass());\n" +
- " }\n" +
- " public static Class getClazz() {\n" +
- " return String.class;\n" +
- " }\n" +
- "}"
- },
- "true");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=147647
- // variant: having both methods in the same class should not change anything
- public void test021() {
- this.runConformTest(
- new String[] {
- "Y.java",
- "class X<T extends Object> {\n" +
- "}\n" +
- "public class Y<V extends String> extends X<V> {\n" +
- " public static <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " System.out.print(true);\n" +
- " return new Y<W>();\n" +
- " }\n" +
- " public static <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " System.out.print(false);\n" +
- " return new X<U>();\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Y.make(getClazz());\n" +
- " }\n" +
- " public static Class getClazz() {\n" +
- " return String.class;\n" +
- " }\n" +
- "}"
- },
- "true");
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=147647
- // variant: using instances triggers raw methods, which are ambiguous
- public void test022() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T extends Object> {\n" +
- "}\n" +
- "class Y<V extends String> extends X<V> {\n" +
- " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " return new Y<W>();\n" +
- " }\n" +
- " public <U extends Object> X<U> make(Class<U> clazz) {\n" +
- " return new X<U>();\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Y y = new Y();\n" +
- " y.make(String.class);\n" +
- " y.make(getClazz());\n" +
- " y.make(getClazz().newInstance().getClass());\n" +
- " }\n" +
- " public static Class getClazz() {\n" +
- " return String.class;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " class Y<V extends String> extends X<V> {\n" +
- " ^^^^^^\n" +
- "The type parameter V should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public <W extends String> Y<W> make(Class<W> clazz) {\n" +
- " ^^^^^^\n" +
- "The type parameter W should not be bounded by the final type String. Final types cannot be further extended\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 11)\n" +
- " Y y = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "4. WARNING in X.java (at line 11)\n" +
- " Y y = new Y();\n" +
- " ^\n" +
- "Y is a raw type. References to generic type Y<V> should be parameterized\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 12)\n" +
- " y.make(String.class);\n" +
- " ^^^^\n" +
- "The method make(Class) is ambiguous for the type Y\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 13)\n" +
- " y.make(getClazz());\n" +
- " ^^^^\n" +
- "The method make(Class) is ambiguous for the type Y\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 14)\n" +
- " y.make(getClazz().newInstance().getClass());\n" +
- " ^^^^\n" +
- "The method make(Class) is ambiguous for the type Y\n" +
- "----------\n" +
- "8. WARNING in X.java (at line 16)\n" +
- " public static Class getClazz() {\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n");
- }
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159711
-public void test023() {
-this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.*;\n" +
- "public class X {\n" +
- " public static void staticFoo(Collection<?> p) {\n" +
- " System.out.print(1);\n" +
- " }\n" +
- " public static <T extends List<?>> void staticFoo(T p) {\n" +
- " System.out.print(2);\n" +
- " }\n" +
- " public void foo(Collection<?> p) {\n" +
- " System.out.print(1);\n" +
- " }\n" +
- " public <T extends List<?>> void foo(T p) {\n" +
- " System.out.print(2);\n" +
- " }\n" +
- " public void foo2(Collection<?> p) {\n" +
- " System.out.print(1);\n" +
- " }\n" +
- " public void foo2(List<?> p) {\n" +
- " System.out.print(2);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " staticFoo(new ArrayList<String>(Arrays.asList(\"\")));\n" +
- " new X().foo(new ArrayList<String>(Arrays.asList(\"\")));\n" +
- " new X().foo2(new ArrayList<String>(Arrays.asList(\"\")));\n" +
- " }\n" +
- "}"
- },
- "222");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159711
-// self contained variant
-public void test024() {
-this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void foo(L1<?> p) {\n" +
- " System.out.println(1);\n" +
- " }\n" +
- " public static <T extends L2<?>> void foo(T p) {\n" +
- " System.out.println(2);\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " foo(new L3<String>());\n" +
- " }\n" +
- "}",
- "L1.java",
- "public interface L1<T> {\n" +
- "}",
- "L2.java",
- "public interface L2<T> extends L1<T> {\n" +
- "}",
- "L3.java",
- "public class L3<T> implements L2<T> {\n" +
- " public L3() {\n" +
- " }\n" +
- "}",
- },
- "2");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162026
-public void test025() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " J m = new Y();" +
- " void foo() {\n" +
- " m.foo(1.0f);\n" +
- " }\n" +
- "}",
- "I.java",
- "public interface I {\n" +
- " <T extends Number> T foo(final Number p);\n" +
- "}",
- "J.java",
- "public interface J extends I {\n" +
- " Float foo(final Number p);\n" +
- "}",
- "Y.java",
- "public class Y implements J {\n" +
- " public Float foo(final Number p){\n" +
- " return null;" +
- " }\n" +
- "}",
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162026
-// variant
-public void test026() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " (new Y()).foo(1.0f);\n" +
- " }\n" +
- "}",
- "I.java",
- "public interface I {\n" +
- " <T extends Number> T foo(final Number p);\n" +
- "}",
- "J.java",
- "public interface J extends I {\n" +
- " Float foo(final Number p);\n" +
- "}",
- "Y.java",
- "public class Y implements J {\n" +
- " public Float foo(final Number p){\n" +
- " return null;" +
- " }\n" +
- "}",
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162026
-// variant
-public void test027() {
- this.runNegativeTest(
- new String[] {
- "J.java",
- "public interface J {\n" +
- " <T extends Number> T foo(final Number p);\n" +
- " Float foo(final Number p);\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in J.java (at line 2)\n" +
- " <T extends Number> T foo(final Number p);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Number) in type J\n" +
- "----------\n" +
- "2. ERROR in J.java (at line 3)\n" +
- " Float foo(final Number p);\n" +
- " ^^^^^^^^^^^^^^^^^^^\n" +
- "Duplicate method foo(Number) in type J\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// **
-public void test028() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface Irrelevant {}\n" +
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "interface J extends Irrelevant, I {\n" +
- " String foo(Number n);\n" +
- "}\n" +
- "interface K {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J, K {\n" +
- " void foo() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - simplified
-// **
-public void test029() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface J {\n" +
- " String foo(Number n);\n" +
- "}\n" +
- "interface K {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J, K {\n" +
- " void foo() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - same return type
-public void test030() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface J {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "interface K {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J, K {\n" +
- " void foo() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant
-// **
-public void test031() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface Irrelevant {}\n" +
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "interface J extends Irrelevant, I {\n" +
- " String foo(Number n);\n" +
- "}\n" +
- "interface K {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements Irrelevant, I, J, K {\n" +
- " void foo() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
-public void test032() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " <T extends Exception & Cloneable> T foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " XX foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J {\n" +
- "}\n" +
- "abstract class XX extends Exception implements Cloneable {}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
-// variant that shows that the use of a substitution is needed during the bounds
-// check
-public void test032a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class Z { }\n" +
- "class Y <U> extends Z { }" +
- "interface I {\n" +
- " <T extends Y<T> & Cloneable> T foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " XX foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J {\n" +
- "}\n" +
- "abstract class XX extends Y<XX> implements Cloneable {}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
-// variant
-public void test032b() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class A<T> { }" +
- "interface I {\n" +
- " <T extends Exception & Cloneable> A<T> foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " A<XX> foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J {\n" +
- "}\n" +
- "abstract class XX extends Exception implements Cloneable {}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
-// variant
-public void test032c() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class A<T> { }" +
- "interface I {\n" +
- " <T extends Exception & Cloneable> A<T> foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " <S extends XX> A<S> foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J {\n" +
- "}\n" +
- "abstract class XX extends Exception implements Cloneable {}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
-// variant
-public void test032d() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class A<T> { }" +
- "interface I {\n" +
- " A<XX> foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " <T extends Exception & Cloneable> A<T> foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J {\n" +
- "}\n" +
- "abstract class XX extends Exception implements Cloneable {}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
-// variant
-public void test033() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " <T extends Exception & Cloneable> T foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " XX foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J {\n" +
- " void foo() {\n" +
- " }\n" +
- " public XX foo(Number n) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "abstract class XX extends Exception implements Cloneable {}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
-// variant that rightly complains
-public void test034() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " <T extends Exception & Cloneable> T foo(Number n);\n" +
- "}\n" +
- "interface J extends I {\n" +
- " XX foo(Number n);\n" +
- "}\n" +
- "interface K {\n" +
- " NullPointerException foo(Number n);\n" +
- "}\n" +
- "public abstract class X implements J, K {\n" +
- "}\n" +
- "abstract class XX extends Exception implements Cloneable {}"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 5)\n" +
- " XX foo(Number n);\n" +
- " ^^\n" +
- "Type safety: The return type XX for foo(Number) from the type J needs unchecked conversion to conform to T from the type I\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 10)\n" +
- " public abstract class X implements J, K {\n" +
- " ^\n" +
- "The return type is incompatible with K.foo(Number), J.foo(Number)\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - the inheriting class implements foo
-public void test035() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "abstract class J {\n" +
- " abstract String foo(Number n);\n" +
- "}\n" +
- "public class X extends J implements I {\n" +
- " void bar() {\n" +
- " foo(0.0f);\n" + // calls X#foo(Number)
- " }\n" +
- " public String foo(Number n) {\n" +
- " return null;\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - extending instead of implementing
-// **
-public void test037() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(Number n);\n" +
- "}\n" +
- "abstract class J {\n" +
- " abstract String foo(Number n);\n" +
- "}\n" +
- "public abstract class X extends J implements I {\n" +
- " void bar() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - no promotion of parameter from float to Number
-// **
-public void test038() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(float f);\n" +
- "}\n" +
- "abstract class J {\n" +
- " public abstract String foo(float f);\n" +
- "}\n" +
- "public abstract class X extends J implements I {\n" +
- " void bar() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - an explicit cast solves the issue
-public void test039() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(float f);\n" +
- "}\n" +
- "abstract class J {\n" +
- " public abstract String foo(float f);\n" +
- "}\n" +
- "public abstract class X extends J implements I {\n" +
- " void bar() {\n" +
- " String s = ((J) this).foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - an explicit cast solves the issue
-public void test040() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(float f);\n" +
- "}\n" +
- "abstract class J {\n" +
- " public abstract String foo(float f);\n" +
- "}\n" +
- "public abstract class X extends J implements I {\n" +
- " void bar() {\n" +
- " Object o = ((I) this).foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - connecting return types
-public void test041() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(float f);\n" +
- "}\n" +
- "abstract class J {\n" +
- " public abstract String foo(float f);\n" +
- "}\n" +
- "public abstract class X extends J implements I {\n" +
- " void bar() {\n" +
- " String s = ((I) this).foo(0.0f);\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " String s = ((I) this).foo(0.0f);\n" +
- " ^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to String\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - a further inheriting class implements String foo
-// **
-public void test042() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(float f);\n" +
- "}\n" +
- "abstract class J {\n" +
- " public abstract String foo(float f);\n" +
- "}\n" +
- "public abstract class X extends J implements I {\n" +
- " void bar() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}\n" +
- "class Z extends X {\n" +
- " @Override" +
- " public String foo(float f) {\n" +
- " return null;\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
-// variant - a further inheriting class implements Object foo
-public void test043() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " Object foo(float f);\n" +
- "}\n" +
- "abstract class J {\n" +
- " public abstract String foo(float f);\n" +
- "}\n" +
- "public abstract class X extends J implements I {\n" +
- " void bar() {\n" +
- " foo(0.0f);\n" +
- " }\n" +
- "}\n" +
- "class Z extends X {\n" +
- " @Override\n" +
- " public Object foo(float f) {\n" + // cannot override String foo
- " return null;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " public Object foo(float f) {\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with J.foo(float)\n" +
- "----------\n");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163370
-public void test044() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I<E> {}\n" +
- "class Y<E> {}\n" +
- "public class X<E extends Y<E>> implements I<E> {\n" +
- " public static <E extends Y<E>> X<E> bar(X<E> s) {\n" +
- " return null;\n" +
- " }\n" +
- " public static <E extends Y<E>> X<E> bar(I<E> c) {\n" +
- " return null;\n" +
- " }\n" +
- " public static <E extends Y<E>> X<E> foo(X<E> s) {\n" +
- " X<E> result = bar(s);\n" +
- " return result;\n" +
- " }\n" +
- "}"
- },
- "");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165620
-public void test045() {
- this.runConformTest(
- new String[] {
- "X.java",
- "abstract class Y<T> implements I<T> {\n" +
- "}\n" +
- "interface I<T> { \n" +
- "}\n" +
- "interface J<T> {\n" +
- "}\n" +
- "class X {\n" +
- " public static <V extends J<? super V>> V foo(final I<V> a)\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " public static <V extends J<? super V>> V foo(final Y<V> a)\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " public static <V extends J<? super V>> void test(final Y<V> a)\n" +
- " {\n" +
- " foo(a);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163370
-// variant
-public void test046() {
- this.runConformTest(
- new String[] {
- "X.java",
- "abstract class Y<T, U> implements I<T, U> {\n" +
- "}\n" +
- "interface I<T, U> { \n" +
- "}\n" +
- "interface J<T, U> {\n" +
- "}\n" +
- "class X {\n" +
- " public static <V extends J<V, W>, W extends J<V, W>> V foo(final I<V, W> a)\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " public static <V extends J<V, W>, W extends J<V, W>> V foo(final Y<V, W> a)\n" +
- " {\n" +
- " return null;\n" +
- " }\n" +
- " public static <V extends J<V, W>, W extends J<V, W>> void test(final Y<V, W> a)\n" +
- " {\n" +
- " foo(a);\n" +
- " }\n" +
- "}"
- },
- "");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163590
-// **
-public void test047() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T extends I & J> {\n" +
- " void foo(T t) {\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " public int method();\n" +
- "}\n" +
- "interface J {\n" +
- " public boolean method();\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T extends I & J> {\n" +
- " ^\n" +
- "The return type is incompatible with J.method(), I.method()\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163590
-// Variant: javac complains as well if we attempt to use method, but noone
-// complains upon bar or CONSTANT.
-public void test048() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X<T extends I & J> {\n" +
- " void foo(T t) {\n" +
- " t.method();\n" +
- " t.bar();\n" +
- " if (t.CONSTANT > 0);\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " public int method();\n" +
- " void bar();\n" +
- "}\n" +
- "interface J {\n" +
- " public boolean method();\n" +
- " static final int CONSTANT = 0;\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X<T extends I & J> {\n" +
- " ^\n" +
- "The return type is incompatible with J.method(), I.method()\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " t.method();\n" +
- " ^^^^^^\n" +
- "The method method() is ambiguous for the type T\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 5)\n" +
- " if (t.CONSTANT > 0);\n" +
- " ^^^^^^^^\n" +
- "The static field J.CONSTANT should be accessed in a static way\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163590
-// can't implement both interfaces though
-public void test049() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " public int method();\n" +
- "}\n" +
- "interface J {\n" +
- " public boolean method();\n" +
- "}\n" +
- "class X implements I, J {\n" +
- " public int method() {\n" +
- " return 0;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " public int method() {\n" +
- " ^^^\n" +
- "The return type is incompatible with J.method()\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163590
-// variant: secure the legal case
-public void test050() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X<T extends I & J> {\n" +
- " void foo(T t) {\n" +
- " }\n" +
- "}\n" +
- "interface I {\n" +
- " public int method();\n" +
- "}\n" +
- "interface J {\n" +
- " public int method();\n" +
- "}\n"
- },
- "");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/ArrayTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/ArrayTest.java
deleted file mode 100644
index 85b0307..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/ArrayTest.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.future.compiler.regression;
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest;
-
-import junit.framework.Test;
-
-public class ArrayTest extends AbstractRegressionTest {
-
- public ArrayTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
- }
-
- public static Class testClass() {
- return ArrayTest.class;
- }
-
-public void test001() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " int[] x= new int[] {,};\n" +
- "}\n",
- });
-}
-
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=28615
- */
-public void test002() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " public static void main(String[] args) {\n" +
- " float[] tab = new float[] {-0.0f};\n" +
- " System.out.print(tab[0]);\n" +
- " }\n" +
- "}",
- },
- "-0.0");
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=28615
- */
-public void test003() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " public static void main(String[] args) {\n" +
- " float[] tab = new float[] {0.0f};\n" +
- " System.out.print(tab[0]);\n" +
- " }\n" +
- "}",
- },
- "0.0");
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=28615
- */
-public void test004() {
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A {\n" +
- " public static void main(String[] args) {\n" +
- " int[] tab = new int[] {-0};\n" +
- " System.out.print(tab[0]);\n" +
- " }\n" +
- "}",
- },
- "0");
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=37387
- */
-//public void test005() {
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " private static final Object X[] = new Object[]{null,null};\n" +
-// " public static void main(String[] args) {\n" +
-// " System.out.println(\"SUCCESS\");\n" +
-// " }\n" +
-// "}\n",
-// },
-// "SUCCESS");
-//
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String actualOutput = null;
-// try {
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator +"X.class"));
-// actualOutput =
-// disassembler.disassemble(
-// classFileBytes,
-// "\n",
-// ClassFileBytesDisassembler.DETAILED);
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// e.printStackTrace();
-// assertTrue("ClassFormatException", false);
-// } catch (IOException e) {
-// e.printStackTrace();
-// assertTrue("IOException", false);
-// }
-//
-// String expectedOutput =
-// " static {};\n" +
-// " 0 iconst_2\n" +
-// " 1 anewarray java.lang.Object [3]\n" +
-// " 4 putstatic X.X : java.lang.Object[] [9]\n" +
-// " 7 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 2]\n" +
-// " [pc: 7, line: 1]\n";
-//
-// int index = actualOutput.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(actualOutput, 3));
-// }
-// if (index == -1) {
-// assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput);
-// }
-//}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=80597
- */
-public void test006() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " char[][][] array = new char[][][10];\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " char[][][] array = new char[][][10];\n" +
- " ^^\n" +
- "Cannot specify an array dimension after an empty dimension\n" +
- "----------\n");
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=85203
- */
-public void test007() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static long lfield;\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " lfield = args.length;\n" +
- " lfield = args(args).length;\n" +
- " \n" +
- " }\n" +
- " static String[] args(String[] args) {\n" +
- " return args;\n" +
- " }\n" +
- "}\n",
- },
- "");
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=85125
- */
-public void test008() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public String getTexts(int i) [] {\n" +
- " String[] texts = new String[1];\n" +
- " return texts; \n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-// check deep resolution of faulty initializer (no array expected type)
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=120263
-public void test009() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " X x = { 10, zork() };\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " X x = { 10, zork() };\n" +
- " ^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from int[] to X\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " X x = { 10, zork() };\n" +
- " ^^^^\n" +
- "The method zork() is undefined for the type X\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=124101
-public void test010() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " int i = {};\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int i = {};\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from Object[] to int\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148807 - variation
-//public void test011() {
-// if (new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_5) {
-// // there is a bug on 1.4 VMs which make them fail verification (see 148807)
-// return;
-// }
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " public static void main(String[] args) {\n" +
-// " try {\n" +
-// " Object[][] all = new String[1][];\n" +
-// " all[0] = new Object[0];\n" +
-// " } catch (ArrayStoreException e) {\n" +
-// " System.out.println(\"SUCCESS\");\n" +
-// " }\n" +
-// " }\n" +
-// "}", // =================
-// },
-// "SUCCESS");
-// String expectedOutput =
-// " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
-// " // Stack: 3, Locals: 2\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 iconst_1\n" +
-// " 1 anewarray java.lang.String[] [16]\n" +
-// " 4 astore_1 [all]\n" +
-// " 5 aload_1 [all]\n" +
-// " 6 iconst_0\n" +
-// " 7 iconst_0\n" +
-// " 8 anewarray java.lang.Object [3]\n" +
-// " 11 aastore\n" +
-// " 12 goto 24\n" +
-// " 15 astore_1 [e]\n" +
-// " 16 getstatic java.lang.System.out : java.io.PrintStream [18]\n" +
-// " 19 ldc <String \"SUCCESS\"> [24]\n" +
-// " 21 invokevirtual java.io.PrintStream.println(java.lang.String) : void [26]\n" +
-// " 24 return\n" +
-// " Exception Table:\n" +
-// " [pc: 0, pc: 12] -> 15 when : java.lang.ArrayStoreException\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 4]\n" +
-// " [pc: 5, line: 5]\n" +
-// " [pc: 15, line: 6]\n" +
-// " [pc: 16, line: 7]\n" +
-// " [pc: 24, line: 9]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 25] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 5, pc: 15] local: all index: 1 type: java.lang.Object[][]\n" +
-// " [pc: 16, pc: 24] local: e index: 1 type: java.lang.ArrayStoreException\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-//}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148807 - variation
-//public void test012() {
-// if (new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_5) {
-// // there is a bug on 1.4 VMs which make them fail verification (see 148807)
-// return;
-// }
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "import java.util.Map;\n" +
-// "\n" +
-// "public class X {\n" +
-// " Map fValueMap;\n" +
-// "\n" +
-// " public static void main(String[] args) {\n" +
-// " System.out.println(\"SUCCESS\");\n" +
-// " }\n" +
-// " public Object[][] getAllChoices() {\n" +
-// " Object[][] all = new String[this.fValueMap.size()][];\n" +
-// " return all;\n" +
-// " }\n" +
-// "}", // =================,
-// },
-// "SUCCESS");
-// String expectedOutput =
-// " // Method descriptor #35 ()[[Ljava/lang/Object;\n" +
-// " // Stack: 1, Locals: 2\n" +
-// " public java.lang.Object[][] getAllChoices();\n" +
-// " 0 aload_0 [this]\n" +
-// " 1 getfield X.fValueMap : java.util.Map [36]\n" +
-// " 4 invokeinterface java.util.Map.size() : int [38] [nargs: 1]\n" +
-// " 9 anewarray java.lang.String[] [44]\n" +
-// " 12 astore_1 [all]\n" +
-// " 13 aload_1 [all]\n" +
-// " 14 areturn\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 10]\n" +
-// " [pc: 13, line: 11]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 15] local: this index: 0 type: X\n" +
-// " [pc: 13, pc: 15] local: all index: 1 type: java.lang.Object[][]\n";
-//
-//try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-//} catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-//} catch (IOException e) {
-// assertTrue(false);
-//}
-//}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/BooleanTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/BooleanTest.java
deleted file mode 100644
index 6eb6870..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/BooleanTest.java
+++ /dev/null
@@ -1,1151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.future.compiler.regression;
-
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest;
-
-import junit.framework.Test;
-
-public class BooleanTest extends AbstractRegressionTest {
-
-public BooleanTest(String name) {
- super(name);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(testClass());
-}
-
-public void test001() {
- this.runConformTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public Object getAccessibleSelection(int i) {\n" +
- " int c, d;\n" +
- " if ((this == null) || ((d = 4) > 0)) {\n" +
- " c = 2;\n" +
- " }\n" +
- " else {\n" +
- " if (this == null) {\n" +
- " c = 3;\n" +
- " i++;\n" +
- " }\n" +
- " i++;\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- " public String getAccessibleSelection2(int i) {\n" +
- " int c, d;\n" +
- " return ((this == null) || ((d = 4) > 0))\n" +
- " ? String.valueOf(c = 2)\n" +
- " : String.valueOf(i++); \n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test002() {
- this.runConformTest(new String[] {
- "p/H.java",
- "package p;\n" +
- "public class H {\n" +
- " Thread fPeriodicSaveThread;\n" +
- " public void bar() {\n" +
- " int a = 0, b = 0;\n" +
- " if (a == 0 || (b = 2) == 2) {\n" +
- " //a = 1;\n" +
- " }\n" +
- " System.out.println(b);\n" +
- " if (b != 0) {\n" +
- " System.err.println(\"<bar>b should be equal to 0.\");\n" +
- " System.exit(-1);\n" +
- " }\n" +
- " }\n" +
- " public void bar2() {\n" +
- " int a = 0, b = 0;\n" +
- " if (a == 1 && (b = 2) == 2) {\n" +
- " //a = 1;\n" +
- " }\n" +
- " System.out.println(b);\n" +
- " if (b != 0) {\n" +
- " System.err.println(\"<bar2>b should be equal to 0.\");\n" +
- " System.exit(-1);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new H().bar();\n" +
- " new H().bar2();\n" +
- " }\n" +
- "}\n",
- });
-}
-public void test003() {
- this.runConformTest(new String[] {
- "p/I.java",
- "package p;\n" +
- "/**\n" +
- " * This test0 should run without producing a java.lang.ClassFormatError\n" +
- " */\n" +
- "public class I {\n" +
- " public static void main(String[] args) {\n" +
- " int i = 1, j;\n" +
- " if (((i > 0) || ((j = 10) > j--)) && (i < 12)) {\n" +
- " System.out.println(i);\n" +
- " }\n" +
- " }\n" +
- " public static void main1(String[] args) {\n" +
- " int i = 1, j;\n" +
- " if (((i < 12) && ((j = 10) > j--)) || (i > 0)) {\n" +
- " System.out.println(i);\n" +
- " }\n" +
- " }\n" +
- " public static void main2(String[] args) {\n" +
- " int i = 1, j;\n" +
- " if (((i < 12) && ((j = 10) > j--)) && (i > 0)) {\n" +
- " System.out.println(i);\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-public void test004() {
- this.runConformTest(new String[] {
- "p/J.java",
- "package p;\n" +
- "/**\n" +
- " * This test0 should run without producing a java.lang.ClassFormatError\n" +
- " */\n" +
- "public class J {\n" +
- " public static void main(String[] args) {\n" +
- " int i = 1, j;\n" +
- " if (((i > 0) || ((j = 10) > j--)) && (i < 12)) {\n" +
- " System.out.println(i);\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test005() {
- this.runConformTest(new String[] {
- "p/M.java",
- "package p;\n" +
- "public class M {\n" +
- " public static void main(String[] args) {\n" +
- " int a = 0, b = 0;\n" +
- " if (a == 0 || (b = 2) == 2) {\n" +
- " }\n" +
- " if (b != 0) {\n" +
- " System.out.println(\"b should be equal to zero\");\n" +
- " System.exit(-1);\n" +
- " }\n" +
- " }\n" +
- "}\n",
- });
-}
-
-public void test006() {
- this.runConformTest(new String[] {
- "p/Q.java",
- "package p;\n" +
- "/**\n" +
- " * This test0 should run without producing a java.lang.VerifyError\n" +
- " */\n" +
- "public class Q {\n" +
- " boolean bar() {\n" +
- " if (false && foo()) {\n" +
- " return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- " boolean foo() {\n" +
- " return true;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " new Q().bar();\n" +
- " }\n" +
- "}\n",
- });
-}
-
-// Bug 6596
-public void test007() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " Object t;\n" +
- " public static void main(String args[]) {\n" +
- " new Test().testMethod();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " private void testMethod(){\n" +
- " boolean a = false;\n" +
- " boolean b = false;\n" +
- " if (!(a&&b)){}\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-// Bug 6596
-public void test008() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " Object t;\n" +
- " public static void main(String args[]) {\n" +
- " new Test().testMethod();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " private void testMethod(){\n" +
- " boolean a = false;\n" +
- " boolean b = false;\n" +
- " if (!(a||b)){}\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-// Bug 6596
-public void test009() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " Object t;\n" +
- " public static void main(String args[]) {\n" +
- " new Test().testMethod();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " private void testMethod(){\n" +
- " final boolean a = false;\n" +
- " boolean b = false;\n" +
- " if (!(a&&b)){}\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-
-// Bug 6596
-public void test010() {
- this.runConformTest(
- new String[] {
- "Test.java",
- "public class Test {\n" +
- " Object t;\n" +
- " public static void main(String args[]) {\n" +
- " new Test().testMethod();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " private void testMethod(){\n" +
- " boolean a = false;\n" +
- " boolean b = false;\n" +
- " if (a == b){}\n" +
- " }\n" +
- "}\n",
- },
- "SUCCESS");
-}
-
-// Bug 46675
-public void test011() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String s = null;\n" +
- " boolean b = s != null && (s.length() == 0 ? TestConst.c1 : TestConst.c2);\n" +
- " if (!b) System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "\n" +
- " public static class TestConst {\n" +
- " public static final boolean c1 = true;\n" +
- " public static final boolean c2 = true;\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-
-// Bug 46675 - variation
-public void test012() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"aaa\";\n" +
- " boolean b = s != null && (s.length() == 0 ? TestConst.c1 : TestConst.c2);\n" +
- " if (b) System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "\n" +
- " public static class TestConst {\n" +
- " public static final boolean c1 = true;\n" +
- " public static final boolean c2 = true;\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-
-// Bug 46675 - variation
-public void test013() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " String s = \"aaa\";\n" +
- " boolean b = s == null || (s.length() == 0 ? TestConst.c1 : TestConst.c2);\n" +
- " if (!b) System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "\n" +
- " public static class TestConst {\n" +
- " public static final boolean c1 = false;\n" +
- " public static final boolean c2 = false;\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-
-// Bug 47881
-public void test014() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " boolean b = true;\n" +
- " b = b && false; \n" +
- " if (b) {\n" +
- " System.out.println(\"FAILED\");\n" +
- " } else {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n",
- },
- "SUCCESS");
-}
-
-// Bug 47881 - variation
-public void test015() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " boolean b = true;\n" +
- " b = b || true; \n" +
- " if (b) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " } else {\n" +
- " System.out.println(\"FAILED\");\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n",
- },
- "SUCCESS");
-}
-// Bug 47881 - variation
-public void test016() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " boolean b = false;\n" +
- " b = b && true; \n" +
- " if (b) {\n" +
- " System.out.println(\"FAILED\");\n" +
- " } else {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n",
- },
- "SUCCESS");
-}
-
-// Bug 47881 - variation
-public void test017() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String args[]) {\n" +
- " boolean b = true;\n" +
- " b = b || false; \n" +
- " if (b) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " } else {\n" +
- " System.out.println(\"FAILED\");\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n",
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120
-public void test018() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0++) || true) != ((true && true) && (!(false || true)))));\n" +
- " }\n" +
- "}\n",
- },
- "true");
-// // ensure optimized boolean codegen sequence
-// String expectedOutput =
-// " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
-// " // Stack: 3, Locals: 3\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 ldc2_w <Long -26> [18]\n" +
-// " 3 lstore_1 [l11]\n" +
-// " 4 getstatic java.lang.System.out : java.io.PrintStream [20]\n" +
-// " 7 getstatic X.f0 : float [26]\n" +
-// " 10 fconst_1\n" +
-// " 11 fadd\n" +
-// " 12 putstatic X.f0 : float [26]\n" +
-// " 15 iconst_1\n" +
-// " 16 invokevirtual java.io.PrintStream.println(boolean) : void [28]\n" +
-// " 19 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 6]\n" +
-// " [pc: 4, line: 8]\n" +
-// " [pc: 7, line: 9]\n" +
-// " [pc: 16, line: 8]\n" +
-// " [pc: 19, line: 10]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 20] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 4, pc: 20] local: l11 index: 1 type: long\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test019() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0++) || false) != true));\n" +
- " }\n" +
- "}\n",
- },
- "false");
- // ensure optimized boolean codegen sequence
-// String expectedOutput =
-// " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
-// " // Stack: 5, Locals: 3\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 ldc2_w <Long -26> [18]\n" +
-// " 3 lstore_1 [l11]\n" +
-// " 4 getstatic java.lang.System.out : java.io.PrintStream [20]\n" +
-// " 7 lload_1 [l11]\n" +
-// " 8 l2f\n" +
-// " 9 getstatic X.f0 : float [26]\n" +
-// " 12 dup\n" +
-// " 13 fconst_1\n" +
-// " 14 fadd\n" +
-// " 15 putstatic X.f0 : float [26]\n" +
-// " 18 fcmpg\n" +
-// " 19 ifge 26\n" +
-// " 22 iconst_0\n" +
-// " 23 goto 27\n" +
-// " 26 iconst_1\n" +
-// " 27 invokevirtual java.io.PrintStream.println(boolean) : void [28]\n" +
-// " 30 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 6]\n" +
-// " [pc: 4, line: 8]\n" +
-// " [pc: 7, line: 9]\n" +
-// " [pc: 27, line: 8]\n" +
-// " [pc: 30, line: 10]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 31] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 4, pc: 31] local: l11 index: 1 type: long\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test020() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0) | true) != false));\n" +
- " }\n" +
- "}\n",
- },
- "true");
-// // ensure optimized boolean codegen sequence
-// String expectedOutput =
-// " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
-// " // Stack: 2, Locals: 3\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 ldc2_w <Long -26> [18]\n" +
-// " 3 lstore_1 [l11]\n" +
-// " 4 getstatic java.lang.System.out : java.io.PrintStream [20]\n" +
-// " 7 iconst_1\n" +
-// " 8 invokevirtual java.io.PrintStream.println(boolean) : void [26]\n" +
-// " 11 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 6]\n" +
-// " [pc: 4, line: 8]\n" +
-// " [pc: 7, line: 9]\n" +
-// " [pc: 8, line: 8]\n" +
-// " [pc: 11, line: 10]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 12] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 4, pc: 12] local: l11 index: 1 type: long\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test021() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0) && false) != true));\n" +
- " }\n" +
- "}\n",
- },
- "true");
-// // ensure optimized boolean codegen sequence
-// String expectedOutput =
-// " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
-// " // Stack: 2, Locals: 3\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 ldc2_w <Long -26> [18]\n" +
-// " 3 lstore_1 [l11]\n" +
-// " 4 getstatic java.lang.System.out : java.io.PrintStream [20]\n" +
-// " 7 iconst_1\n" +
-// " 8 invokevirtual java.io.PrintStream.println(boolean) : void [26]\n" +
-// " 11 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 6]\n" +
-// " [pc: 4, line: 8]\n" +
-// " [pc: 7, line: 9]\n" +
-// " [pc: 8, line: 8]\n" +
-// " [pc: 11, line: 10]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 12] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 4, pc: 12] local: l11 index: 1 type: long\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test022() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0) & false) != true));\n" +
- " }\n" +
- "}\n",
- },
- "true");
-// // ensure optimized boolean codegen sequence
-// String expectedOutput =
-// " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
-// " // Stack: 2, Locals: 3\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 ldc2_w <Long -26> [18]\n" +
-// " 3 lstore_1 [l11]\n" +
-// " 4 getstatic java.lang.System.out : java.io.PrintStream [20]\n" +
-// " 7 iconst_1\n" +
-// " 8 invokevirtual java.io.PrintStream.println(boolean) : void [26]\n" +
-// " 11 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 6]\n" +
-// " [pc: 4, line: 8]\n" +
-// " [pc: 7, line: 9]\n" +
-// " [pc: 8, line: 8]\n" +
-// " [pc: 11, line: 10]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 12] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 4, pc: 12] local: l11 index: 1 type: long\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120
-public void test023() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0++) || true) == ((true && true) && (!(false || true)))));\n" +
- " }\n" +
- "}\n",
- },
- "false");
-// // ensure optimized boolean codegen sequence
-// String expectedOutput =
-// " // Method descriptor #17 ([Ljava/lang/String;)V\n" +
-// " // Stack: 3, Locals: 3\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 ldc2_w <Long -26> [18]\n" +
-// " 3 lstore_1 [l11]\n" +
-// " 4 getstatic java.lang.System.out : java.io.PrintStream [20]\n" +
-// " 7 getstatic X.f0 : float [26]\n" +
-// " 10 fconst_1\n" +
-// " 11 fadd\n" +
-// " 12 putstatic X.f0 : float [26]\n" +
-// " 15 iconst_0\n" +
-// " 16 invokevirtual java.io.PrintStream.println(boolean) : void [28]\n" +
-// " 19 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 6]\n" +
-// " [pc: 4, line: 8]\n" +
-// " [pc: 7, line: 9]\n" +
-// " [pc: 16, line: 8]\n" +
-// " [pc: 19, line: 10]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 20] local: args index: 0 type: java.lang.String[]\n" +
-// " [pc: 4, pc: 20] local: l11 index: 1 type: long\n";
-//
-// try {
-// File f = new File(OUTPUT_DIR + File.separator + "X.class");
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(f);
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
-// int index = result.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(result, 3));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, result);
-// }
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue(false);
-// } catch (IOException e) {
-// assertTrue(false);
-// }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test024() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0++) || false) == true));\n" +
- " }\n" +
- "}\n",
- },
- "true");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test025() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0) | true) == false));\n" +
- " }\n" +
- "}\n",
- },
- "false");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test026() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0) && false) == true));\n" +
- " }\n" +
- "}\n",
- },
- "false");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test027() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0) & false) == true));\n" +
- " }\n" +
- "}\n",
- },
- "false");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test028() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0) || true) == false));\n" +
- " }\n" +
- "}\n",
- },
- "false");
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test029() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " System.out.println(\n" +
- " ((foo() || bar()) || true) && false); \n" +
- " }\n" +
- " static boolean foo(){ \n" +
- " System.out.print(\"foo\");\n" +
- " return false;\n" +
- " }\n" +
- " static boolean bar(){\n" +
- " System.out.print(\"bar\");\n" +
- " return true;\n" +
- " }\n" +
- "}\n",
- },
- "foobarfalse");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117120 - variation
-public void test030() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static float f0;\n" +
- " \n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " \n" +
- " System.out.println(\n" +
- " (((l11 < f0++) || true) == ((foo() || bar()) || true)));\n" +
- " }\n" +
- " static boolean foo() {\n" +
- " System.out.print(\"foo\");\n" +
- " return false;\n" +
- " }\n" +
- " static boolean bar() {\n" +
- " System.out.print(\"bar\");\n" +
- " return true;\n" +
- " }\n" +
- "}\n",
- },
- "foobartrue");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117451
-public void test031() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public float f0;\n" +
- "\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " X x = new X();\n" +
- " System.out.println(\n" +
- " (((l11 < x.f0) || true) != false));\n" +
- " }\n" +
- "}\n",
- },
- "true");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117451 - variation
-public void test032() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static float f0;\n" +
- "\n" +
- " public static void main(String[] args)\n" +
- " {\n" +
- " long l11 = -26;\n" +
- " System.out.println(\n" +
- " (((l11 < (f0=13)) || true) != false));\n" +
- " }\n" +
- "}\n",
- },
- "true");
-}
-
-public void test033() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " boolean b = true;\n" +
- " System.out.print(b ^ b);\n" +
- " System.out.println(b ^ true);\n" +
- " } \n" +
- "}\n",
- },
- "falsefalse");
-}
-public void test034() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " boolean b = true;\n" +
- " if ((b ^ true) || b) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " } \n" +
- "}\n",
- },
- "SUCCESS");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117451 - variation
-public void test035() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static float f0;\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println((X.f0 > 0 || true) == false);\n" +
- " } \n" +
- "}\n",
- },
- "false");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117451 - variation
-public void test036() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " float f0;\n" +
- " public static void main(String[] args) {\n" +
- " new X().foo();\n" +
- " }\n" +
- " void foo() {\n" +
- " System.out.println((this.f0 > 0 || true) == false);\n" +
- " } \n" +
- "}\n",
- },
- "false");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=147024
-public void test037() {
- this.runConformTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " public static final boolean T = true;\n" +
- " public static final boolean F = false;\n" +
- " \n" +
- " public boolean getFlagBT() {\n" +
- " boolean b = this.T;\n" +
- " if (this.T)\n" +
- " return true;\n" +
- " else\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " public int getFlagIT() {\n" +
- " boolean b = this.T;\n" +
- " if (this.T)\n" +
- " return 0;\n" +
- " else\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " public boolean getFlagBF() {\n" +
- " boolean b = this.F;\n" +
- " if (this.F)\n" +
- " return true;\n" +
- " else\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " public int getFlagIF() {\n" +
- " boolean b = this.F;\n" +
- " if (this.F)\n" +
- " return 0;\n" +
- " else\n" +
- " return 1;\n" +
- " }\n" +
- " public boolean getFlagBT2() {\n" +
- " boolean b = T;\n" +
- " if (T)\n" +
- " return true;\n" +
- " else\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " public int getFlagIT2() {\n" +
- " boolean b = T;\n" +
- " if (T)\n" +
- " return 0;\n" +
- " else\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " public boolean getFlagBF2() {\n" +
- " boolean b = F;\n" +
- " if (F)\n" +
- " return true;\n" +
- " else\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " public int getFlagIF2() {\n" +
- " boolean b = F;\n" +
- " if (F)\n" +
- " return 0;\n" +
- " else\n" +
- " return 1;\n" +
- " }\n" +
- " public boolean getFlagBT3() {\n" +
- " X self = this;\n" +
- " boolean b = self.T;\n" +
- " if (self.T)\n" +
- " return true;\n" +
- " else\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " public int getFlagIT3() {\n" +
- " X self = this;\n" +
- " boolean b = self.T;\n" +
- " if (self.T)\n" +
- " return 0;\n" +
- " else\n" +
- " return 1;\n" +
- " }\n" +
- "\n" +
- " public boolean getFlagBF3() {\n" +
- " X self = this;\n" +
- " boolean b = self.F;\n" +
- " if (self.F)\n" +
- " return true;\n" +
- " else\n" +
- " return false;\n" +
- " }\n" +
- " public int getFlagIF3() {\n" +
- " X self = this;\n" +
- " boolean b = self.F;\n" +
- " if (self.F)\n" +
- " return 0;\n" +
- " else\n" +
- " return 1;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"It worked.\");\n" +
- " }\n" +
- "}", // =================
- },
- "It worked.");
- // ensure optimized boolean codegen sequence
-}
-public void test038() {
- this.runConformTest(
- new String[] {
- "X.java",
- " public class X {\n" +
- " static boolean foo() { System.out.print(\"[foo]\"); return false; }\n" +
- " static boolean bar() { System.out.print(\"[bar]\"); return true; }\n" +
- " public static void main(String[] args) {\n" +
- " if ((foo() || bar()) && false) {\n" +
- " return;\n" +
- " }\n" +
- " System.out.println(\"[done]\");\n" +
- " }\n" +
- "}", // =================
- },
- "[foo][bar][done]");
-}
-
-public static Class testClass() {
- return BooleanTest.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_4.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_4.java
deleted file mode 100644
index 5002177..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_4.java
+++ /dev/null
@@ -1,3431 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.future.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class Compliance_1_4 extends AbstractRegressionTest {
-boolean docSupport = false;
-
-public Compliance_1_4(String name) {
- super(name);
-}
-
-/*
- * Toggle compiler in mode -1.4
- */
-protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- if (docSupport) {
- options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
- }
- return options;
-}
-public static Test suite() {
- return buildUniqueComplianceTestSuite(testClass(), COMPLIANCE_1_4);
-}
-public static Class testClass() {
- return Compliance_1_4.class;
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which does not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "Bug58069" };
-// TESTS_NUMBERS = new int[] { 104 };
-// TESTS_RANGE = new int[] { 85, -1 };
-}
-/* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- // Javadoc disabled by default
- docSupport = false;
-}
-
-// test001 - moved to SuperTypeTest#test002
-// test002 - moved to SuperTypeTest#test003
-// test003 - moved to SuperTypeTest#test004
-// test004 - moved to SuperTypeTest#test005
-// test005 - moved to SuperTypeTest#test006
-// test006 - moved to SuperTypeTest#test007
-// test007 - moved to TryStatementTest#test057
-// test008 - moved to LookupTest#test074
-// test009 - moved to RuntimeTests#test1004
-
-// check actualReceiverType when array type
-public void test010() {
- this.runConformTest(
- new String[] {
- "p1/Z.java",
- "package p1; \n"+
- "public class Z { \n" +
- " public static void main(String[] arguments) { \n"+
- " String[] s = new String[]{\"SUCCESS\" }; \n" +
- " System.out.print(s.length); \n" +
- " System.out.print(((String[])s.clone())[0]); \n" +
- " } \n"+
- "} \n"
- },
- "1SUCCESS");
-}
-// test unreachable code complaints
-public void test011() {
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " void foo() { \n"+
- " while (false); \n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " do ; while (false); \n" +
- " do System.out.println(\"unreachable\"); while (false); \n" +
- " for (;false;); \n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " if (false); \n" +
- " if (false)System.out.println(\"unreachable\"); \n" +
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 5)\n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in p1\\X.java (at line 8)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in p1\\X.java (at line 9)\n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n"
- );
-}
-// binary compatibility
-public void test012() {
- this.runConformTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n" +
- "class Store { \n" +
- " String value; \n" +
- " Store(String value){ \n" +
- " this.value = value; \n" +
- " } \n" +
- "} \n" +
- "class Top { \n" +
- " static String bar = \"Top.bar\"; \n" +
- " String foo = \"Top.foo\"; \n" +
- " Store store = new Store(\"Top.store\"); \n" +
- " static Store sstore = new Store(\"Top.sstore\"); \n" +
- " static Top ss = new Top(); \n" +
- "} \n" +
- "public class Y extends Updated { \n" +
- " public static void main(String[] arguments) { \n" +
- " new Y().test(); \n" +
- " } \n" +
- " void test() { \n" +
- " System.out.print(\"*** FIELD ACCESS ***\"); \n" +
- " System.out.print(\"*1* new Updated().bar: \" + new Updated().bar); \n" +
- " System.out.print(\"*2* new Updated().foo: \" + new Updated().foo); \n" +
- " System.out.print(\"*3* new Y().foo: \" + new Y().foo); \n" +
- " System.out.print(\"*4* new Y().bar: \" + new Y().bar); \n" +
- " System.out.print(\"*5* bar: \" + bar); \n" +
- " System.out.print(\"*6* foo: \" + foo); \n" +
- " System.out.print(\"*7* Y.bar: \" + Y.bar); \n" +
- " System.out.print(\"*8* this.bar: \" + this.bar); \n" +
- " System.out.print(\"*9* this.foo: \" + this.foo); \n" +
- " System.out.print(\"*10* store.value: \" + store.value); \n" +
- " System.out.print(\"*11* sstore.value: \" + sstore.value); \n" +
- " System.out.print(\"*12* ss.sstore.value: \" + ss.sstore.value); \n" +
- " } \n" +
- "} \n",
- "p1/Updated.java",
- "package p1; \n" +
- "public class Updated extends Top { \n" +
- "} \n"
- },
- "*** FIELD ACCESS ***"
- +"*1* new Updated().bar: Top.bar"
- +"*2* new Updated().foo: Top.foo"
- +"*3* new Y().foo: Top.foo"
- +"*4* new Y().bar: Top.bar"
- +"*5* bar: Top.bar"
- +"*6* foo: Top.foo"
- +"*7* Y.bar: Top.bar"
- +"*8* this.bar: Top.bar"
- +"*9* this.foo: Top.foo"
- +"*10* store.value: Top.store"
- +"*11* sstore.value: Top.sstore"
- +"*12* ss.sstore.value: Top.sstore");
-
- this.runConformTest(
- new String[] {
- "p1/Updated.java",
- "package p1; \n"+
- "public class Updated extends Top { \n"+
- " public static void main(String[] arguments) { \n"+
- " Y.main(arguments); \n" +
- " } \n" +
- " static String bar = \"Updated.bar\"; \n" +
- " String foo = \"Updated.foo\"; \n" +
- " Store store = new Store(\"Updated.store\"); \n" +
- " static Store sstore = new Store(\"Updated.sstore\"); \n" +
- " static Updated ss = new Updated(); \n" +
- "} \n"
- },
- "*** FIELD ACCESS ***"
- +"*1* new Updated().bar: Updated.bar"
- +"*2* new Updated().foo: Updated.foo"
- +"*3* new Y().foo: Updated.foo"
- +"*4* new Y().bar: Updated.bar"
- +"*5* bar: Updated.bar"
- +"*6* foo: Updated.foo"
- +"*7* Y.bar: Updated.bar"
- +"*8* this.bar: Updated.bar"
- +"*9* this.foo: Updated.foo"
- +"*10* store.value: Updated.store"
- +"*11* sstore.value: Updated.sstore"
- +"*12* ss.sstore.value: Top.sstore",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-// binary compatibility
-public void test013() {
- this.runConformTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n" +
- "class Store { \n" +
- " String value; \n" +
- " Store(String value){ \n" +
- " this.value = value; \n" +
- " } \n" +
- "} \n" +
- "class Top { \n" +
- " static String bar() { return \"Top.bar()\"; } \n" +
- " String foo() { return \"Top.foo()\"; } \n" +
- "} \n" +
- "public class Y extends Updated { \n" +
- " public static void main(String[] arguments) { \n" +
- " new Y().test(); \n" +
- " } \n" +
- " void test() { \n" +
- " System.out.print(\"*** METHOD ACCESS ***\"); \n" +
- " System.out.print(\"*1* new Updated().bar(): \" + new Updated().bar()); \n" +
- " System.out.print(\"*2* new Updated().foo(): \" + new Updated().foo()); \n" +
- " System.out.print(\"*3* new Y().foo(): \" + new Y().foo()); \n" +
- " System.out.print(\"*4* new Y().bar(): \" + new Y().bar()); \n" +
- " System.out.print(\"*5* bar(): \" + bar()); \n" +
- " System.out.print(\"*6* foo(): \" + foo()); \n" +
- " System.out.print(\"*7* Y.bar(): \" + Y.bar()); \n" +
- " System.out.print(\"*8* this.bar(): \" + this.bar()); \n" +
- " System.out.print(\"*9* this.foo(): \" + this.foo()); \n" +
- " } \n" +
- "} \n",
- "p1/Updated.java",
- "package p1; \n" +
- "public class Updated extends Top { \n" +
- "} \n"
- },
- "*** METHOD ACCESS ***"
- +"*1* new Updated().bar(): Top.bar()"
- +"*2* new Updated().foo(): Top.foo()"
- +"*3* new Y().foo(): Top.foo()"
- +"*4* new Y().bar(): Top.bar()"
- +"*5* bar(): Top.bar()"
- +"*6* foo(): Top.foo()"
- +"*7* Y.bar(): Top.bar()"
- +"*8* this.bar(): Top.bar()"
- +"*9* this.foo(): Top.foo()");
-
- this.runConformTest(
- new String[] {
- "p1/Updated.java",
- "package p1; \n"+
- "public class Updated extends Top { \n"+
- " public static void main(String[] arguments) { \n"+
- " Y.main(arguments); \n" +
- " } \n" +
- " static String bar() { return \"Updated.bar()\"; } \n" +
- " String foo() { return \"Updated.foo()\"; } \n" +
- "} \n"
- },
- "*** METHOD ACCESS ***"
- +"*1* new Updated().bar(): Updated.bar()"
- +"*2* new Updated().foo(): Updated.foo()"
- +"*3* new Y().foo(): Updated.foo()"
- +"*4* new Y().bar(): Updated.bar()"
- +"*5* bar(): Updated.bar()"
- +"*6* foo(): Updated.foo()"
- +"*7* Y.bar(): Updated.bar()"
- +"*8* this.bar(): Updated.bar()"
- +"*9* this.foo(): Updated.foo()",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-
-public void test014() {
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n" +
- "class T { \n" +
- " void foo(boolean b) { \n" +
- " System.out.print(\"T.foo(boolean)#\"); \n" +
- " } \n" +
- " boolean bar = false; \n" +
- " class Member { \n" +
- " void display(){ System.out.print(\"T.Member#\"); } \n" +
- " } \n" +
- "} \n" +
- "public class X { \n" +
- " void foo(int i) { \n" +
- " System.out.println(\"X.foo(int)#\"); \n" +
- " } \n" +
- " int bar; \n" +
- " class Member { \n" +
- " void display(){ System.out.print(\"X.Member#\"); } \n" +
- " } \n" +
- " public static void main(String[] arguments) { \n" +
- " new X().bar(); \n" +
- " } \n" +
- " void bar() { \n" +
- " new T() { \n" +
- " { \n" +
- " foo(true); \n" +
- " System.out.print((boolean)bar + \"#\"); \n" +
- " Member m = new Member(); \n" +
- " m.display(); \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n"
- },
- "T.foo(boolean)#false#T.Member#");
-}
-
-/*
- * check handling of default abstract methods
- */
-public void test015() {
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " C c = new C() { \n"+
- " public void doSomething(){ \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " }; \n"+
- " c.doSomething(); \n"+
- " } \n"+
- "} \n"+
- "interface I { \n"+
- " void doSomething(); \n"+
- "} \n"+
- "abstract class C implements I { \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-public void test016() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(boolean b) {} \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " foo(0); \n" +
- " ^^^\n" +
- "The method foo(boolean) in the type T is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-
-public void test017() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(boolean b) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(false); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-public void test018() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(int j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-public void test019() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(int j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "class U { \n"+
- " void foo(int j) { System.out.println(\"FAILED\"); } \n"+
- "} \n"+
- "public class X extends U { \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-public void test020() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(int j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "class U { \n"+
- " void foo(boolean j) { System.out.println(\"FAILED\"); } \n"+
- "} \n"+
- "public class X extends U { \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-public void test020a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(U j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "class U { \n"+
- "} \n"+
- "public class X extends U { \n"+
- " void foo(X j) { System.out.println(\"FAILED\"); } \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(new X()); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-// binary check for 11511
-public void test021() {
- this.runConformTest(
- new String[] {
- "p1/Z.java",
- "package p1; \n" +
- "public class Z extends AbstractA { \n" +
- " public static void main(String[] arguments) { \n" +
- " new Z().init(); \n" +
- " } \n" +
- "} \n" +
- "abstract class AbstractB implements K { \n" +
- " public void init() { \n" +
- " System.out.println(\"AbstractB.init()\"); \n" +
- " } \n" +
- "} \n" +
- "interface K { \n" +
- " void init(); \n" +
- " void init(int i); \n" +
- "} \n",
- "p1/AbstractA.java",
- "package p1; \n" +
- "public abstract class AbstractA extends AbstractB implements K { \n" +
- " public void init(int i) { \n" +
- " } \n" +
- "} \n"
- },
- "AbstractB.init()"); // no special vm args
-
- // check that "new Z().init()" is bound to "Z.init()"
- String computedReferences = findReferences(OUTPUT_DIR + "/p1/Z.class");
- boolean check =
- computedReferences.indexOf("constructorRef/Z/0") >= 0
- && computedReferences.indexOf("methodRef/init/0") >= 0;
- if (!check){
- System.out.println(computedReferences);
- }
- assertTrue("did not bind 'new Z().init()' to Z.init()'", check);
-}
- /*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis
- */
-public void test022() {
-
- this.runNegativeTest(
- new String[] {
- "p1/T.java",
- "package p1; \n"+
- "interface II {} \n"+
- "class TT { \n"+
- " void foo(boolean b) {} \n"+
- " void foo(int i, boolean b) {} \n"+
- " void foo(String s) {} \n"+
- "} \n"+
- "public abstract class T implements II { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(0); // should say that foo(int, boolean) isn't applicable \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void boo() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(true); // should not complain about ambiguity \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\T.java (at line 13)\n" +
- " foo(0); // should say that foo(int, boolean) isn\'t applicable \n" +
- " ^^^\n" +
- "The method foo(int, boolean) in the type TT is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-
- /*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis
- */
-public void test023() {
-
- this.runNegativeTest(
- new String[] {
- "p1/T.java",
- "package p1; \n"+
- "interface II {} \n"+
- "abstract class TT { \n"+ // 259+ABSTRACT
- " void foo(boolean b) {} \n"+
- " void foo(int i, boolean b) {} \n"+
- " void foo(String s) {} \n"+
- "} \n"+
- "public abstract class T implements II { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(0); // should say that foo(int, boolean) isn't applicable \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void boo() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(true); // should complain ambiguity \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\T.java (at line 13)\n" +
- " foo(0); // should say that foo(int, boolean) isn\'t applicable \n" +
- " ^^^\n" +
- "The method foo(int, boolean) in the type TT is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis
- */
-public void test024() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "interface II {} \n"+
- "abstract class T implements II { \n"+
- " void foo(boolean b) {} \n"+
- " void foo(int i, boolean b) {} \n"+
- "} \n"+
- "abstract class TT implements II { \n"+
- " void foo(boolean b) {} \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); // javac says foo cannot be resolved because of multiple matches \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void bar2() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(0); // should say that foo(boolean) isn't applicable \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void boo() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(true); // should complain ambiguity \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 15)\n" +
- " foo(0); // javac says foo cannot be resolved because of multiple matches \n" +
- " ^^^\n" +
- "The method foo(int, boolean) in the type T is not applicable for the arguments (int)\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 22)\n" +
- " foo(0); // should say that foo(boolean) isn\'t applicable \n" +
- " ^^^\n" +
- "The method foo(boolean) in the type TT is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis (no matter if super is abstract or not)
- */
-public void test025() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X extends AbstractY { \n"+
- " void bar(){ \n"+
- " init(\"hello\"); \n"+
- " } \n"+
- "} \n"+
- "abstract class AbstractY implements I { \n"+
- "} \n"+
- "interface I { \n"+
- " void init(String s, int i); \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 2)\n" +
- " public class X extends AbstractY { \n" +
- " ^\n" +
- "The type X must implement the inherited abstract method I.init(String, int)\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 4)\n" +
- " init(\"hello\"); \n" +
- " ^^^^\n" +
- "The method init(String, int) in the type I is not applicable for the arguments (String)\n" +
- "----------\n");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis (no matter if super is abstract or not)
- */
-public void test026() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X extends AbstractY { \n"+
- " void bar(){ \n"+
- " init(\"hello\"); \n"+
- " } \n"+
- "} \n"+
- "class AbstractY implements I { \n"+
- "} \n"+
- "interface I { \n"+
- " void init(String s, int i); \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " init(\"hello\"); \n" +
- " ^^^^\n" +
- "The method init(String, int) in the type I is not applicable for the arguments (String)\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 7)\n" +
- " class AbstractY implements I { \n" +
- " ^^^^^^^^^\n" +
- "The type AbstractY must implement the inherited abstract method I.init(String, int)\n" +
- "----------\n"
-);
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11922
- * should report unreachable empty statement
- */
-public void test027() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " for (;false;p()); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " static void p(){ \n"+
- " System.out.println(\"FAILED\"); \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " for (;false;p()); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=12445
- * should report unreachable empty statement
- */
-public void test028() {
-
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n" +
- "interface FooInterface { \n" +
- " public boolean foo(int a); \n" +
- " public boolean bar(int a); \n" +
- "} \n" +
- "public class X extends Z { \n" +
- " public boolean foo(int a){ return true; } \n" +
- " public boolean bar(int a){ return false; } \n" +
- " public static void main(String[] arguments) { \n"+
- " System.out.println(new X().test(0)); \n"+
- " } \n" +
- "}\n" +
- "abstract class Z implements FooInterface { \n" +
- " public boolean foo(int a, int b) { \n" +
- " return true; \n" +
- " } \n" +
- " public String test(int a) { \n" +
- " boolean result = foo(a); \n" +
- " if (result) \n" +
- " return \"SUCCESS\"; \n" +
- " else \n" +
- " return \"FAILED\"; \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * verify error on qualified name ref in 1.4
- */
-public void test029() {
-
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args) { \n" +
- " new X(); \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " Woof woof_1; \n" +
- " public class Honk { \n" +
- " Integer honks; \n" +
- " } \n" +
- " public class Meow { \n" +
- " Honk honk_1; \n" +
- " } \n" +
- " public class Woof { \n" +
- " Meow meow_1; \n" +
- " } \n" +
- " public void setHonks(int num) { \n" +
- " // This is the line that causes the VerifyError \n" +
- " woof_1.meow_1.honk_1.honks = new Integer(num); \n" +
- " // Here is equivalent code that does not cause the error. \n" +
- " // Honk h = woof_1.moo_1.meow_1.honk_1; \n" +
- " // h.honks = new Integer(num); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * 1.4 signals invocations of non-visible abstract protected method implementations.
- */
-public void test030() {
-
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args){ \n" +
- " new q.X2().foo(\"String\"); \n" +
- " new q.X2().bar(\"String\"); \n" +
- " new q.X2().barbar(\"String\"); \n" +
- " new q.X2().baz(\"String\"); \n" +
- " } \n" +
- "} \n",
-
- "p/X1.java",
- "package p; \n" +
- "public abstract class X1 { \n" +
- " protected void foo(Object o){ System.out.println(\"X1.foo(Object)\"); } \n" +
- " protected void bar(Object o){ System.out.println(\"X1.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X1.barbar(Object)\"); } \n" +
- " protected void baz(Object o) { System.out.println(\"X1.baz(Object)\"); } \n" +
- "} \n",
-
- "q/X2.java",
- "package q; \n" +
- "public class X2 extends p.X1 { \n" +
- " protected void foo(int i) { System.out.println(\"X2.foo(int)\"); } \n" +
- " protected void bar(Object o) { System.out.println(\"X2.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " protected void baz(String s) { System.out.println(\"X2.baz(String)\"); } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 5)\n" +
- " new q.X2().bar(\"String\"); \n" +
- " ^^^\n" +
- "The method bar(Object) from the type X2 is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 6)\n" +
- " new q.X2().barbar(\"String\"); \n" +
- " ^^^^^^\n" +
- "The method barbar(Object) from the type X2 is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in q\\X2.java (at line 5)\n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The method X2.barbar(Object) does not override the inherited method from X1 since it is private to a different package\n" +
- "----------\n");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * 1.4 signals invocations of non-visible abstract protected method implementations.
- */
-public void test031() {
-
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X extends q.X2 { \n" +
- " public static void main(String[] args){ \n" +
- " new X().doSomething(); \n" +
- " } \n" +
- " void doSomething(){ \n" +
- " foo(\"String\"); \n" +
- " bar(\"String\"); \n" +
- " barbar(\"String\"); \n" +
- " baz(\"String\"); \n" +
- " } \n" +
- "} \n",
-
- "p/X1.java",
- "package p; \n" +
- "public abstract class X1 { \n" +
- " protected void foo(Object o){ System.out.println(\"X1.foo(Object)\"); } \n" +
- " protected void bar(Object o){ System.out.println(\"X1.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X1.barbar(Object)\"); } \n" +
- " protected void baz(Object o) { System.out.println(\"X1.baz(Object)\"); } \n" +
- "} \n",
-
- "q/X2.java",
- "package q; \n" +
- "public class X2 extends p.X1 { \n" +
- " protected void foo(int i) { System.out.println(\"X2.foo(int)\"); } \n" +
- " protected void bar(Object o) { System.out.println(\"X2.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " protected void baz(String s) { System.out.println(\"X2.baz(String)\"); } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 9)\n" +
- " barbar(\"String\"); \n" +
- " ^^^^^^\n" +
- "The method barbar(Object) from the type X2 is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in q\\X2.java (at line 5)\n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The method X2.barbar(Object) does not override the inherited method from X1 since it is private to a different package\n" +
- "----------\n"
-);
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * 1.4 signals invocations of non-visible abstract protected field implementations.
- */
-public void test032() {
-
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args){ \n" +
- " System.out.println(new q.X2().foo); \n" +
- " System.out.println(new q.X2().bar); \n" +
- " } \n" +
- "} \n",
-
- "p/X1.java",
- "package p; \n" +
- "public abstract class X1 { \n" +
- " protected String foo = \"X1.foo\"; \n" +
- " String bar = \"X1.bar\"; \n" +
- "} \n",
-
- "q/X2.java",
- "package q; \n" +
- "public class X2 extends p.X1 { \n" +
- " protected String foo = \"X2.foo\"; \n" +
- " String bar = \"X2.bar\"; \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 4)\n" +
- " System.out.println(new q.X2().foo); \n" +
- " ^^^\n" +
- "The field X2.foo is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 5)\n" +
- " System.out.println(new q.X2().bar); \n" +
- " ^^^\n" +
- "The field X2.bar is not visible\n" +
- "----------\n");
-}
-
-/*
- * Initialization of synthetic fields prior to super constructor call
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23075
- */
-public void test033() {
-
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A { \n"+
- " public int m; \n"+
- " public void pp() { \n"+
- " C c = new C(4); \n"+
- " System.out.println(c.get()); \n"+
- " } \n"+
- " public static void main(String[] args) { \n"+
- " A a = new A(); \n"+
- " try { \n"+
- " a.pp(); \n"+
- " System.out.println(\"SyntheticInit BEFORE SuperConstructorCall\"); \n"+
- " } catch(NullPointerException e) { \n"+
- " System.out.println(\"SyntheticInit AFTER SuperConstructorCall\"); // should no longer occur with target 1.4 \n"+
- " } \n"+
- " } \n"+
- " class C extends B { \n"+
- " public C(int x1) { \n"+
- " super(x1); \n"+
- " } \n"+
- " protected void init(int x1) { \n"+
- " x = m * x1; // <- NULL POINTER EXCEPTION because of m \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class B { \n"+
- " int x; \n"+
- " public B(int x1) { \n"+
- " init(x1); \n"+
- " } \n"+
- " protected void init(int x1) { \n"+
- " x = x1; \n"+
- " } \n"+
- " public int get() { \n"+
- " return x; \n"+
- " } \n"+
- "} \n"
- },
- "0\n" +
- "SyntheticInit BEFORE SuperConstructorCall");
-}
-/*
- * Initialization of synthetic fields prior to super constructor call - NPE check
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25174
- */
-public void test034() {
-
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new X2(); \n"+
- " } \n"+
- " class X1 { \n"+
- " X1(){ \n"+
- " this.baz(); \n"+
- " } \n"+
- " void baz() { \n"+
- " System.out.println(\"-X1.baz()\"); \n"+
- " } \n"+
- " } \n"+
- " class X2 extends X1 { \n"+
- " void baz() { \n"+
- " System.out.print(X.this==null ? \"X.this == null\" : \"X.this != null\"); \n"+
- " X1 x1 = X.this.new X1(){ \n"+
- " void baz(){ \n"+
- " System.out.println(\"-X$1.baz()\"); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " } \n"+
- "}\n",
- },
- "X.this != null-X$1.baz()");
-}
-
-public void test035() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " class Y { Y(int i){} } \n"+
- " public static void main(String[] arguments) { \n"+
- " int i = 1; \n" +
- " try { \n" +
- " X x =null; \n" +
- " x.new Y(++i); \n" + // i won't get incremented before NPE
- " System.out.println(\"FAILED\"); \n" +
- " } catch(NullPointerException e){ \n" +
- " System.out.println(\"SUCCESS:\"+i); \n" +
- " } \n" +
- " } \n"+
- "} \n",
- },
- "SUCCESS:1"
- );
-}
-
-public void test036() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " class Y {} \n"+
- " static class Z extends Y { \n"+
- " Z (X x){ \n"+
- " x.super(); \n" +
- " } \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " try { \n" +
- " new Z(null); \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } catch(NullPointerException e){ \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=24744
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23096
- *
- * NOTE: since JLS got revised to allow unterminated line comments (32476)
- */
-public void test037() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:");
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n"+
- "public class X {\n"+
- "}\n"+
- "// TODO: something"
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 4)\n" +
- " // TODO: something\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "TODO: something\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=24833
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23096
- *
- * NOTE: since JLS got revised to allow unterminated line comments (32476)
- */
-public void test038() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:");
- this.runNegativeTest(
- new String[] {
- "X.java",
- "// TODO: something"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " // TODO: something\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "TODO: something\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-/*
- * unreachable empty statement/block are diagnosed in 1.3
- */
-public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args){ \n"+
- " for (;null != null;); \n"+
- " for (;null != null;){} \n"+
- " for (;false;); \n"+
- " for (;false;){} \n"+
- " while (false); \n"+
- " while (false){} \n"+
- " if (false) {} else {} \n"+
- " if (false) ; else ; \n"+
- " System.out.println(\"FAILED\"); \n" +
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " for (;false;){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " while (false){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-// jls6.5.5.1 - simple type names favor member type over toplevel one.
-//http://bugs.eclipse.org/bugs/show_bug.cgi?id=30705
-public void test040() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " interface Homonym {} \n"+ // takes precedence over others.
- " void foo() { \n"+
- " class Homonym extends X { \n"+
- " { \n"+
- " class Y extends Homonym {}; \n"+ // X$Homonym
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class Homonym extends X { \n"+
- " { \n"+
- " class Y extends Homonym {}; \n"+ // X$Homonym
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class Homonym extends X { \n" +
- " ^^^^^^^\n" +
- "The type Homonym is hiding the type X.Homonym\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class Y extends Homonym {}; \n" +
- " ^^^^^^^\n" +
- "The type X.Homonym cannot be the superclass of Y; a superclass must be a class\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " class Y extends Homonym {}; \n" +
- " ^^^^^^^\n" +
- "The type X.Homonym cannot be the superclass of Y; a superclass must be a class\n" +
- "----------\n");
-}
-/*
- * 30856 - 1.4 compliant mode should consider abstract method matches
- */
-public void test041() {
- this.runConformTest(
- new String[] {
- "p/X.java", //================================
- "package p; \n" +
- "public class X { \n" +
- " void foo(int i, float f){} \n" +
- " public static void main(String[] args) { \n" +
- " q.Y y = new q.Y.Z(); \n" +
- " y.bar(); \n" +
- " } \n" +
- "} \n",
- "q/Y.java", //================================
- "package q; \n" +
- "public abstract class Y extends p.X implements I { \n" +
- " public void bar(){ foo(1, 2); } \n" +
- " public static class Z extends Y { \n" +
- " public void foo(float f, int i) { \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " } \n" +
- "} \n" +
- "interface I { \n" +
- " void foo(float f, int i); \n" +
- "} \n",
- },
- "SUCCESS");
-}
-/*
- * variation - 30856 - 1.4 compliant mode should consider abstract method matches
- */
-public void test042() {
- this.runConformTest(
- new String[] {
- "p/X.java", //================================
- "package p; \n" +
- "public class X extends X0 { \n" +
- " void foo(int i, float f){} \n" +
- " public static void main(String[] args) { \n" +
- " q.Y y = new q.Y.Z(); \n" +
- " y.bar(); \n" +
- " } \n" +
- "} \n" +
- "class X0 { \n" +
- " void foo(int i, double d){} \n" + // extra match
- "} \n",
- "q/Y.java", //================================
- "package q; \n" +
- "public abstract class Y extends p.X implements I { \n" +
- " public void bar(){ foo(1, 2); } \n" +
- " public static class Z extends Y { \n" +
- " public void foo(float f, int i) { \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " } \n" +
- "} \n" +
- "interface I { \n" +
- " void foo(float f, int i); \n" +
- "} \n",
- },
- "SUCCESS");
-}
-
-// binary compatibility
-public void _test043() {
- this.runConformTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n" +
- "public class Y extends A implements I { \n" +
- " public static void main(String[] args) { \n" +
- " Y.printValues(); \n" +
- " } \n" +
- " public static void printValues() { \n" +
- " System.out.println(\"i=\"+i+\",j=\"+j+\",Y.i=\"+Y.i+\",Y.j=\"+Y.j); \n" +
- " } \n" +
- "} \n",
- "p1/A.java",
- "package p1; \n" +
- "public class A { \n" +
- " static int i = 1; \n" +
- "} \n",
- "p1/I.java",
- "package p1; \n" +
- "interface I { \n" +
- " int j = \"aa\".length(); \n" +
- "} \n",
- },
- "i=1,j=2,Y.i=1,Y.j=2");
-
- this.runConformTest(
- new String[] {
- "p1/A.java",
- "package p1; \n" +
- "public class A { \n" +
- " static int j = 3; \n" +
- " public static void main(String[] args) { \n" +
- " Y.printValues(); \n" +
- " } \n" +
- "} \n",
- "p1/I.java",
- "package p1; \n" +
- "interface I { \n" +
- " int j = \"aaaa\".length(); \n" +
- "} \n",
- },
- "i=4,j=3,Y.i=4,Y.j=3",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-///*
-// * array.clone() should use array type in methodRef
-// * http://bugs.eclipse.org/bugs/show_bug.cgi?id=36307
-// */
-//public void test044() {
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " public static void main(String[] args) {\n" +
-// " args.clone(); \n"+
-// " System.out.println(\"SUCCESS\");\n" +
-// " }\n" +
-// "}\n",
-// },
-// "SUCCESS");
-//
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String actualOutput = null;
-// try {
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator +"X.class"));
-// actualOutput =
-// disassembler.disassemble(
-// classFileBytes,
-// "\n",
-// ClassFileBytesDisassembler.DETAILED);
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue("ClassFormatException", false);
-// } catch (IOException e) {
-// assertTrue("IOException", false);
-// }
-//
-// String expectedOutput =
-// " 1 invokevirtual java.lang.String[].clone() : java.lang.Object [16]\n";
-//
-// int index = actualOutput.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(actualOutput, 2));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, actualOutput);
-// }
-//}
-// 39172
-public void test045() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(\"FAILED\"); \n" +
- " return;; \n" + // unreachable empty statement - must complain in 1.4 mode
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 5)\n" +
- " return;; \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39467
- * should diagnose missing abstract method implementation
- */
-public void test046() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X extends Y {\n" +
- "}\n" +
- "abstract class Y extends Z {\n" +
- " public abstract void foo();\n" +
- "}\n" +
- "abstract class Z extends T {\n" +
- "}\n" +
- "class T implements I {\n" +
- " public void foo(){}\n" +
- "}\n" +
- "interface I {\n" +
- " public void foo ();\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends Y {\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method Y.foo()\n" +
- "----------\n"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40442
- * Abstract class fails to invoke interface-defined method in 1.4 compliance mode.
- */
-public void test047() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends AbstractDoubleAlgorithm {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " ((ObjectAlgorithm)(new X())).operate(new Double(0));\n" +
- " }\n" +
- " public void operate(Double pDouble)\n" +
- " {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n" +
- "abstract class AbstractDoubleAlgorithm implements DoubleAlgorithm {\n" +
- " public void operate(Object pObject)\n" +
- " {\n" +
- " operate((Double)pObject);\n" +
- " }\n" +
- "}\n" +
- "interface DoubleAlgorithm extends ObjectAlgorithm {\n" +
- " void operate(Double pDouble);\n" +
- "}\n" +
- "interface ObjectAlgorithm {\n" +
- " void operate(Object pObject);\n" +
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40442
- * Abstract class fails to invoke interface-defined method in 1.4 compliance mode.
- * variation with 2 found methods
- */
-public void test048() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends AbstractDoubleAlgorithm {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " ((ObjectAlgorithm)(new X())).operate(new Double(0));\n" +
- " }\n" +
- " public void operate(Double pDouble)\n" +
- " {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n" +
- "abstract class AbstractDoubleAlgorithm implements DoubleAlgorithm {\n" +
- " public void operate(Object pObject)\n" +
- " {\n" +
- " operate((Double)pObject);\n" +
- " }\n" +
- " public void operate(X x) {}\n" +
- "}\n" +
- "interface DoubleAlgorithm extends ObjectAlgorithm {\n" +
- " void operate(Double pDouble);\n" +
- "}\n" +
- "interface ObjectAlgorithm {\n" +
- " void operate(Object pObject);\n" +
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=41278
- */
-public void test049() {
- this.runNegativeTest(
- new String[] {
- "pa/Caller.java",
- "package pa;\n" +
- "import pb.Concrete;\n" +
- "public class Caller {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Concrete aConcrete = new Concrete(); \n" +
- " aConcrete.callme();\n" +
- " }\n" +
- "}\n",
- "pa/Abstract.java",
- "package pa;\n" +
- "public abstract class Abstract {\n" +
- "\n" +
- " protected void callme(){}\n" +
- "}\n",
- "pb/Concrete.java",
- "package pb;\n" +
- "public class Concrete extends pa.Abstract {\n" +
- "\n" +
- " protected void callme(){ System.out.println(\"SUCCESS\"); }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in pa\\Caller.java (at line 7)\n" +
- " aConcrete.callme();\n" +
- " ^^^^^^\n" +
- "The method callme() from the type Concrete is not visible\n" +
- "----------\n");
-}
-
-public void test050() {
- this.runNegativeTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " int a1 = 1;\n" +
- " int a2 = 1;\n" +
- " a1 = 2;\n" +
- " while (false) {};\n" +
- " a2 = 2;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 10)\n" +
- " while (false) {};\n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-
-public void test051() {
- this.runNegativeTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " int a1 = 1;\n" +
- " int a2 = 1;\n" +
- " a1 = 2;\n" +
- " while (false);\n" +
- " a2 = 2;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 10)\n" +
- " while (false);\n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-
-public void test052() {
- this.runNegativeTest(
- new String[] {
- "p/A.java",
- "package p;\n" +
- "public class A {\n" +
- " public static void main(String[] argv) {\n" +
- " foo();\n" +
- " }\n" +
- " private int i;\n" +
- " static class Y extends X {\n" +
- " int x = i;\n" +
- " }\n" +
- " public static void foo() {\n" +
- " return;\n" +
- " }\n" +
- "}",
-
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " int a1 = 1;\n" +
- " int a2 = 1;\n" +
- " a1 = 2;\n" +
- " while (false);\n" +
- " a2 = 2;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in p\\A.java (at line 6)\n" +
- " private int i;\n" +
- " ^\n" +
- "The field A.i is never read locally\n" +
- "----------\n" +
- "2. ERROR in p\\A.java (at line 8)\n" +
- " int x = i;\n" +
- " ^\n" +
- "Cannot make a static reference to the non-static field i\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p\\X.java (at line 10)\n" +
- " while (false);\n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-
-public void test053() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "class X {\n" +
- " static class A {\n" +
- " interface I {\n" +
- " int a = 3;\n" +
- " }\n" +
- " } \n" +
- " interface I { \n" +
- " int b = 4;\n" +
- " }\n" +
- " class Y extends A implements I {\n" +
- " Object F() {\n" +
- " return new I() {\n" +
- " int c = a; // WE SHOULD NOT BE ABLE TO SEE BOTH a and b\n" +
- " int d = b; // WE SHOULD NOT BE ABLE TO SEE BOTH a and b\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}",
- }
- );
-}
-
-public void test054() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " static class A {\n" +
- " interface I {\n" +
- " int a = 3;\n" +
- " void foo();\n" +
- " }\n" +
- " }\n" +
- " interface I {\n" +
- " int a = 4;\n" +
- " void foo();\n" +
- " }\n" +
- " class Y extends A implements I {\n" +
- " public void foo() {\n" +
- " new I() {\n" +
- " public void foo() {\n" +
- " System.out.println(\"X$1::foo-\" + a);\n" +
- " }\n" +
- " }\n" +
- " .foo();\n" +
- " }\n" +
- " }\n" +
- "public static void main(String argv[]) {\n" +
- " new X().new Y().foo();\n" +
- "}\n" +
- "}",
- }
- );
-}
-public void test055() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " static class A {\n" +
- " interface I2 {\n" +
- " int a = 3;\n" +
- " void foo();\n" +
- " }\n" +
- " }\n" +
- " interface I1 {\n" +
- " int a = 4;\n" +
- " void foo(int a);\n" +
- " }\n" +
- " class Y extends A implements I1 {\n" +
- " public void foo(int a) {\n" +
- " new I2() {\n" +
- " public void foo() {\n" +
- " System.out.println(\"X$1::foo-\" + a);\n" +
- " }\n" +
- " }\n" +
- " .foo();\n" +
- " }\n" +
- " }\n" +
- "public static void main(String argv[]) {\n" +
- " new X().new Y().foo(8);\n" +
- "}\n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 11)\n" +
- " void foo(int a);\n" +
- " ^\n" +
- "The parameter a is hiding a field from type X.I1\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 14)\n" +
- " public void foo(int a) {\n" +
- " ^\n" +
- "The parameter a is hiding a field from type X.I1\n" +
- "----------\n"
- );
-}
-
-public void test056() {
- this.runConformTest(
- new String[] {
- "p/MethodQualification.java",
- "package p;\n" +
- "public class MethodQualification {\n" +
- " void foo() {\n" +
- " System.out.println(\"Inherited foo() for anonymous type\");\n" +
- " class Local {\n" +
- " void foo(){\n" +
- " System.out.println(\"Enclosing foo() for anonymous type\");\n" +
- " new MethodQualification () { {foo();} };\n" +
- " }\n" +
- " };\n" +
- " } \n" +
- "}",
- },
- ""
- );
-}
-
-public void test057() {
- this.runConformTest(
- new String[] {
- "p/AG.java",
- "package p;\n" +
- "/**\n" +
- " * 1F9RITI\n" +
- " */\n" +
- "public class AG {\n" +
- " public class X {\n" +
- " class B {\n" +
- " int intValueOfB = -9;\n" +
- " }\n" +
- " class SomeInner extends A {\n" +
- " void someMethod() {\n" +
- " int i = new B().intValueOfB; \n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class A {\n" +
- " class B {\n" +
- " int intValueOfB = -9;\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- ""
- );
-}
-
-public void test058() {
- this.runConformTest(
- new String[] {
- "p/AE.java",
- "package p;\n" +
- "/**\n" +
- " * 1F9RITI\n" +
- " */\n" +
- "public class AE {\n" +
- " public class X {\n" +
- " int intValue = 153;\n" +
- " class SomeInner extends A {\n" +
- " void someMethod() {\n" +
- " int i = intValue; \n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class A {\n" +
- " int intValue = 153;\n" +
- " }\n" +
- "}",
- },
- ""
- );
-}
-
-public void test059() {
- this.runNegativeTest(
- new String[] {
- "p/FieldQualification.java",
- "package p;\n" +
- "public class FieldQualification {\n" +
- " String field = \"Inherited field for anonymous type\";\n" +
- "void foo() {\n" +
- " class Local {\n" +
- " String field = \"Enclosing field for anonymous type\";\n" +
- " void foo() {\n" +
- " System.out.println(\"Enclosing foo() for anonymous type\");\n" +
- " new FieldQualification() {\n" +
- " {\n" +
- " System.out.println(field);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in p\\FieldQualification.java (at line 5)\n" +
- " class Local {\n" +
- " ^^^^^\n" +
- "The type Local is never used locally\n" +
- "----------\n" +
- "2. WARNING in p\\FieldQualification.java (at line 6)\n" +
- " String field = \"Enclosing field for anonymous type\";\n" +
- " ^^^^^\n" +
- "The field Local.field is hiding a field from type FieldQualification\n" +
- "----------\n" +
- "3. WARNING in p\\FieldQualification.java (at line 6)\n" +
- " String field = \"Enclosing field for anonymous type\";\n" +
- " ^^^^^\n" +
- "The field Local.field is never read locally\n" +
- "----------\n" +
- "4. WARNING in p\\FieldQualification.java (at line 7)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type Local is never used locally\n" +
- "----------\n");
-}
-
-public void test060() {
- this.runConformTest(
- new String[] {
- "p/AF.java",
- "package p;\n" +
- "/**\n" +
- " * 1F9RITI\n" +
- " */\n" +
- "public class AF {\n" +
- " public class X {\n" +
- " int intMethod() {\n" +
- " return 3333;\n" +
- " }\n" +
- " class SomeInner extends A {\n" +
- " void someMethod() {\n" +
- " int i = intMethod();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class A {\n" +
- " int intMethod() {\n" +
- " return 3333;\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- ""
- );
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=32342
- */
-public void test061() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //======================
- "package p; \n" +
- "public class X extends q.Y { \n" +
- " X someField; \n" + // no ambiguity since inherited Y.X isn't visible
- "} \n" +
- "class Z extends q.Y { \n" +
- " Z someField; \n" + // ambiguous
- "} \n",
- "q/Y.java", //======================
- "package q; \n" +
- "public class Y { \n" +
- " private static class X {} \n" +
- " public static class Z {} \n" +
- "} \n"
- },
- "----------\n" +
- "1. WARNING in q\\Y.java (at line 3)\n" +
- " private static class X {} \n" +
- " ^\n" +
- "The type Y.X is never used locally\n" +
- "----------\n");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11435
- * variant - must still complain when targeting super abstract method
- */
-public void test062() {
-
- this.runNegativeTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n"+
- "public class Y extends AbstractT { \n"+
- " public void init(){ \n"+
- " super.init(); \n"+
- " } \n"+
- "} \n"+
- "abstract class AbstractT implements J { \n"+
- "} \n"+
- "interface J { \n"+
- " void init(); \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\Y.java (at line 4)\n" +
- " super.init(); \n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method init() for the type J\n" +
- "----------\n"); // expected log
-}
-
-public void test063() {
- this.runNegativeTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " class Y extends X {} \n"+
- " class Z extends Y { \n"+
- " Z(){ \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n" +
- " } \n" +
- " public static void main(String[] arguments) { \n"+
- " new X().new Z(); \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 5)\n" +
- " Z(){ \n" +
- " ^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n"
- );
-}
-
-/**
- * Refuse selection of own enclosing instance arg for super constructor call in 1.3 compliant mode
- */
-public void test064() {
- this.runNegativeTest(
- new String[] {
- "Foo.java",
- "public class Foo {\n" +
- " public static void main(String[] args) {\n"+
- " System.out.println(\"SUCCESS\");\n"+
- " }\n"+
- " public class Bar extends Foo {\n" +
- " public Bar() {\n" +
- " }\n" +
- " }\n" +
- " public class Baz extends Bar {\n" +
- " public Baz() {\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 10)\n" +
- " public Baz() {\n" +
- " ^^^^^\n" +
- "No enclosing instance of type Foo is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-public void test065() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new Y().new Z().bar(); \n"+
- " } \n"+
- " String foo() { return \"X-foo\"; } \n"+
- " class Y extends X { \n"+
- " String foo() { return \"Y-foo\"; } \n"+
- " class Z extends Y { \n"+
- " Z(){ \n"+
- " //X.this.super(); \n"+
- " } \n"+
- " String foo() { return \"Z-foo\"; } \n"+
- " void bar () { \n"+
- " System.out.println(X.this.foo()); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " Z(){ \n" +
- " ^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-/*
- * Check that anonymous type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test066() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {}\n" +
- " class M extends X {\n" +
- " M(){\n" +
- " super(null);\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new M(){});\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(new M(){});\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " super(new M(){});\n" +
- " ^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-/*
- * Check that indirect member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test067() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- " class N extends X {\n" +
- " N(Object o) {\n" +
- " super(o);\n" +
- " }\n" +
- " }\n" +
- " class M extends N {\n" +
- " M() {\n" +
- " super(null); //1\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new M());//2\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " super(null); //1\n" +
- " ^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-/*
- * Check that indirect member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test068() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " class MX1 extends X {\n" +
- " MX1() {\n" +
- " }\n" +
- " }\n" +
- " class MX2 extends MX1 {\n" +
- " MX2() {\n" +
- " super(); // ko\n" +
- " }\n" +
- " MX2(X x) {\n" +
- " this(); // ok\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(); // ko\n" +
- " ^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-/*
- * Check that indirect member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test069() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " class MX3 extends X {\n" +
- " MX3(X x) {\n" +
- " }\n" +
- " }\n" +
- " class MX4 extends MX3 {\n" +
- " MX4() {\n" +
- " super(new MX4()); // ko\n" +
- " }\n" +
- " MX4(X x) {\n" +
- " this(); // ok\n" +
- " }\n" +
- " MX4(int i) {\n" +
- " this(new MX4()); // ko\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(new MX4()); // ko\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " super(new MX4()); // ko\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " this(new MX4()); // ko\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-// binary compatibility
-public void test070() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends Middle {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(new X().field);\n" +
- " }\n" +
- "}\n" +
- "class Middle extends Top {\n" +
- "}\n" +
- "class Top {\n" +
- " String field = \"Top.field\";\n" +
- "}\n"
- },
- "Top.field");
-
- this.runConformTest(
- new String[] {
- "Middle.java",
- "public class Middle extends Top {\n" +
- " public static void main(String[] arguments) { \n"+
- " X.main(arguments); \n" +
- " } \n" +
- " String field = \"Middle.field\";\n" +
- "}\n"
- },
- "Middle.field",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-
-/*
- * 43429 - AbstractMethodError calling clone() at runtime when using Eclipse compiler
- */
-public void test071() {
- this.runConformTest(
- new String[] {
- "X.java", //================================
- "public class X {\n" +
- " public interface Copyable extends Cloneable {\n" +
- " public Object clone() throws CloneNotSupportedException;\n" +
- " }\n" +
- " public interface TestIf extends Copyable {\n" +
- " }\n" +
- " public static class ClassA implements Copyable {\n" +
- " public Object clone() throws CloneNotSupportedException {\n" +
- " return super.clone();\n" +
- " }\n" +
- " }\n" +
- " public static class ClassB implements TestIf {\n" +
- " public Object clone() throws CloneNotSupportedException {\n" +
- " return super.clone();\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Copyable o1 = new ClassA();\n" +
- " ClassB o2 = new ClassB();\n" +
- " TestIf o3 = o2;\n" +
- " Object clonedObject;\n" +
- " clonedObject = o1.clone();\n" +
- " clonedObject = o2.clone();\n" +
- " // The following line fails at runtime with AbstractMethodError when\n" +
- " // compiled with Eclipse\n" +
- " clonedObject = o3.clone();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-public void test072() {
-
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " f();\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- " static void f() {\n" +
- " Object x = new Object() {\n" +
- " {\n" +
- " if (true) throw null;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-// 52221
-public void test073() {
-
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " public static void main(String[] args) {\n" +
- " \n" +
- " switch(args.length) {\n" +
- " \n" +
- " case 1:\n" +
- " int i = 0;\n" +
- " class Local {\n" +
- " }\n" +
- " break;\n" +
- " \n" +
- " case 0 :\n" +
- " System.out.println(i); // local var can be referred to, only an initialization pb\n" +
- " System.out.println(new Local());\n" +
- " break;\n" +
- "\n" +
- " case 2 :\n" +
- " class Local { // not a duplicate\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " System.out.println(new Local());\n" +
- " ^^^^^\n" +
- "Local cannot be resolved to a type\n" +
- "----------\n");
-}
-
-// checking for captured outer local initialization status
-// NOTE: only complain against non-inlinable outer locals
-// http://bugs.eclipse.org/bugs/show_bug.cgi?id=26134
-public void test074() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) { \n" +
- " String nonInlinedString = \"[Local]\"; \n" +
- " int i = 2; \n" +
- " switch(i){ \n" +
- " case 1: \n" +
- " final String displayString = nonInlinedString;\n" +
- " final String inlinedString = \"a\"; \n" +
- " class Local { \n" +
- " public String toString() { \n" +
- " return inlinedString + displayString; \n" +
- " } \n" +
- " } \n" +
- " case 2: \n" +
- " System.out.print(new Local()); \n" +
- " System.out.print(\"-\"); \n" +
- " System.out.println(new Local(){ \n" +
- " public String toString() { \n" +
- " return super.toString()+\": anonymous\"; \n" +
- " } \n" +
- " }); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " System.out.print(new Local()); \n" +
- " ^^^^^\n" +
- "Local cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 17)\n" +
- " System.out.println(new Local(){ \n" +
- " ^^^^^\n" +
- "Local cannot be resolved to a type\n" +
- "----------\n");
-}
-public void test075() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public void foo(int p1) {} \n" +
- " public void foo(short p1) {} \n" +
- "} \n",
- "Y.java",
- "public class Y extends X { \n" +
- " public void foo(long p1) {} \n" +
- " public void testEc() { foo((short)1); } \n" +
- "} \n",
- },
- "SUCCESS");
-}
-
-/**
- * Test fix for bug 58069.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=58069">58069</a>
- */
-public void test076() {
- docSupport = true;
- runNegativeTest(
- new String[] {
- "IX.java",
- "interface IX {\n" +
- " public static class Problem extends Exception {}\n" +
- "}\n",
- "X.java",
- "public abstract class X {\n" +
- " public static class Problem extends Exception {}\n" +
- " public abstract static class InnerClass implements IX {\n" +
- " /**\n" +
- " * @throws Problem \n" +
- " */\n" +
- " public void foo() throws IllegalArgumentException {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"
- },
- "----------\n" +
- "1. WARNING in IX.java (at line 2)\n" +
- " public static class Problem extends Exception {}\n" +
- " ^^^^^^^\n" +
- "The serializable class Problem does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public static class Problem extends Exception {}\n" +
- " ^^^^^^^\n" +
- "The serializable class Problem does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @throws Problem \n" +
- " ^^^^^^^\n" +
- "Javadoc: Exception Problem is not declared\n" +
- "----------\n" );
-}
-/**
- * Test fix bug 58069 for method.
- * Note that problem is not flagged in doc comments as it is only raised while verifying
- * implicit method and javadoc resolution does not use it.
- */
-public void test077() {
- docSupport = true;
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar() { \n"+
- " return \"FAILED\"; \n" +
- " } \n"+
- " void foo(){ \n"+
- " /** @see #bar() */\n" +
- " class Y extends Secondary { \n"+
- " /** @see #bar() */\n" +
- " String z = bar(); \n" +
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " String bar(){ return \"FAILED\"; } \n" +
- "} \n"
- }
- );
-}
-/**
- * Test fix bug 58069 for field.
- * Note that problem is not flagged in doc comments as it is only raised while verifying
- * Name or Qualified name references and javadoc reference is a field reference.
- */
-public void test078() {
- docSupport = true;
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar = \"FAILED\";"+
- " void foo(){ \n"+
- " /** @see #bar */\n" +
- " class Y extends Secondary { \n"+
- " /** @see #bar */\n" +
- " String z = bar; \n"+
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " String bar = \"FAILED\"; \n" +
- "} \n"
- }
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47227
- */
-public void test079() {
- this.runNegativeTest(
- new String[] {
- "Hello.java",
- "void ___eval() {\n" +
- " new Runnable() {\n" +
- " int ___run() throws Throwable {\n" +
- " return blah;\n" +
- " }\n" +
- " private String blarg;\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- "public class Hello {\n" +
- " private static int x;\n" +
- " private String blah;\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void hello() {\n" +
- " }\n" +
- " public boolean blah() {\n" +
- " return false;\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Hello.java (at line 7)\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n"
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67643
- * from 1.5 source level on most specific common super type is allowed
- */
-public void test080() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.util.ArrayList;\n" +
- "public class X {\n" +
- " private static class C1 extends ArrayList {\n" +
- " }\n" +
- " private static class C2 extends ArrayList {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " ArrayList list = args == null ? new C1(): new C2();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " private static class C1 extends ArrayList {\n" +
- " ^^\n" +
- "The serializable class C1 does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 5)\n" +
- " private static class C2 extends ArrayList {\n" +
- " ^^\n" +
- "The serializable class C2 does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 8)\n" +
- " ArrayList list = args == null ? new C1(): new C2();\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Incompatible conditional operand types C1 and C2\n" +
- "----------\n");
-}
-public void test081() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public X foo() { return this; } \n" +
- "}\n" +
- "class Y extends X {\n" +
- " public Y foo() { return this; } \n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " public Y foo() { return this; } \n" +
- " ^\n" +
- "The return type is incompatible with X.foo()\n" +
- "----------\n");
-}
-// covariance
-public void test082() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " X x = new X1();\n" +
- " System.out.println(x.foo());\n" +
- " }\n" +
- " Object foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class X1 extends X {\n" +
- " String foo() {\n" +
- " return \"SUCCESS\";\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " String foo() {\n" +
- " ^^^^^^\n" +
- "The return type is incompatible with X.foo()\n" +
- "----------\n");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=66533
- */
-public void test084() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object enum = null;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 3)\n" +
- " Object enum = null;\n" +
- " ^^^^\n" +
- "\'enum\' should not be used as an identifier, since it is a reserved keyword from source level 5.0 on\n" +
- "----------\n");
-}
-/**
- * Test unused import with static
- */
-public void test085() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "import static j.l.S.*;\n" +
- "import static j.l.S.in;\n" +
- "\n" +
- "public class A {\n" +
- "\n" +
- "}\n",
- "j/l/S.java",
- "package j.l;\n" +
- "public class S {\n" +
- " public static int in;\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in A.java (at line 1)\n" +
- " import static j.l.S.*;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 2)\n" +
- " import static j.l.S.in;\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "3. ERROR in A.java (at line 2)\n" +
- " import static j.l.S.in;\n" +
- " ^^^^^^^^\n" +
- "The import j.l.S.in cannot be resolved\n" +
- "----------\n"
- );
-}
-/**
- * Test invalid static import syntax
- */
-public void test086() {
- this.runNegativeTest(
- new String[] {
- "p/S.java",
- "package p;\n" +
- "public class S {\n" +
- " public final static String full = \"FULL\";\n" +
- " public final static String success = \"SUCCESS\";\n" +
- "}\n",
- "X.java",
- "import static p.S;\n" +
- "public class X {\n" +
- " public static void main ( String[] args) {\n" +
- " \n" +
- " System.out.print(full+\" \"+p.S.success);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static p.S;\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " System.out.print(full+\" \"+p.S.success);\n" +
- " ^^^^\n" +
- "full cannot be resolved\n" +
- "----------\n"
- );
-}
-public void test087() {
- this.runNegativeTest(
- new String[] {
- "p/S.java",
- "public class S {\n" +
- " public final static String full = \"FULL\";\n" +
- " public final static String success = \"SUCCESS\";\n" +
- "}\n",
- "X.java",
- "import static S;\n" +
- "public class X {\n" +
- " public static void main ( String[] args) {\n" +
- " \n" +
- " System.out.print(full+\" \"+S.success);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static S;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Syntax error, static imports are only available if source level is 5.0\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 1)\n" +
- " import static S;\n" +
- " ^\n" +
- "The import S cannot be resolved\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 5)\n" +
- " System.out.print(full+\" \"+S.success);\n" +
- " ^^^^\n" +
- "full cannot be resolved\n" +
- "----------\n"
- );
-}
-public void test088() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import java.util.Date;\n" +
- "import java.lang.reflect.*;\n" +
- "public class X extends Date implements Runnable{\n" +
- " \n" +
- " Integer w = new Integer(90);\n" +
- " protected double x = 91.1;\n" +
- " public long y = 92;\n" +
- " static public Boolean z = new Boolean(true); \n" +
- " public class X_inner {\n" +
- " public X_inner() {\n" +
- " this.super();\n" +
- " System.out.println(\"....\");\n" +
- " }\n" +
- " }\n" +
- " X_inner a = new X_inner();\n" +
- " public interface X_interface {\n" +
- " public void f(); \n" +
- " }\n" +
- " static {\n" +
- " System.out.println(\"Static initializer\");\n" +
- " }\n" +
- " public X() { } \n" +
- " public X(int a1,int b1) { } \n" +
- " private void a() { System.out.println(\"A\");} \n" +
- " protected void b() { System.out.println(\"B\");} \n" +
- " public void c() { System.out.println(\"C\");} \n" +
- " static public int d() {System.out.println(\"Static D\");return -1;} \n" +
- " public static void main(String args[]) {\n" +
- " X b = new X();\n" +
- " Class c = b.getClass();\n" +
- " Class _getClasses [] = X.class.getClasses(); \n" +
- "// System.out.println(_getClasses[0].toString());\n" +
- "// System.out.println(_getClasses[1].toString());\n" +
- " if (_getClasses.length == 0) {System.out.println(\"FAILED\");};\n" +
- " Constructor _getConstructors[] = c.getConstructors(); \n" +
- " try {\n" +
- " Field _getField = c.getField(\"y\");\n" +
- " Method _getMethod = c.getMethod(\"d\",null);\n" +
- " \n" +
- " Boolean b_z = X.z; \n" +
- " }\n" +
- " catch (NoSuchFieldException e) { System.out.println(\"NoSuchFieldException\");}\n" +
- " catch (NoSuchMethodException e) { System.out.println(\"NoSuchMethodException\");};\n" +
- " } \n" +
- " public void run() {System.out.println(\"RUN\");} \n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 4)\n" +
- " public class X extends Date implements Runnable{\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 12)\n" +
- " this.super();\n" +
- " ^^^^\n" +
- "Illegal enclosing instance specification for type Object\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 25)\n" +
- " private void a() { System.out.println(\"A\");} \n" +
- " ^^^\n" +
- "The method a() from the type X is never used locally\n" +
- "----------\n");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78089
- */
-public void test089() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " @interface I1 {}\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.print(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\r\n" +
- " @interface I1 {}\r\n" +
- " ^^\n" +
- "Syntax error, annotation declarations are only available if source level is 5.0\n" +
- "----------\n");
-}
-//78104
-public void test090() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo(int[] ints, Object o) {\n" +
- " ints = ints.clone();\n" +
- " ints = (int[])ints.clone();\n" +
- " X x = this.clone();\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " ints = ints.clone();\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to int[]\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " X x = this.clone();\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to X\n" +
- "----------\n"
- );
-}
-//78104 - variation
-public void test091() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " args = args.clone();\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\r\n" +
- " args = args.clone();\r\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to String[]\n" +
- "----------\n"
- );
-}
-// check autoboxing only enabled in 5.0 source mode
-public void test092() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Boolean b) {\n" +
- " if (b) { \n" +
- " int i = 0;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " if (b) { \n" +
- " ^\n" +
- "Type mismatch: cannot convert from Boolean to boolean\n" +
- "----------\n"
- );
-}
-public void test093() {
- this.runNegativeTest(
- new String[] {
- "p/X_1.java",
- "package p;\n" +
- "/* dena JTest Suite, Version 2.2, September 1997\n" +
- " * Copyright (c) 1995-1997 Modena Software (I) Pvt. Ltd., All Rights Reserved\n" +
- " */\n" +
- "/* Section : Inner classes \n" +
- " * FileName : ciner026.java\n" +
- " * Purpose : Positive test for Inner classes\n" +
- " * \n" +
- " * An anonymous class can have initializers but cannot have a constructor.\n" +
- " * The argument list of the associated new expression is implicitely \n" +
- " * passed to the constructor of the super class. \n" +
- " *\n" +
- " */\n" +
- " \n" +
- " class X_1 {\n" +
- " static int xx = 100;\n" +
- " //inner class Y \n" +
- " static class Y { \n" +
- " public int j = 0;\n" +
- " Y(int x){ j = x; }\n" +
- " } \n" +
- " public void call_inner()\n" +
- " {\n" +
- " int i = test_anonymous().j;\n" +
- " } \n" +
- " public static void main(String argv[])\n" +
- " {\n" +
- " X_1 ox = new X_1();\n" +
- " ox.call_inner(); \n" +
- " } \n" +
- "public void newMethod ( ) {\n" +
- " Float f1 = null;\n" +
- " f1=(f1==0.0)?1.0:f1;\n" +
- "}\n" +
- " static Y test_anonymous()\n" +
- " { \n" +
- " //anonymous implementation of class Y\n" +
- " return new Y(xx) //xx should be implicitely passed to Y()\n" +
- " {\n" +
- " }; \n" +
- " \n" +
- " } //end test_anonymous \n" +
- "} ",
- },
- "----------\n" +
- "1. ERROR in p\\X_1.java (at line 33)\n" +
- " f1=(f1==0.0)?1.0:f1;\n" +
- " ^^^^^^^^^\n" +
- "Incompatible operand types Float and double\n" +
- "----------\n"
- );
-}
-/*
- * Test unused import warning in presence of syntax errors
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21022
- */
-public void test094(){
-
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.*; \n" +
- "public class X { \n" +
- " void foo(){\n" +
- " ()\n" +
- " IOException e;\n" +
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " ()\n" +
- " ^^\n" +
- "Syntax error on tokens, delete these tokens\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84743
-public void test095(){
-
- this.runNegativeTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " int foo();\n" +
- "}\n" +
- "interface J {\n" +
- " String foo();\n" +
- "}\n" +
- " \n" +
- "public class X implements I {\n" +
- " public int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = new X();\n" +
- " try {\n" +
- " J j = (J) i;\n" +
- " } catch(ClassCastException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 15)\n" +
- " J j = (J) i;\n" +
- " ^^^^^\n" +
- "Cannot cast from I to J\n" +
- "----------\n");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47074
- */
-public void test096() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " interface A {\n" +
- " void doSomething();\n" +
- " }\n" +
- "\n" +
- " interface B {\n" +
- " int doSomething();\n" +
- " }\n" +
- "\n" +
- " interface C extends B {\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " \n" +
- " A a = null;\n" +
- " C c = (C)a; //COMPILER ERROR\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 17)\n" +
- " C c = (C)a; //COMPILER ERROR\n" +
- " ^^^^\n" +
- "Cannot cast from X.A to X.C\n" +
- "----------\n");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=79396
-public void test097() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " int cst = X1.CST;\n" +
- " X2.Root.foo();\n" +
- " }\n" +
- " static void foo() {}\n" +
- "}\n" +
- "\n" +
- "class X1 {\n" +
- " static {\n" +
- " System.out.print(\"[X1]\");\n" +
- " }\n" +
- " public static final int CST = 12;\n" +
- " static X Root = null;\n" +
- "}\n" +
- "class X2 {\n" +
- " static {\n" +
- " System.out.print(\"[X2]\");\n" +
- " }\n" +
- " public final int CST = 12;\n" +
- " static X Root = null;\n" +
- "}\n"
- },
- "[X2]");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78906
-public void test098() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " System.out.print(\"foo\");\n" +
- " }\n" +
- " class Y {\n" +
- " String this$0;\n" +
- " String this$0$;\n" +
- " void print() { \n" +
- " foo();\n" +
- " System.out.println(this$0+this$0$);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X.Y y = new X().new Y();\n" +
- " y.this$0 = \"hello\";\n" +
- " y.this$0$ = \"world\";\n" +
- " y.print();\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " String this$0;\n" +
- " ^^^^^^\n" +
- "Duplicate field X.Y.this$0\n" +
- "----------\n");
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=77349
-public void test099() {
- this.runNegativeTest(
- new String[] {
- "I.java",
- "public interface I extends Cloneable {\n" +
- " class Inner {\n" +
- " Object bar(I i) throws CloneNotSupportedException { return i.clone(); }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in I.java (at line 3)\n" +
- " Object bar(I i) throws CloneNotSupportedException { return i.clone(); }\n" +
- " ^^^^^\n" +
- "The method clone() is undefined for the type I\n" +
- "----------\n"
- );
-}
-
-public void test100() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " void foo() {\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " ^^^^^^\n" +
- "Invalid unicode\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " ^^^^^^\n" +
- "Invalid unicode\n" +
- "----------\n"
- );
-}
-
-public void test101() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Character c0 = \'a\';\n" +
- " public static void main(String argv[]) {\n" +
- " Character c1;\n" +
- " c1 = \'b\';\n" +
- "\n" +
- " Character c2 = \'c\';\n" +
- " Character[] c3 = { \'d\' };\n" +
- " \n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " Character c0 = \'a\';\n" +
- " ^^\n" +
- "Type mismatch: cannot convert from char to Character\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " c1 = \'b\';\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Character\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " Character c2 = \'c\';\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Character\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " Character[] c3 = { \'d\' };\n" +
- " ^^^\n" +
- "Type mismatch: cannot convert from char to Character\n" +
- "----------\n"
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=108856
-public void test102() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " new Object() {\n" +
- " {\n" +
- " new Object() {\n" +
- " {\n" +
- " System.out.println(this.getClass().getName());\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n"
- },
- "X$2");
-}
-//public void test103() {
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " public static void main(String[] args) {\n" +
-// " System.out.print(X.class);\n" +
-// " }\n" +
-// "}\n",
-// },
-// "class X");
-//
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String actualOutput = null;
-// try {
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator +"X.class"));
-// actualOutput =
-// disassembler.disassemble(
-// classFileBytes,
-// "\n",
-// ClassFileBytesDisassembler.DETAILED);
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue("ClassFormatException", false);
-// } catch (IOException e) {
-// assertTrue("IOException", false);
-// }
-//
-// String expectedOutput =
-// "// Compiled from X.java (version 1.4 : 48.0, super bit)\n" +
-// "public class X {\n" +
-// " \n" +
-// " // Field descriptor #6 Ljava/lang/Class;\n" +
-// " static synthetic java.lang.Class class$0;\n" +
-// " \n" +
-// " // Method descriptor #9 ()V\n" +
-// " // Stack: 1, Locals: 1\n" +
-// " public X();\n" +
-// " 0 aload_0 [this]\n" +
-// " 1 invokespecial java.lang.Object() [11]\n" +
-// " 4 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 1]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
-// " \n" +
-// " // Method descriptor #18 ([Ljava/lang/String;)V\n" +
-// " // Stack: 3, Locals: 1\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 getstatic java.lang.System.out : java.io.PrintStream [19]\n" +
-// " 3 getstatic X.class$0 : java.lang.Class [25]\n" +
-// " 6 dup\n" +
-// " 7 ifnonnull 35\n" +
-// " 10 pop\n" +
-// " 11 ldc <String \"X\"> [27]\n" +
-// " 13 invokestatic java.lang.Class.forName(java.lang.String) : java.lang.Class [28]\n" +
-// " 16 dup\n" +
-// " 17 putstatic X.class$0 : java.lang.Class [25]\n" +
-// " 20 goto 35\n" +
-// " 23 new java.lang.NoClassDefFoundError [34]\n" +
-// " 26 dup_x1\n" +
-// " 27 swap\n" +
-// " 28 invokevirtual java.lang.Throwable.getMessage() : java.lang.String [36]\n" +
-// " 31 invokespecial java.lang.NoClassDefFoundError(java.lang.String) [42]\n" +
-// " 34 athrow\n" +
-// " 35 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [45]\n" +
-// " 38 return\n" +
-// " Exception Table:\n" +
-// " [pc: 11, pc: 16] -> 23 when : java.lang.ClassNotFoundException\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 3]\n" +
-// " [pc: 38, line: 4]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 39] local: args index: 0 type: java.lang.String[]\n" +
-// "}";
-//
-// int index = actualOutput.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(actualOutput, 2));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, actualOutput);
-// }
-//}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=125570
-public void test104() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " new Object() {\n" +
- " {\n" +
- " new Object() {\n" +
- " {\n" +
- " class Y {\n" +
- " {\n" +
- " System.out.print(this.getClass());\n" +
- " System.out.print(\' \');\n" +
- " System.out.print(this.getClass().getName());\n" +
- " }\n" +
- " }\n" +
- " ;\n" +
- " new Y();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- },
- "class X$1$Y X$1$Y");
-}
-
-// enclosing instance - note that the behavior is different in 1.5
-public void test105() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static class Y { }\n" +
- " static class Z1 {\n" +
- " Runnable m;\n" +
- " Z1(Runnable p) {\n" +
- " this.m = p;\n" +
- " }\n" +
- " }\n" +
- " class Z2 extends Z1 {\n" +
- " Z2(final Y p) {\n" +
- " super(new Runnable() {\n" +
- " public void run() {\n" +
- " foo(p);\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " }\n" +
- " void foo(Y p) { }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 13)\n" +
- " foo(p);\n" +
- " ^^^^^^\n" +
- "No enclosing instance of the type X is accessible in scope\n" +
- "----------\n");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_5.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_5.java
deleted file mode 100644
index f05e168..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_5.java
+++ /dev/null
@@ -1,3456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.future.compiler.regression;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractComparableTest;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class Compliance_1_5 extends AbstractComparableTest {
-boolean docSupport = false;
-
-public Compliance_1_5(String name) {
- super(name);
-}
-
-/*
- * Toggle compiler in mode -1.5
- */
-protected Map getCompilerOptions() {
- Map options = super.getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.IGNORE);
- if (docSupport) {
- options.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR);
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED);
- }
- return options;
-}
-public static Test suite() {
- return buildComparableTestSuite(testClass());
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which does not belong to the class are skipped...
-static {
- // Names of tests to run: can be "testBugXXXX" or "BugXXXX")
-// TESTS_NAMES = new String[] { "Bug58069" };
- // Numbers of tests to run: "test<number>" will be run for each number of this array
-// TESTS_NUMBERS = new int[] { 104 };
- // Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
-// TESTS_RANGE = new int[] { 85, -1 };
-}
-/* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- // Javadoc disabled by default
- docSupport = false;
-}
-
-// test001 - moved to SuperTypeTest#test002
-// test002 - moved to SuperTypeTest#test003
-// test003 - moved to SuperTypeTest#test004
-// test004 - moved to SuperTypeTest#test005
-// test005 - moved to SuperTypeTest#test006
-// test006 - moved to SuperTypeTest#test007
-// test007 - moved to TryStatementTest#test057
-// test008 - moved to LookupTest#test074
-// test009 - moved to RuntimeTests#test1004
-
-// check actualReceiverType when array type
-public void test010() {
- this.runConformTest(
- new String[] {
- "p1/Z.java",
- "package p1; \n"+
- "public class Z { \n" +
- " public static void main(String[] arguments) { \n"+
- " String[] s = new String[]{\"SUCCESS\" }; \n" +
- " System.out.print(s.length); \n" +
- " System.out.print(((String[])s.clone())[0]); \n" +
- " } \n"+
- "} \n"
- },
- "1SUCCESS");
-}
-// test unreachable code complaints
-public void test011() {
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " void foo() { \n"+
- " while (false); \n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " do ; while (false); \n" +
- " do System.out.println(\"unreachable\"); while (false); \n" +
- " for (;false;); \n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " if (false); \n" +
- " if (false)System.out.println(\"unreachable\"); \n" +
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 5)\n" +
- " while (false) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in p1\\X.java (at line 8)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in p1\\X.java (at line 9)\n" +
- " for (;false;) System.out.println(\"unreachable\"); \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Unreachable code\n" +
- "----------\n"
- );
-}
-/// binary compatibility
-public void test012() {
- this.runConformTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n" +
- "class Store { \n" +
- " String value; \n" +
- " Store(String value){ \n" +
- " this.value = value; \n" +
- " } \n" +
- "} \n" +
- "class Top { \n" +
- " static String bar = \"Top.bar\"; \n" +
- " String foo = \"Top.foo\"; \n" +
- " Store store = new Store(\"Top.store\"); \n" +
- " static Store sstore = new Store(\"Top.sstore\"); \n" +
- " static Top ss = new Top(); \n" +
- "} \n" +
- "public class Y extends Updated { \n" +
- " public static void main(String[] arguments) { \n" +
- " new Y().test(); \n" +
- " } \n" +
- " void test() { \n" +
- " System.out.print(\"*** FIELD ACCESS ***\"); \n" +
- " System.out.print(\"*1* new Updated().bar: \" + new Updated().bar); \n" +
- " System.out.print(\"*2* new Updated().foo: \" + new Updated().foo); \n" +
- " System.out.print(\"*3* new Y().foo: \" + new Y().foo); \n" +
- " System.out.print(\"*4* new Y().bar: \" + new Y().bar); \n" +
- " System.out.print(\"*5* bar: \" + bar); \n" +
- " System.out.print(\"*6* foo: \" + foo); \n" +
- " System.out.print(\"*7* Y.bar: \" + Y.bar); \n" +
- " System.out.print(\"*8* this.bar: \" + this.bar); \n" +
- " System.out.print(\"*9* this.foo: \" + this.foo); \n" +
- " System.out.print(\"*10* store.value: \" + store.value); \n" +
- " System.out.print(\"*11* sstore.value: \" + sstore.value); \n" +
- " System.out.print(\"*12* ss.sstore.value: \" + ss.sstore.value); \n" +
- " } \n" +
- "} \n",
- "p1/Updated.java",
- "package p1; \n" +
- "public class Updated extends Top { \n" +
- "} \n"
- },
- "*** FIELD ACCESS ***"
- +"*1* new Updated().bar: Top.bar"
- +"*2* new Updated().foo: Top.foo"
- +"*3* new Y().foo: Top.foo"
- +"*4* new Y().bar: Top.bar"
- +"*5* bar: Top.bar"
- +"*6* foo: Top.foo"
- +"*7* Y.bar: Top.bar"
- +"*8* this.bar: Top.bar"
- +"*9* this.foo: Top.foo"
- +"*10* store.value: Top.store"
- +"*11* sstore.value: Top.sstore"
- +"*12* ss.sstore.value: Top.sstore");
-
- this.runConformTest(
- new String[] {
- "p1/Updated.java",
- "package p1; \n"+
- "public class Updated extends Top { \n"+
- " public static void main(String[] arguments) { \n"+
- " Y.main(arguments); \n" +
- " } \n" +
- " static String bar = \"Updated.bar\"; \n" +
- " String foo = \"Updated.foo\"; \n" +
- " Store store = new Store(\"Updated.store\"); \n" +
- " static Store sstore = new Store(\"Updated.sstore\"); \n" +
- " static Updated ss = new Updated(); \n" +
- "} \n"
- },
- "*** FIELD ACCESS ***"
- +"*1* new Updated().bar: Updated.bar"
- +"*2* new Updated().foo: Updated.foo"
- +"*3* new Y().foo: Updated.foo"
- +"*4* new Y().bar: Updated.bar"
- +"*5* bar: Updated.bar"
- +"*6* foo: Updated.foo"
- +"*7* Y.bar: Updated.bar"
- +"*8* this.bar: Updated.bar"
- +"*9* this.foo: Updated.foo"
- +"*10* store.value: Updated.store"
- +"*11* sstore.value: Updated.sstore"
- +"*12* ss.sstore.value: Top.sstore",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-// binary compatibility
-public void test013() {
- this.runConformTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n" +
- "class Store { \n" +
- " String value; \n" +
- " Store(String value){ \n" +
- " this.value = value; \n" +
- " } \n" +
- "} \n" +
- "class Top { \n" +
- " static String bar() { return \"Top.bar()\"; } \n" +
- " String foo() { return \"Top.foo()\"; } \n" +
- "} \n" +
- "public class Y extends Updated { \n" +
- " public static void main(String[] arguments) { \n" +
- " new Y().test(); \n" +
- " } \n" +
- " void test() { \n" +
- " System.out.print(\"*** METHOD ACCESS ***\"); \n" +
- " System.out.print(\"*1* new Updated().bar(): \" + new Updated().bar()); \n" +
- " System.out.print(\"*2* new Updated().foo(): \" + new Updated().foo()); \n" +
- " System.out.print(\"*3* new Y().foo(): \" + new Y().foo()); \n" +
- " System.out.print(\"*4* new Y().bar(): \" + new Y().bar()); \n" +
- " System.out.print(\"*5* bar(): \" + bar()); \n" +
- " System.out.print(\"*6* foo(): \" + foo()); \n" +
- " System.out.print(\"*7* Y.bar(): \" + Y.bar()); \n" +
- " System.out.print(\"*8* this.bar(): \" + this.bar()); \n" +
- " System.out.print(\"*9* this.foo(): \" + this.foo()); \n" +
- " } \n" +
- "} \n",
- "p1/Updated.java",
- "package p1; \n" +
- "public class Updated extends Top { \n" +
- "} \n"
- },
- "*** METHOD ACCESS ***"
- +"*1* new Updated().bar(): Top.bar()"
- +"*2* new Updated().foo(): Top.foo()"
- +"*3* new Y().foo(): Top.foo()"
- +"*4* new Y().bar(): Top.bar()"
- +"*5* bar(): Top.bar()"
- +"*6* foo(): Top.foo()"
- +"*7* Y.bar(): Top.bar()"
- +"*8* this.bar(): Top.bar()"
- +"*9* this.foo(): Top.foo()");
-
- this.runConformTest(
- new String[] {
- "p1/Updated.java",
- "package p1; \n"+
- "public class Updated extends Top { \n"+
- " public static void main(String[] arguments) { \n"+
- " Y.main(arguments); \n" +
- " } \n" +
- " static String bar() { return \"Updated.bar()\"; } \n" +
- " String foo() { return \"Updated.foo()\"; } \n" +
- "} \n"
- },
- "*** METHOD ACCESS ***"
- +"*1* new Updated().bar(): Updated.bar()"
- +"*2* new Updated().foo(): Updated.foo()"
- +"*3* new Y().foo(): Updated.foo()"
- +"*4* new Y().bar(): Updated.bar()"
- +"*5* bar(): Updated.bar()"
- +"*6* foo(): Updated.foo()"
- +"*7* Y.bar(): Updated.bar()"
- +"*8* this.bar(): Updated.bar()"
- +"*9* this.foo(): Updated.foo()",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-
-public void test014() {
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n" +
- "class T { \n" +
- " void foo(boolean b) { \n" +
- " System.out.print(\"T.foo(boolean)#\"); \n" +
- " } \n" +
- " boolean bar = false; \n" +
- " class Member { \n" +
- " void display(){ System.out.print(\"T.Member#\"); } \n" +
- " } \n" +
- "} \n" +
- "public class X { \n" +
- " void foo(int i) { \n" +
- " System.out.println(\"X.foo(int)#\"); \n" +
- " } \n" +
- " int bar; \n" +
- " class Member { \n" +
- " void display(){ System.out.print(\"X.Member#\"); } \n" +
- " } \n" +
- " public static void main(String[] arguments) { \n" +
- " new X().bar(); \n" +
- " } \n" +
- " void bar() { \n" +
- " new T() { \n" +
- " { \n" +
- " foo(true); \n" +
- " System.out.print((boolean)bar + \"#\"); \n" +
- " Member m = new Member(); \n" +
- " m.display(); \n" +
- " } \n" +
- " }; \n" +
- " } \n" +
- "} \n"
- },
- "T.foo(boolean)#false#T.Member#");
-}
-
-/*
- * check handling of default abstract methods
- */
-public void test015() {
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " C c = new C() { \n"+
- " public void doSomething(){ \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " }; \n"+
- " c.doSomething(); \n"+
- " } \n"+
- "} \n"+
- "interface I { \n"+
- " void doSomething(); \n"+
- "} \n"+
- "abstract class C implements I { \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-public void test016() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(boolean b) {} \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 9)\n" +
- " foo(0); \n" +
- " ^^^\n" +
- "The method foo(boolean) in the type T is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-
-public void test017() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(boolean b) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(false); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-
-public void test018() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(int j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-public void test019() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(int j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "class U { \n"+
- " void foo(int j) { System.out.println(\"FAILED\"); } \n"+
- "} \n"+
- "public class X extends U { \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-public void test020() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(int j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "class U { \n"+
- " void foo(boolean j) { System.out.println(\"FAILED\"); } \n"+
- "} \n"+
- "public class X extends U { \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-public void test020a() {
- this.runConformTest(
- new String[] {
- "X.java",
- "class T { \n"+
- " void foo(U j) { System.out.println(\"SUCCESS\"); } \n"+
- "} \n"+
- "class U { \n"+
- "} \n"+
- "public class X extends U { \n"+
- " void foo(X j) { System.out.println(\"FAILED\"); } \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(new X()); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().bar(); \n" +
- " } \n"+
- "} \n"
- },
- "SUCCESS");
-}
-// binary check for 11511
-public void test021() {
- this.runConformTest(
- new String[] {
- "p1/Z.java",
- "package p1; \n" +
- "public class Z extends AbstractA { \n" +
- " public static void main(String[] arguments) { \n" +
- " new Z().init(); \n" +
- " } \n" +
- "} \n" +
- "abstract class AbstractB implements K { \n" +
- " public void init() { \n" +
- " System.out.println(\"AbstractB.init()\"); \n" +
- " } \n" +
- "} \n" +
- "interface K { \n" +
- " void init(); \n" +
- " void init(int i); \n" +
- "} \n",
- "p1/AbstractA.java",
- "package p1; \n" +
- "public abstract class AbstractA extends AbstractB implements K { \n" +
- " public void init(int i) { \n" +
- " } \n" +
- "} \n"
- },
- "AbstractB.init()"); // no special vm args
-
- // check that "new Z().init()" is bound to "Z.init()"
- String computedReferences = findReferences(OUTPUT_DIR + "/p1/Z.class");
- boolean check =
- computedReferences.indexOf("constructorRef/Z/0") >= 0
- && computedReferences.indexOf("methodRef/init/0") >= 0;
- if (!check){
- System.out.println(computedReferences);
- }
- assertTrue("did not bind 'new Z().init()' to Z.init()'", check);
-}
- /*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis
- */
-public void test022() {
-
- this.runNegativeTest(
- new String[] {
- "p1/T.java",
- "package p1; \n"+
- "interface II {} \n"+
- "class TT { \n"+
- " void foo(boolean b) {} \n"+
- " void foo(int i, boolean b) {} \n"+
- " void foo(String s) {} \n"+
- "} \n"+
- "public abstract class T implements II { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(0); // should say that foo(int, boolean) isn't applicable \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void boo() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(true); // should not complain about ambiguity \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\T.java (at line 13)\n" +
- " foo(0); // should say that foo(int, boolean) isn\'t applicable \n" +
- " ^^^\n" +
- "The method foo(int, boolean) in the type TT is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-
- /*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis
- */
-public void test023() {
-
- this.runNegativeTest(
- new String[] {
- "p1/T.java",
- "package p1; \n"+
- "interface II {} \n"+
- "abstract class TT { \n"+ // 259+ABSTRACT
- " void foo(boolean b) {} \n"+
- " void foo(int i, boolean b) {} \n"+
- " void foo(String s) {} \n"+
- "} \n"+
- "public abstract class T implements II { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(0); // should say that foo(int, boolean) isn't applicable \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void boo() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(true); // should complain ambiguity \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\T.java (at line 13)\n" +
- " foo(0); // should say that foo(int, boolean) isn\'t applicable \n" +
- " ^^^\n" +
- "The method foo(int, boolean) in the type TT is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis
- */
-public void test024() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "interface II {} \n"+
- "abstract class T implements II { \n"+
- " void foo(boolean b) {} \n"+
- " void foo(int i, boolean b) {} \n"+
- "} \n"+
- "abstract class TT implements II { \n"+
- " void foo(boolean b) {} \n"+
- "} \n"+
- "public class X { \n"+
- " void foo(int i) {} \n"+
- " void bar() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(0); // javac says foo cannot be resolved because of multiple matches \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void bar2() { \n"+
- " new TT() { \n"+
- " { \n"+
- " foo(0); // should say that foo(boolean) isn't applicable \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " void boo() { \n"+
- " new T() { \n"+
- " { \n"+
- " foo(true); // should complain ambiguity \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 15)\n" +
- " foo(0); // javac says foo cannot be resolved because of multiple matches \n" +
- " ^^^\n" +
- "The method foo(int, boolean) in the type T is not applicable for the arguments (int)\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 22)\n" +
- " foo(0); // should say that foo(boolean) isn\'t applicable \n" +
- " ^^^\n" +
- "The method foo(boolean) in the type TT is not applicable for the arguments (int)\n" +
- "----------\n");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis (no matter if super is abstract or not)
- */
-public void test025() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X extends AbstractY { \n"+
- " void bar(){ \n"+
- " init(\"hello\"); \n"+
- " } \n"+
- "} \n"+
- "abstract class AbstractY implements I { \n"+
- "} \n"+
- "interface I { \n"+
- " void init(String s, int i); \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 2)\n" +
- " public class X extends AbstractY { \n" +
- " ^\n" +
- "The type X must implement the inherited abstract method I.init(String, int)\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 4)\n" +
- " init(\"hello\"); \n" +
- " ^^^^\n" +
- "The method init(String, int) in the type I is not applicable for the arguments (String)\n" +
- "----------\n");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11511
- * variant - applicable error diagnosis (no matter if super is abstract or not)
- */
-public void test026() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X extends AbstractY { \n"+
- " void bar(){ \n"+
- " init(\"hello\"); \n"+
- " } \n"+
- "} \n"+
- "class AbstractY implements I { \n"+
- "} \n"+
- "interface I { \n"+
- " void init(String s, int i); \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " init(\"hello\"); \n" +
- " ^^^^\n" +
- "The method init(String, int) in the type I is not applicable for the arguments (String)\n" +
- "----------\n" +
- "2. ERROR in p1\\X.java (at line 7)\n" +
- " class AbstractY implements I { \n" +
- " ^^^^^^^^^\n" +
- "The type AbstractY must implement the inherited abstract method I.init(String, int)\n" +
- "----------\n");
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11922
- * should report unreachable empty statement
- */
-public void test027() {
-
- this.runNegativeTest(
- new String[] {
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " for (;false;p()); \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n"+
- " static void p(){ \n"+
- " System.out.println(\"FAILED\"); \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 4)\n" +
- " for (;false;p()); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=12445
- * should report unreachable empty statement
- */
-public void test028() {
-
- this.runConformTest(
- new String[] {
- "p1/X.java",
- "package p1; \n" +
- "interface FooInterface { \n" +
- " public boolean foo(int a); \n" +
- " public boolean bar(int a); \n" +
- "} \n" +
- "public class X extends Z { \n" +
- " public boolean foo(int a){ return true; } \n" +
- " public boolean bar(int a){ return false; } \n" +
- " public static void main(String[] arguments) { \n"+
- " System.out.println(new X().test(0)); \n"+
- " } \n" +
- "}\n" +
- "abstract class Z implements FooInterface { \n" +
- " public boolean foo(int a, int b) { \n" +
- " return true; \n" +
- " } \n" +
- " public String test(int a) { \n" +
- " boolean result = foo(a); \n" +
- " if (result) \n" +
- " return \"SUCCESS\"; \n" +
- " else \n" +
- " return \"FAILED\"; \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * verify error on qualified name ref in 1.4
- */
-public void test029() {
-
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args) { \n" +
- " new X(); \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " Woof woof_1; \n" +
- " public class Honk { \n" +
- " Integer honks; \n" +
- " } \n" +
- " public class Meow { \n" +
- " Honk honk_1; \n" +
- " } \n" +
- " public class Woof { \n" +
- " Meow meow_1; \n" +
- " } \n" +
- " public void setHonks(int num) { \n" +
- " // This is the line that causes the VerifyError \n" +
- " woof_1.meow_1.honk_1.honks = new Integer(num); \n" +
- " // Here is equivalent code that does not cause the error. \n" +
- " // Honk h = woof_1.moo_1.meow_1.honk_1; \n" +
- " // h.honks = new Integer(num); \n" +
- " } \n" +
- "} \n"
- },
- "SUCCESS");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * 1.4 signals invocations of non-visible abstract protected method implementations.
- */
-public void test030() {
-
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args){ \n" +
- " new q.X2().foo(\"String\"); \n" +
- " new q.X2().bar(\"String\"); \n" +
- " new q.X2().barbar(\"String\"); \n" +
- " new q.X2().baz(\"String\"); \n" +
- " } \n" +
- "} \n",
-
- "p/X1.java",
- "package p; \n" +
- "public abstract class X1 { \n" +
- " protected void foo(Object o){ System.out.println(\"X1.foo(Object)\"); } \n" +
- " protected void bar(Object o){ System.out.println(\"X1.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X1.barbar(Object)\"); } \n" +
- " protected void baz(Object o) { System.out.println(\"X1.baz(Object)\"); } \n" +
- "} \n",
-
- "q/X2.java",
- "package q; \n" +
- "public class X2 extends p.X1 { \n" +
- " protected void foo(int i) { System.out.println(\"X2.foo(int)\"); } \n" +
- " protected void bar(Object o) { System.out.println(\"X2.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " protected void baz(String s) { System.out.println(\"X2.baz(String)\"); } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 5)\n" +
- " new q.X2().bar(\"String\"); \n" +
- " ^^^\n" +
- "The method bar(Object) from the type X2 is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 6)\n" +
- " new q.X2().barbar(\"String\"); \n" +
- " ^^^^^^\n" +
- "The method barbar(Object) from the type X2 is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in q\\X2.java (at line 4)\n" +
- " protected void bar(Object o) { System.out.println(\"X2.bar(Object)\"); } \n" +
- " ^^^^^^^^^^^^^\n" +
- "The method bar(Object) of type X2 should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "2. WARNING in q\\X2.java (at line 5)\n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The method X2.barbar(Object) does not override the inherited method from X1 since it is private to a different package\n" +
- "----------\n");
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * 1.4 signals invocations of non-visible abstract protected method implementations.
- */
-public void test031() {
-
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X extends q.X2 { \n" +
- " public static void main(String[] args){ \n" +
- " new X().doSomething(); \n" +
- " } \n" +
- " void doSomething(){ \n" +
- " foo(\"String\"); \n" +
- " bar(\"String\"); \n" +
- " barbar(\"String\"); \n" +
- " baz(\"String\"); \n" +
- " } \n" +
- "} \n",
-
- "p/X1.java",
- "package p; \n" +
- "public abstract class X1 { \n" +
- " protected void foo(Object o){ System.out.println(\"X1.foo(Object)\"); } \n" +
- " protected void bar(Object o){ System.out.println(\"X1.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X1.barbar(Object)\"); } \n" +
- " protected void baz(Object o) { System.out.println(\"X1.baz(Object)\"); } \n" +
- "} \n",
-
- "q/X2.java",
- "package q; \n" +
- "public class X2 extends p.X1 { \n" +
- " protected void foo(int i) { System.out.println(\"X2.foo(int)\"); } \n" +
- " protected void bar(Object o) { System.out.println(\"X2.bar(Object)\"); } \n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " protected void baz(String s) { System.out.println(\"X2.baz(String)\"); } \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 9)\n" +
- " barbar(\"String\"); \n" +
- " ^^^^^^\n" +
- "The method barbar(Object) from the type X2 is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in q\\X2.java (at line 4)\n" +
- " protected void bar(Object o) { System.out.println(\"X2.bar(Object)\"); } \n" +
- " ^^^^^^^^^^^^^\n" +
- "The method bar(Object) of type X2 should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "2. WARNING in q\\X2.java (at line 5)\n" +
- " void barbar(Object o){ System.out.println(\"X2.barbar(Object)\"); } \n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "The method X2.barbar(Object) does not override the inherited method from X1 since it is private to a different package\n" +
- "----------\n"
-);
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21580
- * 1.4 signals invocations of non-visible abstract protected field implementations.
- */
-public void test032() {
-
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args){ \n" +
- " System.out.println(new q.X2().foo); \n" +
- " System.out.println(new q.X2().bar); \n" +
- " } \n" +
- "} \n",
-
- "p/X1.java",
- "package p; \n" +
- "public abstract class X1 { \n" +
- " protected String foo = \"X1.foo\"; \n" +
- " String bar = \"X1.bar\"; \n" +
- "} \n",
-
- "q/X2.java",
- "package q; \n" +
- "public class X2 extends p.X1 { \n" +
- " protected String foo = \"X2.foo\"; \n" +
- " String bar = \"X2.bar\"; \n" +
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 4)\n" +
- " System.out.println(new q.X2().foo); \n" +
- " ^^^\n" +
- "The field X2.foo is not visible\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 5)\n" +
- " System.out.println(new q.X2().bar); \n" +
- " ^^^\n" +
- "The field X2.bar is not visible\n" +
- "----------\n");
-}
-
-/*
- * Initialization of synthetic fields prior to super constructor call
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23075
- */
-public void test033() {
-
- this.runConformTest(
- new String[] {
- "A.java",
- "public class A { \n"+
- " public int m; \n"+
- " public void pp() { \n"+
- " C c = new C(4); \n"+
- " System.out.println(c.get()); \n"+
- " } \n"+
- " public static void main(String[] args) { \n"+
- " A a = new A(); \n"+
- " try { \n"+
- " a.pp(); \n"+
- " System.out.println(\"SyntheticInit BEFORE SuperConstructorCall\"); \n"+
- " } catch(NullPointerException e) { \n"+
- " System.out.println(\"SyntheticInit AFTER SuperConstructorCall\"); // should no longer occur with target 1.4 \n"+
- " } \n"+
- " } \n"+
- " class C extends B { \n"+
- " public C(int x1) { \n"+
- " super(x1); \n"+
- " } \n"+
- " protected void init(int x1) { \n"+
- " x = m * x1; // <- NULL POINTER EXCEPTION because of m \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class B { \n"+
- " int x; \n"+
- " public B(int x1) { \n"+
- " init(x1); \n"+
- " } \n"+
- " protected void init(int x1) { \n"+
- " x = x1; \n"+
- " } \n"+
- " public int get() { \n"+
- " return x; \n"+
- " } \n"+
- "} \n"
- },
- "0\n" +
- "SyntheticInit BEFORE SuperConstructorCall");
-}
-/*
- * Initialization of synthetic fields prior to super constructor call - NPE check
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25174
- */
-public void test034() {
-
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new X2(); \n"+
- " } \n"+
- " class X1 { \n"+
- " X1(){ \n"+
- " this.baz(); \n"+
- " } \n"+
- " void baz() { \n"+
- " System.out.println(\"-X1.baz()\"); \n"+
- " } \n"+
- " } \n"+
- " class X2 extends X1 { \n"+
- " void baz() { \n"+
- " System.out.print(X.this==null ? \"X.this == null\" : \"X.this != null\"); \n"+
- " X1 x1 = X.this.new X1(){ \n"+
- " void baz(){ \n"+
- " System.out.println(\"-X$1.baz()\"); \n"+
- " } \n"+
- " }; \n"+
- " } \n"+
- " } \n"+
- "}\n",
- },
- "X.this != null-X$1.baz()");
-}
-
-public void test035() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " class Y { Y(int i){} } \n"+
- " public static void main(String[] arguments) { \n"+
- " int i = 1; \n" +
- " try { \n" +
- " X x =null; \n" +
- " x.new Y(++i); \n" + // i won't get incremented before NPE
- " System.out.println(\"FAILED\"); \n" +
- " } catch(NullPointerException e){ \n" +
- " System.out.println(\"SUCCESS:\"+i); \n" +
- " } \n" +
- " } \n"+
- "} \n",
- },
- "SUCCESS:1"
- );
-}
-
-public void test036() {
- this.runConformTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " class Y {} \n"+
- " static class Z extends Y { \n"+
- " Z (X x){ \n"+
- " x.super(); \n" +
- " } \n"+
- " } \n"+
- " public static void main(String[] arguments) { \n"+
- " try { \n" +
- " new Z(null); \n" +
- " System.out.println(\"FAILED\"); \n" +
- " } catch(NullPointerException e){ \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " } \n"+
- "} \n",
- },
- "SUCCESS"
- );
-}
-
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=24744
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23096
- *
- * NOTE: since JLS got revised to allow unterminated line comments (32476)
- */
-public void test037() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:");
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n"+
- "public class X {\n"+
- "}\n"+
- "// TODO: something"
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 4)\n" +
- " // TODO: something\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "TODO: something\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-/*
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=24833
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23096
- *
- * NOTE: since JLS got revised to allow unterminated line comments (32476)
- */
-public void test038() {
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:");
- this.runNegativeTest(
- new String[] {
- "X.java",
- "// TODO: something"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 1)\n" +
- " // TODO: something\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "TODO: something\n" +
- "----------\n",
- null,
- true,
- customOptions);
-}
-
-/*
- * unreachable empty statement/block are diagnosed in 1.3
- */
-public void test039() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args){ \n"+
- " for (;null != null;); \n"+
- " for (;null != null;){} \n"+
- " for (;false;); \n"+
- " for (;false;){} \n"+
- " while (false); \n"+
- " while (false){} \n"+
- " if (false) {} else {} \n"+
- " if (false) ; else ; \n"+
- " System.out.println(\"FAILED\"); \n" +
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " for (;false;); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " for (;false;){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " while (false); \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " while (false){} \n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-// jls6.5.5.1 - simple type names favor member type over toplevel one.
-//http://bugs.eclipse.org/bugs/show_bug.cgi?id=30705
-public void test040() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " interface Homonym {} \n"+ // takes precedence over others.
- " void foo() { \n"+
- " class Homonym extends X { \n"+
- " { \n"+
- " class Y extends Homonym {}; \n"+ // X$Homonym
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"+
- "class Homonym extends X { \n"+
- " { \n"+
- " class Y extends Homonym {}; \n"+ // X$Homonym
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 4)\n" +
- " class Homonym extends X { \n" +
- " ^^^^^^^\n" +
- "The type Homonym is hiding the type X.Homonym\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 6)\n" +
- " class Y extends Homonym {}; \n" +
- " ^^^^^^^\n" +
- "The type X.Homonym cannot be the superclass of Y; a superclass must be a class\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 13)\n" +
- " class Y extends Homonym {}; \n" +
- " ^^^^^^^\n" +
- "The type X.Homonym cannot be the superclass of Y; a superclass must be a class\n" +
- "----------\n");
-}
-/*
- * 30856 - 1.4 compliant mode should consider abstract method matches
- */
-public void test041() {
- this.runConformTest(
- new String[] {
- "p/X.java", //================================
- "package p; \n" +
- "public class X { \n" +
- " void foo(int i, float f){} \n" +
- " public static void main(String[] args) { \n" +
- " q.Y y = new q.Y.Z(); \n" +
- " y.bar(); \n" +
- " } \n" +
- "} \n",
- "q/Y.java", //================================
- "package q; \n" +
- "public abstract class Y extends p.X implements I { \n" +
- " public void bar(){ foo(1, 2); } \n" +
- " public static class Z extends Y { \n" +
- " public void foo(float f, int i) { \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " } \n" +
- "} \n" +
- "interface I { \n" +
- " void foo(float f, int i); \n" +
- "} \n",
- },
- "SUCCESS");
-}
-/*
- * variation - 30856 - 1.4 compliant mode should consider abstract method matches
- */
-public void test042() {
- this.runConformTest(
- new String[] {
- "p/X.java", //================================
- "package p; \n" +
- "public class X extends X0 { \n" +
- " void foo(int i, float f){} \n" +
- " public static void main(String[] args) { \n" +
- " q.Y y = new q.Y.Z(); \n" +
- " y.bar(); \n" +
- " } \n" +
- "} \n" +
- "class X0 { \n" +
- " void foo(int i, double d){} \n" + // extra match
- "} \n",
- "q/Y.java", //================================
- "package q; \n" +
- "public abstract class Y extends p.X implements I { \n" +
- " public void bar(){ foo(1, 2); } \n" +
- " public static class Z extends Y { \n" +
- " public void foo(float f, int i) { \n" +
- " System.out.println(\"SUCCESS\"); \n" +
- " } \n" +
- " } \n" +
- "} \n" +
- "interface I { \n" +
- " void foo(float f, int i); \n" +
- "} \n",
- },
- "SUCCESS");
-}
-
-// binary compatibility
-public void _test043() {
- this.runConformTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n" +
- "public class Y extends A implements I { \n" +
- " public static void main(String[] args) { \n" +
- " Y.printValues(); \n" +
- " } \n" +
- " public static void printValues() { \n" +
- " System.out.println(\"i=\"+i+\",j=\"+j+\",Y.i=\"+Y.i+\",Y.j=\"+Y.j); \n" +
- " } \n" +
- "} \n",
- "p1/A.java",
- "package p1; \n" +
- "public class A { \n" +
- " static int i = 1; \n" +
- "} \n",
- "p1/I.java",
- "package p1; \n" +
- "interface I { \n" +
- " int j = \"aa\".length(); \n" +
- "} \n",
- },
- "i=1,j=2,Y.i=1,Y.j=2");
-
- this.runConformTest(
- new String[] {
- "p1/A.java",
- "package p1; \n" +
- "public class A { \n" +
- " static int j = 3; \n" +
- " public static void main(String[] args) { \n" +
- " Y.printValues(); \n" +
- " } \n" +
- "} \n",
- "p1/I.java",
- "package p1; \n" +
- "interface I { \n" +
- " int j = \"aaaa\".length(); \n" +
- "} \n",
- },
- "i=4,j=3,Y.i=4,Y.j=3",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-///*
-// * array.clone() should use array type in methodRef
-// * http://bugs.eclipse.org/bugs/show_bug.cgi?id=36307
-// */
-//public void test044() {
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " public static void main(String[] args) {\n" +
-// " args.clone(); \n"+
-// " System.out.println(\"SUCCESS\");\n" +
-// " }\n" +
-// "}\n",
-// },
-// "SUCCESS");
-//
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String actualOutput = null;
-// try {
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator +"X.class"));
-// actualOutput =
-// disassembler.disassemble(
-// classFileBytes,
-// "\n",
-// ClassFileBytesDisassembler.DETAILED);
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue("ClassFormatException", false);
-// } catch (IOException e) {
-// assertTrue("IOException", false);
-// }
-//
-// String expectedOutput =
-// " 1 invokevirtual java.lang.String[].clone() : java.lang.Object [16]\n";
-//
-// int index = actualOutput.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(actualOutput, 2));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, actualOutput);
-// }
-//}
-// 39172
-public void test045() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p; \n" +
- "public class X { \n" +
- " public static void main(String[] args) { \n" +
- " System.out.println(\"FAILED\"); \n" +
- " return;; \n" + // unreachable empty statement - must complain in 1.4 mode
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 5)\n" +
- " return;; \n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39467
- * should diagnose missing abstract method implementation
- */
-public void test046() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X extends Y {\n" +
- "}\n" +
- "abstract class Y extends Z {\n" +
- " public abstract void foo();\n" +
- "}\n" +
- "abstract class Z extends T {\n" +
- "}\n" +
- "class T implements I {\n" +
- " public void foo(){}\n" +
- "}\n" +
- "interface I {\n" +
- " public void foo ();\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " public class X extends Y {\n" +
- " ^\n" +
- "The type X must implement the inherited abstract method Y.foo()\n" +
- "----------\n" +
- "2. WARNING in X.java (at line 4)\n" +
- " public abstract void foo();\n" +
- " ^^^^^\n" +
- "The method foo() of type Y should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40442
- * Abstract class fails to invoke interface-defined method in 1.4 compliance mode.
- */
-public void test047() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends AbstractDoubleAlgorithm {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " ((ObjectAlgorithm)(new X())).operate(new Double(0));\n" +
- " }\n" +
- " public void operate(Double pDouble)\n" +
- " {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n" +
- "abstract class AbstractDoubleAlgorithm implements DoubleAlgorithm {\n" +
- " public void operate(Object pObject)\n" +
- " {\n" +
- " operate((Double)pObject);\n" +
- " }\n" +
- "}\n" +
- "interface DoubleAlgorithm extends ObjectAlgorithm {\n" +
- " void operate(Double pDouble);\n" +
- "}\n" +
- "interface ObjectAlgorithm {\n" +
- " void operate(Object pObject);\n" +
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40442
- * Abstract class fails to invoke interface-defined method in 1.4 compliance mode.
- * variation with 2 found methods
- */
-public void test048() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends AbstractDoubleAlgorithm {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " ((ObjectAlgorithm)(new X())).operate(new Double(0));\n" +
- " }\n" +
- " public void operate(Double pDouble)\n" +
- " {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n" +
- "abstract class AbstractDoubleAlgorithm implements DoubleAlgorithm {\n" +
- " public void operate(Object pObject)\n" +
- " {\n" +
- " operate((Double)pObject);\n" +
- " }\n" +
- " public void operate(X x) {}\n" +
- "}\n" +
- "interface DoubleAlgorithm extends ObjectAlgorithm {\n" +
- " void operate(Double pDouble);\n" +
- "}\n" +
- "interface ObjectAlgorithm {\n" +
- " void operate(Object pObject);\n" +
- "}"
- },
- "SUCCESS"
- );
-}
-/**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=41278
- */
-public void test049() {
- this.runNegativeTest(
- new String[] {
- "pa/Caller.java",
- "package pa;\n" +
- "import pb.Concrete;\n" +
- "public class Caller {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " Concrete aConcrete = new Concrete(); \n" +
- " aConcrete.callme();\n" +
- " }\n" +
- "}\n",
- "pa/Abstract.java",
- "package pa;\n" +
- "public abstract class Abstract {\n" +
- "\n" +
- " protected void callme(){}\n" +
- "}\n",
- "pb/Concrete.java",
- "package pb;\n" +
- "public class Concrete extends pa.Abstract {\n" +
- "\n" +
- " protected void callme(){ System.out.println(\"SUCCESS\"); }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in pa\\Caller.java (at line 7)\n" +
- " aConcrete.callme();\n" +
- " ^^^^^^\n" +
- "The method callme() from the type Concrete is not visible\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in pb\\Concrete.java (at line 4)\n" +
- " protected void callme(){ System.out.println(\"SUCCESS\"); }\n" +
- " ^^^^^^^^\n" +
- "The method callme() of type Concrete should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n");
-}
-
-public void test050() {
- this.runNegativeTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " int a1 = 1;\n" +
- " int a2 = 1;\n" +
- " a1 = 2;\n" +
- " while (false) {};\n" +
- " a2 = 2;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 10)\n" +
- " while (false) {};\n" +
- " ^^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-
-public void test051() {
- this.runNegativeTest(new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String args[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " int a1 = 1;\n" +
- " int a2 = 1;\n" +
- " a1 = 2;\n" +
- " while (false);\n" +
- " a2 = 2;\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in p\\X.java (at line 10)\n" +
- " while (false);\n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-
-public void test052() {
- this.runNegativeTest(
- new String[] {
- "p/A.java",
- "package p;\n" +
- "public class A {\n" +
- " public static void main(String[] argv) {\n" +
- " foo();\n" +
- " }\n" +
- " private int i;\n" +
- " static class Y extends X {\n" +
- " int x = i;\n" +
- " }\n" +
- " public static void foo() {\n" +
- " return;\n" +
- " }\n" +
- "}",
-
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " foo();\n" +
- " }\n" +
- " public static void foo() {\n" +
- " int a1 = 1;\n" +
- " int a2 = 1;\n" +
- " a1 = 2;\n" +
- " while (false);\n" +
- " a2 = 2;\n" +
- " }\n" +
- "}"
- },
- "----------\n" +
- "1. WARNING in p\\A.java (at line 6)\n" +
- " private int i;\n" +
- " ^\n" +
- "The field A.i is never read locally\n" +
- "----------\n" +
- "2. ERROR in p\\A.java (at line 8)\n" +
- " int x = i;\n" +
- " ^\n" +
- "Cannot make a static reference to the non-static field i\n" +
- "----------\n" +
- "----------\n" +
- "1. ERROR in p\\X.java (at line 10)\n" +
- " while (false);\n" +
- " ^\n" +
- "Unreachable code\n" +
- "----------\n");
-}
-
-public void test053() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "class X {\n" +
- " static class A {\n" +
- " interface I {\n" +
- " int a = 3;\n" +
- " }\n" +
- " } \n" +
- " interface I { \n" +
- " int b = 4;\n" +
- " }\n" +
- " class Y extends A implements I {\n" +
- " Object F() {\n" +
- " return new I() {\n" +
- " int c = a; // WE SHOULD NOT BE ABLE TO SEE BOTH a and b\n" +
- " int d = b; // WE SHOULD NOT BE ABLE TO SEE BOTH a and b\n" +
- " };\n" +
- " }\n" +
- " }\n" +
- "}",
- }
- );
-}
-
-public void test054() {
- this.runConformTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " static class A {\n" +
- " interface I {\n" +
- " int a = 3;\n" +
- " void foo();\n" +
- " }\n" +
- " }\n" +
- " interface I {\n" +
- " int a = 4;\n" +
- " void foo();\n" +
- " }\n" +
- " class Y extends A implements I {\n" +
- " public void foo() {\n" +
- " new I() {\n" +
- " public void foo() {\n" +
- " System.out.println(\"X$1::foo-\" + a);\n" +
- " }\n" +
- " }\n" +
- " .foo();\n" +
- " }\n" +
- " }\n" +
- "public static void main(String argv[]) {\n" +
- " new X().new Y().foo();\n" +
- "}\n" +
- "}",
- }
- );
-}
-public void test055() {
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "public class X {\n" +
- " static class A {\n" +
- " interface I2 {\n" +
- " int a = 3;\n" +
- " void foo();\n" +
- " }\n" +
- " }\n" +
- " interface I1 {\n" +
- " int a = 4;\n" +
- " void foo(int a);\n" +
- " }\n" +
- " class Y extends A implements I1 {\n" +
- " public void foo(int a) {\n" +
- " new I2() {\n" +
- " public void foo() {\n" +
- " System.out.println(\"X$1::foo-\" + a);\n" +
- " }\n" +
- " }\n" +
- " .foo();\n" +
- " }\n" +
- " }\n" +
- "public static void main(String argv[]) {\n" +
- " new X().new Y().foo(8);\n" +
- "}\n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in p\\X.java (at line 11)\n" +
- " void foo(int a);\n" +
- " ^\n" +
- "The parameter a is hiding a field from type X.I1\n" +
- "----------\n" +
- "2. WARNING in p\\X.java (at line 14)\n" +
- " public void foo(int a) {\n" +
- " ^\n" +
- "The parameter a is hiding a field from type X.I1\n" +
- "----------\n"
- );
-}
-
-public void test056() {
- this.runConformTest(
- new String[] {
- "p/MethodQualification.java",
- "package p;\n" +
- "public class MethodQualification {\n" +
- " void foo() {\n" +
- " System.out.println(\"Inherited foo() for anonymous type\");\n" +
- " class Local {\n" +
- " void foo(){\n" +
- " System.out.println(\"Enclosing foo() for anonymous type\");\n" +
- " new MethodQualification () { {foo();} };\n" +
- " }\n" +
- " };\n" +
- " } \n" +
- "}",
- },
- ""
- );
-}
-
-public void test057() {
- this.runConformTest(
- new String[] {
- "p/AG.java",
- "package p;\n" +
- "/**\n" +
- " * 1F9RITI\n" +
- " */\n" +
- "public class AG {\n" +
- " public class X {\n" +
- " class B {\n" +
- " int intValueOfB = -9;\n" +
- " }\n" +
- " class SomeInner extends A {\n" +
- " void someMethod() {\n" +
- " int i = new B().intValueOfB; \n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class A {\n" +
- " class B {\n" +
- " int intValueOfB = -9;\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- ""
- );
-}
-
-public void test058() {
- this.runConformTest(
- new String[] {
- "p/AE.java",
- "package p;\n" +
- "/**\n" +
- " * 1F9RITI\n" +
- " */\n" +
- "public class AE {\n" +
- " public class X {\n" +
- " int intValue = 153;\n" +
- " class SomeInner extends A {\n" +
- " void someMethod() {\n" +
- " int i = intValue; \n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class A {\n" +
- " int intValue = 153;\n" +
- " }\n" +
- "}",
- },
- ""
- );
-}
-
-public void test059() {
- this.runNegativeTest(
- new String[] {
- "p/FieldQualification.java",
- "package p;\n" +
- "public class FieldQualification {\n" +
- " String field = \"Inherited field for anonymous type\";\n" +
- "void foo() {\n" +
- " class Local {\n" +
- " String field = \"Enclosing field for anonymous type\";\n" +
- " void foo() {\n" +
- " System.out.println(\"Enclosing foo() for anonymous type\");\n" +
- " new FieldQualification() {\n" +
- " {\n" +
- " System.out.println(field);\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- "}",
- },
- "----------\n" +
- "1. WARNING in p\\FieldQualification.java (at line 5)\n" +
- " class Local {\n" +
- " ^^^^^\n" +
- "The type Local is never used locally\n" +
- "----------\n" +
- "2. WARNING in p\\FieldQualification.java (at line 6)\n" +
- " String field = \"Enclosing field for anonymous type\";\n" +
- " ^^^^^\n" +
- "The field Local.field is hiding a field from type FieldQualification\n" +
- "----------\n" +
- "3. WARNING in p\\FieldQualification.java (at line 6)\n" +
- " String field = \"Enclosing field for anonymous type\";\n" +
- " ^^^^^\n" +
- "The field Local.field is never read locally\n" +
- "----------\n" +
- "4. WARNING in p\\FieldQualification.java (at line 7)\n" +
- " void foo() {\n" +
- " ^^^^^\n" +
- "The method foo() from the type Local is never used locally\n" +
- "----------\n");
-}
-
-public void test060() {
- this.runConformTest(
- new String[] {
- "p/AF.java",
- "package p;\n" +
- "/**\n" +
- " * 1F9RITI\n" +
- " */\n" +
- "public class AF {\n" +
- " public class X {\n" +
- " int intMethod() {\n" +
- " return 3333;\n" +
- " }\n" +
- " class SomeInner extends A {\n" +
- " void someMethod() {\n" +
- " int i = intMethod(); \n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class A {\n" +
- " int intMethod() {\n" +
- " return 3333;\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- ""
- );
-}
-
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=32342
- */
-public void test061() {
- this.runNegativeTest(
- new String[] {
- "p/X.java", //======================
- "package p; \n" +
- "public class X extends q.Y { \n" +
- " X someField; \n" + // no ambiguity since inherited Y.X isn't visible
- "} \n" +
- "class Z extends q.Y { \n" +
- " Z someField; \n" + // ambiguous
- "} \n",
- "q/Y.java", //======================
- "package q; \n" +
- "public class Y { \n" +
- " private static class X {} \n" +
- " public static class Z {} \n" +
- "} \n"
- },
- "----------\n" +
- "1. WARNING in q\\Y.java (at line 3)\n" +
- " private static class X {} \n" +
- " ^\n" +
- "The type Y.X is never used locally\n" +
- "----------\n");
-}
-/*
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11435
- * variant - must still complain when targeting super abstract method
- */
-public void test062() {
-
- this.runNegativeTest(
- new String[] {
- "p1/Y.java",
- "package p1; \n"+
- "public class Y extends AbstractT { \n"+
- " public void init(){ \n"+
- " super.init(); \n"+
- " } \n"+
- "} \n"+
- "abstract class AbstractT implements J { \n"+
- "} \n"+
- "interface J { \n"+
- " void init(); \n"+
- "} \n"
- },
- "----------\n" +
- "1. ERROR in p1\\Y.java (at line 4)\n" +
- " super.init(); \n" +
- " ^^^^^^^^^^^^\n" +
- "Cannot directly invoke the abstract method init() for the type J\n" +
- "----------\n"); // expected log
-}
-
-public void test063() {
- this.runNegativeTest(
- new String[] {
- /* p1/X.java */
- "p1/X.java",
- "package p1; \n"+
- "public class X { \n"+
- " class Y extends X {} \n"+
- " class Z extends Y { \n"+
- " Z(){ \n"+
- " System.out.println(\"SUCCESS\"); \n"+
- " } \n" +
- " } \n" +
- " public static void main(String[] arguments) { \n"+
- " new X().new Z(); \n"+
- " } \n"+
- "} \n",
- },
- "----------\n" +
- "1. ERROR in p1\\X.java (at line 5)\n" +
- " Z(){ \n" +
- " ^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n"
- );
-}
-
-/**
- * Refuse selection of own enclosing instance arg for super constructor call in 1.3 compliant mode
- */
-public void test064() {
- this.runNegativeTest(
- new String[] {
- "Foo.java",
- "public class Foo {\n" +
- " public static void main(String[] args) {\n"+
- " System.out.println(\"SUCCESS\");\n"+
- " }\n"+
- " public class Bar extends Foo {\n" +
- " public Bar() {\n" +
- " }\n" +
- " }\n" +
- " public class Baz extends Bar {\n" +
- " public Baz() {\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Foo.java (at line 10)\n" +
- " public Baz() {\n" +
- " ^^^^^\n" +
- "No enclosing instance of type Foo is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-public void test065() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n"+
- " public static void main(String[] arguments) { \n"+
- " new X().new Y().new Z().bar(); \n"+
- " } \n"+
- " String foo() { return \"X-foo\"; } \n"+
- " class Y extends X { \n"+
- " String foo() { return \"Y-foo\"; } \n"+
- " class Z extends Y { \n"+
- " Z(){ \n"+
- " //X.this.super(); \n"+
- " } \n"+
- " String foo() { return \"Z-foo\"; } \n"+
- " void bar () { \n"+
- " System.out.println(X.this.foo()); \n"+
- " } \n"+
- " } \n"+
- " } \n"+
- "} \n"
- },
- "----------\n" +
- "1. WARNING in X.java (at line 7)\n" +
- " String foo() { return \"Y-foo\"; } \n" +
- " ^^^^^\n" +
- "The method foo() of type X.Y should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 9)\n" +
- " Z(){ \n" +
- " ^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "3. WARNING in X.java (at line 12)\n" +
- " String foo() { return \"Z-foo\"; } \n" +
- " ^^^^^\n" +
- "The method foo() of type X.Y.Z should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n");
-}
-
-/*
- * Check that anonymous type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test066() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {}\n" +
- " class M extends X {\n" +
- " M(){\n" +
- " super(null);\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new M(){});\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(new M(){});\n" +
- " ^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-/*
- * Check that indirect member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test067() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- " class N extends X {\n" +
- " N(Object o) {\n" +
- " super(o);\n" +
- " }\n" +
- " }\n" +
- " class M extends N {\n" +
- " M() {\n" +
- " super(null); //1\n" +
- " }\n" +
- " M(Object o) {\n" +
- " super(new M());//2\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 11)\n" +
- " super(null); //1\n" +
- " ^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 14)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " super(new M());//2\n" +
- " ^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-/*
- * Check that indirect member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test068() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " class MX1 extends X {\n" +
- " MX1() {\n" +
- " }\n" +
- " }\n" +
- " class MX2 extends MX1 {\n" +
- " MX2() {\n" +
- " super(); // ko\n" +
- " }\n" +
- " MX2(X x) {\n" +
- " this(); // ok\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(); // ko\n" +
- " ^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-/*
- * Check that indirect member type allocation is denied access to compatible enclosing instance available as constructor argument
- */
-public void test069() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " class MX3 extends X {\n" +
- " MX3(X x) {\n" +
- " }\n" +
- " }\n" +
- " class MX4 extends MX3 {\n" +
- " MX4() {\n" +
- " super(new MX4()); // ko\n" +
- " }\n" +
- " MX4(X x) {\n" +
- " this(); // ok\n" +
- " }\n" +
- " MX4(int i) {\n" +
- " this(new MX4()); // ko\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 8)\n" +
- " super(new MX4()); // ko\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 8)\n" +
- " super(new MX4()); // ko\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 14)\n" +
- " this(new MX4()); // ko\n" +
- " ^^^^^^^^^\n" +
- "No enclosing instance of type X is available due to some intermediate constructor invocation\n" +
- "----------\n");
-}
-
-// binary compatibility
-public void test070() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X extends Middle {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.println(new X().field);\n" +
- " }\n" +
- "}\n" +
- "class Middle extends Top {\n" +
- "}\n" +
- "class Top {\n" +
- " String field = \"Top.field\";\n" +
- "}\n"
- },
- "Top.field");
-
- this.runConformTest(
- new String[] {
- "Middle.java",
- "public class Middle extends Top {\n" +
- " public static void main(String[] arguments) { \n"+
- " X.main(arguments); \n" +
- " } \n" +
- " String field = \"Middle.field\";\n" +
- "}\n"
- },
- "Middle.field",
- null, // use default class-path
- false, // do not flush previous output dir content
- null); // no special vm args
-}
-
-/*
- * 43429 - AbstractMethodError calling clone() at runtime when using Eclipse compiler
- */
-public void test071() {
- this.runConformTest(
- new String[] {
- "X.java", //================================
- "public class X {\n" +
- " public interface Copyable extends Cloneable {\n" +
- " public Object clone() throws CloneNotSupportedException;\n" +
- " }\n" +
- " public interface TestIf extends Copyable {\n" +
- " }\n" +
- " public static class ClassA implements Copyable {\n" +
- " public Object clone() throws CloneNotSupportedException {\n" +
- " return super.clone();\n" +
- " }\n" +
- " }\n" +
- " public static class ClassB implements TestIf {\n" +
- " public Object clone() throws CloneNotSupportedException {\n" +
- " return super.clone();\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) throws Exception {\n" +
- " Copyable o1 = new ClassA();\n" +
- " ClassB o2 = new ClassB();\n" +
- " TestIf o3 = o2;\n" +
- " Object clonedObject;\n" +
- " clonedObject = o1.clone();\n" +
- " clonedObject = o2.clone();\n" +
- " // The following line fails at runtime with AbstractMethodError when\n" +
- " // compiled with Eclipse\n" +
- " clonedObject = o3.clone();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-public void test072() {
-
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " try {\n" +
- " f();\n" +
- " } catch(NullPointerException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- " static void f() {\n" +
- " Object x = new Object() {\n" +
- " {\n" +
- " if (true) throw null;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}",
- },
- "SUCCESS");
-}
-// 52221
-public void test073() {
-
- this.runNegativeTest(
- new String[] {
- "X.java",
- "class X {\n" +
- " public static void main(String[] args) {\n" +
- " \n" +
- " switch(args.length) {\n" +
- " \n" +
- " case 1:\n" +
- " int i = 0;\n" +
- " class Local {\n" +
- " }\n" +
- " break;\n" +
- " \n" +
- " case 0 :\n" +
- " System.out.println(i); // local var can be referred to, only an initialization pb\n" +
- " System.out.println(new Local());\n" +
- " break;\n" +
- "\n" +
- " case 2 :\n" +
- " class Local { // not a duplicate\n" +
- " }\n" +
- " break;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 14)\n" +
- " System.out.println(new Local());\n" +
- " ^^^^^\n" +
- "Local cannot be resolved to a type\n" +
- "----------\n");
-}
-
-// checking for captured outer local initialization status
-// NOTE: only complain against non-inlinable outer locals
-// http://bugs.eclipse.org/bugs/show_bug.cgi?id=26134
-public void test074() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) { \n" +
- " String nonInlinedString = \"[Local]\"; \n" +
- " int i = 2; \n" +
- " switch(i){ \n" +
- " case 1: \n" +
- " final String displayString = nonInlinedString;\n" +
- " final String inlinedString = \"a\"; \n" +
- " class Local { \n" +
- " public String toString() { \n" +
- " return inlinedString + displayString; \n" +
- " } \n" +
- " } \n" +
- " case 2: \n" +
- " System.out.print(new Local()); \n" +
- " System.out.print(\"-\"); \n" +
- " System.out.println(new Local(){ \n" +
- " public String toString() { \n" +
- " return super.toString()+\": anonymous\"; \n" +
- " } \n" +
- " }); \n" +
- " } \n" +
- " } \n" +
- "} \n",
- },
- "----------\n" +
- "1. WARNING in X.java (at line 10)\n" +
- " public String toString() { \n" +
- " ^^^^^^^^^^\n" +
- "The method toString() of type Local should be tagged with @Override since it actually overrides a superclass method\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 15)\n" +
- " System.out.print(new Local()); \n" +
- " ^^^^^\n" +
- "Local cannot be resolved to a type\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 17)\n" +
- " System.out.println(new Local(){ \n" +
- " ^^^^^\n" +
- "Local cannot be resolved to a type\n" +
- "----------\n");
-}
-public void test075() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X { \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " public void foo(int p1) {} \n" +
- " public void foo(short p1) {} \n" +
- "} \n",
- "Y.java",
- "public class Y extends X { \n" +
- " public void foo(long p1) {} \n" +
- " public void testEc() { foo((short)1); } \n" +
- "} \n",
- },
- "SUCCESS");
-}
-
-/**
- * Test fix for bug 58069.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=58069">58069</a>
- */
-public void test076() {
- docSupport = true;
- runNegativeTest(
- new String[] {
- "IX.java",
- "interface IX {\n" +
- " public static class Problem extends Exception {}\n" +
- "}\n",
- "X.java",
- "public abstract class X {\n" +
- " public static class Problem extends Exception {}\n" +
- " public abstract static class InnerClass implements IX {\n" +
- " /**\n" +
- " * @throws Problem \n" +
- " */\n" +
- " public void foo() throws IllegalArgumentException {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "\n"
- },
- "----------\n" +
- "1. WARNING in IX.java (at line 2)\n" +
- " public static class Problem extends Exception {}\n" +
- " ^^^^^^^\n" +
- "The serializable class Problem does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public static class Problem extends Exception {}\n" +
- " ^^^^^^^\n" +
- "The serializable class Problem does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " * @throws Problem \n" +
- " ^^^^^^^\n" +
- "Javadoc: Exception Problem is not declared\n" +
- "----------\n" );
-}
-/**
- * Test fix bug 58069 for method.
- * Note that problem is not flagged in doc comments as it is only raised while verifying
- * implicit method and javadoc resolution does not use it.
- */
-public void test077() {
- docSupport = true;
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar() { \n"+
- " return \"FAILED\"; \n" +
- " } \n"+
- " void foo(){ \n"+
- " /** @see #bar() */\n" +
- " class Y extends Secondary { \n"+
- " /** @see #bar() */\n" +
- " String z = bar(); \n" +
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " String bar(){ return \"FAILED\"; } \n" +
- "} \n"
- }
- );
-}
-/**
- * Test fix bug 58069 for field.
- * Note that problem is not flagged in doc comments as it is only raised while verifying
- * Name or Qualified name references and javadoc reference is a field reference.
- */
-public void test078() {
- docSupport = true;
- this.runConformTest(
- new String[] {
- "p1/Test.java",
- "package p1; \n"+
- "public class Test { \n"+
- " public static void main(String[] arguments) { \n"+
- " new Test().foo(); \n"+
- " } \n"+
- " String bar = \"FAILED\";"+
- " void foo(){ \n"+
- " /** @see #bar */\n" +
- " class Y extends Secondary { \n"+
- " /** @see #bar */\n" +
- " String z = bar; \n"+
- " }; \n"+
- " System.out.println(new Y().z); \n" +
- " } \n"+
- "} \n" +
- "class Secondary { \n" +
- " String bar = \"FAILED\"; \n" +
- "} \n"
- }
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47227
- */
-public void test079() {
- this.runNegativeTest(
- new String[] {
- "Hello.java",
- "void ___eval() {\n" +
- " new Runnable() {\n" +
- " int ___run() throws Throwable {\n" +
- " return blah;\n" +
- " }\n" +
- " private String blarg;\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}\n" +
- "public class Hello {\n" +
- " private static int x;\n" +
- " private String blah;\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- " public void hello() {\n" +
- " }\n" +
- " public boolean blah() {\n" +
- " return false;\n" +
- " }\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in Hello.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^^^^\n" +
- "Syntax error on token \"void\", @ expected\n" +
- "----------\n" +
- "2. ERROR in Hello.java (at line 1)\n" +
- " void ___eval() {\n" +
- " ^\n" +
- "Syntax error on token \")\", delete this token\n" +
- "----------\n" +
- "3. ERROR in Hello.java (at line 9)\n" +
- " };\n" +
- " ^\n" +
- "Syntax error on token \"}\", { expected\n" +
- "----------\n" +
- "4. ERROR in Hello.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
- "----------\n" +
- "5. ERROR in Hello.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete MemberValueArrayInitializer\n" +
- "----------\n" +
- "6. ERROR in Hello.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \")\" to complete Modifiers\n" +
- "----------\n" +
- "7. ERROR in Hello.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"enum Identifier\" to complete EnumHeader\n" +
- "----------\n" +
- "8. ERROR in Hello.java (at line 23)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"EnumBody\" to complete JavaScriptUnit\n" +
- "----------\n"
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67643
- * from 1.5 source level on most specific common super type is allowed
- */
-public void test080() {
- this.runConformTest(
- new String[] {
- "X.java",
- "import java.util.ArrayList;\n" +
- "public class X {\n" +
- " private static class C1 extends ArrayList {\n" +
- " }\n" +
- " private static class C2 extends ArrayList {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " ArrayList list = args == null ? new C1(): new C2();\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n"
- },
- "SUCCESS");
-}
-public void test081() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public X foo() { return this; } \n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- "}\n" +
- "class Y extends X {\n" +
- " public Y foo() { return this; } \n" +
- "}\n"
- },
- "SUCCESS");
-}
-// covariance
-public void test082() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " X x = new X1();\n" +
- " System.out.println(x.foo());\n" +
- " }\n" +
- " Object foo() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class X1 extends X {\n" +
- " String foo() {\n" +
- " return \"SUCCESS\";\n" +
- " }\n" +
- "}\n"
- },
- "SUCCESS");
-}
-
-/**
- * Test fix for bug 71079: [1.5] ClassCastException resolving Javadoc
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=71079">71079</a>
- */
-public void test083() {
- docSupport = true;
- this.runConformTest(
- new String[] {
- "X.java",
- "public @interface X {\n" +
- " /** Value */\n" +
- " String[] value();\n" +
- "}\n"
- }
- );
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=66533
- */
-public void test084() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " Object enum = null;\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " Object enum = null;\n" +
- " ^^^^\n" +
- "Syntax error on token \"enum\", delete this token\n" +
- "----------\n");
-}
-/**
- * Test unused import with static
- */
-public void test085() {
- this.runNegativeTest(
- new String[] {
- "A.java",
- "import static j.l.S.*;\n" +
- "import static j.l.S.in;\n" +
- "\n" +
- "public class A {\n" +
- "\n" +
- "}\n",
- "j/l/S.java",
- "package j.l;\n" +
- "public class S {\n" +
- " public static int in;\n" +
- "}\n"
- },
- "----------\n" +
- "1. WARNING in A.java (at line 1)\n" +
- " import static j.l.S.*;\n" +
- " ^^^^^\n" +
- "The import j.l.S is never used\n" +
- "----------\n" +
- "2. WARNING in A.java (at line 2)\n" +
- " import static j.l.S.in;\n" +
- " ^^^^^^^^\n" +
- "The import j.l.S.in is never used\n" +
- "----------\n");
-}
-/**
- * Test invalid static import syntax
- */
-public void test086() {
- this.runNegativeTest(
- new String[] {
- "p/S.java",
- "package p;\n" +
- "public class S {\n" +
- " public final static String full = \"FULL\";\n" +
- " public final static String success = \"SUCCESS\";\n" +
- "}\n",
- "X.java",
- "import static p.S;\n" +
- "public class X {\n" +
- " public static void main ( String[] args) {\n" +
- " \n" +
- " System.out.print(full+\" \"+p.S.success);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static p.S;\n" +
- " ^^^\n" +
- "The static import p.S must be a field or member type\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " System.out.print(full+\" \"+p.S.success);\n" +
- " ^^^^\n" +
- "full cannot be resolved\n" +
- "----------\n"
- );
-}
-public void test087() {
- this.runNegativeTest(
- new String[] {
- "S.java",
- "public class S {\n" +
- " public final static String full = \"FULL\";\n" +
- " public final static String success = \"SUCCESS\";\n" +
- "}\n",
- "X.java",
- "import static S;\n" +
- "public class X {\n" +
- " public static void main ( String[] args) {\n" +
- " \n" +
- " System.out.print(full+\" \"+S.success);\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 1)\n" +
- " import static S;\n" +
- " ^\n" +
- "The import S cannot be resolved\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " System.out.print(full+\" \"+S.success);\n" +
- " ^^^^\n" +
- "full cannot be resolved\n" +
- "----------\n"
- );
-}
-public void test088() {
- String errorMessage =
- "----------\n" +
- "1. WARNING in p\\X.java (at line 4)\n" +
- " public class X extends Date implements Runnable{\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 12)\n" +
- " this.super();\n" +
- " ^^^^\n" +
- "Illegal enclosing instance specification for type Object\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 25)\n" +
- " private void a() { System.out.println(\"A\");} \n" +
- " ^^^\n" +
- "The method a() from the type X is never used locally\n" +
- "----------\n" +
- "4. WARNING in p\\X.java (at line 31)\n" +
- " Class c = b.getClass();\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in p\\X.java (at line 32)\n" +
- " Class _getClasses [] = X.class.getClasses(); \n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in p\\X.java (at line 36)\n" +
- " Constructor _getConstructors[] = c.getConstructors(); \n" +
- " ^^^^^^^^^^^\n" +
- "Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in p\\X.java (at line 39)\n" +
- " Method _getMethod = c.getMethod(\"d\",null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" +
- "----------\n";
- if (isJRELevel(AbstractCompilerTest.F_1_6|AbstractCompilerTest.F_1_7)) {
- errorMessage =
- "----------\n" +
- "1. WARNING in p\\X.java (at line 4)\n" +
- " public class X extends Date implements Runnable{\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in p\\X.java (at line 12)\n" +
- " this.super();\n" +
- " ^^^^\n" +
- "Illegal enclosing instance specification for type Object\n" +
- "----------\n" +
- "3. WARNING in p\\X.java (at line 25)\n" +
- " private void a() { System.out.println(\"A\");} \n" +
- " ^^^\n" +
- "The method a() from the type X is never used locally\n" +
- "----------\n" +
- "4. WARNING in p\\X.java (at line 31)\n" +
- " Class c = b.getClass();\n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "5. WARNING in p\\X.java (at line 32)\n" +
- " Class _getClasses [] = X.class.getClasses(); \n" +
- " ^^^^^\n" +
- "Class is a raw type. References to generic type Class<T> should be parameterized\n" +
- "----------\n" +
- "6. WARNING in p\\X.java (at line 36)\n" +
- " Constructor _getConstructors[] = c.getConstructors(); \n" +
- " ^^^^^^^^^^^\n" +
- "Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
- "----------\n" +
- "7. WARNING in p\\X.java (at line 39)\n" +
- " Method _getMethod = c.getMethod(\"d\",null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" +
- "----------\n" +
- "8. WARNING in p\\X.java (at line 39)\n" +
- " Method _getMethod = c.getMethod(\"d\",null);\n" +
- " ^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type safety: The method getMethod(String, Class...) belongs to the raw type Class. References to generic type Class<T> should be parameterized\n" +
- "----------\n";
- }
- this.runNegativeTest(
- new String[] {
- "p/X.java",
- "package p;\n" +
- "import java.util.Date;\n" +
- "import java.lang.reflect.*;\n" +
- "public class X extends Date implements Runnable{\n" +
- " \n" +
- " Integer w = new Integer(90);\n" +
- " protected double x = 91.1;\n" +
- " public long y = 92;\n" +
- " static public Boolean z = new Boolean(true); \n" +
- " public class X_inner {\n" +
- " public X_inner() {\n" +
- " this.super();\n" +
- " System.out.println(\"....\");\n" +
- " }\n" +
- " }\n" +
- " X_inner a = new X_inner();\n" +
- " public interface X_interface {\n" +
- " public void f(); \n" +
- " }\n" +
- " static {\n" +
- " System.out.println(\"Static initializer\");\n" +
- " }\n" +
- " public X() { } \n" +
- " public X(int a1,int b1) { } \n" +
- " private void a() { System.out.println(\"A\");} \n" +
- " protected void b() { System.out.println(\"B\");} \n" +
- " public void c() { System.out.println(\"C\");} \n" +
- " static public int d() {System.out.println(\"Static D\");return -1;} \n" +
- " public static void main(String args[]) {\n" +
- " X b = new X();\n" +
- " Class c = b.getClass();\n" +
- " Class _getClasses [] = X.class.getClasses(); \n" +
- "// System.out.println(_getClasses[0].toString());\n" +
- "// System.out.println(_getClasses[1].toString());\n" +
- " if (_getClasses.length == 0) {System.out.println(\"FAILED\");};\n" +
- " Constructor _getConstructors[] = c.getConstructors(); \n" +
- " try {\n" +
- " Field _getField = c.getField(\"y\");\n" +
- " Method _getMethod = c.getMethod(\"d\",null);\n" +
- " \n" +
- " Boolean b_z = X.z; \n" +
- " }\n" +
- " catch (NoSuchFieldException e) { System.out.println(\"NoSuchFieldException\");}\n" +
- " catch (NoSuchMethodException e) { System.out.println(\"NoSuchMethodException\");};\n" +
- " } \n" +
- " public void run() {System.out.println(\"RUN\");} \n" +
- "}",
- },
- errorMessage);
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78089
- */
-public void test089() {
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " @interface I1 {}\n" +
- "}\n" +
- "\n" +
- "public class X {\n" +
- " public static void main(String argv[]) {\n" +
- " System.out.print(\"SUCCESS\");\n" +
- " }\n" +
- "}"
- },
- "SUCCESS");
-}
-//78104
-public void test090() {
- this.runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " void foo(int[] ints, Object o) {\n" +
- " ints = ints.clone();\n" +
- " ints = (int[])ints.clone();\n" +
- " X x = this.clone();\n" +
- " }\n" +
- "}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 6)\n" +
- " X x = this.clone();\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Object to X\n" +
- "----------\n"
- );
-}
-//78104 - variation
-public void test091() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " args = args.clone();\n" +
- " }\n" +
- "}",
- },
- ""
- );
-}
-// check autoboxing only enabled in 1.5 source mode
-public void test092() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo(Boolean b) {\n" +
- " if (b) { \n" +
- " int i = 0;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- },
- ""
- );
-}
-public void test093() {
- this.runNegativeTest(
- new String[] {
- "p/X_1.java",
- "package p;\n" +
- "/* dena JTest Suite, Version 2.2, September 1997\n" +
- " * Copyright (c) 1995-1997 Modena Software (I) Pvt. Ltd., All Rights Reserved\n" +
- " */\n" +
- "/* Section : Inner classes \n" +
- " * FileName : ciner026.java\n" +
- " * Purpose : Positive test for Inner classes\n" +
- " * \n" +
- " * An anonymous class can have initializers but cannot have a constructor.\n" +
- " * The argument list of the associated new expression is implicitely \n" +
- " * passed to the constructor of the super class. \n" +
- " *\n" +
- " */\n" +
- " \n" +
- " class X_1 {\n" +
- " static int xx = 100;\n" +
- " //inner class Y \n" +
- " static class Y { \n" +
- " public int j = 0;\n" +
- " Y(int x){ j = x; }\n" +
- " } \n" +
- " public void call_inner()\n" +
- " {\n" +
- " int i = test_anonymous().j;\n" +
- " } \n" +
- " public static void main(String argv[])\n" +
- " {\n" +
- " X_1 ox = new X_1();\n" +
- " ox.call_inner(); \n" +
- " } \n" +
- "public void newMethod ( ) {\n" +
- " Float f1 = null;\n" +
- " f1=(f1==0.0)?1.0:f1;\n" +
- "}\n" +
- " static Y test_anonymous()\n" +
- " { \n" +
- " //anonymous implementation of class Y\n" +
- " return new Y(xx) //xx should be implicitely passed to Y()\n" +
- " {\n" +
- " }; \n" +
- " \n" +
- " } //end test_anonymous \n" +
- "} ",
- },
- "----------\n" +
- "1. ERROR in p\\X_1.java (at line 33)\n" +
- " f1=(f1==0.0)?1.0:f1;\n" +
- " ^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from double to Float\n" +
- "----------\n"
- );
-}
-/*
- * Test unused import warning in presence of syntax errors
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21022
- */
-public void test094(){
-
- this.runNegativeTest(
- new String[] {
- "X.java",
- "import java.io.*; \n" +
- "public class X { \n" +
- " void foo(){\n" +
- " ()\n" +
- " IOException e;\n" +
- " } \n" +
- "} \n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " ()\n" +
- " ^\n" +
- "Syntax error on token \"(\", AnnotationName expected before this token\n" +
- "----------\n");
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84743
-public void test095(){
-
- this.runConformTest(
- new String[] {
- "X.java",
- "interface I {\n" +
- " int foo();\n" +
- "}\n" +
- "interface J {\n" +
- " String foo();\n" +
- "}\n" +
- " \n" +
- "public class X implements I {\n" +
- " public int foo() {\n" +
- " return 0;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " I i = new X();\n" +
- " try {\n" +
- " J j = (J) i;\n" +
- " } catch(ClassCastException e) {\n" +
- " System.out.println(\"SUCCESS\");\n" +
- " }\n" +
- " }\n" +
- "}\n"
- },
- "SUCCESS");
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47074
- */
-public void test096() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " interface A {\n" +
- " void doSomething();\n" +
- " }\n" +
- "\n" +
- " interface B {\n" +
- " int doSomething();\n" +
- " }\n" +
- "\n" +
- " interface C extends B {\n" +
- " }\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " \n" +
- " A a = null;\n" +
- " C c = (C)a; \n" +
- " }\n" +
- "}"
- },
- "");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=79396
-public void test097() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- "\n" +
- " public static void main(String argv[]) {\n" +
- " int cst = X1.CST;\n" +
- " X2.Root.foo();\n" +
- " }\n" +
- " static void foo() {}\n" +
- "}\n" +
- "\n" +
- "class X1 {\n" +
- " static {\n" +
- " System.out.print(\"[X1]\");\n" +
- " }\n" +
- " public static final int CST = 12;\n" +
- " static X Root = null;\n" +
- "}\n" +
- "class X2 {\n" +
- " static {\n" +
- " System.out.print(\"[X2]\");\n" +
- " }\n" +
- " public final int CST = 12;\n" +
- " static X Root = null;\n" +
- "}\n"
- },
- "[X2]");
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78906
-public void test098() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " void foo() {\n" +
- " System.out.print(\"foo\");\n" +
- " }\n" +
- " class Y {\n" +
- " String this$0;\n" +
- " String this$0$;\n" +
- " void print() { \n" +
- " foo();\n" +
- " System.out.println(this$0+this$0$);\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " X.Y y = new X().new Y();\n" +
- " y.this$0 = \"hello\";\n" +
- " y.this$0$ = \"world\";\n" +
- " y.print();\n" +
- " }\n" +
- "}\n"
- },
- "foohelloworld");
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=77349
-public void test099() {
- this.runNegativeTest(
- new String[] {
- "I.java",
- "public interface I extends Cloneable {\n" +
- " class Inner {\n" +
- " Object bar(I i) throws CloneNotSupportedException { return i.clone(); }\n" +
- " }\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in I.java (at line 3)\n" +
- " Object bar(I i) throws CloneNotSupportedException { return i.clone(); }\n" +
- " ^^^^^\n" +
- "The method clone() is undefined for the type I\n" +
- "----------\n"
- );
-}
-
-public void test100() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " void foo() {\n" +
- " int \\ud800\\udc05\\ud800\\udc04\\ud800\\udc03\\ud800\\udc02\\ud800\\udc01\\ud800\\udc00;\n" +
- " }\n" +
- "}\n"
- }
- );
-}
-public void test101() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Character c0 = \'a\';\n" +
- " public static void main(String argv[]) {\n" +
- " Character c1;\n" +
- " c1 = \'b\';\n" +
- "\n" +
- " Character c2 = \'c\';\n" +
- " Character[] c3 = { \'d\' };\n" +
- " \n" +
- " }\n" +
- "}\n"
- },
- ""
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=108856
-public void test102() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " new Object() {\n" +
- " {\n" +
- " new Object() {\n" +
- " {\n" +
- " System.out.println(this.getClass().getName());\n" +
- " System.out.println(this.getClass().getSimpleName());\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n"
- },
- "X$1$1");
-}
-//public void test103() {
-// this.runConformTest(
-// new String[] {
-// "X.java",
-// "public class X {\n" +
-// " public static void main(String[] args) {\n" +
-// " System.out.print(X.class);\n" +
-// " }\n" +
-// "}\n",
-// },
-// "class X");
-//
-// ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
-// String actualOutput = null;
-// try {
-// byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(new File(OUTPUT_DIR + File.separator +"X.class"));
-// actualOutput =
-// disassembler.disassemble(
-// classFileBytes,
-// "\n",
-// ClassFileBytesDisassembler.DETAILED);
-// } catch (org.eclipse.wst.jsdt.core.util.ClassFormatException e) {
-// assertTrue("ClassFormatException", false);
-// } catch (IOException e) {
-// assertTrue("IOException", false);
-// }
-//
-// String expectedOutput =
-// "public class X {\n" +
-// " \n" +
-// " // Method descriptor #6 ()V\n" +
-// " // Stack: 1, Locals: 1\n" +
-// " public X();\n" +
-// " 0 aload_0 [this]\n" +
-// " 1 invokespecial java.lang.Object() [8]\n" +
-// " 4 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 1]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 5] local: this index: 0 type: X\n" +
-// " \n" +
-// " // Method descriptor #15 ([Ljava/lang/String;)V\n" +
-// " // Stack: 2, Locals: 1\n" +
-// " public static void main(java.lang.String[] args);\n" +
-// " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
-// " 3 ldc <Class X> [1]\n" +
-// " 5 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [22]\n" +
-// " 8 return\n" +
-// " Line numbers:\n" +
-// " [pc: 0, line: 3]\n" +
-// " [pc: 8, line: 4]\n" +
-// " Local variable table:\n" +
-// " [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]\n";
-//
-// int index = actualOutput.indexOf(expectedOutput);
-// if (index == -1 || expectedOutput.length() == 0) {
-// System.out.println(Util.displayString(actualOutput, 2));
-// }
-// if (index == -1) {
-// assertEquals("Wrong contents", expectedOutput, actualOutput);
-// }
-//}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=125570
-public void test104() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " public static void main(String[] s) {\n" +
- " new Object() {\n" +
- " {\n" +
- " new Object() {\n" +
- " {\n" +
- " class Y {\n" +
- " {\n" +
- " System.out.print(this.getClass());\n" +
- " System.out.print(\' \');\n" +
- " System.out.print(this.getClass().getSimpleName());\n" +
- " }\n" +
- " }\n" +
- " ;\n" +
- " new Y();\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- },
- "class X$1$1$1Y Y");
-}
-
-// enclosing instance - note that the behavior is different in 1.3 and 1.4
-public void test105() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " static class Y { }\n" +
- " static class Z1 {\n" +
- " Runnable m;\n" +
- " Z1(Runnable p) {\n" +
- " this.m = p;\n" +
- " }\n" +
- " }\n" +
- " class Z2 extends Z1 {\n" +
- " Z2(final Y p) {\n" +
- " super(new Runnable() {\n" +
- " public void run() {\n" +
- " foo(p);\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " }\n" +
- " void foo(Y p) { }\n" +
- "}\n"
- },
- "");
-}
-
-public static Class testClass() {
- return Compliance_1_5.class;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/interpret/BasicInterpretTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/interpret/BasicInterpretTest.java
deleted file mode 100644
index 0bfb3d0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/interpret/BasicInterpretTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.interpret;
-
-public class BasicInterpretTest extends InterpretTest {
-
- public BasicInterpretTest(String name) {
- super(name);
- }
-
-
- public void test0001() {
- interpetTest("1+2","3");
- }
-
- public void test0002() {
- interpetTest("a=10","a","10");
- }
-
- public void test0003() {
- interpetTest("a=10;b=a+11;","b","21");
- }
-
- public void test0004() {
- interpetTest("a={p:21}; b=a.p;","b","21");
- }
-
- public void test0005() {
- interpetTest("a = new Object(); a.hasProperty(\"c\");","false");
- }
-
- public void test0005a() {
- interpetTest("a = new Object(); a.c=1; a.hasProperty('c');","true");
- }
-
- public void test0007() {
- interpetTest("function box(w,h){this.width=w;this.height=h;}"+
- "box.prototype.area=function (){return this.width*this.height;}"+
- "b=new box(3,4); b.area();"
- ,"12");
- }
-
- public void test0008() {
- interpetTest("var i=1;"+
- "if (i>0) i=3;"
- ,"i","3");
- }
-
- public void test0008b() {
- interpetTest("var i=1;"+
- "if (i>1) i=3;"
- ,"i","1");
- }
-
-
- public void test0009() {
- interpetTest("var i=1;"+
- "while (i<3) i++;"
- ,"i","3");
- }
-
- public void test0009a() {
- interpetTest("var i=1;"+
- "while (i<3) {i++; if (i==2) break;}"
- ,"i","2");
- }
-
-
- public void test0010() {
- interpetTest("a = \"abc\"; a.indexOf(\"b\");","1");
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/interpret/InterpretTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/interpret/InterpretTest.java
deleted file mode 100644
index 77da302..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/interpret/InterpretTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.interpret;
-
-import org.eclipse.wst.jsdt.core.tests.junit.extension.StopableTestCase;
-import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
-import org.eclipse.wst.jsdt.internal.core.interpret.Interpreter;
-import org.eclipse.wst.jsdt.internal.core.interpret.InterpreterContext;
-import org.eclipse.wst.jsdt.internal.core.interpret.InterpreterResult;
-import org.eclipse.wst.jsdt.internal.core.interpret.Value;
-
-public class InterpretTest extends AbstractCompilerTest implements
- StopableTestCase {
-
-
- InterpreterResult result;
-
- public InterpretTest(String name) {
- super(name);
- }
-
- public void stop() {
-
- }
-
- public void interpetTest(String source, String expected)
- {
-
- InterpreterContext context= new InterpreterContext();
- context.initailizeBuiltins();
-
- result=Interpreter.interpet(source, context);
- Object res=result.getResult();
- if (res instanceof Value)
- res=((Value)res).stringValue();
- assertTrue("Result has errors", !result.hasErrors());
- assertEquals("Unexpected result",expected, res.toString());
-
-
- }
-
- public void interpetTest(String source, String varName, String expected)
- {
-
- InterpreterContext context= new InterpreterContext();
-
- result=Interpreter.interpet(source, context);
-
- assertTrue("Result has errors", !result.hasErrors());
- Value value =context.getValue(varName.toCharArray());
- assertTrue("var not found: "+varName, value!=null);
- assertEquals("Unexpected result",expected, value.stringValue() );
-
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/PerformanceTestSuite.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/PerformanceTestSuite.java
deleted file mode 100644
index 84760f3..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/PerformanceTestSuite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.junit.extension;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Vector;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class PerformanceTestSuite extends TestSuite {
-
- /**
- * Constructs a TestSuite from the given class. Adds all the methods
- * starting with "testPerf" as test cases to the suite.
- */
- public PerformanceTestSuite(final Class theClass) {
- setName(theClass.getName());
- try {
- getTestConstructor(theClass); // Avoid generating multiple error messages
- } catch (NoSuchMethodException e) {
- addTest(addWarningTest("Class "+theClass.getName()+" has no public constructor TestCase(String name) or TestCase()"));
- return;
- }
-
- if (!Modifier.isPublic(theClass.getModifiers())) {
- addTest(addWarningTest("Class "+theClass.getName()+" is not public"));
- return;
- }
-
- Class superClass= theClass;
- Vector names= new Vector();
- while (Test.class.isAssignableFrom(superClass)) {
- Method[] methods= superClass.getDeclaredMethods();
- for (int i= 0; i < methods.length; i++) {
- addTestMethod(methods[i], names, theClass);
- }
- superClass= superClass.getSuperclass();
- }
- if (countTestCases() == 0)
- addTest(addWarningTest("No tests found in "+theClass.getName()));
- }
-
- public PerformanceTestSuite(String name) {
- setName(name);
- }
-
- private void addTestMethod(Method m, Vector names, Class theClass) {
- String name= m.getName();
- if (names.contains(name))
- return;
- if (! isPublicTestMethod(m)) {
- if (isTestMethod(m))
- addTest(addWarningTest("Test method isn't public: "+m.getName()));
- return;
- }
- names.addElement(name);
- addTest(createTest(theClass, name));
- }
-
- public void addTestSuite(Class theClass) {
- addTest(new PerformanceTestSuite(theClass));
- }
-
- private boolean isPublicTestMethod(Method m) {
- return isTestMethod(m) && Modifier.isPublic(m.getModifiers());
- }
-
- private boolean isTestMethod(Method m) {
- String name= m.getName();
- Class[] parameters= m.getParameterTypes();
- Class returnType= m.getReturnType();
- return parameters.length == 0 && name.startsWith("testPerf") && returnType.equals(Void.TYPE);
- }
-
- /**
- * Returns a test which will fail and log a warning message.
- */
- private static Test addWarningTest(final String message) {
- return new TestCase("warning") {
- protected void runTest() {
- fail(message);
- }
- };
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/StopableTestCase.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/StopableTestCase.java
deleted file mode 100644
index 8d4cf56..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/StopableTestCase.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.junit.extension;
-
-/**
- * A test case that is being sent stop() when the user presses 'Stop' or 'Exit'.
- */
-public interface StopableTestCase {
- /**
- * Invoked when this test needs to be stoped.
- */
- public void stop();
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestCase.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestCase.java
deleted file mode 100644
index 9b41657..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestCase.java
+++ /dev/null
@@ -1,748 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.junit.extension;
-
-import java.io.*;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.text.DateFormat;
-import java.util.*;
-
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.internal.compiler.batch.Main;
-
-import junit.framework.ComparisonFailure;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class TestCase extends junit.framework.TestCase {
-
- // Filters
- public static final String METHOD_PREFIX = "test";
- public static String RUN_ONLY_ID = "ONLY_";
-
- // Ordering
- public static final int NO_ORDER = 0;
- public static final int ALPHABETICAL_SORT = 1;
- public static final int ALPHA_REVERSE_SORT = 2;
- public static final int RANDOM_ORDER_JDT = 3;
- public static final int RANDOM_ORDER_TIME = 4;
-
- /**
- * Expected tests order while building tests list for test suites.
- * @see #buildTestsList(Class, int, long)
- * <br>
- * User may use following different values:
- * <ul>
- * <li>{@link #NO_ORDER}: none (this is the default)</li>
- * <li>{@link #ALPHABETICAL_SORT}: alphabetical order (ie. ascending)</li>
- * <li>{@link #ALPHA_REVERSE_SORT}: alpha reverse order (ie. descending )</li>
- * <li>{@link #RANDOM_ORDER_JDT}: random order using JDT/Core current version as seed</li>
- * <li>{@link #RANDOM_ORDER_TIME}: random order using current time as seed (used time value is displayed in console)</li>
- * <li>other values: random order using given <code>long</code> value as seed</li>
- * </ul>
- * This value is initialized with <code>"ordering"</code> system property.
- */
- public static final long ORDERING;
- static {
- long ordering = NO_ORDER; // default is no order
- try {
- long seed = Long.parseLong(System.getProperty("ordering", "0"));
- try {
- int kind = Integer.parseInt(System.getProperty("ordering", "0"));
- switch (kind) {
- case NO_ORDER:
- break;
- case ALPHABETICAL_SORT:
- ordering = kind;
- System.err.println("Note that tests will be run sorted using alphabetical order...");
- break;
- case ALPHA_REVERSE_SORT:
- ordering = kind;
- System.err.println("Note that tests will be run sorted using alphabetical reverse order...");
- break;
- case RANDOM_ORDER_JDT:
- String version = new Main(null, null, false).bind("compiler.version");
- try {
- String v_number = version.substring(2, 5);
- ordering = Long.parseLong(v_number);
- System.err.println("Note that tests will be run in random order using seed="+v_number+" (ie. JDT/Core version)");
- }
- catch (NumberFormatException nfe) {
- System.err.println("Cannot extract valid JDT/Core version number from 'compiler.version': "+version+" => no order will be finally used...");
- ordering = NO_ORDER;
- }
- break;
- case RANDOM_ORDER_TIME:
- ordering = System.currentTimeMillis();
- System.err.println("Note that tests will be run in random order using seed="+ordering+" (ie. current time)");
- break;
- default:
- ordering = seed;
- System.err.println("Note that tests will be run in random order using seed="+seed+" (ie. given value)");
- break;
- }
- } catch (NumberFormatException nfe) {
- // ordering value is over int range but is a valid long => keep the value
- ordering = seed;
- System.err.println("Note that tests will be run in random order using seed="+seed+" (ie. given value)");
- }
- }
- catch (NumberFormatException nfe) {
- System.err.println("Only integer or long values are allowed for 'ordering' system property: "+System.getProperty("ordering", "0")+" is not valid ! => no order will be finally used...");
- ordering = NO_ORDER;
- }
- ORDERING = ordering;
- }
-
- // Garbage collect constants
- final static int MAX_GC = 5; // Max gc iterations
- final static int TIME_GC = 200; // Sleep to wait gc to run (in ms)
- final static int DELTA_GC = 1000; // Threshold to remaining free memory
-
- // Debug Log Information
- public final static File MEM_LOG_FILE;
- public final static File MEM_LOG_DIR;
- public static Class CURRENT_CLASS;
- public static String CURRENT_CLASS_NAME;
- public final static String STORE_MEMORY;
- public final static boolean ALL_TESTS_LOG;
- public final static boolean RUN_GC;
-
- /*
- * Static initializer for memory trace.
- * This functionality is activated using system property "storeMemory".
- * Here's possible format for this property:
- * -DstoreMemory=<file name>[,all][,gc][,dir=<directory name>]
- * <file name>: name of the file where memory data will be stored
- * optional parameters:
- * all: flag to store memory data for all tests. If not specified,
- * then data will be stored only per test suite
- * gc: flag to run garbage collection before each test or test suite
- * (depending of "all" parameter)
- * dir=<directory name>:
- * specify directory where to put the file. Default is the directory
- * specified in 'user.home' property
- */
- static {
- String storeMemory = System.getProperty("storeMemory");
- boolean allTestsLog = false;
- boolean runGc = false;
- File memLogDir = new File(System.getProperty("user.home"));
- if (storeMemory != null) {
- int index = storeMemory.indexOf(',');
- if (index>0) {
- StringTokenizer parameters = new StringTokenizer(storeMemory.substring(storeMemory.indexOf(',')+1), ",");
- while (parameters.hasMoreTokens()) {
- String param = parameters.nextToken();
- if ("all".equals(param)) {
- allTestsLog = true;
- } else if ("gc".equals(param)) {
- runGc = true;
- } else if (param.startsWith("dir=")) {
- memLogDir = new File(param.substring(4));
- }
- }
- storeMemory = storeMemory.substring(0, index);
- }
- }
- STORE_MEMORY = storeMemory;
- ALL_TESTS_LOG = allTestsLog;
- RUN_GC = runGc;
- if (!verifyLogDir(memLogDir)) {
- memLogDir = null;
- }
- MEM_LOG_DIR = memLogDir;
- MEM_LOG_FILE = createMemLogFile();
- if (STORE_MEMORY != null && MEM_LOG_FILE != null) {
- System.out.println("Memory storage activated:");
- System.out.println(" data stored in file "+MEM_LOG_FILE);
- System.out.println(" all tests log: "+ALL_TESTS_LOG);
- System.out.println(" gc activated: "+RUN_GC);
- }
- }
- /*
- * Flag telling if current test is the first of TestSuite it belongs or not.
- */
- private boolean first;
-
- // static variables for subsets tests
- public static String TESTS_PREFIX = null; // prefix of test names to perform
- public static String[] TESTS_NAMES = null; // list of test names to perform
- public static int[] TESTS_NUMBERS = null; // list of test numbers to perform
- public static int[] TESTS_RANGE = null; // range of test numbers to perform
-
- public TestCase(String name) {
- setName(name);
- }
-
-public static void assertEquals(String expected, String actual) {
- assertEquals(null, expected, actual);
-}
-public static void assertEquals(String message, String expected, String actual) {
- assertStringEquals(message, expected, actual, true);
-}
-public static void assertStringEquals(String expected, String actual, boolean showLineSeparators) {
- assertStringEquals(null, expected, actual, showLineSeparators);
-}
-public static void assertStringEquals(String message, String expected, String actual, boolean showLineSeparators) {
- if (expected == null && actual == null)
- return;
- if (expected != null && expected.equals(actual))
- return;
- final String formatted;
- if (message != null) {
- formatted = message+"."; //$NON-NLS-1$
- } else {
- formatted = ""; //$NON-NLS-1$
- }
- if (showLineSeparators) {
- final String expectedWithLineSeparators = showLineSeparators(expected);
- final String actualWithLineSeparators = showLineSeparators(actual);
- throw new ComparisonFailure(
- formatted
- + "\n----------- Expected ------------\n" //$NON-NLS-1$
- + expectedWithLineSeparators
- + "\n------------ but was ------------\n" //$NON-NLS-1$
- + actualWithLineSeparators
- + "\n--------- Difference is ----------\n", //$NON-NLS-1$
- expectedWithLineSeparators,
- actualWithLineSeparators);
- } else {
- throw new ComparisonFailure(
- formatted
- + "\n----------- Expected ------------\n" //$NON-NLS-1$
- + expected
- + "\n------------ but was ------------\n" //$NON-NLS-1$
- + actual
- + "\n--------- Difference is ----------\n", //$NON-NLS-1$
- expected,
- actual);
- }
-}
-
-/**
- * Build a list of methods to run for a test suite.
- * There's no recursion in given class hierarchy, methods are only
- * public method starting with "test" of it.
- * <p></p>
- * Note that this list may be reduced using 2 different mechanism:
- * <p></p>
- * 1) TESTS* static variables:
- * <ul>
- * <li>{@link #TESTS_PREFIX}: only methods starting with this prefix (after "test" of course)
- * will be put in test suite.
- * </li>
- * <li>{@link #TESTS_NAMES}: only methods with these names will be put in test suite.
- * </li>
- * <li>{@link #TESTS_NUMBERS}: only methods including these numbers will be put in test suite.<br>
- * For example, <code>TESTS_NUMBERS = new int[] { 10, 100, 125678 };</code> will put
- * <code>test010()</code>, <code>test100()</code> and <code>testBug125678()</code>
- * methods in test suite.
- * </li>
- * <li>{@link #TESTS_RANGE}: only methods which numbers are between first and second value
- * of this int array will be put in the suite.
- * For example: <code>TESTS_RANGE = new int[] { 10, 12 };</code> will put
- * <code>test010()</code>, <code>test011()</code> and <code>test012()</code>
- * methods in test suite.<br>
- * Note that -1 will clean min or max value, for example <code>TESTS_RANGE = new int[] { 10, -1 };</code>
- * will put all methods after <code>test010()</code> in the test suite.
- * </li>
- * </ul>
- * <p></p>
- * 2) testONLY_ methods<br>
- * As static variables needs a static initializer usually put at the beginning of the test suite,
- * it could be a little be boring while adding tests at the end of the file to modify this static initializer.
- * One solution to avoid this was to introduced specific methods name which will be only executed
- * when test suite is run alone.
- * For example:
- * <pre>
- * public class MyTest extends TestCase {
- * public MyTest(String name) {
- * super(name);
- * }
- * public test001() {
- * ...
- * }
- * public test002() {
- * ...
- * }
- * ...
- * public testONLY_100() {
- * ...
- * }
- * }
- * </pre>
- * This test suite will have only test "testONLY_100" put in test suite while running it.
- *
- * Note that these 2 mechanisms should be reset while executing "global" test suites.
- * For example:
- * <pre>
- * public class TestAll extends junit.framework.TestCase {
- * public TestAll(String testName) {
- * super(testName);
- * }
- * public static Test suite() {
- * TestCase.TESTS_PREFIX = null;
- * TestCase.TESTS_NAMES = null;
- * TestCase.TESTS_NUMBERS= null;
- * TestCase.TESTS_RANGE = null;
- * TestCase.RUN_ONLY_ID = null;
- * return buildTestSuite(MyTest.class);
- * }
- * }
- * </pre>
- * This will insure you that all tests will be put in TestAll test suite, even if static variables
- * values are set or some methods start as testONLY_...
- *
- * @param evaluationTestClass the test suite class
- * @return a list ({@link List}) of tests ({@link Test}).
- */
-public static List buildTestsList(Class evaluationTestClass) {
- return buildTestsList(evaluationTestClass, 0/*only one level*/, ORDERING);
-}
-
-/**
- * Build a list of methods to run for a test suite.
- * <br>
- * Differ from {@link #buildTestsList(Class)} in the fact that one
- * can specify level of recursion in hierarchy to find additional tests.
- *
- * @param evaluationTestClass the test suite class
- * @param inheritedDepth level of recursion in top-level hierarchy to find other tests
- * @return a {@link List list} of {@link Test tests}.
- */
-public static List buildTestsList(Class evaluationTestClass, int inheritedDepth) {
- return buildTestsList(evaluationTestClass, inheritedDepth, ORDERING);
-}
-
-/**
- * Build a list of methods to run for a test suite.
- * <br>
- * This list may be ordered in different ways using {@link #ORDERING}.
- * <br>
- * Example
- * <pre>
- * public class AbstractTest extends TestCase {
- * public MyTest(String name) {
- * super(name);
- * }
- * public testOne() {
- * ...
- * }
- * public testTwo() {
- * ...
- * }
- * }
- * public class MyTest extends AbstractTest {
- * public MyTest(String name) {
- * super(name);
- * }
- * public test001() {
- * ...
- * }
- * public test002() {
- * ...
- * }
- * ...
- * public testONLY_100() {
- * ...
- * }
- * }
- * </pre>
- * Returned list will have 5 tests if inheritedDepth is equals to 1 instead of
- * 3 if it was 0 as while calling by {@link #buildTestsList(Class)}.
- *
- * @see #buildTestsList(Class) for complete explanation of subsets mechanisms.
- *
- * @param evaluationTestClass the test suite class
- * @param inheritedDepth level of recursion in top-level hierarchy to find other tests
- * @param ordering kind of sort use for the list (see {@link #ORDERING} for possible values)
- * @return a {@link List list } of {@link Test tests}
- */
-public static List buildTestsList(Class evaluationTestClass, int inheritedDepth, long ordering) {
- List tests = new ArrayList();
- List testNames = new ArrayList();
- List onlyNames = new ArrayList();
- Constructor constructor = null;
- try {
- // Get class constructor
- Class[] paramTypes = new Class[] { String.class };
- constructor = evaluationTestClass.getConstructor(paramTypes);
- }
- catch (Exception e) {
- // cannot get constructor, skip suite
- return tests;
- }
-
- // Get all tests from "test%" methods
- Method[] methods = evaluationTestClass.getDeclaredMethods();
- Class evaluationTestSuperclass = evaluationTestClass.getSuperclass();
- for (int i=0; i<inheritedDepth && !Flags.isAbstract(evaluationTestSuperclass.getModifiers()); i++) {
- Method[] superMethods = evaluationTestSuperclass.getDeclaredMethods();
- Method[] mergedMethods = new Method[methods.length+superMethods.length];
- System.arraycopy(superMethods, 0, mergedMethods, 0, superMethods.length);
- System.arraycopy(methods, 0, mergedMethods, superMethods.length, methods.length);
- methods = mergedMethods;
- evaluationTestSuperclass = evaluationTestSuperclass.getSuperclass();
- }
-
- // Build test names list
- final int methodPrefixLength = METHOD_PREFIX.length();
- nextMethod: for (int m = 0, max = methods.length; m < max; m++) {
- int modifiers = methods[m].getModifiers();
- if (Flags.isPublic(modifiers) && !Flags.isStatic(modifiers)) {
- String methName = methods[m].getName();
- if (methName.startsWith(METHOD_PREFIX)) {
-
- // look if this is a run only method
- boolean isOnly = RUN_ONLY_ID != null && methName.substring(methodPrefixLength).startsWith(RUN_ONLY_ID);
- if (isOnly) {
- if (!onlyNames.contains(methName)) {
- onlyNames.add(methName);
- }
- continue;
- }
-
- // no prefix, no subsets => add method
- if (TESTS_PREFIX == null && TESTS_NAMES == null && TESTS_NUMBERS == null && TESTS_RANGE == null) {
- if (!testNames.contains(methName)) {
- testNames.add(methName);
- }
- continue nextMethod;
- }
-
- // no prefix or method matches prefix
- if (TESTS_PREFIX == null || methName.startsWith(TESTS_PREFIX)) {
- int numStart = TESTS_PREFIX==null ? methodPrefixLength : TESTS_PREFIX.length();
- // tests names subset
- if (TESTS_NAMES != null) {
- for (int i = 0, imax= TESTS_NAMES.length; i<imax; i++) {
- if (methName.indexOf(TESTS_NAMES[i]) >= 0) {
- if (!testNames.contains(methName)) {
- testNames.add(methName);
- }
- continue nextMethod;
- }
- }
- }
- // look for test number
- int length = methName.length();
- if (numStart < length) {
- // get test number
- while (numStart<length && !Character.isDigit(methName.charAt(numStart))) numStart++; // skip to first digit
- while (numStart<length && methName.charAt(numStart) == '0') numStart++; // skip to first non-nul digit
- int n = numStart;
- while (n<length && Character.isDigit(methName.charAt(n))) n++; // skip to next non-digit
- if (n>numStart && n <= length) {
- try {
- int num = Integer.parseInt(methName.substring(numStart, n));
- // tests numbers subset
- if (TESTS_NUMBERS != null && !testNames.contains(methName)) {
- for (int i = 0; i < TESTS_NUMBERS.length; i++) {
- if (TESTS_NUMBERS[i] == num) {
- testNames.add(methName);
- continue nextMethod;
- }
- }
- }
- // tests range subset
- if (TESTS_RANGE != null && TESTS_RANGE.length == 2 && !testNames.contains(methName)) {
- if ((TESTS_RANGE[0]==-1 || num>=TESTS_RANGE[0]) && (TESTS_RANGE[1]==-1 || num<=TESTS_RANGE[1])) {
- testNames.add(methName);
- continue nextMethod;
- }
- }
- } catch (NumberFormatException e) {
- System.out.println("Method "+methods[m]+" has an invalid number format: "+e.getMessage());
- }
- }
- }
-
- // no subset, add all tests
- if (TESTS_NAMES==null && TESTS_NUMBERS==null && TESTS_RANGE==null) {
- if (!testNames.contains(methName)) {
- testNames.add(methName);
- }
- }
- }
- }
- }
- }
-
- // Order tests
- List names = onlyNames.size() > 0 ? onlyNames : testNames;
- if (ordering == ALPHA_REVERSE_SORT) {
- Collections.sort(names, Collections.reverseOrder());
- } else if (ordering == ALPHABETICAL_SORT) {
- Collections.sort(names);
- } else if (ordering != NO_ORDER) {
- Collections.shuffle(names, new Random(ordering));
- }
-
- // Add corresponding tests
- Iterator iterator = names.iterator();
- while (iterator.hasNext()) {
- String testName = (String) iterator.next();
- try {
- tests.add(constructor.newInstance(new Object[] { testName } ));
- }
- catch (Exception e) {
- System.err.println("Method "+testName+" removed from suite due to exception: "+e.getMessage());
- }
- }
- return tests;
-}
-
-/**
- * Build a test suite with all tests computed from public methods starting with "test"
- * found in the given test class.
- * Test suite name is the name of the given test class.
- *
- * Note that this lis maybe reduced using some mechanisms detailed in {@link #buildTestsList(Class)} method.
- *
- * @param evaluationTestClass
- * @return a {@link Test test suite}
- */
-public static Test buildTestSuite(Class evaluationTestClass) {
- return buildTestSuite(evaluationTestClass, null); //$NON-NLS-1$
-}
-
-/**
- * Build a test suite with all tests computed from public methods starting with "test"
- * found in the given test class.
- * Test suite name is the given name.
- *
- * Note that this lis maybe reduced using some mechanisms detailed in {@link #buildTestsList(Class)} method.
- *
- * @param evaluationTestClass
- * @param suiteName
- * @return a test suite ({@link Test})
- */
-public static Test buildTestSuite(Class evaluationTestClass, String suiteName) {
- TestSuite suite = new TestSuite(suiteName==null?evaluationTestClass.getName():suiteName);
- List tests = buildTestsList(evaluationTestClass);
- for (int index=0, size=tests.size(); index<size; index++) {
- suite.addTest((Test)tests.get(index));
- }
- return suite;
-}
-
-private static File createMemLogFile() {
- if (STORE_MEMORY == null || MEM_LOG_DIR == null) {
- return null;
- }
- // Get file (create if necessary)
- File logFile = new File(MEM_LOG_DIR, STORE_MEMORY+".log");
- try {
- boolean fileExist = logFile.exists();
- PrintStream stream = new PrintStream(new FileOutputStream(logFile, true));
- if (stream != null) {
- if (fileExist) {
- stream.println();
- }
- // Log date and time
- Date date = new Date(System.currentTimeMillis());
- stream.println("Tests:\t" + STORE_MEMORY);
- stream.println("Date:\t" + DateFormat.getDateInstance(3).format(date));
- stream.println("Time:\t" + DateFormat.getTimeInstance(3).format(date));
- // Log columns title
- stream.print("Class");
- if (ALL_TESTS_LOG) stream.print("\tTest");
- stream.print("\tUsed\tTotal\tMax");
- stream.println();
- stream.close();
- System.out.println("Log file " + logFile.getPath() + " opened.");
- return logFile;
- } else {
- System.err.println("Cannot open file " + logFile.getPath());
- }
- } catch (FileNotFoundException e) {
- // no log available for this statistic
- }
- return null;
-}
-
-/*
- * Shows the line separators in the given String.
- */
-protected static String showLineSeparators(String string) {
- if (string == null) return null;
- StringBuffer buffer = new StringBuffer();
- int length = string.length();
- for (int i = 0; i < length; i++) {
- char car = string.charAt(i);
- switch (car) {
- case '\n':
- buffer.append("\\n\n"); //$NON-NLS-1$
- break;
- case '\r':
- if (i < length-1 && string.charAt(i+1) == '\n') {
- buffer.append("\\r\\n\n"); //$NON-NLS-1$
- i++;
- } else {
- buffer.append("\\r\n"); //$NON-NLS-1$
- }
- break;
- default:
- buffer.append(car);
- break;
- }
- }
- return buffer.toString();
-}
-
-/*
- * Returns whether a given file is a valid log directory or not.
- */
-private static boolean verifyLogDir(File logDir) {
- if (logDir.exists()) {
- if (logDir.isDirectory()) {
- return true;
- } else {
- System.err.println(logDir+" is not a valid directory. Log files will NOT be written!");
- }
- } else {
- if (logDir.mkdir()) {
- return true;
- } else {
- System.err.println("Cannot create "+logDir+" as its parent does not exist. Log files will NOT be written!");
- }
- }
- return false;
-}
-
-public void assertPerformance() {
- // make it public to avoid compiler warning about synthetic access
-// super.assertPerformance();
-}
-
-
-/**
- * Clean test before run it.
- * Currently, clean only performs a gc.
- */
-protected void clean() {
- System.out.println("Clean test "+getName());
- // Run gc
- int iterations = 0;
- long delta=0, free=0;
- for (int i=0; i<MAX_GC; i++) {
- free = Runtime.getRuntime().freeMemory();
- System.gc();
- delta = Runtime.getRuntime().freeMemory() - free;
- try {
- Thread.sleep(TIME_GC);
- } catch (InterruptedException e) {
- // do nothing
- }
- }
- if (iterations == MAX_GC && delta > DELTA_GC) {
- // perhaps gc was not well executed
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- // do nothing
- }
- }
-}
-
-public void commitMeasurements() {
-// super.commitMeasurements();
-}
-
-/**
- * Return whether current test is on a new {@link Test test} class or not.
- *
- * @return <code>true</code> if it's the first test of a {@link TestSuite},
- * <code>false</code> otherwise.
- */
-protected boolean isFirst() {
- return first;
-}
-
-protected void setUp() throws Exception {
- super.setUp();
-
- // Store test class and its name when changing
- first = false;
- if (CURRENT_CLASS == null || CURRENT_CLASS != getClass()) {
- if (CURRENT_CLASS != null && RUN_GC) clean();
- CURRENT_CLASS = getClass();
- first = true;
- CURRENT_CLASS_NAME = getClass().getName();
- CURRENT_CLASS_NAME = CURRENT_CLASS_NAME.substring(CURRENT_CLASS_NAME.indexOf(".tests.")+7, CURRENT_CLASS_NAME.length());
- }
-
- // Memory storage if specified
- if (STORE_MEMORY != null && MEM_LOG_FILE != null) {
- if (ALL_TESTS_LOG && MEM_LOG_FILE.exists()) {
- PrintStream stream = new PrintStream(new FileOutputStream(MEM_LOG_FILE, true));
- stream.print(CURRENT_CLASS_NAME);
- stream.print('\t');
- String testName = getName();
- stream.print(testName);
- stream.print('\t');
- long total = Runtime.getRuntime().totalMemory();
- long used = total - Runtime.getRuntime().freeMemory();
- stream.print(used);
- stream.print('\t');
- stream.print(total);
- stream.print('\t');
- stream.print(Runtime.getRuntime().maxMemory());
- stream.println();
- stream.close();
- }
- }
-}
-
-public void startMeasuring() {
- // make it public to avoid compiler warning about synthetic access
-// super.startMeasuring();
-}
-public void stopMeasuring() {
- // make it public to avoid compiler warning about synthetic access
-// super.stopMeasuring();
-}
-
-protected void tearDown() throws Exception {
- super.tearDown();
-
- // Memory storage if specified
- if (STORE_MEMORY != null && MEM_LOG_FILE != null) {
- if ((first || ALL_TESTS_LOG) && MEM_LOG_FILE.exists()) {
- PrintStream stream = new PrintStream(new FileOutputStream(MEM_LOG_FILE, true));
- stream.print(CURRENT_CLASS_NAME);
- stream.print('\t');
- if (ALL_TESTS_LOG) {
- String testName = getName();
- String str = "";
- int length = testName.length()-4;
- for (int i=0; i<length; i++) {
- str += '.';
- }
- stream.print(str);
- stream.print("end:");
- stream.print('\t');
- }
- long total = Runtime.getRuntime().totalMemory();
- long used = total - Runtime.getRuntime().freeMemory();
- stream.print(used);
- stream.print('\t');
- stream.print(total);
- stream.print('\t');
- stream.print(Runtime.getRuntime().maxMemory());
- stream.println();
- stream.close();
- }
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestListener.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestListener.java
deleted file mode 100644
index b642f96..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.junit.extension;
-
-import junit.framework.Test;
-import junit.framework.TestFailure;
-/**
- * A Listener for test progress
- */
-public interface TestListener extends junit.framework.TestListener {
- /**
- * An error occurred.
- */
- public void addError(Test test, TestFailure testFailure);
- /**
- * A failure occurred.
- */
- public void addFailure(Test test, TestFailure testFailure);
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestResult.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestResult.java
deleted file mode 100644
index 4c0783a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/junit/extension/TestResult.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.junit.extension;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestFailure;
-
-public class TestResult extends junit.framework.TestResult {
- TestCase currentTest;
-/**
- * TestResult constructor comment.
- */
-public TestResult() {
- super();
-}
- /**
- * Adds an error to the list of errors. The passed in exception
- * caused the error.
- */
- public synchronized void addError(Test test, Throwable t) {
- TestFailure testFailure= new TestFailure(test, t);
- fErrors.add(testFailure);
- for (Enumeration e= cloneListeners().elements(); e.hasMoreElements(); ) {
- ((TestListener)e.nextElement()).addError(test, testFailure);
- }
- }
- /**
- * Adds a failure to the list of failures. The passed in exception
- * caused the failure.
- */
- public synchronized void addFailure(Test test, AssertionFailedError t) {
- TestFailure testFailure= new TestFailure(test, t);
- fFailures.add(testFailure);
- for (Enumeration e= cloneListeners().elements(); e.hasMoreElements(); ) {
- ((TestListener)e.nextElement()).addFailure(test, testFailure);
- }
- }
- /**
- * Returns a copy of the listeners.
- */
- private synchronized Vector cloneListeners() {
- return new Vector(fListeners);
- }
- protected void run(final TestCase test) {
- this.currentTest = test;
- super.run(test);
- this.currentTest = null;
- }
-public synchronized void stop() {
- super.stop();
- if (this.currentTest != null && this.currentTest instanceof StopableTestCase) {
- ((StopableTestCase)this.currentTest).stop();
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/AbstractReader.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/AbstractReader.java
deleted file mode 100644
index 5fd50b2..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/AbstractReader.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-/**
- * An abstract reader that continuously reads.
- */
-
-abstract public class AbstractReader {
- protected String name;
- protected Thread readerThread;
- protected boolean isStopping= false;
-/*
- * Creates a new reader with the given name.
- */
-public AbstractReader(String name) {
- this.name = name;
-}
-/**
- * Continuously reads. Note that if the read involves waiting
- * it can be interrupted and a InterruptedException will be thrown.
- */
-abstract protected void readerLoop();
-/**
- * Start the thread that reads events.
- *
- */
-public void start() {
- this.readerThread = new Thread(
- new Runnable() {
- public void run () {
- readerLoop();
- }
- },
- AbstractReader.this.name);
- this.readerThread.start();
-}
-/**
- * Tells the reader loop that it should stop.
- */
-public void stop() {
- this.isStopping= true;
- if (this.readerThread != null)
- this.readerThread.interrupt();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VMLauncher.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VMLauncher.java
deleted file mode 100644
index 4455268..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VMLauncher.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.*;
-
-import java.util.Vector;
-
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-/**
- * A J9 VM launcher launches an external J9 VM (and J9 Proxy if needed) with
- * the given arguments on the same machine.
- * <p>
- * Unlike with the <code>StandardVMLauncher</code>, a debugger would have to
- * connect to the J9 Proxy instead of connecting to the VM directly. In this case,
- * the Proxy port is the specified debug port. Note that an internal debug port
- * must also be specified. This port is used for the communication between the
- * Proxy and the VM.
- */
-public class J9VMLauncher extends LocalVMLauncher implements RuntimeConstants {
- int internalDebugPort = -1;
- String proxyOutFile;
- String symbolPath;
-/**
- * Creates a new J9VMLauncher that launches a J9 VM
- * (and J9 Proxy if needed) on the same machine.
- */
-public J9VMLauncher() {
- super();
-}
-/**
- * Builds the actual boot class path that is going to be passed to the VM.
- */
-protected String buildBootClassPath() {
- StringBuffer bootPathString = new StringBuffer();
- char pathSeparator = File.pathSeparatorChar;
-
- if (this.bootPath != null) {
- // Add boot class path given by client
- int length = this.bootPath.length;
- for (int i = 0; i < length; i++){
- bootPathString.append(this.bootPath[i]);
- bootPathString.append(pathSeparator);
- }
- } else {
- // Add regular classes.zip
- bootPathString.append(this.vmPath);
- bootPathString.append(File.separator);
- bootPathString.append("lib");
- bootPathString.append(File.separator);
- bootPathString.append("jclMax");
- bootPathString.append(File.separator);
- bootPathString.append("classes.zip");
- bootPathString.append(pathSeparator);
- }
-
- // Add boot class path directory if needed
- if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) {
- bootPathString.append(this.evalTargetPath);
- bootPathString.append(File.separatorChar);
- bootPathString.append(BOOT_CLASSPATH_DIRECTORY);
- }
-
- return bootPathString.toString();
-}
-/**
- * @see LocalVMLauncher#execCommandLine
- */
-protected Process execCommandLine() throws TargetException {
- // Check that the internal debug port has been specified if in debug mode
- if (this.debugPort != -1 && this.internalDebugPort == -1) {
- throw new TargetException("Internal debug port has not been specified");
- }
-
- return super.execCommandLine();
-}
-/**
- * @see LocalVMLauncher#getCommandLine
- */
-public String[] getCommandLine() {
- Vector commandLine = new Vector();
-
- // VM binary
- commandLine.addElement(
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "j9");
-
- // VM arguments
- if (this.vmArguments != null) {
- for (int i = 0; i < this.vmArguments.length; i++) {
- commandLine.addElement(this.vmArguments[i]);
- }
- }
-
- // debug mode
- if (this.debugPort != -1 && this.internalDebugPort != -1) {
- commandLine.addElement("-debug:" + this.internalDebugPort);
- }
-
- // boot class path
- commandLine.addElement("-Xbootclasspath:" + buildBootClassPath());
-
- // regular class path
- commandLine.addElement("-classpath");
- commandLine.addElement(buildClassPath());
-
- // code snippet runner class
- if (this.evalPort != -1) {
- commandLine.addElement(CODE_SNIPPET_RUNNER_CLASS_NAME);
- }
-
- // code snippet runner arguments
- if (this.evalPort != -1) {
- commandLine.addElement(EVALPORT_ARG);
- commandLine.addElement(Integer.toString(this.evalPort));
- if (TARGET_HAS_FILE_SYSTEM) {
- commandLine.addElement(CODESNIPPET_CLASSPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + REGULAR_CLASSPATH_DIRECTORY);
- commandLine.addElement(CODESNIPPET_BOOTPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + BOOT_CLASSPATH_DIRECTORY);
- }
- }
-
- // program class
- if (this.programClass != null) {
- commandLine.addElement(this.programClass);
- }
-
- // program arguments
- if (this.programArguments != null) {
- for (int i=0;i<this.programArguments.length;i++) {
- commandLine.addElement(this.programArguments[i]);
- }
- }
-
- String[] result= new String[commandLine.size()];
- commandLine.copyInto(result);
-
- // check for spaces in result
- for (int i = 0; i < result.length; i++) {
- String argument = result[i];
- if (argument.indexOf(' ') != -1) {
- result[i] = "\"" + argument + "\"";
- }
- }
-
- return result;
-}
-/**
- * Returns the debug port the J9 Proxy uses to connect to the J9 VM.
- * The value is unspecified if debug mode is disabled.
- * Note that the regular debug port is the port used to connect the J9 Proxy and
- * the IDE in the case of the J9 VM Launcher.
- */
-public int getInternalDebugPort() {
- return this.internalDebugPort;
-}
-/**
- * Returns the command line which will be used to launch the Proxy.
- */
-public String[] getProxyCommandLine() {
- Vector commandLine = new Vector();
-
- // Proxy binary
- commandLine.addElement(
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "j9proxy");
-
- // Arguments
- commandLine.addElement(getTargetAddress() + ":" + this.internalDebugPort);
- commandLine.addElement(Integer.toString(this.debugPort));
- if (this.symbolPath != null && this.symbolPath != "") {
- commandLine.addElement(this.symbolPath);
- }
-
- String[] result= new String[commandLine.size()];
- commandLine.copyInto(result);
- return result;
-}
-/**
- * Returns the full path name to the file where the proxy output is redirected.
- * Returns "con" if the proxy output is redirected to the stdout.
- * Returns null if the proxy output is not redirected.
- */
-public String getProxyOutFile() {
- return this.proxyOutFile;
-}
-/**
- * Returns the full path name to the symbol file used by the J9 Proxy.
- * Returns null if the no symbol file is passed to the J9 Proxy.
- */
-public String getSymbolPath() {
- return this.symbolPath;
-}
-/**
- * @see LocalVMLauncher#launch
- */
-public LocalVirtualMachine launch() throws TargetException {
- // Launch VM
- LocalVirtualMachine localVM = super.launch();
-
- // Launch Proxy if needed
- Process proxyProcess= null;
- if (this.debugPort != -1) {
- try {
- // Use Runtime.exec(String[]) with tokens because Runtime.exec(String) with commandLineString
- // does not properly handle spaces in arguments on Unix/Linux platforms.
- String[] commandLine = getProxyCommandLine();
-
- // DEBUG
- /*
- for (int i = 0; i < commandLine.length; i++) {
- System.out.print(commandLine[i] + " ");
- }
- System.out.println();
- */
-
- proxyProcess= Runtime.getRuntime().exec(commandLine);
- } catch (IOException e) {
- localVM.shutDown();
- throw new TargetException("Error launching J9 Proxy at " + this.vmPath);
- }
- }
-
- // Transform launched VM into J9 VM
- Process vmProcess = localVM.process;
- this.runningVMs.removeElement(localVM);
- J9VirtualMachine vm= new J9VirtualMachine(vmProcess, this.debugPort, this.evalTargetPath, proxyProcess, this.proxyOutFile);
- this.runningVMs.addElement(vm);
- return vm;
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.runtime.LocalVMLauncher#setDebugPort(int)
- */
-public void setDebugPort(int debugPort) {
- super.setDebugPort(debugPort);
-
- // specify default internal debug port as well
- this.setInternalDebugPort(Util.getFreePort());
-}
-
-/**
- * Sets the debug port the J9 Proxy uses to connect to the J9 VM.
- * This is mandatory if debug mode is enabled.
- * This is ignored if debug mode is disabled.
- * Note that the regular debug port is the port used to connect the J9 Proxy and
- * the IDE in the case of the J9 VM Launcher.
- */
-public void setInternalDebugPort(int internalDebugPort) {
- this.internalDebugPort = internalDebugPort;
-}
-/**
- * Sets the full path name to the file where the proxy output must be redirected.
- * Specify "con" if the proxy output must be redirected to the stdout.
- * Specify null if the proxy output must not be redirected (default value).
- * This is ignored if debug mode is disabled.
- */
-public void setProxyOutFile(String proxyOutFile) {
- this.proxyOutFile = proxyOutFile;
-}
-/**
- * Sets the full path name to the symbol file used by the J9 Proxy.
- * Specify null if the no symbol file must be passed to the J9 Proxy (default value).
- * This is ignored if debug mode is disabled.
- */
-public void setSymbolPath(String symbolPath) {
- this.symbolPath = symbolPath;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VirtualMachine.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VirtualMachine.java
deleted file mode 100644
index 8ee53da..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VirtualMachine.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-/**
- * Wrapper around the external processes that are running a J9 VM
- * and a J9 Proxy.
- * This allows to kill these processes when we exit this vm.
- */
-class J9VirtualMachine extends LocalVirtualMachine {
- private Process proxyProcess;
- private AbstractReader proxyConsoleReader;
- private String proxyOutputFile;
-/**
- * Creates a new J9VirtualMachine from the Processes that runs this VM
- * and its J9 Proxy and with the given info.
- */
-public J9VirtualMachine(Process vmProcess, int debugPort, String evalTargetPath, Process proxyProcess, String proxyOutputFile) {
- super(vmProcess, debugPort, evalTargetPath);
- this.proxyProcess = proxyProcess;
- this.proxyOutputFile = proxyOutputFile;
-
- // Start the Proxy console reader so that the proxy is not blocked on its stdout.
- if (this.proxyProcess != null) {
- if (this.proxyOutputFile == null) {
- this.proxyConsoleReader=
- new NullConsoleReader(
- "J9 Proxy Console Reader",
- this.proxyProcess.getInputStream());
- } else {
- this.proxyConsoleReader=
- new ProxyConsoleReader(
- "J9 Proxy Console Reader",
- this.proxyProcess.getInputStream(),
- this.proxyOutputFile);
- }
- this.proxyConsoleReader.start();
- }
-
-}
-private boolean isProxyRunning() {
- if (this.proxyProcess == null) {
- return false;
- }
- boolean hasExited;
- try {
- this.proxyProcess.exitValue();
- hasExited = true;
- } catch (IllegalThreadStateException e) {
- hasExited = false;
- }
- return !hasExited;
-}
-/**
- * @see LocalVirtualMachine#shutDown
- */
-public void shutDown() throws TargetException {
- super.shutDown();
- if (this.proxyConsoleReader != null)
- this.proxyConsoleReader.stop();
- if ((this.proxyProcess != null) && isProxyRunning())
- this.proxyProcess.destroy();
-}
-/**
- * @see LocalVirtualMachine#shutDown
- */
-public void waitForTermination() throws InterruptedException {
- super.waitForTermination();
- if (this.proxyProcess != null)
- this.proxyProcess.waitFor();
- if (this.proxyConsoleReader != null)
- this.proxyConsoleReader.stop();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/JRockitVMLauncher.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/JRockitVMLauncher.java
deleted file mode 100644
index 7f9029e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/JRockitVMLauncher.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-
-import java.io.*;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-/**
- * A standard VM launcher launches an external standard VM with
- * the given arguments on the same machine.
- */
-public class JRockitVMLauncher extends LocalVMLauncher implements RuntimeConstants {
- String batchFileName;
-/**
- * Creates a new StandardVMLauncher that launches a standard VM
- * on the same machine.
- */
-public JRockitVMLauncher() {
- super();
-}
-/**
- * Builds the actual boot class path that is going to be passed to the VM.
- */
-protected String buildBootClassPath() {
- StringBuffer bootPathString = new StringBuffer();
-
- // Add boot class path directory if needed
- if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) {
- bootPathString.append(this.evalTargetPath);
- bootPathString.append(File.separatorChar);
- bootPathString.append(BOOT_CLASSPATH_DIRECTORY);
- }
-
- return bootPathString.toString();
-}
-/**
- * Returns the name of the batch file used to launch the VM.
- */
-public String getBatchFileName() {
- return this.batchFileName;
-}
-/**
- * @see LocalVMLauncher#getCommandLine
- */
-public String[] getCommandLine() {
- Vector commandLine= new Vector();
-
- // VM binary
- if (System.getProperty("java.vm.version").startsWith("1.4.2")) {
- commandLine.addElement(
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "java");
- } else {
- String vmLocation = this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "javaw";
- final String osName = System.getProperty("os.name");
- if (osName.indexOf("win32") != -1) {
- vmLocation += ".exe";
- }
- if (!new File(vmLocation).exists()) {
- vmLocation =
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "java";
- }
- commandLine.addElement(vmLocation);
- }
-
- // VM arguments
- if (this.vmArguments != null) {
- for (int i = 0; i < this.vmArguments.length; i++) {
- commandLine.addElement(this.vmArguments[i]);
- }
- }
-
- // debug mode
- if (this.debugPort != -1) {
- commandLine.addElement("-Xdebug");
- commandLine.addElement("-Xnoagent");
- commandLine.addElement(
- "-Xrunjdwp:transport=dt_socket,address=" +
- this.debugPort +
- ",server=y,suspend=n");
- }
-
- // set the classpath
- // we don't set the bootclasspath as for StandardVMLauncher as this breaks the debug mode of JRockit
- // we would get: [JRockit] ERROR: failed to set up MAPI gc reporting
- commandLine.addElement("-classpath");
- String classpath = buildBootClassPath() + File.pathSeparator + buildClassPath();
- System.out.println(classpath);
- commandLine.addElement(classpath);
-
- // code snippet runner class
- if (this.evalPort != -1) {
- commandLine.addElement(CODE_SNIPPET_RUNNER_CLASS_NAME);
- }
-
- // code snippet runner arguments
- if (this.evalPort != -1) {
- commandLine.addElement(EVALPORT_ARG);
- commandLine.addElement(Integer.toString(this.evalPort));
- if (TARGET_HAS_FILE_SYSTEM) {
- commandLine.addElement(CODESNIPPET_CLASSPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + REGULAR_CLASSPATH_DIRECTORY);
- commandLine.addElement(CODESNIPPET_BOOTPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + BOOT_CLASSPATH_DIRECTORY);
- }
- }
-
- // program class
- if (this.programClass != null) {
- commandLine.addElement(this.programClass);
- }
-
- // program arguments
- if (this.programArguments != null) {
- for (int i=0;i<this.programArguments.length;i++) {
- commandLine.addElement(this.programArguments[i]);
- }
- }
-
- String[] result;
- if (this.batchFileName!= null) {
- // Write to batch file if specified
- writeBatchFile(this.batchFileName, commandLine);
- result = new String[] {this.batchFileName};
- } else {
- result = new String[commandLine.size()];
- commandLine.copyInto(result);
- }
-
- // check for spaces in result
- for (int i = 0; i < result.length; i++) {
- String argument = result[i];
- if (argument.indexOf(' ') != -1) {
- result[i] = "\"" + argument + "\"";
- }
- }
-
- return result;
-}
-/**
- * Sets the name of the batch file used to launch the VM.
- * When this option is set, the launcher writes the command line to the given batch file,
- * and it launches the batch file. This causes a DOS console to be opened. Note it
- * doesn't delete the batch file when done.
- */
-public void setBatchFileName(String batchFileName) {
- this.batchFileName = batchFileName;
-}
-protected void writeBatchFile(String fileName, Vector commandLine) {
- FileOutputStream output = null;
- try {
- output = new FileOutputStream(fileName);
- PrintWriter out= new PrintWriter(output);
- for (Enumeration e = commandLine.elements(); e.hasMoreElements();) {
- out.print((String)e.nextElement());
- out.print(" ");
- }
- out.println("pause");
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- if (output != null) {
- try {
- output.close();
- } catch (IOException e2) {
- // ignore
- }
- }
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVMLauncher.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVMLauncher.java
deleted file mode 100644
index 7a49609..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVMLauncher.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.*;
-import java.util.*;
-
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-/**
- * The root of the VM launchers that launch VMs on the same machine.
- * <p>
- * A local VM launcher has the following limitations:
- * <ul>
- * <li>It can only retrieve the running virtual machines that it has launched. So if
- * a client is using 2 instances of <code>LocalVMLauncher</code>, each of these
- * instances will be able to retrieve only a part of the running VMs.
- * </ul>
- */
-public abstract class LocalVMLauncher implements RuntimeConstants {
-
- /**
- * Whether the target has a file system and thus whether it supports writing
- * class files to disk. See org.eclipse.wst.jsdt.core.tests.eval.target.CodeSnippetRunner for more
- * information.
- */
- public static final boolean TARGET_HAS_FILE_SYSTEM = true;
- public static final String REGULAR_CLASSPATH_DIRECTORY = "regularPath";
- public static final String BOOT_CLASSPATH_DIRECTORY = "bootPath";
-
- protected String[] bootPath;
- protected String[] classPath;
- protected int debugPort = -1;
- protected int evalPort = -1;
- protected String evalTargetPath;
- protected String[] programArguments;
- protected String programClass;
- protected Vector runningVMs = new Vector(); // a Vector of LocalVirtualMachine
- protected String[] vmArguments;
- protected String vmPath;
-
-/**
- * Returns a launcher that will launch the same kind of VM that is currently running
- */
-public static LocalVMLauncher getLauncher() {
- final String vmName = System.getProperty("java.vm.name");
- if ("J9".equals(vmName)) {
- return new J9VMLauncher();
- }
- if (vmName != null && vmName.indexOf("JRockit") != -1) {
- return new JRockitVMLauncher();
- }
- final String osName = System.getProperty("os.name");
- if (osName.startsWith("Mac")) {
- return new MacVMLauncher();
- }
- File file = new File(Util.getJREDirectory() + "/lib/rt.jar");
- if (file.exists()) {
- return new StandardVMLauncher();
- }
- if ("IBM J9SE VM".equals(vmName)) {
- return new SideCarJ9VMLauncher();
- }
- return new SideCarVMLauncher();
-}
-/**
- * Builds the actual class path that is going to be passed to the VM.
- */
-protected String buildClassPath() {
- StringBuffer classPathString = new StringBuffer();
- char pathSeparator = File.pathSeparatorChar;
-
- // Add jar support if in evaluation mode
- if (this.evalPort != -1) {
- classPathString.append(new File(this.evalTargetPath, SUPPORT_ZIP_FILE_NAME).getPath());
- classPathString.append(pathSeparator);
- }
-
- // Add class path given by client
- if (this.classPath != null) {
- int length = this.classPath.length;
- for (int i = 0; i < length; i++){
- classPathString.append(this.classPath[i]);
- classPathString.append(pathSeparator);
- }
- }
-
- // Add regular classpath directory if needed
- if (this.evalPort != -1 && TARGET_HAS_FILE_SYSTEM) {
- classPathString.append(this.evalTargetPath);
- classPathString.append(File.separatorChar);
- classPathString.append(REGULAR_CLASSPATH_DIRECTORY);
- }
-
- return classPathString.toString();
-}
-/**
- * Launches the VM by exec'ing the command line and returns the resulting Process.
- */
-protected Process execCommandLine() throws TargetException {
- // Check that the VM path has been specified
- if (this.vmPath == null) {
- throw new TargetException("Path to the VM has not been specified");
- }
-
- // Check that the program class has been specified if not in evaluation mode
- if ((this.programClass == null) && (this.evalPort == -1)) {
- throw new TargetException("Program class has not been specified");
- }
-
- // Launch VM
- Process vmProcess= null;
- try {
- // Use Runtime.exec(String[]) with tokens because Runtime.exec(String) with commandLineString
- // does not properly handle spaces in arguments on Unix/Linux platforms.
- String[] commandLine = getCommandLine();
-
- // DEBUG
- /*for (int i = 0; i < commandLine.length; i++) {
- System.out.print(commandLine[i] + " ");
- }
- System.out.println();
- */
-
- vmProcess= Runtime.getRuntime().exec(commandLine);
- } catch (IOException e) {
- throw new TargetException("Error launching VM at " + this.vmPath);
- }
- return vmProcess;
-}
-/**
- * Returns the boot class path used when a VM is launched.
- */
-public String[] getBootClassPath() {
- return this.bootPath;
-}
-/**
- * Returns the class path used when a VM is launched.
- */
-public String[] getClassPath() {
- return this.classPath;
-}
-/**
- * Returns the command line which will be used to launch the VM.
- * The segments are in the following order:
- * <p><ul>
- * <li> VM path,
- * <li> VM arguments,
- * <li> the class path,
- * <li> the program class
- * <li> the program arguments
- * </ul>
- */
-public abstract String[] getCommandLine();
-/**
- * Returns the debug port, or -1 if debug mode is disabled.
- * The default is -1.
- */
-public int getDebugPort() {
- return this.debugPort;
-}
-/**
- * Returns the evaluation port for evaluation support.
- * The default is -1, indicating no evaluation support.
- *
- * @see #setEvalPort(int)
- */
-public int getEvalPort() {
- return this.evalPort;
-}
-/**
- * Returns the evaluation target path for evaluation support.
- *
- * @see #setEvalTargetPath(String)
- */
-public String getEvalTargetPath() {
- return this.evalTargetPath;
-}
-/**
- * Returns the arguments passed to the program class.
- * Returns null if the VM is being launched for evaluation support only.
- */
-public String[] getProgramArguments() {
- if (this.evalPort != -1) {
- return null;
- }
- return this.programArguments;
-}
-/**
- * Returns the dot-separated, fully qualified name of the class to run.
- * It must implement main(String[] args).
- * Returns null if the VM is being launched for evaluation support only.
- */
-public String getProgramClass() {
- if (this.evalPort != -1) {
- return null;
- }
- return this.programClass;
-}
-/**
- * Returns all the target VMs that are running at this launcher's target
- * address.
- * Note that these target VMs may or may not have been launched by this
- * launcher.
- * Note also that if the list of running VMs doesn't change on the target,
- * two calls to this method return VMs that are equal.
- *
- * @return the list of running target VMs
- */
-public LocalVirtualMachine[] getRunningVirtualMachines() {
- // Select the VMs that are actually running
- Vector actuallyRunning = new Vector();
- Enumeration en = this.runningVMs.elements();
- while (en.hasMoreElements()) {
- LocalVirtualMachine vm = (LocalVirtualMachine)en.nextElement();
- if (vm.isRunning())
- actuallyRunning.addElement(vm);
- }
- this.runningVMs = actuallyRunning;
-
- // Return the running VMs
- int size = actuallyRunning.size();
- LocalVirtualMachine[] result = new LocalVirtualMachine[size];
- for (int i=0; i<size; i++)
- result[i] = (LocalVirtualMachine)actuallyRunning.elementAt(i);
- return result;
-}
-/**
- * Returns the address of the target where this launcher runs the target VMs. The format
- * of this address is transport specific.
- * For example, a VM launcher using a TCP/IP transport returns target addresses looking like:
- * <code>"localhost:2010"</code>, or <code>"joe.ibm.com"</code>.
- *
- * @return transport specific address of the target
- */
-public String getTargetAddress() {
- return "localhost";
-}
-/**
- * Returns the VM-specific arguments. This does not include:
- * <p><ul>
- * <li>the VM path
- * <li>the class path or the boot class path
- * <li>the program class or program arguments
- * </ul>
- */
-public String[] getVMArguments() {
- return this.vmArguments;
-}
-/**
- * Returns the path on disk of the VM to launch.
- */
-public String getVMPath() {
- return this.vmPath;
-}
-/**
- * Initializes this context's target path by copying the jar file for the code snippet support
- * and by creating the 2 directories that will contain the code snippet classes (see TARGET_HAS_FILE_SYSTEM).
- * Add the code snipport root class to the boot path directory so that code snippets can be run in
- * java.* packages
- *
- * @throws TargetException if the path could not be initialized with the code snippet support
- */
-protected void initTargetPath() throws TargetException {
- // create directories
- File directory = new File(this.evalTargetPath);
- directory.mkdirs();
- if (!directory.exists()) {
- throw new TargetException("Could not create directory " + this.evalTargetPath);
- }
- if (TARGET_HAS_FILE_SYSTEM) {
- File classesDirectory = new File(directory, REGULAR_CLASSPATH_DIRECTORY);
- classesDirectory.mkdir();
- if (!classesDirectory.exists()) {
- throw new TargetException("Could not create directory " + classesDirectory.getPath());
- }
- File bootDirectory = new File(directory, BOOT_CLASSPATH_DIRECTORY);
- bootDirectory.mkdir();
- if (!bootDirectory.exists()) {
- throw new TargetException("Could not create directory " + bootDirectory.getPath());
- }
- /*
- // add the code snippet root class to the boot path directory
- InputStream in = null;
- try {
- in = EvaluationContext.class.getResourceAsStream("/" + SUPPORT_ZIP_FILE_NAME);
- ZipInputStream zip = new ZipInputStream(in);
- String rootClassFileName = ROOT_FULL_CLASS_NAME.replace('.', '/') + ".class";
- while (true) {
- ZipEntry entry = zip.getNextEntry();
- if (entry.getName().equals(rootClassFileName)) {
- // read root class file contents
- int size = (int)entry.getSize();
- byte[] buffer = new byte[size];
- int totalRead = 0;
- int read = 0;
- while (totalRead < size) {
- read = zip.read(buffer, totalRead, size - totalRead);
- if (read != -1) {
- totalRead += read;
- }
- }
- // write root class file contents
- FileOutputStream out = null;
- try {
- File rootFile = new File(bootDirectory, rootClassFileName.replace('/', File.separatorChar));
- File parent = new File(rootFile.getParent());
- parent.mkdirs();
- out = new FileOutputStream(rootFile);
- out.write(buffer);
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- if (out != null) {
- try {
- out.close();
- } catch (IOException e2) {
- }
- }
- }
- break;
- }
- }
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- if (in != null) {
- try {
- in.close();
- } catch (IOException e2) {
- }
- }
- }*/
- }
-
- // copy jar file
- InputStream in = null;
- FileOutputStream out = null;
- try {
- in = this.getClass().getResourceAsStream("/" + SUPPORT_ZIP_FILE_NAME);
- if (in == null) {
- throw new TargetException("Could not find resource /" + SUPPORT_ZIP_FILE_NAME);
- }
- int bufferLength = 1024;
- byte[] buffer = new byte[bufferLength];
- File file = new File(directory, SUPPORT_ZIP_FILE_NAME);
- out = new FileOutputStream(file);
- int read = 0;
- while (read != -1) {
- read = in.read(buffer, 0, bufferLength);
- if (read != -1) {
- out.write(buffer, 0, read);
- }
- }
- } catch (IOException e) {
- throw new TargetException("IOException while copying " + SUPPORT_ZIP_FILE_NAME + ": " + e.getMessage());
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- }
- }
- if (out != null) {
- try {
- out.close();
- } catch (IOException e) {
- }
- }
- }
-}
-/**
- * Launches a new target VM with the registered arguments.
- * This operation returns once a new target VM has been launched.
- *
- * @exception TargetException if the target VM could not be launched.
- */
-public LocalVirtualMachine launch() throws TargetException {
- // evaluation mode
- if (this.evalTargetPath != null) {
- // init target path
- this.initTargetPath();
- }
-
- // launch VM
- LocalVirtualMachine vm;
- Process p = execCommandLine();
- vm = new LocalVirtualMachine(p, this.debugPort, this.evalTargetPath);
-
- // TBD: Start reading VM stdout and stderr right away otherwise this may prevent the connection
- // from happening.
-
- // add VM to list of known running VMs
- this.runningVMs.addElement(vm);
- return vm;
-}
-/**
- * Sets the boot class path used when a VM is launched.
- */
-public void setBootClassPath(java.lang.String[] bootClassPath) {
- this.bootPath = bootClassPath;
-}
-/**
- * Sets the class path used when a VM is launched.
- */
-public void setClassPath(String[] classPath) {
- this.classPath = classPath;
-}
-/**
- * Sets the debug port to use for debug support.
- * Specify -1 to disable debug mode.
- */
-public void setDebugPort(int debugPort) {
- this.debugPort = debugPort;
-}
-/**
- * Sets the evaluation port to use for evaluation support.
- * Setting the port enables evaluation support.
- * Specify null to disable evaluation support.
- */
-public void setEvalPort(int evalPort) {
- this.evalPort = evalPort;
-}
-/**
- * Sets the evaluation target path to use for evaluation support.
- */
-public void setEvalTargetPath(String evalTargetPath) {
- this.evalTargetPath = evalTargetPath;
-}
-/**
- * Sets the arguments passed to the program class.
- * This is ignored if the VM is being launched for evaluation support only.
- */
-public void setProgramArguments(String[] args) {
- this.programArguments = args;
-}
-/**
- * Sets the dot-separated, fully qualified name of the class to run.
- * It must implement main(String[] args).
- * This is ignored if the VM is being launched for evaluation support only.
- */
-public void setProgramClass(String programClass) {
- this.programClass = programClass;
-}
-/**
- * Sets the VM-specific arguments. This does not include:
- * <p><ul>
- * <li>the VM path
- * <li>the class path or the boot class path
- * <li>the program class or program arguments
- * </ul>
- */
-public void setVMArguments(String[] args) {
- this.vmArguments = args;
-}
-/**
- * Sets the path on disk of the VM to launch.
- */
-public void setVMPath(String vmPath) {
- this.vmPath = vmPath;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVirtualMachine.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVirtualMachine.java
deleted file mode 100644
index 4cb14e0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVirtualMachine.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.*;
-
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-/**
- * Wrapper around the external process that is running a local VM.
- * This allows to kill this process when we exit this vm.
- */
-public class LocalVirtualMachine {
- protected Process process;
- protected int debugPort;
- protected String evalTargetPath;
-/**
- * Creates a new LocalVirtualMachine that doesn't run and that cannot be debugged nor used to
- * evaluate.
- */
-public LocalVirtualMachine() {
- this.process = null;
- this.debugPort = -1;
- this.evalTargetPath = null;
-}
-/**
- * Creates a new LocalVirtualMachine from the Process that runs this VM
- * and with the given debug port number.
- */
-public LocalVirtualMachine(Process p, int debugPort, String evalTargetPath) {
- this.process = p;
- this.debugPort = debugPort;
- this.evalTargetPath = evalTargetPath;
-}
-/**
- * Destroys the process running this VM.
- */
-protected void basicShutDown() {
- if ((this.process != null) && this.isRunning()) {
- this.process.destroy();
- }
-}
-/*
- * Cleans up the given directory by removing all the files it contains as well
- * but leaving the directory.
- * @throws TargetException if the target path could not be cleaned up
- *
-private void cleanupDirectory(File directory) throws TargetException {
- if (!directory.exists()) {
- return;
- }
- String[] fileNames = directory.list();
- for (int i = 0; i < fileNames.length; i++) {
- File file = new File(directory, fileNames[i]);
- if (file.isDirectory()) {
- cleanupDirectory(file);
- if (!file.delete()) {
- throw new TargetException("Could not delete directory " + directory.getPath());
- }
- } else {
- if (!file.delete()) {
- throw new TargetException("Could not delete file " + file.getPath());
- }
- }
- }
-}
-*/
-/**
- * Cleans up this context's target path by removing all the files it contains
- * but leaving the directory.
- * @throws TargetException if the target path could not be cleaned up
- */
-protected void cleanupTargetPath() throws TargetException {
- if (this.evalTargetPath == null) return;
- String targetPath = this.evalTargetPath;
- if (LocalVMLauncher.TARGET_HAS_FILE_SYSTEM) {
- Util.delete(new File(targetPath, LocalVMLauncher.REGULAR_CLASSPATH_DIRECTORY));
- Util.delete(new File(targetPath, LocalVMLauncher.BOOT_CLASSPATH_DIRECTORY));
- File file = new File(targetPath, RuntimeConstants.SUPPORT_ZIP_FILE_NAME);
-
- /* workaround pb with Process.exitValue() that returns the process has exited, but it has not free the file yet
- int count = 10;
- for (int i = 0; i < count; i++) {
- if (file.delete()) {
- break;
- }
- try {
- Thread.sleep(count * 100);
- } catch (InterruptedException e) {
- }
- }
- */
- if (!Util.delete(file)) {
- throw new TargetException("Could not delete " + file.getPath());
- }
- } else {
- Util.delete(targetPath);
- }
-}
-/**
- * Returns the debug port number for this VM. This is the port number that was
- * passed as the "-debug" option if this VM was launched using a <code>LocalVMLauncher</code>.
- * Returns -1 if this information is not available or if this VM is not running in
- * debug mode.
- */
-public int getDebugPortNumber() {
- return this.debugPort;
-}
-/**
- * Returns an input stream that is connected to the standard error
- * (<code>System.err</code>) of this target VM.
- * Bytes that are written to <code>System.err</code> by the target
- * program become available in the input stream.
- * <p>
- * Note 1: This stream is usually unbuffered.
- * <p>
- * Note 2: Two calls to this method return the same identical input stream.
- * <p>
- * See also <code>java.lang.Process.getErrorStream()</code>.
- *
- * @return an input stream connected to the target VM's <code>System.err</code>.
- * @exception TargetException if the target VM is not reachable.
- */
-public InputStream getErrorStream() throws TargetException {
- if (this.process == null)
- throw new TargetException("The VM is not running");
- return this.process.getErrorStream();
-}
-/**
- * Returns an input stream that is connected to the standard output
- * (<code>System.out</code>) of this target VM.
- * Bytes that are written to <code>System.out</code> by the target
- * program become available in the input stream.
- * <p>
- * Note 1: This stream is usually buffered.
- * <p>
- * Note 2: Two calls to this method return the same identical input stream.
- * <p>
- * See also <code>java.lang.Process.getInputStream()</code>.
- *
- * @return an input stream connected to the target VM's <code>System.out</code>.
- * @exception TargetException if the target VM is not reachable.
- */
-public InputStream getInputStream() throws TargetException {
- if (this.process == null)
- throw new TargetException("The VM is not running");
- // Workaround problem with input stream of a Process
- return new VMInputStream(this.process, this.process.getInputStream());
-}
-/**
- * Returns an output stream that is connected to the standard input
- * (<code>System.in</code>) of this target VM.
- * Bytes that are written to the output stream by a client become available to the target
- * program in <code>System.in</code>.
- * <p>
- * Note 1: This stream is usually buffered.
- * <p>
- * Note 2: Two calls to this method return the same identical output stream.
- * <p>
- * See also <code>java.lang.Process.getOutputStream()</code>.
- *
- * @return an output stream connected to the target VM's <code>System.in</code>.
- * @exception TargetException if the target VM is not reachable.
- */
-public OutputStream getOutputStream() throws TargetException {
- if (this.process == null)
- throw new TargetException("The VM is not running");
- return this.process.getOutputStream();
-}
-/**
- * Returns whether this target VM is still running.
- * <p>
- * Note: This operation may require contacting the target VM to find out
- * if it is still running.
- */
-public boolean isRunning() {
- if (this.process == null) {
- return false;
- }
- boolean hasExited;
- try {
- this.process.exitValue();
- hasExited = true;
- } catch (IllegalThreadStateException e) {
- hasExited = false;
- }
- return !hasExited;
-}
-/**
- * Shuts down this target VM.
- * This causes the VM to exit. This operation is ignored
- * if the VM has already shut down.
- *
- * @exception TargetException if the target VM could not be shut down.
- */
-public void shutDown() throws TargetException {
- this.basicShutDown();
- int retry = 0;
- while (this.isRunning() && (++retry < 20)) {
- try {
- Thread.sleep(retry * 100);
- } catch (InterruptedException e) {
- }
- }
- if (this.isRunning()) { // give up cleaning the target path if VM is still running
- throw new TargetException("Could not shut the VM down");
- }
- this.cleanupTargetPath();
-}
-/**
- * Waits for the VM to shut down. This method returns
- * immediately if the VM has already shut down. If the
- * VM has not yet shut down, the calling thread will be
- * blocked until the VM shuts down.
- *
- * @exception InterruptedException if the <code>waitForTermination</code> was
- * interrupted.
- */
-public void waitForTermination() throws InterruptedException {
- if (this.process == null) return;
- this.process.waitFor();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/MacVMLauncher.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/MacVMLauncher.java
deleted file mode 100644
index 810127c..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/MacVMLauncher.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.File;
-import java.util.Vector;
-/**
- * This is a new vm launcher to support sidecar settings
- */
-public class MacVMLauncher extends StandardVMLauncher {
-/**
- * @see LocalVMLauncher#getCommandLine
- */
-public String[] getCommandLine() {
- Vector commandLine= new Vector();
-
- // VM binary
- commandLine.addElement(
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "java");
-
- // VM arguments
- if (this.vmArguments != null) {
- for (int i = 0; i < this.vmArguments.length; i++) {
- commandLine.addElement(this.vmArguments[i]);
- }
- }
-
- // boot classpath
- commandLine.addElement("-Xbootclasspath/a:" + buildBootClassPath());
-
- // debug mode
- if (this.debugPort != -1) {
- commandLine.addElement("-Xdebug");
- commandLine.addElement("-Xnoagent");
- // commandLine.addElement("-Djava.compiler=NONE");
- commandLine.addElement(
- "-Xrunjdwp:transport=dt_socket,address=" +
- this.debugPort +
- ",server=y,suspend=n");
- } else {
- commandLine.addElement("-Xdebug");
- }
-
- // regular classpath
- commandLine.addElement("-classpath");
- commandLine.addElement(buildClassPath());
-
- // code snippet runner class
- if (this.evalPort != -1) {
- commandLine.addElement(CODE_SNIPPET_RUNNER_CLASS_NAME);
- }
-
- // code snippet runner arguments
- if (this.evalPort != -1) {
- commandLine.addElement(EVALPORT_ARG);
- commandLine.addElement(Integer.toString(this.evalPort));
- if (TARGET_HAS_FILE_SYSTEM) {
- commandLine.addElement(CODESNIPPET_CLASSPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + REGULAR_CLASSPATH_DIRECTORY);
- commandLine.addElement(CODESNIPPET_BOOTPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + BOOT_CLASSPATH_DIRECTORY);
- }
- }
-
- // program class
- if (this.programClass != null) {
- commandLine.addElement(this.programClass);
- }
-
- // program arguments
- if (this.programArguments != null) {
- for (int i=0;i<this.programArguments.length;i++) {
- commandLine.addElement(this.programArguments[i]);
- }
- }
-
- String[] result;
- if (this.batchFileName!= null) {
- // Write to batch file if specified
- writeBatchFile(this.batchFileName, commandLine);
- result = new String[] {this.batchFileName};
- } else {
- result = new String[commandLine.size()];
- commandLine.copyInto(result);
- }
-
- // check for spaces in result
- for (int i = 0; i < result.length; i++) {
- String argument = result[i];
- if (argument.indexOf(' ') != -1) {
- result[i] = "\"" + argument + "\"";
- }
- }
-
- return result;
-}
-
-/**
- * Builds the actual boot class path that is going to be passed to the VM.
- */
-protected String buildBootClassPath() {
- StringBuffer bootPathString = new StringBuffer();
- char pathSeparator = File.pathSeparatorChar;
-
- if (this.bootPath != null) {
- // Add boot class path given by client
- int length = this.bootPath.length;
- for (int i = 0; i < length; i++){
- bootPathString.append(this.bootPath[i]);
- bootPathString.append(pathSeparator);
- }
- }
-
- // Add boot class path directory if needed
- if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) {
- bootPathString.append(this.evalTargetPath);
- bootPathString.append(File.separatorChar);
- bootPathString.append(BOOT_CLASSPATH_DIRECTORY);
- }
-
- return bootPathString.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/NullConsoleReader.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/NullConsoleReader.java
deleted file mode 100644
index 9c4dae7..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/NullConsoleReader.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.InputStream;
-
-/**
- * A null console reader that continuously reads from the VM input stream
- * so that the VM doesn't block when the program writes to the stout.
- */
-
-public class NullConsoleReader extends AbstractReader {
- private InputStream input;
-/*
- * Creates a new console reader that will read from the given input stream.
- */
-public NullConsoleReader(String name, InputStream input) {
- super(name);
- this.input = input;
-}
-/**
- * Continuously reads events that are coming from the event queue.
- */
-protected void readerLoop() {
- java.io.BufferedReader bufferedInput = new java.io.BufferedReader(new java.io.InputStreamReader(this.input));
- try {
- int read= 0;
- while (!this.isStopping && read != -1) {
- read= bufferedInput.read();
- }
- } catch (java.io.IOException e) {
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/ProxyConsoleReader.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/ProxyConsoleReader.java
deleted file mode 100644
index 0f105b7..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/ProxyConsoleReader.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.*;
-
-/**
- * A <code>ProxyConsoleReader</code> reads the ouput from the proxy and
- * redirects it to a file or to the stdout if "con" is the name of the file.
- */
-class ProxyConsoleReader extends AbstractReader {
- private InputStream input;
- private OutputStream output;
-/*
- * Creates a new proxy console reader that will read from the given input stream
- * and rewrite what's read to the given file (or the stdout is the file name is
- * "con")
- */
-public ProxyConsoleReader(String name, InputStream input, String fileName) {
- super(name);
- this.input = input;
- if (fileName.equals("con")) {
- this.output= System.out;
- } else {
- try {
- this.output= new FileOutputStream(fileName);
- } catch (IOException e) {
- System.out.println("Could not create file " + fileName + ". Redirecting to stdout");
- this.output= System.out;
- }
- }
-}
-/**
- * Continuously reads from the proxy output and redirect what's read to
- * this reader's file.
- */
-protected void readerLoop() {
- try {
- byte[] buffer= new byte[1024];
- int read= 0;
- while (!this.isStopping && read != -1) {
- read= this.input.read(buffer);
- if (read != -1)
- this.output.write(buffer, 0, read);
- }
- } catch (java.io.IOException e) {
- }
-}
-/**
- * Stop this reader
- */
-public void stop() {
- super.stop();
- try {
- if (this.output != System.out)
- this.output.close();
- } catch (IOException e) {
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/RuntimeConstants.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/RuntimeConstants.java
deleted file mode 100644
index dc17a5a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/RuntimeConstants.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-public interface RuntimeConstants {
- public static final String SUPPORT_ZIP_FILE_NAME = "EvalTestsTarget.zip";
- public static final String CODE_SNIPPET_RUNNER_CLASS_NAME = "org.eclipse.wst.jsdt.core.tests.eval.target.CodeSnippetRunner";
- public static final String RUN_CODE_SNIPPET_METHOD = "runCodeSnippet";
- public static final String THE_RUNNER_FIELD = "theRunner";
- public static final String EVALPORT_ARG = "-evalport";
- public static final String CODESNIPPET_CLASSPATH_ARG = "-cscp";
- public static final String CODESNIPPET_BOOTPATH_ARG = "-csbp";
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarJ9VMLauncher.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarJ9VMLauncher.java
deleted file mode 100644
index 7c369db..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarJ9VMLauncher.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.File;
-import java.util.Vector;
-/**
- * This is a new vm launcher to support sidecar settings
- */
-public class SideCarJ9VMLauncher extends StandardVMLauncher {
-/**
- * @see LocalVMLauncher#getCommandLine
- */
-public String[] getCommandLine() {
- Vector commandLine= new Vector();
-
- // VM binary
- commandLine.addElement(
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "javaw");
-
- // VM arguments
- if (this.vmArguments != null) {
- for (int i = 0; i < this.vmArguments.length; i++) {
- commandLine.addElement(this.vmArguments[i]);
- }
- }
-
- // boot classpath
- commandLine.addElement("-Xbootclasspath/a:" + buildBootClassPath());
-
- // debug mode
- if (this.debugPort != -1) {
- commandLine.addElement("-Xdebug");
- commandLine.addElement("-Xnoagent");
- // commandLine.addElement("-Djava.compiler=NONE");
- commandLine.addElement(
- "-Xrunjdwp:transport=dt_socket,address=" +
- this.debugPort +
- ",server=y,suspend=n");
- } else {
- commandLine.addElement("-Xdebug");
- }
-
- commandLine.addElement("-Xj9");
- commandLine.addElement("-Xprod");
-
- // regular classpath
- commandLine.addElement("-classpath");
- commandLine.addElement(buildClassPath());
-
- // code snippet runner class
- if (this.evalPort != -1) {
- commandLine.addElement(CODE_SNIPPET_RUNNER_CLASS_NAME);
- }
-
- // code snippet runner arguments
- if (this.evalPort != -1) {
- commandLine.addElement(EVALPORT_ARG);
- commandLine.addElement(Integer.toString(this.evalPort));
- if (TARGET_HAS_FILE_SYSTEM) {
- commandLine.addElement(CODESNIPPET_CLASSPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + REGULAR_CLASSPATH_DIRECTORY);
- commandLine.addElement(CODESNIPPET_BOOTPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + BOOT_CLASSPATH_DIRECTORY);
- }
- }
-
- // program class
- if (this.programClass != null) {
- commandLine.addElement(this.programClass);
- }
-
- // program arguments
- if (this.programArguments != null) {
- for (int i=0;i<this.programArguments.length;i++) {
- commandLine.addElement(this.programArguments[i]);
- }
- }
-
- String[] result;
- if (this.batchFileName!= null) {
- // Write to batch file if specified
- writeBatchFile(this.batchFileName, commandLine);
- result = new String[] {this.batchFileName};
- } else {
- result = new String[commandLine.size()];
- commandLine.copyInto(result);
- }
-
- // check for spaces in result
- for (int i = 0; i < result.length; i++) {
- String argument = result[i];
- if (argument.indexOf(' ') != -1) {
- result[i] = "\"" + argument + "\"";
- }
- }
-
- return result;
-}
-
-/**
- * Builds the actual boot class path that is going to be passed to the VM.
- */
-protected String buildBootClassPath() {
- StringBuffer bootPathString = new StringBuffer();
- char pathSeparator = File.pathSeparatorChar;
-
- if (this.bootPath != null) {
- // Add boot class path given by client
- int length = this.bootPath.length;
- for (int i = 0; i < length; i++){
- bootPathString.append(this.bootPath[i]);
- bootPathString.append(pathSeparator);
- }
- }
-
- // Add boot class path directory if needed
- if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) {
- bootPathString.append(this.evalTargetPath);
- bootPathString.append(File.separatorChar);
- bootPathString.append(BOOT_CLASSPATH_DIRECTORY);
- }
-
- return bootPathString.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarVMLauncher.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarVMLauncher.java
deleted file mode 100644
index 29913ec..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarVMLauncher.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.File;
-import java.util.Vector;
-/**
- * This is a new vm launcher to support sidecar settings
- */
-public class SideCarVMLauncher extends StandardVMLauncher {
-/**
- * @see LocalVMLauncher#getCommandLine
- */
-public String[] getCommandLine() {
- Vector commandLine= new Vector();
-
- // VM binary
- commandLine.addElement(
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "javaw");
-
- // VM arguments
- if (this.vmArguments != null) {
- for (int i = 0; i < this.vmArguments.length; i++) {
- commandLine.addElement(this.vmArguments[i]);
- }
- }
-
- // boot classpath
- commandLine.addElement("-Xbootclasspath/a:" + buildBootClassPath());
-
- // debug mode
- if (this.debugPort != -1) {
- commandLine.addElement("-Xdebug");
- commandLine.addElement("-Xnoagent");
- // commandLine.addElement("-Djava.compiler=NONE");
- commandLine.addElement(
- "-Xrunjdwp:transport=dt_socket,address=" +
- this.debugPort +
- ",server=y,suspend=n");
- }
-
- // regular classpath
- commandLine.addElement("-classpath");
- commandLine.addElement(buildClassPath());
-
- // code snippet runner class
- if (this.evalPort != -1) {
- commandLine.addElement(CODE_SNIPPET_RUNNER_CLASS_NAME);
- }
-
- // code snippet runner arguments
- if (this.evalPort != -1) {
- commandLine.addElement(EVALPORT_ARG);
- commandLine.addElement(Integer.toString(this.evalPort));
- if (TARGET_HAS_FILE_SYSTEM) {
- commandLine.addElement(CODESNIPPET_CLASSPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + REGULAR_CLASSPATH_DIRECTORY);
- commandLine.addElement(CODESNIPPET_BOOTPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + BOOT_CLASSPATH_DIRECTORY);
- }
- }
-
- // program class
- if (this.programClass != null) {
- commandLine.addElement(this.programClass);
- }
-
- // program arguments
- if (this.programArguments != null) {
- for (int i=0;i<this.programArguments.length;i++) {
- commandLine.addElement(this.programArguments[i]);
- }
- }
-
- String[] result;
- if (this.batchFileName!= null) {
- // Write to batch file if specified
- writeBatchFile(this.batchFileName, commandLine);
- result = new String[] {this.batchFileName};
- } else {
- result = new String[commandLine.size()];
- commandLine.copyInto(result);
- }
-
- // check for spaces in result
- for (int i = 0; i < result.length; i++) {
- String argument = result[i];
- if (argument.indexOf(' ') != -1) {
- result[i] = "\"" + argument + "\"";
- }
- }
-
- return result;
-}
-
-/**
- * Builds the actual boot class path that is going to be passed to the VM.
- */
-protected String buildBootClassPath() {
- StringBuffer bootPathString = new StringBuffer();
- char pathSeparator = File.pathSeparatorChar;
-
- if (this.bootPath != null) {
- // Add boot class path given by client
- int length = this.bootPath.length;
- for (int i = 0; i < length; i++){
- bootPathString.append(this.bootPath[i]);
- bootPathString.append(pathSeparator);
- }
- }
-
- // Add boot class path directory if needed
- if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) {
- bootPathString.append(this.evalTargetPath);
- bootPathString.append(File.separatorChar);
- bootPathString.append(BOOT_CLASSPATH_DIRECTORY);
- }
-
- return bootPathString.toString();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/StandardVMLauncher.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/StandardVMLauncher.java
deleted file mode 100644
index 0b430da..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/StandardVMLauncher.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-
-import java.io.*;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-/**
- * A standard VM launcher launches an external standard VM with
- * the given arguments on the same machine.
- */
-public class StandardVMLauncher extends LocalVMLauncher implements RuntimeConstants {
- String batchFileName;
-/**
- * Creates a new StandardVMLauncher that launches a standard VM
- * on the same machine.
- */
-public StandardVMLauncher() {
- super();
-}
-/**
- * Builds the actual boot class path that is going to be passed to the VM.
- */
-protected String buildBootClassPath() {
- StringBuffer bootPathString = new StringBuffer();
- char pathSeparator = File.pathSeparatorChar;
-
- if (this.bootPath != null) {
- // Add boot class path given by client
- int length = this.bootPath.length;
- for (int i = 0; i < length; i++){
- bootPathString.append(this.bootPath[i]);
- bootPathString.append(pathSeparator);
- }
- } else {
- // Add regular rt.jar
- bootPathString.append(this.vmPath);
- bootPathString.append(File.separator);
- if (!(this.vmPath.toLowerCase().endsWith("jre") || this.vmPath.toLowerCase().endsWith("jre" + File.separator))) {
- bootPathString.append("jre");
- bootPathString.append(File.separator);
- }
- bootPathString.append("lib");
- bootPathString.append(File.separator);
- bootPathString.append("rt.jar");
- bootPathString.append(pathSeparator);
- }
-
- // Add boot class path directory if needed
- if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) {
- bootPathString.append(this.evalTargetPath);
- bootPathString.append(File.separatorChar);
- bootPathString.append(BOOT_CLASSPATH_DIRECTORY);
- }
-
- return bootPathString.toString();
-}
-/**
- * Returns the name of the batch file used to launch the VM.
- */
-public String getBatchFileName() {
- return this.batchFileName;
-}
-/**
- * @see LocalVMLauncher#getCommandLine
- */
-public String[] getCommandLine() {
- Vector commandLine= new Vector();
-
- // VM binary
- if (System.getProperty("java.vm.version").startsWith("1.4.2")) {
- commandLine.addElement(
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "java");
- } else {
- String vmLocation = this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "javaw";
- final String osName = System.getProperty("os.name");
- if (osName.indexOf("win32") != -1) {
- vmLocation += ".exe";
- }
- if (!new File(vmLocation).exists()) {
- vmLocation =
- this.vmPath +
- (this.vmPath.endsWith(File.separator) ? "" : File.separator) +
- "bin" +
- File.separator +
- "java";
- }
- commandLine.addElement(vmLocation);
- }
-
- // VM arguments
- if (this.vmArguments != null) {
- for (int i = 0; i < this.vmArguments.length; i++) {
- commandLine.addElement(this.vmArguments[i]);
- }
- }
-
- String vmVersion = System.getProperty("java.vm.version");
- if (vmVersion != null && vmVersion.startsWith("1.6")) {
- commandLine.addElement("-XX:-FailOverToOldVerifier");
- commandLine.addElement("-Xverify:all");
- }
-
- // debug mode
- if (this.debugPort != -1) {
- commandLine.addElement("-Xdebug");
- commandLine.addElement("-Xnoagent");
- // commandLine.addElement("-Djava.compiler=NONE");
- commandLine.addElement(
- "-Xrunjdwp:transport=dt_socket,address=" +
- this.debugPort +
- ",server=y,suspend=n");
- }
-
- // boot classpath
- commandLine.addElement("-Xbootclasspath:" + buildBootClassPath());
-
- // regular classpath
- commandLine.addElement("-classpath");
- commandLine.addElement(buildClassPath());
-
- // code snippet runner class
- if (this.evalPort != -1) {
- commandLine.addElement(CODE_SNIPPET_RUNNER_CLASS_NAME);
- }
-
- // code snippet runner arguments
- if (this.evalPort != -1) {
- commandLine.addElement(EVALPORT_ARG);
- commandLine.addElement(Integer.toString(this.evalPort));
- if (TARGET_HAS_FILE_SYSTEM) {
- commandLine.addElement(CODESNIPPET_CLASSPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + REGULAR_CLASSPATH_DIRECTORY);
- commandLine.addElement(CODESNIPPET_BOOTPATH_ARG);
- commandLine.addElement(this.evalTargetPath + File.separator + BOOT_CLASSPATH_DIRECTORY);
- }
- }
-
- // program class
- if (this.programClass != null) {
- commandLine.addElement(this.programClass);
- }
-
- // program arguments
- if (this.programArguments != null) {
- for (int i=0;i<this.programArguments.length;i++) {
- commandLine.addElement(this.programArguments[i]);
- }
- }
-
- String[] result;
- if (this.batchFileName!= null) {
- // Write to batch file if specified
- writeBatchFile(this.batchFileName, commandLine);
- result = new String[] {this.batchFileName};
- } else {
- result = new String[commandLine.size()];
- commandLine.copyInto(result);
- }
-
- // check for spaces in result
- for (int i = 0; i < result.length; i++) {
- String argument = result[i];
- if (argument.indexOf(' ') != -1) {
- result[i] = "\"" + argument + "\"";
- }
- }
-
- return result;
-}
-/**
- * Sets the name of the batch file used to launch the VM.
- * When this option is set, the launcher writes the command line to the given batch file,
- * and it launches the batch file. This causes a DOS console to be opened. Note it
- * doesn't delete the batch file when done.
- */
-public void setBatchFileName(String batchFileName) {
- this.batchFileName = batchFileName;
-}
-protected void writeBatchFile(String fileName, Vector commandLine) {
- FileOutputStream output = null;
- try {
- output = new FileOutputStream(fileName);
- PrintWriter out= new PrintWriter(output);
- for (Enumeration e = commandLine.elements(); e.hasMoreElements();) {
- out.print((String)e.nextElement());
- out.print(" ");
- }
- out.println("pause");
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- if (output != null) {
- try {
- output.close();
- } catch (IOException e2) {
- // ignore
- }
- }
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetException.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetException.java
deleted file mode 100644
index c78bdd3..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-/**
- * A TargetException is thrown when an operation on a target has failed
- * for any reason.
- */
-public class TargetException extends Exception {
-private static final long serialVersionUID = 1L;
-/**
- * Constructs a <code>TargetException</code> with no detail message.
- */
-public TargetException() {
- super();
-}
-/**
- * Constructs a <code>TargetException</code> with the specified
- * detail message.
- *
- * @param s the detail message.
- */
-public TargetException(String s) {
- super(s);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetInterface.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetInterface.java
deleted file mode 100644
index a4208b9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetInterface.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.net.Socket;
-import java.net.UnknownHostException;
-/**
- * This is the interface to the target VM. It connects to an IDEInterface on the target side
- * using TCP/IO to send request for code snippet evaluation and to get the result back.
- *
- * @see org.eclipse.wst.jsdt.core.tests.eval.target.IDEInterface for details about the protocol.
- */
-public class TargetInterface {
- /**
- * Whether class files should be written in d:\eval\ instead of sending them to the target
- * NB: d:\eval should contain a batch file TestCodeSnippet.bat with the following contents:
- * SET JDK=c:\jdk1.2.2
- * SET EVAL=d:\eval
- * %JDK%\bin\java -Xbootclasspath:%JDK%\jre\lib\rt.jar;%EVAL%\javaClasses; -classpath c:\temp;%EVAL%\snippets;%EVAL%\classes;"d:\ide\project_resources\Eclipse Java Evaluation\CodeSnippetSupport.jar" CodeSnippetTester %1
- */
- static final boolean DEBUG = false;
- String codeSnippetClassName;
-
- /**
- * Whether timing info should be printed to stdout
- */
- static final boolean TIMING = false;
- long sentTime;
-
- /**
- * The connection to the target's ide interface.
- */
- Socket socket;
-
- public class Result {
- public char[] displayString;
- public char[] typeName;
- }
-
-/**
- * (PRIVATE API)
- * Connects this interface to the target.
- * Try as long as the given time (in ms) has not expired.
- * Use isConnected() to find out if the connection was successful.
- */
-public void connect(String targetAddress, int portNumber, int timeout) {
- if (isConnected()) {
- return;
- }
- if (portNumber > 0) {
- long startTime = System.currentTimeMillis();
- do {
- try {
- this.socket = new Socket(targetAddress, portNumber);
- this.socket.setTcpNoDelay(true);
- break;
- } catch (UnknownHostException e) {
- } catch (IOException e) {
- }
- if (this.socket == null) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- }
- } while (!isConnected() && (System.currentTimeMillis() - startTime) < timeout);
- }
-}
-/**
- * (PRIVATE API)
- * Disconnects this interface from the target.
- */
-public void disconnect() {
- if (this.socket != null) {
- try {
- this.socket.close();
- } catch (IOException e) {
- // Already closed. Nothing more to do
- }
- this.socket = null;
- }
-}
-/**
- * Returns the result of the evaluation sent previously to the target.
- */
-public Result getResult() {
- boolean hasValue = false;
- String typeName = null;
- String toString = null;
- if (DEBUG) {
- hasValue = true;
- typeName = "TargetInterface in debug mode. Run d:\\eval\\TestCodeSnippet.bat d:\\eval\\snippets\\" + codeSnippetClassName;
- toString = "";
- } else {
- if (this.isConnected()) {
- // TBD: Read type name and toString as a character array
- try {
- DataInputStream in = new DataInputStream(this.socket.getInputStream());
- hasValue = in.readBoolean();
- if (hasValue) {
- typeName = in.readUTF();
- toString = in.readUTF();
- } else {
- typeName = null;
- toString = null;
- }
- } catch (IOException e) {
- // The socket has likely been closed on the other end. So the code snippet runner has stopped.
- hasValue = true;
- typeName = e.getMessage();
- toString = "";
- this.disconnect();
- }
- } else {
- hasValue = true;
- typeName = "Connection has been lost";
- toString = "";
- }
- }
- if (TIMING) {
- System.out.println("Time to send compiled classes, run on target and get result is " + (System.currentTimeMillis() - this.sentTime) + "ms");
- }
- Result result = new Result();
- result.displayString = toString == null ? null : toString.toCharArray();
- result.typeName = typeName == null ? null : typeName.toCharArray();
- return result;
-}
-/**
- * Returns whether this interface is connected to the target.
- */
-boolean isConnected() {
- return this.socket != null;
-}
-/**
- * Sends the given class definitions to the target for loading and (if specified) for running.
- */
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/VMInputStream.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/VMInputStream.java
deleted file mode 100644
index b86ea20..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/VMInputStream.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.runtime;
-
-import java.io.*;
-
-/**
- * Workaround problem with input stream from a <code>java.lang.Process</code>
- * that throws an <code>IOException</code> even if there is something to read.
- */
-public class VMInputStream extends InputStream {
- InputStream input;
- Process process;
-public VMInputStream(Process process, InputStream input) {
- this.process= process;
- this.input= input;
-}
-public int available() throws IOException {
- return this.input.available();
-}
-public void close() throws IOException {
- this.input.close();
-}
-private boolean isRunning() {
- if (this.process == null) {
- return false;
- }
- boolean hasExited;
- try {
- this.process.exitValue();
- hasExited = true;
- } catch (IllegalThreadStateException e) {
- hasExited = false;
- }
- return !hasExited;
-}
-public synchronized void mark(int readlimit) {
- this.input.mark(readlimit);
-}
-public boolean markSupported() {
- return this.input.markSupported();
-}
-public int read() throws IOException {
- try {
- return this.input.read();
- } catch (IOException e) {
- if (isRunning()) {
- return read();
- }
- throw e;
- }
-}
-public int read(byte b[]) throws IOException {
- // Make sure the byte array is initialized (value of 0 is used in the workaround below)
- for (int i=0;i<b.length;i++)
- b[i]=0;
-
- int read;
- try {
- read = this.input.read(b);
- } catch (IOException e) {
- if (isRunning()) {
- // Workaround problem with implementation of Process.getInputStream()
- // (see PR 1PRW670: LFRE:WINNT - Program hangs running in LeapFrog)
- read= 0;
- while (read < b.length && b[read] != 0) {
- read++;
- }
- } else
- throw e;
- }
-
- return read;
-}
-public int read(byte b[], int off, int len) throws IOException {
- // Make sure the byte array is initialized (value of 0 is used in the workaround below)
- for (int i = off; i < len; i++)
- b[i] = 0;
-
- int read;
- try {
- read = this.input.read(b, off, len);
- } catch (IOException e) {
- if (isRunning()) {
- // Workaround problem with implementation of Process.getInputStream()
- // (see PR 1PRW670: LFRE:WINNT - Program hangs running in LeapFrog)
- read = 0;
- while (off + read < len && b[off + read] != 0) {
- read++;
- }
- } else
- throw e;
- }
- return read;
-}
-public synchronized void reset() throws IOException {
- this.input.reset();
-}
-public long skip(long n) throws IOException {
- return this.input.skip(n);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/AbstractCompilerTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/AbstractCompilerTest.java
deleted file mode 100644
index e9a0378..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/AbstractCompilerTest.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.util;
-
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.RegressionTestSetup;
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class AbstractCompilerTest extends TestCase {
-
- public static final String COMPLIANCE_1_3 = CompilerOptions.VERSION_1_3;
- public static final String COMPLIANCE_1_4 = CompilerOptions.VERSION_1_4;
- public static final String COMPLIANCE_1_5 = CompilerOptions.VERSION_1_5;
- public static final String COMPLIANCE_1_6 = CompilerOptions.VERSION_1_6;
- public static final String COMPLIANCE_1_7 = CompilerOptions.VERSION_1_7;
-
- public static final int F_1_3 = 0x01;
- public static final int F_1_4 = 0x02;
- public static final int F_1_5 = 0x04;
- public static final int F_1_6 = 0x08;
- public static final int F_1_7 = 0x10;
-
- protected static boolean RUN_JAVAC = CompilerOptions.ENABLED.equals(System.getProperty("run.javac"));
- private static int possibleComplianceLevels =
- RUN_JAVAC ? F_1_5 : -1;
- // javac tests imply 1.5 compliance
-
- protected String complianceLevel;
-
- /**
- * Build a test suite made of test suites for all possible running VM compliances .
- *
- * @see #buildUniqueComplianceTestSuite(Class, String) for test suite children content.
- *
- * @param evaluationTestClass The main test suite to build.
- * @return built test suite (see {@link TestSuite}
- */
- public static Test buildAllCompliancesTestSuite(Class evaluationTestClass) {
- TestSuite suite = new TestSuite(evaluationTestClass.getName());
- int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((complianceLevels & AbstractCompilerTest.F_1_3) != 0) {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_3));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_4));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_5));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_6) != 0) {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_6));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_7) != 0) {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_7));
- }
- return suite;
- }
-
- /**
- * Build a test suite made of test suites for all possible running VM compliances .
- *
- * @see #buildComplianceTestSuite(List, Class, String) for test suite children content.
- *
- * @param testSuiteClass The main test suite to build.
- * @param setupClass The compiler setup to class to use to bundle given tets suites tests.
- * @param testClasses The list of test suites to include in main test suite.
- * @return built test suite (see {@link TestSuite}
- */
- public static Test buildAllCompliancesTestSuite(Class testSuiteClass, Class setupClass, List testClasses) {
- TestSuite suite = new TestSuite(testSuiteClass.getName());
- int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((complianceLevels & AbstractCompilerTest.F_1_3) != 0) {
- suite.addTest(buildComplianceTestSuite(testClasses, setupClass, COMPLIANCE_1_3));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- suite.addTest(buildComplianceTestSuite(testClasses, setupClass, COMPLIANCE_1_4));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- suite.addTest(buildComplianceTestSuite(testClasses, setupClass, COMPLIANCE_1_5));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_6) != 0) {
- suite.addTest(buildComplianceTestSuite(testClasses, setupClass, COMPLIANCE_1_6));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_7) != 0) {
- suite.addTest(buildComplianceTestSuite(testClasses, setupClass, COMPLIANCE_1_7));
- }
- return suite;
- }
-
- /**
- * Build a test suite for a compliance and a list of test suites.
- * Returned test suite has only one child: {@link RegressionTestSetup} test suite.
- * Name of returned suite is the given compliance level.
- *
- * @see #buildComplianceTestSuite(List, Class, String) for child test suite content.
- *
- * @param complianceLevel The compliance level used for this test suite.
- * @param testClasses The list of test suites to include in main test suite.
- * @return built test suite (see {@link TestSuite}
- */
- public static Test buildComplianceTestSuite(String complianceLevel, List testClasses) {
- return buildComplianceTestSuite(testClasses, RegressionTestSetup.class, complianceLevel);
- }
-
- /**
- * Build a test suite for a compliance and a list of test suites.
- * Children of returned test suite are setup test suites (see {@link CompilerTestSetup}).
- * Name of returned suite is the given compliance level.
- *
- * @param complianceLevel The compliance level used for this test suite.
- * @param testClasses The list of test suites to include in main test suite.
- * @return built test suite (see {@link TestSuite}
- */
- private static Test buildComplianceTestSuite(List testClasses, Class setupClass, String complianceLevel) {
- TestSuite complianceSuite = new TestSuite(complianceLevel);
- for (int i=0, m=testClasses.size(); i<m ; i++) {
- Class testClass = (Class)testClasses.get(i);
- TestSuite suite = new TestSuite(testClass.getName());
- List tests = buildTestsList(testClass);
- for (int index=0, size=tests.size(); index<size; index++) {
- suite.addTest((Test)tests.get(index));
- }
- complianceSuite.addTest(suite);
- }
-
- // call the setup constructor with the suite and compliance level
- try {
- Constructor constructor = setupClass.getConstructor(new Class[]{Test.class, String.class});
- Test setUp = (Test)constructor.newInstance(new Object[]{complianceSuite, complianceLevel});
- return setUp;
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
-
- return null;
- }
-
- /**
- * Build a regression test setup suite for a minimal compliance and a test suite to run.
- * Returned test suite has only one child: {@link RegressionTestSetup} test suite.
- * Name of returned suite is the name of given test suite class.
- * The test suite will be run iff the compliance is at least the specified one.
- *
- * @param minimalCompliance The unqie compliance level used for this test suite.
- * @param evaluationTestClass The test suite to run.
- * @return built test suite (see {@link TestSuite}
- */
- public static Test buildMinimalComplianceTestSuite(Class evaluationTestClass, int minimalCompliance) {
- TestSuite suite = new TestSuite(evaluationTestClass.getName());
- int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- int level13 = complianceLevels & AbstractCompilerTest.F_1_3;
- if (level13 != 0) {
- if (level13 < minimalCompliance) {
- System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+COMPLIANCE_1_3+"!");
- } else {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_3));
- }
- }
- int level14 = complianceLevels & AbstractCompilerTest.F_1_4;
- if (level14 != 0) {
- if (level14 < minimalCompliance) {
- System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+COMPLIANCE_1_4+"!");
- } else {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_4));
- }
- }
- int level15 = complianceLevels & AbstractCompilerTest.F_1_5;
- if (level15 != 0) {
- if (level15 < minimalCompliance) {
- System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+COMPLIANCE_1_5+"!");
- } else {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_5));
- }
- }
- int level16 = complianceLevels & AbstractCompilerTest.F_1_6;
- if (level16 != 0) {
- if (level16 < minimalCompliance) {
- System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+COMPLIANCE_1_6+"!");
- } else {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_6));
- }
- }
- int level17 = complianceLevels & AbstractCompilerTest.F_1_7;
- if (level17 != 0) {
- if (level17 < minimalCompliance) {
- System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+COMPLIANCE_1_7+"!");
- } else {
- suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, AbstractCompilerTest.COMPLIANCE_1_7));
- }
- }
- return suite;
- }
-
- /**
- * Build a regression test setup suite for a compliance and a test suite to run.
- * Returned test suite has only one child: {@link RegressionTestSetup} test suite.
- * Name of returned suite is the name of given test suite class.
- *
- * @param uniqueCompliance The unqie compliance level used for this test suite.
- * @param evaluationTestClass The test suite to run.
- * @return built test suite (see {@link TestSuite}
- */
- public static Test buildUniqueComplianceTestSuite(Class evaluationTestClass, String uniqueCompliance) {
- String highestLevel = highestComplianceLevels();
- if (highestLevel.compareTo(uniqueCompliance) < 0) {
- System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+highestLevel+"!");
- return new TestSuite();
- }
- TestSuite complianceSuite = new TestSuite(uniqueCompliance);
- List tests = buildTestsList(evaluationTestClass);
- for (int index=0, size=tests.size(); index<size; index++) {
- complianceSuite.addTest((Test)tests.get(index));
- }
- TestSuite suite = new TestSuite(evaluationTestClass.getName());
- suite.addTest(new RegressionTestSetup(complianceSuite, uniqueCompliance));
- return suite;
- }
-
- /*
- * Returns the highest compliance level this VM instance can run.
- */
- public static String highestComplianceLevels() {
- int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((complianceLevels & AbstractCompilerTest.F_1_7) != 0) {
- return COMPLIANCE_1_7;
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_6) != 0) {
- return COMPLIANCE_1_6;
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- return COMPLIANCE_1_5;
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- return COMPLIANCE_1_4;
- }
- return COMPLIANCE_1_3;
- }
-
- /*
- * Returns the possible compliance levels this VM instance can run.
- */
- public static int getPossibleComplianceLevels() {
- if (possibleComplianceLevels == -1) {
- String compliance = System.getProperty("compliance");
- if (compliance != null) {
- if (COMPLIANCE_1_3.equals(compliance)) {
- possibleComplianceLevels = F_1_3;
- } else if (COMPLIANCE_1_4.equals(compliance)) {
- possibleComplianceLevels = F_1_4;
- } else if (COMPLIANCE_1_5.equals(compliance)) {
- possibleComplianceLevels = F_1_5;
- } else if (COMPLIANCE_1_6.equals(compliance)) {
- possibleComplianceLevels = F_1_6;
- } else if (COMPLIANCE_1_7.equals(compliance)) {
- possibleComplianceLevels = F_1_7;
- } else {
- System.out.println("Invalid compliance specified (" + compliance + ")");
- System.out.print("Use one of ");
- System.out.print(COMPLIANCE_1_3 + ", ");
- System.out.print(COMPLIANCE_1_4 + ", ");
- System.out.print(COMPLIANCE_1_5 + ", ");
- System.out.print(COMPLIANCE_1_6 + ", ");
- System.out.println(COMPLIANCE_1_7);
- System.out.println("Defaulting to all possible compliances");
- }
- }
- if (possibleComplianceLevels == -1) {
- possibleComplianceLevels = F_1_3;
- String specVersion = System.getProperty("java.specification.version");
- boolean canRun1_4 = !"1.0".equals(specVersion)
- && !CompilerOptions.VERSION_1_1.equals(specVersion)
- && !CompilerOptions.VERSION_1_2.equals(specVersion)
- && !CompilerOptions.VERSION_1_3.equals(specVersion);
- if (canRun1_4) {
- possibleComplianceLevels |= F_1_4;
- }
- boolean canRun1_5 = canRun1_4 && !CompilerOptions.VERSION_1_4.equals(specVersion);
- if (canRun1_5) {
- possibleComplianceLevels |= F_1_5;
- }
- boolean canRun1_6 = canRun1_5 && !CompilerOptions.VERSION_1_5.equals(specVersion);
- if (canRun1_6) {
- possibleComplianceLevels |= F_1_6;
- }
- boolean canRun1_7 = canRun1_6 && !CompilerOptions.VERSION_1_6.equals(specVersion);
- if (canRun1_7) {
- possibleComplianceLevels |= F_1_7;
- }
- }
- }
- return possibleComplianceLevels;
- }
-
- /*
- * Returns a test suite including the tests defined by the given classes for all possible complianceLevels
- * and using the given setup class (CompilerTestSetup or a subclass)
- */
- public static Test suite(String suiteName, Class setupClass, ArrayList testClasses) {
- TestSuite all = new TestSuite(suiteName);
- int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
- if ((complianceLevels & AbstractCompilerTest.F_1_3) != 0) {
- all.addTest(suiteForComplianceLevel(COMPLIANCE_1_3, setupClass, testClasses));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_4) != 0) {
- all.addTest(suiteForComplianceLevel(COMPLIANCE_1_4, setupClass, testClasses));
- }
- if ((complianceLevels & AbstractCompilerTest.F_1_5) != 0) {
- all.addTest(suiteForComplianceLevel(COMPLIANCE_1_5, setupClass, testClasses));
- }
- return all;
- }
-
- /*
- * Returns a test suite including the tests defined by the given classes for the given complianceLevel
- * (see AbstractCompilerTest for valid values) and using the given setup class (CompilerTestSetup or a subclass)
- */
- public static Test suiteForComplianceLevel(String complianceLevel, Class setupClass, ArrayList testClasses) {
- TestSuite suite;
- Class testClass;
- if (testClasses.size() == 1) {
- suite = new TestSuite(testClass = (Class)testClasses.get(0), complianceLevel);
- TESTS_COUNTERS.put(testClass.getName(), new Integer(suite.countTestCases()));
- } else {
- suite = new TestSuite(complianceLevel);
- for (int i = 0, length = testClasses.size(); i < length; i++) {
- TestSuite innerSuite = new TestSuite(testClass = (Class)testClasses.get(i));
- TESTS_COUNTERS.put(testClass.getName(), new Integer(innerSuite.countTestCases()));
- suite.addTest(innerSuite);
- }
- }
-
- // call the setup constructor with the suite and compliance level
- try {
- Constructor constructor = setupClass.getConstructor(new Class[]{Test.class, String.class});
- Test setUp = (Test)constructor.newInstance(new Object[]{suite, complianceLevel});
- return setUp;
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
-
- return null;
- }
-
- public static Test setupSuite(Class clazz) {
- ArrayList testClasses = new ArrayList();
- testClasses.add(clazz);
- return suite(clazz.getName(), RegressionTestSetup.class, testClasses);
- }
-
- public static Test buildTestSuite(Class evaluationTestClass) {
- if (TESTS_PREFIX != null || TESTS_NAMES != null || TESTS_NUMBERS!=null || TESTS_RANGE !=null) {
- return buildTestSuite(evaluationTestClass, highestComplianceLevels());
- }
- return setupSuite(evaluationTestClass);
- }
-
- public static Test buildTestSuite(Class evaluationTestClass, String complianceLevel) {
- TestSuite suite = new TestSuite(complianceLevel);
- List tests = buildTestsList(evaluationTestClass);
- for (int index=0, size=tests.size(); index<size; index++) {
- suite.addTest((Test)tests.get(index));
- }
- TestSuite test = new TestSuite(evaluationTestClass.getName());
- test.addTest(new RegressionTestSetup(suite, complianceLevel));
- String className = evaluationTestClass.getName();
- Integer testsNb;
- int newTestsNb = test.countTestCases();
- if ((testsNb = (Integer) TESTS_COUNTERS.get(className)) != null)
- newTestsNb += testsNb.intValue();
- TESTS_COUNTERS.put(className, new Integer(newTestsNb));
- return test;
- }
-
-
- public static boolean isJRELevel(int compliance) {
- return (AbstractCompilerTest.getPossibleComplianceLevels() & compliance) != 0;
- }
-
- public AbstractCompilerTest(String name) {
- super(name);
- }
-
- protected Map getCompilerOptions() {
- Map options = new CompilerOptions().getMap();
- options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
- if (COMPLIANCE_1_3.equals(this.complianceLevel)) {
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_3);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
- } else if (COMPLIANCE_1_4.equals(this.complianceLevel)) {
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
- } else if (COMPLIANCE_1_5.equals(this.complianceLevel)) {
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- } else if (COMPLIANCE_1_6.equals(this.complianceLevel)) {
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
- } else if (COMPLIANCE_1_7.equals(this.complianceLevel)) {
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
- }
- return options;
- }
-
- public String getName() {
- String name = super.getName();
- if (this.complianceLevel != null) {
- name = name + " - " + this.complianceLevel;
- }
- return name;
- }
-
- public void initialize(CompilerTestSetup setUp) {
- this.complianceLevel = setUp.complianceLevel;
- }
-
- protected String testName() {
- return super.getName();
- }
-
- // Output files management
- protected IPath outputRootDirectoryPath = new Path(Util.getOutputDirectory());
- protected File outputTestDirectory;
-
- /**
- * Create a test specific output directory as a subdirectory of
- * outputRootDirectory, given a subdirectory path. The whole
- * subtree is created as needed. outputTestDirectoryPath is
- * modified according to the latest call to this method.
- * @param suffixPath a valid relative path for the subdirectory
- */
- protected void createOutputTestDirectory(String suffixPath) {
- this.outputTestDirectory = new File(this.outputRootDirectoryPath.toFile(), suffixPath);
- if (!this.outputTestDirectory.exists()) {
- this.outputTestDirectory.mkdirs();
- }
- }
- /*
- * Write given source test files in current output sub-directory.
- * Use test name for this sub-directory name (ie. test001, test002, etc...)
- */
- protected void writeFiles(String[] testFiles) {
- createOutputTestDirectory(testName());
-
- // Write each given test file
- for (int i = 0, length = testFiles.length; i < length; ) {
- String fileName = testFiles[i++];
- String contents = testFiles[i++];
- File file = new File(this.outputTestDirectory, fileName);
- if (fileName.lastIndexOf('/') >= 0) {
- File dir = file.getParentFile();
- if (!dir.exists()) {
- dir.mkdirs();
- }
- }
- Util.writeToFile(contents, file.getPath());
- }
- }
-
- // Summary display
- // Used by AbstractRegressionTest for javac comparison tests
- protected static Map TESTS_COUNTERS = new HashMap();
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/CompilerTestSetup.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/CompilerTestSetup.java
deleted file mode 100644
index 7cd3971..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/CompilerTestSetup.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.util;
-
-import java.util.Enumeration;
-
-import junit.extensions.TestDecorator;
-import junit.framework.Test;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-public class CompilerTestSetup extends TestDecorator {
-
- String complianceLevel;
-
- public CompilerTestSetup(Test test, String complianceLevel) {
- super(test);
- this.complianceLevel = complianceLevel;
- }
-
- protected void initTest(Object test) {
- if (test instanceof AbstractCompilerTest) {
- AbstractCompilerTest compilerTest = (AbstractCompilerTest)test;
- compilerTest.initialize(this);
- return;
- }
- if (test instanceof TestSuite) {
- TestSuite testSuite = (TestSuite)test;
- Enumeration evaluationTestClassTests = testSuite.tests();
- while (evaluationTestClassTests.hasMoreElements()) {
- initTest(evaluationTestClassTests.nextElement());
- }
- return;
- }
- }
-
- public void run(TestResult result) {
- try {
- setUp();
- super.run(result);
- } finally {
- tearDown();
- }
- }
-
- protected void setUp() {
- // Init wrapped suite
- initTest(fTest);
- }
-
- protected void tearDown() {
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/TestVerifier.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/TestVerifier.java
deleted file mode 100644
index 86decab..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/TestVerifier.java
+++ /dev/null
@@ -1,618 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.util;
-
-import org.eclipse.wst.jsdt.core.tests.runtime.*;
-import java.io.*;
-import java.net.*;
-/**
- * Verifies that the .class files resulting from a compilation can be loaded
- * in a VM and that they can be run.
- */
-public class TestVerifier {
- public String failureReason;
-
- boolean reuseVM = true;
- String[] classpathCache;
- LocalVirtualMachine vm;
- StringBuffer outputBuffer;
- StringBuffer errorBuffer;
- Socket socket;
-public TestVerifier(boolean reuseVM) {
- this.reuseVM = reuseVM;
-}
-private boolean checkBuffers(String errorString, String outputString, String sourceFileName, String expectedSuccessOutputString) {
-
- if (errorString.trim().length() > 0) {
- this.failureReason =
- "Unexpected target error running resulting class file for "
- + sourceFileName
- + ":\n"
- + errorString;
- return false;
- }
- String platformIndependantOutputString = Util.convertToIndependantLineDelimiter(outputString.trim());
- if (expectedSuccessOutputString != null && !Util.convertToIndependantLineDelimiter(expectedSuccessOutputString).equals(platformIndependantOutputString)) {
- System.out.println(Util.displayString(platformIndependantOutputString, 2));
- this.failureReason =
- "Unexpected output running resulting class file for "
- + sourceFileName
- + ":\n"
- + "--[START]--\n"
- + outputString
- + "---[END]---\n";
- return false;
- }
-
- return true;
-}
-
-private boolean checkBuffersThrowingError(String errorString, String sourceFileName, String expectedSuccessOutputString) {
-
- if (errorString.length() > 0 && errorString.indexOf(expectedSuccessOutputString) != -1) {
- return true;
- }
-
- this.failureReason =
- "Expected error not thrown for "
- + sourceFileName
- + ":\n"
- + expectedSuccessOutputString;
- return false;
-}
-
-private void compileVerifyTests(String verifierDir) {
- String fullyQualifiedName = VerifyTests.class.getName();
-
- int lastDot = fullyQualifiedName.lastIndexOf('.');
- String packageName = fullyQualifiedName.substring(0, lastDot);
- String simpleName = fullyQualifiedName.substring(lastDot + 1);
-
- String dirName = verifierDir.replace('\\', '/') + "/" + packageName.replace('.', '/');
- File dir = new File(dirName.replace('/', File.separatorChar));
- if (!dir.exists() && !dir.mkdirs()) {
- System.out.println("Could not create " + dir);
- return;
- }
- String fileName = dir + File.separator + simpleName + ".java";
- Util.writeToFile(this.getVerifyTestsCode(), fileName);
- org.eclipse.wst.jsdt.internal.compiler.batch.Main.compile("\"" + fileName + "\" -d \"" + verifierDir + "\" -classpath \"" + Util.getJavaClassLibsAsString() + "\"");
-}
-public void execute(String className, String[] classpaths) {
- this.outputBuffer = new StringBuffer();
- this.errorBuffer = new StringBuffer();
-
- launchAndRun(className, classpaths, null, null);
-}
-protected void finalize() throws Throwable {
- this.shutDown();
-}
-public String getExecutionOutput(){
- return outputBuffer.toString();
-}
-
-public String getExecutionError(){
- return errorBuffer.toString();
-}
-/**
- * Returns the code of the VerifyTests class.
- *
- * IMPORTANT NOTE: DO NOTE EDIT BUT GENERATE INSTEAD (see below)
- *
- * To generate:
- * - export VerifyTests.java to d:/temp
- * - inspect org.eclipse.wst.jsdt.core.tests.util.Util.fileContentToDisplayString("d:/temp/VerifyTests.java", 2, true)
- */
-private String getVerifyTestsCode() {
- return
- "/*******************************************************************************" +
- " * Copyright (c) 2000, 2005 IBM Corporation and others." +
- " * All rights reserved. This program and the accompanying materials" +
- " * are made available under the terms of the Eclipse Public License v1.0" +
- " * which accompanies this distribution, and is available at" +
- " * http://www.eclipse.org/legal/epl-v10.html" +
- " *" +
- " * Contributors:" +
- " * IBM Corporation - initial API and implementation" +
- " *******************************************************************************/" +
- "package org.eclipse.wst.jsdt.core.tests.util;\n" +
- "\n" +
- "import java.lang.reflect.*;\n" +
- "import java.io.*;\n" +
- "import java.net.*;\n" +
- "import java.util.*;\n" +
- "\n" +
- "/******************************************************\n" +
- " * \n" +
- " * IMPORTANT NOTE: If modifying this class, copy the source to TestVerifier#getVerifyTestsCode()\n" +
- " * (see this method for details)\n" +
- " * \n" +
- " ******************************************************/\n" +
- "\n" +
- "public class VerifyTests {\n" +
- " int portNumber;\n" +
- " Socket socket;\n" +
- "\n" +
- "/**\n" +
- " * NOTE: Code copied from junit.util.TestCaseClassLoader.\n" +
- " *\n" +
- " * A custom class loader which enables the reloading\n" +
- " * of classes for each test run. The class loader\n" +
- " * can be configured with a list of package paths that\n" +
- " * should be excluded from loading. The loading\n" +
- " * of these packages is delegated to the system class\n" +
- " * loader. They will be shared across test runs.\n" +
- " * <p>\n" +
- " * The list of excluded package paths is specified in\n" +
- " * a properties file \"excluded.properties\" that is located in \n" +
- " * the same place as the TestCaseClassLoader class.\n" +
- " * <p>\n" +
- " * <b>Known limitation:</b> the VerifyClassLoader cannot load classes\n" +
- " * from jar files.\n" +
- " */\n" +
- "\n" +
- "\n" +
- "public class VerifyClassLoader extends ClassLoader {\n" +
- " /** scanned class path */\n" +
- " private String[] fPathItems;\n" +
- " \n" +
- " /** excluded paths */\n" +
- " private String[] fExcluded= {};\n" +
- "\n" +
- " /**\n" +
- " * Constructs a VerifyClassLoader. It scans the class path\n" +
- " * and the excluded package paths\n" +
- " */\n" +
- " public VerifyClassLoader() {\n" +
- " super();\n" +
- " String classPath= System.getProperty(\"java.class.path\");\n" +
- " String separator= System.getProperty(\"path.separator\");\n" +
- " \n" +
- " // first pass: count elements\n" +
- " StringTokenizer st= new StringTokenizer(classPath, separator);\n" +
- " int i= 0;\n" +
- " while (st.hasMoreTokens()) {\n" +
- " st.nextToken();\n" +
- " i++;\n" +
- " }\n" +
- " // second pass: split\n" +
- " fPathItems= new String[i];\n" +
- " st= new StringTokenizer(classPath, separator);\n" +
- " i= 0;\n" +
- " while (st.hasMoreTokens()) {\n" +
- " fPathItems[i++]= st.nextToken();\n" +
- " }\n" +
- "\n" +
- " }\n" +
- " public java.net.URL getResource(String name) {\n" +
- " return ClassLoader.getSystemResource(name);\n" +
- " }\n" +
- " public InputStream getResourceAsStream(String name) {\n" +
- " return ClassLoader.getSystemResourceAsStream(name);\n" +
- " }\n" +
- " protected boolean isExcluded(String name) {\n" +
- " // exclude the \"java\" packages.\n" +
- " // They always need to be excluded so that they are loaded by the system class loader\n" +
- " if (name.startsWith(\"java\"))\n" +
- " return true;\n" +
- " \n" +
- " // exclude the user defined package paths\n" +
- " for (int i= 0; i < fExcluded.length; i++) {\n" +
- " if (name.startsWith(fExcluded[i])) {\n" +
- " return true;\n" +
- " }\n" +
- " }\n" +
- " return false; \n" +
- " }\n" +
- " public synchronized Class loadClass(String name, boolean resolve)\n" +
- " throws ClassNotFoundException {\n" +
- " \n" +
- " Class c= findLoadedClass(name);\n" +
- " if (c != null)\n" +
- " return c;\n" +
- " //\n" +
- " // Delegate the loading of excluded classes to the\n" +
- " // standard class loader.\n" +
- " //\n" +
- " if (isExcluded(name)) {\n" +
- " try {\n" +
- " c= findSystemClass(name);\n" +
- " return c;\n" +
- " } catch (ClassNotFoundException e) {\n" +
- " // keep searching\n" +
- " }\n" +
- " }\n" +
- " File file= locate(name);\n" +
- " if (file == null)\n" +
- " throw new ClassNotFoundException();\n" +
- " byte data[]= loadClassData(file);\n" +
- " c= defineClass(name, data, 0, data.length);\n" +
- " if (resolve) \n" +
- " resolveClass(c);\n" +
- " return c;\n" +
- " }\n" +
- " private byte[] loadClassData(File f) throws ClassNotFoundException {\n" +
- " try {\n" +
- " //System.out.println(\"loading: \"+f.getPath());\n" +
- " FileInputStream stream= new FileInputStream(f);\n" +
- " \n" +
- " try {\n" +
- " byte[] b= new byte[stream.available()];\n" +
- " stream.read(b);\n" +
- " stream.close();\n" +
- " return b;\n" +
- " }\n" +
- " catch (IOException e) {\n" +
- " throw new ClassNotFoundException();\n" +
- " }\n" +
- " }\n" +
- " catch (FileNotFoundException e) {\n" +
- " throw new ClassNotFoundException();\n" +
- " }\n" +
- " }\n" +
- " /**\n" +
- " * Locate the given file.\n" +
- " * @return Returns null if file couldn\'t be found.\n" +
- " */\n" +
- " private File locate(String fileName) { \n" +
- " fileName= fileName.replace(\'.\', \'/\')+\".class\";\n" +
- " File path= null;\n" +
- " \n" +
- " if (fileName != null) {\n" +
- " for (int i= 0; i < fPathItems.length; i++) {\n" +
- " path= new File(fPathItems[i], fileName);\n" +
- " if (path.exists())\n" +
- " return path;\n" +
- " }\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- " \n" +
- "public void loadAndRun(String className) throws Throwable {\n" +
- " //System.out.println(\"Loading \" + className + \"...\");\n" +
- " Class testClass = new VerifyClassLoader().loadClass(className);\n" +
- " //System.out.println(\"Loaded \" + className);\n" +
- " try {\n" +
- " Method main = testClass.getMethod(\"main\", new Class[] {String[].class});\n" +
- " //System.out.println(\"Running \" + className);\n" +
- " main.invoke(null, new Object[] {new String[] {}});\n" +
- " //System.out.println(\"Finished running \" + className);\n" +
- " } catch (NoSuchMethodException e) {\n" +
- " return;\n" +
- " } catch (InvocationTargetException e) {\n" +
- " throw e.getTargetException();\n" +
- " }\n" +
- "}\n" +
- "public static void main(String[] args) throws IOException {\n" +
- " VerifyTests verify = new VerifyTests();\n" +
- " verify.portNumber = Integer.parseInt(args[0]);\n" +
- " verify.run();\n" +
- "}\n" +
- "public void run() throws IOException {\n" +
- " ServerSocket server = new ServerSocket(this.portNumber);\n" +
- " this.socket = server.accept();\n" +
- " this.socket.setTcpNoDelay(true);\n" +
- " server.close();\n" +
- "\n" +
- " DataInputStream in = new DataInputStream(this.socket.getInputStream());\n" +
- " final DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());\n" +
- " while (true) {\n" +
- " final String className = in.readUTF();\n" +
- " Thread thread = new Thread() {\n" +
- " public void run() {\n" +
- " try {\n" +
- " loadAndRun(className);\n" +
- " out.writeBoolean(true);\n" +
- " System.err.println(VerifyTests.class.getName());\n" +
- " System.out.println(VerifyTests.class.getName());\n" +
- " } catch (Throwable e) {\n" +
- " e.printStackTrace();\n" +
- " try {\n" +
- " System.err.println(VerifyTests.class.getName());\n" +
- " System.out.println(VerifyTests.class.getName());\n" +
- " out.writeBoolean(false);\n" +
- " } catch (IOException e1) {\n" +
- " // ignore\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " thread.start();\n" +
- " }\n" +
- "}\n" +
- "}\n";
-}
-private void launchAndRun(String className, String[] classpaths, String[] programArguments, String[] vmArguments) {
- // we won't reuse the vm, shut the existing one if running
- if (this.vm != null) {
- try {
- vm.shutDown();
- } catch (TargetException e) {
- }
- }
- this.classpathCache = null;
-
- // launch a new one
- LocalVMLauncher launcher = LocalVMLauncher.getLauncher();
- launcher.setClassPath(classpaths);
- launcher.setVMPath(Util.getJREDirectory());
- if (vmArguments != null) {
- String[] completeVmArguments = new String[vmArguments.length + 1];
- System.arraycopy(vmArguments, 0, completeVmArguments, 1, vmArguments.length);
- completeVmArguments[0] = "-verify";
- launcher.setVMArguments(completeVmArguments);
- } else {
- launcher.setVMArguments(new String[] {"-verify"});
- }
- launcher.setProgramClass(className);
- launcher.setProgramArguments(programArguments);
- Thread outputThread;
- Thread errorThread;
- try {
- this.vm = launcher.launch();
- final InputStream input = this.vm.getInputStream();
- outputThread = new Thread(new Runnable() {
- public void run() {
- try {
- int c = input.read();
- while (c != -1) {
- outputBuffer.append((char) c);
- c = input.read();
- }
- } catch(IOException ioEx) {
- }
- }
- });
- final InputStream errorStream = this.vm.getErrorStream();
- errorThread = new Thread(new Runnable() {
- public void run() {
- try {
- int c = errorStream.read();
- while (c != -1) {
- errorBuffer.append((char) c);
- c = errorStream.read();
- }
- } catch(IOException ioEx) {
- }
- }
- });
- outputThread.start();
- errorThread.start();
- } catch(TargetException e) {
- throw new Error(e.getMessage());
- }
-
- // wait for vm to shut down by itself
- try {
- outputThread.join(5000);
- errorThread.join(5000);
- } catch (InterruptedException e) {
- }
-}
-private void launchVerifyTestsIfNeeded(String[] classpaths, String[] vmArguments) {
- // determine if we can reuse the vm
- if (this.vm != null && this.vm.isRunning() && this.classpathCache != null) {
- if (classpaths.length == classpathCache.length) {
- boolean sameClasspaths = true;
- for (int i = 0; i < classpaths.length; i++) {
- if (!this.classpathCache[i].equals(classpaths[i])) {
- sameClasspaths = false;
- break;
- }
- }
- if (sameClasspaths) {
- return;
- }
- }
- }
-
- // we could not reuse the vm, shut the existing one if running
- if (this.vm != null) {
- try {
- vm.shutDown();
- } catch (TargetException e) {
- }
- }
-
- this.classpathCache = classpaths;
-
- // launch a new one
- LocalVMLauncher launcher = LocalVMLauncher.getLauncher();
- int length = classpaths.length;
- String[] cp = new String[length + 1];
- System.arraycopy(classpaths, 0, cp, 0, length);
- String verifierDir = Util.getOutputDirectory() + File.separator + "verifier";
- this.compileVerifyTests(verifierDir);
- cp[length] = verifierDir;
- launcher.setClassPath(cp);
- launcher.setVMPath(Util.getJREDirectory());
- if (vmArguments != null) {
- String[] completeVmArguments = new String[vmArguments.length + 1];
- System.arraycopy(vmArguments, 0, completeVmArguments, 1, vmArguments.length);
- completeVmArguments[0] = "-verify";
- launcher.setVMArguments(completeVmArguments);
- } else {
- launcher.setVMArguments(new String[] {"-verify"});
- }
- launcher.setProgramClass(VerifyTests.class.getName());
- int portNumber = Util.getFreePort();
- launcher.setProgramArguments(new String[] {Integer.toString(portNumber)});
- try {
- this.vm = launcher.launch();
- final InputStream input = this.vm.getInputStream();
- Thread outputThread = new Thread(new Runnable() {
- public void run() {
- try {
- int c = input.read();
- while (c != -1) {
- outputBuffer.append((char) c);
- c = input.read();
- }
- } catch(IOException ioEx) {
- }
- }
- });
- final InputStream errorStream = this.vm.getErrorStream();
- Thread errorThread = new Thread(new Runnable() {
- public void run() {
- try {
- int c = errorStream.read();
- while (c != -1) {
- errorBuffer.append((char) c);
- c = errorStream.read();
- }
- } catch(IOException ioEx) {
- }
- }
- });
- outputThread.start();
- errorThread.start();
- } catch(TargetException e) {
- throw new Error(e.getMessage());
- }
-
- // connect to the vm
- this.socket = null;
- boolean isVMRunning = false;
- do {
- try {
- this.socket = new Socket("localhost", portNumber);
- this.socket.setTcpNoDelay(true);
- break;
- } catch (UnknownHostException e) {
- } catch (IOException e) {
- }
- if (this.socket == null) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- isVMRunning = vm.isRunning();
- }
- } while (this.socket == null && isVMRunning);
-
-}
-/**
- * Loads and runs the given class.
- * Return whether no exception was thrown while running the class.
- */
-private boolean loadAndRun(String className) {
- if (this.socket != null) {
- try {
- DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());
- out.writeUTF(className);
- DataInputStream in = new DataInputStream(this.socket.getInputStream());
- try {
- boolean result = in.readBoolean();
- this.waitForFullBuffers();
- return result;
- } catch (SocketException e) {
- // connection was reset because target program has exited
- return true;
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- return true;
-}
-public void shutDown() {
- // Close the socket first so that the OS resource has a chance to be freed.
- if (this.socket != null) {
- try {
- this.socket.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- // Wait for the vm to shut down by itself for 2 seconds. If not succesfull, force the shut down.
- if (this.vm != null) {
- try {
- int retry = 0;
- while (this.vm.isRunning() && (++retry < 20)) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- }
- if (this.vm.isRunning()) {
- this.vm.shutDown();
- }
- } catch (TargetException e) {
- e.printStackTrace();
- }
- }
-}
-/**
- * Verify that the class files created for the given test file can be loaded by
- * a virtual machine.
- */
-public boolean verifyClassFiles(String sourceFilePath, String className, String expectedSuccessOutputString, String[] classpaths) {
- return verifyClassFiles(sourceFilePath, className, expectedSuccessOutputString, classpaths, null, null);
-}
-/**
- * Verify that the class files created for the given test file can be loaded by
- * a virtual machine.
- */
-public boolean verifyClassFiles(String sourceFilePath, String className, String expectedSuccessOutputString, String[] classpaths, String[] programArguments, String[] vmArguments) {
- this.outputBuffer = new StringBuffer();
- this.errorBuffer = new StringBuffer();
- if (this.reuseVM && programArguments == null) {
- this.launchVerifyTestsIfNeeded(classpaths, vmArguments);
- this.loadAndRun(className);
- } else {
- this.launchAndRun(className, classpaths, programArguments, vmArguments);
- }
-
- this.failureReason = null;
- return this.checkBuffers(this.errorBuffer.toString(), this.outputBuffer.toString(), sourceFilePath, expectedSuccessOutputString);
-}
-
-/**
- * Verify that the class files created for the given test file can be loaded and run with an expected error contained
- * in the expectedSuccessOutputString string.
- */
-public boolean verifyClassFilesThrowingError(String sourceFilePath, String className, String expectedSuccessOutputString, String[] classpaths, String[] programArguments, String[] vmArguments) {
- this.outputBuffer = new StringBuffer();
- this.errorBuffer = new StringBuffer();
- if (this.reuseVM && programArguments == null) {
- this.launchVerifyTestsIfNeeded(classpaths, vmArguments);
- this.loadAndRun(className);
- } else {
- this.launchAndRun(className, classpaths, programArguments, vmArguments);
- }
-
- this.failureReason = null;
- return this.checkBuffersThrowingError(this.errorBuffer.toString(), sourceFilePath, expectedSuccessOutputString);
-}
-
-/**
- * Wait until there is nothing more to read from the stdout or sterr.
- */
-private void waitForFullBuffers() {
- String endString = VerifyTests.class.getName();
- int count = 50;
- int errorEndStringStart = this.errorBuffer.toString().indexOf(endString);
- int outputEndStringStart = this.outputBuffer.toString().indexOf(endString);
- while (errorEndStringStart == -1 || outputEndStringStart == -1) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- if (--count == 0) return;
- errorEndStringStart = this.errorBuffer.toString().indexOf(endString);
- outputEndStringStart = this.outputBuffer.toString().indexOf(endString);
- }
- this.errorBuffer.setLength(errorEndStringStart);
- this.outputBuffer.setLength(outputEndStringStart);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/Util.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/Util.java
deleted file mode 100644
index f5a8c69..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/Util.java
+++ /dev/null
@@ -1,1299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.util;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringBufferInputStream;
-import java.net.ServerSocket;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-import java.util.zip.ZipOutputStream;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.compiler.libraries.SystemLibraryLocation;
-import org.eclipse.wst.jsdt.core.tests.compiler.regression.Requestor;
-import org.eclipse.wst.jsdt.internal.compiler.Compiler;
-import org.eclipse.wst.jsdt.internal.compiler.IErrorHandlingPolicy;
-import org.eclipse.wst.jsdt.internal.compiler.IProblemFactory;
-import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.compiler.batch.FileSystem;
-import org.eclipse.wst.jsdt.internal.compiler.env.INameEnvironment;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblem;
-import org.eclipse.wst.jsdt.internal.compiler.problem.DefaultProblemFactory;
-public class Util {
- private static String TARGET_PLUGIN="org.eclipse.wst.jsdt.core";
- // Trace for delete operation
- /*
- * Maximum time wasted repeating delete operations while running JDT/Core tests.
- */
- private static int DELETE_MAX_TIME = 0;
- /**
- * Trace deletion operations while running JDT/Core tests.
- */
- public static boolean DELETE_DEBUG = false;
- /**
- * Maximum of time in ms to wait in deletion operation while running JDT/Core tests.
- * Default is 10 seconds. This number cannot exceed 1 minute (ie. 60000).
- * <br>
- * To avoid too many loops while waiting, the ten first ones are done waiting
- * 10ms before repeating, the ten loops after are done waiting 100ms and
- * the other loops are done waiting 1s...
- */
- public static int DELETE_MAX_WAIT = 10000;
-
- private static final boolean DEBUG = false;
- /**
- * Initially, output directory was located in System.getProperty("user.home")+"\comptest".
- * To allow user to run several compiler tests at the same time, main output directory
- * is now located in a sub-directory of "comptest" which name is "run."+<code>System.currentMilliseconds</code>.
- *
- * @see #DELAY_BEFORE_CLEAN_PREVIOUS
- */
- private final static String OUTPUT_DIRECTORY;
- /**
- * Let user specify the delay in hours before output directories are removed from file system
- * while starting a new test run. Default value is 2 hours.
- * <p>
- * Note that this value may be a float and so have time less than one hour.
- * If value is 0 or negative, then all previous run directories will be removed...
- *
- * @see #OUTPUT_DIRECTORY
- */
- private final static String DELAY_BEFORE_CLEAN_PREVIOUS = System.getProperty("delay");
- /*
- * Static initializer to clean directories created while running previous test suites.
- */
- static {
- // Get delay for cleaning sub-directories
- long millisecondsPerHour = 1000L * 3600L;
- long delay = millisecondsPerHour * 2; // default is to keep previous run directories for 2 hours
- try {
- if (DELAY_BEFORE_CLEAN_PREVIOUS != null) {
- float hours = Float.parseFloat(DELAY_BEFORE_CLEAN_PREVIOUS);
- delay = (int) (millisecondsPerHour * hours);
- }
- }
- catch (NumberFormatException nfe) {
- // use default
- }
-
- // Get output directory root from system properties
- String container = System.getProperty("jdt.test.output_directory");
- if (container == null){
- container = System.getProperty("user.home");
- }
- if (container == null) {
- container = "."; // use current directory
- }
-
- // Get file for root directory
- if (Character.isLowerCase(container.charAt(0)) && container.charAt(1) == ':') {
- container = Character.toUpperCase(container.charAt(0)) + container.substring(1);
- }
- File dir = new File(new File(container), "comptest");
-
- // If root directory already exists, clean it
- if (dir.exists()) {
- long now = System.currentTimeMillis();
- if ((now - dir.lastModified()) > delay) {
- // remove all directory content
- flushDirectoryContent(dir);
- } else {
- // remove only old sub-dirs
- File[] testDirs = dir.listFiles();
- for (int i=0,l=testDirs.length; i<l; i++) {
- if (testDirs[i].isDirectory()) {
- if ((now - testDirs[i].lastModified()) > delay) {
- delete(testDirs[i]);
- }
- }
- }
- }
- }
-
- // Computed test run directory name based on current time
- File dateDir = new File(dir, "run."+System.currentTimeMillis());
- OUTPUT_DIRECTORY = dateDir.getPath();
- }
-
-public static void appendProblem(StringBuffer problems, IProblem problem, char[] source, int problemCount) {
- problems.append(problemCount + (problem.isError() ? ". ERROR" : ". WARNING"));
- problems.append(" in " + new String(problem.getOriginatingFileName()));
- if (source != null) {
- problems.append(((DefaultProblem)problem).errorReportSource(source));
- }
- problems.append("\n");
- problems.append(problem.getMessage());
- problems.append("\n");
-}
-
-public static CompilationUnit[] compilationUnits(String[] testFiles) {
- int length = testFiles.length / 2;
- CompilationUnit[] result = new CompilationUnit[length];
- int index = 0;
- for (int i = 0; i < length; i++) {
- String fileName = testFiles[index];
- result[i] = new CompilationUnit(testFiles[index + 1].toCharArray(), fileName, null);
- char [] fileNameChars=fileName.toCharArray();
- int lastIndexOf = CharOperation.lastIndexOf('/', fileNameChars);
- if (lastIndexOf>=0)
- {
- char[] subarray = CharOperation.subarray(fileNameChars, 0, lastIndexOf);
- result[i].packageName=CharOperation.splitOn('/', subarray);
- }
- index += 2;
- }
- return result;
-}
-public static void compile(String[] pathsAndContents, Map options, String outputPath) {
- IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
- Requestor requestor =
- new Requestor(
- problemFactory,
- outputPath.endsWith(File.separator) ? outputPath : outputPath + File.separator,
- false,
- null/*no custom requestor*/,
- false, /* show category */
- false /* show warning token*/);
-
- INameEnvironment nameEnvironment = new FileSystem(getJavaClassLibs(), new String[] {}, null);
- IErrorHandlingPolicy errorHandlingPolicy =
- new IErrorHandlingPolicy() {
- public boolean proceedOnErrors() {
- return true;
- }
- public boolean stopOnFirstError() {
- return false;
- }
- };
- CompilerOptions compilerOptions = new CompilerOptions(options);
- compilerOptions.performMethodsFullRecovery = false;
- compilerOptions.performStatementsRecovery = false;
- Compiler batchCompiler =
- new Compiler(
- nameEnvironment,
- errorHandlingPolicy,
- compilerOptions,
- requestor,
- problemFactory);
- batchCompiler.options.produceReferenceInfo = true;
- batchCompiler.compile(compilationUnits(pathsAndContents)); // compile all files together
- System.err.print(requestor.problemLog); // problem log empty if no problems
-}
-public static String[] concatWithClassLibs(String[] classpaths, boolean inFront) {
- String[] classLibs = getJavaClassLibs();
- if (classpaths == null) return classLibs;
- final int classLibsLength = classLibs.length;
- final int classpathsLength = classpaths.length;
- String[] defaultClassPaths = new String[classLibsLength + classpathsLength];
- if (inFront) {
- System.arraycopy(classLibs, 0, defaultClassPaths, classpathsLength, classLibsLength);
- System.arraycopy(classpaths, 0, defaultClassPaths, 0, classpathsLength);
- } else {
- System.arraycopy(classLibs, 0, defaultClassPaths, 0, classLibsLength);
- System.arraycopy(classpaths, 0, defaultClassPaths, classLibsLength, classpathsLength);
- }
- for (int i = 0; i < classpathsLength; i++) {
- File file = new File(classpaths[i]);
- if (!file.exists()) {
- file.mkdirs();
- }
- }
- return defaultClassPaths;
-}
-public static String[] concatWithClassLibs(String classpath, boolean inFront) {
- String[] classLibs = getJavaClassLibs();
- final int length = classLibs.length;
- File dir = new File(classpath);
- if (!dir.exists())
- dir.mkdirs();
- String[] defaultClassPaths = new String[length + 1];
- if (inFront) {
- System.arraycopy(classLibs, 0, defaultClassPaths, 1, length);
- defaultClassPaths[0] = classpath;
- } else {
- System.arraycopy(classLibs, 0, defaultClassPaths, 0, length);
- defaultClassPaths[length] = classpath;
- }
- return defaultClassPaths;
-}
-public static String convertToIndependantLineDelimiter(String source) {
- if (source.indexOf('\n') == -1 && source.indexOf('\r') == -1) return source;
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = source.length(); i < length; i++) {
- char car = source.charAt(i);
- if (car == '\r') {
- buffer.append('\n');
- if (i < length-1 && source.charAt(i+1) == '\n') {
- i++; // skip \n after \r
- }
- } else {
- buffer.append(car);
- }
- }
- return buffer.toString();
-}
-/**
- * Copy the given source (a file or a directory that must exists) to the given destination (a directory that must exists).
- */
-public static void copy(String sourcePath, String destPath) {
- sourcePath = toNativePath(sourcePath);
- destPath = toNativePath(destPath);
- File source = new File(sourcePath);
- if (!source.exists()) return;
- File dest = new File(destPath);
- if (!dest.exists()) return;
- if (source.isDirectory()) {
- String[] files = source.list();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- String file = files[i];
- File sourceFile = new File(source, file);
- if (sourceFile.isDirectory()) {
- File destSubDir = new File(dest, file);
- destSubDir.mkdir();
- copy(sourceFile.getPath(), destSubDir.getPath());
- } else {
- copy(sourceFile.getPath(), dest.getPath());
- }
- }
- }
- } else {
- FileInputStream in = null;
- FileOutputStream out = null;
- try {
- in = new FileInputStream(source);
- File destFile = new File(dest, source.getName());
- if (destFile.exists()) {
- if (!Util.delete(destFile)) {
- throw new IOException(destFile + " is in use");
- }
- }
- out = new FileOutputStream(destFile);
- int bufferLength = 1024;
- byte[] buffer = new byte[bufferLength];
- int read = 0;
- while (read != -1) {
- read = in.read(buffer, 0, bufferLength);
- if (read != -1) {
- out.write(buffer, 0, read);
- }
- }
- } catch (IOException e) {
- throw new Error(e.toString());
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- }
- }
- if (out != null) {
- try {
- out.close();
- } catch (IOException e) {
- }
- }
- }
- }
-}
-public static void createFile(String path, String contents) throws IOException {
- FileOutputStream output = new FileOutputStream(path);
- try {
- output.write(contents.getBytes());
- } finally {
- output.close();
- }
-}
-public static void createJar(String[] pathsAndContents, Map options, String jarPath) throws IOException {
- String classesPath = getOutputDirectory() + File.separator + "classes";
- File classesDir = new File(classesPath);
- flushDirectoryContent(classesDir);
- compile(pathsAndContents, options, classesPath);
- zip(classesDir, jarPath);
-}
-public static void createJar(String[] pathsAndContents, String jarPath, String compliance) throws IOException {
- Map options = new HashMap();
- options.put(CompilerOptions.OPTION_Compliance, compliance);
- options.put(CompilerOptions.OPTION_Source, compliance);
- options.put(CompilerOptions.OPTION_TargetPlatform, compliance);
- // Ignore options with new defaults (since bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=76530)
- options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_ReportTypeParameterHiding, CompilerOptions.IGNORE);
- options.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
- options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
- createJar(pathsAndContents, options, jarPath);
-}
-public static void createSourceZip(String[] pathsAndContents, String zipPath) throws IOException {
- String sourcesPath = getOutputDirectory() + File.separator + "sources";
- File sourcesDir = new File(sourcesPath);
- flushDirectoryContent(sourcesDir);
- for (int i = 0, length = pathsAndContents.length; i < length; i+=2) {
- String sourcePath = sourcesPath + File.separator + pathsAndContents[i];
- File sourceFile = new File(sourcePath);
- sourceFile.getParentFile().mkdirs();
- createFile(sourcePath, pathsAndContents[i+1]);
- }
- zip(sourcesDir, zipPath);
-}
-/**
- * Delete a file or directory and insure that the file is no longer present
- * on file system. In case of directory, delete all the hierarchy underneath.
- *
- * @param file The file or directory to delete
- * @return true iff the file was really delete, false otherwise
- */
-public static boolean delete(File file) {
- // flush all directory content
- if (file.isDirectory()) {
- flushDirectoryContent(file);
- }
- // remove file
- file.delete();
- if (isFileDeleted(file)) {
- return true;
- }
- return waitUntilFileDeleted(file);
-}
-/**
- * Delete a file or directory and insure that the file is no longer present
- * on file system. In case of directory, delete all the hierarchy underneath.
- *
- * @param resource The resource to delete
- * @return true iff the file was really delete, false otherwise
- */
-public static boolean delete(IResource resource) {
- try {
- resource.delete(true, null);
- if (isResourceDeleted(resource)) {
- return true;
- }
- }
- catch (CoreException e) {
- // skip
- }
- return waitUntilResourceDeleted(resource);
-}
-/**
- * Delete a file or directory and insure that the file is no longer present
- * on file system. In case of directory, delete all the hierarchy underneath.
- *
- * @param path The path of the file or directory to delete
- * @return true iff the file was really delete, false otherwise
- */
-public static boolean delete(String path) {
- return delete(new File(path));
-}
-/**
- * Generate a display string from the given String.
- * @param inputString the given input string
- *
- * Example of use: [org.eclipse.wst.jsdt.core.tests.util.Util.displayString("abc\ndef\tghi")]
-*/
-public static String displayString(String inputString){
- return displayString(inputString, 0);
-}
-/**
- * Generate a display string from the given String.
- * It converts:
- * <ul>
- * <li>\t to \t</li>
- * <li>\r to \\r</li>
- * <li>\n to \n</li>
- * <li>\b to \\b</li>
- * <li>\f to \\f</li>
- * <li>\" to \\\"</li>
- * <li>\' to \\'</li>
- * <li>\\ to \\\\</li>
- * <li>All other characters are unchanged.</li>
- * </ul>
- * This method doesn't convert \r\n to \n.
- * <p>
- * Example of use:
- * <o>
- * <li>
- * <pre>
- * input string = "abc\ndef\tghi",
- * indent = 3
- * result = "\"\t\t\tabc\\n" +
- * "\t\t\tdef\tghi\""
- * </pre>
- * </li>
- * <li>
- * <pre>
- * input string = "abc\ndef\tghi\n",
- * indent = 3
- * result = "\"\t\t\tabc\\n" +
- * "\t\t\tdef\tghi\\n\""
- * </pre>
- * </li>
- * <li>
- * <pre>
- * input string = "abc\r\ndef\tghi\r\n",
- * indent = 3
- * result = "\"\t\t\tabc\\r\\n" +
- * "\t\t\tdef\tghi\\r\\n\""
- * </pre>
- * </li>
- * </ol>
- * </p>
- *
- * @param inputString the given input string
- * @param indent number of tabs are added at the begining of each line.
- *
- * @return the displayed string
-*/
-public static String displayString(String inputString, int indent) {
- return displayString(inputString, indent, false);
-}
-public static String displayString(String inputString, int indent, boolean shift) {
- if (inputString == null)
- return "null";
- int length = inputString.length();
- StringBuffer buffer = new StringBuffer(length);
- java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(inputString, "\n\r", true);
- for (int i = 0; i < indent; i++) buffer.append("\t");
- if (shift) indent++;
- buffer.append("\"");
- while (tokenizer.hasMoreTokens()){
-
- String token = tokenizer.nextToken();
- if (token.equals("\r")) {
- buffer.append("\\r");
- if (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- if (token.equals("\n")) {
- buffer.append("\\n");
- if (tokenizer.hasMoreTokens()) {
- buffer.append("\" + \n");
- for (int i = 0; i < indent; i++) buffer.append("\t");
- buffer.append("\"");
- }
- continue;
- }
- buffer.append("\" + \n");
- for (int i = 0; i < indent; i++) buffer.append("\t");
- buffer.append("\"");
- } else {
- continue;
- }
- } else if (token.equals("\n")) {
- buffer.append("\\n");
- if (tokenizer.hasMoreTokens()) {
- buffer.append("\" + \n");
- for (int i = 0; i < indent; i++) buffer.append("\t");
- buffer.append("\"");
- }
- continue;
- }
-
- StringBuffer tokenBuffer = new StringBuffer();
- for (int i = 0; i < token.length(); i++){
- char c = token.charAt(i);
- switch (c) {
- case '\r' :
- tokenBuffer.append("\\r");
- break;
- case '\n' :
- tokenBuffer.append("\\n");
- break;
- case '\b' :
- tokenBuffer.append("\\b");
- break;
- case '\t' :
- tokenBuffer.append("\t");
- break;
- case '\f' :
- tokenBuffer.append("\\f");
- break;
- case '\"' :
- tokenBuffer.append("\\\"");
- break;
- case '\'' :
- tokenBuffer.append("\\'");
- break;
- case '\\' :
- tokenBuffer.append("\\\\");
- break;
- default :
- tokenBuffer.append(c);
- }
- }
- buffer.append(tokenBuffer.toString());
- }
- buffer.append("\"");
- return buffer.toString();
-}
-/**
- * Reads the content of the given source file.
- * Returns null if enable to read given source file.
- *
- * Example of use: [org.eclipse.wst.jsdt.core.tests.util.Util.fileContent("c:/temp/X.java")]
-*/
-public static String fileContent(String sourceFilePath) {
- File sourceFile = new File(sourceFilePath);
- if (!sourceFile.exists()) {
- if (DEBUG) System.out.println("File " + sourceFilePath + " does not exists.");
- return null;
- }
- if (!sourceFile.isFile()) {
- if (DEBUG) System.out.println(sourceFilePath + " is not a file.");
- return null;
- }
- StringBuffer sourceContentBuffer = new StringBuffer();
- FileInputStream input = null;
- try {
- input = new FileInputStream(sourceFile);
- } catch (FileNotFoundException e) {
- return null;
- }
- try {
- int read;
- do {
- read = input.read();
- if (read != -1) {
- sourceContentBuffer.append((char)read);
- }
- } while (read != -1);
- input.close();
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- } finally {
- try {
- input.close();
- } catch (IOException e2) {
- }
- }
- return sourceContentBuffer.toString();
-}
-
-/**
- * Reads the content of the given source file and converts it to a display string.
- *
- * Example of use: [org.eclipse.wst.jsdt.core.tests.util.Util.fileContentToDisplayString("c:/temp/X.java", 0)]
-*/
-public static String fileContentToDisplayString(String sourceFilePath, int indent, boolean independantLineDelimiter) {
- String sourceString = fileContent(sourceFilePath);
- if (independantLineDelimiter) {
- sourceString = convertToIndependantLineDelimiter(sourceString);
- }
- return displayString(sourceString, indent);
-}
-/**
- * Reads the content of the given source file, converts it to a display string.
- * If the destination file path is not null, writes the result to this file.
- * Otherwise writes it to the console.
- *
- * Example of use: [org.eclipse.wst.jsdt.core.tests.util.Util.fileContentToDisplayString("c:/temp/X.java", 0, null)]
-*/
-public static void fileContentToDisplayString(String sourceFilePath, int indent, String destinationFilePath, boolean independantLineDelimiter) {
- String displayString = fileContentToDisplayString(sourceFilePath, indent, independantLineDelimiter);
- if (destinationFilePath == null) {
- System.out.println(displayString);
- return;
- }
- writeToFile(displayString, destinationFilePath);
-}
-/**
- * Flush content of a given directory (leaving it empty),
- * no-op if not a directory.
- */
-public static void flushDirectoryContent(File dir) {
- File[] files = dir.listFiles();
- if (files == null) return;
- for (int i = 0, max = files.length; i < max; i++) {
- delete(files[i]);
- }
-}
-/**
- * Returns the next available port number on the local host.
- */
-public static int getFreePort() {
- ServerSocket socket = null;
- try {
- socket = new ServerSocket(0);
- return socket.getLocalPort();
- } catch (IOException e) {
- // ignore
- } finally {
- if (socket != null) {
- try {
- socket.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
- return -1;
-}
-/**
- * Search the user hard-drive for a Java class library.
- * Returns null if none could be found.
- *
- * Example of use: [org.eclipse.wst.jsdt.core.tests.util.Util.getJavaClassLib()]
-*/
-public static String[] getJavaClassLibs() {
-
- IPath targetRoot = (new Path(System.getProperty("user.dir"))).removeLastSegments(1);
- IPath pluginDir = targetRoot.append(new Path(TARGET_PLUGIN));
- IPath libDir = pluginDir.append(new Path(new String(SystemLibraryLocation.LIBRARY_PLUGIN_DIRECTORY)));
- IPath fullDir = libDir.append(new Path(new String(SystemLibraryLocation.SYSTEM_LIBARAY_NAME)));
- File libFile=new File(fullDir.toOSString());
- if (!libFile.exists())
- {
- targetRoot = new Path(OUTPUT_DIRECTORY);
- libDir = targetRoot.append(new Path(new String(SystemLibraryLocation.LIBRARY_PLUGIN_DIRECTORY)));
-
- libFile=new File(libDir.toOSString());
- libFile.mkdirs();
-
- fullDir = libDir.append(new Path(new String(SystemLibraryLocation.SYSTEM_LIBARAY_NAME)));
-
- Class clazz=SystemLibraryLocation.class;
-
- String inputName=/*"../../../../../../../"+*/
- new String(SystemLibraryLocation.LIBRARY_PLUGIN_DIRECTORY)+"/"+new String(SystemLibraryLocation.SYSTEM_LIBARAY_NAME);
-
- URL resource = clazz.getClassLoader().getResource(inputName);
-
- InputStream inputStream=clazz.getClassLoader().getResourceAsStream(inputName);
-
- try {
- copyFile(inputStream, new File(fullDir.toOSString()));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- return new String[]
- {
- fullDir.toOSString()
- };
-// String jreDir = getJREDirectory();
-// final String osName = System.getProperty("os.name");
-// if (jreDir == null) {
-// return new String[] {};
-// }
-// if (osName.startsWith("Mac")) {
-// return new String[] { toNativePath(jreDir + "/../Classes/classes.jar")};
-// }
-// final String vmName = System.getProperty("java.vm.name");
-// if ("J9".equals(vmName)) {
-// return new String[] { toNativePath(jreDir + "/lib/jclMax/classes.zip")};
-// }
-// File file = new File(jreDir + "/lib/rt.jar");
-// if (file.exists()) {
-// return new String[] {
-// toNativePath(jreDir + "/lib/rt.jar")
-// };
-// }
-// return new String[] {
-// toNativePath(jreDir + "/lib/core.jar"),
-// toNativePath(jreDir + "/lib/security.jar"),
-// toNativePath(jreDir + "/lib/graphics.jar")
-// };
-}
-
-public static void copyFile(InputStream src, File dst) throws IOException {
- InputStream in=null;
- OutputStream out=null;
- try {
- in = new BufferedInputStream(src);
- out = new BufferedOutputStream(new FileOutputStream(dst));
- byte[] buffer = new byte[4096];
- int len;
- while ((len=in.read(buffer)) != -1) {
- out.write(buffer, 0, len);
- }
- } finally {
- if (in != null)
- try {
- in.close();
- } catch (IOException e) {
- }
- if (out != null)
- try {
- out.close();
- } catch (IOException e) {
- }
- }
-}
-
-public static String copyToOutput(String fileName, String contents) {
-
- Path targetRoot = new Path(OUTPUT_DIRECTORY);
- Path filePath=new Path(fileName);
-
- IPath libDir = targetRoot.append(filePath.removeLastSegments(1));
- String fullFileName=libDir.toOSString();
- File libFile=new File(fullFileName);
- libFile.mkdirs();
-
- IPath fullDir = libDir.append(filePath.lastSegment());
-
-
- InputStream inputStream=new StringBufferInputStream(contents);
-
- try {
- copyFile(inputStream, new File(fullDir.toOSString()));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
-
-
- return
- fullDir.toOSString();
-
-}
-
-
-
-public static String getJavaClassLibsAsString() {
- String[] classLibs = getJavaClassLibs();
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, max = classLibs.length; i < max; i++) {
- buffer
- .append(classLibs[i])
- .append(File.pathSeparatorChar);
-
- }
- return buffer.toString();
-}
-/**
- * Returns the JRE directory this tests are running on.
- * Returns null if none could be found.
- *
- * Example of use: [org.eclipse.wst.jsdt.core.tests.util.Util.getJREDirectory()]
- */
-public static String getJREDirectory() {
- return System.getProperty("java.home");
-}
-/**
- * Search the user hard-drive for a possible output directory.
- * Returns null if none could be found.
- *
- * Example of use: [org.eclipse.wst.jsdt.core.tests.util.Util.getOutputDirectory()]
- */
-public static String getOutputDirectory() {
- return OUTPUT_DIRECTORY;
-}
-/**
- * Returns the parent's child file matching the given file or null if not found.
- *
- * @param file The searched file in parent
- * @return The parent's child matching the given file or null if not found.
- */
-private static File getParentChildFile(File file) {
- File parent = file.getParentFile();
- if (parent == null || !parent.exists()) return null;
- File[] files = parent.listFiles();
- int length = files==null ? 0 : files.length;
- if (length > 0) {
- for (int i=0; i<length; i++) {
- if (files[i] == file) {
- return files[i];
- } else if (files[i].equals(file)) {
- return files[i];
- } else if (files[i].getPath().equals(file.getPath())) {
- return files[i];
- }
- }
- }
- return null;
-}
-/**
- * Returns parent's child resource matching the given resource or null if not found.
- *
- * @param resource The searched file in parent
- * @return The parent's child matching the given file or null if not found.
- */
-private static IResource getParentChildResource(IResource resource) {
- IContainer parent = resource.getParent();
- if (parent == null || !parent.exists()) return null;
- try {
- IResource[] members = parent.members();
- int length = members ==null ? 0 : members.length;
- if (length > 0) {
- for (int i=0; i<length; i++) {
- if (members[i] == resource) {
- return members[i];
- } else if (members[i].equals(resource)) {
- return members[i];
- } else if (members[i].getFullPath().equals(resource.getFullPath())) {
- return members[i];
- }
- }
- }
- }
- catch (CoreException ce) {
- // skip
- }
- return null;
-}
-/**
- * Returns the test name from stack elements info.
- *
- * @return The name of the test currently running
- */
-private static String getTestName() {
- StackTraceElement[] elements = new Exception().getStackTrace();
- int idx = 0, length=elements.length;
- while (idx<length && !elements[idx++].getClassName().startsWith("org.eclipse.wst.jsdt")) {
- // loop until JDT/Core class appears in the stack
- }
- if (idx<length) {
- StackTraceElement testElement = null;
- while (idx<length && elements[idx].getClassName().startsWith("org.eclipse.wst.jsdt")) {
- testElement = elements[idx++];
- }
- if (testElement != null) {
- return testElement.getClassName() + " - " + testElement.getMethodName();
- }
- }
- return "?";
-}
-public static String indentString(String inputString, int indent) {
- if (inputString == null)
- return "";
- int length = inputString.length();
- StringBuffer buffer = new StringBuffer(length);
- java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(inputString, "\n\r", true);
- StringBuffer indentStr = new StringBuffer(indent);
- for (int i = 0; i < indent; i++) indentStr.append("\t");
- buffer.append(indentStr);
- while (tokenizer.hasMoreTokens()){
- String token = tokenizer.nextToken();
- buffer.append(token);
- if (token.equals("\r") || token.equals("\n")) {
- buffer.append(indentStr);
- }
- }
- return buffer.toString();
-}
-/**
- * Returns whether a file is really deleted or not.
- * Does not only rely on {@link File#exists()} method but also
- * look if it's not in its parent children {@link #getParentChildFile(File)}.
- *
- * @param file The file to test if deleted
- * @return true if the file does not exist and was not found in its parent children.
- */
-public static boolean isFileDeleted(File file) {
- return !file.exists() && getParentChildFile(file) == null;
-}
-public static boolean isMacOS() {
- return System.getProperty("os.name").indexOf("Mac") != -1;
-}
-/**
- * Returns whether a resource is really deleted or not.
- * Does not only rely on {@link IResource#isAccessible()} method but also
- * look if it's not in its parent children {@link #getParentChildResource(IResource)}.
- *
- * @param resource The resource to test if deleted
- * @return true if the resource is not accessible and was not found in its parent children.
- */
-public static boolean isResourceDeleted(IResource resource) {
- return !resource.isAccessible() && getParentChildResource(resource) == null;
-}
-/**
- * Print given file information with specified indentation.
- * These information are:<ul>
- * <li>read {@link File#canRead()}</li>
- * <li>write {@link File#canWrite()}</li>
- * <li>exists {@link File#exists()}</li>
- * <li>is file {@link File#isFile()}</li>
- * <li>is directory {@link File#isDirectory()}</li>
- * <li>is hidden {@link File#isHidden()}</li>
- * </ul>
- * May recurse several level in parents hierarchy.
- * May also display children, but then will not recusre in parent
- * hierarchy to avoid infinite loop...
- *
- * @param file The file to display information
- * @param indent Number of tab to print before the information
- * @param recurse Display also information on <code>recurse</code>th parents in hierarchy.
- * If negative then display children information instead.
- */
-private static void printFileInfo(File file, int indent, int recurse) {
- String tab = "";
- for (int i=0; i<indent; i++) tab+="\t";
- System.out.print(tab+"- "+file.getName()+" file info: ");
- String sep = "";
- if (file.canRead()) {
- System.out.print("read");
- sep = ", ";
- }
- if (file.canWrite()) {
- System.out.print(sep+"write");
- sep = ", ";
- }
- if (file.exists()) {
- System.out.print(sep+"exist");
- sep = ", ";
- }
- if (file.isDirectory()) {
- System.out.print(sep+"dir");
- sep = ", ";
- }
- if (file.isFile()) {
- System.out.print(sep+"file");
- sep = ", ";
- }
- if (file.isHidden()) {
- System.out.print(sep+"hidden");
- sep = ", ";
- }
- System.out.println();
- File[] files = file.listFiles();
- int length = files==null ? 0 : files.length;
- if (length > 0) {
- boolean children = recurse < 0;
- System.out.print(tab+" + children: ");
- if (children) System.out.println();
- for (int i=0; i<length; i++) {
- if (children) { // display children
- printFileInfo(files[i], indent+2, -1);
- } else {
- if (i>0) System.out.print(", ");
- System.out.print(files[i].getName());
- if (files[i].isDirectory()) System.out.print("[dir]");
- else if (files[i].isFile()) System.out.print("[file]");
- else System.out.print("[?]");
- }
- }
- if (!children) System.out.println();
- }
- if (recurse > 0) {
- File parent = file.getParentFile();
- if (parent != null) printFileInfo(parent, indent+1, recurse-1);
- }
-}
-/**
- * Print stack trace with only JDT/Core elements.
- *
- * @param exception Exception of the stack trace. May be null, then a fake exception is used.
- * @param indent Number of tab to display before the stack elements to display.
- */
-private static void printJdtCoreStackTrace(Exception exception, int indent) {
- String tab = "";
- for (int i=0; i<indent; i++) tab+="\t";
- StackTraceElement[] elements = (exception==null?new Exception():exception).getStackTrace();
- int idx = 0, length=elements.length;
- while (idx<length && !elements[idx++].getClassName().startsWith("org.eclipse.wst.jsdt")) {
- // loop until JDT/Core class appears in the stack
- }
- if (idx<length) {
- System.out.print(tab+"- stack trace");
- if (exception == null)
- System.out.println(":");
- else
- System.out.println(" for exception "+exception+":");
- while (idx<length && elements[idx].getClassName().startsWith("org.eclipse.wst.jsdt")) {
- StackTraceElement testElement = elements[idx++];
- System.out.println(tab+" -> "+testElement);
- }
- } else {
- exception.printStackTrace(System.out);
- }
-}
-/**
- * Makes the given path a path using native path separators as returned by File.getPath()
- * and trimming any extra slash.
- */
-public static String toNativePath(String path) {
- String nativePath = path.replace('\\', File.separatorChar).replace('/', File.separatorChar);
- return
- nativePath.endsWith("/") || nativePath.endsWith("\\") ?
- nativePath.substring(0, nativePath.length() - 1) :
- nativePath;
-}
-/**
- * Unzip the contents of the given zip in the given directory (create it if it doesn't exist)
- */
-public static void unzip(String zipPath, String destDirPath) throws IOException {
-
- InputStream zipIn = new FileInputStream(zipPath);
- byte[] buf = new byte[8192];
- File destDir = new File(destDirPath);
- ZipInputStream zis = new ZipInputStream(zipIn);
- FileOutputStream fos = null;
- try {
- ZipEntry zEntry;
- while ((zEntry = zis.getNextEntry()) != null) {
- // if it is empty directory, create it
- if (zEntry.isDirectory()) {
- new File(destDir, zEntry.getName()).mkdirs();
- continue;
- }
- // if it is a file, extract it
- String filePath = zEntry.getName();
- int lastSeparator = filePath.lastIndexOf("/"); //$NON-NLS-1$
- String fileDir = ""; //$NON-NLS-1$
- if (lastSeparator >= 0) {
- fileDir = filePath.substring(0, lastSeparator);
- }
- //create directory for a file
- new File(destDir, fileDir).mkdirs();
- //write file
- File outFile = new File(destDir, filePath);
- fos = new FileOutputStream(outFile);
- int n = 0;
- while ((n = zis.read(buf)) >= 0) {
- fos.write(buf, 0, n);
- }
- fos.close();
- }
- } catch (IOException ioe) {
- if (fos != null) {
- try {
- fos.close();
- } catch (IOException ioe2) {
- }
- }
- } finally {
- try {
- zipIn.close();
- if (zis != null)
- zis.close();
- } catch (IOException ioe) {
- }
- }
-}
-/**
- * Wait until the file is _really_ deleted on file system.
- *
- * @param file Deleted file
- * @return true if the file was finally deleted, false otherwise
- */
-private static boolean waitUntilFileDeleted(File file) {
- if (DELETE_DEBUG) {
- System.out.println();
- System.out.println("WARNING in test: "+getTestName());
- System.out.println(" - problems occured while deleting "+file);
- printJdtCoreStackTrace(null, 1);
- printFileInfo(file.getParentFile(), 1, -1); // display parent with its children
- System.out.print(" - wait for ("+DELETE_MAX_WAIT+"ms max): ");
- }
- int count = 0;
- int delay = 10; // ms
- int maxRetry = DELETE_MAX_WAIT / delay;
- int time = 0;
- while (count < maxRetry) {
- try {
- count++;
- Thread.sleep(delay);
- time += delay;
- if (time > DELETE_MAX_TIME) DELETE_MAX_TIME = time;
- if (DELETE_DEBUG) System.out.print('.');
- if (file.exists()) {
- if (file.delete()) {
- // SUCCESS
- if (DELETE_DEBUG) {
- System.out.println();
- System.out.println(" => file really removed after "+time+"ms (max="+DELETE_MAX_TIME+"ms)");
- System.out.println();
- }
- return true;
- }
- }
- if (isFileDeleted(file)) {
- // SUCCESS
- if (DELETE_DEBUG) {
- System.out.println();
- System.out.println(" => file disappeared after "+time+"ms (max="+DELETE_MAX_TIME+"ms)");
- System.out.println();
- }
- return true;
- }
- // Increment waiting delay exponentially
- if (count >= 10 && delay <= 100) {
- count = 1;
- delay *= 10;
- maxRetry = DELETE_MAX_WAIT / delay;
- if ((DELETE_MAX_WAIT%delay) != 0) {
- maxRetry++;
- }
- }
- }
- catch (InterruptedException ie) {
- break; // end loop
- }
- }
- if (!DELETE_DEBUG) {
- System.out.println();
- System.out.println("WARNING in test: "+getTestName());
- System.out.println(" - problems occured while deleting "+file);
- printJdtCoreStackTrace(null, 1);
- printFileInfo(file.getParentFile(), 1, -1); // display parent with its children
- }
- System.out.println();
- System.out.println(" !!! ERROR: "+file+" was never deleted even after having waited "+DELETE_MAX_TIME+"ms!!!");
- System.out.println();
- return false;
-}
-/**
- * Wait until a resource is _really_ deleted on file system.
- *
- * @param resource Deleted resource
- * @return true if the file was finally deleted, false otherwise
- */
-private static boolean waitUntilResourceDeleted(IResource resource) {
- File file = resource.getLocation().toFile();
- if (DELETE_DEBUG) {
- System.out.println();
- System.out.println("WARNING in test: "+getTestName());
- System.out.println(" - problems occured while deleting resource "+resource);
- printJdtCoreStackTrace(null, 1);
- printFileInfo(file.getParentFile(), 1, -1); // display parent with its children
- System.out.print(" - wait for ("+DELETE_MAX_WAIT+"ms max): ");
- }
- int count = 0;
- int delay = 10; // ms
- int maxRetry = DELETE_MAX_WAIT / delay;
- int time = 0;
- while (count < maxRetry) {
- try {
- count++;
- Thread.sleep(delay);
- time += delay;
- if (time > DELETE_MAX_TIME) DELETE_MAX_TIME = time;
- if (DELETE_DEBUG) System.out.print('.');
- if (resource.isAccessible()) {
- try {
- resource.delete(true, null);
- if (isResourceDeleted(resource) && isFileDeleted(file)) {
- // SUCCESS
- if (DELETE_DEBUG) {
- System.out.println();
- System.out.println(" => resource really removed after "+time+"ms (max="+DELETE_MAX_TIME+"ms)");
- System.out.println();
- }
- return true;
- }
- }
- catch (CoreException e) {
- // skip
- }
- }
- if (isResourceDeleted(resource) && isFileDeleted(file)) {
- // SUCCESS
- if (DELETE_DEBUG) {
- System.out.println();
- System.out.println(" => resource disappeared after "+time+"ms (max="+DELETE_MAX_TIME+"ms)");
- System.out.println();
- }
- return true;
- }
- // Increment waiting delay exponentially
- if (count >= 10 && delay <= 100) {
- count = 1;
- delay *= 10;
- maxRetry = DELETE_MAX_WAIT / delay;
- if ((DELETE_MAX_WAIT%delay) != 0) {
- maxRetry++;
- }
- }
- }
- catch (InterruptedException ie) {
- break; // end loop
- }
- }
- if (!DELETE_DEBUG) {
- System.out.println();
- System.out.println("WARNING in test: "+getTestName());
- System.out.println(" - problems occured while deleting resource "+resource);
- printJdtCoreStackTrace(null, 1);
- printFileInfo(file.getParentFile(), 1, -1); // display parent with its children
- }
- System.out.println();
- System.out.println(" !!! ERROR: "+resource+" was never deleted even after having waited "+DELETE_MAX_TIME+"ms!!!");
- System.out.println();
- return false;
-}
-public static void writeToFile(String contents, String destinationFilePath) {
- File destFile = new File(destinationFilePath);
- FileOutputStream output = null;
- try {
- output = new FileOutputStream(destFile);
- PrintWriter writer = new PrintWriter(output);
- writer.print(contents);
- writer.flush();
- } catch (IOException e) {
- e.printStackTrace();
- return;
- } finally {
- if (output != null) {
- try {
- output.close();
- } catch (IOException e2) {
- }
- }
- }
-}
-public static void zip(File rootDir, String zipPath) throws IOException {
- ZipOutputStream zip = null;
- try {
- File zipFile = new File(zipPath);
- if (zipFile.exists()) delete(zipFile);
- zip = new ZipOutputStream(new FileOutputStream(zipFile));
- zip(rootDir, zip, rootDir.getPath().length()+1); // 1 for last slash
- } finally {
- if (zip != null) {
- zip.close();
- }
- }
-}
-private static void zip(File dir, ZipOutputStream zip, int rootPathLength) throws IOException {
- File[] files = dir.listFiles();
- if (files != null) {
- for (int i = 0, length = files.length; i < length; i++) {
- File file = files[i];
- if (file.isFile()) {
- String path = file.getPath();
- path = path.substring(rootPathLength);
- ZipEntry entry = new ZipEntry(path.replace('\\', '/'));
- zip.putNextEntry(entry);
- zip.write(org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileByteContent(file));
- zip.closeEntry();
- } else {
- zip(file, zip, rootPathLength);
- }
- }
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/VerifyTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/VerifyTests.java
deleted file mode 100644
index 9beddab..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/VerifyTests.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.util;
-
-import java.lang.reflect.*;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/******************************************************
- *
- * IMPORTANT NOTE: If modifying this class, copy the source to TestVerifier#getVerifyTestsCode()
- * (see this method for details)
- *
- ******************************************************/
-
-public class VerifyTests {
- int portNumber;
- Socket socket;
-
-/**
- * NOTE: Code copied from junit.util.TestCaseClassLoader.
- *
- * A custom class loader which enables the reloading
- * of classes for each test run. The class loader
- * can be configured with a list of package paths that
- * should be excluded from loading. The loading
- * of these packages is delegated to the system class
- * loader. They will be shared across test runs.
- * <p>
- * The list of excluded package paths is specified in
- * a properties file "excluded.properties" that is located in
- * the same place as the TestCaseClassLoader class.
- * <p>
- * <b>Known limitation:</b> the VerifyClassLoader cannot load classes
- * from jar files.
- */
-
-
-public class VerifyClassLoader extends ClassLoader {
- /** scanned class path */
- private String[] fPathItems;
-
- /** excluded paths */
- private String[] fExcluded= {};
-
- /**
- * Constructs a VerifyClassLoader. It scans the class path
- * and the excluded package paths
- */
- public VerifyClassLoader() {
- super();
- String classPath= System.getProperty("java.class.path");
- String separator= System.getProperty("path.separator");
-
- // first pass: count elements
- StringTokenizer st= new StringTokenizer(classPath, separator);
- int i= 0;
- while (st.hasMoreTokens()) {
- st.nextToken();
- i++;
- }
- // second pass: split
- fPathItems= new String[i];
- st= new StringTokenizer(classPath, separator);
- i= 0;
- while (st.hasMoreTokens()) {
- fPathItems[i++]= st.nextToken();
- }
-
- }
- public java.net.URL getResource(String name) {
- return ClassLoader.getSystemResource(name);
- }
- public InputStream getResourceAsStream(String name) {
- return ClassLoader.getSystemResourceAsStream(name);
- }
- protected boolean isExcluded(String name) {
- // exclude the "java" packages.
- // They always need to be excluded so that they are loaded by the system class loader
- if (name.startsWith("java"))
- return true;
-
- // exclude the user defined package paths
- for (int i= 0; i < fExcluded.length; i++) {
- if (name.startsWith(fExcluded[i])) {
- return true;
- }
- }
- return false;
- }
- public synchronized Class loadClass(String name, boolean resolve)
- throws ClassNotFoundException {
-
- Class c= findLoadedClass(name);
- if (c != null)
- return c;
- //
- // Delegate the loading of excluded classes to the
- // standard class loader.
- //
- if (isExcluded(name)) {
- try {
- c= findSystemClass(name);
- return c;
- } catch (ClassNotFoundException e) {
- // keep searching
- }
- }
- File file= locate(name);
- if (file == null)
- throw new ClassNotFoundException();
- byte data[]= loadClassData(file);
- c= defineClass(name, data, 0, data.length);
- if (resolve)
- resolveClass(c);
- return c;
- }
- private byte[] loadClassData(File f) throws ClassNotFoundException {
- try {
- //System.out.println("loading: "+f.getPath());
- FileInputStream stream= new FileInputStream(f);
-
- try {
- byte[] b= new byte[stream.available()];
- stream.read(b);
- stream.close();
- return b;
- }
- catch (IOException e) {
- throw new ClassNotFoundException();
- }
- }
- catch (FileNotFoundException e) {
- throw new ClassNotFoundException();
- }
- }
- /**
- * Locate the given file.
- * @return Returns null if file couldn't be found.
- */
- private File locate(String fileName) {
- fileName= fileName.replace('.', '/')+".class";
- File path= null;
-
- if (fileName != null) {
- for (int i= 0; i < fPathItems.length; i++) {
- path= new File(fPathItems[i], fileName);
- if (path.exists())
- return path;
- }
- }
- return null;
- }
-}
-
-public void loadAndRun(String className) throws Throwable {
- //System.out.println("Loading " + className + "...");
- Class testClass = new VerifyClassLoader().loadClass(className);
- //System.out.println("Loaded " + className);
- try {
- Method main = testClass.getMethod("main", new Class[] {String[].class});
- //System.out.println("Running " + className);
- main.invoke(null, new Object[] {new String[] {}});
- //System.out.println("Finished running " + className);
- } catch (NoSuchMethodException e) {
- return;
- } catch (InvocationTargetException e) {
- throw e.getTargetException();
- }
-}
-public static void main(String[] args) throws IOException {
- VerifyTests verify = new VerifyTests();
- verify.portNumber = Integer.parseInt(args[0]);
- verify.run();
-}
-public void run() throws IOException {
- ServerSocket server = new ServerSocket(this.portNumber);
- this.socket = server.accept();
- this.socket.setTcpNoDelay(true);
- server.close();
-
- DataInputStream in = new DataInputStream(this.socket.getInputStream());
- final DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());
- while (true) {
- final String className = in.readUTF();
- Thread thread = new Thread() {
- public void run() {
- try {
- loadAndRun(className);
- out.writeBoolean(true);
- System.err.println(VerifyTests.class.getName());
- System.out.println(VerifyTests.class.getName());
- } catch (Throwable e) {
- e.printStackTrace();
- try {
- System.err.println(VerifyTests.class.getName());
- System.out.println(VerifyTests.class.getName());
- out.writeBoolean(false);
- } catch (IOException e1) {
- // ignore
- }
- }
- }
- };
- thread.start();
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/test.xml b/tests/org.eclipse.wst.jsdt.core.tests.compiler/test.xml
deleted file mode 100644
index a1d9cc5..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/test.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project
- name="testsuite"
- default="run"
- basedir=".">
-
- <!--
- =====================================================
- There should be no need to change what's above.
- (if there is, let us know if the script can be improved.)
- =====================================================
- -->
-
- <!-- should be little need to change what's above -->
- <property
- name="plugin-name"
- value="org.eclipse.wst.jsdt.core.tests.compiler" />
- <property
- name="classname"
- value="org.eclipse.wst.jsdt.core.tests.compiler.JSDTCompilerTests" />
- <property
- name="testType"
- value="core-test" />
-
- <!-- should be little need to change what's below -->
-
- <echo message="basedir: ${basedir}" />
- <echo message="eclipse-home: ${eclipse-home}" />
- <echo message="buildDirectory: ${buildDirectory}" />
- <echo message="plugin-name: ${plugin-name}" />
- <echo message="classname: ${classname}" />
- <echo message="testType ${testType}" />
-
-
- <property
- name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml" />
- <property
- name="workspace"
- value="${eclipse-home}/junitworkspaces/${plugin-name}" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp />
- <delete>
- <fileset
- dir="${eclipse-home}"
- includes="${plugin-name}.*xml" />
- </delete>
-
- <!--
- make the workspace directory, in case path doesn't exist yet
- but delete to make sure fresh contents, if it does exist
- -->
- <delete
- dir="${workspace}"
- quiet="true" />
- <mkdir
- dir="${workspace}" />
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
-
- <ant
- target="${testType}"
- antfile="${library-file}"
- dir="${eclipse-home}">
- <property
- name="data-dir"
- value="${workspace}" />
- <property
- name="plugin-name"
- value="${plugin-name}" />
- <property
- name="classname"
- value="${classname}" />
- <property
- name="plugin-path"
- value="${eclipse-home}/plugins/${plugin-name}" />
- </ant>
-
- <copy
- failonerror="false"
- file="${workspace}/.metadata/.log"
- tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt" />
-
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- <!-- usually no need to delete workspace until next run, and leaving it allows inspection -->
- <!-- <delete dir="${workspace}" quiet="true" /> -->
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target
- name="run"
- depends="init,suite,cleanup">
- <ant
- target="collect"
- antfile="${library-file}"
- dir="${eclipse-home}">
- <property
- name="includes"
- value="${plugin-name}.*xml" />
- <property
- name="output-file"
- value="${plugin-name}.xml" />
- </ant>
- </target>
-
-</project> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/.classpath b/tests/org.eclipse.wst.jsdt.core.tests.model/.classpath
deleted file mode 100644
index ce73933..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/.cvsignore b/tests/org.eclipse.wst.jsdt.core.tests.model/.cvsignore
deleted file mode 100644
index 7722bc8..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-javaCompiler...args
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/.project b/tests/org.eclipse.wst.jsdt.core.tests.model/.project
deleted file mode 100644
index 15cf2d2..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.core.tests.model</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.core.resources.prefs b/tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 039fac0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Mon Jan 28 15:47:49 CST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d8c99ee..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Tue Apr 17 15:48:57 CDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/MANIFEST.MF
deleted file mode 100644
index 1dee450..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.jsdt.core.tests.model; singleton:=true
-Bundle-Version: 1.0.300.qualifier
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.jsdt.core.tests,
- org.eclipse.wst.jsdt.core.tests.dom,
- org.eclipse.wst.jsdt.core.tests.formatter,
- org.eclipse.wst.jsdt.core.tests.formatter.comment,
- org.eclipse.wst.jsdt.core.tests.model,
- org.eclipse.wst.jsdt.core.tests.rewrite.describing,
- org.eclipse.wst.jsdt.core.tests.rewrite.modifying
-Import-Package: com.ibm.icu.text; version="3.8",
- com.ibm.icu.util; version="3.8"
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.junit;bundle-version=3.8.2,
- org.eclipse.wst.jsdt.core.tests.compiler,
- org.eclipse.team.core,
- org.eclipse.text,
- org.eclipse.wst.jsdt.core
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/eclipse.inf b/tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/eclipse.inf
deleted file mode 100644
index fdcf47e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/eclipse.inf
+++ /dev/null
@@ -1,6 +0,0 @@
-# We do not want any nested jars
-# signed or normalized for packing
-# see bug 274743 Some unit tests are sensitive to details of build
-# https://bugs.eclipse.org/bugs/show_bug.cgi?id=274743
-
-jarprocessor.exclude.children=true \ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/about.html b/tests/org.eclipse.wst.jsdt.core.tests.model/about.html
deleted file mode 100644
index 4602330..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/build.properties b/tests/org.eclipse.wst.jsdt.core.tests.model/build.properties
deleted file mode 100644
index fe0e4e9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.xml,\
- workspace/,\
- .,\
- test.xml,\
- plugin.properties,\
- META-INF/,\
- about.html
-source.. = src/
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/plugin.properties b/tests/org.eclipse.wst.jsdt.core.tests.model/plugin.properties
deleted file mode 100644
index 5167a7e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/plugin.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2008 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-pluginName=JSDT Tests - Model
-providerName=Eclipse.org
-
-JsGlobalScopeVariableInitializer.deprecated.0 = Test deprecated flag
-JsGlobalScopeVariableInitializer.deprecated.1 = A deprecated and read-only initializer
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/plugin.xml b/tests/org.eclipse.wst.jsdt.core.tests.model/plugin.xml
deleted file mode 100644
index 18bd40e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/plugin.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <!-- Classpath variable initializer -->
- <extension point = "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer">
- <JsGlobalScopeVariableInitializer
- variable="TEST_LIB"
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"/>
- <JsGlobalScopeVariableInitializer
- variable="TEST_SRC"
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"/>
- <JsGlobalScopeVariableInitializer
- variable="TEST_ROOT"
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"/>
- <JsGlobalScopeVariableInitializer
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"
- deprecated="%JsGlobalScopeVariableInitializer.deprecated.0"
- variable="TEST_DEPRECATED">
- </JsGlobalScopeVariableInitializer>
- <JsGlobalScopeVariableInitializer
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"
- readOnly="true"
- variable="TEST_READ_ONLY">
- </JsGlobalScopeVariableInitializer>
- <JsGlobalScopeVariableInitializer
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"
- deprecated="%JsGlobalScopeVariableInitializer.deprecated.1"
- readOnly="true"
- variable="TEST_DEPRECATED_READ_ONLY">
- </JsGlobalScopeVariableInitializer>
- </extension>
-
- <!-- Classpath container initializer -->
- <extension point = "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
- <JsGlobalScopeContainerInitializer
- id="org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"
- class="org.eclipse.wst.jsdt.core.tests.model.ContainerInitializer"/>
- </extension>
-
- <!-- Extra JavaScript-like file extensions -->
- <extension point="org.eclipse.core.contenttype.contentTypes">
- <file-association
- content-type="org.eclipse.wst.jsdt.core.javaSource"
- file-extensions="foo,bar"/>
- </extension>
-
- <!-- Repository provider -->
- <extension point="org.eclipse.team.core.repository">
- <repository
- id="org.eclipse.wst.jsdt.core.tests.model.pessimisticnature"
- class="org.eclipse.wst.jsdt.core.tests.model.TestPessimisticProvider">
- </repository>;
- </extension>
-
- <!-- Compilation participant -->
- <extension point="org.eclipse.wst.jsdt.core.validationParticipant">
- <validationParticipant
- class="org.eclipse.wst.jsdt.core.tests.model.TestvalidationParticipant"
- createsProblems="true"
- id="org.eclipse.wst.jsdt.core.tests.model.validationParticipant"
- requiredSourceLevel="1.4"
- modifiesEnvironment="true">
- <requires id="non.existing"/>
- </validationParticipant>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunCompilerTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunCompilerTests.java
deleted file mode 100644
index faae149..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunCompilerTests.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Runs all compiler tests (including parser tests) See AbstractCompilerTests
- * for more details.
- */
-public class RunCompilerTests extends TestCase {
-
- public RunCompilerTests(String name) {
- super(name);
- }
-
- public static Class[] getAllTestClasses() {
- return new Class[] {
- org.eclipse.wst.jsdt.core.tests.compiler.regression.TestAll.class,
- org.eclipse.wst.jsdt.core.tests.compiler.parser.TestAll.class };
- }
-
- public static Test suite() {
- TestSuite ts = new TestSuite(RunCompilerTests.class.getName());
-
- Class[] testClasses = getAllTestClasses();
- for (int i = 0; i < testClasses.length; i++) {
- Class testClass = testClasses[i];
-
- // call the suite() method and add the resulting suite to the suite
- try {
- Method suiteMethod = testClass.getDeclaredMethod(
- "suite", new Class[0]); //$NON-NLS-1$
- Test suite = (Test) suiteMethod.invoke(null, new Object[0]);
- ts.addTest(suite);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- return ts;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunDOMTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunDOMTests.java
deleted file mode 100644
index 7358ecf..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunDOMTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.dom.RunAllTests;
-
-/**
- * Runs all DOM AST tests.
- */
-public class RunDOMTests extends TestCase {
-
-public RunDOMTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = new TestSuite(RunDOMTests.class.getName());
- suite.addTest(RunAllTests.suite());
- return suite;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunFormatterTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunFormatterTests.java
deleted file mode 100644
index 88afcb4..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunFormatterTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.formatter.comment.CommentsTestSuite;
-
-/**
- * Runs all formatter tests.
- */
-public class RunFormatterTests extends TestCase {
-
- public static Class[] getAllTestClasses() {
- return new Class[] {
- //FormatterRegressionTests.class,
- CommentsTestSuite.class,
- };
- }
- public static Test suite() {
- TestSuite ts = new TestSuite(RunFormatterTests.class.getName());
-
- Class[] testClasses = getAllTestClasses();
- for (int i = 0; i < testClasses.length; i++) {
- Class testClass = testClasses[i];
-
- // call the suite() method and add the resulting suite to the suite
- try {
- Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
- Test suite = (Test)suiteMethod.invoke(null, new Object[0]);
- ts.addTest(suite);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- return ts;
- }
-
-public RunFormatterTests(String name) {
- super(name);
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunJSDTCoreTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunJSDTCoreTests.java
deleted file mode 100644
index 309911f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunJSDTCoreTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.utils.SequenceReaderTests;
-
-/**
- * Runs all JDT Core tests.
- */
-public class RunJSDTCoreTests extends TestCase {
-public RunJSDTCoreTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = new TestSuite("JSDT 'Model' Tests");
- suite.addTest(RunDOMTests.suite());
- suite.addTest(RunFormatterTests.suite());
- suite.addTest(RunModelTests.suite());
- suite.addTestSuite(SequenceReaderTests.class);
- return suite;
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunModelTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunModelTests.java
deleted file mode 100644
index 1f53b8e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunModelTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.model.JSDTModelTests;
-
-/**
- * Runs all Java model tests.
- */
-public class RunModelTests extends TestCase {
-public RunModelTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = new TestSuite(RunModelTests.class.getName());
- suite.addTest(JSDTModelTests.suite());
- return suite;
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterAST3Test.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterAST3Test.java
deleted file mode 100644
index 2e407ba..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterAST3Test.java
+++ /dev/null
@@ -1,9467 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
-import org.eclipse.wst.jsdt.core.dom.TryStatement;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.WhileStatement;
-import org.eclipse.wst.jsdt.core.util.IModifierConstants;
-
-public class ASTConverterAST3Test extends ConverterTestSetup {
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS3);
- }
-
- public ASTConverterAST3Test(String name) {
- super(name);
- }
-
- static {
- }
-
- public static Test suite() {
- return buildModelTestSuite(ASTConverterAST3Test.class);
- }
-
- public void test0001() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0001", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
-
- // check that we have the right tree
- JavaScriptUnit unit = this.ast.newJavaScriptUnit();
- FunctionDeclaration methodDeclaration = this.ast.newFunctionDeclaration();
- methodDeclaration.setConstructor(false);
- methodDeclaration.setName(this.ast.newSimpleName("main"));//$NON-NLS-1$
- SingleVariableDeclaration variableDeclaration = this.ast.newSingleVariableDeclaration();
- variableDeclaration.setName(this.ast.newSimpleName("args"));//$NON-NLS-1$
- methodDeclaration.parameters().add(variableDeclaration);
- org.eclipse.wst.jsdt.core.dom.Block block = this.ast.newBlock();
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- methodInvocation.setName(this.ast.newSimpleName("print")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("Hello");//$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();
- literal.setLiteralValue(" world");//$NON-NLS-1$
- infixExpression.setRightOperand(literal);//$NON-NLS-1$
- methodInvocation.arguments().add(infixExpression);
- ExpressionStatement expressionStatement = this.ast.newExpressionStatement(methodInvocation);
- block.statements().add(expressionStatement);
- methodDeclaration.setBody(block);
- assertTrue("Both AST trees should be identical", result.subtreeMatch(new ASTMatcher(), unit));//$NON-NLS-1$
- String expected =
- "function main(args) {\n" +
- " print(\"Hello\" + \" world\");\n" +
- "}";
- checkSourceRange(result, expected, source);
- }
-
- /**
- * Test allocation expression: new Object() ==> ClassInstanceCreation
- */
- public void test0002() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0002", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
- classInstanceCreation.setType(this.ast.newSimpleType(this.ast.newSimpleName("Object"))); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new Object()", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new java.lang.Object() ==> ClassInstanceCreation
- */
- public void test0003() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0003", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newQualifiedName(
- this.ast.newSimpleName("java"), //$NON-NLS-1$
- this.ast.newSimpleName("lang")), //$NON-NLS-1$
- this.ast.newSimpleName("Object"));//$NON-NLS-1$
- classInstanceCreation.setType(this.ast.newSimpleType(name));
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new java.lang.Object()", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new java.lang.Exception("ERROR") ==> ClassInstanceCreation
- */
- public void test0004() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0004", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newQualifiedName(
- this.ast.newSimpleName("java"), //$NON-NLS-1$
- this.ast.newSimpleName("lang")), //$NON-NLS-1$
- this.ast.newSimpleName("Exception"));//$NON-NLS-1$
- classInstanceCreation.setType(this.ast.newSimpleType(name));
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("ERROR"); //$NON-NLS-1$
- classInstanceCreation.arguments().add(literal);
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new java.lang.Exception(\"ERROR\")", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new java.lang.Object() {} ==> ClassInstanceCreation
- */
- public void test0005() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0005", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newQualifiedName(
- this.ast.newSimpleName("java"), //$NON-NLS-1$
- this.ast.newSimpleName("lang")), //$NON-NLS-1$
- this.ast.newSimpleName("Object"));//$NON-NLS-1$
- classInstanceCreation.setType(this.ast.newSimpleType(name));
- AnonymousClassDeclaration anonymousClassDeclaration = this.ast.newAnonymousClassDeclaration();
- classInstanceCreation.setAnonymousClassDeclaration(anonymousClassDeclaration);
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new java.lang.Object() {}", source); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation2 = (ClassInstanceCreation) expression;
- Type type = classInstanceCreation2.getType();
- checkSourceRange(type, "java.lang.Object", source); //$NON-NLS-1$
- }
-
-
- /**
- * Test allocation expression: new java.lang.Runnable() { public void run() {}} ==> ClassInstanceCreation
- */
- public void test0006() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0006", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newQualifiedName(
- this.ast.newSimpleName("java"), //$NON-NLS-1$
- this.ast.newSimpleName("lang")), //$NON-NLS-1$
- this.ast.newSimpleName("Runnable"));//$NON-NLS-1$
- classInstanceCreation.setType(this.ast.newSimpleType(name));
- FunctionDeclaration methodDeclaration = this.ast.newFunctionDeclaration();
- methodDeclaration.setBody(this.ast.newBlock());
- methodDeclaration.setConstructor(false);
- methodDeclaration.modifiers().add(this.ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
- methodDeclaration.setName(this.ast.newSimpleName("run"));//$NON-NLS-1$
- methodDeclaration.setReturnType2(this.ast.newPrimitiveType(PrimitiveType.VOID));
- AnonymousClassDeclaration anonymousClassDeclaration = this.ast.newAnonymousClassDeclaration();
- anonymousClassDeclaration.bodyDeclarations().add(methodDeclaration);
- classInstanceCreation.setAnonymousClassDeclaration(anonymousClassDeclaration);
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new java.lang.Runnable() { public void run() {}}", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new Test().new D() ==> ClassInstanceCreation
- */
- public void test0007() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0007", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- ASTNode expression = (ASTNode) ((FunctionInvocation) expressionStatement.getExpression()).arguments().get(0);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
- classInstanceCreation.setType(this.ast.newSimpleType(this.ast.newSimpleName("D"))); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreationExpression = this.ast.newClassInstanceCreation();
- classInstanceCreationExpression.setType(this.ast.newSimpleType(this.ast.newSimpleName("Test"))); //$NON-NLS-1$
- classInstanceCreation.setExpression(classInstanceCreationExpression);
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new Test().new D()", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new int[] {1, 2, 3, 4} ==> ArrayCreation
- */
- public void test0008() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0008", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ArrayCreation arrayCreation = this.ast.newArrayCreation();
- arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 1));
- ArrayInitializer arrayInitializer = this.ast.newArrayInitializer();
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("3"));//$NON-NLS-1$
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
- arrayCreation.setInitializer(arrayInitializer);
- assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new int[] {1, 2, 3, 4}", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new int[][] {{1}, {2}} ==> ArrayCreation
- */
- public void test0009() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0009", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ArrayCreation arrayCreation = this.ast.newArrayCreation();
- arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 2));
- ArrayInitializer arrayInitializer = this.ast.newArrayInitializer();
- ArrayInitializer innerArrayInitializer = this.ast.newArrayInitializer();
- innerArrayInitializer.expressions().add(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- arrayInitializer.expressions().add(innerArrayInitializer);
- innerArrayInitializer = this.ast.newArrayInitializer();
- innerArrayInitializer.expressions().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- arrayInitializer.expressions().add(innerArrayInitializer);
- arrayCreation.setInitializer(arrayInitializer);
- assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new int[][] {{1}, {2}}", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new int[3] ==> ArrayCreation
- */
- public void test0010() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0010", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ArrayCreation arrayCreation = this.ast.newArrayCreation();
- arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 1));
- arrayCreation.dimensions().add(this.ast.newNumberLiteral("3")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new int[3]", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new int[3][] ==> ArrayCreation
- */
- public void test0011() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0011", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ArrayCreation arrayCreation = this.ast.newArrayCreation();
- arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 2));
- arrayCreation.dimensions().add(this.ast.newNumberLiteral("3")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new int[3][]", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new int[][] {{},{}} ==> ArrayCreation
- */
- public void test0012() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0012", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ArrayCreation arrayCreation = this.ast.newArrayCreation();
- arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 2));
- ArrayInitializer arrayInitializer = this.ast.newArrayInitializer();
- ArrayInitializer innerArrayInitializer = this.ast.newArrayInitializer();
- arrayInitializer.expressions().add(innerArrayInitializer);
- innerArrayInitializer = this.ast.newArrayInitializer();
- arrayInitializer.expressions().add(innerArrayInitializer);
- arrayCreation.setInitializer(arrayInitializer);
- assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new int[][] {{}, {}}", source); //$NON-NLS-1$
- }
-
- /**
- * int i; ==> VariableDeclarationFragment
- */
- public void test0013() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0013", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int i;", source); //$NON-NLS-1$
- }
-
- /**
- * int i = 0; ==> VariableDeclarationFragment
- */
- public void test0014() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0014", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int i = 0;", source); //$NON-NLS-1$
- }
-
- /**
- * i = 1; ==> ExpressionStatement(Assignment)
- */
- public void test0015() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0015", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("1")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i = 1;", source); //$NON-NLS-1$
- }
-
- /**
- * i += 2; ==> ExpressionStatement(Assignment)
- */
- public void test0016() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0016", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.PLUS_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i += 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i -= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0017() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0017", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.MINUS_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i -= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i *= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0018() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0018", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.TIMES_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i *= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i /= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0019() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0019", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.DIVIDE_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i /= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i &= 2 ==> ExpressionStatement(Assignment)
- */
- public void test0020() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0020", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.BIT_AND_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i &= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i |= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0021() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0021", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.BIT_OR_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i |= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i ^= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0022() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0022", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.BIT_XOR_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i ^= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i %= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0023() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0023", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.REMAINDER_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i %= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i <<= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0024() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0024", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.LEFT_SHIFT_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i <<= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i >>= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0025() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0025", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i >>= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i >>>= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0026() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0026", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i >>>= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * --i; ==> ExpressionStatement(PrefixExpression)
- */
- public void test0027() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0027", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- prefixExpression.setOperator(PrefixExpression.Operator.DECREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(prefixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "--i;", source); //$NON-NLS-1$
- }
-
- /**
- * --i; ==> ExpressionStatement(PrefixExpression)
- */
- public void test0028() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0028", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- prefixExpression.setOperator(PrefixExpression.Operator.INCREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(prefixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "++i;", source); //$NON-NLS-1$
- }
-
- /**
- * i--; ==> ExpressionStatement(PostfixExpression)
- */
- public void test0029() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0029", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.DECREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(postfixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i--;", source); //$NON-NLS-1$
- }
-
- /**
- * i++; ==> ExpressionStatement(PostfixExpression)
- */
- public void test0030() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0030", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(postfixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i++;", source); //$NON-NLS-1$
- }
-
- /**
- * int.class; ==> ExpressionStatement(TypeLiteral)
- */
- public void test0038() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0038", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
- TypeLiteral typeLiteral = this.ast.newTypeLiteral();
- typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- variableDeclarationFragment.setInitializer(typeLiteral);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "int.class", source); //$NON-NLS-1$
- }
-
- /**
- * void.class; ==> ExpressionStatement(TypeLiteral)
- */
- public void test0039() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0039", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
- TypeLiteral typeLiteral = this.ast.newTypeLiteral();
- typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.VOID));
- variableDeclarationFragment.setInitializer(typeLiteral);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "void.class", source); //$NON-NLS-1$
- }
-
- /**
- * double.class; ==> ExpressionStatement(TypeLiteral)
- */
- public void test0040() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0040", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
- TypeLiteral typeLiteral = this.ast.newTypeLiteral();
- typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.DOUBLE));
- variableDeclarationFragment.setInitializer(typeLiteral);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "double.class", source); //$NON-NLS-1$
- }
-
- /**
- * long.class; ==> ExpressionStatement(TypeLiteral)
- */
- public void test0041() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0041", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
- TypeLiteral typeLiteral = this.ast.newTypeLiteral();
- typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.LONG));
- variableDeclarationFragment.setInitializer(typeLiteral);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "long.class", source); //$NON-NLS-1$
- }
-
- /**
- * false ==> BooleanLiteral
- */
- public void test0042() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0042", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- BooleanLiteral literal = this.ast.newBooleanLiteral(false);
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "false", source); //$NON-NLS-1$
- }
-
- /**
- * true ==> BooleanLiteral
- */
- public void test0043() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0043", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- BooleanLiteral literal = this.ast.newBooleanLiteral(true);
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "true", source); //$NON-NLS-1$
- }
-
- /**
- * null ==> NullLiteral
- */
- public void test0044() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0044", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NullLiteral literal = this.ast.newNullLiteral();
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "null", source); //$NON-NLS-1$
- }
-
- /**
- * CharLiteral ==> CharacterLiteral
- */
- public void test0045() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0045", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- CharacterLiteral literal = this.ast.newCharacterLiteral();
- literal.setEscapedValue("'c'"); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "'c'", source); //$NON-NLS-1$
- }
-
- /**
- * DoubleLiteral ==> NumberLiteral
- */
- public void test0046() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0046", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("1.00001");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "1.00001", source); //$NON-NLS-1$
- }
-
- /**
- * FloatLiteral ==> NumberLiteral
- */
- public void test0047() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0047", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("1.00001f");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "1.00001f", source); //$NON-NLS-1$
- }
-
- /**
- * IntLiteral ==> NumberLiteral
- */
- public void test0048() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0048", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("30000");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "30000", source); //$NON-NLS-1$
- }
-
- /**
- * IntLiteralMinValue ==> NumberLiteral
- */
- public void test0049() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0049", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("-2147483648");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "-2147483648", source); //$NON-NLS-1$
- }
-
- /**
- * LongLiteral ==> NumberLiteral
- */
- public void test0050() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0050", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("2147483648L");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "2147483648L", source); //$NON-NLS-1$
- }
-
- /**
- * LongLiteral ==> NumberLiteral (negative value)
- */
- public void test0051() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0051", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("2147483648L");//$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(literal);
- prefixExpression.setOperator(PrefixExpression.Operator.MINUS);
- assertTrue("Both AST trees should be identical", prefixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "-2147483648L", source); //$NON-NLS-1$
- }
-
- /**
- * LongLiteralMinValue ==> NumberLiteral
- */
- public void test0052() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0052", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("-9223372036854775808L");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "-9223372036854775808L", source); //$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0053() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0053", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- /*
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello World");*/
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("Hello");//$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();
- literal.setLiteralValue(" World");//$NON-NLS-1$
- infixExpression.setRightOperand(literal);//$NON-NLS-1$
-
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\"", source); //$NON-NLS-1$
- }
-
- /**
- * AND_AND_Expression ==> InfixExpression
- */
- public void test0054() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0054", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b3")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_AND);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b3 = b && b2;", source); //$NON-NLS-1$
- }
-
- /**
- * OR_OR_Expression ==> InfixExpression
- */
- public void test0055() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0055", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b3")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_OR);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b3 = b || b2;", source); //$NON-NLS-1$
- }
-
- /**
- * EqualExpression ==> InfixExpression
- */
- public void test0056() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0056", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b3")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b3 = b == b2;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (+) ==> InfixExpression
- */
- public void test0057() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0057", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i + j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (-) ==> InfixExpression
- */
- public void test0058() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0058", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i - j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (*) ==> InfixExpression
- */
- public void test0059() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0059", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.TIMES);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i * j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (/) ==> InfixExpression
- */
- public void test0060() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0060", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.DIVIDE);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i / j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (%) ==> InfixExpression
- */
- public void test0061() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0061", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.REMAINDER);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i % j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (^) ==> InfixExpression
- */
- public void test0062() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0062", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.XOR);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i ^ j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (&) ==> InfixExpression
- */
- public void test0063() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0063", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.AND);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i & j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (|) ==> InfixExpression
- */
- public void test0064() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0064", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.OR);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = i | j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (<) ==> InfixExpression
- */
- public void test0065() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0065", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b2 = b < b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (<=) ==> InfixExpression
- */
- public void test0066() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0066", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS_EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b2 = b <= b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (>) ==> InfixExpression
- */
- public void test0067() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0067", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.GREATER);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b2 = b > b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (>=) ==> InfixExpression
- */
- public void test0068() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0068", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.GREATER_EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b2 = b >= b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (!=) ==> InfixExpression
- */
- public void test0069() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0069", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.NOT_EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b2 = b != b1;", source); //$NON-NLS-1$
- }
-
- /**
- * InstanceofExpression ==> InfixExpression
- */
- public void test0070() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0070", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b")); //$NON-NLS-1$
- InstanceofExpression instanceOfExpression = this.ast.newInstanceofExpression();
- instanceOfExpression.setLeftOperand(this.ast.newSimpleName("o"));//$NON-NLS-1$
- SimpleType simpleType = this.ast.newSimpleType(this.ast.newSimpleName("Integer"));//$NON-NLS-1$
- instanceOfExpression.setRightOperand(simpleType);
- variableDeclarationFragment.setInitializer(instanceOfExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b = o instanceof Integer;", source); //$NON-NLS-1$
- }
-
- /**
- * InstanceofExpression ==> InfixExpression
- */
- public void test0071() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0071", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b")); //$NON-NLS-1$
- InstanceofExpression instanceOfExpression = this.ast.newInstanceofExpression();
- instanceOfExpression.setLeftOperand(this.ast.newSimpleName("o")); //$NON-NLS-1$
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newQualifiedName(
- this.ast.newSimpleName("java"), //$NON-NLS-1$
- this.ast.newSimpleName("lang")), //$NON-NLS-1$
- this.ast.newSimpleName("Integer")); //$NON-NLS-1$
- Type type = ast.newSimpleType(name);
- instanceOfExpression.setRightOperand(type);
- variableDeclarationFragment.setInitializer(instanceOfExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b = o instanceof java.lang.Integer;", source); //$NON-NLS-1$
- }
-
- /**
- * UnaryExpression (!) ==> PrefixExpression
- */
- public void test0072() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0072", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.NOT);
- prefixExpression.setOperand(this.ast.newSimpleName("b"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b1 = !b;", source); //$NON-NLS-1$
- }
-
- /**
- * UnaryExpression (~) ==> PrefixExpression
- */
- public void test0073() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0073", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.COMPLEMENT);
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int n = ~i;", source); //$NON-NLS-1$
- }
-
- /**
- * UnaryExpression (+) ==> PrefixExpression
- */
- public void test0074() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0074", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.PLUS);
- prefixExpression.setOperand(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int i = +2;", source); //$NON-NLS-1$
- }
-
- /**
- * UnaryExpression (-) ==> PrefixExpression
- */
- public void test0075() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0075", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.MINUS);
- prefixExpression.setOperand(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int i = -2;", source); //$NON-NLS-1$
- }
-
- /**
- * ConditionalExpression ==> ConditionalExpression
- */
- public void test0076() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0076", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b")); //$NON-NLS-1$
- ConditionalExpression conditionalExpression = this.ast.newConditionalExpression();
- InfixExpression condition = this.ast.newInfixExpression();
- condition.setLeftOperand(this.ast.newSimpleName("args")); //$NON-NLS-1$
- condition.setRightOperand(this.ast.newNullLiteral()); //$NON-NLS-1$
- condition.setOperator(InfixExpression.Operator.NOT_EQUALS);
- conditionalExpression.setExpression(condition);
- conditionalExpression.setThenExpression(this.ast.newBooleanLiteral(true));
- conditionalExpression.setElseExpression(this.ast.newBooleanLiteral(false));
- variableDeclarationFragment.setInitializer(conditionalExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "boolean b = args != null ? true : false;", source); //$NON-NLS-1$
- }
-
- /**
- * ConditionalExpression ==> ConditionalExpression
- */
- public void test0077() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0077", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- ConditionalExpression conditionalExpression = this.ast.newConditionalExpression();
- conditionalExpression.setExpression(this.ast.newBooleanLiteral(true));
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newSimpleName("args"), //$NON-NLS-1$
- this.ast.newSimpleName("length")); //$NON-NLS-1$
- conditionalExpression.setThenExpression(name);
- conditionalExpression.setElseExpression(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(conditionalExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int i = true ? args.length: 0;", source); //$NON-NLS-1$
- }
-
- /**
- * MessageSend ==> SuperMethodInvocation
- */
- public void test0078() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0078", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- SuperMethodInvocation superMethodInvocation = this.ast.newSuperMethodInvocation();
- superMethodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(superMethodInvocation);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "super.bar();", source); //$NON-NLS-1$
- }
-
- /**
- * MessageSend ==> SuperMethodInvocation
- */
- public void test0079() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0079", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- SuperMethodInvocation superMethodInvocation = this.ast.newSuperMethodInvocation();
- superMethodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
- superMethodInvocation.arguments().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(superMethodInvocation);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "super.bar(4);", source); //$NON-NLS-1$
- }
-
- /**
- * MessageSend ==> FunctionInvocation
- */
- public void test0080() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0080", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- methodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
- methodInvocation.arguments().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(methodInvocation);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "bar(4);", source); //$NON-NLS-1$
- }
-
- /**
- * MessageSend ==> FunctionInvocation
- */
- public void test0081() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0081", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- methodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
- methodInvocation.setExpression(this.ast.newThisExpression());
- methodInvocation.arguments().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(methodInvocation);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "this.bar(4);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0082() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0082", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (;;);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0083() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0083", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newBlock());
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (int i = 0; i < 10; i++) {}", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0084() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0084", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
-
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (int i = 0; i < 10; i++);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0085() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0085", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
-
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (int i = 0;; i++);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0086() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0086", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (; i < 10; i++);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0087() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0087", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (;;i++);", source); //$NON-NLS-1$
- }
-
- /**
- * LocalDeclaration ==> VariableDeclarationStatement
- */
- public void test0088() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0088", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
-
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int i;", source); //$NON-NLS-1$
- }
-
- /**
- * LocalDeclaration ==> VariableDeclarationStatement
- */
- public void test0089() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0089", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
-
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newQualifiedName(
- this.ast.newSimpleName("java"),//$NON-NLS-1$
- this.ast.newSimpleName("lang")//$NON-NLS-1$
- ),
- this.ast.newSimpleName("String") //$NON-NLS-1$
- );
- statement.setType(this.ast.newSimpleType(name));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "java.lang.String s;", source); //$NON-NLS-1$
- }
-
- /**
- * LocalDeclaration ==> VariableDeclarationStatement
- */
- public void test0090() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0090", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- ArrayInitializer initializer = this.ast.newArrayInitializer();
- initializer.expressions().add(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- initializer.expressions().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(initializer);
- variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
-
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 1));
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int[] tab = {1, 2};", source); //$NON-NLS-1$
- }
-
- /**
- * Argument ==> SingleVariableDeclaration
- */
- public void test0091() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0091", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- FunctionDeclaration method = (FunctionDeclaration)((TypeDeclaration) ((JavaScriptUnit) result).types().get(0)).bodyDeclarations().get(0);
- SingleVariableDeclaration node = (SingleVariableDeclaration) method.parameters().get(0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- SingleVariableDeclaration variableDeclaration = this.ast.newSingleVariableDeclaration();
- variableDeclaration.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
- variableDeclaration.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", variableDeclaration.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "String s", source); //$NON-NLS-1$
- }
-
- /**
- * Argument ==> SingleVariableDeclaration
- */
- public void test0092() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0092", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- FunctionDeclaration method = (FunctionDeclaration)((TypeDeclaration) ((JavaScriptUnit) result).types().get(0)).bodyDeclarations().get(0);
- SingleVariableDeclaration node = (SingleVariableDeclaration) method.parameters().get(0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- SingleVariableDeclaration variableDeclaration = this.ast.newSingleVariableDeclaration();
- variableDeclaration.modifiers().add(this.ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
- variableDeclaration.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
- variableDeclaration.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", variableDeclaration.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "final String s", source); //$NON-NLS-1$
- assertEquals("Wrong dimension", 0, node.getExtraDimensions()); //$NON-NLS-1$
- }
-
- /**
- * Break ==> BreakStatement
- */
- public void test0093() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0093", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) node;
- BreakStatement statement = (BreakStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- BreakStatement breakStatement = this.ast.newBreakStatement();
- assertTrue("Both AST trees should be identical", breakStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "break;", source); //$NON-NLS-1$
- }
-
- /**
- * Continue ==> ContinueStatement
- */
- public void test0094() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0094", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) node;
- ContinueStatement statement = (ContinueStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- ContinueStatement continueStatement = this.ast.newContinueStatement();
- assertTrue("Both AST trees should be identical", continueStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "continue;", source); //$NON-NLS-1$
- }
-
- /**
- * Continue with Label ==> ContinueStatement
- */
- public void test0095() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0095", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- ContinueStatement statement = (ContinueStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- ContinueStatement continueStatement = this.ast.newContinueStatement();
- continueStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", continueStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "continue label;", source); //$NON-NLS-1$
- }
-
- /**
- * Break + label ==> BreakStatement
- */
- public void test0096() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0096", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- BreakStatement statement = (BreakStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- BreakStatement breakStatement = this.ast.newBreakStatement();
- breakStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", breakStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "break label;", source); //$NON-NLS-1$
- }
-
- /**
- * SwitchStatement ==> SwitchStatement
- */
- public void test0097() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0097", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- SwitchStatement switchStatement = this.ast.newSwitchStatement();
- switchStatement.setExpression(this.ast.newSimpleName("i"));//$NON-NLS-1$
- SwitchCase _case = this.ast.newSwitchCase();
- _case.setExpression(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- switchStatement.statements().add(_case);
- switchStatement.statements().add(this.ast.newBreakStatement());
- _case = this.ast.newSwitchCase();
- _case.setExpression(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- switchStatement.statements().add(_case);
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newSimpleName("System"),//$NON-NLS-1$
- this.ast.newSimpleName("out"));//$NON-NLS-1$
- methodInvocation.setExpression(name);
- methodInvocation.setName(this.ast.newSimpleName("println")); //$NON-NLS-1$
- methodInvocation.arguments().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- ExpressionStatement expressionStatement = this.ast.newExpressionStatement(methodInvocation);
- switchStatement.statements().add(expressionStatement);
- switchStatement.statements().add(this.ast.newBreakStatement());
- _case = this.ast.newSwitchCase();
- _case.setExpression(null);
- switchStatement.statements().add(_case);
- methodInvocation = this.ast.newFunctionInvocation();
- name =
- this.ast.newQualifiedName(
- this.ast.newSimpleName("System"),//$NON-NLS-1$
- this.ast.newSimpleName("out"));//$NON-NLS-1$
- methodInvocation.setExpression(name);
- methodInvocation.setName(this.ast.newSimpleName("println")); //$NON-NLS-1$
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("default"); //$NON-NLS-1$
- methodInvocation.arguments().add(literal);
- expressionStatement = this.ast.newExpressionStatement(methodInvocation);
- switchStatement.statements().add(expressionStatement);
- assertTrue("Both AST trees should be identical", switchStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "switch(i) {\n" +//$NON-NLS-1$
- " case 1: \n" +//$NON-NLS-1$
- " break;\n" +//$NON-NLS-1$
- " case 2:\n" +//$NON-NLS-1$
- " System.out.println(2);\n" +//$NON-NLS-1$
- " break;\n" +//$NON-NLS-1$
- " default:\n" +//$NON-NLS-1$
- " System.out.println(\"default\");\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- SwitchStatement switchStatement2 = (SwitchStatement) node;
- List statements = switchStatement2.statements();
- assertEquals("wrong size", 7, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(5);
- assertTrue("Not a case statement", stmt instanceof SwitchCase); //$NON-NLS-1$
- SwitchCase switchCase = (SwitchCase) stmt;
- assertTrue("Not the default case", switchCase.isDefault()); //$NON-NLS-1$
- }
-
- /**
- * EmptyStatement ==> EmptyStatement
- */
- public void test0098() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0098", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- EmptyStatement emptyStatement = this.ast.newEmptyStatement();
- assertTrue("Both AST trees should be identical", emptyStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, ";", source); //$NON-NLS-1$
- }
-
- /**
- * DoStatement ==> DoStatement
- */
- public void test0099() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0099", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- DoStatement doStatement = this.ast.newDoStatement();
- Block block = this.ast.newBlock();
- block.statements().add(this.ast.newEmptyStatement());
- doStatement.setBody(block);
- doStatement.setExpression(this.ast.newBooleanLiteral(true));
- assertTrue("Both AST trees should be identical", doStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "do {;\n" +//$NON-NLS-1$
- " } while(true);";//$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * WhileStatement ==> WhileStatement
- */
- public void test0100() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0100", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- WhileStatement whileStatement = this.ast.newWhileStatement();
- whileStatement.setExpression(this.ast.newBooleanLiteral(true));
- whileStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", whileStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "while(true);", source);//$NON-NLS-1$
- }
-
- /**
- * WhileStatement ==> WhileStatement
- */
- public void test0101() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0101", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- WhileStatement whileStatement = this.ast.newWhileStatement();
- whileStatement.setExpression(this.ast.newBooleanLiteral(true));
- whileStatement.setBody(this.ast.newBlock());
- assertTrue("Both AST trees should be identical", whileStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "while(true) {}", source);//$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0102() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0102", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue(" World"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\" + \"!\"", source);//$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0103() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0103", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue(" World"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\" + \"!\" + \"!\"", source);//$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0104() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0104", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue(" World"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- NumberLiteral numberLiteral = this.ast.newNumberLiteral();//$NON-NLS-1$
- numberLiteral.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(numberLiteral);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\" + \"!\" + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0105() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0105", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "4 + 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0106() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0106", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
-
- InfixExpression infixExpression2 = this.ast.newInfixExpression();
- infixExpression2.setOperator(InfixExpression.Operator.PLUS);
- infixExpression2.setLeftOperand(infixExpression);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression2.setRightOperand(literal);
-
- InfixExpression infixExpression3 = this.ast.newInfixExpression();
- infixExpression3.setOperator(InfixExpression.Operator.PLUS);
- infixExpression3.setLeftOperand(infixExpression2);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression3.setRightOperand(literal);
-
- assertTrue("Both AST trees should be identical", infixExpression3.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "4 - 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0107() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0107", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "4 - 5 - 6 - 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0108() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0108", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral stringLiteral = this.ast.newStringLiteral();//$NON-NLS-1$
- stringLiteral.setLiteralValue("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(stringLiteral);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"4\" + 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0109() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0109", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- StringLiteral stringLiteral = this.ast.newStringLiteral();//$NON-NLS-1$
- stringLiteral.setLiteralValue("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(stringLiteral);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
-
- InfixExpression infixExpression2 = this.ast.newInfixExpression();
- infixExpression2.setOperator(InfixExpression.Operator.PLUS);
- infixExpression2.setLeftOperand(infixExpression);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression2.setRightOperand(literal);
-
- InfixExpression infixExpression3 = this.ast.newInfixExpression();
- infixExpression3.setOperator(InfixExpression.Operator.PLUS);
- infixExpression3.setLeftOperand(infixExpression2);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression3.setRightOperand(literal);
-
- assertTrue("Both AST trees should be identical", infixExpression3.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"4\" - 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * ReturnStatement ==> ReturnStatement
- */
- public void test0110() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0110", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- assertTrue("Both AST trees should be identical", returnStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "return 2;", source);//$NON-NLS-1$
- }
-
- /**
- * ReturnStatement ==> ReturnStatement
- */
- public void test0111() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0111", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- assertTrue("Both AST trees should be identical", returnStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "return 2\\u003B", source);//$NON-NLS-1$
- }
-
-
-
- /**
- * TryStatement ==> TryStatement
- */
- public void test0113() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0113", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- TryStatement tryStatement = this.ast.newTryStatement();
- tryStatement.setBody(this.ast.newBlock());
- tryStatement.setFinally(this.ast.newBlock());
- CatchClause catchBlock = this.ast.newCatchClause();
- catchBlock.setBody(this.ast.newBlock());
- SingleVariableDeclaration exceptionVariable = this.ast.newSingleVariableDeclaration();
- exceptionVariable.setName(this.ast.newSimpleName("e"));//$NON-NLS-1$
- exceptionVariable.setType(this.ast.newSimpleType(this.ast.newSimpleName("Exception")));//$NON-NLS-1$
- catchBlock.setException(exceptionVariable);
- tryStatement.catchClauses().add(catchBlock);
- assertTrue("Both AST trees should be identical", tryStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "try {\n" +//$NON-NLS-1$
- " } catch(Exception e) {\n" +//$NON-NLS-1$
- " } finally {\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * TryStatement ==> TryStatement
- */
- public void test0114() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0114", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- TryStatement tryStatement = this.ast.newTryStatement();
- tryStatement.setBody(this.ast.newBlock());
- CatchClause catchBlock = this.ast.newCatchClause();
- catchBlock.setBody(this.ast.newBlock());
- SingleVariableDeclaration exceptionVariable = this.ast.newSingleVariableDeclaration();
- exceptionVariable.setName(this.ast.newSimpleName("e"));//$NON-NLS-1$
- exceptionVariable.setType(this.ast.newSimpleType(this.ast.newSimpleName("Exception")));//$NON-NLS-1$
- catchBlock.setException(exceptionVariable);
- tryStatement.catchClauses().add(catchBlock);
- assertTrue("Both AST trees should be identical", tryStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "try {\n" +//$NON-NLS-1$
- " } catch(Exception e) {\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * TryStatement ==> TryStatement
- */
- public void test0115() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0115", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- TryStatement tryStatement = this.ast.newTryStatement();
- Block block = this.ast.newBlock();
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- block.statements().add(returnStatement);
- tryStatement.setBody(block);
- CatchClause catchBlock = this.ast.newCatchClause();
- catchBlock.setBody(this.ast.newBlock());
- SingleVariableDeclaration exceptionVariable = this.ast.newSingleVariableDeclaration();
- exceptionVariable.setName(this.ast.newSimpleName("e"));//$NON-NLS-1$
- exceptionVariable.setType(this.ast.newSimpleType(this.ast.newSimpleName("Exception")));//$NON-NLS-1$
- catchBlock.setException(exceptionVariable);
- tryStatement.catchClauses().add(catchBlock);
- assertTrue("Both AST trees should be identical", tryStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "try {\n" +//$NON-NLS-1$
- " return 2;\n" +//$NON-NLS-1$
- " } catch(Exception e) {\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * ThrowStatement ==> ThrowStatement
- */
- public void test0116() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0116", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ThrowStatement throwStatement = this.ast.newThrowStatement();
- throwStatement.setExpression(this.ast.newSimpleName("e")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", throwStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "throw e \\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * ThrowStatement ==> ThrowStatement
- */
- public void test0117() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0117", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ThrowStatement throwStatement = this.ast.newThrowStatement();
- throwStatement.setExpression(this.ast.newSimpleName("e")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", throwStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "throw e /* comment in the middle of a throw */ \\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * ThrowStatement ==> ThrowStatement
- */
- public void test0118() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0118", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ThrowStatement throwStatement = this.ast.newThrowStatement();
- throwStatement.setExpression(this.ast.newSimpleName("e")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", throwStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "throw e /* comment in the middle of a throw */ \\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0119() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0119", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ifStatement.setThenStatement(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "if (true)\\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0120() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0120", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ifStatement.setThenStatement(this.ast.newEmptyStatement());
- ifStatement.setElseStatement(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "if (true)\\u003B\n" +//$NON-NLS-1$
- "\t\telse ;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0121() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0121", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ifStatement.setThenStatement(this.ast.newBlock());
- ifStatement.setElseStatement(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "if (true) {}\n" +//$NON-NLS-1$
- " else ;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0122() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0122", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- ifStatement.setThenStatement(returnStatement);
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "if (true) return 2\\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0123() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0123", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- ifStatement.setThenStatement(returnStatement);
- returnStatement = this.ast.newReturnStatement();
- literal = this.ast.newNumberLiteral();
- literal.setToken("3");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- ifStatement.setElseStatement(returnStatement);
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "if (true) return 2;\n" +//$NON-NLS-1$
- " else return 3;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * Multiple local declaration => VariabledeclarationStatement
- */
- public void test0124() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0124", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("x"));//$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("10");//$NON-NLS-1$
- fragment.setInitializer(literal);
- fragment.setExtraDimensions(0);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("z"));//$NON-NLS-1$
- fragment.setInitializer(this.ast.newNullLiteral());
- fragment.setExtraDimensions(1);
- statement.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("i"));//$NON-NLS-1$
- fragment.setExtraDimensions(0);
- statement.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("j"));//$NON-NLS-1$
- fragment.setExtraDimensions(2);
- statement.fragments().add(fragment);
- statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- VariableDeclarationFragment[] fragments = (VariableDeclarationFragment[])((VariableDeclarationStatement) node).fragments().toArray(new VariableDeclarationFragment[4]);
- assertTrue("fragments.length != 4", fragments.length == 4); //$NON-NLS-1$
- checkSourceRange(fragments[0], "x= 10", source);//$NON-NLS-1$
- checkSourceRange(fragments[1], "z[] = null", source);//$NON-NLS-1$
- checkSourceRange(fragments[2], "i", source);//$NON-NLS-1$
- checkSourceRange(fragments[3], "j[][]", source);//$NON-NLS-1$
- checkSourceRange(node, "int x= 10, z[] = null, i, j[][];", source);//$NON-NLS-1$
- }
-
- /**
- * Multiple local declaration => VariabledeclarationStatement
- */
- public void test0125() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0125", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("x"));//$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("10");//$NON-NLS-1$
- fragment.setInitializer(literal);
- fragment.setExtraDimensions(0);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("z"));//$NON-NLS-1$
- fragment.setInitializer(this.ast.newNullLiteral());
- fragment.setExtraDimensions(1);
- statement.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("i"));//$NON-NLS-1$
- fragment.setExtraDimensions(0);
- statement.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("j"));//$NON-NLS-1$
- fragment.setExtraDimensions(2);
- statement.fragments().add(fragment);
- statement.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 1));
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int[] x= 10, z[] = null, i, j[][];", source); //$NON-NLS-1$
- VariableDeclarationFragment[] fragments = (VariableDeclarationFragment[])((VariableDeclarationStatement) node).fragments().toArray(new VariableDeclarationFragment[4]);
- assertTrue("fragments.length != 4", fragments.length == 4); //$NON-NLS-1$
- checkSourceRange(fragments[0], "x= 10", source);//$NON-NLS-1$
- checkSourceRange(fragments[1], "z[] = null", source);//$NON-NLS-1$
- checkSourceRange(fragments[2], "i", source);//$NON-NLS-1$
- checkSourceRange(fragments[3], "j[][]", source);//$NON-NLS-1$
- }
-
- /**
- * ForStatement
- */
- public void test0126() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0126", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNullLiteral());//$NON-NLS-1$
- variableDeclarationFragment.setExtraDimensions(1);
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setType(this.ast.newArrayType(this.ast.newSimpleType(this.ast.newSimpleName("String")), 1));//$NON-NLS-1$
- forStatement.initializers().add(variableDeclarationExpression);
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- prefixExpression.setOperator(PrefixExpression.Operator.INCREMENT);
- forStatement.updaters().add(prefixExpression);
- forStatement.setBody(this.ast.newBlock());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (String[] tab[] = null;; ++i) {}", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).updaters().get(0), "++i", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).initializers().get(0), "String[] tab[] = null", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement
- */
- public void test0127() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0127", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNullLiteral());//$NON-NLS-1$
- variableDeclarationFragment.setExtraDimensions(1);
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
- forStatement.initializers().add(variableDeclarationExpression);
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- prefixExpression.setOperator(PrefixExpression.Operator.INCREMENT);
- forStatement.updaters().add(prefixExpression);
- forStatement.setBody(this.ast.newBlock());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (String tab[] = null;; ++i) {}", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).updaters().get(0), "++i", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).initializers().get(0), "String tab[] = null", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement
- */
- public void test0128() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0128", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNullLiteral());//$NON-NLS-1$
- variableDeclarationFragment.setExtraDimensions(1);
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newBlock());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (String tab[] = null;; i++/**/) {}", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).updaters().get(0), "i++", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).initializers().get(0), "String tab[] = null", source); //$NON-NLS-1$
- }
-
- /**
- * FieldDeclaration
- */
- public void test0129() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0129", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- VariableDeclarationFragment frag = (VariableDeclarationFragment) ((FieldDeclaration) node).fragments().get(0);
- assertTrue("Not a declaration", frag.getName().isDeclaration()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- fragment.setExtraDimensions(0);
- FieldDeclaration fieldDeclaration = this.ast.newFieldDeclaration(fragment);
- fieldDeclaration.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- assertTrue("Both AST trees should be identical", fieldDeclaration.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "int i;", source); //$NON-NLS-1$
- }
-
- /**
- * FieldDeclaration
- */
- public void test0130() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0130", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("x")); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("10"); //$NON-NLS-1$
- fragment.setInitializer(literal);
- fragment.setExtraDimensions(0);
- FieldDeclaration fieldDeclaration = this.ast.newFieldDeclaration(fragment);
- fieldDeclaration.modifiers().add(this.ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
- fieldDeclaration.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("y"));//$NON-NLS-1$
- fragment.setExtraDimensions(1);
- fragment.setInitializer(this.ast.newNullLiteral());
- fieldDeclaration.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("i"));//$NON-NLS-1$
- fragment.setExtraDimensions(0);
- fieldDeclaration.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("j"));//$NON-NLS-1$
- fragment.setExtraDimensions(2);
- fieldDeclaration.fragments().add(fragment);
- assertTrue("Both AST trees should be identical", fieldDeclaration.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "public int x= 10, y[] = null, i, j[][];", source); //$NON-NLS-1$
- VariableDeclarationFragment[] fragments = (VariableDeclarationFragment[])((FieldDeclaration) node).fragments().toArray(new VariableDeclarationFragment[4]);
- assertTrue("fragments.length != 4", fragments.length == 4); //$NON-NLS-1$
- checkSourceRange(fragments[0], "x= 10", source);//$NON-NLS-1$
- checkSourceRange(fragments[1], "y[] = null", source);//$NON-NLS-1$
- checkSourceRange(fragments[2], "i", source);//$NON-NLS-1$
- checkSourceRange(fragments[3], "j[][]", source);//$NON-NLS-1$
- }
-
- /**
- * Argument with final modifier
- */
- public void test0131() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0131", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- assertTrue("Not a declaration", ((FunctionDeclaration) node).getName().isDeclaration()); //$NON-NLS-1$
- List parameters = ((FunctionDeclaration) node).parameters();
- assertTrue("Parameters.length != 1", parameters.size() == 1); //$NON-NLS-1$
- SingleVariableDeclaration arg = (SingleVariableDeclaration) ((FunctionDeclaration) node).parameters().get(0);
- SingleVariableDeclaration singleVariableDeclaration = this.ast.newSingleVariableDeclaration();
- singleVariableDeclaration.modifiers().add(this.ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
- singleVariableDeclaration.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- singleVariableDeclaration.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- assertTrue("Both AST trees should be identical", singleVariableDeclaration.subtreeMatch(new ASTMatcher(), arg)); //$NON-NLS-1$
- checkSourceRange(node, "void foo(final int i) {}", source); //$NON-NLS-1$
- checkSourceRange(arg, "final int i", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0132() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0132", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- checkSourceRange(node, "/** JavaDoc Comment*/\n void foo(final int i) {}", source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0133() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0133", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "void foo(final int i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0134() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0134", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "void foo(final int i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FieldDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0135() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0135", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((FieldDeclaration) node).getJavadoc();
- checkSourceRange(node, "/** JavaDoc Comment*/\n int i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FieldDeclaration
- */
- public void test0136() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0136", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FieldDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "int i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FieldDeclaration
- */
- public void test0137() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0137", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FieldDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "int i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for TypeDeclaration
- */
- public void test0138() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0138", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- String expectedContents = "public class Test {\n" +//$NON-NLS-1$
- " int i;\n" +//$NON-NLS-1$
- "}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for TypeDeclaration
- */
- public void test0139() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0139", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- String expectedContents = "public class Test {\n" +//$NON-NLS-1$
- " int i;\n" +//$NON-NLS-1$
- "}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for TypeDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0140() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0140", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- "public class Test {\n" +//$NON-NLS-1$
- " int i;\n" +//$NON-NLS-1$
- "}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0141() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0141", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- " class B {}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- */
- public void test0142() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0142", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "class B {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- */
- public void test0143() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0143", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- */
- public void test0144() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0144", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
- }
-
- /**
- * Checking initializers
- */
- public void test0145() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0145", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- checkSourceRange(node, "{}", source); //$NON-NLS-1$
- }
-
- /**
- * Checking initializers
- */
- public void test0146() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0146", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- checkSourceRange(node, "static {}", source); //$NON-NLS-1$
- }
-
- /**
- * Checking initializers
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0147() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0147", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- JSdoc actualJavadoc = ((Initializer) node).getJavadoc();
- assertNotNull("Javadoc comment should no be null", actualJavadoc); //$NON-NLS-1$
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- " static {}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-
- }
-
- /**
- * Checking initializers
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0148() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0148", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- JSdoc actualJavadoc = ((Initializer) node).getJavadoc();
- assertNotNull("Javadoc comment should not be null", actualJavadoc); //$NON-NLS-1$
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- " {}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-
- }
-
- /**
- * Checking initializers
- */
- public void test0149() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0149", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- JSdoc actualJavadoc = ((Initializer) node).getJavadoc();
- assertNull("Javadoc comment should be null", actualJavadoc); //$NON-NLS-1$
- checkSourceRange(node, "{}", source); //$NON-NLS-1$
- }
-
- /**
- * Checking syntax error
- */
- public void test0150() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0150", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertTrue("The compilation unit is malformed", !isMalformed(unit)); //$NON-NLS-1$
- assertTrue("The package declaration is not malformed", isMalformed(unit.getPackage())); //$NON-NLS-1$
- List imports = unit.imports();
- assertTrue("The imports list size is not one", imports.size() == 1); //$NON-NLS-1$
- assertTrue("The first import is malformed", !isMalformed((ASTNode) imports.get(0))); //$NON-NLS-1$
- }
-
- /**
- * Checking syntax error
- */
- public void test0151() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0151", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
- }
-
- /**
- * Checking syntax error
- */
- public void test0152() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0152", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The type is malformed", !isMalformed(node)); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The field is not malformed", isMalformed(node)); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The method is not malformed", isMalformed(node)); //$NON-NLS-1$
- }
-
- /**
- * Checking syntax error
- */
- public void test0153() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0153", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The method is not original", isOriginal(node)); //$NON-NLS-1$
- assertTrue("The method is not malformed", isMalformed(node)); //$NON-NLS-1$
- }
-
- /**
- * Checking binding of package declaration
- */
- public void test0154() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0154", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- IBinding binding = compilationUnit.getPackage().getName().resolveBinding();
- assertNotNull("The package binding is null", binding); //$NON-NLS-1$
- assertTrue("The binding is not a package binding", binding instanceof IPackageBinding); //$NON-NLS-1$
- IPackageBinding packageBinding = (IPackageBinding) binding;
- assertEquals("The package name is incorrect", "test0154", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = compilationUnit.getPackage().getName().resolveBinding();
- assertTrue("The package binding is not canonical", binding == binding2); //$NON-NLS-1$
- }
-
- /**
- * Checking arguments positions
- */
- public void test0155() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0155", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The result is not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) node;
- List parameters = methodDecl.parameters();
- assertTrue("The parameters size is different from 2", parameters.size() == 2); //$NON-NLS-1$
- Object parameter = parameters.get(0);
- assertTrue("The parameter is not a SingleVariableDeclaration", parameter instanceof SingleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange((ASTNode) parameter, "int i", source); //$NON-NLS-1$
- parameter = parameters.get(1);
- assertTrue("The parameter is not a SingleVariableDeclaration", parameter instanceof SingleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange((ASTNode) parameter, "final boolean b", source); //$NON-NLS-1$
- }
-
- /**
- * Checking arguments positions
- */
- public void test0156() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0156", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The result is not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) node;
- List parameters = methodDecl.parameters();
- assertTrue("The parameters size is different from 1", parameters.size() == 1); //$NON-NLS-1$
- Object parameter = parameters.get(0);
- assertTrue("The parameter is not a SingleVariableDeclaration", parameter instanceof SingleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange((ASTNode) parameter, "int i", source); //$NON-NLS-1$
- Block block = methodDecl.getBody();
- List statements = block.statements();
- assertTrue("The statements size is different from 2", statements.size() == 2); //$NON-NLS-1$
- ASTNode statement = (ASTNode) statements.get(0);
- assertTrue("The statements[0] is a postfixExpression statement", statement instanceof ExpressionStatement); //$NON-NLS-1$
- }
-
- /**
- * Check canonic binding for fields
- */
- public void test0157() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test0157.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Type binding is null", typeBinding); //$NON-NLS-1$
- assertTrue("The type binding is canonical", typeBinding == typeDeclaration.resolveBinding()); //$NON-NLS-1$
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertTrue("The body declaration list is empty", bodyDeclarations.size() != 0); //$NON-NLS-1$
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("This is not a field", bodyDeclaration instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) bodyDeclaration;
- List variableFragments = fieldDeclaration.fragments();
- assertTrue("The fragment list is empty", variableFragments.size() != 0); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableFragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding); //$NON-NLS-1$
- assertFalse("Not a parameter", variableBinding.isParameter());
- assertTrue("The field binding is not canonical", variableBinding == fragment.resolveBinding()); //$NON-NLS-1$
- typeBinding = variableBinding.getType();
- assertTrue("The type is not an array type", typeBinding.isArray()); //$NON-NLS-1$
- assertTrue("The type binding for the field is not canonical", typeBinding == variableBinding.getType()); //$NON-NLS-1$
- SimpleName name = fragment.getName();
- assertTrue("is a declaration", name.isDeclaration()); //$NON-NLS-1$
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong type", IBinding.VARIABLE, binding.getKind()); //$NON-NLS-1$
- assertTrue("not a field", ((IVariableBinding) binding).isField()); //$NON-NLS-1$
- }
-
- /**
- * Check canonic bindings for fields
- */
- public void test0158() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test0158.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Type binding is null", typeBinding); //$NON-NLS-1$
- assertTrue("The type binding is canonical", typeBinding == typeDeclaration.resolveBinding()); //$NON-NLS-1$
- SimpleName simpleName = typeDeclaration.getName();
- assertTrue("is a declaration", simpleName.isDeclaration()); //$NON-NLS-1$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertEquals("wrong name", simpleName.getIdentifier(), binding.getName()); //$NON-NLS-1$
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertTrue("The body declaration list is empty", bodyDeclarations.size() != 0); //$NON-NLS-1$
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("This is not a field", bodyDeclaration instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) bodyDeclaration;
- List variableFragments = fieldDeclaration.fragments();
- assertTrue("The fragment list is empty", variableFragments.size() != 0); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableFragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding); //$NON-NLS-1$
- assertTrue("The field binding is not canonical", variableBinding == fragment.resolveBinding()); //$NON-NLS-1$
- ITypeBinding typeBinding2 = variableBinding.getType();
- assertTrue("The type is not an array type", typeBinding2.isArray()); //$NON-NLS-1$
- assertTrue("The type binding for the field is not canonical", typeBinding2 == variableBinding.getType()); //$NON-NLS-1$
- assertTrue("The type binding for the field is not canonical with the declaration type binding", typeBinding == typeBinding2.getElementType()); //$NON-NLS-1$
- }
-
- /**
- * Define an anonymous type
- */
- public void test0159() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0159", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-
- /**
- * Check bindings for multiple field declarations
- */
- public void test0160() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0160", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Type binding is null", typeBinding); //$NON-NLS-1$
- assertTrue("The type binding is canonical", typeBinding == typeDeclaration.resolveBinding()); //$NON-NLS-1$
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertTrue("The body declaration list is empty", bodyDeclarations.size() != 0); //$NON-NLS-1$
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("This is not a field", bodyDeclaration instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) bodyDeclaration;
- List variableFragments = fieldDeclaration.fragments();
- assertTrue("The fragment list size is not 2", variableFragments.size() == 2); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableFragments.get(0);
- IVariableBinding variableBinding1 = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding1); //$NON-NLS-1$
- assertTrue("The field binding is not canonical", variableBinding1 == fragment.resolveBinding()); //$NON-NLS-1$
- ITypeBinding type1 = variableBinding1.getType();
- assertNotNull("The type is null", type1); //$NON-NLS-1$
- assertTrue("The field type is canonical", type1 == variableBinding1.getType()); //$NON-NLS-1$
- assertTrue("The type is not an array type",type1.isArray()); //$NON-NLS-1$
- assertTrue("The type dimension is 1", type1.getDimensions() == 1); //$NON-NLS-1$
- fragment = (VariableDeclarationFragment) variableFragments.get(1);
- IVariableBinding variableBinding2 = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding2); //$NON-NLS-1$
- assertTrue("The field binding is not canonical", variableBinding2 == fragment.resolveBinding()); //$NON-NLS-1$
- ITypeBinding type2 = variableBinding2.getType();
- type2 = variableBinding2.getType();
- assertNotNull("The type is null", type2); //$NON-NLS-1$
- assertTrue("The field type is canonical", type2 == variableBinding2.getType()); //$NON-NLS-1$
- assertTrue("The type is not an array type",type2.isArray()); //$NON-NLS-1$
- assertTrue("The type dimension is 2", type2.getDimensions() == 2); //$NON-NLS-1$
- assertTrue("Element type is canonical", type1.getElementType() == type2.getElementType()); //$NON-NLS-1$
- assertTrue("type1.id < type2.id", variableBinding1.getVariableId() < variableBinding2.getVariableId()); //$NON-NLS-1$
-
- }
-
- /**
- * Check ITypeBinding APIs:
- * - getModifiers()
- * - getElementType() when it is not an array type
- * - getDimensions() when it is not an array type
- * - getDeclaringClass()
- * - getDeclaringName()
- * - getName()
- * - isNested()
- * - isAnonymous()
- * - isLocal()
- * - isMember()
- * - isArray()
- * - getDeclaredMethods() => returns binding for default constructor
- * - isPrimitive()
- * - isTopLevel()
- * - getSuperclass()
- */
- public void test0161() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0161", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("The type binding should not be null", typeBinding); //$NON-NLS-1$
- assertEquals("The modifier is PUBLIC", Modifier.PUBLIC, typeBinding.getModifiers()); //$NON-NLS-1$
- assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
- assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
- assertNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
- IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
- assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
- assertEquals("The name is not Test", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
- assertTrue("A local class", !typeBinding.isLocal()); //$NON-NLS-1$
- assertTrue("A nested class", !typeBinding.isNested()); //$NON-NLS-1$
- assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
- assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
- assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
- assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
- assertTrue("Is nested", typeBinding.isTopLevel()); //$NON-NLS-1$
- assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
- ITypeBinding superclass = typeBinding.getSuperclass();
- assertNotNull("No superclass", superclass); //$NON-NLS-1$
- assertTrue("From source", !superclass.isFromSource()); //$NON-NLS-1$
- ITypeBinding supersuperclass = superclass.getSuperclass();
- assertNull("No superclass for java.lang.Object", supersuperclass); //$NON-NLS-1$
- assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
- }
-
- /**
- * Check ITypeBinding APIs:
- * - getModifiers()
- * - getElementType() when it is not an array type
- * - getDimensions() when it is not an array type
- * - getDeclaringClass()
- * - getDeclaringName()
- * - getName()
- * - isNested()
- * - isAnonymous()
- * - isLocal()
- * - isMember()
- * - isArray()
- * - getDeclaredMethods() => returns binding for default constructor
- * - isPrimitive()
- * - isTopLevel()
- * - getSuperclass()
- */
- public void test0162() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0162", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("The type binding should not be null", typeBinding); //$NON-NLS-1$
- assertEquals("The modifier is PUBLIC", Modifier.PUBLIC, typeBinding.getModifiers()); //$NON-NLS-1$
- assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
- assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
- assertNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
- IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
- assertEquals("Contains no methos", 0, methods.length); //$NON-NLS-1$
- assertEquals("The name is not Test", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
- assertTrue("A local class", !typeBinding.isLocal()); //$NON-NLS-1$
- assertTrue("A nested class", !typeBinding.isNested()); //$NON-NLS-1$
- assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
- assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
- assertTrue("A class", !typeBinding.isClass()); //$NON-NLS-1$
- assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
- assertTrue("Is nested", typeBinding.isTopLevel()); //$NON-NLS-1$
- assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
- ITypeBinding superclass = typeBinding.getSuperclass();
- assertNull("No superclass", superclass); //$NON-NLS-1$
- assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
- }
-
- /**
- * Test binding for anonymous declaration: new java.lang.Object() {}
- */
- public void test0163() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0163", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- assertTrue("Not an anonymous type declaration", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation anonymousClass = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = anonymousClass.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not an anonymous class", typeBinding.isAnonymous()); //$NON-NLS-1$
- assertEquals("The modifier is not default", Modifier.NONE, typeBinding.getModifiers()); //$NON-NLS-1$
- assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
- assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
- assertNotNull("This is a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("The name is not empty", "", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
- assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
- assertTrue("Not a local class", typeBinding.isLocal()); //$NON-NLS-1$
- assertTrue("Not a nested class", typeBinding.isNested()); //$NON-NLS-1$
- assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
- assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
- assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
- assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
- assertTrue("Is a top level", !typeBinding.isTopLevel()); //$NON-NLS-1$
- assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
- assertEquals("wrong qualified name", "", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding superclass = typeBinding.getSuperclass();
- assertNotNull("No superclass", superclass); //$NON-NLS-1$
- assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
- }
-
- /**
- * Test binding for member type declaration
- */
- public void test0164() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0164", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
- assertEquals("The modifier is not default", Modifier.PRIVATE, typeBinding.getModifiers()); //$NON-NLS-1$
- assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
- assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
- assertNotNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("The name is not 'B'", "B", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
- assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
- assertTrue("A local class", !typeBinding.isLocal()); //$NON-NLS-1$
- assertTrue("Not a nested class", typeBinding.isNested()); //$NON-NLS-1$
- assertTrue("Not a member class", typeBinding.isMember()); //$NON-NLS-1$
- assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
- assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
- assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
- assertTrue("Is a top level", !typeBinding.isTopLevel()); //$NON-NLS-1$
- assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
- ITypeBinding superclass = typeBinding.getSuperclass();
- assertNotNull("No superclass", superclass); //$NON-NLS-1$
- assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
- }
-
- /**
- * Test binding for local type declaration
- */
- public void test0165() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0165", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an type declaration", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
- TypeDeclarationStatement statement = (TypeDeclarationStatement) node;
- AbstractTypeDeclaration typeDeclaration = statement.getDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
- assertEquals("The modifier is not default", Modifier.NONE, typeBinding.getModifiers()); //$NON-NLS-1$
- assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
- assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
- assertNotNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("The name is not 'C'", "C", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
- assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
- assertTrue("Not a local class", typeBinding.isLocal()); //$NON-NLS-1$
- assertTrue("Not a nested class", typeBinding.isNested()); //$NON-NLS-1$
- assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
- assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
- assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
- assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
- assertTrue("Is a top level", !typeBinding.isTopLevel()); //$NON-NLS-1$
- assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
- assertEquals("wrong qualified name", "", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding superclass = typeBinding.getSuperclass();
- assertNotNull("No superclass", superclass); //$NON-NLS-1$
- assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
- }
-
- /**
- * Multiple local declaration => VariabledeclarationStatement
- */
- public void test0166() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0166", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("Fragment list is not 4 ", fragments.size() == 4); //$NON-NLS-1$
- VariableDeclarationFragment fragment1 = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding binding1 = fragment1.resolveBinding();
- assertNotNull("Binding is null", binding1); //$NON-NLS-1$
- assertEquals("wrong name for binding1", "x", binding1.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding1", 0, binding1.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding1.isField()); //$NON-NLS-1$
- assertNull("declaring class is not null", binding1.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding1 = binding1.getType();
- assertNotNull("typeBinding1 is null", typeBinding1); //$NON-NLS-1$
- assertTrue("typeBinding1 is not a primitive type", typeBinding1.isPrimitive()); //$NON-NLS-1$
- assertTrue("typeBinding1 is not canonical", typeBinding1 == binding1.getType()); //$NON-NLS-1$
- VariableDeclarationFragment fragment2 = (VariableDeclarationFragment) fragments.get(1);
- IVariableBinding binding2 = fragment2.resolveBinding();
- assertNotNull("Binding is null", binding2); //$NON-NLS-1$
- assertEquals("wrong name for binding2", "z", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding2", 0, binding2.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding2.isField()); //$NON-NLS-1$
- assertNull("declaring class is not null", binding2.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding2 = binding2.getType();
- assertNotNull("typeBinding2 is null", typeBinding2); //$NON-NLS-1$
- assertTrue("typeBinding2 is not an array type", typeBinding2.isArray()); //$NON-NLS-1$
- assertTrue("typeBinding2 is not canonical", typeBinding2 == binding2.getType()); //$NON-NLS-1$
- assertTrue("primitive type is not canonical", typeBinding1 == typeBinding2.getElementType()); //$NON-NLS-1$
- assertEquals("dimension is 1", 1, typeBinding2.getDimensions()); //$NON-NLS-1$
- assertEquals("it is not int[]", "int[]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- VariableDeclarationFragment fragment3 = (VariableDeclarationFragment) fragments.get(2);
- IVariableBinding binding3 = fragment3.resolveBinding();
- assertNotNull("Binding is null", binding3); //$NON-NLS-1$
- assertEquals("wrong name for binding3", "i", binding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding3", 0, binding3.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding3.isField()); //$NON-NLS-1$
- assertNull("declaring class is not null", binding3.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding3 = binding3.getType();
- assertNotNull("typeBinding3 is null", typeBinding3); //$NON-NLS-1$
- assertTrue("typeBinding3 is not an primitive type", typeBinding3.isPrimitive()); //$NON-NLS-1$
- assertTrue("typeBinding3 is not canonical", typeBinding3 == binding3.getType()); //$NON-NLS-1$
- assertTrue("primitive type is not canonical", typeBinding1 == typeBinding3); //$NON-NLS-1$
- assertEquals("dimension is 0", 0, typeBinding3.getDimensions()); //$NON-NLS-1$
- assertEquals("it is not the primitive type int", "int", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- VariableDeclarationFragment fragment4 = (VariableDeclarationFragment) fragments.get(3);
- IVariableBinding binding4 = fragment4.resolveBinding();
- assertNotNull("Binding is null", binding4); //$NON-NLS-1$
- assertEquals("wrong name for binding4", "j", binding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding4", 0, binding4.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding4.isField()); //$NON-NLS-1$
- assertNull("declaring class is not null", binding4.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding4 = binding4.getType();
- assertNotNull("typeBinding4 is null", typeBinding4); //$NON-NLS-1$
- assertTrue("typeBinding4 is not an array type", typeBinding4.isArray()); //$NON-NLS-1$
- assertTrue("typeBinding4 is not canonical", typeBinding4 == binding4.getType()); //$NON-NLS-1$
- assertTrue("primitive type is not canonical", typeBinding1 == typeBinding4.getElementType()); //$NON-NLS-1$
- assertEquals("dimension is 2", 2, typeBinding4.getDimensions()); //$NON-NLS-1$
- assertEquals("it is not int[][]", "int[][]", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("ids in the wrong order", binding1.getVariableId() < binding2.getVariableId()); //$NON-NLS-1$
- assertTrue("ids in the wrong order", binding2.getVariableId() < binding3.getVariableId()); //$NON-NLS-1$
- assertTrue("ids in the wrong order", binding3.getVariableId() < binding4.getVariableId()); //$NON-NLS-1$
- }
-
- /**
- * Check source position for new Test[1+2].length.
- */
- public void test0167() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0167", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Instance of VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("fragment list size is not 1", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertNotNull("No initialization", initialization); //$NON-NLS-1$
- assertTrue("Not a FieldAccess", initialization instanceof FieldAccess); //$NON-NLS-1$
- checkSourceRange(initialization, "new Test[1+2].length", source); //$NON-NLS-1$
- }
-
- /**
- * Check package binding: test0168.test
- */
- public void test0168() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0168.test1", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
- IPackageBinding packageBinding = typeBinding.getPackage();
- assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
- assertEquals("wrong name", "test0168.test1", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- String[] components = packageBinding.getNameComponents();
- assertNotNull("no components", components); //$NON-NLS-1$
- assertTrue("components size != 2", components.length == 2); //$NON-NLS-1$
- assertEquals("wrong component name", "test0168", components[0]); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong component name", "test1", components[1]); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
- assertTrue("Unnamed package", !packageBinding.isUnnamed()); //$NON-NLS-1$
- assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
- }
-
- /**
- * Check package binding: test0169
- */
- public void test0169() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0169", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
- IPackageBinding packageBinding = typeBinding.getPackage();
- assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
- assertEquals("wrong name", "test0169", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- String[] components = packageBinding.getNameComponents();
- assertNotNull("no components", components); //$NON-NLS-1$
- assertTrue("components size != 1", components.length == 1); //$NON-NLS-1$
- assertEquals("wrong component name", "test0169", components[0]); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
- assertTrue("Unnamed package", !packageBinding.isUnnamed()); //$NON-NLS-1$
- assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
- }
-
- /**
- * Check package binding: test0170
- */
- public void test0170() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test0170.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
- IPackageBinding packageBinding = typeBinding.getPackage();
- assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
- assertEquals("wrong name", "", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- String[] components = packageBinding.getNameComponents();
- assertNotNull("no components", components); //$NON-NLS-1$
- assertTrue("components size != 0", components.length == 0); //$NON-NLS-1$
- assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
- assertTrue("Not an unnamed package", packageBinding.isUnnamed()); //$NON-NLS-1$
- assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
- }
-
- /**
- * Check package binding: test0171
- */
- public void test0171() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0171", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() == 2); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
- IPackageBinding packageBinding = typeBinding.getPackage();
- assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
- assertEquals("wrong name", "test0171", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- String[] components = packageBinding.getNameComponents();
- assertNotNull("no components", components); //$NON-NLS-1$
- assertTrue("components size != 1", components.length == 1); //$NON-NLS-1$
- assertEquals("wrong component name", "test0171", components[0]); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
- assertTrue("Unnamed package", !packageBinding.isUnnamed()); //$NON-NLS-1$
- assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
-
- typeDeclaration = (TypeDeclaration) types.get(1);
- typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
- IPackageBinding packageBinding2 = typeBinding.getPackage();
- assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
- assertTrue("Package binding is not canonical", packageBinding == packageBinding2); //$NON-NLS-1$
- }
-
- /**
- * Check method binding
- */
- public void test0172() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0172", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List types = compilationUnit.types();
- assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
- IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
- assertEquals("methods.length != 4", 4, methods.length); //$NON-NLS-1$
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("body declaration size != 3", 3, bodyDeclarations.size()); //$NON-NLS-1$
- FunctionDeclaration method1 = (FunctionDeclaration) bodyDeclarations.get(0);
- IFunctionBinding methodBinding1 = method1.resolveBinding();
- assertNotNull("No method binding for foo", methodBinding1); //$NON-NLS-1$
- SimpleName simpleName = method1.getName();
- assertTrue("not a declaration", simpleName.isDeclaration()); //$NON-NLS-1$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", binding.getName(), simpleName.getIdentifier()); //$NON-NLS-1$
- // search method foo
- IFunctionBinding methodBinding = null;
- loop: for (int i = 0, max = methods.length; i < max; i++) {
- IFunctionBinding currentMethod = methods[i];
- if ("foo".equals(currentMethod.getName())) {
- methodBinding = currentMethod;
- break loop;
- }
- }
- assertNotNull("Cannot be null", methodBinding);
- assertTrue("Canonical method binding", methodBinding1 == methodBinding); //$NON-NLS-1$
- assertTrue("declaring class is canonical", typeBinding == methodBinding1.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("wrong modifier", Modifier.NONE, methodBinding1.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name for method", "foo", methodBinding1.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding[] parameters = methodBinding1.getParameterTypes();
- assertNotNull("No parameters", parameters); //$NON-NLS-1$
- assertEquals("wrong size", 1, parameters.length); //$NON-NLS-1$
- assertEquals("wrong type", "int[]", parameters[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong return type", "void", methodBinding1.getReturnType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("A constructor", !methodBinding1.isConstructor()); //$NON-NLS-1$
-
- FunctionDeclaration method2 = (FunctionDeclaration) bodyDeclarations.get(1);
- IFunctionBinding methodBinding2 = method2.resolveBinding();
- assertNotNull("No method binding for main", methodBinding2); //$NON-NLS-1$
- // search main
- methodBinding = null;
- loop: for (int i = 0, max = methods.length; i < max; i++) {
- IFunctionBinding currentMethod = methods[i];
- if ("main".equals(currentMethod.getName())) {
- methodBinding = currentMethod;
- break loop;
- }
- }
- assertNotNull("Cannot be null", methodBinding);
- assertTrue("Canonical method binding", methodBinding2 == methodBinding); //$NON-NLS-1$
- assertTrue("declaring class is canonical", typeBinding == methodBinding2.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("wrong modifier", Modifier.PUBLIC | Modifier.STATIC, methodBinding2.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name for method", "main", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding[] parameters2 = methodBinding2.getParameterTypes();
- assertNotNull("No parameters", parameters2); //$NON-NLS-1$
- assertEquals("wrong size", 1, parameters2.length); //$NON-NLS-1$
- assertEquals("wrong type for parameter2[0]", "String[]", parameters2[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong return type", "void", methodBinding2.getReturnType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("A constructor", !methodBinding2.isConstructor()); //$NON-NLS-1$
-
- FunctionDeclaration method3 = (FunctionDeclaration) bodyDeclarations.get(2);
- IFunctionBinding methodBinding3 = method3.resolveBinding();
- assertNotNull("No method binding for bar", methodBinding3); //$NON-NLS-1$
- // search method bar
- methodBinding = null;
- loop: for (int i = 0, max = methods.length; i < max; i++) {
- IFunctionBinding currentMethod = methods[i];
- if ("bar".equals(currentMethod.getName())) {
- methodBinding = currentMethod;
- break loop;
- }
- }
- assertNotNull("Cannot be null", methodBinding);
- assertTrue("Canonical method binding", methodBinding3 == methodBinding); //$NON-NLS-1$
- assertTrue("declaring class is canonical", typeBinding == methodBinding3.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("wrong modifier", Modifier.PRIVATE, methodBinding3.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name for method", "bar", methodBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding[] parameters3 = methodBinding3.getParameterTypes();
- assertNotNull("No parameters", parameters3); //$NON-NLS-1$
- assertEquals("wrong size", 1, parameters3.length); //$NON-NLS-1$
- assertEquals("wrong type", "String", parameters3[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong return type", "String", methodBinding3.getReturnType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("A constructor", !methodBinding3.isConstructor()); //$NON-NLS-1$
- assertTrue("The binding is not canonical", parameters3[0] == methodBinding3.getReturnType()); //$NON-NLS-1$
- }
-
- /**
- * i++; IVariableBinding
- */
- public void test0173() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0173", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an expressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Not a postfixexpression", ex instanceof PostfixExpression); //$NON-NLS-1$
- PostfixExpression postfixExpression = (PostfixExpression) ex;
- Expression expr = postfixExpression.getOperand();
- assertTrue("Not a simpleName", expr instanceof SimpleName); //$NON-NLS-1$
- SimpleName name = (SimpleName) expr;
- assertTrue("a declaration", !name.isDeclaration()); //$NON-NLS-1$
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
-
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertTrue(variableBinding == binding);
- }
-
- /**
- * i++; IVariableBinding (field)
- */
- public void test0174() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0174", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an expressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Not a postfixexpression", ex instanceof PostfixExpression); //$NON-NLS-1$
- PostfixExpression postfixExpression = (PostfixExpression) ex;
- Expression expr = postfixExpression.getOperand();
- assertTrue("Not a simpleName", expr instanceof SimpleName); //$NON-NLS-1$
- SimpleName name = (SimpleName) expr;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
-
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("FieldDeclaration", node2 instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node2;
- List fragments = fieldDeclaration.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertTrue(variableBinding == binding);
- }
-
- /**
- * int i = 0; Test IntBinding for the field declaration and the 0 literal
- */
- public void test0175() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0175", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node2;
- List fragments = fieldDeclaration.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- ITypeBinding typeBinding = fragment.getInitializer().resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not a primitive type", typeBinding.isPrimitive()); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(variableBinding.getType() == typeBinding);
- }
-
- /**
- * ThisReference
- */
- public void test0176() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0176", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("Return statement", node2 instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node2;
- assertTrue("Not a field access", returnStatement.getExpression() instanceof FieldAccess); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) returnStatement.getExpression();
- ITypeBinding typeBinding = fieldAccess.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not a primitive type", typeBinding.isPrimitive()); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Expression expr = fieldAccess.getExpression();
- assertTrue("Not a this expression", expr instanceof ThisExpression); //$NON-NLS-1$
- ThisExpression thisExpression = (ThisExpression) expr;
- ITypeBinding typeBinding2 = thisExpression.resolveTypeBinding();
- assertNotNull("No type binding2", typeBinding2); //$NON-NLS-1$
- assertEquals("Not Test", "Test", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * i++; IVariableBinding
- */
- public void test0177() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0177", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 1, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an expressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Not a postfixexpression", ex instanceof PostfixExpression); //$NON-NLS-1$
- PostfixExpression postfixExpression = (PostfixExpression) ex;
- Expression expr = postfixExpression.getOperand();
- assertTrue("Not a simpleName", expr instanceof SimpleName); //$NON-NLS-1$
- SimpleName name = (SimpleName) expr;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
-
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertEquals("return type is not int", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(variableBinding == binding);
- }
-
- /**
- * SuperReference
- */
- public void test0178() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0178", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 1, 0, 0);
- assertTrue("Return statement", node2 instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node2;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not a field access", expr instanceof SuperFieldAccess); //$NON-NLS-1$
- SuperFieldAccess fieldAccess = (SuperFieldAccess) expr;
- ITypeBinding typeBinding = fieldAccess.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not a primitive type", typeBinding.isPrimitive()); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Allocation expression
- */
- public void test0179() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0179", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- }
-
- /**
- * Allocation expression
- */
- public void test0180() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0180", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- assertTrue("No an array creation", initialization instanceof ArrayCreation); //$NON-NLS-1$
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not an array", typeBinding.isArray()); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- }
-
- /**
- * Allocation expression
- */
- public void test0181() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0181", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not an array", typeBinding.isArray()); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- }
-
- /**
- * BinaryExpression
- */
- public void test0182() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0182", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0183() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0183", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10 && i < 20", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0184() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0184", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10 || i < 20", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0185() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0185", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i == 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0186() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0186", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "o == o", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0187() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0187", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof WhileStatement); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node2;
- Expression expr = whileStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i <= 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0188() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0188", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertTrue("DoStatement", node2 instanceof DoStatement); //$NON-NLS-1$
- DoStatement statement = (DoStatement) node2;
- Expression expr = statement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i <= 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0189() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0189", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("ForStatement", node2 instanceof ForStatement); //$NON-NLS-1$
- ForStatement statement = (ForStatement) node2;
- Expression expr = statement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0190() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0190", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 2, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement statement = (IfStatement) node2;
- Expression expr = statement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "scanner.x < selection.start && selection.start < scanner.y", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0191() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0191", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Assignment", ex instanceof Assignment); //$NON-NLS-1$
- Assignment statement = (Assignment) ex;
- Expression rightExpr = statement.getRightHandSide();
- assertTrue("Not an infix expression", rightExpr instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) rightExpr;
- Expression expr = infixExpression.getRightOperand();
- assertNotNull("No right hand side expression", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "2 < 20", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0192() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0192", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- checkSourceRange(initialization, "0", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0193() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0193", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- checkSourceRange(initialization, "new Inner()", source); //$NON-NLS-1$
- assertEquals("Wrong type", "Inner", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Initializer
- */
- public void test0194() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0194", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- checkSourceRange(initialization, "new Inner[10]", source); //$NON-NLS-1$
- assertTrue("Not an array", typeBinding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong type", "Inner[]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Initializer
- */
- public void test0195() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0195", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 1, 0, 1);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression ex = expressionStatement.getExpression();
- assertTrue("FunctionInvocation", ex instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) ex;
- checkSourceRange(methodInvocation, "a.useFile(/*]*/a.getFile()/*[*/)", source); //$NON-NLS-1$
- List list = methodInvocation.arguments();
- assertTrue("Parameter list not empty", list.size() == 1); //$NON-NLS-1$
- Expression parameter = (Expression) list.get(0);
- assertTrue("Not a method invocation", parameter instanceof FunctionInvocation); //$NON-NLS-1$
- ITypeBinding typeBinding = parameter.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "File", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter, "a.getFile()", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0196() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0196", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 2);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Assignment", ex instanceof Assignment); //$NON-NLS-1$
- Assignment statement = (Assignment) ex;
- Expression rightExpr = statement.getRightHandSide();
- assertTrue("Not an instanceof expression", rightExpr instanceof InstanceofExpression); //$NON-NLS-1$
- ITypeBinding typeBinding = rightExpr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong type", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(rightExpr, "inner instanceof Inner", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0197() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0197", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 0);
- ASTNode node2 = getASTNode(unit, 1, 0, 1);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression ex = expressionStatement.getExpression();
- assertTrue("FunctionInvocation", ex instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) ex;
- checkSourceRange(methodInvocation, "a.getFile()/*[*/.getName()", source); //$NON-NLS-1$
- Expression receiver = methodInvocation.getExpression();
- assertTrue("Not a method invocation", receiver instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) receiver;
- ITypeBinding typeBinding = methodInvocation2.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "File", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(methodInvocation2, "a.getFile()", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0198() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0198", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node2;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not an infixExpression", expr instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expr;
- Expression left = infixExpression.getLeftOperand();
- assertTrue("Not an InfixExpression", left instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression2 = (InfixExpression) left;
- Expression right = infixExpression2.getRightOperand();
- assertTrue("Not an InfixExpression", right instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression3 = (InfixExpression) right;
- assertEquals("A multiplication", InfixExpression.Operator.TIMES, infixExpression3.getOperator()); //$NON-NLS-1$
- ITypeBinding typeBinding = infixExpression3.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(infixExpression3, "20 * 30", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0199() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0199", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not an infixExpression", initialization instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) initialization;
- Expression left = infixExpression.getLeftOperand();
- assertTrue("Not an InfixExpression", left instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression2 = (InfixExpression) left;
- Expression right = infixExpression2.getRightOperand();
- assertTrue("Not an InfixExpression", right instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression3 = (InfixExpression) right;
- assertEquals("A multiplication", InfixExpression.Operator.TIMES, infixExpression3.getOperator()); //$NON-NLS-1$
- ITypeBinding typeBinding = infixExpression3.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(infixExpression3, "10 * 30", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0200() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0200", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 1, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not an infixExpression", initialization instanceof FieldAccess); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) initialization;
- Expression receiver = fieldAccess.getExpression();
- assertTrue("ArrayCreation", receiver instanceof ArrayCreation); //$NON-NLS-1$
- ArrayCreation arrayCreation = (ArrayCreation) receiver;
- List dimensions = arrayCreation.dimensions();
- assertEquals("Wrong dimension", 1, dimensions.size()); //$NON-NLS-1$
- Expression dim = (Expression) dimensions.get(0);
- assertTrue("InfixExpression", dim instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) dim;
- ITypeBinding typeBinding = infixExpression.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(infixExpression, "1 + 2", source); //$NON-NLS-1$
- }
-
- /**
- * Position inside for statement: PR 3300
- */
- public void test0201() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0201", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("ForStatement", node2 instanceof ForStatement); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node2;
- List initializers = forStatement.initializers();
- assertTrue("wrong size", initializers.size() == 1); //$NON-NLS-1$
- Expression init = (Expression) initializers.get(0);
- checkSourceRange(init, "int i= 0", source); //$NON-NLS-1$
- }
-
- /**
- * PR 7386
- */
- public void test0202() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0202", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("FieldDeclaration", node2 instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node2;
- checkSourceRange(fieldDeclaration, "int f= (2);", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not a parenthesized expression", initialization instanceof ParenthesizedExpression); //$NON-NLS-1$
- checkSourceRange(initialization, "(2)", source); //$NON-NLS-1$
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * PR 7386
- */
- public void test0203() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0203", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("FieldDeclaration", node2 instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node2;
- checkSourceRange(fieldDeclaration, "int f= (2);", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not a parenthesized expression", initialization instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) initialization;
- checkSourceRange(parenthesizedExpression, "(2)", source); //$NON-NLS-1$
- Expression expr = parenthesizedExpression.getExpression();
- checkSourceRange(expr, "2", source); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("type binding is canonical", typeBinding == parenthesizedExpression.resolveTypeBinding()); //$NON-NLS-1$
- }
-
- /**
- * PR 7386
- */
- public void test0204() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0204", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("FieldDeclaration", node2 instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node2;
- checkSourceRange(fieldDeclaration, "int f= ((2));", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not a parenthesized expression", initialization instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) initialization;
- checkSourceRange(parenthesizedExpression, "((2))", source); //$NON-NLS-1$
- Expression expr = parenthesizedExpression.getExpression();
- assertTrue("Not a parenthesized expression", expr instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression2 = (ParenthesizedExpression) expr;
- checkSourceRange(parenthesizedExpression2, "(2)", source); //$NON-NLS-1$
- expr = parenthesizedExpression2.getExpression();
- checkSourceRange(expr, "2", source); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = parenthesizedExpression.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("type binding is canonical", typeBinding == parenthesizedExpression2.resolveTypeBinding()); //$NON-NLS-1$
- }
-
-
- /**
- * Local class end position when trailing comment
- */
- public void test0205() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0205", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("TypeDeclarationStatement", node2 instanceof TypeDeclarationStatement); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node2;
- AbstractTypeDeclaration typeDeclaration = typeDeclarationStatement.getDeclaration();
- assertEquals("wrong name", "AA", typeDeclaration.getName().getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(typeDeclaration, "class AA extends Test {}", source); //$NON-NLS-1$
- }
-
- /**
- * QualifiedName
- */
- public void test0206() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0206", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 5, 0);
- assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node2;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not a qualifiedName", expr instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expr;
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not an int (typeBinding)", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(qualifiedName, "field1.field2.field3.field4.i", source); //$NON-NLS-1$
- assertTrue("Not a simple name", qualifiedName.getName().isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = qualifiedName.getName();
- assertTrue("a declaration", !simpleName.isDeclaration()); //$NON-NLS-1$
- checkSourceRange(simpleName, "i", source); //$NON-NLS-1$
- ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
- assertNotNull("No typebinding2", typeBinding2); //$NON-NLS-1$
- assertEquals("Not an int (typeBinding2)", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Not Test", "Test", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not default", Modifier.PUBLIC, variableBinding.getModifiers()); //$NON-NLS-1$
- Name qualifierName = qualifiedName.getQualifier();
- assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(qualifierName, "field1.field2.field3.field4", source); //$NON-NLS-1$
- ITypeBinding typeBinding5 = qualifierName.resolveTypeBinding();
- assertNotNull("No binding5", typeBinding5); //$NON-NLS-1$
- assertEquals("Not Test", "Test", typeBinding5.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-
- qualifiedName = (QualifiedName) qualifierName;
- simpleName = qualifiedName.getName();
- checkSourceRange(simpleName, "field4", source); //$NON-NLS-1$
- ITypeBinding typeBinding6 = simpleName.resolveTypeBinding();
- assertNotNull("No binding6", typeBinding6); //$NON-NLS-1$
- assertEquals("Not Test", "Test", typeBinding6.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-
- qualifierName = qualifiedName.getQualifier();
- assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(qualifierName, "field1.field2.field3", source); //$NON-NLS-1$
- ITypeBinding typeBinding7 = qualifierName.resolveTypeBinding();
- assertNotNull("No binding7", typeBinding7); //$NON-NLS-1$
- assertEquals("Not Test", "Test", typeBinding7.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-
- qualifiedName = (QualifiedName) qualifierName;
- simpleName = qualifiedName.getName();
- checkSourceRange(simpleName, "field3", source); //$NON-NLS-1$
- qualifierName = qualifiedName.getQualifier();
- assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(qualifierName, "field1.field2", source); //$NON-NLS-1$
- ITypeBinding typeBinding3 = qualifierName.resolveTypeBinding();
- assertNotNull("No binding3", typeBinding3); //$NON-NLS-1$
- assertEquals("Not Test", "Test", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- qualifiedName = (QualifiedName) qualifierName;
- simpleName = qualifiedName.getName();
- checkSourceRange(simpleName, "field2", source); //$NON-NLS-1$
- qualifierName = qualifiedName.getQualifier();
- assertTrue("Not a simple name", qualifierName.isSimpleName()); //$NON-NLS-1$
- assertTrue("a declaration", !((SimpleName)qualifierName).isDeclaration()); //$NON-NLS-1$
- checkSourceRange(qualifierName, "field1", source); //$NON-NLS-1$
- ITypeBinding typeBinding4 = qualifierName.resolveTypeBinding();
- assertNotNull("No binding4", typeBinding4); //$NON-NLS-1$
- assertEquals("Not Test", "Test", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0207() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0207", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- checkSourceRange(node, "/** JavaDoc Comment*/\n void foo(final int i) {}", source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0208() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0208", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "void foo(final int i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0209() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0209", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "void foo(final int i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FieldDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0210() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0210", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((FieldDeclaration) node).getJavadoc();
- checkSourceRange(node, "/** JavaDoc Comment*/\n int i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FieldDeclaration
- */
- public void test0211() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0211", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FieldDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "int i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FieldDeclaration
- */
- public void test0212() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0212", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FieldDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "int i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for TypeDeclaration
- */
- public void test0213() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0213", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- String expectedContents = "public class Test {\n" +//$NON-NLS-1$
- " int i;\n" +//$NON-NLS-1$
- "}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for TypeDeclaration
- */
- public void test0214() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0214", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- String expectedContents = "public class Test {\n" +//$NON-NLS-1$
- " int i;\n" +//$NON-NLS-1$
- "}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for TypeDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0215() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0215", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- "public class Test {\n" +//$NON-NLS-1$
- " int i;\n" +//$NON-NLS-1$
- "}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0216() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0216", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- " class B {}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- */
- public void test0217() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0217", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "class B {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- */
- public void test0218() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0218", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for MemberTypeDeclaration
- */
- public void test0219() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0219", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
- }
-
- /**
- * Checking initializers
- */
- public void test0220() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0220", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- checkSourceRange(node, "{}", source); //$NON-NLS-1$
- }
-
- /**
- * Checking initializers
- */
- public void test0221() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0221", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- checkSourceRange(node, "static {}", source); //$NON-NLS-1$
- }
-
- /**
- * Checking initializers
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0222() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0222", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- JSdoc actualJavadoc = ((Initializer) node).getJavadoc();
- assertNotNull("Javadoc comment should no be null", actualJavadoc); //$NON-NLS-1$
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- " static {}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-
- }
-
- /**
- * Checking initializers
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0223() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0223", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- JSdoc actualJavadoc = ((Initializer) node).getJavadoc();
- assertNotNull("Javadoc comment should not be null", actualJavadoc); //$NON-NLS-1$
- String expectedContents =
- "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
- " {}";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-
- }
-
- /**
- * Checking initializers
- */
- public void test0224() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0224", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- JSdoc actualJavadoc = ((Initializer) node).getJavadoc();
- assertNull("Javadoc comment should be null", actualJavadoc); //$NON-NLS-1$
- checkSourceRange(node, "{}", source); //$NON-NLS-1$
- }
-
- /**
- * Continue ==> ContinueStatement
- */
- public void test0225() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0225", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- checkSourceRange(labeledStatement.getLabel(), "label", source); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- ContinueStatement statement = (ContinueStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- ContinueStatement continueStatement = this.ast.newContinueStatement();
- continueStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", continueStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "continue label;", source); //$NON-NLS-1$
- checkSourceRange(statement.getLabel(), "label", source); //$NON-NLS-1$
- }
-
- /**
- * Break + label ==> BreakStatement
- */
- public void test0226() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0226", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- checkSourceRange(labeledStatement.getLabel(), "label", source); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- BreakStatement statement = (BreakStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- BreakStatement breakStatement = this.ast.newBreakStatement();
- breakStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", breakStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "break label;", source); //$NON-NLS-1$
- checkSourceRange(statement.getLabel(), "label", source); //$NON-NLS-1$
- }
-
- /**
- * QualifiedName
- */
- public void test0227() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0227", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 3, 2, 0);
- assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node2;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not a qualifiedName", expr instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expr;
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not an long (typeBinding)", "long", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(qualifiedName, "field.fB.fA.j", source); //$NON-NLS-1$
-
- SimpleName simpleName = qualifiedName.getName();
- checkSourceRange(simpleName, "j", source); //$NON-NLS-1$
- ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
- assertEquals("Not an long (typeBinding2)", "long", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Not A", "A", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not default", Modifier.NONE, variableBinding.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name", "j", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-
- Name qualifierName = qualifiedName.getQualifier();
- assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(qualifierName, "field.fB.fA", source); //$NON-NLS-1$
- qualifiedName = (QualifiedName) qualifierName;
- ITypeBinding typeBinding3 = qualifiedName.resolveTypeBinding();
- assertNotNull("No type binding3", typeBinding3); //$NON-NLS-1$
- assertEquals("Not an A", "A", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- simpleName = qualifiedName.getName();
- checkSourceRange(simpleName, "fA", source); //$NON-NLS-1$
- ITypeBinding typeBinding4 = simpleName.resolveTypeBinding();
- assertNotNull("No typeBinding4", typeBinding4); //$NON-NLS-1$
- assertEquals("Not an A", "A", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = qualifiedName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertTrue("VariableBinding", binding2 instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding2 = (IVariableBinding) binding2;
- assertEquals("Not B", "B", variableBinding2.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not default", Modifier.NONE, variableBinding2.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name", "fA", variableBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-
- qualifierName = qualifiedName.getQualifier();
- assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(qualifierName, "field.fB", source); //$NON-NLS-1$
- qualifiedName = (QualifiedName) qualifierName;
- ITypeBinding typeBinding5 = qualifiedName.resolveTypeBinding();
- assertNotNull("No typeBinding5", typeBinding5); //$NON-NLS-1$
- assertEquals("Not a B", "B", typeBinding5.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- simpleName = qualifiedName.getName();
- checkSourceRange(simpleName, "fB", source); //$NON-NLS-1$
- ITypeBinding typeBinding6 = simpleName.resolveTypeBinding();
- assertNotNull("No typebinding6", typeBinding6); //$NON-NLS-1$
- assertEquals("not a B", "B", typeBinding6.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding3 = qualifiedName.resolveBinding();
- assertNotNull("No binding2", binding3); //$NON-NLS-1$
- assertTrue("VariableBinding", binding3 instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding3 = (IVariableBinding) binding3;
- assertEquals("Not C", "C", variableBinding3.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not default", Modifier.NONE, variableBinding3.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name", "fB", variableBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-
- qualifierName = qualifiedName.getQualifier();
- assertTrue("Not a simple name", qualifierName.isSimpleName()); //$NON-NLS-1$
- checkSourceRange(qualifierName, "field", source); //$NON-NLS-1$
- simpleName = (SimpleName) qualifierName;
- ITypeBinding typeBinding7 = simpleName.resolveTypeBinding();
- assertNotNull("No typeBinding7", typeBinding7); //$NON-NLS-1$
- assertEquals("Not a C", "C", typeBinding7.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding4 = simpleName.resolveBinding();
- assertNotNull("No binding4", binding4); //$NON-NLS-1$
- assertTrue("VariableBinding", binding4 instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding4 = (IVariableBinding) binding4;
- assertEquals("Not Test", "Test", variableBinding4.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not public", Modifier.PUBLIC, variableBinding4.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name", "field", variableBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong return type", "C", variableBinding4.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * QualifiedName as TypeReference
- */
- public void test0228() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0228", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node2;
- Expression expr = returnStatement.getExpression();
- checkSourceRange(expr, "test0228.Test.foo()", source); //$NON-NLS-1$
- assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- Expression qualifier = methodInvocation.getExpression();
- assertNotNull("no qualifier", qualifier); //$NON-NLS-1$
- assertTrue("QualifiedName", qualifier instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) qualifier;
- checkSourceRange(qualifiedName, "test0228.Test", source); //$NON-NLS-1$
- ITypeBinding typeBinding = qualifiedName.resolveTypeBinding();
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong type", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = qualifiedName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Not a type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
-
- }
-
- /**
- * FunctionInvocation
- */
- public void test0229() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0229", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expr = expressionStatement.getExpression();
- assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- checkSourceRange(expr, "System.err.println()", source); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- Expression qualifier = methodInvocation.getExpression();
- assertTrue("QualifiedName", qualifier instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) qualifier;
- ITypeBinding typeBinding = qualifier.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "PrintStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = qualifiedName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("wrong name", "err", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName methodName = methodInvocation.getName();
- IBinding binding2 = methodName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- }
-
- /**
- * FunctionInvocation
- */
- public void test0230() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0230", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expr = expressionStatement.getExpression();
- assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- checkSourceRange(expr, "err.println()", source); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- Expression qualifier = methodInvocation.getExpression();
- assertTrue("SimpleName", qualifier instanceof SimpleName); //$NON-NLS-1$
- SimpleName name = (SimpleName) qualifier;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong name", "err", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding = name.resolveTypeBinding();
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wron type name", "PrintStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * FunctionInvocation
- */
- public void test0231() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0231", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expr = expressionStatement.getExpression();
- assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- checkSourceRange(expr, "System.err.println()", source); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- Expression qualifier = methodInvocation.getExpression();
- assertTrue("QualifiedName", qualifier instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) qualifier;
- ITypeBinding typeBinding = qualifier.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "PrintStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = qualifiedName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("wrong name", "err", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName methodName = methodInvocation.getName();
- IBinding binding2 = methodName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- Name name = qualifiedName.getQualifier();
- assertTrue("SimpleName", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
- assertNotNull("No typeBinding2", typeBinding2); //$NON-NLS-1$
- assertEquals("wrong type name", "System", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * FunctionInvocation
- */
- public void test0232() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0232", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = variableDeclarationFragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not a primitive type", typeBinding.isPrimitive()); //$NON-NLS-1$
- assertEquals("wrong name", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("QualifiedName", initialization instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) initialization;
- SimpleName simpleName = qualifiedName.getName();
- ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- assertTrue("Not a primitive type", typeBinding2.isPrimitive()); //$NON-NLS-1$
- assertEquals("wrong name", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("IVariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertNull("No declaring class", variableBinding.getDeclaringClass()); //$NON-NLS-1$
- }
-
- /**
- * Checking that only syntax errors are reported for the MALFORMED tag
- */
- public void test0233() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0233", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The fiels is not malformed", !isMalformed(node)); //$NON-NLS-1$
- assertEquals("No problem found", 1, unit.getMessages().length); //$NON-NLS-1$
- assertEquals("No problem found", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * Checking that null is returned for a resolveBinding if the type is unknown
- */
- public void test0234() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0234", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The fiels is not malformed", !isMalformed(node)); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("No problem found", 1, unit.getMessages().length); //$NON-NLS-1$
- assertEquals("No problem found", 1, unit.getProblems().length); //$NON-NLS-1$
- assertTrue("FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNull("binding not null", variableBinding); //$NON-NLS-1$
- }
-
- /**
- * Checking that null is returned for a resolveBinding if the type is unknown
- */
- public void test0235() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0235", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The fiels is not malformed", !isMalformed(node)); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("problems found", 0, unit.getMessages().length); //$NON-NLS-1$
- assertEquals("problems found", 0, unit.getProblems().length); //$NON-NLS-1$
- assertTrue("FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=9452
- */
- public void test0237() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "junit.framework", "TestCase.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-
- /**
- * Check ThisExpression
- */
- public void test0238() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0238", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- char[] source = sourceUnit.getSource().toCharArray();
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
- AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
- Object o = typeDecl.bodyDeclarations().get(0);
- assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) o;
- Block block = methodDecl.getBody();
- List statements = block.statements();
- assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) stmt;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not a method invocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- checkSourceRange(methodInvocation, "Test.this.bar()", source); //$NON-NLS-1$
- Expression qualifier = methodInvocation.getExpression();
- assertTrue("Not a ThisExpression", qualifier instanceof ThisExpression); //$NON-NLS-1$
- ThisExpression thisExpression = (ThisExpression) qualifier;
- Name name = thisExpression.getQualifier();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check ThisExpression
- */
- public void test0239() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0239", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 0);
- assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
- AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
- Object o = typeDecl.bodyDeclarations().get(0);
- assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) o;
- Block block = methodDecl.getBody();
- List statements = block.statements();
- assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) stmt;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not a SuperMethodInvocation", expr instanceof SuperMethodInvocation); //$NON-NLS-1$
- SuperMethodInvocation superMethodInvocation = (SuperMethodInvocation) expr;
- Name name = superMethodInvocation.getQualifier();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("A type binding", binding instanceof ITypeBinding); //$NON-NLS-1$
- assertEquals("Not Test", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Name methodName = superMethodInvocation.getName();
- IBinding binding2 = methodName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertTrue("No an IFunctionBinding", binding2 instanceof IFunctionBinding); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Not bar", "bar", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not T", "T", methodBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check FieldAccess
- */
- public void test0240() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0240", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
- AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
- Object o = typeDecl.bodyDeclarations().get(0);
- assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) o;
- Block block = methodDecl.getBody();
- List statements = block.statements();
- assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) stmt;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not a field access", expr instanceof FieldAccess); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) expr;
- Expression qualifier = fieldAccess.getExpression();
- assertTrue("Not a ThisExpression", qualifier instanceof ThisExpression); //$NON-NLS-1$
- ThisExpression thisExpression = (ThisExpression) qualifier;
- Name name = thisExpression.getQualifier();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Not Test", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Name fieldName = fieldAccess.getName();
- IBinding binding2 = fieldName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertEquals("Wrong name", "f", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong modifier", Modifier.PUBLIC, binding2.getModifiers()); //$NON-NLS-1$
- ITypeBinding typeBinding = fieldName.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check order of body declarations
- */
- public void test0241() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0241", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assertTrue("Not a type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- assertTrue("Not a declaration", ((TypeDeclaration) node).getName().isDeclaration()); //$NON-NLS-1$
- assertEquals("Wrong size", 11, ((TypeDeclaration)node).bodyDeclarations().size()); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 7);
- assertTrue("Not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 8);
- assertTrue("Not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 9);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 10);
- assertTrue("Not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- }
-
- /**
- * Check ThisExpression
- */
- public void test0242() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0242", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 0);
- assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
- AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
- Object o = typeDecl.bodyDeclarations().get(0);
- assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) o;
- Block block = methodDecl.getBody();
- List statements = block.statements();
- assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) stmt;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not a SuperFieldAccess", expr instanceof SuperFieldAccess); //$NON-NLS-1$
- SuperFieldAccess superFieldAccess = (SuperFieldAccess) expr;
- Name name = superFieldAccess.getQualifier();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("A type binding", binding instanceof ITypeBinding); //$NON-NLS-1$
- assertEquals("Not Test", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Name fieldName = superFieldAccess.getName();
- IBinding binding2 = fieldName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertTrue("No an IVariableBinding", binding2 instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding2;
- assertEquals("Not f", "f", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not T", "T", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding2 = fieldName.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check catch clause positions:
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10570
- */
- public void test0243() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0243", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a try statement", node instanceof TryStatement); //$NON-NLS-1$
- TryStatement tryStatement = (TryStatement) node;
- List catchClauses = tryStatement.catchClauses();
- assertEquals("wrong size", 1, catchClauses.size()); //$NON-NLS-1$
- CatchClause catchClause = (CatchClause) catchClauses.get(0);
- checkSourceRange(catchClause, "catch (Exception e){m();}", source); //$NON-NLS-1$
- }
-
- /**
- * Check catch clause positions:
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10570
- */
- public void test0244() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0244", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a try statement", node instanceof TryStatement); //$NON-NLS-1$
- TryStatement tryStatement = (TryStatement) node;
- List catchClauses = tryStatement.catchClauses();
- assertEquals("wrong size", 2, catchClauses.size()); //$NON-NLS-1$
- CatchClause catchClause = (CatchClause) catchClauses.get(0);
- checkSourceRange(catchClause, "catch (RuntimeException e){m();}", source); //$NON-NLS-1$
- catchClause = (CatchClause) catchClauses.get(1);
- checkSourceRange(catchClause, "catch(Exception e) {}", source); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=10587
- */
- public void test0245() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0245", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expr = returnStatement.getExpression();
- assertTrue("not a name", expr instanceof Name); //$NON-NLS-1$
- Name name = (Name) expr;
- IBinding binding = name.resolveBinding();
- assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Not i", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not int", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ASTNode declaringNode = unit.findDeclaringNode(variableBinding);
- assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
- assertTrue("Not a VariableDeclarationFragment", declaringNode instanceof VariableDeclarationFragment); //$NON-NLS-1$
- }
-
- /**
- * Test binding resolution for import declaration
- */
- public void test0246() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0246", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- List imports = unit.imports();
- assertEquals("wrong imports size", 2, imports.size()); //$NON-NLS-1$
- ImportDeclaration importDeclaration = (ImportDeclaration) imports.get(0);
- assertTrue("Not on demand", importDeclaration.isOnDemand()); //$NON-NLS-1$
- checkSourceRange(importDeclaration, "import java.util.*;", source); //$NON-NLS-1$
- IBinding binding = importDeclaration.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
- assertEquals("Wrong name", "java.util", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- importDeclaration = (ImportDeclaration) imports.get(1);
- assertTrue("On demand", !importDeclaration.isOnDemand()); //$NON-NLS-1$
- checkSourceRange(importDeclaration, "import java.io.IOException;", source); //$NON-NLS-1$
- binding = importDeclaration.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertEquals("Wrong name", "IOException", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Test binding resolution for import declaration
- */
- public void test0247() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0247", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- PackageDeclaration packageDeclaration = unit.getPackage();
- checkSourceRange(packageDeclaration, "package test0247;", source); //$NON-NLS-1$
- IPackageBinding binding = packageDeclaration.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
- assertEquals("Wrong name", "test0247", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
- */
- public void test0248() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0248", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 1, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- Name name = singleVariableDeclaration.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong type", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
- */
- public void test0249() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0249", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 2, 1);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not an assignment", expression instanceof Assignment); //$NON-NLS-1$
- Assignment assignment = (Assignment) expression;
- Expression leftHandSide = assignment.getLeftHandSide();
- assertTrue("Not a qualified name", leftHandSide instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) leftHandSide;
- Name simpleName = qualifiedName.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertTrue("Not a IVariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "k", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong modifier", Modifier.STATIC, variableBinding.getModifiers()); //$NON-NLS-1$
- assertEquals("Wrong type", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong declaring class name", "j", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
- */
- public void test0250() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0250", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- Name name = singleVariableDeclaration.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong type", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check qualified name resolution for static fields
- */
- public void test0251() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0251", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- checkSourceRange(methodInvocation, "java.lang.System.out.println()", source); //$NON-NLS-1$
- Expression qualifier = methodInvocation.getExpression();
- assertTrue("Not a qualified name", qualifier instanceof QualifiedName); //$NON-NLS-1$
- checkSourceRange(qualifier, "java.lang.System.out", source); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) qualifier;
- Name typeName = qualifiedName.getQualifier();
- assertTrue("Not a QualifiedName", typeName instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedTypeName = (QualifiedName) typeName;
- IBinding binding = qualifiedTypeName.getName().resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong name", "System", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- binding = qualifiedTypeName.getQualifier().resolveBinding();
- assertNotNull("No binding2", binding); //$NON-NLS-1$
- assertEquals("Wrong type binding", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
- }
-
- /**
- * Check binding for anonymous class
- */
- public void test0252() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0252", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not a classinstancecreation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- IFunctionBinding methodBinding = classInstanceCreation.resolveConstructorBinding();
- assertNotNull("No methodBinding", methodBinding); //$NON-NLS-1$
- assertTrue("Not a constructor", methodBinding.isConstructor()); //$NON-NLS-1$
- assertTrue("Not an anonymous class", methodBinding.getDeclaringClass().isAnonymous()); //$NON-NLS-1$
- assertEquals("Not an anonymous class of java.lang.Object", "Object", methodBinding.getDeclaringClass().getSuperclass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not an anonymous class of java.lang.Object", "java.lang", methodBinding.getDeclaringClass().getSuperclass().getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check binding for allocation expression
- */
- public void test0253() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0253", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not a classinstancecreation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- IFunctionBinding methodBinding = classInstanceCreation.resolveConstructorBinding();
- assertNotNull("No methodBinding", methodBinding); //$NON-NLS-1$
- assertTrue("Not a constructor", methodBinding.isConstructor()); //$NON-NLS-1$
- assertEquals("Wrong size", 1, methodBinding.getParameterTypes().length); //$NON-NLS-1$
- assertEquals("Wrong type", "String", methodBinding.getParameterTypes()[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check binding for allocation expression
- */
- public void test0254() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0254", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong type", "C", binding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-
- /**
- * Check binding for allocation expression
- */
- public void test0255() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0255", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- }
-
- /**
- * Check binding for allocation expression
- */
- public void test0256() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0256", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- }
-
- /**
- * Check binding for allocation expression
- */
- public void test0257() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0257", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- }
-
- /**
- * Check binding for allocation expression
- */
- public void test0258() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0258", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10663
- */
- public void test0259() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0259", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
- */
- public void test0260() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0260", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- IBinding binding = singleVariableDeclaration.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- Name name = singleVariableDeclaration.getName();
- assertTrue("Not a simple name", name instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- assertEquals("Wrong name", "i", simpleName.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = name.resolveBinding();
- assertNotNull("No binding", binding2); //$NON-NLS-1$
- assertTrue("binding == binding2", binding == binding2); //$NON-NLS-1$
- assertTrue("Not a variable binding", binding2 instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding2;
- assertEquals("Wrong name", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong type", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10679
- */
- public void test0261() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0261", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Wrong msg size", 1, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertEquals("Wrong pb size", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- ITypeBinding binding = expression.resolveTypeBinding();
- assertNull("got a binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10676
- */
- public void test0262() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0262", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expr = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- List arguments = methodInvocation.arguments();
- assertEquals("Wrong argument list size", 1, arguments.size()); //$NON-NLS-1$
- Expression expr2 = (Expression) arguments.get(0);
- assertTrue("Not a class instance creation", expr2 instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expr2;
- arguments = classInstanceCreation.arguments();
- assertEquals("Wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression expression2 = (Expression) arguments.get(0);
- assertTrue("Not a string literal", expression2 instanceof StringLiteral); //$NON-NLS-1$
- StringLiteral stringLiteral = (StringLiteral) expression2;
- ITypeBinding typeBinding = stringLiteral.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "String", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10700
- */
- public void test0263() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0263", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expr = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- List arguments = methodInvocation.arguments();
- assertEquals("Wrong argument list size", 1, arguments.size()); //$NON-NLS-1$
- Expression expr2 = (Expression) arguments.get(0);
- assertTrue("Not a simple name", expr2 instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expr2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10699
- */
- public void test0264() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0264", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong fragment size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a classinstancecreation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- assertNotNull("No anonymousclassdeclaration", anonymousClassDeclaration); //$NON-NLS-1$
- String expectedSourceRange =
- "{\n"+ //$NON-NLS-1$
- " void m(int k){\n"+ //$NON-NLS-1$
- " k= i;\n"+ //$NON-NLS-1$
- " }\n"+ //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(anonymousClassDeclaration, expectedSourceRange, source);
- List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size()); //$NON-NLS-1$
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- assertEquals("Wrong name", "m", methodDeclaration.getName().getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10698
- */
- public void test0265() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0265", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
- */
- public void test0266() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0266", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Inner\\u005b]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type type2 = arrayType.getElementType();
- assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type2;
- checkSourceRange(simpleType, "Inner", source); //$NON-NLS-1$
- Name name = simpleType.getName();
- assertTrue("not a simple name", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- checkSourceRange(simpleName, "Inner", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
- */
- public void test0267() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0267", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Inner[]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type type2 = arrayType.getElementType();
- assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type2;
- checkSourceRange(simpleType, "Inner", source); //$NON-NLS-1$
- Name name = simpleType.getName();
- assertTrue("not a simple name", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- checkSourceRange(simpleName, "Inner", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
- */
- public void test0268() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0268", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "test0268.Test.Inner[]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type type2 = arrayType.getElementType();
- assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type2;
- checkSourceRange(simpleType, "test0268.Test.Inner", source); //$NON-NLS-1$
- Name name = simpleType.getName();
- assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(name, "test0268.Test.Inner", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
- */
- public void test0269() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0269", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "test0269.Test.Inner[/**/]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type type2 = arrayType.getElementType();
- assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type2;
- checkSourceRange(simpleType, "test0269.Test.Inner", source); //$NON-NLS-1$
- Name name = simpleType.getName();
- assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(name, "test0269.Test.Inner", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
- */
- public void test0270() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0270", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "test0270.Test.Inner", source); //$NON-NLS-1$
- assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(name, "test0270.Test.Inner", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
- */
- public void test0271() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0271", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "test0271.Test.Inner[]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type type2 = arrayType.getElementType();
- assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type2;
- checkSourceRange(simpleType, "test0271.Test.Inner", source); //$NON-NLS-1$
- Name name = simpleType.getName();
- assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- checkSourceRange(name, "test0271.Test.Inner", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0272() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0272", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a For statement", node instanceof ForStatement); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- checkSourceRange(forStatement, "for (int i= 0; i < 10; i++) foo();", source); //$NON-NLS-1$
- Statement action = forStatement.getBody();
- checkSourceRange(action, "foo();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0273() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0273", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a For statement", node instanceof ForStatement); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- checkSourceRange(forStatement, "for (int i= 0; i < 10; i++) { foo(); }", source); //$NON-NLS-1$
- Statement action = forStatement.getBody();
- checkSourceRange(action, "{ foo(); }", source); //$NON-NLS-1$
- assertTrue("Not a block", action instanceof Block); //$NON-NLS-1$
- Block block = (Block) action;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- checkSourceRange(stmt, "foo();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0274() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0274", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not a While statement", node instanceof WhileStatement); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node;
- checkSourceRange(whileStatement, "while (i < 10) { foo(i++); }", source); //$NON-NLS-1$
- Statement action = whileStatement.getBody();
- checkSourceRange(action, "{ foo(i++); }", source); //$NON-NLS-1$
- assertTrue("Not a block", action instanceof Block); //$NON-NLS-1$
- Block block = (Block) action;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- checkSourceRange(stmt, "foo(i++);", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0275() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0275", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not a While statement", node instanceof WhileStatement); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node;
- checkSourceRange(whileStatement, "while (i < 10) foo(i++);", source); //$NON-NLS-1$
- Statement action = whileStatement.getBody();
- checkSourceRange(action, "foo(i++);", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10798
- */
- public void test0276() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0276", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "public void foo() {\n" + //$NON-NLS-1$
- " foo();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " foo();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration.getBody(), expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10798
- */
- public void test0277() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0277", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "public void foo() {\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration.getBody(), expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10861
- */
- public void test0278() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0278", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "Class c = java.lang.String.class;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a type literal", expression instanceof TypeLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = expression.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Class", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10861
- */
- public void test0279() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0279", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0,0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- checkSourceRange(variableDeclarationStatement, "Class c = java.lang.String.class;", source); //$NON-NLS-1$
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a type literal", expression instanceof TypeLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = expression.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Class", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10865
- * Check well known types
- */
- public void test0280() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0280", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- AST newAst = result.getAST();
- ITypeBinding typeBinding = newAst.resolveWellKnownType("boolean"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("char"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "char", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("byte"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "byte", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("short"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "short", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("int"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("long"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "long", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("float"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "float", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("double"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "double", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("void"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "void", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Object", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.String"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "String", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.StringBuffer"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "StringBuffer", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.Throwable"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Throwable", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.Exception"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Exception", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.RuntimeException"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "RuntimeException", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.Error"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Error", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.Class"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Class", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("java.lang.Runnable"); //$NON-NLS-1$
- assertNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Cloneable"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.io.Serializable"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Boolean"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Byte"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Character"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Double"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Float"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Integer"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Long"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Short"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- typeBinding = newAst.resolveWellKnownType("java.lang.Void"); //$NON-NLS-1$
- assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0281() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0281", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "Object o= /*]*/new Object()/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "new Object()", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0282() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0282", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "boolean b = /*]*/true/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "true", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0283() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0283", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "char c = /*]*/'c'/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "'c'", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0284() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0284", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "Object o = /*]*/null/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "null", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0285() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0285", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "Object o = /*]*/Object.class/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "Object.class", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0286() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0286", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "int i = /**/(2)/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "(2)", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0287() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0287", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "String[] tab = /**/new String[3]/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "new String[3]", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0288() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0288", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "String[] tab = /**/{ }/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "{ }", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0289() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0289", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "String s = /**/tab1[0]/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "tab1[0]", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0290() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0290", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "Object o = /*]*/new java.lang.Object()/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "new java.lang.Object()", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10898
- */
- public void test0291() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0291", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("no errors", 1, unit.getMessages().length); //$NON-NLS-1$
- assertEquals("no errors", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10913
- */
- public void test0292() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0292", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not a qualifiedName", expression instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expression;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("Wrong name", "x", simpleName.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("NO binding", binding); //$NON-NLS-1$
- assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
- assertEquals("wrong name", "x", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Name name = qualifiedName.getQualifier();
- assertTrue("Not a simpleName", name instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleName2 = (SimpleName) name;
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertTrue("Not a type binding", binding2 instanceof ITypeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Test", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10933
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10935
- */
- public void test0293() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0293", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- assertNotNull("No body", anonymousClassDeclaration); //$NON-NLS-1$
- String expectedSource =
- "{\n" + //$NON-NLS-1$
- " public void run() {\n" + //$NON-NLS-1$
- " /*]*/foo();/*[*/\n" + //$NON-NLS-1$
- " }\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(anonymousClassDeclaration, expectedSource, source);
- expectedSource =
- "run= new Runnable() {\n" + //$NON-NLS-1$
- " public void run() {\n" + //$NON-NLS-1$
- " /*]*/foo();/*[*/\n" + //$NON-NLS-1$
- " }\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(variableDeclarationFragment, expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10984
- */
- public void test0294() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0294", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "public void fails() {\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- Block block = methodDeclaration.getBody();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(block, expectedSource, source);
- node = getASTNode(compilationUnit, 0, 1);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10986
- */
- public void test0295() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0295", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not a method invocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- ITypeBinding typeBinding = methodInvocation.resolveTypeBinding();
- assertNull("type binding is not null", typeBinding); //$NON-NLS-1$
- }
-
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10984
- */
- public void test0296() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0296", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "public void fails() {\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- Block block = methodDeclaration.getBody();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(block, expectedSource, source);
- node = getASTNode(compilationUnit, 0, 1);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11037
- */
- public void test0297() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0297", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- runConversion(AST.JLS3, sourceUnit, false);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10984
- */
- public void test0298() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0298", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a ReturnStatement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- checkSourceRange(expression, "a().length != 3", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11104
- */
- public void test0299() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0299", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "int i = (/**/2/**/);", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a parenthesized expression", expression instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression;
- Expression expression2 = parenthesizedExpression.getExpression();
- checkSourceRange(expression2, "2", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11104
- */
- public void test0300() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0300", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "boolean b = /**/true/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "true", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11104
- */
- public void test0301() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0301", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "Object o = /**/null/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "null", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11106
- */
- public void test0302() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0302", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a DoStatement", node instanceof DoStatement); //$NON-NLS-1$
- DoStatement doStatement = (DoStatement) node;
- String expectedSource =
- "do\n" + //$NON-NLS-1$
- " foo();\n" + //$NON-NLS-1$
- " while(1 < 10);"; //$NON-NLS-1$
- checkSourceRange(doStatement, expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11129
- */
- public void test0303() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0303", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression2 = expressionStatement.getExpression();
- assertTrue("Not an Assignement", expression2 instanceof Assignment); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11151
- */
- public void test0304() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0304", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- checkSourceRange(node, "public void foo(int arg);", source); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- assertNull("Has a body", block); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11125
- */
- public void test0305() {
- char[] source =
- ("package test0305;\n" + //$NON-NLS-1$
- "\n" + //$NON-NLS-1$
- "class Test {\n" + //$NON-NLS-1$
- " public void foo(int arg) {}\n" + //$NON-NLS-1$
- "}").toCharArray(); //$NON-NLS-1$
- IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
- ASTNode result = runConversion(AST.JLS3, source, "Test.js", project, true); //$NON-NLS-1$
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0);
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "test0305", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Not an interface", typeBinding.isClass()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11125
- */
- public void test0306() {
- char[] source =
- ("package java.lang;\n" + //$NON-NLS-1$
- "\n" + //$NON-NLS-1$
- "class Object {\n" + //$NON-NLS-1$
- " public void foo(int arg) {}\n" + //$NON-NLS-1$
- "}").toCharArray(); //$NON-NLS-1$
- IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
- ASTNode result = runConversion(AST.JLS3, source, "Object.js", project, true); //$NON-NLS-1$
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0);
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Object", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "java.lang", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Not an interface", typeBinding.isClass()); //$NON-NLS-1$
- assertEquals("Wrong size", 2, typeBinding.getDeclaredMethods().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11371
- */
- public void test0307() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0307", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- assertNotNull("No body", block); //$NON-NLS-1$
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a super constructor invocation", statement instanceof SuperConstructorInvocation); //$NON-NLS-1$
- checkSourceRange(statement, "super(10);", source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11371
- */
- public void test0308() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0308", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- assertNotNull("No body", block); //$NON-NLS-1$
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a super constructor invocation", statement instanceof SuperConstructorInvocation); //$NON-NLS-1$
- SuperConstructorInvocation superConstructorInvocation = (SuperConstructorInvocation) statement;
- IFunctionBinding methodBinding = superConstructorInvocation.resolveConstructorBinding();
- assertNotNull("No methodBinding", methodBinding); //$NON-NLS-1$
- IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding();
- assertNotNull("No methodBinding2", methodBinding2); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11380
- */
- public void test0309() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0309", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a conditional expression", expression instanceof ConditionalExpression); //$NON-NLS-1$
- ConditionalExpression conditionalExpression = (ConditionalExpression) expression;
- ITypeBinding typeBinding = conditionalExpression.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11380
- */
- public void test0310() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0310", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a qualified name", expression instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expression;
- Name qualifier = qualifiedName.getQualifier();
- IBinding binding = qualifier.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", "I", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11638
- */
- public void test0311() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0311", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- assertNotNull("No body", anonymousClassDeclaration); //$NON-NLS-1$
- List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("wrong size for body declarations", 1, bodyDeclarations.size()); //$NON-NLS-1$
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- assertNotNull("no body", block); //$NON-NLS-1$
- List statements = block.statements();
- assertEquals("Wrong size for statements", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("not a variable declaration statement", statement instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement2 = (VariableDeclarationStatement) statement;
- List fragments2 = variableDeclarationStatement2.fragments();
- assertEquals("wrong size for fragments2", 1, fragments2.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment2 = (VariableDeclarationFragment) fragments2.get(0);
- Expression expression2 = variableDeclarationFragment2.getInitializer();
- assertTrue("Not a name", expression2 instanceof Name); //$NON-NLS-1$
- Name name = (Name) expression2;
- checkSourceRange(name, "j", source); //$NON-NLS-1$
- IBinding binding = name.resolveBinding();
- ASTNode declaringNode = compilationUnit.findDeclaringNode(binding);
- assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
- checkSourceRange(declaringNode, "int j", source); //$NON-NLS-1$
- assertTrue("Not a single variable declaration", declaringNode instanceof SingleVariableDeclaration); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11638
- * There is a error in this source. A is unresolved. Then there is no
- * declaring node.
- */
- public void test0312() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0312", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- assertNotNull("No body", anonymousClassDeclaration); //$NON-NLS-1$
- List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("wrong size for body declarations", 1, bodyDeclarations.size()); //$NON-NLS-1$
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- assertNotNull("no body", block); //$NON-NLS-1$
- List statements = block.statements();
- assertEquals("Wrong size for statements", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("not a variable declaration statement", statement instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement2 = (VariableDeclarationStatement) statement;
- List fragments2 = variableDeclarationStatement2.fragments();
- assertEquals("wrong size for fragments2", 1, fragments2.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment2 = (VariableDeclarationFragment) fragments2.get(0);
- Expression expression2 = variableDeclarationFragment2.getInitializer();
- assertTrue("Not a name", expression2 instanceof Name); //$NON-NLS-1$
- Name name = (Name) expression2;
- checkSourceRange(name, "j", source); //$NON-NLS-1$
- IBinding binding = name.resolveBinding();
- ASTNode declaringNode = compilationUnit.findDeclaringNode(binding);
- assertNull("No declaring node is available", declaringNode); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11659
- */
- public void test0313() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0313", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an InfixExpression", expression instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "i+j", source); //$NON-NLS-1$
- Expression expression2 = infixExpression.getLeftOperand();
- checkSourceRange(expression2, "i", source); //$NON-NLS-1$
- assertTrue("Not a name", expression2 instanceof Name); //$NON-NLS-1$
- Name name = (Name) expression2;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- ASTNode astNode = compilationUnit.findDeclaringNode(binding);
- assertNotNull("No declaring node", astNode); //$NON-NLS-1$
- checkSourceRange(astNode, "int i", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=12326
- */
- public void test0314() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0314", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No result", result); //$NON-NLS-1$
- assertTrue("Not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Wrong line number", 1, compilationUnit.getLineNumber(0)); //$NON-NLS-1$
- // ensure that last character is on the last line
- assertEquals("Wrong line number", 3, compilationUnit.getLineNumber(source.length - 1)); //$NON-NLS-1$
- // source.length is beyond the size of the compilation unit source
- assertEquals("Wrong line number", -1, compilationUnit.getLineNumber(source.length)); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=12326
- */
- public void test0315() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0315", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a Return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not an instanceof expression", expression instanceof InstanceofExpression); //$NON-NLS-1$
- InstanceofExpression instanceOfExpression = (InstanceofExpression) expression;
- Type rightOperand = instanceOfExpression.getRightOperand();
- assertTrue("Not a simpleType", rightOperand instanceof SimpleType); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) rightOperand;
- Name n = simpleType.getName();
- assertTrue("Not a qualified name", n instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName name = (QualifiedName) n;
- checkSourceRange(name, "java.io.Serializable", source); //$NON-NLS-1$
- ITypeBinding typeBinding = name.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Serializable", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Name qualifier = name.getQualifier();
- assertTrue("Not a qualified name", qualifier instanceof QualifiedName); //$NON-NLS-1$
- ITypeBinding typeBinding2 = qualifier.resolveTypeBinding();
- assertNull("typebinding2 is not null", typeBinding2); //$NON-NLS-1$
- IBinding binding = qualifier.resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
- IPackageBinding pBinding = (IPackageBinding) binding;
- assertEquals("Wrong name", "java.io", pBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=12454
- */
- public void test0316() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Hello.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No result", result); //$NON-NLS-1$
- assertTrue("Not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Wrong size", 1, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertEquals("Wrong size", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=12781
- */
- public void test0317() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0317", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("not an instanceof expression", expression instanceof InstanceofExpression); //$NON-NLS-1$
- InstanceofExpression instanceOfExpression = (InstanceofExpression) expression;
- Expression left = instanceOfExpression.getLeftOperand();
- assertTrue("Not a Name", left instanceof Name); //$NON-NLS-1$
- Name name = (Name) left;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", "x", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding = name.resolveTypeBinding();
- assertNotNull("No typebinding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong type", "Object", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Type right = instanceOfExpression.getRightOperand();
- assertTrue("Not a simpleType", right instanceof SimpleType); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) right;
- name = simpleType.getName();
- assertTrue("Not a simpleName", name instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- IBinding binding2 = simpleName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
- assertNotNull("No typeBinding2", typeBinding2); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13233
- */
- public void test0318() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0318", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("No error", 1, unit.getMessages().length); //$NON-NLS-1$
- assertEquals("No error", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0319() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0319", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an array creation", expression instanceof ArrayCreation); //$NON-NLS-1$
- ArrayCreation arrayCreation = (ArrayCreation) expression;
- ITypeBinding typeBinding = arrayCreation.resolveTypeBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ArrayType arrayType = arrayCreation.getType();
- ITypeBinding typeBinding2 = arrayType.resolveBinding();
- assertNotNull("no type binding2", typeBinding2); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Type type = arrayType.getElementType();
- assertTrue("Not a simple type", type instanceof SimpleType); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- ITypeBinding typeBinding3 = simpleType.resolveBinding();
- assertNotNull("no type binding3", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong name", "Object", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0320() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0320", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "int[]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding typeBinding = arrayType.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- Type elementType = arrayType.getElementType();
- assertTrue("Not a simple type", elementType.isPrimitiveType()); //$NON-NLS-1$
- ITypeBinding typeBinding2 = elementType.resolveBinding();
- assertNotNull("No type binding2", typeBinding2); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0321() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0321", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding typeBinding = arrayType.resolveBinding();
- checkSourceRange(type, "java.lang.Object[][]", source); //$NON-NLS-1$
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- Type elementType = arrayType.getComponentType();
- ITypeBinding typeBinding2 = elementType.resolveBinding();
- assertNotNull("No type binding2", typeBinding2); //$NON-NLS-1$
- assertEquals("wrong dimension", 1, typeBinding2.getDimensions()); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Not an array type", elementType.isArrayType()); //$NON-NLS-1$
- Type elementType2 = ((ArrayType) elementType).getComponentType();
- assertTrue("Not a simple type", elementType2.isSimpleType()); //$NON-NLS-1$
- ITypeBinding typeBinding3 = elementType2.resolveBinding();
- assertNotNull("No type binding3", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong dimension", 0, typeBinding3.getDimensions()); //$NON-NLS-1$
- assertEquals("wrong name", "Object", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13231
- */
- public void test0322() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0322", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a FieldDeclaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a null literal", expression instanceof NullLiteral); //$NON-NLS-1$
- NullLiteral nullLiteral = (NullLiteral) expression;
- ITypeBinding typeBinding = nullLiteral.resolveTypeBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not the null type", typeBinding.isNullType()); //$NON-NLS-1$
- assertEquals("Wrong qualified name", typeBinding.getQualifiedName(), "null"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14198
- */
- public void test0323() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0323", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression2 = expressionStatement.getExpression();
- assertTrue("Not an Assignement", expression2 instanceof Assignment); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14198
- */
- public void test0324() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0324", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression2 = expressionStatement.getExpression();
- assertTrue("Not an Assignement", expression2 instanceof Assignment); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14198
- */
- public void test0325() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0325", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression2 = expressionStatement.getExpression();
- assertTrue("Not an Assignement", expression2 instanceof Assignment); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14217
- */
- public void test0326() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0326", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- char[] source = sourceUnit.getSource().toCharArray();
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- checkSourceRange(expressionStatement.getExpression(), "a().f= a()", source); //$NON-NLS-1$
- checkSourceRange(expressionStatement, "a().f= a();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14198
- */
- public void test0327() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0327", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Wrong number of errors", 2, compilationUnit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not an VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0328() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0328", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "java.lang.Object[]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding typeBinding = arrayType.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Type elementType = arrayType.getElementType();
- assertTrue("Not a simple type", elementType.isSimpleType()); //$NON-NLS-1$
- ITypeBinding typeBinding2 = elementType.resolveBinding();
- assertNotNull("No type binding2", typeBinding2); //$NON-NLS-1$
- assertEquals("wrong name", "Object", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a array creation", expression instanceof ArrayCreation); //$NON-NLS-1$
- ITypeBinding typeBinding3 = expression.resolveTypeBinding();
- assertNotNull("No typeBinding3", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ArrayCreation arrayCreation = (ArrayCreation) expression;
- ArrayInitializer arrayInitializer = arrayCreation.getInitializer();
- assertNotNull("not array initializer", arrayInitializer); //$NON-NLS-1$
- ITypeBinding typeBinding4 = arrayInitializer.resolveTypeBinding();
- assertNotNull("No typeBinding4", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0329() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0329", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "java.lang.Object[]", source); //$NON-NLS-1$
- assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding typeBinding = arrayType.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Type elementType = arrayType.getElementType();
- assertTrue("Not a simple type", elementType.isSimpleType()); //$NON-NLS-1$
- ITypeBinding typeBinding2 = elementType.resolveBinding();
- assertNotNull("No type binding2", typeBinding2); //$NON-NLS-1$
- assertEquals("wrong name", "Object", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a array creation", expression instanceof ArrayCreation); //$NON-NLS-1$
- ITypeBinding typeBinding3 = expression.resolveTypeBinding();
- assertNotNull("No typeBinding3", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ArrayCreation arrayCreation = (ArrayCreation) expression;
- ArrayInitializer arrayInitializer = arrayCreation.getInitializer();
- assertNotNull("not array initializer", arrayInitializer); //$NON-NLS-1$
- ITypeBinding typeBinding4 = arrayInitializer.resolveTypeBinding();
- assertNotNull("No typeBinding4", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14313
- */
- public void test0330() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0330", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertEquals("wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
- assertEquals("wrong size", 1, methods.length); //$NON-NLS-1$
- assertTrue("not a constructor", methods[0].isConstructor()); //$NON-NLS-1$
- assertTrue("wrong name", !methods[0].getName().equals("foo")); //$NON-NLS-1$ //$NON-NLS-2$
- node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a methodDeclaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNull("method binding not null", methodBinding); //$NON-NLS-1$
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- ITypeBinding typeBinding2 = expression.resolveTypeBinding();
- assertNotNull("no type binding2", typeBinding2); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14322
- */
- public void test0331() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0331", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not an VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a QualifiedName", expression instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expression;
- IBinding binding = qualifiedName.getName().resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind()); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertTrue("Not a field", variableBinding.isField()); //$NON-NLS-1$
- assertNull("Got a declaring class", variableBinding.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("wrong name", "length", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14403
- */
- public void test0332() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0332", "LocalSelectionTransfer.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0333() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0333", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an array creation", expression instanceof ArrayCreation); //$NON-NLS-1$
- ArrayCreation arrayCreation = (ArrayCreation) expression;
- ITypeBinding typeBinding = arrayCreation.resolveTypeBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "Object[][]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ArrayType arrayType = arrayCreation.getType();
- ITypeBinding typeBinding2 = arrayType.resolveBinding();
- assertNotNull("no type binding2", typeBinding2); //$NON-NLS-1$
- assertEquals("wrong name", "Object[][]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Type type = arrayType.getElementType();
- assertTrue("Not a simple type", type instanceof SimpleType); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- ITypeBinding typeBinding3 = simpleType.resolveBinding();
- assertNotNull("no type binding3", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong name", "Object", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- type = arrayType.getComponentType();
- assertTrue("Not an array type", type instanceof ArrayType); //$NON-NLS-1$
- ArrayType arrayType2 = (ArrayType) type;
- ITypeBinding typeBinding4 = arrayType2.resolveBinding();
- assertNotNull("no type binding4", typeBinding4); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0334() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0334", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an array creation", expression instanceof ArrayCreation); //$NON-NLS-1$
- ArrayCreation arrayCreation = (ArrayCreation) expression;
- ITypeBinding typeBinding = arrayCreation.resolveTypeBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "Object[][][]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ArrayType arrayType = arrayCreation.getType();
- checkSourceRange(arrayType, "Object[10][][]", source); //$NON-NLS-1$
- ITypeBinding typeBinding2 = arrayType.resolveBinding();
- assertNotNull("no type binding2", typeBinding2); //$NON-NLS-1$
- assertEquals("wrong name", "Object[][][]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Type type = arrayType.getElementType();
- assertTrue("Not a simple type", type instanceof SimpleType); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- checkSourceRange(simpleType, "Object", source); //$NON-NLS-1$
- ITypeBinding typeBinding3 = simpleType.resolveBinding();
- assertNotNull("no type binding3", typeBinding3); //$NON-NLS-1$
- assertEquals("wrong name", "Object", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- type = arrayType.getComponentType();
- assertTrue("Not an array type", type instanceof ArrayType); //$NON-NLS-1$
- ArrayType arrayType2 = (ArrayType) type;
- checkSourceRange(arrayType2, "Object[10][]", source); //$NON-NLS-1$
- ITypeBinding typeBinding4 = arrayType2.resolveBinding();
- assertNotNull("no type binding4", typeBinding4); //$NON-NLS-1$
- assertEquals("wrong name", "Object[][]", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- type = arrayType2.getComponentType();
- assertTrue("Not an array type", type instanceof ArrayType); //$NON-NLS-1$
- ArrayType arrayType3 = (ArrayType) type;
- ITypeBinding typeBinding5 = arrayType3.resolveBinding();
- assertNotNull("no type binding5", typeBinding5); //$NON-NLS-1$
- assertEquals("wrong name", "Object[]", typeBinding5.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(arrayType3, "Object[10]", source); //$NON-NLS-1$
- }
-
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14526
- */
- public void test0335() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0335", "ExceptionTestCaseTest.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0);
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertEquals("errors found", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- Type superclassType = typeDeclaration.getSuperclassType();
- assertNotNull("no super class", superclassType); //$NON-NLS-1$
- assertEquals("Wrong type", superclassType.getNodeType(), ASTNode.SIMPLE_TYPE);
- SimpleType simpleType = (SimpleType) superclassType;
- Name name = simpleType.getName();
- assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) name;
- name = qualifiedName.getQualifier();
- assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- qualifiedName = (QualifiedName) name;
- name = qualifiedName.getQualifier();
- assertTrue("not a simple name", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("wrong type", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
- assertEquals("wrong name", "junit", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14526
- */
- public void test0336() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0336", "SorterTest.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertEquals("errors found", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14602
- */
- public void test0337() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0337", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- checkSourceRange(variableDeclarationFragment, "message= Test.m(\"s\", new String[]{\"g\"})", source); //$NON-NLS-1$
- checkSourceRange(fieldDeclaration, "String message= Test.m(\"s\", new String[]{\"g\"});", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14852
- */
- public void test0338() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0338", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List thrownExceptions = methodDeclaration.thrownExceptions();
- assertEquals("Wrong size", 1, thrownExceptions.size()); //$NON-NLS-1$
- Name name = (Name) thrownExceptions.get(0);
- IBinding binding = name.resolveBinding();
- assertEquals("wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertEquals("wrong name", "IOException", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=15061
- */
- public void test0339() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0339", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No errors found", 3, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size()); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclarations.get(0);
- checkSourceRange(methodDeclaration, "int doQuery(boolean x);", source); //$NON-NLS-1$
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- String expectedSource =
- "public void setX(boolean x) {\n" + //$NON-NLS-1$
- " {\n" + //$NON-NLS-1$
- " z\n" + //$NON-NLS-1$
- " }\n" + //$NON-NLS-1$
- "}"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- int methodEndPosition = node.getStartPosition() + node.getLength();
- node = getASTNode(compilationUnit, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- int typeEndPosition = node.getStartPosition() + node.getLength();
- assertEquals("different positions", methodEndPosition, typeEndPosition); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14852
- */
- public void test0340() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "p3", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not an method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertNotNull("No receiver", expression2); //$NON-NLS-1$
- ITypeBinding binding = expression2.resolveTypeBinding();
- assertNotNull("No type binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", "A", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong name", "p2", binding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Not a qualified name", expression2.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expression2;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "A", simpleName.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding = simpleName.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "A", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong name", "p2", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Name name = qualifiedName.getQualifier();
- assertTrue("Not a simple name", name.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName2 = (SimpleName) name;
- assertEquals("wrong name", "p2", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("No binding", binding2); //$NON-NLS-1$
- assertEquals("wrong type", IBinding.PACKAGE, binding2.getKind()); //$NON-NLS-1$
- assertEquals("wrong name", "p2", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) node;
- Expression expression3 = expressionStatement2.getExpression();
- assertTrue("Not an method invocation", expression3.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression3;
- Expression expression4 = methodInvocation2.getExpression();
- assertNotNull("No receiver", expression4); //$NON-NLS-1$
- ITypeBinding binding3 = expression4.resolveTypeBinding();
- assertNotNull("No type binding", binding3); //$NON-NLS-1$
- assertEquals("wrong name", "A", binding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong name", "p1", binding3.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=15804
- */
- public void test0341() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0341", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an if statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- String expectedSource =
- "if (field != null) {\n" + //$NON-NLS-1$
- " throw new IOException();\n" + //$NON-NLS-1$
- " } else if (field == null) {\n" + //$NON-NLS-1$
- " throw new MalformedURLException();\n" + //$NON-NLS-1$
- " } else if (field == null) {\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " } else {\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- IfStatement ifStatement = (IfStatement) node;
- Statement thenStatement = ifStatement.getThenStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new IOException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(thenStatement, expectedSource, source);
- Statement elseStatement = ifStatement.getElseStatement();
- expectedSource =
- "if (field == null) {\n" + //$NON-NLS-1$
- " throw new MalformedURLException();\n" + //$NON-NLS-1$
- " } else if (field == null) {\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " } else {\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(elseStatement, expectedSource, source);
- assertTrue("Not a if statement", elseStatement.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- ifStatement = (IfStatement) elseStatement;
- thenStatement = ifStatement.getThenStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new MalformedURLException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(thenStatement, expectedSource, source);
- elseStatement = ifStatement.getElseStatement();
- expectedSource =
- "if (field == null) {\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " } else {\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(elseStatement, expectedSource, source);
- assertTrue("Not a if statement", elseStatement.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- ifStatement = (IfStatement) elseStatement;
- thenStatement = ifStatement.getThenStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(thenStatement, expectedSource, source);
- elseStatement = ifStatement.getElseStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(elseStatement, expectedSource, source);
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=15657
-// * @deprecated marked deprecated to suppress JDOM-related deprecation warnings
-// */
-// public void test0342() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0342", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// IDOMCompilationUnit dcompUnit = new DOMFactory().createCompilationUnit(sourceUnit.getSource(), sourceUnit.getElementName());
-// assertNotNull("dcompUnit is null", dcompUnit); //$NON-NLS-1$
-//
-// // searching class
-// IDOMType classNode = null;
-// Enumeration children = dcompUnit.getChildren();
-// assertNotNull("dcompUnit has no children", children); //$NON-NLS-1$
-//
-// while (children.hasMoreElements()) {
-// IDOMNode child = (IDOMNode) children.nextElement();
-// if (child.getNodeType() == IDOMNode.TYPE) {
-// classNode = (IDOMType) child;
-// break;
-// }
-// }
-// assertNotNull("classNode is null", classNode); //$NON-NLS-1$
-//
-// // searching for methods
-// children = classNode.getChildren();
-//
-// assertNotNull("classNode has no children", children); //$NON-NLS-1$
-//
-// while (children.hasMoreElements()) {
-// IDOMNode child = (IDOMNode) children.nextElement();
-// if (child.getNodeType() == IDOMNode.METHOD) {
-// IDOMMethod childMethod = (IDOMMethod) child;
-//
-// // returnType is always null;
-// String returnType = childMethod.getReturnType();
-// if (childMethod.isConstructor()) {
-// assertNull(returnType);
-// } else {
-// assertNotNull("no return type", returnType); //$NON-NLS-1$
-// }
-// }
-// }
-// }
-//
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=16051
- */
- public void test0343() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0343", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an if statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- String expectedSource =
- "if (flag)\n" + //$NON-NLS-1$
- " i= 10;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=16132
- */
- public void test0344() throws JavaScriptModelException {
- IJavaScriptProject project = null;
- String pb_assert = null;
- String compiler_source = null;
- String compiler_compliance = null;
- try {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0344", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- project = sourceUnit.getJavaScriptProject();
- pb_assert = project.getOption(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, true);
- compiler_source = project.getOption(JavaScriptCore.COMPILER_SOURCE, true);
- compiler_compliance = project.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true);
- project.setOption(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.ERROR);
- project.setOption(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- project.setOption(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_4);
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- } finally {
- if (project != null) {
- project.setOption(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, pb_assert);
- project.setOption(JavaScriptCore.COMPILER_SOURCE, compiler_source);
- project.setOption(JavaScriptCore.COMPILER_COMPLIANCE, compiler_compliance);
- }
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=17922
- */
- public void test0345() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0345", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an ArrayCreation", expression.getNodeType() == ASTNode.ARRAY_CREATION); //$NON-NLS-1$
- ArrayCreation arrayCreation = (ArrayCreation) expression;
- ArrayType arrayType = arrayCreation.getType();
- IBinding binding2 = arrayType.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertEquals("not a type", binding2.getKind(), IBinding.TYPE); //$NON-NLS-1$
- ITypeBinding typeBinding2 = (ITypeBinding) binding2;
- assertTrue("Not an array type binding2", typeBinding2.isArray()); //$NON-NLS-1$
- Type type = arrayType.getElementType();
- assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("QualifiedName", name.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- SimpleName simpleName = ((QualifiedName) name).getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("not a type", binding.getKind(), IBinding.TYPE); //$NON-NLS-1$
- ITypeBinding typeBinding = (ITypeBinding) binding;
- assertTrue("An array type binding", !typeBinding.isArray()); //$NON-NLS-1$
- Type type2 = fieldDeclaration.getType();
- assertTrue("Not a array type", type2.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType2 = (ArrayType) type2;
- Type type3 = arrayType2.getElementType();
- assertTrue("Not a simple type", type3.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType2 = (SimpleType) type3;
- Name name2 = simpleType2.getName();
- assertTrue("Not a qualified name", name2.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- SimpleName simpleName2 = ((QualifiedName) name2).getName();
- IBinding binding3 = simpleName2.resolveBinding();
- assertNotNull("no binding", binding3); //$NON-NLS-1$
- assertEquals("not a type", binding3.getKind(), IBinding.TYPE); //$NON-NLS-1$
- ITypeBinding typeBinding3 = (ITypeBinding) binding3;
- assertTrue("An array type binding", !typeBinding3.isArray()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0346() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0346", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Vector", source); //$NON-NLS-1$
- assertTrue("not an array type", !type.isArrayType()); //$NON-NLS-1$
- assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("Not a simpleName", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- ITypeBinding typeBinding = (ITypeBinding) binding;
- assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding2 = simpleType.resolveBinding();
- assertNotNull("No binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, typeBinding2.getKind()); //$NON-NLS-1$
- assertTrue("An array", !typeBinding2.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0347() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0347", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Vector[]", source); //$NON-NLS-1$
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding binding = arrayType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not an array type", binding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector[]", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0348() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0348", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Vector[][]", source); //$NON-NLS-1$
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding binding = arrayType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not an array type", binding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector[][]", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0349() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0349", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Vector[][]", source); //$NON-NLS-1$
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding binding = arrayType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not an array type", binding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector[][]", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0350() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0350", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Vector", source); //$NON-NLS-1$
- assertTrue("not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- ITypeBinding binding = simpleType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("An array type", binding.isClass()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18169
- */
- public void test0351() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0351", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "int a", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "int[] b", source); //$NON-NLS-1$
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "int a", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "int b[]", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18169
- */
- public void test0352() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0352", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "final int a", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "final int[] b", source); //$NON-NLS-1$
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "final int a", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "final int b[]", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18042
- */
- public void test0353() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0353", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "InputStream", source); //$NON-NLS-1$
- assertTrue("not a simple type", type.isSimpleType()); //$NON-NLS-1$
- ITypeBinding binding = type.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not a class", binding.isClass()); //$NON-NLS-1$
- assertEquals("Wrong name", "InputStream", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "java.io", binding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- IBinding binding2 = name.resolveBinding();
- assertNotNull("No binding", binding2); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding2.getKind()); //$NON-NLS-1$
- ITypeBinding typeBinding = (ITypeBinding) binding2;
- assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
- assertEquals("Wrong name", "InputStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "java.io", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=19851
- */
- public void test0354() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0354", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 2, compilationUnit.getMessages().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=20520
- */
- public void test0355() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0355", "Foo.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not an if statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node;
- Expression condition = ifStatement.getExpression();
- assertTrue("Not an infixExpression", condition.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) condition;
- Expression expression = infixExpression.getLeftOperand();
- assertTrue("Not a method invocation expression", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a parenthesis expression", expression2.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=20865
- */
- public void test0356() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0356", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 1, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- ITypeBinding binding = type.resolveBinding();
- assertNotNull("Binding should NOT be null for type: "+type, binding);
-
- // Verify that class instance creation has a null binding
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Expect only one fragment for VariableDeclarationStatement: "+variableDeclarationStatement, 1, fragments.size());
- node = (ASTNode) fragments.get(0);
- assertEquals("Not a variable declaration fragment", ASTNode.VARIABLE_DECLARATION_FRAGMENT, node.getNodeType()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) node;
- Expression initializer = fragment.getInitializer();
- assertEquals("Expect a class instance creation for initializer: "+initializer, ASTNode.CLASS_INSTANCE_CREATION, initializer.getNodeType()); //$NON-NLS-1$
- ClassInstanceCreation instanceCreation = (ClassInstanceCreation) initializer;
- type = instanceCreation.getType();
- binding = type.resolveBinding();
- assertNull("Binding should BE null for type: "+type, binding);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21757
- */
- public void test0357() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0357", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration statement", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- SimpleName name = typeDeclaration.getName();
- checkSourceRange(name, "A", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21768
- */
- public void test0358() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0358", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0);
- assertNotNull(node);
- assertTrue("Not a method declaration statement", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName name = methodDeclaration.getName();
- checkSourceRange(name, "mdd", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21768
- */
- public void test0359() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0359", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0);
- assertNotNull(node);
- assertTrue("Not a method declaration statement", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName name = methodDeclaration.getName();
- checkSourceRange(name, "mdd", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21916
- */
- public void test0360() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0360", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("Wrong size", 1, initializers.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21916
- */
- public void test0361() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0361", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("Wrong size", 1, initializers.size()); //$NON-NLS-1$
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21916
- */
- public void test0362() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0362", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
-
- VariableDeclarationFragment iFragment = this.ast.newVariableDeclarationFragment();
- iFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- iFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationFragment jFragment = this.ast.newVariableDeclarationFragment();
- jFragment.setName(this.ast.newSimpleName("j")); //$NON-NLS-1$
- jFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationFragment kFragment = this.ast.newVariableDeclarationFragment();
- kFragment.setName(this.ast.newSimpleName("k")); //$NON-NLS-1$
- kFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
-
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(iFragment);
- variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- variableDeclarationExpression.fragments().add(jFragment);
- variableDeclarationExpression.fragments().add(kFragment);
- forStatement.initializers().add(variableDeclarationExpression);
-
- PostfixExpression iPostfixExpression = this.ast.newPostfixExpression();
- iPostfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- iPostfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(iPostfixExpression);
-
- PostfixExpression jPostfixExpression = this.ast.newPostfixExpression();
- jPostfixExpression.setOperand(this.ast.newSimpleName("j"));//$NON-NLS-1$
- jPostfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(jPostfixExpression);
-
- PostfixExpression kPostfixExpression = this.ast.newPostfixExpression();
- kPostfixExpression.setOperand(this.ast.newSimpleName("k"));//$NON-NLS-1$
- kPostfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(kPostfixExpression);
-
- forStatement.setBody(this.ast.newBlock());
-
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
-
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (int i=0, j=0, k=0; i<10 ; i++, j++, k++) {}", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22939
- */
- public void test0363() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0363", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a parenthesized expression", expression.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION); //$NON-NLS-1$
- Expression expression2 = ((ParenthesizedExpression) expression).getExpression();
- checkSourceRange(expression2, "xxxx", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11529
- */
- public void test0364() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0364", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- checkSourceRange(variableDeclarationStatement, "int local;", source); //$NON-NLS-1$
- SimpleName simpleName = variableDeclarationFragment.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11529
- */
- public void test0365() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0365", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("Wrong size", 1, initializers.size()); //$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) initializers.get(0);
- List fragments = variableDeclarationExpression.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- SimpleName simpleName = variableDeclarationFragment.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0366() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0366", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- checkSourceRange(forStatement, "for (int i = 0; i < 5; ++i);", source); //$NON-NLS-1$
- Statement statement = forStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0367() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0367", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a while statement", node.getNodeType() == ASTNode.WHILE_STATEMENT); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node;
- checkSourceRange(whileStatement, "while(i == 2);", source); //$NON-NLS-1$
- Statement statement = whileStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0368() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0368", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertProblemsSize(compilationUnit, 1, "The label test is never explicitly referenced"); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a labeled statement", node.getNodeType() == ASTNode.LABELED_STATEMENT); //$NON-NLS-1$
- LabeledStatement labeledStatement = (LabeledStatement) node;
- checkSourceRange(labeledStatement, "test:;", source); //$NON-NLS-1$
- Statement statement = labeledStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0369() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0369", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertProblemsSize(compilationUnit, 1, "The label test is never explicitly referenced"); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a labeled statement", node.getNodeType() == ASTNode.LABELED_STATEMENT); //$NON-NLS-1$
- LabeledStatement labeledStatement = (LabeledStatement) node;
- checkSourceRange(labeledStatement, "test:\\u003B", source); //$NON-NLS-1$
- Statement statement = labeledStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, "\\u003B", source); //$NON-NLS-1$
- }
-
- /**
- * DoStatement ==> DoStatement
- */
- public void test0370() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0370", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- DoStatement doStatement = this.ast.newDoStatement();
- doStatement.setBody(this.ast.newEmptyStatement());
- doStatement.setExpression(this.ast.newBooleanLiteral(true));
- assertTrue("Both AST trees should be identical", doStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "do ; while(true);";//$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- DoStatement doStatement2 = (DoStatement) node;
- Statement statement = doStatement2.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0371() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0371", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a labeled statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node;
- checkSourceRange(ifStatement, "if (i == 6);", source); //$NON-NLS-1$
- Statement statement = ifStatement.getThenStatement();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0372() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0372", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a labeled statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node;
- checkSourceRange(ifStatement, "if (i == 6) {} else ;", source); //$NON-NLS-1$
- Statement statement = ifStatement.getElseStatement();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23118
- */
- public void test0373() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0373", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- Statement statement = forStatement.getBody();
- assertTrue("Not a block statement", statement.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- Block block = (Block) statement;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(0);
- assertTrue("Not a break statement", statement2.getNodeType() == ASTNode.BREAK_STATEMENT); //$NON-NLS-1$
- BreakStatement breakStatement = (BreakStatement) statement2;
- checkSourceRange(breakStatement, "break;", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23118
- */
- public void test0374() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0374", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- Statement statement = forStatement.getBody();
- assertTrue("Not a block statement", statement.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- Block block = (Block) statement;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(0);
- assertTrue("Not a break statement", statement2.getNodeType() == ASTNode.CONTINUE_STATEMENT); //$NON-NLS-1$
- ContinueStatement continueStatement = (ContinueStatement) statement2;
- checkSourceRange(continueStatement, "continue;", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23052
- */
- public void test0375() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0375", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("problems found", 1, compilationUnit.getMessages().length); //$NON-NLS-1$
- List imports = compilationUnit.imports();
- assertEquals("wrong size", 1, imports.size()); //$NON-NLS-1$
- ImportDeclaration importDeclaration = (ImportDeclaration) imports.get(0);
- IBinding binding = importDeclaration.resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("Not a type binding", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22939
- */
- public void test0376() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0376", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23050
- */
- public void test0377() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0377", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = variableDeclarationFragment.resolveBinding();
- assertNotNull("No variable binding", variableBinding); //$NON-NLS-1$
- assertEquals("Wrong modifier", IModifierConstants.ACC_FINAL, variableBinding.getModifiers()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22161
- */
- public void test0378() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0378", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- SimpleName name = typeDeclaration.getName();
- checkSourceRange(name, "B", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22161
- */
- public void test0379() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0379", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation2 = (ClassInstanceCreation) expression;
- Type type = classInstanceCreation2.getType();
- checkSourceRange(type, "Object", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22054
- */
- public void test0380() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0380", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not a super method invocation", expression.getNodeType() == ASTNode.SUPER_METHOD_INVOCATION); //$NON-NLS-1$
- SuperMethodInvocation superMethodInvocation = (SuperMethodInvocation) expression;
- ITypeBinding typeBinding = superMethodInvocation.resolveTypeBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong declaring class", typeBinding.getSuperclass().getName(), "Object"); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName = superMethodInvocation.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.METHOD, binding.getKind()); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding;
- assertEquals("Wrong declaring class", methodBinding.getDeclaringClass().getName(), "Object"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23054
- */
- public void test0381() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0381", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- JSdoc javadoc = typeDeclaration.getJavadoc();
- assertNull("Javadoc not null", javadoc); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0382() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0382", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong fully qualified name", typeBinding.getQualifiedName(), "test0382.A"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0383() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0383", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong fully qualified name", typeBinding.getQualifiedName(), "test0383.A.B"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0384() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0384", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong fully qualified name", typeBinding.getQualifiedName(), "test0384.A.B.D"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23117
- */
- public void test0385() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0385", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 1, compilationUnit.getMessages().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23259
- */
- public void test0386() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0386", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a switch statement", node.getNodeType() == ASTNode.SWITCH_STATEMENT); //$NON-NLS-1$
- SwitchStatement switchStatement = (SwitchStatement) node;
- List statements = switchStatement.statements();
- assertEquals("Wrong size", 5, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a case statement", statement.getNodeType() == ASTNode.SWITCH_CASE); //$NON-NLS-1$
- checkSourceRange(statement, "case 1:", source); //$NON-NLS-1$
- statement = (Statement) statements.get(3);
- assertTrue("Not a default case statement", statement.getNodeType() == ASTNode.SWITCH_CASE); //$NON-NLS-1$
- checkSourceRange(statement, "default :", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22939
- */
- public void test0387() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0387", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0388() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0388", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "test0388.A", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0389() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0389", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "test0389.A.B", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0390() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0390", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "int", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0391() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0391", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "int[]", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22154
- */
- public void test0392() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0392", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "java.lang.String[]", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23284
- */
- public void test0393() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0393", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- checkSourceRange(type, "String", source); //$NON-NLS-1$
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "java.lang.String", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong dimension", 1, methodDeclaration.getExtraDimensions()); //$NON-NLS-1$
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull("No method binding", methodBinding); //$NON-NLS-1$
- ITypeBinding typeBinding2 = methodBinding.getReturnType();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "java.lang.String[]", typeBinding2.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong dimension", 1, typeBinding2.getDimensions()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23284
- */
- public void test0394() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0394", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- checkSourceRange(type, "String", source); //$NON-NLS-1$
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "java.lang.String", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong dimension", 0, methodDeclaration.getExtraDimensions()); //$NON-NLS-1$
- }
-
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23284
- */
- public void test0395() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0395", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- checkSourceRange(type, "String[]", source); //$NON-NLS-1$
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong dimension", 1, typeBinding.getDimensions()); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "java.lang.String[]", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong dimension", 1, methodDeclaration.getExtraDimensions()); //$NON-NLS-1$
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull("No method binding", methodBinding); //$NON-NLS-1$
- ITypeBinding typeBinding2 = methodBinding.getReturnType();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Wrong qualified name", "java.lang.String[][]", typeBinding2.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong dimension", 2, typeBinding2.getDimensions()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23284
- */
- public void test0396() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0396", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) method.parameters().get(0);
- assertNotNull("Expression should not be null", singleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange(singleVariableDeclaration, "final String s[]", source); //$NON-NLS-1$
- Type type = singleVariableDeclaration.getType();
- checkSourceRange(type, "String", source); //$NON-NLS-1$
- assertEquals("Wrong dimension", 1, singleVariableDeclaration.getExtraDimensions()); //$NON-NLS-1$
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("An array binding", !typeBinding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
- assertEquals("wrong fully qualified name", "java.lang.String", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- IVariableBinding variableBinding = singleVariableDeclaration.resolveBinding();
- assertNotNull("No variable binding", variableBinding); //$NON-NLS-1$
- assertTrue("Is a parameter", variableBinding.isParameter());
- ITypeBinding typeBinding2 = variableBinding.getType();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- assertTrue("Not an array binding", typeBinding2.isArray()); //$NON-NLS-1$
- assertEquals("Wrong dimension", 1, typeBinding2.getDimensions()); //$NON-NLS-1$
- assertEquals("wrong fully qualified name", "java.lang.String[]", typeBinding2.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23284
- */
- public void test0397() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0397", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) method.parameters().get(0);
- assertNotNull("Expression should not be null", singleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange(singleVariableDeclaration, "final String[] \\u0073\\u005B][]", source); //$NON-NLS-1$
- Type type = singleVariableDeclaration.getType();
- checkSourceRange(type, "String[]", source); //$NON-NLS-1$
- assertEquals("Wrong dimension", 2, singleVariableDeclaration.getExtraDimensions()); //$NON-NLS-1$
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not an array binding", typeBinding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong dimension", 1, typeBinding.getDimensions()); //$NON-NLS-1$
- assertEquals("wrong fully qualified name", "java.lang.String[]", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- IVariableBinding variableBinding = singleVariableDeclaration.resolveBinding();
- assertNotNull("No variable binding", variableBinding); //$NON-NLS-1$
- assertTrue("Is a parameter", variableBinding.isParameter());
- ITypeBinding typeBinding2 = variableBinding.getType();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- assertTrue("Not an array binding", typeBinding2.isArray()); //$NON-NLS-1$
- assertEquals("Wrong dimension", 3, typeBinding2.getDimensions()); //$NON-NLS-1$
- assertEquals("wrong fully qualified name", "java.lang.String[][][]", typeBinding2.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23362
- */
- public void test0398() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0398", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an infix expression", expression.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "(1 + 2) * 3", source); //$NON-NLS-1$
- Expression expression2 = infixExpression.getLeftOperand();
- assertTrue("Not an parenthesis expression", expression2.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- assertTrue("Not an infix expression", expression3.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- checkSourceRange(expression3, "1 + 2", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22306
- */
- public void test0399() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0399", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor()); //$NON-NLS-1$
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22306
- */
- public void test0400() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0400", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor()); //$NON-NLS-1$
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 3, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an superconstructorinvocation", statement.getNodeType() == ASTNode.SUPER_CONSTRUCTOR_INVOCATION); //$NON-NLS-1$
- checkSourceRange(statement, "super();", source); //$NON-NLS-1$
- }
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterBindingsTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterBindingsTest.java
deleted file mode 100644
index efa3e8f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterBindingsTest.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-
-public class ASTConverterBindingsTest extends ConverterTestSetup {
- private static final boolean DEBUG = false;
-
- static class BindingsCollector extends ASTVisitor {
-
- public ArrayList arrayList;
-
- BindingsCollector() {
- // visit Javadoc.tags() as well
- super(true);
- this.arrayList = new ArrayList();
- }
-
- private void collectBindings(
- ASTNode node,
- IBinding binding) {
-
- if (binding != null) {
- arrayList.add(binding);
- }
- }
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(AnonymousClassDeclaration)
- */
- public void endVisit(AnonymousClassDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayAccess)
- */
- public void endVisit(ArrayAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayCreation)
- */
- public void endVisit(ArrayCreation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayInitializer)
- */
- public void endVisit(ArrayInitializer node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayType)
- */
- public void endVisit(ArrayType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(Assignment)
- */
- public void endVisit(Assignment node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(BooleanLiteral)
- */
- public void endVisit(BooleanLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(CharacterLiteral)
- */
- public void endVisit(CharacterLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ClassInstanceCreation)
- */
- public void endVisit(ClassInstanceCreation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ConditionalExpression)
- */
- public void endVisit(ConditionalExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ConstructorInvocation)
- */
- public void endVisit(ConstructorInvocation node) {
- IFunctionBinding methodBinding = node.resolveConstructorBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FieldAccess)
- */
- public void endVisit(FieldAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ImportDeclaration)
- */
- public void endVisit(ImportDeclaration node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(InfixExpression)
- */
- public void endVisit(InfixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(InstanceofExpression)
- */
- public void endVisit(InstanceofExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- public void endVisit(ListExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see ASTVisitor#endVisit(MemberRef)
- * @since 3.0
- */
- public void endVisit(MemberRef node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FunctionDeclaration)
- */
- public void endVisit(FunctionDeclaration node) {
- IFunctionBinding methodBinding = node.resolveBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FunctionInvocation)
- */
- public void endVisit(FunctionInvocation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see ASTVisitor#endVisit(FunctionRef )
- * @since 3.0
- */
- public void endVisit(FunctionRef node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(NullLiteral)
- */
- public void endVisit(NullLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(NumberLiteral)
- */
- public void endVisit(NumberLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PackageDeclaration)
- */
- public void endVisit(PackageDeclaration node) {
- IPackageBinding packageBinding = node.resolveBinding();
- collectBindings(node, packageBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ParenthesizedExpression)
- */
- public void endVisit(ParenthesizedExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PostfixExpression)
- */
- public void endVisit(PostfixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PrefixExpression)
- */
- public void endVisit(PrefixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PrimitiveType)
- */
- public void endVisit(PrimitiveType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(QualifiedName)
- */
- public void endVisit(QualifiedName node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SimpleName)
- */
- public void endVisit(SimpleName node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SimpleType)
- */
- public void endVisit(SimpleType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SingleVariableDeclaration)
- */
- public void endVisit(SingleVariableDeclaration node) {
- IVariableBinding variableBinding = node.resolveBinding();
- collectBindings(node, variableBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(StringLiteral)
- */
- public void endVisit(StringLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperConstructorInvocation)
- */
- public void endVisit(SuperConstructorInvocation node) {
- IFunctionBinding methodBinding = node.resolveConstructorBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperFieldAccess)
- */
- public void endVisit(SuperFieldAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperMethodInvocation)
- */
- public void endVisit(SuperMethodInvocation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ThisExpression)
- */
- public void endVisit(ThisExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(TypeDeclaration)
- */
- public void endVisit(TypeDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(TypeLiteral)
- */
- public void endVisit(TypeLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(VariableDeclarationExpression)
- */
- public void endVisit(VariableDeclarationExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(VariableDeclarationFragment)
- */
- public void endVisit(VariableDeclarationFragment node) {
- IVariableBinding variableBinding = node.resolveBinding();
- collectBindings(node, variableBinding);
- }
-
- public List getBindings() {
- return arrayList;
- }
-
- }
-
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS3);
- }
-
- public ASTConverterBindingsTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(ASTConverterBindingsTest.class);
- }
-
- public void test0001() throws JavaScriptModelException {
- checkBindingEqualityForProject("Converter");
- checkBindingEqualityForProject("Converter15");
- }
-
- /**
- * @throws JavaScriptModelException
- */
- private void checkBindingEqualityForProject(String projectName) throws JavaScriptModelException {
- IJavaScriptProject javaProject = getJavaProject(projectName);
- IPackageFragment[] packageFragments = javaProject.getPackageFragments();
- ArrayList compilationUnitscollector = new ArrayList();
- for (int j = 0, max2 = packageFragments.length; j < max2; j++) {
- IJavaScriptUnit[] units = packageFragments[j].getJavaScriptUnits();
- if (units != null) {
- for (int k = 0, max3 = units.length; k < max3; k++) {
- compilationUnitscollector.add(units[k]);
- }
- }
- }
- final int length = compilationUnitscollector.size();
- IJavaScriptUnit[] units = new IJavaScriptUnit[length];
- compilationUnitscollector.toArray(units);
- long totalTime = 0;
- for (int j = 0; j < length; j++) {
- IJavaScriptUnit currentUnit = units[j];
- ASTNode result = runConversion(AST.JLS3, currentUnit, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) result;
- result = runConversion(AST.JLS3, currentUnit, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
- if (DEBUG) {
- if (unit.types().size() > 0 ) {
- AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) unit.types().get(0);
- StringBuffer buffer = new StringBuffer();
- PackageDeclaration packageDeclaration = unit.getPackage();
- if (packageDeclaration != null) {
- buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName());
- } else {
- buffer.append(typeDeclaration.getName());
- }
- System.out.println(String.valueOf(buffer));
- } else {
- System.out.println(currentUnit.getElementName());
- }
- }
- JavaScriptUnit unit2 = (JavaScriptUnit) result;
- BindingsCollector collector = new BindingsCollector();
- unit.accept(collector);
- List bindings1 = collector.getBindings();
- BindingsCollector collector2 = new BindingsCollector();
- unit2.accept(collector2);
- List bindings2 = collector2.getBindings();
- assertEquals("Wrong size", bindings1.size(), bindings2.size());
- long time = System.currentTimeMillis();
- for (int i = 0, max = bindings1.size(); i < max; i++) {
- final Object object = bindings1.get(i);
- assertTrue("not a binding", object instanceof IBinding);
- final IBinding binding = (IBinding) object;
- final Object object2 = bindings2.get(i);
- assertTrue("not a binding", object2 instanceof IBinding);
- final IBinding binding2 = (IBinding) object2;
- final boolean equalTo = binding.isEqualTo(binding2);
- assertTrue("not equals", equalTo);
- }
- totalTime += (System.currentTimeMillis() - time);
- }
- if (DEBUG) {
- System.out.println("Total time = " + totalTime + "ms");
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterJavadocTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterJavadocTest.java
deleted file mode 100644
index c7900f6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterJavadocTest.java
+++ /dev/null
@@ -1,3405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.Comment;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.TagElement;
-import org.eclipse.wst.jsdt.core.dom.TextElement;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.internal.compiler.parser.ScannerHelper;
-
-public class ASTConverterJavadocTest extends ConverterTestSetup {
-
- // Flag to know whether Converter directory should be copied from org.eclipse.wst.jsdt.core.tests.model project
- static protected boolean COPY_DIR = true;
-
- // Test counters
- protected static int[] TEST_COUNTERS = { 0, 0, 0, 0 };
- // Unicode tests
- protected static boolean UNICODE = false;
- // Unix tests
- final boolean unix;
- static final String UNIX_SUPPORT = System.getProperty("unix");
- // Doc Comment support
- static final String DOC_COMMENT_SUPPORT = System.getProperty("doc.support");
- final String docCommentSupport;
-
- // List of comments read from source of test
- private final int LINE_COMMENT = 100;
- private final int BLOCK_COMMENT =200;
- private final int DOC_COMMENT = 300;
- List comments = new ArrayList();
- private String chars;
- // List of tags contained in each comment read from test source.
- List allTags = new ArrayList();
- // Current compilation unit
- protected IJavaScriptUnit sourceUnit;
- // Test package binding
- protected boolean resolveBinding = true;
- protected boolean packageBinding = true;
- // AST Level
- /** @deprecated using deprecated code */
- protected int astLevel = AST.JLS2;
- protected int savedLevel;
- // Debug
- protected String prefix = "";
- protected boolean debug = false;
- protected StringBuffer problems;
- protected String compilerOption = JavaScriptCore.IGNORE;
- protected List failures;
- protected boolean stopOnFailure = true;
- // Project
- protected IJavaScriptProject currentProject;
- Map savedOptions = null;
-
- /**
- * @param name
- * @param support
- */
- public ASTConverterJavadocTest(String name, String support, String unix) {
- super(name);
- this.docCommentSupport = support;
- this.unix = "true".equals(unix);
- }
- /**
- * @param name
- */
- public ASTConverterJavadocTest(String name) {
- this(name, JavaScriptCore.ENABLED, UNIX_SUPPORT);
- }
-
- public static Test suite() {
- TestSuite suite = new Suite(ASTConverterJavadocTest.class.getName());
-// String param = System.getProperty("unicode");
-// if ("true".equals(param)) {
-// unicode = true;
-// }
-// String param = System.getProperty("unix");
-// if ("true".equals(param)) {
-// unix = true;
-// }
- if (true) {
- if (DOC_COMMENT_SUPPORT == null) {
- buildSuite(suite, JavaScriptCore.ENABLED);
- buildSuite(suite, JavaScriptCore.DISABLED);
- } else {
- String support = DOC_COMMENT_SUPPORT==null ? JavaScriptCore.DISABLED : (DOC_COMMENT_SUPPORT.equals(JavaScriptCore.DISABLED)?JavaScriptCore.DISABLED:JavaScriptCore.ENABLED);
- buildSuite(suite, support);
- }
- return suite;
- }
-
- // Run test cases subset
- COPY_DIR = false;
- System.err.println("WARNING: only subset of tests will be executed!!!");
- suite.addTest(new ASTConverterJavadocTest("testBug165525"));
- return suite;
- }
-
- public static void buildSuite(TestSuite suite, String support) {
- Class c = ASTConverterJavadocTest.class;
- Method[] methods = c.getMethods();
- for (int i = 0, max = methods.length; i < max; i++) {
- if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$
- suite.addTest(new ASTConverterJavadocTest(methods[i].getName(), support, UNIX_SUPPORT));
- }
- }
- // when unix support not specified, also run using unix format
- if (UNIX_SUPPORT == null && JavaScriptCore.ENABLED.equals(support)) {
- for (int i = 0, max = methods.length; i < max; i++) {
- if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$
- suite.addTest(new ASTConverterJavadocTest(methods[i].getName(), support, "true"));
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests#copyDirectory(java.io.File, java.io.File)
- */
- protected void copyDirectory(File sourceDir, File targetDir) throws IOException {
- if (COPY_DIR) {
- super.copyDirectory(sourceDir, targetDir);
- } else {
- targetDir.mkdirs();
- File sourceFile = new File(sourceDir, ".project");
- File targetFile = new File(targetDir, ".project");
- targetFile.createNewFile();
- copy(sourceFile, targetFile);
- sourceFile = new File(sourceDir, ".classpath");
- targetFile = new File(targetDir, ".classpath");
- targetFile.createNewFile();
- copy(sourceFile, targetFile);
- }
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#getName()
- */
- public String getName() {
- String strUnix = unix ? " - Unix" : "";
- return "Doc "+docCommentSupport+strUnix+" - "+super.getName();
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- TEST_COUNTERS[0]++;
- failures = new ArrayList();
- problems = new StringBuffer();
- workingCopies = null;
- savedLevel = astLevel;
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- int size = failures.size();
- String title = size+" positions/bindings were incorrect in "+getName();
- if (size == 0) {
- TEST_COUNTERS[1]++;
- } else if (problems.length() > 0) {
- if (debug) {
- System.out.println("Compilation warnings/errors occured:");
- System.out.println(problems.toString());
- }
- TEST_COUNTERS[2]++;
- } else {
- TEST_COUNTERS[3]++;
- System.out.println(title+":");
- for (int i=0; i<size; i++) {
- System.out.println(" - "+failures.get(i));
- }
- }
-// if (!stopOnFailure) {
- assertTrue(title, size==0 || problems.length() > 0);
-// }
- super.tearDown();
-
- // Restore saved ast level
- astLevel = savedLevel;
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- public void tearDownSuite() throws Exception {
- // put default options on project
- if (currentProject != null && savedOptions != null) {
- currentProject.setOptions(savedOptions);
- }
- super.tearDownSuite();
- if (TEST_COUNTERS[0] != TEST_COUNTERS[1]) {
- NumberFormat intFormat = NumberFormat.getInstance();
- intFormat.setMinimumIntegerDigits(3);
- intFormat.setMaximumIntegerDigits(3);
- System.out.println("=====================================");
- System.out.println(intFormat.format(TEST_COUNTERS[0])+" tests have been executed:");
- System.out.println(" - "+intFormat.format(TEST_COUNTERS[1])+" tests have been actually executed.");
- System.out.println(" - "+intFormat.format(TEST_COUNTERS[2])+" tests were skipped due to compilation errors.");
- System.out.println(" - "+intFormat.format(TEST_COUNTERS[3])+" tests failed.");
- }
- }
-
- public ASTNode runConversion(char[] source, String unitName, IJavaScriptProject project) {
- ASTParser parser = ASTParser.newParser(astLevel);
- parser.setSource(source);
- parser.setUnitName(unitName);
- parser.setProject(project);
- parser.setResolveBindings(resolveBinding);
- return parser.createAST(null);
- }
-
- public ASTNode runConversion(char[] source, String unitName, IJavaScriptProject project, Map options) {
- if (project == null) {
- ASTParser parser = ASTParser.newParser(astLevel);
- parser.setSource(source);
- parser.setUnitName(unitName);
- parser.setCompilerOptions(options);
- parser.setResolveBindings(resolveBinding);
- return parser.createAST(null);
- }
- return runConversion(source, unitName, project);
- }
-
-// NOT USED
-// class ASTConverterJavadocFlattener extends ASTVisitor {
-//
-// /**
-// * The string buffer into which the serialized representation of the AST is
-// * written.
-// */
-// private StringBuffer buffer;
-//
-// private String comment;
-//
-// /**
-// * Creates a new AST printer.
-// */
-// ASTConverterJavadocFlattener(String comment) {
-// buffer = new StringBuffer();
-// comment = comment;
-// }
-//
-// /**
-// * Returns the string accumulated in the visit.
-// *
-// * @return the serialized
-// */
-// public String getResult() {
-// return buffer.toString();
-// }
-//
-// /**
-// * Resets this printer so that it can be used again.
-// */
-// public void reset() {
-// buffer.setLength(0);
-// }
-//
-// /*
-// * @see ASTVisitor#visit(ArrayType)
-// */
-// public boolean visit(ArrayType node) {
-// node.getComponentType().accept(this);
-// buffer.append("[]");//$NON-NLS-1$
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(BlockComment)
-// * @since 3.0
-// */
-// public boolean visit(BlockComment node) {
-// buffer.append(comment);
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(Javadoc)
-// */
-// public boolean visit(Javadoc node) {
-//
-// // ignore deprecated node.getComment()
-// buffer.append("/**");//$NON-NLS-1$
-// ASTNode e = null;
-// int start = 3;
-// for (Iterator it = node.tags().iterator(); it.hasNext(); ) {
-// e = (ASTNode) it.next();
-// try {
-// buffer.append(comment.substring(start, e.getStartPosition()-node.getStartPosition()));
-// start = e.getStartPosition()-node.getStartPosition();
-// } catch (IndexOutOfBoundsException ex) {
-// // do nothing
-// }
-// e.accept(this);
-// start += e.getLength();
-// }
-// buffer.append(comment.substring(start, node.getLength()));
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(LineComment)
-// * @since 3.0
-// */
-// public boolean visit(LineComment node) {
-// buffer.append(comment);
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(MemberRef)
-// * @since 3.0
-// */
-// public boolean visit(MemberRef node) {
-// if (node.getQualifier() != null) {
-// node.getQualifier().accept(this);
-// }
-// buffer.append("#");//$NON-NLS-1$
-// node.getName().accept(this);
-// return true;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(FunctionRef)
-// * @since 3.0
-// */
-// public boolean visit(FunctionRef node) {
-// if (node.getQualifier() != null) {
-// node.getQualifier().accept(this);
-// }
-// buffer.append("#");//$NON-NLS-1$
-// node.getName().accept(this);
-// buffer.append("(");//$NON-NLS-1$
-// for (Iterator it = node.parameters().iterator(); it.hasNext(); ) {
-// FunctionRefParameter e = (FunctionRefParameter) it.next();
-// e.accept(this);
-// if (it.hasNext()) {
-// buffer.append(",");//$NON-NLS-1$
-// }
-// }
-// buffer.append(")");//$NON-NLS-1$
-// return true;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(FunctionRefParameter)
-// * @since 3.0
-// */
-// public boolean visit(FunctionRefParameter node) {
-// node.getType().accept(this);
-// if (node.getName() != null) {
-// buffer.append(" ");//$NON-NLS-1$
-// node.getName().accept(this);
-// }
-// return true;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(TagElement)
-// * @since 3.0
-// */
-// public boolean visit(TagElement node) {
-// Javadoc javadoc = null;
-// int start = 0;
-// if (node.isNested()) {
-// // nested tags are always enclosed in braces
-// buffer.append("{");//$NON-NLS-1$
-// javadoc = (Javadoc) node.getParent().getParent();
-// start++;
-// } else {
-// javadoc = (Javadoc) node.getParent();
-// }
-// start += node.getStartPosition()-javadoc.getStartPosition();
-// if (node.getTagName() != null) {
-// buffer.append(node.getTagName());
-// start += node.getTagName().length();
-// }
-// for (Iterator it = node.fragments().iterator(); it.hasNext(); ) {
-// ASTNode e = (ASTNode) it.next();
-// try {
-// buffer.append(comment.substring(start, e.getStartPosition()-javadoc.getStartPosition()));
-// start = e.getStartPosition()-javadoc.getStartPosition();
-// } catch (IndexOutOfBoundsException ex) {
-// // do nothing
-// }
-// start += e.getLength();
-// e.accept(this);
-// }
-// if (node.isNested()) {
-// buffer.append("}");//$NON-NLS-1$
-// }
-// return true;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(TextElement)
-// * @since 3.0
-// */
-// public boolean visit(TextElement node) {
-// buffer.append(node.getText());
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(PrimitiveType)
-// */
-// public boolean visit(PrimitiveType node) {
-// buffer.append(node.getPrimitiveTypeCode().toString());
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(QualifiedName)
-// */
-// public boolean visit(QualifiedName node) {
-// node.getQualifier().accept(this);
-// buffer.append(".");//$NON-NLS-1$
-// node.getName().accept(this);
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(SimpleName)
-// */
-// public boolean visit(SimpleName node) {
-// buffer.append(node.getIdentifier());
-// return false;
-// }
-//
-// /*
-// * @see ASTVisitor#visit(SimpleName)
-// */
-// public boolean visit(SimpleType node) {
-// node.getName().accept(this);
-// return false;
-// }
-// }
-
- private char getNextChar(char[] source, int idx) {
- // get next char
- char ch = source[idx];
- int charLength = 1;
- int pos = idx;
- chars = null;
- if (ch == '\\' && source[idx+1] == 'u') {
- //-------------unicode traitement ------------
- int c1, c2, c3, c4;
- charLength++;
- while (source[idx+charLength] == 'u') charLength++;
- if (((c1 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15
- || c1 < 0)
- || ((c2 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15 || c2 < 0)
- || ((c3 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15 || c3 < 0)
- || ((c4 = ScannerHelper.getNumericValue(source[idx+charLength++])) > 15 || c4 < 0)) {
- return ch;
- }
- ch = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
- chars = new String(source, pos, charLength);
- }
- return ch;
- }
- /*
- * Convert Javadoc source to match Javadoc.toString().
- * Store converted comments and their corresponding tags respectively
- * in comments and allTags fields
- */
- protected void setSourceComment(char[] source) throws ArrayIndexOutOfBoundsException {
- comments = new ArrayList();
- allTags = new ArrayList();
- StringBuffer buffer = null;
- int comment = 0;
- boolean end = false, lineStarted = false;
- String tag = null;
- List tags = new ArrayList();
- int length = source.length;
- char previousChar=0, currentChar=0;
- for (int i=0; i<length;) {
- previousChar = currentChar;
- // get next char
- currentChar = getNextChar(source, i);
- i += (chars==null) ? 1 : chars.length();
-
- //
- switch (comment) {
- case 0:
- switch (currentChar) {
- case '/':
- comment = 1; // first char for comments...
- buffer = new StringBuffer();
- if (chars == null) buffer.append(currentChar);
- else buffer.append(chars);
- break;
- case '\'':
- while (i<length) {
- // get next char
- currentChar = getNextChar(source, i);
- i += (chars==null) ? 1 : chars.length();
- if (currentChar == '\\') {
- // get next char
- currentChar = getNextChar(source, i);
- i += (chars==null) ? 1 : chars.length();
- } else {
- if (currentChar == '\'') {
- break;
- }
- }
- }
- break;
- case '"':
- while (i<length) {
- // get next char
- currentChar = getNextChar(source, i);
- i += (chars==null) ? 1 : chars.length();
- if (currentChar == '\\') {
- // get next char
- currentChar = getNextChar(source, i);
- i += (chars==null) ? 1 : chars.length();
- } else {
- if (currentChar == '"') {
- // get next char
- currentChar = getNextChar(source, i);
- if (currentChar == '"') {
- i += (chars==null) ? 1 : chars.length();
- } else {
- break;
- }
- }
- }
- }
- break;
- }
- break;
- case 1: // first '/' has been found...
- switch (currentChar) {
- case '/':
- if (chars == null) buffer.append(currentChar);
- else buffer.append(chars);
- comment = LINE_COMMENT;
- break;
- case '*':
- if (chars == null) buffer.append(currentChar);
- else buffer.append(chars);
- comment = 2; // next step
- break;
- default:
- comment = 0;
- break;
- }
- break;
- case 2: // '/*' has been found...
- if (currentChar == '*') {
- comment = 3; // next step...
- } else {
- comment = BLOCK_COMMENT;
- }
- if (chars == null) buffer.append(currentChar);
- else buffer.append(chars);
- break;
- case 3: // '/**' has bee found, verify that's not an empty block comment
- if (currentChar == '/') { // empty block comment
- if (chars == null) buffer.append(currentChar);
- else buffer.append(chars);
- comments.add(buffer.toString());
- allTags.add(new ArrayList());
- comment = 0;
- break;
- }
- // do not break, directly go to next case...
- comment = DOC_COMMENT;
- case DOC_COMMENT:
- if (tag != null) {
- if (currentChar >= 'a' && currentChar <= 'z') {
- tag += currentChar;
- } else {
- tags.add(tag);
- tag = null;
- }
- }
- switch (currentChar) {
- case '@':
- if (!lineStarted || previousChar == '{') {
- tag = "";
- lineStarted = true;
- }
- break;
- case '\r':
- case '\n':
- lineStarted = false;
- break;
- case '*':
- break;
- default:
- if (!Character.isWhitespace(currentChar)) {
- lineStarted = true;
- }
- }
- case BLOCK_COMMENT:
- if (chars == null) buffer.append(currentChar);
- else buffer.append(chars);
- if (end && currentChar == '/') {
- comment = 0;
- lineStarted = false;
- comments.add(buffer.toString());
- allTags.add(tags);
- tags = new ArrayList();
- }
- end = currentChar == '*';
- break;
- case LINE_COMMENT:
- if (currentChar == '\r' || currentChar == '\n') {
- /*
- if (currentChar == '\r' && source[i+1] == '\n') {
- buffer.append(source[++i]);
- }
- */
- comment = 0;
- comments.add(buffer.toString());
- allTags.add(tags);
- } else {
- if (chars == null) buffer.append(currentChar);
- else buffer.append(chars);
- }
- break;
- default:
- // do nothing
- break;
- }
- }
- }
-
- /*
- * Convert Javadoc source to match Javadoc.toString().
- * Store converted comments and their corresponding tags respectively
- * in comments and allTags fields
- */
- char[] getUnicodeSource(char[] source) {
- int length = source.length;
- int unicodeLength = length*6;
- char[] unicodeSource = new char[unicodeLength];
- int u=0;
- for (int i=0; i<length; i++) {
- // get next char
- if (source[i] == '\\' && source[i+1] == 'u') {
- //-------------unicode traitement ------------
- int c1, c2, c3, c4;
- unicodeSource[u++] = source[i];
- unicodeSource[u++] = source[++i];
- if (((c1 = ScannerHelper.getNumericValue(source[i+1])) > 15
- || c1 < 0)
- || ((c2 = ScannerHelper.getNumericValue(source[i+2])) > 15 || c2 < 0)
- || ((c3 = ScannerHelper.getNumericValue(source[i+3])) > 15 || c3 < 0)
- || ((c4 = ScannerHelper.getNumericValue(source[i+4])) > 15 || c4 < 0)) {
- throw new RuntimeException("Invalid unicode in source at "+i);
- }
- for (int j=0; j<4; j++) unicodeSource[u++] = source[++i];
- } else {
- unicodeSource[u++] = '\\';
- unicodeSource[u++] = 'u';
- unicodeSource[u++] = '0';
- unicodeSource[u++] = '0';
- int val = source[i]/16;
- unicodeSource[u++] = (char) (val<10 ? val+ 0x30 : val-10+0x61);
- val = source[i]%16;
- unicodeSource[u++] = (char) (val<10 ? val+ 0x30 : val-10+0x61);
- }
- }
- // Return one well sized array
- if (u != unicodeLength) {
- char[] result = new char[u];
- System.arraycopy(unicodeSource, 0, result, 0, u);
- return result;
- }
- return unicodeSource;
- }
-
- /*
- * Convert Javadoc source to match Javadoc.toString().
- * Store converted comments and their corresponding tags respectively
- * in comments and allTags fields
- */
- char[] getUnixSource(char[] source) {
- int length = source.length;
- int unixLength = length;
- char[] unixSource = new char[unixLength];
- int u=0;
- for (int i=0; i<length; i++) {
- // get next char
- if (source[i] == '\r' && source[i+1] == '\n') {
- i++;
- }
- unixSource[u++] = source[i];
- }
- // Return one well sized array
- if (u != unixLength) {
- char[] result = new char[u];
- System.arraycopy(unixSource, 0, result, 0, u);
- return result;
- }
- return unixSource;
- }
-
- /*
- * Return all tags number for a given Javadoc
- */
- int allTags(JSdoc docComment) {
- int all = 0;
- // Count main tags
- Iterator tags = docComment.tags().listIterator();
- while (tags.hasNext()) {
- TagElement tagElement = (TagElement) tags.next();
- if (tagElement.getTagName() != null) {
- all++;
- }
- Iterator fragments = tagElement.fragments().listIterator();
- while (fragments.hasNext()) {
- ASTNode node = (ASTNode) fragments.next();
- if (node.getNodeType() == ASTNode.TAG_ELEMENT) {
- all++;
- }
- }
- }
- return all;
- }
-
- /*
- * Add a failure to the list. Use only one method as it easier to put breakpoint to
- * debug failure when it occurs...
- */
- private void addFailure(String msg) {
- failures.add(msg);
- }
-
- /*
- * Put the failure message in list instead of throwing exception immediately.
- * This allow to store several failures per test...
- * @see tearDown method which finally throws the execption to signal that test fails.
- */
- protected void assumeTrue(String msg, boolean cond) {
- if (!cond) {
- addFailure(msg);
- if (stopOnFailure) assertTrue(msg, cond);
- }
- }
-
- /*
- * Put the failure message in list instead of throwing exception immediately.
- * This allow to store several failures per test...
- * @see tearDown method which finally throws the execption to signal that test fails.
- */
- protected void assumeNull(String msg, Object obj) {
- if (obj != null) {
- addFailure(msg);
- if (stopOnFailure) assertNull(msg, obj);
- }
- }
-
- /*
- * Put the failure message in list instead of throwing exception immediately.
- * This allow to store several failures per test...
- * @see tearDown method which finally throws the execption to signal that test fails.
- */
- protected void assumeNotNull(String msg, Object obj) {
- if (obj == null) {
- addFailure(msg);
- if (stopOnFailure) assertNotNull(msg, obj);
- }
- }
-
- /*
- * Put the failure message in list instead of throwing exception immediately.
- * This allow to store several failures per test...
- * @see tearDown method which finally throws the execption to signal that test fails.
- */
- protected void assumeEquals(String msg, int expected, int actual) {
- if (expected != actual) {
- addFailure(msg+", expected="+expected+" actual="+actual);
- if (stopOnFailure) assertEquals(msg, expected, actual);
- }
- }
-
- /*
- * Put the failure message in list instead of throwing exception immediately.
- * This allow to store several failures per test...
- * @see tearDown method which finally throws the execption to signal that test fails.
- */
- protected void assumeEquals(String msg, Object expected, Object actual) {
- if (expected == null && actual == null)
- return;
- if (expected != null && expected.equals(actual))
- return;
- addFailure(msg+", expected:<"+expected+"> actual:<"+actual+'>');
- if (stopOnFailure) assertEquals(msg, expected, actual);
- }
-
- /*
- * Verify positions of tags in source
- */
- private void verifyPositions(JSdoc docComment, char[] source) {
- boolean stop = stopOnFailure;
-// stopOnFailure = false;
- // Verify javadoc start and end position
- int start = docComment.getStartPosition();
- int end = start+docComment.getLength()-1;
- assumeTrue(prefix+"Misplaced javadoc start at <"+start+">: "+docComment, source[start++] == '/' && source[start++] == '*' && source[start++] == '*');
- // Get first meaningful character
- int tagStart = start;
- // Verify tags
- Iterator tags = docComment.tags().listIterator();
- while (tags.hasNext()) {
- while (source[tagStart] == '*' || Character.isWhitespace(source[tagStart])) {
- tagStart++; // purge non-stored characters
- }
- TagElement tagElement = (TagElement) tags.next();
- int teStart = tagElement.getStartPosition();
- assumeEquals(prefix+"Wrong start position <"+teStart+"> for tag element: "+tagElement, tagStart, teStart);
- verifyPositions(tagElement, source);
- tagStart += tagElement.getLength();
- }
- while (source[tagStart] == '*' || Character.isWhitespace(source[tagStart])) {
- tagStart++; // purge non-stored characters
- }
- assumeTrue(prefix+"Misplaced javadoc end at <"+tagStart+'>', source[tagStart-1] == '*' && source[tagStart] == '/');
- assumeEquals(prefix+"Wrong javadoc length at <"+end+">: ", tagStart, end);
- stopOnFailure = stop;
- assertTrue(!stop || failures.size()==0);
- }
-
- /**
- * Verify positions of fragments in source
- * @deprecated using deprecated code
- */
- private void verifyPositions(TagElement tagElement, char[] source) {
- String text = null;
- // Verify tag name
- String tagName = tagElement.getTagName();
- int tagStart = tagElement.getStartPosition();
- if (tagElement.isNested()) {
- assumeEquals(prefix+"Wrong start position <"+tagStart+"> for "+tagElement, '{', source[tagStart++]);
- }
- if (tagName != null) {
- text= new String(source, tagStart, tagName.length());
- assumeEquals(prefix+"Misplaced tag name at <"+tagStart+">: ", tagName, text);
- tagStart += tagName.length();
- }
- // Verify each fragment
- ASTNode previousFragment = null;
- Iterator elements = tagElement.fragments().listIterator();
- while (elements.hasNext()) {
- ASTNode fragment = (ASTNode) elements.next();
- if (fragment.getNodeType() == ASTNode.TEXT_ELEMENT) {
- if (previousFragment == null && TagElement.TAG_PARAM.equals(tagName) && ((TextElement)fragment).getText().equals("<")) { // special case here for @param <E> syntax
- int start = tagStart;
- // verify '<'
- while (source[start] == ' ' || Character.isWhitespace(source[start])) {
- start++; // purge white characters
- }
- text = new String(source, start, fragment.getLength());
- assumeEquals(prefix+"Misplaced text element at <"+fragment.getStartPosition()+">: ", text, ((TextElement) fragment).getText());
- start += fragment.getLength();
- // verify simple name
- assumeTrue(prefix+"Unexpected fragment end for "+tagElement, elements.hasNext());
- fragment = (ASTNode) elements.next();
- while (source[start] == ' ' || Character.isWhitespace(source[start])) {
- start++; // purge white characters
- }
- assumeEquals(prefix+"Unexpected node type for tag element "+tagElement, ASTNode.SIMPLE_NAME, fragment.getNodeType());
- Name name = (Name) fragment;
- verifyNamePositions(start, name, source);
- start += fragment.getLength();
- // verify simple name
- assumeTrue(prefix+"Unexpected fragment end for "+tagElement, elements.hasNext());
- fragment = (ASTNode) elements.next();
- while (source[start] == ' ' || Character.isWhitespace(source[start])) {
- start++; // purge white characters
- }
- text = new String(source, start, fragment.getLength());
- assumeEquals(prefix+"Misplaced text element at <"+fragment.getStartPosition()+">: ", text, ((TextElement) fragment).getText());
- start += fragment.getLength();
- // reset fragment as simple name to avoid issue with next text element
- fragment = name;
- tagStart += (start- tagStart) - name.getLength();
- } else {
- if (previousFragment == null) {
- if (tagName != null && (source[tagStart] == '\r' || source[tagStart] == '\n')) {
- while (source[tagStart] == '*' || Character.isWhitespace(source[tagStart])) {
- tagStart++; // purge non-stored characters
- }
- }
- } else {
- if (previousFragment.getNodeType() == ASTNode.TEXT_ELEMENT) {
- assumeTrue(prefix+"Wrong length at <"+previousFragment.getStartPosition()+"> for text element "+previousFragment, (source[tagStart] == '\r' /* && source[tagStart+1] == '\n' */ || source[tagStart] == '\n'));
- while (source[tagStart] == '*' || Character.isWhitespace(source[tagStart])) {
- tagStart++; // purge non-stored characters
- }
- } else if (TagElement.TAG_PARAM.equals(tagName) && previousFragment.getNodeType() == ASTNode.SIMPLE_NAME && ((TextElement)fragment).getText().equals(">")) {
- while (source[tagStart] == ' ' || Character.isWhitespace(source[tagStart])) {
- tagStart++; // purge white characters
- }
- } else {
- int start = tagStart;
- boolean newLine = false;
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- if (source[tagStart] == '\r' || source[tagStart] == '\n') {
- newLine = true;
- }
- }
- if (newLine) tagStart = start;
- }
- }
- text = new String(source, tagStart, fragment.getLength());
- assumeEquals(prefix+"Misplaced text element at <"+fragment.getStartPosition()+">: ", text, ((TextElement) fragment).getText());
- }
- } else {
- while (source[tagStart] == '*' || Character.isWhitespace(source[tagStart])) {
- tagStart++; // purge non-stored characters
- }
- if (fragment.getNodeType() == ASTNode.SIMPLE_NAME || fragment.getNodeType() == ASTNode.QUALIFIED_NAME) {
- verifyNamePositions(tagStart, (Name) fragment, source);
- } else if (fragment.getNodeType() == ASTNode.TAG_ELEMENT) {
- TagElement inlineTag = (TagElement) fragment;
- assumeEquals(prefix+"Tag element <"+inlineTag+"> has wrong start position", tagStart, inlineTag.getStartPosition());
- verifyPositions(inlineTag, source);
- } else if (fragment.getNodeType() == ASTNode.MEMBER_REF) {
- MemberRef memberRef = (MemberRef) fragment;
- // Store start position
- int start = tagStart;
- // Verify qualifier position
- Name qualifier = memberRef.getQualifier();
- if (qualifier != null) {
- verifyNamePositions(start, qualifier, source);
- start += qualifier.getLength();
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
- }
- // Verify member separator position
- assumeEquals(prefix+"Misplaced # separator at <"+start+"> for member ref "+memberRef, '#', source[start]);
- start++;
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
- // Verify member name position
- Name name = memberRef.getName();
- text = new String(source, start, name.getLength());
- assumeEquals(prefix+"Misplaced member ref at <"+start+">: ", text, name.toString());
- verifyNamePositions(start, name, source);
- } else if (fragment.getNodeType() == ASTNode.FUNCTION_REF) {
- FunctionRef methodRef = (FunctionRef) fragment;
- // Store start position
- int start = tagStart;
- // Verify qualifier position
- Name qualifier = methodRef.getQualifier();
- if (qualifier != null) {
- verifyNamePositions(start, qualifier, source);
- start += qualifier.getLength();
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
- }
- // Verify member separator position
- assumeEquals(prefix+"Misplaced # separator at <"+start+"> for method ref: "+methodRef, '#', source[start]);
- start++;
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
- // Verify member name position
- Name name = methodRef.getName();
- int nameLength = name.getLength();
- text = new String(source, start, nameLength);
- if (!text.equals(name.toString())) { // may have qualified constructor reference for inner classes
- if (methodRef.getQualifier().isQualifiedName()) {
- text = new String(source, start, methodRef.getQualifier().getLength());
- assumeEquals(prefix+"Misplaced method ref name at <"+start+">: ", text, methodRef.getQualifier().toString());
- while (source[start] != '.' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
- start++;
- } else {
- while (source[start] != '.' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
- start++;
- text = new String(source, start, nameLength);
- assumeEquals(prefix+"Misplaced method ref name at <"+start+">: ", text, name.toString());
- }
- }
- verifyNamePositions(start, name, source);
- start += nameLength;
- // Verify arguments starting open parenthesis
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
-// assumeEquals(prefix+"Misplaced ( at <"+start+"> for method ref: "+methodRef, '(', source[start]);
- if (source[start] == '(') { // now method reference may have no parenthesis...
- start++;
- // Verify parameters
- Iterator parameters = methodRef.parameters().listIterator();
- while (parameters.hasNext()) {
- FunctionRefParameter param = (FunctionRefParameter) parameters.next();
- boolean lastParam = !parameters.hasNext();
- // Verify parameter type positions
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++; // purge non-stored characters
- }
- Type type = param.getType();
- if (type.isSimpleType()) {
- verifyNamePositions(start, ((SimpleType)type).getName(), source);
- } else if (type.isPrimitiveType()) {
- text = new String(source, start, type.getLength());
- assumeEquals(prefix+"Misplaced method ref parameter type at <"+start+"> for method ref: "+methodRef, text, type.toString());
- } else if (type.isArrayType()) {
- Type elementType = ((ArrayType) param.getType()).getElementType();
- if (elementType.isSimpleType()) {
- verifyNamePositions(start, ((SimpleType)elementType).getName(), source);
- } else if (elementType.isPrimitiveType()) {
- text = new String(source, start, elementType.getLength());
- assumeEquals(prefix+"Misplaced method ref parameter type at <"+start+"> for method ref: "+methodRef, text, elementType.toString());
- }
- }
- start += type.getLength();
- // if last param then perhaps a varargs
- while (Character.isWhitespace(source[start])) { // do NOT accept '*' in parameter declaration
- start++; // purge non-stored characters
- }
- if (lastParam && this.astLevel != AST.JLS2 && param.isVarargs()) {
- for (int p=0;p<3;p++) {
- assumeTrue(prefix+"Missing ellipsis for vararg method ref parameter at <"+start+"> for method ref: "+methodRef, source[start++]=='.');
- }
- }
- // Verify parameter name positions
- while (Character.isWhitespace(source[start])) { // do NOT accept '*' in parameter declaration
- start++; // purge non-stored characters
- }
- name = param.getName();
- if (name != null) {
- text = new String(source, start, name.getLength());
- assumeEquals(prefix+"Misplaced method ref parameter name at <"+start+"> for method ref: "+methodRef, text, name.toString());
- start += name.getLength();
- }
- // Verify end parameter declaration
- while (source[start] == '*' || Character.isWhitespace(source[start])) {
- start++;
- }
- assumeTrue(prefix+"Misplaced parameter end at <"+start+"> for method ref: "+methodRef, source[start] == ',' || source[start] == ')');
- start++;
- if (source[start] == ')') {
- break;
- }
- }
- }
- }
- }
- tagStart += fragment.getLength();
- previousFragment = fragment;
- }
- if (tagElement.isNested()) {
- assumeEquals(prefix+"Wrong end character at <"+tagStart+"> for "+tagElement, '}', source[tagStart++]);
- }
- }
-
- /*
- * Verify each name component positions.
- */
- private void verifyNamePositions(int nameStart, Name name, char[] source) {
- if (name.isQualifiedName()) {
- QualifiedName qualified = (QualifiedName) name;
- int start = qualified.getName().getStartPosition();
- String str = new String(source, start, qualified.getName().getLength());
- assumeEquals(prefix+"Misplaced or wrong name for qualified name: "+name, str, qualified.getName().toString());
- verifyNamePositions(nameStart, ((QualifiedName) name).getQualifier(), source);
- }
- String str = new String(source, nameStart, name.getLength());
- if (str.indexOf('\n') < 0) { // cannot compare if text contains new line
- assumeEquals(prefix+"Misplaced name for qualified name: ", str, name.toString());
- } else if (debug) {
- System.out.println(prefix+"Name contains new line for qualified name: "+name);
- }
- }
-
- /*
- * Verify that bindings of Javadoc comment structure are resolved or not.
- * For expected unresolved binding, verify that following text starts with 'Unknown'
- */
- private void verifyBindings(JSdoc docComment) {
- boolean stop = stopOnFailure;
-// stopOnFailure = false;
- // Verify tags
- Iterator tags = docComment.tags().listIterator();
- while (tags.hasNext()) {
- verifyBindings((TagElement) tags.next());
- }
- stopOnFailure = stop;
- assertTrue(!stop || failures.size()==0);
- }
-
- /*
- * Verify that bindings of Javadoc tag structure are resolved or not.
- * For expected unresolved binding, verify that following text starts with 'Unknown'
- */
- private void verifyBindings(TagElement tagElement) {
- // Verify each fragment
- Iterator elements = tagElement.fragments().listIterator();
- IBinding previousBinding = null;
- ASTNode previousFragment = null;
- boolean resolvedBinding = false;
- while (elements.hasNext()) {
- ASTNode fragment = (ASTNode) elements.next();
- if (fragment.getNodeType() == ASTNode.TEXT_ELEMENT) {
- TextElement text = (TextElement) fragment;
- if (resolvedBinding) {
- if (previousBinding == null) {
- assumeTrue(prefix+"Reference '"+previousFragment+"' should be bound!", text.getText().trim().indexOf("Unknown")>=0);
- } else {
- assumeTrue(prefix+"Unknown reference '"+previousFragment+"' should NOT be bound!", text.getText().trim().indexOf("Unknown")<0);
- }
- }
- previousBinding = null;
- resolvedBinding = false;
- } else if (fragment.getNodeType() == ASTNode.TAG_ELEMENT) {
- verifyBindings((TagElement) fragment);
- previousBinding = null;
- resolvedBinding = false;
- } else {
- resolvedBinding = true;
- if (fragment.getNodeType() == ASTNode.SIMPLE_NAME) {
- previousBinding = ((Name)fragment).resolveBinding();
- } else if (fragment.getNodeType() == ASTNode.QUALIFIED_NAME) {
- QualifiedName name = (QualifiedName) fragment;
- previousBinding = name.resolveBinding();
- verifyNameBindings(name);
- } else if (fragment.getNodeType() == ASTNode.MEMBER_REF) {
- MemberRef memberRef = (MemberRef) fragment;
- previousBinding = memberRef.resolveBinding();
- if (previousBinding != null) {
- SimpleName name = memberRef.getName();
- assumeNotNull(prefix+""+name+" binding was not foundfound in "+fragment, name.resolveBinding());
- verifyNameBindings(memberRef.getQualifier());
- }
- } else if (fragment.getNodeType() == ASTNode.FUNCTION_REF) {
- FunctionRef methodRef = (FunctionRef) fragment;
- previousBinding = methodRef.resolveBinding();
- if (previousBinding != null) {
- SimpleName methodName = methodRef.getName();
- IBinding methNameBinding = methodName.resolveBinding();
- Name methodQualifier = methodRef.getQualifier();
- // TODO (frederic) Replace the two following lines by commented block when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=62650 will be fixed
- assumeNotNull(prefix+""+methodName+" binding was not found in "+fragment, methNameBinding);
- verifyNameBindings(methodQualifier);
- /*
- if (methodQualifier == null) {
- if (methNameBinding == null) {
- char firstChar = methodName.getIdentifier().charAt(0);
- if (Character.isUpperCase(firstChar)) {
- // assume that selector starting with uppercase is for constructor => signal that binding is null
- System.out.println(prefix+"Binding for selector of '"+methodRef+"' is null.");
- }
- } else {
- if (methNameBinding.getName().equals(methodName.getIdentifier())) { // binding is not null only for constructor
- assumeNotNull(prefix+""+methodName+" binding was not found!",methNameBinding);
- } else {
- assumeNull(prefix+""+methodName+" binding should be null!", methNameBinding);
- }
- }
- } else {
- SimpleName methodSimpleType = null;
- if (methodQualifier.isQualifiedName()) {
- methodSimpleType = ((QualifiedName)methodQualifier).getName();
- } else {
- methodSimpleType = (SimpleName) methodQualifier;
- }
- if (methodSimpleType.getIdentifier().equals(methodName.getIdentifier())) { // binding is not null only for constructor
- assumeNotNull(prefix+""+methodName+" binding was not found!",methNameBinding);
- } else {
- assumeNull(prefix+""+methodName+" binding should be null!", methNameBinding);
- }
- verifyNameBindings(methodRef.getQualifier());
- }
- */
- Iterator parameters = methodRef.parameters().listIterator();
- while (parameters.hasNext()) {
- FunctionRefParameter param = (FunctionRefParameter) parameters.next();
- Type type = param.getType();
- assumeNotNull(prefix+""+type+" binding was not found in "+fragment, type.resolveBinding());
- if (type.isSimpleType()) {
- verifyNameBindings(((SimpleType)type).getName());
- } else if (type.isArrayType()) {
- Type elementType = ((ArrayType) param.getType()).getElementType();
- assumeNotNull(prefix+""+elementType+" binding was not found in "+fragment, elementType.resolveBinding());
- if (elementType.isSimpleType()) {
- verifyNameBindings(((SimpleType)elementType).getName());
- }
- }
- // Do not verify parameter name as no binding is expected for them
- }
- }
- }
- }
- previousFragment = fragment;
- }
- assumeTrue(prefix+"Reference '"+(previousFragment==null?tagElement:previousFragment)+"' should be bound!", (!resolvedBinding || previousBinding != null));
- }
-
- /*
- * Verify each name component binding.
- */
- private void verifyNameBindings(Name name) {
- if (name != null) {
- IBinding binding = name.resolveBinding();
- if (name.toString().indexOf("Unknown") > 0) {
- assumeNull(prefix+name+" binding should be null!", binding);
- } else {
- assumeNotNull(prefix+name+" binding was not found!", binding);
- }
- SimpleName simpleName = null;
- int index = 0;
- while (name.isQualifiedName()) {
- simpleName = ((QualifiedName) name).getName();
- binding = simpleName.resolveBinding();
- if (simpleName.getIdentifier().equalsIgnoreCase("Unknown")) {
- assumeNull(prefix+simpleName+" binding should be null!", binding);
- } else {
- assumeNotNull(prefix+simpleName+" binding was not found!", binding);
- }
- if (index > 0 && packageBinding) {
- assumeEquals(prefix+"Wrong binding type!", IBinding.PACKAGE, binding.getKind());
- }
- index++;
- name = ((QualifiedName) name).getQualifier();
- binding = name.resolveBinding();
- if (name.toString().indexOf("Unknown") > 0) {
- assumeNull(prefix+name+" binding should be null!", binding);
- } else {
- assumeNotNull(prefix+name+" binding was not found!", binding);
- }
- if (packageBinding) {
- assumeEquals(prefix+"Wrong binding type!", IBinding.PACKAGE, binding.getKind());
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void verifyComments(String test) throws JavaScriptModelException {
- IJavaScriptUnit[] units = getCompilationUnits("Converter" , "src", "javadoc."+test); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- for (int i=0; i<units.length; i++) {
- verifyComments(units[i]);
- }
- }
-
- /*
- * Verify the comments of a compilation unit.
- */
- protected void verifyWorkingCopiesComments() throws JavaScriptModelException {
- assumeNotNull("No working copies to verify!", workingCopies);
- int length = workingCopies.length;
- assumeTrue("We need to have at least one working copy to verify!", length>0);
- for (int i=0; i<length; i++) {
- verifyComments(workingCopies[i]);
- }
- }
-
- /*
- * Verify the comments of a compilation unit.
- */
- protected JavaScriptUnit verifyComments(IJavaScriptUnit unit) throws JavaScriptModelException {
- // Get test file
- sourceUnit = unit;
- prefix = unit.getElementName()+": ";
-
- // Get current project
- String sourceStr = sourceUnit.getSource();
- if (savedOptions != null && !sourceUnit.getJavaScriptProject().getElementName().equals(currentProject.getElementName())) {
- currentProject.setOptions(savedOptions);
- savedOptions = null;
- }
- currentProject = sourceUnit.getJavaScriptProject();
- if (savedOptions == null) savedOptions = currentProject.getOptions(false);
-
- // set up java project options
- currentProject.setOption(JavaScriptCore.COMPILER_PB_INVALID_JAVADOC, compilerOption);
- currentProject.setOption(JavaScriptCore.COMPILER_PB_MISSING_JAVADOC_TAGS, compilerOption);
- currentProject.setOption(JavaScriptCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS, compilerOption);
- currentProject.setOption(JavaScriptCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME, JavaScriptCore.IGNORE);
- currentProject.setOption(JavaScriptCore.COMPILER_DOC_COMMENT_SUPPORT, docCommentSupport);
-
- // Verify source regardings converted comments
- char[] source = sourceStr.toCharArray();
- String fileName = unit.getPath().toString();
- try {
- return verifyComments(fileName, source);
- }
- catch (RuntimeException ex) {
- TEST_COUNTERS[3]++;
- throw ex;
- }
- }
-
- protected JavaScriptUnit verifyComments(String fileName, char[] source) {
- return verifyComments(fileName, source, null);
- }
-
- protected JavaScriptUnit verifyComments(String fileName, char[] source, Map options) {
-
- // Verify comments either in unicode or not
- char[] testedSource = source;
- if (UNICODE) {
- testedSource = getUnicodeSource(source);
- }
-
- // Verify comments either in unicode or not
- else if (unix) {
- testedSource = getUnixSource(source);
- }
-
- // Get comments infos from test file
- setSourceComment(testedSource);
-
- // Create DOM AST nodes hierarchy
- List unitComments = null;
- String sourceLevel = null;
- String complianceLevel = null;
- if (currentProject != null) {
- if (astLevel == AST.JLS3) {
- complianceLevel = currentProject.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true);
- sourceLevel = currentProject.getOption(JavaScriptCore.COMPILER_SOURCE, true);
- currentProject.setOption(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_5);
- currentProject.setOption(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_5);
- }
- }
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(testedSource, fileName, currentProject, options);
- if (compilerOption.equals(JavaScriptCore.ERROR)) {
- assumeEquals(prefix+"Unexpected problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- } else if (compilerOption.equals(JavaScriptCore.WARNING)) {
- IProblem[] problemsList = compilUnit.getProblems();
- int length = problemsList.length;
- if (length > 0) {
- problems.append(" - "+prefix+length+" problems:"); //$NON-NLS-1$
- for (int i = 0; i < problemsList.length; i++) {
- problems.append(" + ");
- problems.append(problemsList[i]);
- problems.append("\n");
- }
- }
- }
- unitComments = compilUnit.getCommentList();
- assumeNotNull(prefix+"Unexpected problems", unitComments);
-
- // Basic comments verification
- int size = unitComments.size();
- assumeEquals(prefix+"Wrong number of comments!", comments.size(), size);
-
- // Verify comments positions and bindings
- for (int i=0; i<size; i++) {
- Comment comment = (Comment) unitComments.get(i);
- List tags = (List) allTags.get(i);
- // Verify flattened content
- String stringComment = (String) comments.get(i);
-// ASTConverterJavadocFlattener printer = new ASTConverterJavadocFlattener(stringComment);
-// comment.accept(printer);
- String text = new String(testedSource, comment.getStartPosition(), comment.getLength());
- assumeEquals(prefix+"Flattened comment does NOT match source!", stringComment, text);
- // Verify javdoc tags positions and bindings
- if (comment.isDocComment()) {
- JSdoc docComment = (JSdoc)comment;
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- assumeEquals(prefix+"Invalid tags number in javadoc:\n"+docComment+"\n", tags.size(), allTags(docComment));
- verifyPositions(docComment, testedSource);
- if (resolveBinding) {
- verifyBindings(docComment);
- }
- } else {
- assumeEquals("Javadoc should be flat!", 0, docComment.tags().size());
- }
- }
- }
-
- /* Verify each javadoc: not implemented yet
- Iterator types = compilUnit.types().listIterator();
- while (types.hasNext()) {
- TypeDeclaration typeDeclaration = (TypeDeclaration) types.next();
- verifyJavadoc(typeDeclaration.getJavadoc());
- }
- */
-
- if (sourceLevel != null) {
- currentProject.setOption(JavaScriptCore.COMPILER_COMPLIANCE, complianceLevel);
- currentProject.setOption(JavaScriptCore.COMPILER_SOURCE, sourceLevel);
- }
- // Return compilation unit for possible further verifications
- return compilUnit;
- }
-
- /*
- * Verify each javadoc
- * Not implented yet
- private void verifyJavadoc(Javadoc docComment) {
- }
- */
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test000() throws JavaScriptModelException {
- verifyComments("test000");
- }
-
- /**
- * Check javadoc for invalid syntax
- */
- public void test001() throws JavaScriptModelException {
- verifyComments("test001");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50781"
- */
- public void test002() throws JavaScriptModelException {
- verifyComments("test002");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50784"
- */
- public void test003() throws JavaScriptModelException {
- verifyComments("test003");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50785"
- */
- public void test004() throws JavaScriptModelException {
- verifyComments("test004");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50838"
- */
- public void test005() throws JavaScriptModelException {
- verifyComments("test005");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50877"
- */
- public void test006() throws JavaScriptModelException {
- verifyComments("test006");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50877"
- */
- public void test007() throws JavaScriptModelException {
- verifyComments("test007");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50877"
- */
- public void test008() throws JavaScriptModelException {
- verifyComments("test008");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50877"
- */
- public void test009() throws JavaScriptModelException {
- verifyComments("test009");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50880"
- */
- public void test010() throws JavaScriptModelException {
- verifyComments("test010");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=47396"
- */
- public void test011() throws JavaScriptModelException {
- problems = new StringBuffer();
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.test011", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assumeNotNull("No compilation unit", result);
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50938"
- */
- public void test012() throws JavaScriptModelException {
- verifyComments("test012");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51104"
- */
- public void test013() throws JavaScriptModelException {
- verifyComments("test013");
- }
-
- /**
- * Verify that text on next line following empty tag element
- * is well positionned.
- */
- public void test014() throws JavaScriptModelException {
- verifyComments("test014");
- }
-
- /**
- * Verify that we do not report failure when types are written on several lines
- * in Javadoc comments.
- */
- public void test015() throws JavaScriptModelException {
- verifyComments("test015");
- }
-
- /**
- * Verify DefaultCommentMapper heuristic to get leading and trailing comments
- */
- protected void verifyMapper(String folder, int count, int[] indexes) throws JavaScriptModelException {
- IJavaScriptUnit[] units = getCompilationUnits("Converter" , "src", "javadoc."+folder); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- for (int i=0; i<units.length; i++) {
- sourceUnit = units[i];
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", count, compilUnit.getCommentList().size());
- // Verify first method existence
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- // Verify first method extended positions
- int commentStart = method.getStartPosition();
- if (indexes[0]>=0) {
- Comment comment = (Comment) compilUnit.getCommentList().get(indexes[0]);
- commentStart = comment.getStartPosition();
- }
- int startPosition = compilUnit.getExtendedStartPosition(method);
- assumeEquals("Method "+node+" does not start at the right position", commentStart, startPosition);
- int methodEnd = startPosition + compilUnit.getExtendedLength(method) - 1;
- int commentEnd = method.getStartPosition() + method.getLength() - 1;
- if (indexes[1]>=0) {
- Comment comment = (Comment) compilUnit.getCommentList().get(indexes[1]);
- commentEnd = comment.getStartPosition() + comment.getLength() - 1;
- }
- assumeEquals("Method "+node+" does not have the correct length", commentEnd, methodEnd);
- // Verify second method existence
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- method = (FunctionDeclaration) node;
- // Verify second method extended positions
- commentStart = method.getStartPosition();
- if (indexes[2]>=0) {
- Comment comment = (Comment) compilUnit.getCommentList().get(indexes[2]);
- commentStart = comment.getStartPosition();
- }
- startPosition = compilUnit.getExtendedStartPosition(method);
- assumeEquals("Method "+node+" does not start at the right position", commentStart, startPosition);
- methodEnd = startPosition + compilUnit.getExtendedLength(method) - 1;
- commentEnd = method.getStartPosition() + method.getLength() - 1;
- if (indexes[3]>=0) {
- Comment comment = (Comment) compilUnit.getCommentList().get(indexes[3]);
- commentEnd = comment.getStartPosition() + comment.getLength() - 1;
- }
- assumeEquals("Method "+node+" does not have the correct length", commentEnd, methodEnd);
- }
- }
-
- /**
- * Verify DefaultCommentMapper heuristic to get leading and trailing comments
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=53445"
- */
- public void test100() throws JavaScriptModelException {
- verifyMapper("test100", 16, new int[] {2,7,8,15});
- }
- public void test101() throws JavaScriptModelException {
- verifyMapper("test101", 8, new int[] {1,3,4,7});
- }
- public void test102() throws JavaScriptModelException {
- verifyMapper("test102", 16, new int[] {4,9,10,13});
- }
- public void test103() throws JavaScriptModelException {
- verifyMapper("test103", 8, new int[] {2,4,5,6});
- }
- public void test104() throws JavaScriptModelException {
- verifyMapper("test104", 16, new int[] {2,7,8,15});
- }
- public void test105() throws JavaScriptModelException {
- verifyMapper("test105", 16, new int[] {-1,11,-1,15});
- }
- public void test106() throws JavaScriptModelException {
- verifyMapper("test106", 8, new int[] {-1,5,-1,7});
- }
- public void test107() throws JavaScriptModelException {
- verifyMapper("test107", 16, new int[] {2,7,8,-1});
- }
- public void test108() throws JavaScriptModelException {
- verifyMapper("test108", 8, new int[] {1,3,4,-1});
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=54776"
- */
- public void testBug54776() throws JavaScriptModelException {
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug54776", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 2, compilUnit.getCommentList().size());
- // get comments range
- Comment comment = (Comment) compilUnit.getCommentList().get(0);
- int commentStart = comment.getStartPosition();
- int extendedLength = ((Comment) compilUnit.getCommentList().get(1)).getStartPosition()-commentStart+comment.getLength();
- // get method invocation in field initializer
- ASTNode node = getASTNode((JavaScriptUnit) result, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDecl = (TypeDeclaration) node;
- FieldDeclaration[] fields = typeDecl.getFields();
- assumeEquals("We should have a field declaration", 1, fields.length);
- List fragments = fields[0].fragments();
- assumeEquals("We should have a variable fragment", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assumeTrue("We should get an expression", expression instanceof FunctionInvocation);
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- // verify that methodinvocation extended range includes leading and trailing comment
- int methodStart = compilUnit.getExtendedStartPosition(methodInvocation);
- assumeEquals("Method invocation "+methodInvocation+" does not start at the right position", commentStart, methodStart);
- int methodLength = compilUnit.getExtendedLength(methodInvocation);
- assumeEquals("Method invocation "+methodInvocation+" does not have the correct length", extendedLength, methodLength);
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=55221"
- */
- public void testBug55221a() throws JavaScriptModelException {
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug55221.a", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 1, compilUnit.getCommentList().size());
- // Get comment range
- Comment comment = (Comment) compilUnit.getCommentList().get(0);
- int commentStart = comment.getStartPosition();
- // get first method
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- // verify that first method does not include comment
- int methodStart = compilUnit.getExtendedStartPosition(method);
- assumeEquals("Method "+method+" does not start at the right position", method.getStartPosition(), methodStart);
- int methodLength = compilUnit.getExtendedLength(method);
- assumeEquals("Method declaration "+method+" does not end at the right position",method.getLength(), methodLength);
- // get method body
- node = method.getBody();
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a block", node.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- Block block = (Block) node;
- // verify that body does not include following comment
- int blockStart = compilUnit.getExtendedStartPosition(block);
- assumeEquals("Body block "+block+" does not start at the right position", block.getStartPosition(), blockStart);
- int blockLength = compilUnit.getExtendedLength(block);
- assumeEquals("Body block "+block+" does not have the correct length", block.getLength(), blockLength);
- // get second method
- node = getASTNode(compilUnit, 0, 1);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- method = (FunctionDeclaration) node;
- // verify that second method start includes comment
- assumeEquals("Method declaration "+method+" does not start at the right position", commentStart, method.getStartPosition());
- }
- public void testBug55221b() throws JavaScriptModelException {
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug55221.b", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 1, compilUnit.getCommentList().size());
- // Get comment range
- Comment comment = (Comment) compilUnit.getCommentList().get(0);
- int commentStart = comment.getStartPosition();
- // get first method
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- // verify that first method does not include comment
- int methodStart = compilUnit.getExtendedStartPosition(method);
- assumeEquals("Method "+method+" does not start at the right position", method.getStartPosition(), methodStart);
- int methodLength = compilUnit.getExtendedLength(method);
- assumeEquals("Method declaration "+method+" does not end at the right position",method.getLength(), methodLength);
- // get method body
- node = method.getBody();
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a block", node.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- Block block = (Block) node;
- // verify that body does not include following comment
- int blockStart = compilUnit.getExtendedStartPosition(block);
- assumeEquals("Body block "+block+" does not start at the right position", block.getStartPosition(), blockStart);
- int blockLength = compilUnit.getExtendedLength(block);
- assumeEquals("Body block "+block+" does not have the correct length", block.getLength(), blockLength);
- // get second method
- node = getASTNode(compilUnit, 0, 1);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- method = (FunctionDeclaration) node;
- // verify that second method start includes comment
- assumeEquals("Method declaration "+method+" does not start at the right position", commentStart, method.getStartPosition());
- }
- public void testBug55221c() throws JavaScriptModelException {
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug55221.c", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 1, compilUnit.getCommentList().size());
- // Get comment range
- Comment comment = (Comment) compilUnit.getCommentList().get(0);
- int commentStart = comment.getStartPosition();
- int commentEnd = commentStart+comment.getLength()-1;
- // get first method
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- // verify that first method includes comment
- int methodStart = compilUnit.getExtendedStartPosition(method);
- assumeEquals("Method "+method+" does not start at the right position", method.getStartPosition(), methodStart);
- int methodLength = compilUnit.getExtendedLength(method);
- assumeEquals("Method "+method+" does not end at the right position", commentEnd, methodStart+methodLength-1);
- // get method body
- node = method.getBody();
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a block", node.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- Block block = (Block) node;
- // verify that body includes following comment
- int blockStart = compilUnit.getExtendedStartPosition(block);
- assumeEquals("Body block "+block+" does not start at the right position", block.getStartPosition(), blockStart);
- int blockLength = compilUnit.getExtendedLength(block);
- assumeEquals("Body block "+block+" does not end at the right position", commentEnd, blockStart+blockLength-1);
- // get second method
- node = getASTNode(compilUnit, 0, 1);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- method = (FunctionDeclaration) node;
- // verify that second method does not include comment
- methodStart = compilUnit.getExtendedStartPosition(method);
- assumeEquals("Method "+method+" does not start at the right position", method.getStartPosition(), methodStart);
- methodLength = compilUnit.getExtendedLength(method);
- assumeEquals("Method declaration "+method+" does not end at the right position",method.getLength(), methodLength);
- }
- /** @deprecated using deprecated code */
- public void testBug55221d() throws JavaScriptModelException {
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug55221.d", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 2, compilUnit.getCommentList().size());
- // get first method
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- // verify that first method includes comment
- int methodStart = compilUnit.getExtendedStartPosition(method);
- assumeEquals("Method "+method+" does not start at the right position", method.getStartPosition(), methodStart);
- int methodLength = compilUnit.getExtendedLength(method);
- assumeEquals("Method "+method+" does not have the right length", methodLength, method.getLength());
- // get return type
- node = method.getReturnType();
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not return type", node.getNodeType() == ASTNode.PRIMITIVE_TYPE); //$NON-NLS-1$
- PrimitiveType returnType = (PrimitiveType) node;
- // verify that return type includes following comment
- int returnStart = compilUnit.getExtendedStartPosition(returnType);
- assumeEquals("Return type "+returnType+" does not start at the right position", returnType.getStartPosition(), returnStart);
- int returnLength = compilUnit.getExtendedLength(returnType);
- assumeEquals("Return type "+returnType+" does not have the right length", returnType.getLength(), returnLength);
- }
- public void testBug55223a() throws JavaScriptModelException {
-// stopOnFailure = false;
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug55223", "TestA.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 2, compilUnit.getCommentList().size());
- // get method
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- // get method body
- node = method.getBody();
- assumeNotNull("We should get a non-null ast node", node);
- assumeEquals("Not a block", ASTNode.BLOCK, node.getNodeType()); //$NON-NLS-1$
- Block block = (Block) node;
- // verify block statements start/end positions
- Iterator statements = block.statements().iterator();
- int idx = 0;
- while (statements.hasNext()) {
- node = (ExpressionStatement) statements.next();
- assumeEquals("Not a block", ASTNode.EXPRESSION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- ExpressionStatement statement = (ExpressionStatement) node;
- int statementStart = statement.getStartPosition();
- int statementEnd = statementStart + statement.getLength() - 1;
- if (idx < 2) {
- // Get comment range
- Comment comment = (Comment) compilUnit.getCommentList().get(idx);
- int commentStart = comment.getStartPosition();
- statementEnd = commentStart+comment.getLength()-1;
- }
- int extendedStart = compilUnit.getExtendedStartPosition(statement);
- assumeEquals("Statement "+statement+" does not start at the right position", statementStart, extendedStart);
- int extendedEnd = extendedStart + compilUnit.getExtendedLength(statement) - 1;
- assumeEquals("Statement "+statement+" does not end at the right position", statementEnd, extendedEnd);
- idx++;
- }
- }
- /** @deprecated using deprecated code */
- public void testBug55223b() throws JavaScriptModelException {
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug55223", "TestB.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit compilUnit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, compilUnit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 2, compilUnit.getCommentList().size());
- // Get comment range
- Comment comment = (Comment) compilUnit.getCommentList().get(1);
- int commentStart = comment.getStartPosition();
- // get method
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assumeNotNull("We should get a non-null ast node", node);
- assumeEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- FunctionDeclaration method = (FunctionDeclaration) node;
- // get return type
- node = method.getReturnType();
- assumeNotNull("We should get a non-null ast node", node);
- assumeTrue("Not return type", node.getNodeType() == ASTNode.SIMPLE_TYPE); //$NON-NLS-1$
- SimpleType returnType = (SimpleType) node;
- // verify that return type includes following comment
- int returnStart = compilUnit.getExtendedStartPosition(returnType);
- assumeEquals("Return type "+returnType+" does not start at the right position", commentStart, returnStart);
- int returnEnd = returnStart + compilUnit.getExtendedLength(returnType) - 1;
- assumeEquals("Return type "+returnType+" does not end at the right length", returnType.getStartPosition()+returnType.getLength()-1, returnEnd);
- }
- /*
- * End DefaultCommentMapper verifications
- */
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=48489"
- */
- public void testBug48489() throws JavaScriptModelException {
- verifyComments("testBug48489");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=50898"
- */
- public void testBug50898() throws JavaScriptModelException {
- IJavaScriptUnit unit = getCompilationUnit("Converter" , "src", "javadoc.testBug50898", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- packageBinding = false;
- verifyComments(unit);
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51226"
- */
- public void testBug51226() throws JavaScriptModelException {
- IJavaScriptUnit[] units = getCompilationUnits("Converter" , "src", "javadoc.testBug51226"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- for (int i=0; i<units.length; i++) {
- ASTNode result = runConversion(units[i], false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 1, unit.getCommentList().size());
- Comment comment = (Comment) unit.getCommentList().get(0);
- assumeTrue(prefix+"Comment should be a Javadoc one", comment.isDocComment());
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- JSdoc docComment = (JSdoc) comment;
- assumeEquals(prefix+"Wrong number of tags", 1, docComment.tags().size());
- TagElement tagElement = (TagElement) docComment.tags().get(0);
- assumeNull(prefix+"Wrong type of tag ["+tagElement+"]", tagElement.getTagName());
- assumeEquals(prefix+"Wrong number of fragments in tag ["+tagElement+"]", 1, tagElement.fragments().size());
- ASTNode fragment = (ASTNode) tagElement.fragments().get(0);
- assumeEquals(prefix+"Invalid type for fragment ["+fragment+"]", ASTNode.TEXT_ELEMENT, fragment.getNodeType());
- TextElement textElement = (TextElement) fragment;
- assumeEquals(prefix+"Invalid content for text element ", "Test", textElement.getText());
- if (debug) System.out.println(docComment+"\nsuccessfully verified.");
- }
- }
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51241"
- */
- public void testBug51241() throws JavaScriptModelException {
- verifyComments("testBug51241");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51363"
- */
- public void testBug51363() throws JavaScriptModelException {
- sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.testBug51363", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assumeEquals(prefix+"Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assumeEquals(prefix+"Wrong number of comments", 2, unit.getCommentList().size());
- // verify first comment
- Comment comment = (Comment) unit.getCommentList().get(0);
- assumeTrue(prefix+"Comment should be a line comment ", comment.isLineComment());
- String sourceStr = sourceUnit.getSource();
- int startPos = comment.getStartPosition()+comment.getLength();
- assumeEquals("Wrong length for line comment "+comment, "\\u000D\\u000A", sourceStr.substring(startPos, startPos+12));
- if (debug) System.out.println(comment+"\nsuccessfully verified.");
- // verify second comment
- comment = (Comment) unit.getCommentList().get(1);
- assumeTrue(prefix+"Comment should be a line comment", comment.isLineComment());
- sourceStr = sourceUnit.getSource();
- startPos = comment.getStartPosition()+comment.getLength();
- assumeEquals("Wrong length for line comment "+comment, "\\u000Dvoid", sourceStr.substring(startPos, startPos+10));
- if (debug) System.out.println(comment+"\nsuccessfully verified.");
-// verifyComments("testBug51363");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51476"
- */
- public void testBug51476() throws JavaScriptModelException {
- verifyComments("testBug51476");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51478"
- */
- public void testBug51478() throws JavaScriptModelException {
- verifyComments("testBug51478");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51508"
- */
- public void testBug51508() throws JavaScriptModelException {
- verifyComments("testBug51508");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51650"
- */
- public void testBug51650() throws JavaScriptModelException {
- verifyComments("testBug51650");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51770"
- */
- public void testBug51770() throws JavaScriptModelException {
- verifyComments("testBug51770");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=52908"
- */
- public void testBug52908() throws JavaScriptModelException {
- verifyComments("testBug52908");
- }
- public void testBug52908a() throws JavaScriptModelException {
- verifyComments("testBug52908a");
- }
- public void testBug52908unicode() throws JavaScriptModelException {
- verifyComments("testBug52908unicode");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=53276"
- */
- public void testBug53276() throws JavaScriptModelException {
- verifyComments("testBug53276");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=53075"
- */
- public void testBug53075() throws JavaScriptModelException {
- IJavaScriptUnit unit = getCompilationUnit("Converter" , "src", "javadoc.testBug53075", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- boolean pb = packageBinding;
- packageBinding = false;
- JavaScriptUnit compilUnit = verifyComments(unit);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- Comment comment = (Comment) compilUnit.getCommentList().get(0);
- assumeTrue(prefix+"Comment should be a javadoc comment ", comment.isDocComment());
- JSdoc docComment = (JSdoc) comment;
- TagElement tagElement = (TagElement) docComment.tags().get(0);
- assumeEquals("Wrong tag type!", TagElement.TAG_LINK, tagElement.getTagName());
- tagElement = (TagElement) docComment.tags().get(1);
- assumeEquals("Wrong tag type!", TagElement.TAG_LINKPLAIN, tagElement.getTagName());
- }
- packageBinding = pb;
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=53757"
- */
- public void testBug53757() throws JavaScriptModelException {
- verifyComments("testBug53757");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51600"
- */
- public void testBug51600() throws JavaScriptModelException {
- verifyComments("testBug51600");
- }
- public void testBug51617() throws JavaScriptModelException {
- stopOnFailure = false;
- String [] unbound = { "e" };
- verifyComments("testBug51617");
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- int size = unbound.length;
- for (int i=0, f=0; i<size; i++) {
- assertTrue("Invalid number of failures!", failures.size()>f);
- String failure = (String) failures.get(f);
- String expected = "Reference '"+unbound[i]+"' should be bound!";
- if (expected.equals(failure.substring(failure.indexOf(' ')+1))) {
- failures.remove(f);
- } else {
- f++; // skip offending failure
- i--; // stay on expected string
- }
- }
- }
- stopOnFailure = true;
- }
- public void testBug54424() throws JavaScriptModelException {
- stopOnFailure = false;
- String [] unbound = { "tho",
- "from",
- "A#getList(int,long,boolean)",
- "#getList(Object,java.util.AbstractList)",
- "from",
- "#getList(int from,long tho)",
- "to"
- };
- verifyComments("testBug54424");
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- int size = unbound.length;
- for (int i=0, f=0; i<size; i++) {
- assertTrue("Invalid number of failures!", failures.size()>f);
- String failure = (String) failures.get(f);
- String expected = "Reference '"+unbound[i]+"' should be bound!";
- if (expected.equals(failure.substring(failure.indexOf(' ')+1))) {
- failures.remove(f);
- } else {
- f++; // skip offending failure
- i--; // stay on expected string
- }
- }
- }
- stopOnFailure = true;
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=63044"
- */
- public void testBug63044() throws JavaScriptModelException {
- verifyComments("testBug63044");
- }
-
- /**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=51660"
- */
- public void testBug51660() throws JavaScriptModelException {
- stopOnFailure = false;
- IJavaScriptUnit unit = getCompilationUnit("Converter" , "src", "javadoc.testBug51660", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit compilUnit = verifyComments(unit);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- String[] tagNames = {
- "@ejb",
- "@ejb",
- "@ejb",
- "@ejb",
- "@ejb",
- "@ejb",
- "@ejb(bean",
- "@ejb)bean",
- "@ejb",
- "@ejb+bean",
- "@ejb,bean",
- "@ejb-bean",
- "@ejb.bean",
- "@ejb/bean",
- "@ejb",
- "@ejb;bean",
- "@ejb",
- "@ejb=bean",
- "@ejb",
- "@ejb?bean",
- "@ejb@bean",
- "@ejb[bean",
- "@ejb\\bean",
- "@ejb]bean",
- "@ejb^bean",
- "@ejb`bean",
- "@ejb{bean",
- "@ejb|bean",
- "@ejb",
- "@ejb~bean",
- "@unknown"
- };
- String[] tagTexts = {
- "!bean test non-java id character '!' (val=33) in tag name",
- "\"bean test non-java id character '\"' (val=34) in tag name",
- "#bean test non-java id character '#' (val=35) in tag name",
- "%bean test non-java id character '%' (val=37) in tag name",
- "&bean test non-java id character '&' (val=38) in tag name",
- "'bean test non-java id character ''' (val=39) in tag name",
- " test non-java id character '(' (val=40) in tag name",
- " test non-java id character ')' (val=41) in tag name",
- "*bean test non-java id character '*' (val=42) in tag name",
- " test non-java id character '+' (val=43) in tag name",
- " test non-java id character ',' (val=44) in tag name",
- " test non-java id character '-' (val=45) in tag name",
- " test non-java id character '.' (val=46) in tag name",
- " test non-java id character '/' (val=47) in tag name",
- ":bean test non-java id character ':' (val=58) in tag name",
- " test non-java id character ';' (val=59) in tag name",
- "<bean test non-java id character '<' (val=60) in tag name",
- " test non-java id character '=' (val=61) in tag name",
- ">bean test non-java id character '>' (val=62) in tag name",
- " test non-java id character '?' (val=63) in tag name",
- " test non-java id character '@' (val=64) in tag name",
- " test non-java id character '[' (val=91) in tag name",
- " test non-java id character '\\' (val=92) in tag name",
- " test non-java id character ']' (val=93) in tag name",
- " test non-java id character '^' (val=94) in tag name",
- " test non-java id character '`' (val=96) in tag name",
- " test non-java id character '{' (val=123) in tag name",
- " test non-java id character '|' (val=124) in tag name",
- "}bean test non-java id character '}' (val=125) in tag name",
- " test non-java id character '~' (val=126) in tag name",
- " test java id"
- };
- Comment comment = (Comment) compilUnit.getCommentList().get(0);
- assumeTrue(prefix+"Comment should be a javadoc comment ", comment.isDocComment());
- JSdoc docComment = (JSdoc) comment;
- int size = docComment.tags().size();
- for (int i=0; i<size; i++) {
- TagElement tagElement = (TagElement) docComment.tags().get(i);
- assumeEquals("Wrong tag name for:"+tagElement, tagNames[i], tagElement.getTagName());
- assumeEquals("Wrong fragments size for :"+tagElement, 1, tagElement.fragments().size());
- ASTNode fragment = (ASTNode) tagElement.fragments().get(0);
- assumeEquals("Wrong fragments type for :"+tagElement, ASTNode.TEXT_ELEMENT, fragment.getNodeType());
- TextElement textElement = (TextElement) fragment;
- assumeEquals("Wrong text for tag!", tagTexts[i], textElement.getText());
- }
- }
- stopOnFailure = true;
- }
-
- /**
- * Bug 65174: Spurious "Javadoc: Missing reference" error
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=65174"
- */
- public void testBug65174() throws JavaScriptModelException {
- verifyComments("testBug65174");
- }
-
- /**
- * Bug 65253: [Javadoc] @@tag is wrongly parsed as @tag
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=65253"
- */
- public void testBug65253() throws JavaScriptModelException {
- verifyComments("testBug65253");
- }
-
- /**
- * Bug 65288: Javadoc: tag gets mangled when javadoc closing on same line without whitespace
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=65288"
- */
- public void testBug65288() throws JavaScriptModelException {
- verifyComments("testBug65288");
- }
-
- /**
- * Bug 68017: Javadoc processing does not detect missing argument to @return
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=68017"
- */
- public void testBug68017() throws JavaScriptModelException {
- verifyComments("testBug68017");
- }
-
- /**
- * Bug 68025: Javadoc processing does not detect some wrong links
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=68025"
- */
- public void testBug68025() throws JavaScriptModelException {
- verifyComments("testBug68025");
- }
-
- /**
- * Bug 69272: [Javadoc] Invalid malformed reference (missing separator)
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=69272"
- */
- public void testBug69272() throws JavaScriptModelException {
- verifyComments("testBug69272");
- }
-
- /**
- * Bug 69275: [Javadoc] Invalid warning on @see link
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=69275"
- */
- public void testBug69275() throws JavaScriptModelException {
- verifyComments("testBug69275");
- }
-
- /**
- * Bug 69302: [Javadoc] Invalid reference warning inconsistent with javadoc tool
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=69302"
- */
- public void testBug69302() throws JavaScriptModelException {
- verifyComments("testBug69302");
- }
-
- /**
- * Bug 68726: [Javadoc] Target attribute in @see link triggers warning
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=68726"
- */
- public void testBug68726() throws JavaScriptModelException {
- verifyComments("testBug68726");
- }
-
- /**
- * Bug 70892: [1.5][Javadoc] Compiler should parse reference for inline tag @value
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=70892"
- * @deprecated using deprecated code
- */
- public void testBug70892_JLS2() throws JavaScriptModelException {
- int level = astLevel;
- astLevel = AST.JLS2;
- verifyComments("testBug70892");
- astLevel = level;
- }
- public void testBug70892_JLS3() throws JavaScriptModelException {
- int level = astLevel;
- astLevel = AST.JLS3;
- verifyComments("testBug70892");
- astLevel = level;
- }
-
- /**
- * Bug 51911: [Javadoc] @see method w/out ()
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=51911"
- */
- public void testBug51911() throws JavaScriptModelException {
- verifyComments("testBug51911");
- }
-
- /**
- * Bug 73348: [Javadoc] Missing description for return tag is not always warned
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=73348"
- */
- public void testBug73348() throws JavaScriptModelException {
- verifyComments("testBug73348");
- }
-
- /**
- * Bug 77644: [dom] AST node extended positions may be wrong while moving
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=77644"
- */
- public void testBug77644() throws JavaScriptModelException {
- verifyComments("testBug77644");
- }
-
- /**
- * Bug 79809: [1.5][dom][javadoc] Need better support for type parameter Javadoc tags
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=79809"
- */
- public void testBug79809() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter/src/javadoc/b79809/Test.js",
- "package javadoc.b79809;\n" +
- "/**\n" +
- " * @param <E> Class type parameter\n" +
- " * @see Object\n" +
- " */\n" +
- "public class Test<E> {\n" +
- " /**\n" +
- " * @param t\n" +
- " * @param <T> Method type parameter\n" +
- " */\n" +
- " <T> void foo(T t) {}\n" +
- "}\n");
- verifyWorkingCopiesComments();
- }
- public void testBug79809b() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter/src/javadoc/b79809/Test.js",
- "package javadoc.b79809;\n" +
- "\n" +
- "/**\n" +
- " * New tags for 5.0\n" +
- " * - literal: {@literal a<B>c}\n" +
- " * - code: {@code abc}\n" +
- " * - value: {@value System#out}\n" +
- " */\n" +
- "public class Test {\n" +
- "\n" +
- "}\n");
- verifyWorkingCopiesComments();
- }
-
- /**
- * Bug 79904: [1.5][dom][javadoc] TagElement range not complete for type parameter tags
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=79904"
- */
- public void testBug79904() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter/src/javadoc/b79904/Test.js",
- "package javadoc.b79904;\n" +
- "/**\n" +
- " * @param <E>\n" +
- " * @see Object\n" +
- " */\n" +
- "public class Test<E> {\n" +
- " /**\n" +
- " * @param t\n" +
- " * @param <T>\n" +
- " */\n" +
- " <T> void foo(T t) {}\n" +
- "}\n");
- verifyWorkingCopiesComments();
- }
-
- /**
- * Bug 80221: [1.5][dom][javadoc] Need better support for type parameter Javadoc tags
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=80221"
- */
- public void testBug80221() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter/src/javadoc/b80221/Test.js",
- "package javadoc.b80221;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Object Unknown: ref is not resolved due to compile error...\n" +
- " */\n" +
- " public foo() {\n" +
- " return 1;\n" +
- " }\n" +
- "}\n"
- );
- verifyWorkingCopiesComments();
- }
-
- /**
- * Bug 80257: [1.5][javadoc][dom] Type references in javadocs should have generic binding, not raw
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=80257"
- */
- public void testBug80257() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b80257/Test.js",
- "package javadoc.b80257;\n" +
- "import java.util.*;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see ArrayList\n" +
- " * @return {@link java.util.List}\n" +
- " */\n" +
- " List<String> getList() {\n" +
- " return new ArrayList<String>();\n" +
- " }\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Do not need to verify following statement as we know it's ok as verifyComments did not fail
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // get javadoc comment
- TagElement firstTag = (TagElement) docComment.tags().get(0); // get first tag
- TagElement secondTag = (TagElement) docComment.tags().get(1); // get second tag
- TagElement inlineTag = (TagElement) secondTag.fragments().get(1); // get inline tag
- // Get tag simple name reference in first tag
- assertEquals("Invalid number of fragments for tag element: "+firstTag, 1, firstTag.fragments().size());
- ASTNode node = (ASTNode) firstTag.fragments().get(0);
- assertEquals("Invalid kind of name reference for tag element: "+firstTag, ASTNode.SIMPLE_NAME, node.getNodeType());
- SimpleName seeRef = (SimpleName) node;
- // Verify binding for simple name
- IBinding binding = seeRef.resolveBinding();
- assertTrue("Wrong kind of binding", binding instanceof ITypeBinding);
- // Get inline tag simple name reference in second tag
- assertEquals("Invalid number of fragments for inline tag element: "+inlineTag, 1, inlineTag.fragments().size());
- node = (ASTNode) inlineTag.fragments().get(0);
- assertEquals("Invalid kind of name reference for tag element: "+inlineTag, ASTNode.QUALIFIED_NAME, node.getNodeType());
- QualifiedName linkRef = (QualifiedName) node;
- // Verify binding for qualified name
- binding = linkRef.resolveBinding();
- assertTrue("Wrong kind of binding", binding instanceof ITypeBinding);
- }
- }
-
- /**
- * Bug 83804: [1.5][javadoc] Missing Javadoc node for package declaration
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=83804"
- */
- public void testBug83804() throws CoreException, JavaScriptModelException {
- astLevel = AST.JLS3;
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getCompilationUnit("Converter15", "src", "javadoc.b83804", "package-info.js");
- workingCopies[1] = getCompilationUnit("Converter15", "src", "javadoc.b83804", "Test.js");
- verifyWorkingCopiesComments();
- }
- public void testBug83804a() throws CoreException, JavaScriptModelException {
- astLevel = AST.JLS3;
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getCompilationUnit("Converter15", "src", "javadoc.b83804a", "package-info.js");
- workingCopies[1] = getCompilationUnit("Converter15", "src", "javadoc.b83804a", "Test.js");
- verifyWorkingCopiesComments();
- }
-
- /**
- * Bug 84049: [javadoc][dom] Extended ranges wrong for method name without return type
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84049"
- */
- public void testBug84049() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b84049/Test.js",
- "package javadoc.b84049;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see Object\n" +
- " */\n" +
- " foo() {\n" +
- " }\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assertEquals("Invalid type for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- JSdoc methodJavadoc = methodDeclaration.getJavadoc();
- assertNotNull("FunctionDeclaration have a javadoc comment", methodJavadoc);
- int javadocStart = methodJavadoc.getStartPosition();
- assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart);
- SimpleName methodName = methodDeclaration.getName();
- int nameStart = methodName.getStartPosition();
- assertTrue("Method simple name should not include javadoc comment", nameStart > javadocStart+methodJavadoc.getLength());
- int extendedStart = compilUnit.getExtendedStartPosition(methodName);
- assertEquals("Method simple name start position should not be extended!", nameStart, extendedStart);
- int extendedLength = compilUnit.getExtendedLength(methodName);
- assertEquals("Method simple name length should not be extended!", methodName.getLength(), extendedLength);
- }
- }
-
- /**
- * Bug 87845: [1.5][javadoc][dom] Type references in javadocs should have generic binding, not raw
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=87845"
- */
- public void testBug87845() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b87845/Test.js",
- "package javadoc.b87845;\n" +
- "public class Test {\n" +
- " public void foo(int a, int b) {} \n" +
- " public void foo(int a, int... args) {}\n" +
- " public void foo(String... args) {}\n" +
- " public void foo(Exception str, boolean... args) {}\n" +
- " /**\n" +
- " * @see Test#foo(int, int)\n" +
- " * @see Test#foo(int, int[])\n" +
- " * @see Test#foo(int, int...)\n" +
- " * @see Test#foo(String[])\n" +
- " * @see Test#foo(String...)\n" +
- " * @see Test#foo(Exception, boolean[])\n" +
- " * @see Test#foo(Exception, boolean...)\n" +
- " */\n" +
- " public void valid() {}\n" +
- " /**\n" +
- " * @see Test#foo(int)\n" +
- " * @see Test#foo(int, int, int)\n" +
- " * @see Test#foo()\n" +
- " * @see Test#foo(String)\n" +
- " * @see Test#foo(String, String)\n" +
- " * @see Test#foo(Exception)\n" +
- " * @see Test#foo(Exception, boolean)\n" +
- " * @see Test#foo(Exception, boolean, boolean)\n" +
- " */\n" +
- " public void invalid() {}\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Do not need to verify following statement as we know it's ok as verifyComments did not fail
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // get first javadoc comment
- // Verify last parameter for all methods reference in javadoc comment
- List tags = docComment.tags();
- int size = tags.size();
- for (int i=0; i<size; i++) {
- TagElement tag = (TagElement) docComment.tags().get(i);
- assertEquals("Invalid number of fragment for see reference: "+tag, 1, tag.fragments().size());
- ASTNode node = (ASTNode) tag.fragments().get(0);
- assertEquals("Invalid kind of name reference for tag element: "+tag, ASTNode.FUNCTION_REF, node.getNodeType());
- FunctionRef methodRef = (FunctionRef) node;
- List parameters = methodRef.parameters();
- int paramSize = parameters.size();
- for (int j=0; j<paramSize; j++) {
- node = (ASTNode) parameters.get(j);
- assertEquals("Invalid kind of method parameter: "+node, ASTNode.FUNCTION_REF_PARAMETER, node.getNodeType());
- FunctionRefParameter parameter = (FunctionRefParameter) node;
- if (j==(paramSize-1)) {
- switch (i) {
- case 2:
- case 4:
- case 6:
- assertTrue("Method parameter \""+parameter+"\" should be varargs!", parameter.isVarargs());
- break;
- default:
- assertFalse("Method parameter \""+parameter+"\" should not be varargs!", parameter.isVarargs());
- break;
- }
- } else {
- assertFalse("Method parameter \""+parameter+"\" should not be varargs!", parameter.isVarargs());
- }
- }
- }
- }
- }
-
- /**
- * Bug 93880: [1.5][javadoc] Source range of PackageDeclaration does not include Javadoc child
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=93880"
- */
- public void testBug93880_15a() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/Test.js",
- "/**\n" +
- " * Javadoc\n" +
- " */\n" +
- "package javadoc.b93880;\n" +
- "public class Test {\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration javadoc
- assertTrue("Javadoc should be set on package declaration", docComment == packDecl.getJavadoc());
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_15b() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/**\n" +
- " * Javadoc for all package\n" +
- " */\n" +
- "package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration javadoc
- assertTrue("Javadoc should be set on package declaration", docComment == packDecl.getJavadoc());
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_15c() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/**\n" +
- " * Javadoc for all package\n" +
- " */\n" +
- "private package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration javadoc
- assertTrue("Javadoc should be set on package declaration", docComment == packDecl.getJavadoc());
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_15d() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/**\n" +
- " * Javadoc for all package\n" +
- " */\n" +
- "@Deprecated\n" +
- "package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- assertNotNull("Compilation unit should have a package declaration", packDecl);
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration javadoc
- assertTrue("Javadoc should be set on package declaration", docComment == packDecl.getJavadoc());
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_15e() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/* (non-javadoc)\n" +
- " * No comment\n" +
- " */\n" +
- "package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
-
- // Verify package declaration javadoc
- assertNull("Package declaration should not have any javadoc", packDecl.getJavadoc());
-
- // Verify package declaration declaration source start
- assertTrue("Source range of PackageDeclaration should NOT include Javadoc child", packDecl.getStartPosition() > comment.getStartPosition()+comment.getLength());
- }
- }
- public void testBug93880_14a() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/Test.js",
- "/**\n" +
- " * Javadoc\n" +
- " */\n" +
- "package javadoc.b93880;\n" +
- "public class Test {\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_14b() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/**\n" +
- " * Javadoc for all package\n" +
- " */\n" +
- "package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_14c() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/**\n" +
- " * Javadoc for all package\n" +
- " */\n" +
- "private package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_14d() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/**\n" +
- " * Javadoc for all package\n" +
- " */\n" +
- "@Deprecated\n" +
- "package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- assertNotNull("Compilation unit should have a package declaration", packDecl);
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(0); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
-
- // Verify package declaration declaration source start
- assertEquals("Source range of PackageDeclaration should include Javadoc child", docComment.getStartPosition(), packDecl.getStartPosition());
- }
- }
- public void testBug93880_14e() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b93880/package-info.js",
- "/* (non-javadoc)\n" +
- " * No comment\n" +
- " */\n" +
- "package javadoc.b93880;"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get package declaration declaration and javadoc
- PackageDeclaration packDecl = compilUnit.getPackage();
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
-
- // Verify package declaration declaration source start
- assertTrue("Source range of PackageDeclaration should NOT not include Javadoc child", packDecl.getStartPosition() > comment.getStartPosition()+comment.getLength());
- }
- }
-
-
- /**
- * Bug 99507: [javadoc] Infinit loop in DocCommentParser
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=99507"
- */
- public void testBug99507() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b99507/X.js",
- "package javadoc.b99507;\n" +
- "public class X {\n" +
- "}\n" +
- "/** @param test*/"
- );
- verifyComments(workingCopies[0]);
- }
- public void testBug99507b() throws JavaScriptModelException {
- String source = "/**\n@param country*/";
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_COMPILATION_UNIT);
- parser.setSource(source.toCharArray());
- parser.createAST(null);
- }
-
- /**
- * Bug 100041: [javadoc] Infinit loop in DocCommentParser
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=100041"
- */
- public void testBug100041() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b100041/X.js",
- "package javadoc.b100041;\n" +
- "class X {\n" +
- " static Object object;\n" +
- " static void foo() {\n" +
- " /**\n" +
- " * javadoc comment.\n" +
- " */\n" +
- " if (object instanceof String) {\n" +
- " final String clr = null;\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get comment
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
- int commentStart = comment.getStartPosition();
- int commentEnd = commentStart+comment.getLength();
-
- // Get local variable declaration
- ASTNode node = getASTNode(compilUnit, 0, 1, 0);
- assertEquals("Expected if statement for node: "+node, ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- assertTrue("Invalid start position for IfStatement: "+ifStatement, ifStatement.getStartPosition() > commentEnd);
- Statement statement = ifStatement.getThenStatement();
- assertEquals("Expected block for node: "+statement, ASTNode.BLOCK, statement.getNodeType());
- Block block = (Block) statement;
- assertTrue("Invalid start position for Block: "+block, block.getStartPosition() > commentEnd);
- List statements = block.statements();
- assertEquals("Invalid number of statements for block: "+block, 1, statements.size());
- statement = (Statement) statements.get(0);
- assertEquals("Expected variable declaration statement for node: "+statement, ASTNode.VARIABLE_DECLARATION_STATEMENT, statement.getNodeType());
- VariableDeclarationStatement varDecl = (VariableDeclarationStatement) statement;
- assertTrue("Invalid start position for : VariableDeclarationStatement"+varDecl, varDecl.getStartPosition() > commentEnd);
- }
- }
- public void testBug100041b() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b100041/X.js",
- "package javadoc.b100041;\n" +
- "class X {\n" +
- " static Object object;\n" +
- " static void foo() {\n" +
- " /**\n" +
- " * javadoc comment.\n" +
- " */\n" +
- " if (object instanceof String)\n" +
- " return;\n" +
- " }\n" +
- "}"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get comment
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
- int commentStart = comment.getStartPosition();
- int commentEnd = commentStart+comment.getLength();
-
- // Get local variable declaration
- ASTNode node = getASTNode(compilUnit, 0, 1, 0);
- assertEquals("Expected if statement for node: "+node, ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- assertTrue("Invalid start position for IfStatement: "+ifStatement, ifStatement.getStartPosition() > commentEnd);
- Statement statement = ifStatement.getThenStatement();
- assertEquals("Expected block for node: "+statement, ASTNode.RETURN_STATEMENT, statement.getNodeType());
- ReturnStatement returnStatement = (ReturnStatement) statement;
- assertTrue("Invalid start position for Block: "+returnStatement, returnStatement.getStartPosition() > commentEnd);
- }
- }
- public void testBug100041c() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b100041/Z.js",
- "package javadoc.b100041;\n" +
- "public class Z {\n" +
- " /** C1 */\n" +
- " class Z1 {}\n" +
- " /** C2 */\n" +
- " Z1 z1;\n" +
- " /** C3 */\n" +
- " public static void foo(Object object) {\n" +
- " /** C4 */\n" +
- " class ZZ {\n" +
- " /** C5 */\n" +
- " ZZ zz;\n" +
- " /** C6 */\n" +
- " public void bar() {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get comments
- List unitComments = compilUnit.getCommentList();
- int size = unitComments.size();
- assertEquals("Wrong number of comments", 6, size);
- JSdoc[] javadocs = new JSdoc[size];
- Iterator iterator = unitComments.iterator();
- for (int i=0; i<size; i++) {
- Comment comment = (Comment) iterator.next();
- assertEquals("Expect javadoc for comment: "+comment, ASTNode.JSDOC, comment.getNodeType());
- javadocs[i] = (JSdoc) comment;
- }
-
- // Verify member type declaration start
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assertEquals("Expected type declaration for node: "+node, ASTNode.TYPE_DECLARATION, node.getNodeType());
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- int javadocStart = javadocs[0].getStartPosition();
- assertEquals("Invalid start position for TypeDeclaration: "+typeDeclaration, typeDeclaration.getStartPosition(), javadocStart);
-
- // Verify field declaration start
- node = getASTNode(compilUnit, 0, 1);
- assertEquals("Expected field declaration for node: "+node, ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- javadocStart = javadocs[1].getStartPosition();
- assertEquals("Invalid start position for FieldDeclaration: "+fieldDeclaration, fieldDeclaration.getStartPosition(), javadocStart);
-
- // Verify method declaration start
- node = getASTNode(compilUnit, 0, 2);
- assertEquals("Expected method declaration for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- javadocStart = javadocs[2].getStartPosition();
- assertEquals("Invalid start position for FunctionDeclaration: "+methodDeclaration, methodDeclaration.getStartPosition(), javadocStart);
-
- // Verify local type declaration start
- node = getASTNode(compilUnit, 0, 2, 0);
- assertEquals("Expected type declaration for node: "+node, ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType());
- typeDeclaration = (TypeDeclaration) ((TypeDeclarationStatement) node).getDeclaration();
- javadocStart = javadocs[3].getStartPosition();
- assertEquals("Invalid start position for TypeDeclaration: "+typeDeclaration, typeDeclaration.getStartPosition(), javadocStart);
-
- // Verify field declaration start
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- node = (ASTNode) bodyDeclarations.get(0);
- assertEquals("Expected field declaration for node: "+node, ASTNode.FIELD_DECLARATION, node.getNodeType());
- fieldDeclaration = (FieldDeclaration) node;
- javadocStart = javadocs[4].getStartPosition();
- assertEquals("Invalid start position for FieldDeclaration: "+fieldDeclaration, fieldDeclaration.getStartPosition(), javadocStart);
-
- // Verify method declaration start
- node = (ASTNode) bodyDeclarations.get(1);
- assertEquals("Expected method declaration for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- methodDeclaration = (FunctionDeclaration) node;
- javadocStart = javadocs[5].getStartPosition();
- assertEquals("Invalid start position for FunctionDeclaration: "+methodDeclaration, methodDeclaration.getStartPosition(), javadocStart);
- }
- }
-
- /**
- * @bug 103304: [Javadoc] Wrong reference proposal for inner classes.
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
- */
- public void testBug103304() throws JavaScriptModelException {
- this.packageBinding = false; // do NOT verify that qualification only can be package name
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b103304/Test.js",
- "package javadoc.b103304;\n" +
- "interface IAFAState {\n" +
- " public class ValidationException extends Exception {\n" +
- " public ValidationException(String variableName, IAFAState subformula) {\n" +
- " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class Test {\n" +
- " /**\n" +
- " * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
- " */\n" +
- " IAFAState.ValidationException valid;\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify comment type
- Iterator unitComments = compilUnit.getCommentList().iterator();
- while (unitComments.hasNext()) {
- Comment comment = (Comment) unitComments.next();
- assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.JSDOC);
- JSdoc javadoc = (JSdoc) comment;
-
- // Verify that there's always a method reference in tags
- List tags = javadoc.tags();
- int size = tags.size();
- for (int i=0; i<size; i++) {
- TagElement tag = (TagElement) javadoc.tags().get(i);
- assertEquals("Invalid number of fragment for see reference: "+tag, 1, tag.fragments().size());
- ASTNode node = (ASTNode) tag.fragments().get(0);
- assertEquals("Invalid kind of name reference for tag element: "+tag, ASTNode.FUNCTION_REF, node.getNodeType());
- }
- }
- }
- }
-
- /**
- * Bug 106581: [javadoc] null type binding for parameter in javadoc
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=106581"
- */
- public void testBug106581() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b106581/A.js",
- "package javadoc.b106581;\n" +
- "public class A {\n" +
- " /**\n" +
- " * @param x\n" +
- " */ \n" +
- " public void foo(int x) {},\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get comment
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
- assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.JSDOC);
-
- // Get local variable declaration
- JSdoc docComment = (JSdoc) comment;
- TagElement tag = (TagElement) docComment.tags().get(0);
- assertEquals("Invalid number of fragment for tag: "+tag, 1, tag.fragments().size());
- ASTNode node = (ASTNode) tag.fragments().get(0);
- assertEquals("Invalid kind of name reference for tag element: "+tag, ASTNode.SIMPLE_NAME, node.getNodeType());
- SimpleName simpleName = (SimpleName) node;
- assertNotNull("We should have a type binding for simple name: "+simpleName, simpleName.resolveTypeBinding());
- }
- }
-
- /**
- * Bug 108622: [javadoc][dom] ASTNode not including javadoc
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=108622"
- */
- public void testBug108622() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b108622/Test.js",
- "package javadoc.b108622;\n" +
- "/**\n" +
- " * \n" +
- " */\n" +
- "public abstract class Test {\n" +
- "\n" +
- " /**\n" +
- " * \n" +
- " */\n" +
- " public abstract Zork getFoo();\n" +
- "\n" +
- " /**\n" +
- " * \n" +
- " */\n" +
- " public abstract void setFoo(Zork dept);\n" +
- "\n" +
- "}"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify first method
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assertEquals("Invalid type for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("Invalid method name", "getFoo", methodDeclaration.getName().toString());
- JSdoc methodJavadoc = methodDeclaration.getJavadoc();
- assertNotNull("FunctionDeclaration have a javadoc comment", methodJavadoc);
- int javadocStart = methodJavadoc.getStartPosition();
- assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart);
- // Verify second method
- node = getASTNode(compilUnit, 0, 1);
- assertEquals("Invalid type for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- methodDeclaration = (FunctionDeclaration) node;
- assertEquals("Invalid method name", "setFoo", methodDeclaration.getName().toString());
- methodJavadoc = methodDeclaration.getJavadoc();
- assertNotNull("FunctionDeclaration have a javadoc comment", methodJavadoc);
- javadocStart = methodJavadoc.getStartPosition();
- assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart);
- }
- }
-
- /**
- * Bug 113108: [API][comments] JavaScriptUnit.getNodeComments(ASTNode)
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=113108"
- */
- public void testBug113108a() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b113108/Test.js",
- "package javadoc.b113108;\n" +
- "/** C0 */\n" +
- "public class Test {\n" +
- " /* C1 */\n" +
- " /** C2 */\n" +
- " // C3\n" +
- " public void foo() {\n" +
- " /* C4 */\n" +
- " }\n" +
- " /* C5 */\n" +
- " /** C6 */\n" +
- " // C7\n" +
- "}"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify method javadoc
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assertEquals("Invalid type for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("Invalid method name", "foo", methodDeclaration.getName().toString());
- JSdoc methodJavadoc = methodDeclaration.getJavadoc();
- assertNotNull("FunctionDeclaration have a javadoc comment", methodJavadoc);
- int javadocStart = methodJavadoc.getStartPosition();
- assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart);
- // Verify method first leading and last trailing comment
- int index = compilUnit.firstLeadingCommentIndex(methodDeclaration);
- assertEquals("Invalid first leading comment for "+methodDeclaration, 1, index);
- index = compilUnit.lastTrailingCommentIndex(methodDeclaration);
- assertEquals("Invalid last trailing comment for "+methodDeclaration, 7, index);
- }
- }
- public void testBug113108b() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b113108/Test.js",
- "package javadoc.b113108;\n" +
- "/** C0 */\n" +
- "public class Test {\n" +
- " /** C1 */\n" +
- " // C2\n" +
- " /* C3 */\n" +
- " public void foo() {\n" +
- " // C4\n" +
- " }\n" +
- " /** C5 */\n" +
- " /// C6\n" +
- " /* C7 */\n" +
- "}"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify method javadoc
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assertEquals("Invalid type for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("Invalid method name", "foo", methodDeclaration.getName().toString());
- JSdoc methodJavadoc = methodDeclaration.getJavadoc();
- assertNotNull("FunctionDeclaration have a javadoc comment", methodJavadoc);
- int javadocStart = methodJavadoc.getStartPosition();
- assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart);
- // Verify method first leading and last trailing comment
- int index = compilUnit.firstLeadingCommentIndex(methodDeclaration);
- assertEquals("Invalid first leading comment for "+methodDeclaration, 1, index);
- index = compilUnit.lastTrailingCommentIndex(methodDeclaration);
- assertEquals("Invalid last trailing comment for "+methodDeclaration, 7, index);
- }
- }
- public void testBug113108c() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b113108/Test.js",
- "package javadoc.b113108;\n" +
- "/** C0 */\n" +
- "public class Test {\n" +
- " // C1\n" +
- " /* C2 */\n" +
- " /** C3 */\n" +
- " public void foo() {\n" +
- " /** C4 */\n" +
- " }\n" +
- " // C5\n" +
- " /* C6 */\n" +
- " /** C7 */\n" +
- "}"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify method javadoc
- ASTNode node = getASTNode(compilUnit, 0, 0);
- assertEquals("Invalid type for node: "+node, ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("Invalid method name", "foo", methodDeclaration.getName().toString());
- JSdoc methodJavadoc = methodDeclaration.getJavadoc();
- assertNotNull("FunctionDeclaration have a javadoc comment", methodJavadoc);
- int javadocStart = methodJavadoc.getStartPosition();
- assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart);
- // Verify method first leading and last trailing comment
- int index = compilUnit.firstLeadingCommentIndex(methodDeclaration);
- assertEquals("Invalid first leading comment for "+methodDeclaration, 1, index);
- index = compilUnit.lastTrailingCommentIndex(methodDeclaration);
- assertEquals("Invalid last trailing comment for "+methodDeclaration, 7, index);
- }
- }
-
- /**
- * @bug 125676: [javadoc] @category should not read beyond end of line
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125676"
- */
- public void testBug125676() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[3];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b125676/A.js",
- "package javadoc.b125676;\n" +
- "public class A {\n" +
- " /**\n" +
- " * @category \n" +
- " * When searching for field matches, it will exclusively find read accesses, as\n" +
- " * opposed to write accesses. Note that some expressions are considered both\n" +
- " * as field read/write accesses: for example, x++; x+= 1;\n" +
- " * \n" +
- " * @since 2.0\n" +
- " */\n" +
- " int READ_ACCESSES = 4;\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/Converter15/src/javadoc/b125676/B.js",
- "package javadoc.b125676;\n" +
- "public class B {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " int field1;\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " int field2;\n" +
- " /**\n" +
- " * @category test \n" +
- " */\n" +
- " int field3;\n" +
- " /**\n" +
- " * @category test \n" +
- " */\n" +
- " int field4;\n" +
- " /** @category test */\n" +
- " int field5;\n" +
- "\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/Converter15/src/javadoc/b125676/C.js",
- "package javadoc.b125676;\n" +
- "public class C { \n" +
- " /**\n" +
- " * @category test mutli ids\n" +
- " */\n" +
- " int field1;\n" +
- " /**\n" +
- " * @category test mutli ids \n" +
- " */\n" +
- " int field2;\n" +
- " /** @category test mutli ids*/\n" +
- " int field3;\n" +
- "}\n"
- );
- verifyWorkingCopiesComments();
- }
-
- /**
- * @bug 125903: [javadoc] Treat whitespace in javadoc tags as invalid tags
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125903"
- */
- public void testBug125903() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b125903/Test.js",
- "package javadoc.b125903;\n" +
- "/**\n" +
- " * {@ link java.lang.String}\n" +
- " * @ since 2.1\n" +
- " */\n" +
- "public class Test {\n" +
- "\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify method javadoc
- ASTNode node = getASTNode(compilUnit, 0);
- assertEquals("Invalid type for node: "+node, ASTNode.TYPE_DECLARATION, node.getNodeType());
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- JSdoc javadoc = typeDeclaration.getJavadoc();
- assertNotNull("TypeDeclaration should have a javadoc comment", javadoc);
- List tags = javadoc.tags();
- TagElement tag = (TagElement) tags.get(0);
- tag = (TagElement) tag.fragments().get(0);
- assertEquals("Tag name should be empty", tag.getTagName(), "@");
- tag = (TagElement) tags.get(1);
- assertEquals("Tag name should be empty", tag.getTagName(), "@");
- }
- }
-
- /**
- * @bug 130752: [comments] first BlockComment parsed as LineComment
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=130752"
- */
- public void testBug130752() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b130752/Test.js",
- "/* Ceci n'est pas\n" +
- " * une ligne. */\n" +
- "package javadoc.b130752;\n" +
- "public class Test {\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify comment type
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
- assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.BLOCK_COMMENT);
- }
- }
- public void testBug130752b() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b130752/Test.js",
- "// Line comment\n" +
- "package javadoc.b130752;\n" +
- "public class Test {\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify comment type
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
- assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.LINE_COMMENT);
- }
- }
- public void testBug130752c() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b130752/Test.js",
- "/** Javadoc comment */\n" +
- "package javadoc.b130752;\n" +
- "public class Test {\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify comment type
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 1, unitComments.size());
- Comment comment = (Comment) unitComments.get(0);
- assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.JSDOC);
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterRecoveryTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterRecoveryTest.java
deleted file mode 100644
index 2fbd5ac..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterRecoveryTest.java
+++ /dev/null
@@ -1,923 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-
-public class ASTConverterRecoveryTest extends ConverterTestSetup {
- public ASTConverterRecoveryTest(String name) {
- super(name);
- }
-
- static {
-// TESTS_NAMES = new String[] {"test0003"};
-// TESTS_NUMBERS = new int[] { 624 };
- }
- public static Test suite() {
- return buildModelTestSuite(ASTConverterRecoveryTest.class);
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS3);
- }
-
- public void test0001() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(0)\n"+
- " baz(1);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(0);\n" +
- " baz(1);\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(0)", source); //$NON-NLS-1$
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- checkSourceRange(methodInvocation, "bar(0)", source); //$NON-NLS-1$
- List list = methodInvocation.arguments();
- assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$
- Expression parameter = (Expression) list.get(0);
- assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = parameter.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter, "0", source); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(1);
- assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2;
- checkSourceRange(expressionStatement2, "baz(1);", source); //$NON-NLS-1$
- Expression expression2 = expressionStatement2.getExpression();
- assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression2;
- checkSourceRange(methodInvocation2, "baz(1)", source); //$NON-NLS-1$
- List list2 = methodInvocation2.arguments();
- assertTrue("Parameter list is empty", list2.size() == 1); //$NON-NLS-1$
- Expression parameter2 = (Expression) list2.get(0);
- assertTrue("Not a number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding2 = parameter2.resolveTypeBinding();
- assertNotNull("No binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter2, "1", source); //$NON-NLS-1$
- }
-
- public void test0002() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " baz(0);\n"+
- " bar(1,\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " baz(0);\n" +
- " bar(1);\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "baz(0);", source); //$NON-NLS-1$
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- checkSourceRange(methodInvocation, "baz(0)", source); //$NON-NLS-1$
- List list = methodInvocation.arguments();
- assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$
- Expression parameter = (Expression) list.get(0);
- assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = parameter.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter, "0", source); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(1);
- assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2;
- checkSourceRange(expressionStatement2, "bar(1", source); //$NON-NLS-1$
- Expression expression2 = expressionStatement2.getExpression();
- assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression2;
- checkSourceRange(methodInvocation2, "bar(1", source); //$NON-NLS-1$
- List list2 = methodInvocation2.arguments();
- assertTrue("Parameter list is empty", list2.size() == 1); //$NON-NLS-1$
- Expression parameter2 = (Expression) list2.get(0);
- assertTrue("Not a number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding2 = parameter2.resolveTypeBinding();
- assertNotNull("No binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter2, "1", source); //$NON-NLS-1$
- }
-
- public void test0003() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " baz(0);\n"+
- " bar(1,\n"+
- " foo(3);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " baz(0);\n" +
- " bar(1,foo(3));\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "baz(0);", source); //$NON-NLS-1$
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- checkSourceRange(methodInvocation, "baz(0)", source); //$NON-NLS-1$
- List list = methodInvocation.arguments();
- assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$
- Expression parameter = (Expression) list.get(0);
- assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = parameter.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter, "0", source); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(1);
- assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2;
- checkSourceRange(expressionStatement2, "bar(1,\n\t foo(3);", source); //$NON-NLS-1$
- Expression expression2 = expressionStatement2.getExpression();
- assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression2;
- checkSourceRange(methodInvocation2, "bar(1,\n\t foo(3)", source); //$NON-NLS-1$
- List list2 = methodInvocation2.arguments();
- assertTrue("Parameter list is empty", list2.size() == 2); //$NON-NLS-1$
- Expression parameter2 = (Expression) list2.get(0);
- assertTrue("Not a Number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$
- parameter2 = (Expression) list2.get(1);
- assertTrue("Not a method invocation", parameter2 instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation3 = (FunctionInvocation) parameter2;
- checkSourceRange(methodInvocation3, "foo(3)", source); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124296
- public void test0004() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " int var= 123\n"+
- " System.out.println(var);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int var=123;\n" +
- " System.out.println(var);\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement1 = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement1.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement1;
- checkSourceRange(variableDeclarationStatement, "int var= 123", source); //$NON-NLS-1$
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment)fragments.get(0);
- checkSourceRange(variableDeclarationFragment, "var= 123", source); //$NON-NLS-1$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=126148
- public void test0005() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " String[] s = {\"\",,,};\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " String[] s={\"\",$missing$};\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement1 = (Statement) statements.get(0);
- assertTrue("Not an expression variable declaration statement", statement1.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement1;
- checkSourceRange(variableDeclarationStatement, "String[] s = {\"\",,,};", source); //$NON-NLS-1$
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment)fragments.get(0);
- checkSourceRange(variableDeclarationFragment, "s = {\"\",,,}", source); //$NON-NLS-1$
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an array initializer", expression.getNodeType() == ASTNode.ARRAY_INITIALIZER); //$NON-NLS-1$
- ArrayInitializer arrayInitializer = (ArrayInitializer) expression;
- checkSourceRange(arrayInitializer, "{\"\",,,}", source); //$NON-NLS-1$
- List expressions = arrayInitializer.expressions();
- assertEquals("wrong size", 2, expressions.size()); //$NON-NLS-1$
- Expression expression1 = (Expression) expressions.get(0);
- assertTrue("Not a string literal", expression1.getNodeType() == ASTNode.STRING_LITERAL); //$NON-NLS-1$
- StringLiteral stringLiteral = (StringLiteral) expression1;
- checkSourceRange(stringLiteral, "\"\"", source); //$NON-NLS-1$
- Expression expression2 = (Expression) expressions.get(1);
- assertTrue("Not a string literal", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- checkSourceRange(simpleName, ",", source); //$NON-NLS-1$
-
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0006() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar()\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar();\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar()", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0007() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz()\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz()", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz()", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) != 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0008() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " for(int i\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " for (int i; ; ) ;\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Not flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) != 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a for statement", statement.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) statement;
- checkSourceRange(forStatement, "for(int i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (forStatement.getFlags() & ASTNode.RECOVERED) != 0);
- List initializers = forStatement.initializers();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Expression expression = (Expression)initializers.get(0);
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.VARIABLE_DECLARATION_EXPRESSION); //$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression)expression;
- checkSourceRange(variableDeclarationExpression, "int i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (variableDeclarationExpression.getFlags() & ASTNode.RECOVERED) != 0);
- List fragments = variableDeclarationExpression.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment)fragments.get(0);
- checkSourceRange(fragment, "i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (fragment.getFlags() & ASTNode.RECOVERED) != 0);
- SimpleName name = fragment.getName();
- checkSourceRange(name, "i", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (name.getFlags() & ASTNode.RECOVERED) == 0);
- Statement statement2 = forStatement.getBody();
- assertTrue("Not an empty statement", statement2.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- EmptyStatement emptyStatement = (EmptyStatement)statement2;
- checkSourceRange(emptyStatement, "i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (emptyStatement.getFlags() & ASTNode.RECOVERED) != 0);
- }
-
- // check RECOVERED flag (remove tokens)
- public void test0009() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz());#\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Not flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) != 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz());", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) == 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz())", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (remove tokens)
- public void test0010() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz())#;\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz())#;", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz())", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (remove tokens)
- public void test0011() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz()#);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz()#);", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) == 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz()#)", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) != 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0012() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar()#\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar();\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar()#", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=129555
- public void test0013() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " a[0]\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " a[0]=$missing$;\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) != 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "a[0]", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not an assigment", expression.getNodeType() == ASTNode.ASSIGNMENT); //$NON-NLS-1$
- Assignment assignment = (Assignment)expression;
- checkSourceRange(assignment, "a[0]", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (assignment.getFlags() & ASTNode.RECOVERED) != 0);
- Expression rhs = assignment.getRightHandSide();
- assertTrue("Not a simple name", rhs.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) rhs;
- assertEquals("Not length isn't correct", 0, simpleName.getLength()); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=129909
- public void test0014() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " int[] = a[0];\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int[] $missing$=a[0];\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a variable declaration statement", statement.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement;
- checkSourceRange(variableDeclarationStatement, "int[] = a[0];", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (variableDeclarationStatement.getFlags() & ASTNode.RECOVERED) != 0);
- List fragments = variableDeclarationStatement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- SimpleName simpleName = fragment.getName();
- assertEquals("Not length isn't correct", 0, simpleName.getLength()); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=143212
- public void test0015() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " assert 0 == 0 : a[0;\n"+
- " }\n"+
- "}\n");
-
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " assert 0 == 0 : a[0];\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=143212
- public void test0016() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " assert 0 == 0 : foo(;\n"+
- " }\n"+
- "}\n");
-
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " assert 0 == 0 : foo();\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=143212
- public void test0017() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " assert 0 == 0 : (\"aa\";\n"+
- " }\n"+
- "}\n");
-
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " assert 0 == 0 : (\"aa\");\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest.java
deleted file mode 100644
index 9b97b0b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest.java
+++ /dev/null
@@ -1,8795 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
-import org.eclipse.wst.jsdt.core.dom.TryStatement;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.WhileStatement;
-
-public class ASTConverterTest extends ConverterTestSetup {
-
- /** @deprecated using deprecated code */
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS2);
- }
-
- public ASTConverterTest(String name) {
- super(name);
- }
-
- static {
-// TESTS_NUMBERS = new int[] { 305 };
- }
- public static Test suite() {
- return buildModelTestSuite(ASTConverterTest.class);
- }
-
- public void test00() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0005", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ExpressionStatement statement = (ExpressionStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ASTNode expression=statement.getExpression();
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- ArrayAccess arrayAccess = this.ast.newArrayAccess();
- arrayAccess.setArray(this.ast.newSimpleName("args"));
- arrayAccess.setIndex(this.ast.newNumberLiteral("5"));
- methodInvocation.setExpression(arrayAccess);
-
- NumberLiteral literal = this.ast.newNumberLiteral("1");
- methodInvocation.arguments().add(literal);
-
-
- assertTrue("Both AST trees should be identical", methodInvocation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "args[5](1)", source); //$NON-NLS-1$
- }
-
- /** @deprecated using deprecated code */
- public void test0001() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0001", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
-
- // check that we have the right tree
- JavaScriptUnit unit = this.ast.newJavaScriptUnit();
-// PackageDeclaration packageDeclaration = this.ast.newPackageDeclaration();
-// packageDeclaration.setName(this.ast.newSimpleName("test0001"));//$NON-NLS-1$
-// unit.setPackage(packageDeclaration);
-// ImportDeclaration importDeclaration = this.ast.newImportDeclaration();
-// QualifiedName name =
-// this.ast.newQualifiedName(
-// this.ast.newSimpleName("java"),//$NON-NLS-1$
-// this.ast.newSimpleName("util"));//$NON-NLS-1$
-// importDeclaration.setName(name);
-// importDeclaration.setOnDemand(true);
-// unit.imports().add(importDeclaration);
-// TypeDeclaration type = this.ast.newTypeDeclaration();
-// type.setInterface(false);
-// type.setModifiers(Modifier.PUBLIC);
-// type.setName(this.ast.newSimpleName("Test"));//$NON-NLS-1$
- FunctionDeclaration methodDeclaration = this.ast.newFunctionDeclaration();
- methodDeclaration.setConstructor(false);
-// methodDeclaration.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
- methodDeclaration.setName(this.ast.newSimpleName("main"));//$NON-NLS-1$
-// methodDeclaration.setReturnType(this.ast.newPrimitiveType(PrimitiveType.VOID));
- SingleVariableDeclaration variableDeclaration = this.ast.newSingleVariableDeclaration();
-// variableDeclaration.setModifiers(Modifier.NONE);
-// variableDeclaration.setType(this.ast.newArrayType(this.ast.newSimpleType(this.ast.newSimpleName("String"))));//$NON-NLS-1$
- variableDeclaration.setName(this.ast.newSimpleName("args"));//$NON-NLS-1$
- methodDeclaration.parameters().add(variableDeclaration);
- org.eclipse.wst.jsdt.core.dom.Block block = this.ast.newBlock();
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- QualifiedName name =
- this.ast.newQualifiedName(
- this.ast.newSimpleName("System"),//$NON-NLS-1$
- this.ast.newSimpleName("out"));//$NON-NLS-1$
- methodInvocation.setExpression(name);
- methodInvocation.setName(this.ast.newSimpleName("println")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("Hello");//$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();
- literal.setLiteralValue(" world");//$NON-NLS-1$
- infixExpression.setRightOperand(literal);//$NON-NLS-1$
- methodInvocation.arguments().add(infixExpression);
- ExpressionStatement expressionStatement = this.ast.newExpressionStatement(methodInvocation);
- block.statements().add(expressionStatement);
- methodDeclaration.setBody(block);
- unit.statements().add(methodDeclaration);
- assertTrue("Both AST trees should be identical", result.subtreeMatch(new ASTMatcher(), unit));//$NON-NLS-1$
- String expected =
- "function main(args) {\n" +
- " print(\"Hello\" + \" world\");\n" +
- "}" +
- "";
- checkSourceRange(result, expected, source);
- }
-
- /**
- * Test allocation expression: new Object() ==> ClassInstanceCreation
- * @deprecated using deprecated code
- */
- public void test0002() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0002", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
- classInstanceCreation.setMember(this.ast.newSimpleName("Object")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new Object()", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new java.lang.Object() ==> ClassInstanceCreation
- * @deprecated using deprecated code
- */
- public void test0003() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0003", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
-
- FieldAccess expr = this.ast.newFieldAccess();
- expr.setName(this.ast.newSimpleName("Object"));
-
- FieldAccess expr2 = this.ast.newFieldAccess();
- expr2.setName(this.ast.newSimpleName("lang"));
- expr2.setExpression(this.ast.newSimpleName("java"));
-
- expr.setExpression(expr2);
-
- classInstanceCreation.setMember(expr);
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new java.lang.Object()", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new java.lang.Exception("ERROR") ==> ClassInstanceCreation
- * @deprecated using deprecated code
- */
- public void test0004() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0004", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
-
- FieldAccess expr = this.ast.newFieldAccess();
- expr.setName(this.ast.newSimpleName("Exception"));
-
- FieldAccess expr2 = this.ast.newFieldAccess();
- expr2.setName(this.ast.newSimpleName("lang"));
- expr2.setExpression(this.ast.newSimpleName("java"));
-
- expr.setExpression(expr2);
-
- classInstanceCreation.setMember(expr);
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("ERROR"); //$NON-NLS-1$
- classInstanceCreation.arguments().add(literal);
- assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "new java.lang.Exception(\"ERROR\")", source); //$NON-NLS-1$
- }
-
- public void test0005() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0005", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ExpressionStatement statement = (ExpressionStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ASTNode expression=statement.getExpression();
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- ArrayAccess arrayAccess = this.ast.newArrayAccess();
- arrayAccess.setArray(this.ast.newSimpleName("args"));
- arrayAccess.setIndex(this.ast.newNumberLiteral("5"));
- methodInvocation.setExpression(arrayAccess);
-
- NumberLiteral literal = this.ast.newNumberLiteral("1");
- methodInvocation.arguments().add(literal);
-
-
- assertTrue("Both AST trees should be identical", methodInvocation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "args[5](1)", source); //$NON-NLS-1$
- }
-
-
-// /**
-// * Test allocation expression: new java.lang.Runnable() { public void run() {}} ==> ClassInstanceCreation
-// * @deprecated using deprecated code
-// */
-// public void test0006() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0006", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
-// assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
-// QualifiedName name =
-// this.ast.newQualifiedName(
-// this.ast.newQualifiedName(
-// this.ast.newSimpleName("java"), //$NON-NLS-1$
-// this.ast.newSimpleName("lang")), //$NON-NLS-1$
-// this.ast.newSimpleName("Runnable"));//$NON-NLS-1$
-// classInstanceCreation.setName(name);
-// FunctionDeclaration methodDeclaration = this.ast.newMethodDeclaration();
-// methodDeclaration.setBody(this.ast.newBlock());
-// methodDeclaration.setConstructor(false);
-// methodDeclaration.setModifiers(Modifier.PUBLIC);
-// methodDeclaration.setName(this.ast.newSimpleName("run"));//$NON-NLS-1$
-// methodDeclaration.setReturnType(this.ast.newPrimitiveType(PrimitiveType.VOID));
-// AnonymousClassDeclaration anonymousClassDeclaration = this.ast.newAnonymousClassDeclaration();
-// anonymousClassDeclaration.bodyDeclarations().add(methodDeclaration);
-// classInstanceCreation.setAnonymousClassDeclaration(anonymousClassDeclaration);
-// assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
-// checkSourceRange(expression, "new java.lang.Runnable() { public void run() {}}", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Test allocation expression: new Test().new D() ==> ClassInstanceCreation
-// * @deprecated using deprecated code
-// */
-// public void test0007() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0007", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node;
-// ASTNode expression = (ASTNode) ((FunctionInvocation) expressionStatement.getExpression()).arguments().get(0);
-// assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = this.ast.newClassInstanceCreation();
-// classInstanceCreation.setName(this.ast.newSimpleName("D")); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreationExpression = this.ast.newClassInstanceCreation();
-// classInstanceCreationExpression.setName(this.ast.newSimpleName("Test")); //$NON-NLS-1$
-// classInstanceCreation.setExpression(classInstanceCreationExpression);
-// assertTrue("Both AST trees should be identical", classInstanceCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
-// checkSourceRange(expression, "new Test().new D()", source); //$NON-NLS-1$
-// }
-
- /**
- * Test allocation expression: new int[] {1, 2, 3, 4} ==> ArrayCreation
- */
- public void test0008() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0008", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ArrayInitializer arrayInitializer = this.ast.newArrayInitializer();
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("3"));//$NON-NLS-1$
- arrayInitializer.expressions().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", arrayInitializer.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "[1, 2, 3, 4]", source); //$NON-NLS-1$
- }
-
- /**
- * Test allocation expression: new int[][] {{1}, {2}} ==> ArrayCreation
- */
- public void test0009() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0009", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- ArrayInitializer arrayInitializer = this.ast.newArrayInitializer();
- ArrayInitializer innerArrayInitializer = this.ast.newArrayInitializer();
- innerArrayInitializer.expressions().add(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- arrayInitializer.expressions().add(innerArrayInitializer);
- innerArrayInitializer = this.ast.newArrayInitializer();
- innerArrayInitializer.expressions().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- arrayInitializer.expressions().add(innerArrayInitializer);
- assertTrue("Both AST trees should be identical", arrayInitializer.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "[[1], [2]]", source); //$NON-NLS-1$
- }
-
-// /**
-// * Test allocation expression: new int[3] ==> ArrayCreation
-// */
-// public void test0010() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0010", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
-// assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-// ArrayCreation arrayCreation = this.ast.newArrayCreation();
-// arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 1));
-// arrayCreation.dimensions().add(this.ast.newNumberLiteral("3")); //$NON-NLS-1$
-// assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
-// checkSourceRange(expression, "new int[3]", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Test allocation expression: new int[3][] ==> ArrayCreation
-// */
-// public void test0011() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0011", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
-// assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-// ArrayCreation arrayCreation = this.ast.newArrayCreation();
-// arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 2));
-// arrayCreation.dimensions().add(this.ast.newNumberLiteral("3")); //$NON-NLS-1$
-// assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
-// checkSourceRange(expression, "new int[3][]", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Test allocation expression: new int[][] {{},{}} ==> ArrayCreation
-// */
-// public void test0012() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0012", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
-// assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-// ArrayCreation arrayCreation = this.ast.newArrayCreation();
-// arrayCreation.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 2));
-// ArrayInitializer arrayInitializer = this.ast.newArrayInitializer();
-// ArrayInitializer innerArrayInitializer = this.ast.newArrayInitializer();
-// arrayInitializer.expressions().add(innerArrayInitializer);
-// innerArrayInitializer = this.ast.newArrayInitializer();
-// arrayInitializer.expressions().add(innerArrayInitializer);
-// arrayCreation.setInitializer(arrayInitializer);
-// assertTrue("Both AST trees should be identical", arrayCreation.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
-// checkSourceRange(expression, "new int[][] {{}, {}}", source); //$NON-NLS-1$
-// }
-
- /**
- * int i; ==> VariableDeclarationFragment
- * @deprecated using deprecated code
- */
- public void test0013() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0013", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var i;", source); //$NON-NLS-1$
- }
-
- /**
- * int i = 0; ==> VariableDeclarationFragment
- * @deprecated using deprecated code
- */
- public void test0014() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0014", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var i = 0;", source); //$NON-NLS-1$
- }
-
- /**
- * i = 1; ==> ExpressionStatement(Assignment)
- */
- public void test0015() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0015", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("1")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i = 1;", source); //$NON-NLS-1$
- }
-
- /**
- * i += 2; ==> ExpressionStatement(Assignment)
- */
- public void test0016() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0016", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.PLUS_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i += 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i -= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0017() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0017", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.MINUS_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i -= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i *= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0018() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0018", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.TIMES_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i *= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i /= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0019() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0019", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.DIVIDE_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i /= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i &= 2 ==> ExpressionStatement(Assignment)
- */
- public void test0020() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0020", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.BIT_AND_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i &= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i |= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0021() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0021", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.BIT_OR_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i |= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i ^= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0022() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0022", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.BIT_XOR_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i ^= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i %= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0023() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0023", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.REMAINDER_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i %= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i <<= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0024() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0024", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.LEFT_SHIFT_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i <<= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i >>= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0025() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0025", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i >>= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * i >>>= 2; ==> ExpressionStatement(Assignment)
- */
- public void test0026() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0026", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- Assignment assignment = this.ast.newAssignment();
- assignment.setLeftHandSide(this.ast.newSimpleName("i")); //$NON-NLS-1$
- assignment.setRightHandSide(this.ast.newNumberLiteral("2")); //$NON-NLS-1$
- assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN);
- ExpressionStatement statement = this.ast.newExpressionStatement(assignment);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i >>>= 2;", source); //$NON-NLS-1$
- }
-
- /**
- * --i; ==> ExpressionStatement(PrefixExpression)
- */
- public void test0027() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0027", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- prefixExpression.setOperator(PrefixExpression.Operator.DECREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(prefixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "--i;", source); //$NON-NLS-1$
- }
-
- /**
- * --i; ==> ExpressionStatement(PrefixExpression)
- */
- public void test0028() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0028", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- prefixExpression.setOperator(PrefixExpression.Operator.INCREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(prefixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "++i;", source); //$NON-NLS-1$
- }
-
- /**
- * i--; ==> ExpressionStatement(PostfixExpression)
- */
- public void test0029() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0029", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.DECREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(postfixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i--;", source); //$NON-NLS-1$
- }
-
- /**
- * i++; ==> ExpressionStatement(PostfixExpression)
- */
- public void test0030() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0030", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(postfixExpression);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "i++;", source); //$NON-NLS-1$
- }
-
-// /**
-// * (String) o; ==> ExpressionStatement(CastExpression)
-// * @deprecated using deprecated code
-// */
-// public void test0031() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0031", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
-// CastExpression castExpression = this.ast.newCastExpression();
-// castExpression.setExpression(this.ast.newSimpleName("o"));//$NON-NLS-1$
-// castExpression.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(castExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "String s = (String) o;", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * (int) d; ==> ExpressionStatement(CastExpression)
-// * @deprecated using deprecated code
-// */
-// public void test0032() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0032", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
-// CastExpression castExpression = this.ast.newCastExpression();
-// castExpression.setExpression(this.ast.newSimpleName("d"));//$NON-NLS-1$
-// castExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));//$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(castExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));//$NON-NLS-1$
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "int i = (int) d;", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * (float) d; ==> ExpressionStatement(CastExpression)
-// * @deprecated using deprecated code
-// */
-// public void test0033() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0033", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("f")); //$NON-NLS-1$
-// CastExpression castExpression = this.ast.newCastExpression();
-// castExpression.setExpression(this.ast.newSimpleName("d"));//$NON-NLS-1$
-// castExpression.setType(this.ast.newPrimitiveType(PrimitiveType.FLOAT));//$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(castExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.FLOAT));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "float f = (float) d;", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * (byte) d; ==> ExpressionStatement(CastExpression)
-// * @deprecated using deprecated code
-// */
-// public void test0034() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0034", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("b")); //$NON-NLS-1$
-// CastExpression castExpression = this.ast.newCastExpression();
-// castExpression.setExpression(this.ast.newSimpleName("d"));//$NON-NLS-1$
-// castExpression.setType(this.ast.newPrimitiveType(PrimitiveType.BYTE));//$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(castExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BYTE));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "byte b = (byte) d;", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * (short) d; ==> ExpressionStatement(CastExpression)
-// * @deprecated using deprecated code
-// */
-// public void test0035() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0035", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
-// CastExpression castExpression = this.ast.newCastExpression();
-// castExpression.setExpression(this.ast.newSimpleName("d"));//$NON-NLS-1$
-// castExpression.setType(this.ast.newPrimitiveType(PrimitiveType.SHORT));//$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(castExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.SHORT));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "short s = (short) d;", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * (long) d; ==> ExpressionStatement(CastExpression)
-// * @deprecated using deprecated code
-// */
-// public void test0036() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0036", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("l")); //$NON-NLS-1$
-// CastExpression castExpression = this.ast.newCastExpression();
-// castExpression.setExpression(this.ast.newSimpleName("d"));//$NON-NLS-1$
-// castExpression.setType(this.ast.newPrimitiveType(PrimitiveType.LONG));//$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(castExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.LONG));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "long l = (long) d;", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * (char) i; ==> ExpressionStatement(CastExpression)
-// * @deprecated using deprecated code
-// */
-// public void test0037() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0037", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
-// CastExpression castExpression = this.ast.newCastExpression();
-// castExpression.setExpression(this.ast.newSimpleName("i"));//$NON-NLS-1$
-// castExpression.setType(this.ast.newPrimitiveType(PrimitiveType.CHAR));//$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(castExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.CHAR));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "char c = (char) i;", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * int.class; ==> ExpressionStatement(TypeLiteral)
-// * @deprecated using deprecated code
-// */
-// public void test0038() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0038", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
-// TypeLiteral typeLiteral = this.ast.newTypeLiteral();
-// typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-// variableDeclarationFragment.setInitializer(typeLiteral);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "int.class", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * void.class; ==> ExpressionStatement(TypeLiteral)
-// * @deprecated using deprecated code
-// */
-// public void test0039() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0039", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
-// TypeLiteral typeLiteral = this.ast.newTypeLiteral();
-// typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.VOID));
-// variableDeclarationFragment.setInitializer(typeLiteral);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "void.class", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * double.class; ==> ExpressionStatement(TypeLiteral)
-// * @deprecated using deprecated code
-// */
-// public void test0040() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0040", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
-// TypeLiteral typeLiteral = this.ast.newTypeLiteral();
-// typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.DOUBLE));
-// variableDeclarationFragment.setInitializer(typeLiteral);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "double.class", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * long.class; ==> ExpressionStatement(TypeLiteral)
-// * @deprecated using deprecated code
-// */
-// public void test0041() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0041", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("c")); //$NON-NLS-1$
-// TypeLiteral typeLiteral = this.ast.newTypeLiteral();
-// typeLiteral.setType(this.ast.newPrimitiveType(PrimitiveType.LONG));
-// variableDeclarationFragment.setInitializer(typeLiteral);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newSimpleType(this.ast.newSimpleName("Class")));//$NON-NLS-1$
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(((VariableDeclarationFragment)((VariableDeclarationStatement)node).fragments().get(0)).getInitializer(), "long.class", source); //$NON-NLS-1$
-// }
-
- /**
- * false ==> BooleanLiteral
- */
- public void test0042() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0042", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- BooleanLiteral literal = this.ast.newBooleanLiteral(false);
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "false", source); //$NON-NLS-1$
- }
-
- /**
- * true ==> BooleanLiteral
- */
- public void test0043() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0043", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- BooleanLiteral literal = this.ast.newBooleanLiteral(true);
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "true", source); //$NON-NLS-1$
- }
-
- /**
- * null ==> NullLiteral
- */
- public void test0044() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0044", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NullLiteral literal = this.ast.newNullLiteral();
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "null", source); //$NON-NLS-1$
- }
-
- /**
- * CharLiteral ==> CharacterLiteral
- */
- public void test0045() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0045", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- CharacterLiteral literal = this.ast.newCharacterLiteral();
- literal.setEscapedValue("'c'"); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "'c'", source); //$NON-NLS-1$
- }
-
- /**
- * DoubleLiteral ==> NumberLiteral
- */
- public void test0046() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0046", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("1.00001");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "1.00001", source); //$NON-NLS-1$
- }
-
- /**
- * FloatLiteral ==> NumberLiteral
- */
- public void test0047() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0047", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("1.00001f");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "1.00001f", source); //$NON-NLS-1$
- }
-
- /**
- * IntLiteral ==> NumberLiteral
- */
- public void test0048() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0048", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("30000");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "30000", source); //$NON-NLS-1$
- }
-
- /**
- * IntLiteralMinValue ==> NumberLiteral
- */
- public void test0049() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0049", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("-2147483648");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "-2147483648", source); //$NON-NLS-1$
- }
-
- /**
- * LongLiteral ==> NumberLiteral
- */
- public void test0050() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0050", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("2147483648L");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "2147483648L", source); //$NON-NLS-1$
- }
-
- /**
- * LongLiteral ==> NumberLiteral (negative value)
- */
- public void test0051() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0051", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("2147483648L");//$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperand(literal);
- prefixExpression.setOperator(PrefixExpression.Operator.MINUS);
- assertTrue("Both AST trees should be identical", prefixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "-2147483648L", source); //$NON-NLS-1$
- }
-
- /**
- * LongLiteralMinValue ==> NumberLiteral
- */
- public void test0052() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0052", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral("-9223372036854775808L");//$NON-NLS-1$
- assertTrue("Both AST trees should be identical", literal.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "-9223372036854775808L", source); //$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0053() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0053", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- /*
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello World");*/
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("Hello");//$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();
- literal.setLiteralValue(" World");//$NON-NLS-1$
- infixExpression.setRightOperand(literal);//$NON-NLS-1$
-
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\"", source); //$NON-NLS-1$
- }
-
- /**
- * AND_AND_Expression ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0054() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0054", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b3")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_AND);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b3 = b && b2;", source); //$NON-NLS-1$
- }
-
- /**
- * OR_OR_Expression ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0055() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0055", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b3")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.CONDITIONAL_OR);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b3 = b || b2;", source); //$NON-NLS-1$
- }
-
- /**
- * EqualExpression ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0056() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0056", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b3")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b3 = b == b2;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (+) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0057() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0057", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i + j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (-) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0058() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0058", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i - j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (*) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0059() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0059", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.TIMES);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i * j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (/) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0060() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0060", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.DIVIDE);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i / j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (%) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0061() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0061", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.REMAINDER);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i % j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (^) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0062() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0062", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.XOR);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i ^ j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (&) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0063() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0063", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.AND);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i & j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (|) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0064() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0064", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("j")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.OR);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = i | j;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (<) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0065() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0065", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b2 = b < b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (<=) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0066() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0066", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS_EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b2 = b <= b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (>) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0067() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0067", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.GREATER);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b2 = b > b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (>=) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0068() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0068", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.GREATER_EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b2 = b >= b1;", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression (!=) ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0069() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0069", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b2")); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("b")); //$NON-NLS-1$
- infixExpression.setRightOperand(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.NOT_EQUALS);
- variableDeclarationFragment.setInitializer(infixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b2 = b != b1;", source); //$NON-NLS-1$
- }
-
- /**
- * InstanceofExpression ==> InfixExpression
- * @deprecated using deprecated code
- */
- public void test0070() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0070", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b")); //$NON-NLS-1$
- InfixExpression instanceOfExpression = this.ast.newInfixExpression();
- instanceOfExpression.setLeftOperand(this.ast.newSimpleName("o"));//$NON-NLS-1$
- instanceOfExpression.setOperator(InfixExpression.Operator.INSTANCEOF);
-// SimpleType simpleType = this.ast.newSimpleType(this.ast.newSimpleName("Integer"));//$NON-NLS-1$
- instanceOfExpression.setRightOperand(this.ast.newSimpleName("Number"));
- variableDeclarationFragment.setInitializer(instanceOfExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b = o instanceof Number;", source); //$NON-NLS-1$
- }
-
-// /**
-// * InstanceofExpression ==> InfixExpression
-// * @deprecated using deprecated code
-// */
-// public void test0071() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0071", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("b")); //$NON-NLS-1$
-// InstanceofExpression instanceOfExpression = this.ast.newInstanceofExpression();
-// instanceOfExpression.setLeftOperand(this.ast.newSimpleName("o")); //$NON-NLS-1$
-// QualifiedName name =
-// this.ast.newQualifiedName(
-// this.ast.newQualifiedName(
-// this.ast.newSimpleName("java"), //$NON-NLS-1$
-// this.ast.newSimpleName("lang")), //$NON-NLS-1$
-// this.ast.newSimpleName("Integer")); //$NON-NLS-1$
-// Type type = ast.newSimpleType(name);
-// instanceOfExpression.setRightOperand(type);
-// variableDeclarationFragment.setInitializer(instanceOfExpression);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setModifiers(Modifier.NONE);
-//// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "var b = o instanceof java.lang.Integer;", source); //$NON-NLS-1$
-// }
-
- /**
- * UnaryExpression (!) ==> PrefixExpression
- * @deprecated using deprecated code
- */
- public void test0072() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0072", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b1")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.NOT);
- prefixExpression.setOperand(this.ast.newSimpleName("b"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b1 = !b;", source); //$NON-NLS-1$
- }
-
- /**
- * UnaryExpression (~) ==> PrefixExpression
- * @deprecated using deprecated code
- */
- public void test0073() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0073", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("n")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.COMPLEMENT);
- prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var n = ~i;", source); //$NON-NLS-1$
- }
-
- /**
- * UnaryExpression (+) ==> PrefixExpression
- * @deprecated using deprecated code
- */
- public void test0074() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0074", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.PLUS);
- prefixExpression.setOperand(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var i = +2;", source); //$NON-NLS-1$
- }
-
- /**
- * UnaryExpression (-) ==> PrefixExpression
- * @deprecated using deprecated code
- */
- public void test0075() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0075", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- PrefixExpression prefixExpression = this.ast.newPrefixExpression();
- prefixExpression.setOperator(PrefixExpression.Operator.MINUS);
- prefixExpression.setOperand(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(prefixExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var i = -2;", source); //$NON-NLS-1$
- }
-
- /**
- * ConditionalExpression ==> ConditionalExpression
- * @deprecated using deprecated code
- */
- public void test0076() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0076", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("b")); //$NON-NLS-1$
- ConditionalExpression conditionalExpression = this.ast.newConditionalExpression();
- InfixExpression condition = this.ast.newInfixExpression();
- condition.setLeftOperand(this.ast.newSimpleName("args")); //$NON-NLS-1$
- condition.setRightOperand(this.ast.newNullLiteral()); //$NON-NLS-1$
- condition.setOperator(InfixExpression.Operator.NOT_EQUALS);
- conditionalExpression.setExpression(condition);
- conditionalExpression.setThenExpression(this.ast.newBooleanLiteral(true));
- conditionalExpression.setElseExpression(this.ast.newBooleanLiteral(false));
- variableDeclarationFragment.setInitializer(conditionalExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.BOOLEAN));
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var b = args != null ? true : false;", source); //$NON-NLS-1$
- }
-
- /**
- * ConditionalExpression ==> ConditionalExpression
- * @deprecated using deprecated code
- */
- public void test0077() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0077", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- ConditionalExpression conditionalExpression = this.ast.newConditionalExpression();
- conditionalExpression.setExpression(this.ast.newBooleanLiteral(true));
-// QualifiedName name =
-// this.ast.newQualifiedName(
-// this.ast.newSimpleName("args"), //$NON-NLS-1$
-// this.ast.newSimpleName("length")); //$NON-NLS-1$
-// conditionalExpression.setThenExpression(name);
- FieldAccess fieldAccess=this.ast.newFieldAccess();
- fieldAccess.setExpression(this.ast.newSimpleName("args"));
- fieldAccess.setName(this.ast.newSimpleName("length"));
- conditionalExpression.setThenExpression(fieldAccess);
- conditionalExpression.setElseExpression(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(conditionalExpression);
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
- statement.setModifiers(Modifier.NONE);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var i = true ? args.length: 0;", source); //$NON-NLS-1$
- }
-//
-// /**
-// * MessageSend ==> SuperMethodInvocation
-// */
-// public void test0078() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0078", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// SuperMethodInvocation superMethodInvocation = this.ast.newSuperMethodInvocation();
-// superMethodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
-// ExpressionStatement statement = this.ast.newExpressionStatement(superMethodInvocation);
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "super.bar();", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * MessageSend ==> SuperMethodInvocation
-// */
-// public void test0079() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0079", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// SuperMethodInvocation superMethodInvocation = this.ast.newSuperMethodInvocation();
-// superMethodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
-// superMethodInvocation.arguments().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
-// ExpressionStatement statement = this.ast.newExpressionStatement(superMethodInvocation);
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "super.bar(4);", source); //$NON-NLS-1$
-// }
-
- /**
- * MessageSend ==> FunctionInvocation
- */
- public void test0080() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0080", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- methodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
- methodInvocation.arguments().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(methodInvocation);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "bar(4);", source); //$NON-NLS-1$
- }
-
- /**
- * MessageSend ==> FunctionInvocation
- */
- public void test0081() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0081", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
- methodInvocation.setName(this.ast.newSimpleName("bar")); //$NON-NLS-1$
- methodInvocation.setExpression(this.ast.newThisExpression());
- methodInvocation.arguments().add(this.ast.newNumberLiteral("4"));//$NON-NLS-1$
- ExpressionStatement statement = this.ast.newExpressionStatement(methodInvocation);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "this.bar(4);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0082() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0082", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (;;);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- * @deprecated using deprecated code
- */
- public void test0083() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0083", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setModifiers(Modifier.NONE);
-// variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newBlock());
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (var i = 0; i < 10; i++) {}", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- * @deprecated using deprecated code
- */
- public void test0084() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0084", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
-
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setModifiers(Modifier.NONE);
-// variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (var i = 0; i < 10; i++);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- * @deprecated using deprecated code
- */
- public void test0085() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0085", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
-
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setModifiers(Modifier.NONE);
-// variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (var i = 0;; i++);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0086() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0086", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (; i < 10; i++);", source); //$NON-NLS-1$
- }
-
- /**
- * ForStatement ==> ForStatement
- */
- public void test0087() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0087", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (;;i++);", source); //$NON-NLS-1$
- }
-
- /**
- * LocalDeclaration ==> VariableDeclarationStatement
- * @deprecated using deprecated code
- */
- public void test0088() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0088", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
-
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- statement.setModifiers(Modifier.NONE);
-
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var i;", source); //$NON-NLS-1$
- }
-
-// /**
-// * LocalDeclaration ==> VariableDeclarationStatement
-// * @deprecated using deprecated code
-// */
-// public void test0089() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0089", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-//
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
-//
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// QualifiedName name =
-// this.ast.newQualifiedName(
-// this.ast.newQualifiedName(
-// this.ast.newSimpleName("java"),//$NON-NLS-1$
-// this.ast.newSimpleName("lang")//$NON-NLS-1$
-// ),
-// this.ast.newSimpleName("String") //$NON-NLS-1$
-// );
-// statement.setType(this.ast.newSimpleType(name));
-// statement.setModifiers(Modifier.NONE);
-//
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "java.lang.String s;", source); //$NON-NLS-1$
-// }
-
- /**
- * LocalDeclaration ==> VariableDeclarationStatement
- * @deprecated using deprecated code
- */
- public void test0090() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0090", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- ArrayInitializer initializer = this.ast.newArrayInitializer();
- initializer.expressions().add(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- initializer.expressions().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- variableDeclarationFragment.setInitializer(initializer);
- variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
-
- VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(variableDeclarationFragment);
-// statement.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 1));
- statement.setModifiers(Modifier.NONE);
- assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var tab = [1, 2];", source); //$NON-NLS-1$
- }
-
- /**
- * Argument ==> SingleVariableDeclaration
- * @deprecated using deprecated code
- */
- public void test0091() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0091", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- FunctionDeclaration method = (FunctionDeclaration) ((JavaScriptUnit) result).statements().get(0);
- SingleVariableDeclaration node = (SingleVariableDeclaration) method.parameters().get(0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- SingleVariableDeclaration variableDeclaration = this.ast.newSingleVariableDeclaration();
- variableDeclaration.setModifiers(Modifier.NONE);
-// variableDeclaration.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
- variableDeclaration.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", variableDeclaration.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "s", source); //$NON-NLS-1$
- }
-
- /**
- * Argument ==> SingleVariableDeclaration
- * @deprecated using deprecated code
- */
-// public void test0092() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0092", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// FunctionDeclaration method = (FunctionDeclaration)((TypeDeclaration) ((JavaScriptUnit) result).types().get(0)).bodyDeclarations().get(0);
-// SingleVariableDeclaration node = (SingleVariableDeclaration) method.parameters().get(0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// SingleVariableDeclaration variableDeclaration = this.ast.newSingleVariableDeclaration();
-// variableDeclaration.setModifiers(Modifier.FINAL);
-// variableDeclaration.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
-// variableDeclaration.setName(this.ast.newSimpleName("s")); //$NON-NLS-1$
-// assertTrue("Both AST trees should be identical", variableDeclaration.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "final String s", source); //$NON-NLS-1$
-// assertEquals("Wrong dimension", 0, node.getExtraDimensions()); //$NON-NLS-1$
-// }
-
- /**
- * Break ==> BreakStatement
- */
- public void test0093() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0093", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) node;
- BreakStatement statement = (BreakStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- BreakStatement breakStatement = this.ast.newBreakStatement();
- assertTrue("Both AST trees should be identical", breakStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "break;", source); //$NON-NLS-1$
- }
-
- /**
- * Continue ==> ContinueStatement
- */
- public void test0094() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0094", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) node;
- ContinueStatement statement = (ContinueStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- ContinueStatement continueStatement = this.ast.newContinueStatement();
- assertTrue("Both AST trees should be identical", continueStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "continue;", source); //$NON-NLS-1$
- }
-
- /**
- * Continue with Label ==> ContinueStatement
- */
- public void test0095() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0095", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- ContinueStatement statement = (ContinueStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- ContinueStatement continueStatement = this.ast.newContinueStatement();
- continueStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", continueStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "continue label;", source); //$NON-NLS-1$
- }
-
- /**
- * Break + label ==> BreakStatement
- */
- public void test0096() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0096", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- BreakStatement statement = (BreakStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- BreakStatement breakStatement = this.ast.newBreakStatement();
- breakStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", breakStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "break label;", source); //$NON-NLS-1$
- }
-
- /**
- * SwitchStatement ==> SwitchStatement
- */
- public void test0097() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0097", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- SwitchStatement switchStatement = this.ast.newSwitchStatement();
- switchStatement.setExpression(this.ast.newSimpleName("i"));//$NON-NLS-1$
- SwitchCase _case = this.ast.newSwitchCase();
- _case.setExpression(this.ast.newNumberLiteral("1"));//$NON-NLS-1$
- switchStatement.statements().add(_case);
- switchStatement.statements().add(this.ast.newBreakStatement());
- _case = this.ast.newSwitchCase();
- _case.setExpression(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- switchStatement.statements().add(_case);
- FunctionInvocation methodInvocation = this.ast.newFunctionInvocation();
-// QualifiedName name =
-// this.ast.newQualifiedName(
-// this.ast.newSimpleName("System"),//$NON-NLS-1$
-// this.ast.newSimpleName("out"));//$NON-NLS-1$
-// methodInvocation.setExpression(name);
- FieldAccess fieldAccess = this.ast.newFieldAccess();
- fieldAccess.setExpression(this.ast.newSimpleName("System"));
- fieldAccess.setName(this.ast.newSimpleName("out"));
- methodInvocation.setExpression(fieldAccess);
- methodInvocation.setName(this.ast.newSimpleName("println")); //$NON-NLS-1$
- methodInvocation.arguments().add(this.ast.newNumberLiteral("2"));//$NON-NLS-1$
- ExpressionStatement expressionStatement = this.ast.newExpressionStatement(methodInvocation);
- switchStatement.statements().add(expressionStatement);
- switchStatement.statements().add(this.ast.newBreakStatement());
- _case = this.ast.newSwitchCase();
- _case.setExpression(null);
- switchStatement.statements().add(_case);
- methodInvocation = this.ast.newFunctionInvocation();
-// name =
-// this.ast.newQualifiedName(
-// this.ast.newSimpleName("System"),//$NON-NLS-1$
-// this.ast.newSimpleName("out"));//$NON-NLS-1$
-// methodInvocation.setExpression(name);
- fieldAccess = this.ast.newFieldAccess();
- fieldAccess.setExpression(this.ast.newSimpleName("System"));
- fieldAccess.setName(this.ast.newSimpleName("out"));
- methodInvocation.setExpression(fieldAccess);
- methodInvocation.setName(this.ast.newSimpleName("println")); //$NON-NLS-1$
- StringLiteral literal = this.ast.newStringLiteral();
- literal.setLiteralValue("default"); //$NON-NLS-1$
- methodInvocation.arguments().add(literal);
- expressionStatement = this.ast.newExpressionStatement(methodInvocation);
- switchStatement.statements().add(expressionStatement);
- assertTrue("Both AST trees should be identical", switchStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "switch(i) {\n" +//$NON-NLS-1$
- " case 1: \n" +//$NON-NLS-1$
- " break;\n" +//$NON-NLS-1$
- " case 2:\n" +//$NON-NLS-1$
- " System.out.println(2);\n" +//$NON-NLS-1$
- " break;\n" +//$NON-NLS-1$
- " default:\n" +//$NON-NLS-1$
- " System.out.println(\"default\");\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- SwitchStatement switchStatement2 = (SwitchStatement) node;
- List statements = switchStatement2.statements();
- assertEquals("wrong size", 7, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(5);
- assertTrue("Not a case statement", stmt instanceof SwitchCase); //$NON-NLS-1$
- SwitchCase switchCase = (SwitchCase) stmt;
- assertTrue("Not the default case", switchCase.isDefault()); //$NON-NLS-1$
- }
-
- /**
- * EmptyStatement ==> EmptyStatement
- */
- public void test0098() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0098", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- EmptyStatement emptyStatement = this.ast.newEmptyStatement();
- assertTrue("Both AST trees should be identical", emptyStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, ";", source); //$NON-NLS-1$
- }
-
- /**
- * DoStatement ==> DoStatement
- */
- public void test0099() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0099", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- DoStatement doStatement = this.ast.newDoStatement();
- Block block = this.ast.newBlock();
- block.statements().add(this.ast.newEmptyStatement());
- doStatement.setBody(block);
- doStatement.setExpression(this.ast.newBooleanLiteral(true));
- assertTrue("Both AST trees should be identical", doStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "do {;\n" +//$NON-NLS-1$
- " } while(true);";//$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * WhileStatement ==> WhileStatement
- */
- public void test0100() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0100", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- WhileStatement whileStatement = this.ast.newWhileStatement();
- whileStatement.setExpression(this.ast.newBooleanLiteral(true));
- whileStatement.setBody(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", whileStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "while(true);", source);//$NON-NLS-1$
- }
-
- /**
- * WhileStatement ==> WhileStatement
- */
- public void test0101() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0101", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- WhileStatement whileStatement = this.ast.newWhileStatement();
- whileStatement.setExpression(this.ast.newBooleanLiteral(true));
- whileStatement.setBody(this.ast.newBlock());
- assertTrue("Both AST trees should be identical", whileStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "while(true) {}", source);//$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0102() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0102", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue(" World"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\" + \"!\"", source);//$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0103() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0103", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue(" World"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\" + \"!\" + \"!\"", source);//$NON-NLS-1$
- }
-
- /**
- * ExtendedStringLiteral ==> StringLiteral
- */
- public void test0104() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0104", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("Hello"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue(" World"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newStringLiteral();//$NON-NLS-1$
- literal.setLiteralValue("!"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- NumberLiteral numberLiteral = this.ast.newNumberLiteral();//$NON-NLS-1$
- numberLiteral.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(numberLiteral);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"Hello\" + \" World\" + \"!\" + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0105() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0105", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "4 + 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0106() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0106", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
-
- InfixExpression infixExpression2 = this.ast.newInfixExpression();
- infixExpression2.setOperator(InfixExpression.Operator.PLUS);
- infixExpression2.setLeftOperand(infixExpression);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression2.setRightOperand(literal);
-
- InfixExpression infixExpression3 = this.ast.newInfixExpression();
- infixExpression3.setOperator(InfixExpression.Operator.PLUS);
- infixExpression3.setLeftOperand(infixExpression2);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression3.setRightOperand(literal);
-
- assertTrue("Both AST trees should be identical", infixExpression3.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "4 - 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0107() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0107", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "4 - 5 - 6 - 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0108() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0108", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- StringLiteral stringLiteral = this.ast.newStringLiteral();//$NON-NLS-1$
- stringLiteral.setLiteralValue("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(stringLiteral);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression.extendedOperands().add(literal);
- assertTrue("Both AST trees should be identical", infixExpression.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"4\" + 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * NumberLiteral ==> InfixExpression
- */
- public void test0109() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0109", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
- assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setOperator(InfixExpression.Operator.MINUS);
- StringLiteral stringLiteral = this.ast.newStringLiteral();//$NON-NLS-1$
- stringLiteral.setLiteralValue("4"); //$NON-NLS-1$
- infixExpression.setLeftOperand(stringLiteral);
- NumberLiteral literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("5"); //$NON-NLS-1$
- infixExpression.setRightOperand(literal);
-
- InfixExpression infixExpression2 = this.ast.newInfixExpression();
- infixExpression2.setOperator(InfixExpression.Operator.PLUS);
- infixExpression2.setLeftOperand(infixExpression);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("6"); //$NON-NLS-1$
- infixExpression2.setRightOperand(literal);
-
- InfixExpression infixExpression3 = this.ast.newInfixExpression();
- infixExpression3.setOperator(InfixExpression.Operator.PLUS);
- infixExpression3.setLeftOperand(infixExpression2);
- literal = this.ast.newNumberLiteral();//$NON-NLS-1$
- literal.setToken("4"); //$NON-NLS-1$
- infixExpression3.setRightOperand(literal);
-
- assertTrue("Both AST trees should be identical", infixExpression3.subtreeMatch(new ASTMatcher(), expression)); //$NON-NLS-1$
- checkSourceRange(expression, "\"4\" - 5 + 6 + 4", source);//$NON-NLS-1$
- }
-
- /**
- * ReturnStatement ==> ReturnStatement
- */
- public void test0110() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0110", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- assertTrue("Both AST trees should be identical", returnStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "return 2;", source);//$NON-NLS-1$
- }
-
- /**
- * ReturnStatement ==> ReturnStatement
- */
- public void test0111() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0111", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- assertTrue("Both AST trees should be identical", returnStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "return 2\\u003B", source);//$NON-NLS-1$
- }
-
-// /**
-// * SynchronizedStatement ==> SynchronizedStatement
-// */
-// public void test0112() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0112", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// SynchronizedStatement synchronizedStatement = this.ast.newSynchronizedStatement();
-// synchronizedStatement.setExpression(this.ast.newThisExpression());
-// synchronizedStatement.setBody(this.ast.newBlock());
-// assertTrue("Both AST trees should be identical", synchronizedStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// String expectedSource = "synchronized(this) {\n" +//$NON-NLS-1$
-// " }"; //$NON-NLS-1$
-// checkSourceRange(node, expectedSource, source);
-// }
-
- /**
- * TryStatement ==> TryStatement
- * @deprecated using deprecated code
- */
- public void test0113() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0113", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- TryStatement tryStatement = this.ast.newTryStatement();
- tryStatement.setBody(this.ast.newBlock());
- tryStatement.setFinally(this.ast.newBlock());
- CatchClause catchBlock = this.ast.newCatchClause();
- catchBlock.setBody(this.ast.newBlock());
- SingleVariableDeclaration exceptionVariable = this.ast.newSingleVariableDeclaration();
- exceptionVariable.setModifiers(Modifier.NONE);
- exceptionVariable.setName(this.ast.newSimpleName("e"));//$NON-NLS-1$
-// exceptionVariable.setType(this.ast.newSimpleType(this.ast.newSimpleName("Exception")));//$NON-NLS-1$
- catchBlock.setException(exceptionVariable);
- tryStatement.catchClauses().add(catchBlock);
- assertTrue("Both AST trees should be identical", tryStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "try {\n" +//$NON-NLS-1$
- " } catch( e) {\n" +//$NON-NLS-1$
- " } finally {\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * TryStatement ==> TryStatement
- * @deprecated using deprecated code
- */
- public void test0114() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0114", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- TryStatement tryStatement = this.ast.newTryStatement();
- tryStatement.setBody(this.ast.newBlock());
- CatchClause catchBlock = this.ast.newCatchClause();
- catchBlock.setBody(this.ast.newBlock());
- SingleVariableDeclaration exceptionVariable = this.ast.newSingleVariableDeclaration();
- exceptionVariable.setModifiers(Modifier.NONE);
- exceptionVariable.setName(this.ast.newSimpleName("e"));//$NON-NLS-1$
-// exceptionVariable.setType(this.ast.newSimpleType(this.ast.newSimpleName("Exception")));//$NON-NLS-1$
- catchBlock.setException(exceptionVariable);
- tryStatement.catchClauses().add(catchBlock);
- assertTrue("Both AST trees should be identical", tryStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "try {\n" +//$NON-NLS-1$
- " } catch(e) {\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * TryStatement ==> TryStatement
- * @deprecated using deprecated code
- */
- public void test0115() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0115", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- TryStatement tryStatement = this.ast.newTryStatement();
- Block block = this.ast.newBlock();
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- block.statements().add(returnStatement);
- tryStatement.setBody(block);
- CatchClause catchBlock = this.ast.newCatchClause();
- catchBlock.setBody(this.ast.newBlock());
- SingleVariableDeclaration exceptionVariable = this.ast.newSingleVariableDeclaration();
- exceptionVariable.setModifiers(Modifier.NONE);
- exceptionVariable.setName(this.ast.newSimpleName("e"));//$NON-NLS-1$
-// exceptionVariable.setType(this.ast.newSimpleType(this.ast.newSimpleName("Exception")));//$NON-NLS-1$
- catchBlock.setException(exceptionVariable);
- tryStatement.catchClauses().add(catchBlock);
- assertTrue("Both AST trees should be identical", tryStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "try {\n" +//$NON-NLS-1$
- " return 2;\n" +//$NON-NLS-1$
- " } catch(e) {\n" +//$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * ThrowStatement ==> ThrowStatement
- */
- public void test0116() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0116", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ThrowStatement throwStatement = this.ast.newThrowStatement();
- throwStatement.setExpression(this.ast.newSimpleName("e")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", throwStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "throw e \\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * ThrowStatement ==> ThrowStatement
- */
- public void test0117() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0117", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ThrowStatement throwStatement = this.ast.newThrowStatement();
- throwStatement.setExpression(this.ast.newSimpleName("e")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", throwStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "throw e /* comment in the middle of a throw */ \\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * ThrowStatement ==> ThrowStatement
- */
- public void test0118() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0118", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ThrowStatement throwStatement = this.ast.newThrowStatement();
- throwStatement.setExpression(this.ast.newSimpleName("e")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", throwStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "throw e /* comment in the middle of a throw */ \\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0119() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0119", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ifStatement.setThenStatement(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "if (true)\\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0120() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0120", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ifStatement.setThenStatement(this.ast.newEmptyStatement());
- ifStatement.setElseStatement(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "if (true)\\u003B\n" +//$NON-NLS-1$
- "\t\telse ;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0121() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0121", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ifStatement.setThenStatement(this.ast.newBlock());
- ifStatement.setElseStatement(this.ast.newEmptyStatement());
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "if (true) {}\n" +//$NON-NLS-1$
- " else ;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0122() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0122", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- ifStatement.setThenStatement(returnStatement);
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "if (true) return 2\\u003B", source);//$NON-NLS-1$
- }
-
- /**
- * IfStatement ==> IfStatement
- */
- public void test0123() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0123", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- IfStatement ifStatement = this.ast.newIfStatement();
- ifStatement.setExpression(this.ast.newBooleanLiteral(true));
- ReturnStatement returnStatement = this.ast.newReturnStatement();
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("2");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- ifStatement.setThenStatement(returnStatement);
- returnStatement = this.ast.newReturnStatement();
- literal = this.ast.newNumberLiteral();
- literal.setToken("3");//$NON-NLS-1$
- returnStatement.setExpression(literal);
- ifStatement.setElseStatement(returnStatement);
- assertTrue("Both AST trees should be identical", ifStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "if (true) return 2;\n" +//$NON-NLS-1$
- " else return 3;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * Multiple local declaration => VariabledeclarationStatement
- * @deprecated using deprecated code
- */
-// public void test0124() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0124", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("x"));//$NON-NLS-1$
-// NumberLiteral literal = this.ast.newNumberLiteral();
-// literal.setToken("10");//$NON-NLS-1$
-// fragment.setInitializer(literal);
-// fragment.setExtraDimensions(0);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(fragment);
-// fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("z"));//$NON-NLS-1$
-// fragment.setInitializer(this.ast.newNullLiteral());
-// fragment.setExtraDimensions(1);
-// statement.fragments().add(fragment);
-// fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("i"));//$NON-NLS-1$
-// fragment.setExtraDimensions(0);
-// statement.fragments().add(fragment);
-// fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("j"));//$NON-NLS-1$
-// fragment.setExtraDimensions(2);
-// statement.fragments().add(fragment);
-// statement.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-// statement.setModifiers(Modifier.NONE);
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// VariableDeclarationFragment[] fragments = (VariableDeclarationFragment[])((VariableDeclarationStatement) node).fragments().toArray(new VariableDeclarationFragment[4]);
-// assertTrue("fragments.length != 4", fragments.length == 4); //$NON-NLS-1$
-// checkSourceRange(fragments[0], "x= 10", source);//$NON-NLS-1$
-// checkSourceRange(fragments[1], "z[] = null", source);//$NON-NLS-1$
-// checkSourceRange(fragments[2], "i", source);//$NON-NLS-1$
-// checkSourceRange(fragments[3], "j[][]", source);//$NON-NLS-1$
-// checkSourceRange(node, "int x= 10, z[] = null, i, j[][];", source);//$NON-NLS-1$
-// }
-//
-// /**
-// * Multiple local declaration => VariabledeclarationStatement
-// * @deprecated using deprecated code
-// */
-// public void test0125() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0125", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("x"));//$NON-NLS-1$
-// NumberLiteral literal = this.ast.newNumberLiteral();
-// literal.setToken("10");//$NON-NLS-1$
-// fragment.setInitializer(literal);
-// fragment.setExtraDimensions(0);
-// VariableDeclarationStatement statement = this.ast.newVariableDeclarationStatement(fragment);
-// fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("z"));//$NON-NLS-1$
-// fragment.setInitializer(this.ast.newNullLiteral());
-// fragment.setExtraDimensions(1);
-// statement.fragments().add(fragment);
-// fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("i"));//$NON-NLS-1$
-// fragment.setExtraDimensions(0);
-// statement.fragments().add(fragment);
-// fragment = this.ast.newVariableDeclarationFragment();
-// fragment.setName(this.ast.newSimpleName("j"));//$NON-NLS-1$
-// fragment.setExtraDimensions(2);
-// statement.fragments().add(fragment);
-// statement.setType(this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT), 1));
-// statement.setModifiers(Modifier.NONE);
-// assertTrue("Both AST trees should be identical", statement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "int[] x= 10, z[] = null, i, j[][];", source); //$NON-NLS-1$
-// VariableDeclarationFragment[] fragments = (VariableDeclarationFragment[])((VariableDeclarationStatement) node).fragments().toArray(new VariableDeclarationFragment[4]);
-// assertTrue("fragments.length != 4", fragments.length == 4); //$NON-NLS-1$
-// checkSourceRange(fragments[0], "x= 10", source);//$NON-NLS-1$
-// checkSourceRange(fragments[1], "z[] = null", source);//$NON-NLS-1$
-// checkSourceRange(fragments[2], "i", source);//$NON-NLS-1$
-// checkSourceRange(fragments[3], "j[][]", source);//$NON-NLS-1$
-// }
-//
-// /**
-// * ForStatement
-// * @deprecated using deprecated code
-// */
-// public void test0126() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0126", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// ForStatement forStatement = this.ast.newForStatement();
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(this.ast.newNullLiteral());//$NON-NLS-1$
-// variableDeclarationFragment.setExtraDimensions(1);
-// VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
-// variableDeclarationExpression.setModifiers(Modifier.NONE);
-// variableDeclarationExpression.setType(this.ast.newArrayType(this.ast.newSimpleType(this.ast.newSimpleName("String")), 1));//$NON-NLS-1$
-// forStatement.initializers().add(variableDeclarationExpression);
-// PrefixExpression prefixExpression = this.ast.newPrefixExpression();
-// prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
-// prefixExpression.setOperator(PrefixExpression.Operator.INCREMENT);
-// forStatement.updaters().add(prefixExpression);
-// forStatement.setBody(this.ast.newBlock());
-// assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "for (String[] tab[] = null;; ++i) {}", source); //$NON-NLS-1$
-// checkSourceRange((ASTNode) ((ForStatement) node).updaters().get(0), "++i", source); //$NON-NLS-1$
-// checkSourceRange((ASTNode) ((ForStatement) node).initializers().get(0), "String[] tab[] = null", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * ForStatement
-// * @deprecated using deprecated code
-// */
-// public void test0127() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0127", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// ForStatement forStatement = this.ast.newForStatement();
-// VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
-// variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
-// variableDeclarationFragment.setInitializer(this.ast.newNullLiteral());//$NON-NLS-1$
-// variableDeclarationFragment.setExtraDimensions(1);
-// VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
-// variableDeclarationExpression.setModifiers(Modifier.NONE);
-// variableDeclarationExpression.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
-// forStatement.initializers().add(variableDeclarationExpression);
-// PrefixExpression prefixExpression = this.ast.newPrefixExpression();
-// prefixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
-// prefixExpression.setOperator(PrefixExpression.Operator.INCREMENT);
-// forStatement.updaters().add(prefixExpression);
-// forStatement.setBody(this.ast.newBlock());
-// assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
-// checkSourceRange(node, "for (String tab[] = null;; ++i) {}", source); //$NON-NLS-1$
-// checkSourceRange((ASTNode) ((ForStatement) node).updaters().get(0), "++i", source); //$NON-NLS-1$
-// checkSourceRange((ASTNode) ((ForStatement) node).initializers().get(0), "String tab[] = null", source); //$NON-NLS-1$
-// }
-//
- /**
- * ForStatement
- * @deprecated using deprecated code
- */
- public void test0128() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0128", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
- VariableDeclarationFragment variableDeclarationFragment = this.ast.newVariableDeclarationFragment();
- variableDeclarationFragment.setName(this.ast.newSimpleName("tab")); //$NON-NLS-1$
- variableDeclarationFragment.setInitializer(this.ast.newNullLiteral());//$NON-NLS-1$
-// variableDeclarationFragment.setExtraDimensions(1);
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(variableDeclarationFragment);
- variableDeclarationExpression.setModifiers(Modifier.NONE);
-// variableDeclarationExpression.setType(this.ast.newSimpleType(this.ast.newSimpleName("String")));//$NON-NLS-1$
- forStatement.initializers().add(variableDeclarationExpression);
- PostfixExpression postfixExpression = this.ast.newPostfixExpression();
- postfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(postfixExpression);
- forStatement.setBody(this.ast.newBlock());
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (var tab = null;; i++/**/) {}", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).updaters().get(0), "i++", source); //$NON-NLS-1$
- checkSourceRange((ASTNode) ((ForStatement) node).initializers().get(0), "var tab = null", source); //$NON-NLS-1$
- }
-
- /**
- * VariableDeclarationStatement
- * @deprecated using deprecated code
- */
- public void test0129() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0129", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationFragment frag = (VariableDeclarationFragment) ((VariableDeclarationStatement) node).fragments().get(0);
- assertTrue("Not a declaration", frag.getName().isDeclaration()); //$NON-NLS-1$
-
- VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
-
-
- VariableDeclarationStatement var = this.ast.newVariableDeclarationStatement(fragment);
-// fragment.setExtraDimensions(0);
-// VariableDeclarationStatement fieldDeclaration = this.ast.newVariableDeclarationStatement(fragment);
-// fieldDeclaration.setModifiers(Modifier.NONE);
-// fieldDeclaration.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- assertTrue("Both AST trees should be identical", var.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var i;", source); //$NON-NLS-1$
- }
-
- /**
- * VariableDeclarationStatement
- * @deprecated using deprecated code
- */
- public void test0130() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0130", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationFragment fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("x")); //$NON-NLS-1$
- NumberLiteral literal = this.ast.newNumberLiteral();
- literal.setToken("10"); //$NON-NLS-1$
- fragment.setInitializer(literal);
-// fragment.setExtraDimensions(0);
- VariableDeclarationStatement variableDeclaration = this.ast.newVariableDeclarationStatement(fragment);
-// variableDeclaration.setModifiers(Modifier.PUBLIC);
-// fieldDeclaration.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("y"));//$NON-NLS-1$
-// fragment.setExtraDimensions(1);
- fragment.setInitializer(this.ast.newNullLiteral());
- variableDeclaration.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("i"));//$NON-NLS-1$
-// fragment.setExtraDimensions(0);
- variableDeclaration.fragments().add(fragment);
- fragment = this.ast.newVariableDeclarationFragment();
- fragment.setName(this.ast.newSimpleName("j"));//$NON-NLS-1$
-// fragment.setExtraDimensions(2);
- variableDeclaration.fragments().add(fragment);
- assertTrue("Both AST trees should be identical", variableDeclaration.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "var x= 10, y = null, i, j;", source); //$NON-NLS-1$
- VariableDeclarationFragment[] fragments = (VariableDeclarationFragment[])((VariableDeclarationStatement) node).fragments().toArray(new VariableDeclarationFragment[4]);
- assertTrue("fragments.length != 4", fragments.length == 4); //$NON-NLS-1$
- checkSourceRange(fragments[0], "x= 10", source);//$NON-NLS-1$
- checkSourceRange(fragments[1], "y = null", source);//$NON-NLS-1$
- checkSourceRange(fragments[2], "i", source);//$NON-NLS-1$
- checkSourceRange(fragments[3], "j", source);//$NON-NLS-1$
- }
-
-// /**
-// * Argument with final modifier
-// * @deprecated using deprecated code
-// */
-// public void test0131() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0131", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
-// assertTrue("Not a declaration", ((FunctionDeclaration) node).getName().isDeclaration()); //$NON-NLS-1$
-// List parameters = ((FunctionDeclaration) node).parameters();
-// assertTrue("Parameters.length != 1", parameters.size() == 1); //$NON-NLS-1$
-// SingleVariableDeclaration arg = (SingleVariableDeclaration) ((FunctionDeclaration) node).parameters().get(0);
-// SingleVariableDeclaration singleVariableDeclaration = this.ast.newSingleVariableDeclaration();
-// singleVariableDeclaration.setModifiers(Modifier.FINAL);
-// singleVariableDeclaration.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
-// singleVariableDeclaration.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
-// assertTrue("Both AST trees should be identical", singleVariableDeclaration.subtreeMatch(new ASTMatcher(), arg)); //$NON-NLS-1$
-// checkSourceRange(node, "void foo(final int i) {}", source); //$NON-NLS-1$
-// checkSourceRange(arg, "final int i", source); //$NON-NLS-1$
-// }
-
- /**
- * Check javadoc for FunctionDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0132() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0132", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- JSdoc javadoc = this.ast.newJSdoc();
- javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
- assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
- checkSourceRange(node, "/** JavaDoc Comment*/\n function foo(i) {}", source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0133() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0133", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "function foo(i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0134() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0134", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "function foo( i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for VariableDeclarationStatement
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0135() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0135", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- JSdoc actualJavadoc = ((VariableDeclarationStatement) node).getJavadoc();
- JSdoc javadoc = this.ast.newJSdoc();
- javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
- assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
- checkSourceRange(node, "/** JavaDoc Comment*/\n var i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for VariableDeclarationStatement
- */
- public void test0136() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0136", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- JSdoc actualJavadoc = ((VariableDeclarationStatement) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "var i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for VariableDeclarationStatement
- */
- public void test0137() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0137", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- JSdoc actualJavadoc = ((VariableDeclarationStatement) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "var i;", source); //$NON-NLS-1$
- }
-
-// /**
-// * Check javadoc for TypeDeclaration
-// */
-// public void test0138() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0138", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// String expectedContents = "public class Test {\n" +//$NON-NLS-1$
-// " int i;\n" +//$NON-NLS-1$
-// "}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for TypeDeclaration
-// */
-// public void test0139() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0139", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// String expectedContents = "public class Test {\n" +//$NON-NLS-1$
-// " int i;\n" +//$NON-NLS-1$
-// "}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for TypeDeclaration
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0140() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0140", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// "public class Test {\n" +//$NON-NLS-1$
-// " int i;\n" +//$NON-NLS-1$
-// "}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-// }
-
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0141() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0141", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// " class B {}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// */
-// public void test0142() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0142", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// checkSourceRange(node, "class B {}", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// */
-// public void test0143() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0143", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// */
-// public void test0144() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0144", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
-// }
-
-// /**
-// * Checking initializers
-// */
-// public void test0145() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0145", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// checkSourceRange(node, "{}", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Checking initializers
-// */
-// public void test0146() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0146", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// checkSourceRange(node, "static {}", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Checking initializers
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0147() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0147", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((Initializer) node).getJavadoc();
-// assertNotNull("Javadoc comment should no be null", actualJavadoc); //$NON-NLS-1$
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// " static {}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-//
-// }
-//
-// /**
-// * Checking initializers
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0148() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0148", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((Initializer) node).getJavadoc();
-// assertNotNull("Javadoc comment should not be null", actualJavadoc); //$NON-NLS-1$
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// " {}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-//
-// }
-//
-// /**
-// * Checking initializers
-// */
-// public void test0149() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0149", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((Initializer) node).getJavadoc();
-// assertNull("Javadoc comment should be null", actualJavadoc); //$NON-NLS-1$
-// checkSourceRange(node, "{}", source); //$NON-NLS-1$
-// }
-
- /**
- * Checking syntax error
- */
- public void test0150() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0150", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertTrue("The compilation unit is malformed", !isMalformed(unit)); //$NON-NLS-1$
-// assertTrue("The package declaration is not malformed", isMalformed(unit.getPackage())); //$NON-NLS-1$
-// List imports = unit.imports();
-// assertTrue("The imports list size is not one", imports.size() == 1); //$NON-NLS-1$
-// assertTrue("The first import is malformed", !isMalformed((ASTNode) imports.get(0))); //$NON-NLS-1$
- }
-
-// /**
-// * Checking syntax error
-// */
-// public void test0151() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0151", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, false);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
-// }
-
- /**
- * Checking syntax error
- */
- public void test0152() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0152", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The type is malformed", !isMalformed(node)); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The field is not malformed", isMalformed(node)); //$NON-NLS-1$
-// node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The method is not malformed", isMalformed(node)); //$NON-NLS-1$
- }
-
- /**
- * Checking syntax error
- */
- public void test0153() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0153", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The method is not original", isOriginal(node)); //$NON-NLS-1$
- assertTrue("The method is not malformed", isMalformed(node)); //$NON-NLS-1$
- }
-//
-// /**
-// * Checking binding of package declaration
-// */
-// public void test0154() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0154", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// IBinding binding = compilationUnit.getPackage().getName().resolveBinding();
-// assertNotNull("The package binding is null", binding); //$NON-NLS-1$
-// assertTrue("The binding is not a package binding", binding instanceof IPackageBinding); //$NON-NLS-1$
-// IPackageBinding packageBinding = (IPackageBinding) binding;
-// assertEquals("The package name is incorrect", "test0154", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding2 = compilationUnit.getPackage().getName().resolveBinding();
-// assertTrue("The package binding is not canonical", binding == binding2); //$NON-NLS-1$
-// }
-
- /**
- * Checking arguments positions
- */
- public void test0155() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0155", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The result is not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) node;
- List parameters = methodDecl.parameters();
- assertTrue("The parameters size is different from 2", parameters.size() == 2); //$NON-NLS-1$
- Object parameter = parameters.get(0);
- assertTrue("The parameter is not a SingleVariableDeclaration", parameter instanceof SingleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange((ASTNode) parameter, "i", source); //$NON-NLS-1$
- parameter = parameters.get(1);
- assertTrue("The parameter is not a SingleVariableDeclaration", parameter instanceof SingleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange((ASTNode) parameter, "b", source); //$NON-NLS-1$
- }
-
- /**
- * Checking arguments positions
- */
- public void test0156() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0156", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The result is not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDecl = (FunctionDeclaration) node;
- List parameters = methodDecl.parameters();
- assertTrue("The parameters size is different from 1", parameters.size() == 1); //$NON-NLS-1$
- Object parameter = parameters.get(0);
- assertTrue("The parameter is not a SingleVariableDeclaration", parameter instanceof SingleVariableDeclaration); //$NON-NLS-1$
- checkSourceRange((ASTNode) parameter, "i", source); //$NON-NLS-1$
- Block block = methodDecl.getBody();
- List statements = block.statements();
- assertTrue("The statements size is different from 2", statements.size() == 2); //$NON-NLS-1$
- ASTNode statement = (ASTNode) statements.get(0);
- assertTrue("The statements[0] is a postfixExpression statement", statement instanceof ExpressionStatement); //$NON-NLS-1$
- }
-
- /**
- * Check canonic binding for fields
- */
- public void test0157() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test0157.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List statements = compilationUnit.statements();
- assertTrue("The types list is empty", statements.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Type binding is null", typeBinding); //$NON-NLS-1$
-// assertTrue("The type binding is canonical", typeBinding == typeDeclaration.resolveBinding()); //$NON-NLS-1$
-// List bodyDeclarations = typeDeclaration.bodyDeclarations();
-// assertTrue("The body declaration list is empty", bodyDeclarations.size() != 0); //$NON-NLS-1$
- Statement bodyDeclaration = (Statement) statements.get(0);
- assertTrue("This is not a field", bodyDeclaration instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) bodyDeclaration;
- List variableFragments = fieldDeclaration.fragments();
- assertTrue("The fragment list is empty", variableFragments.size() != 0); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableFragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding); //$NON-NLS-1$
- assertTrue("The field binding is not canonical", variableBinding == fragment.resolveBinding()); //$NON-NLS-1$
- ITypeBinding typeBinding = variableBinding.getType();
-// assertTrue("The type is not an array type", typeBinding.isArray()); //$NON-NLS-1$
- assertTrue("The type binding for the field is not canonical", typeBinding == variableBinding.getType()); //$NON-NLS-1$
- SimpleName name = fragment.getName();
- assertTrue("is a declaration", name.isDeclaration()); //$NON-NLS-1$
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong type", IBinding.VARIABLE, binding.getKind()); //$NON-NLS-1$
- assertTrue("is a field", !((IVariableBinding) binding).isField()); //$NON-NLS-1$
- }
-
- /**
- * Check canonic bindings for fields
- */
- public void test0158() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test0158.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List statements = compilationUnit.statements();
- assertTrue("The types list is empty", statements.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Type binding is null", typeBinding); //$NON-NLS-1$
-// assertTrue("The type binding is canonical", typeBinding == typeDeclaration.resolveBinding()); //$NON-NLS-1$
-// SimpleName simpleName = typeDeclaration.getName();
-// assertTrue("is a declaration", simpleName.isDeclaration()); //$NON-NLS-1$
-// IBinding binding = simpleName.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
-// assertEquals("wrong name", simpleName.getIdentifier(), binding.getName()); //$NON-NLS-1$
-// List bodyDeclarations = typeDeclaration.bodyDeclarations();
-// assertTrue("The body declaration list is empty", bodyDeclarations.size() != 0); //$NON-NLS-1$
- Statement bodyDeclaration = (Statement) statements.get(0);
- assertTrue("This is not a field", bodyDeclaration instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) bodyDeclaration;
- List variableFragments = fieldDeclaration.fragments();
- assertTrue("The fragment list is empty", variableFragments.size() != 0); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableFragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding); //$NON-NLS-1$
- assertTrue("The field binding is not canonical", variableBinding == fragment.resolveBinding()); //$NON-NLS-1$
- ITypeBinding typeBinding2 = variableBinding.getType();
-// assertTrue("The type is not an array type", typeBinding2.isArray()); //$NON-NLS-1$
- assertTrue("The type binding for the field is not canonical", typeBinding2 == variableBinding.getType()); //$NON-NLS-1$
-// assertTrue("The type binding for the field is not canonical with the declaration type binding", typeBinding == typeBinding2.getElementType()); //$NON-NLS-1$
- }
-
-// /**
-// * Define an anonymous type
-// */
-// public void test0159() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0159", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// }
-
- /**
- * Check bindings for multiple field declarations
- */
- public void test0160() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0160", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List statements = compilationUnit.statements();
- assertTrue("The statements list is empty", statements.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Type binding is null", typeBinding); //$NON-NLS-1$
-// assertTrue("The type binding is canonical", typeBinding == typeDeclaration.resolveBinding()); //$NON-NLS-1$
-// List bodyDeclarations = typeDeclaration.bodyDeclarations();
-// assertTrue("The body declaration list is empty", bodyDeclarations.size() != 0); //$NON-NLS-1$
- Statement bodyDeclaration = (Statement) statements.get(0);
- assertTrue("This is not a field", bodyDeclaration instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) bodyDeclaration;
- List variableFragments = fieldDeclaration.fragments();
- assertTrue("The fragment list size is not 2", variableFragments.size() == 2); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableFragments.get(0);
- IVariableBinding variableBinding1 = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding1); //$NON-NLS-1$
- assertTrue("The field binding is not canonical", variableBinding1 == fragment.resolveBinding()); //$NON-NLS-1$
- ITypeBinding type1 = variableBinding1.getType();
- assertNotNull("The type is null", type1); //$NON-NLS-1$
- assertTrue("The field type is canonical", type1 == variableBinding1.getType()); //$NON-NLS-1$
-// assertTrue("The type is not an array type",type1.isArray()); //$NON-NLS-1$
-// assertTrue("The type dimension is 1", type1.getDimensions() == 1); //$NON-NLS-1$
- fragment = (VariableDeclarationFragment) variableFragments.get(1);
- IVariableBinding variableBinding2 = fragment.resolveBinding();
- assertNotNull("the field binding is null", variableBinding2); //$NON-NLS-1$
- assertTrue("The field binding is not canonical", variableBinding2 == fragment.resolveBinding()); //$NON-NLS-1$
- ITypeBinding type2 = variableBinding2.getType();
- type2 = variableBinding2.getType();
- assertNotNull("The type is null", type2); //$NON-NLS-1$
- assertTrue("The field type is canonical", type2 == variableBinding2.getType()); //$NON-NLS-1$
-// assertTrue("The type is not an array type",type2.isArray()); //$NON-NLS-1$
-// assertTrue("The type dimension is 2", type2.getDimensions() == 2); //$NON-NLS-1$
-// assertTrue("Element type is canonical", type1.getElementType() == type2.getElementType()); //$NON-NLS-1$
- assertTrue("type1.id < type2.id", variableBinding1.getVariableId() < variableBinding2.getVariableId()); //$NON-NLS-1$
-
- }
-//
-// /**
-// * Check ITypeBinding APIs:
-// * - getModifiers()
-// * - getElementType() when it is not an array type
-// * - getDimensions() when it is not an array type
-// * - getDeclaringClass()
-// * - getDeclaringName()
-// * - getName()
-// * - isNested()
-// * - isAnonymous()
-// * - isLocal()
-// * - isMember()
-// * - isArray()
-// * - getDeclaredMethods() => returns binding for default constructor
-// * - isPrimitive()
-// * - isTopLevel()
-// * - getSuperclass()
-// */
-// public void test0161() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0161", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// List types = compilationUnit.types();
-// assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("The type binding should not be null", typeBinding); //$NON-NLS-1$
-// assertEquals("The modifier is PUBLIC", Modifier.PUBLIC, typeBinding.getModifiers()); //$NON-NLS-1$
-// assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
-// assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
-// assertNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
-// IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
-// assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
-// assertEquals("The name is not Test", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
-// assertTrue("A local class", !typeBinding.isLocal()); //$NON-NLS-1$
-// assertTrue("A nested class", !typeBinding.isNested()); //$NON-NLS-1$
-// assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
-// assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
-// assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
-// assertTrue("An interface", !typeBinding.isInterface()); //$NON-NLS-1$
-// assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
-// assertTrue("Is nested", typeBinding.isTopLevel()); //$NON-NLS-1$
-// assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
-// ITypeBinding superclass = typeBinding.getSuperclass();
-// assertNotNull("No superclass", superclass); //$NON-NLS-1$
-// assertTrue("From source", !superclass.isFromSource()); //$NON-NLS-1$
-// ITypeBinding supersuperclass = superclass.getSuperclass();
-// assertNull("No superclass for java.lang.Object", supersuperclass); //$NON-NLS-1$
-// ITypeBinding[] interfaces = typeBinding.getInterfaces();
-// assertNotNull("No interfaces", interfaces); //$NON-NLS-1$
-// assertEquals("More then one super interface", 1, interfaces.length); //$NON-NLS-1$
-// assertTrue("is not an interface", interfaces[0].isInterface()); //$NON-NLS-1$
-// assertTrue("From source", !interfaces[0].isFromSource()); //$NON-NLS-1$
-// assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check ITypeBinding APIs:
-// * - getModifiers()
-// * - getElementType() when it is not an array type
-// * - getDimensions() when it is not an array type
-// * - getDeclaringClass()
-// * - getDeclaringName()
-// * - getName()
-// * - isNested()
-// * - isAnonymous()
-// * - isLocal()
-// * - isMember()
-// * - isArray()
-// * - getDeclaredMethods() => returns binding for default constructor
-// * - isPrimitive()
-// * - isTopLevel()
-// * - getSuperclass()
-// */
-// public void test0162() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0162", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// List types = compilationUnit.types();
-// assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("The type binding should not be null", typeBinding); //$NON-NLS-1$
-// assertEquals("The modifier is PUBLIC", Modifier.PUBLIC, typeBinding.getModifiers()); //$NON-NLS-1$
-// assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
-// assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
-// assertNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
-// IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
-// assertEquals("Contains no methos", 0, methods.length); //$NON-NLS-1$
-// assertEquals("The name is not Test", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
-// assertTrue("A local class", !typeBinding.isLocal()); //$NON-NLS-1$
-// assertTrue("A nested class", !typeBinding.isNested()); //$NON-NLS-1$
-// assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
-// assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
-// assertTrue("A class", !typeBinding.isClass()); //$NON-NLS-1$
-// assertTrue("Not an interface", typeBinding.isInterface()); //$NON-NLS-1$
-// assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
-// assertTrue("Is nested", typeBinding.isTopLevel()); //$NON-NLS-1$
-// assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
-// ITypeBinding superclass = typeBinding.getSuperclass();
-// assertNull("No superclass", superclass); //$NON-NLS-1$
-// assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
-// }
-//
-// /**
-// * Test binding for anonymous declaration: new java.lang.Object() {}
-// */
-// public void test0163() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0163", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode expression = getASTNodeToCompare((JavaScriptUnit) result);
-// assertNotNull("Expression should not be null", expression); //$NON-NLS-1$
-// assertTrue("Not an anonymous type declaration", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
-// ClassInstanceCreation anonymousClass = (ClassInstanceCreation) expression;
-// ITypeBinding typeBinding = anonymousClass.resolveTypeBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertTrue("Not an anonymous class", typeBinding.isAnonymous()); //$NON-NLS-1$
-// assertEquals("The modifier is not default", Modifier.NONE, typeBinding.getModifiers()); //$NON-NLS-1$
-// assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
-// assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
-// assertNotNull("This is a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
-// assertEquals("The name is not empty", "", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
-// assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
-// assertTrue("Not a local class", typeBinding.isLocal()); //$NON-NLS-1$
-// assertTrue("Not a nested class", typeBinding.isNested()); //$NON-NLS-1$
-// assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
-// assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
-// assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
-// assertTrue("An interface", !typeBinding.isInterface()); //$NON-NLS-1$
-// assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
-// assertTrue("Is a top level", !typeBinding.isTopLevel()); //$NON-NLS-1$
-// assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
-// assertEquals("wrong qualified name", "", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
-// ITypeBinding superclass = typeBinding.getSuperclass();
-// assertNotNull("No superclass", superclass); //$NON-NLS-1$
-// assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
-// }
-//
-// /**
-// * Test binding for member type declaration
-// */
-// public void test0164() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0164", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("Not an type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) node;
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
-// assertEquals("The modifier is not default", Modifier.PRIVATE, typeBinding.getModifiers()); //$NON-NLS-1$
-// assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
-// assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
-// assertNotNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
-// assertEquals("The name is not 'B'", "B", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
-// assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
-// assertTrue("A local class", !typeBinding.isLocal()); //$NON-NLS-1$
-// assertTrue("Not a nested class", typeBinding.isNested()); //$NON-NLS-1$
-// assertTrue("Not a member class", typeBinding.isMember()); //$NON-NLS-1$
-// assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
-// assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
-// assertTrue("An interface", !typeBinding.isInterface()); //$NON-NLS-1$
-// assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
-// assertTrue("Is a top level", !typeBinding.isTopLevel()); //$NON-NLS-1$
-// assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
-// ITypeBinding superclass = typeBinding.getSuperclass();
-// assertNotNull("No superclass", superclass); //$NON-NLS-1$
-// assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
-// }
-//
-// /**
-// * Test binding for local type declaration
-// * @deprecated using deprecated code
-// */
-// public void test0165() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0165", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("Not an type declaration", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
-// TypeDeclarationStatement statement = (TypeDeclarationStatement) node;
-// TypeDeclaration typeDeclaration = statement.getTypeDeclaration();
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertTrue("An anonymous class", !typeBinding.isAnonymous()); //$NON-NLS-1$
-// assertEquals("The modifier is not default", Modifier.NONE, typeBinding.getModifiers()); //$NON-NLS-1$
-// assertNull("There is no element type", typeBinding.getElementType()); //$NON-NLS-1$
-// assertEquals("There is no dimension", 0, typeBinding.getDimensions()); //$NON-NLS-1$
-// assertNotNull("This is not a member type", typeBinding.getDeclaringClass()); //$NON-NLS-1$
-// assertEquals("The name is not 'C'", "C", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IFunctionBinding[] methods = typeBinding.getDeclaredMethods();
-// assertEquals("Contains the default constructor", 1, methods.length); //$NON-NLS-1$
-// assertTrue("Not a local class", typeBinding.isLocal()); //$NON-NLS-1$
-// assertTrue("Not a nested class", typeBinding.isNested()); //$NON-NLS-1$
-// assertTrue("A member class", !typeBinding.isMember()); //$NON-NLS-1$
-// assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
-// assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
-// assertTrue("An interface", !typeBinding.isInterface()); //$NON-NLS-1$
-// assertTrue("Not from source", typeBinding.isFromSource()); //$NON-NLS-1$
-// assertTrue("Is a top level", !typeBinding.isTopLevel()); //$NON-NLS-1$
-// assertTrue("A primitive type", !typeBinding.isPrimitive()); //$NON-NLS-1$
-// assertEquals("wrong qualified name", "", typeBinding.getQualifiedName()); //$NON-NLS-1$ //$NON-NLS-2$
-// ITypeBinding superclass = typeBinding.getSuperclass();
-// assertNotNull("No superclass", superclass); //$NON-NLS-1$
-// assertEquals("Has fields", 0, typeBinding.getDeclaredFields().length); //$NON-NLS-1$
-// }
-
- /**
- * Multiple local declaration => VariabledeclarationStatement
- */
- public void test0166() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0166", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("Fragment list is not 4 ", fragments.size() == 4); //$NON-NLS-1$
- VariableDeclarationFragment fragment1 = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding binding1 = fragment1.resolveBinding();
- assertNotNull("Binding is null", binding1); //$NON-NLS-1$
- assertEquals("wrong name for binding1", "x", binding1.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding1", 0, binding1.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding1.isField()); //$NON-NLS-1$
-// assertNull("declaring class is not null", binding1.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding1 = binding1.getType();
- assertNotNull("typeBinding1 is null", typeBinding1); //$NON-NLS-1$
-// assertTrue("typeBinding1 is not a primitive type", typeBinding1.isPrimitive()); //$NON-NLS-1$
-// assertTrue("typeBinding1 is not canonical", typeBinding1 == binding1.getType()); //$NON-NLS-1$
- VariableDeclarationFragment fragment2 = (VariableDeclarationFragment) fragments.get(1);
- IVariableBinding binding2 = fragment2.resolveBinding();
- assertNotNull("Binding is null", binding2); //$NON-NLS-1$
- assertEquals("wrong name for binding2", "z", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding2", 0, binding2.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding2.isField()); //$NON-NLS-1$
-// assertNull("declaring class is not null", binding2.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding2 = binding2.getType();
- assertNotNull("typeBinding2 is null", typeBinding2); //$NON-NLS-1$
-// assertTrue("typeBinding2 is not an array type", typeBinding2.isArray()); //$NON-NLS-1$
-// assertTrue("typeBinding2 is not canonical", typeBinding2 == binding2.getType()); //$NON-NLS-1$
-// assertTrue("primitive type is not canonical", typeBinding1 == typeBinding2.getElementType()); //$NON-NLS-1$
-// assertEquals("dimension is 1", 1, typeBinding2.getDimensions()); //$NON-NLS-1$
-// assertEquals("it is not int[]", "int[]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- VariableDeclarationFragment fragment3 = (VariableDeclarationFragment) fragments.get(2);
- IVariableBinding binding3 = fragment3.resolveBinding();
- assertNotNull("Binding is null", binding3); //$NON-NLS-1$
- assertEquals("wrong name for binding3", "i", binding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding3", 0, binding3.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding3.isField()); //$NON-NLS-1$
-// assertNull("declaring class is not null", binding3.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding3 = binding3.getType();
- assertNotNull("typeBinding3 is null", typeBinding3); //$NON-NLS-1$
-// assertTrue("typeBinding3 is not an primitive type", typeBinding3.isPrimitive()); //$NON-NLS-1$
-// assertTrue("typeBinding3 is not canonical", typeBinding3 == binding3.getType()); //$NON-NLS-1$
-// assertTrue("primitive type is not canonical", typeBinding1 == typeBinding3); //$NON-NLS-1$
- assertEquals("dimension is 0", 0, typeBinding3.getDimensions()); //$NON-NLS-1$
- assertEquals("it is not the primitive type any", "any", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- VariableDeclarationFragment fragment4 = (VariableDeclarationFragment) fragments.get(3);
- IVariableBinding binding4 = fragment4.resolveBinding();
- assertNotNull("Binding is null", binding4); //$NON-NLS-1$
- assertEquals("wrong name for binding4", "j", binding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier for binding4", 0, binding4.getModifiers()); //$NON-NLS-1$
- assertTrue("a field", !binding4.isField()); //$NON-NLS-1$
- assertNull("declaring class is not null", binding4.getDeclaringClass()); //$NON-NLS-1$
- ITypeBinding typeBinding4 = binding4.getType();
- assertNotNull("typeBinding4 is null", typeBinding4); //$NON-NLS-1$
-// assertTrue("typeBinding4 is not an array type", typeBinding4.isArray()); //$NON-NLS-1$
-// assertTrue("typeBinding4 is not canonical", typeBinding4 == binding4.getType()); //$NON-NLS-1$
-// assertTrue("primitive type is not canonical", typeBinding1 == typeBinding4.getElementType()); //$NON-NLS-1$
-// assertEquals("dimension is 2", 2, typeBinding4.getDimensions()); //$NON-NLS-1$
-// assertEquals("it is not int[][]", "int[][]", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("ids in the wrong order", binding1.getVariableId() < binding2.getVariableId()); //$NON-NLS-1$
- assertTrue("ids in the wrong order", binding2.getVariableId() < binding3.getVariableId()); //$NON-NLS-1$
- assertTrue("ids in the wrong order", binding3.getVariableId() < binding4.getVariableId()); //$NON-NLS-1$
- }
-//
-// /**
-// * Check source position for new Test[1+2].length.
-// */
-// public void test0167() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0167", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("Instance of VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// List fragments = variableDeclarationStatement.fragments();
-// assertTrue("fragment list size is not 1", fragments.size() == 1); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression initialization = fragment.getInitializer();
-// assertNotNull("No initialization", initialization); //$NON-NLS-1$
-// assertTrue("Not a FieldAccess", initialization instanceof FieldAccess); //$NON-NLS-1$
-// checkSourceRange(initialization, "new Test[1+2].length", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check package binding: test0168.test
-// */
-// public void test0168() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0168.test1", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// List types = compilationUnit.types();
-// assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
-// IPackageBinding packageBinding = typeBinding.getPackage();
-// assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
-// assertEquals("wrong name", "test0168.test1", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// String[] components = packageBinding.getNameComponents();
-// assertNotNull("no components", components); //$NON-NLS-1$
-// assertTrue("components size != 2", components.length == 2); //$NON-NLS-1$
-// assertEquals("wrong component name", "test0168", components[0]); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("wrong component name", "test1", components[1]); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
-// assertTrue("Unnamed package", !packageBinding.isUnnamed()); //$NON-NLS-1$
-// assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
-// }
-
-// /**
-// * Check package binding: test0169
-// */
-// public void test0169() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0169", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// List types = compilationUnit.types();
-// assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
-// IPackageBinding packageBinding = typeBinding.getPackage();
-// assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
-// assertEquals("wrong name", "test0169", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// String[] components = packageBinding.getNameComponents();
-// assertNotNull("no components", components); //$NON-NLS-1$
-// assertTrue("components size != 1", components.length == 1); //$NON-NLS-1$
-// assertEquals("wrong component name", "test0169", components[0]); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
-// assertTrue("Unnamed package", !packageBinding.isUnnamed()); //$NON-NLS-1$
-// assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
-// }
-
-// /**
-// * Check package binding: test0170
-// */
-// public void test0170() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test0170.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// List types = compilationUnit.types();
-// assertTrue("The types list is empty", types.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
-// IPackageBinding packageBinding = typeBinding.getPackage();
-// assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
-// assertEquals("wrong name", "", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// String[] components = packageBinding.getNameComponents();
-// assertNotNull("no components", components); //$NON-NLS-1$
-// assertTrue("components size != 0", components.length == 0); //$NON-NLS-1$
-// assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
-// assertTrue("Not an unnamed package", packageBinding.isUnnamed()); //$NON-NLS-1$
-// assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check package binding: test0171
-// */
-// public void test0171() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0171", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// List types = compilationUnit.types();
-// assertTrue("The types list is empty", types.size() == 2); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
-// IPackageBinding packageBinding = typeBinding.getPackage();
-// assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
-// assertEquals("wrong name", "test0171", packageBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// String[] components = packageBinding.getNameComponents();
-// assertNotNull("no components", components); //$NON-NLS-1$
-// assertTrue("components size != 1", components.length == 1); //$NON-NLS-1$
-// assertEquals("wrong component name", "test0171", components[0]); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("wrong type", IBinding.PACKAGE, packageBinding.getKind()); //$NON-NLS-1$
-// assertTrue("Unnamed package", !packageBinding.isUnnamed()); //$NON-NLS-1$
-// assertTrue("Package binding is not canonical", packageBinding == typeBinding.getPackage()); //$NON-NLS-1$
-//
-// typeDeclaration = (TypeDeclaration) types.get(1);
-// typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
-// IPackageBinding packageBinding2 = typeBinding.getPackage();
-// assertNotNull("No package binding", packageBinding); //$NON-NLS-1$
-// assertTrue("Package binding is not canonical", packageBinding == packageBinding2); //$NON-NLS-1$
-// }
-
- /**
- * Check method binding
- */
- public void test0172() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0172", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("Expression should not be null", result); //$NON-NLS-1$
- assertTrue("The result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- List statements = compilationUnit.statements();
- assertTrue("The statements list is empty", statements.size() != 0); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) statements.get(0);
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("Binding not null", typeBinding); //$NON-NLS-1$
-// IFunctionBinding[] methods = null;// typeBinding.getDeclaredMethods();
-// assertNotNull("No methods", methods);
-// assertEquals("methods.length != 4", 4, methods.length); //$NON-NLS-1$
-// List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("statements size != 3", 3, statements.size()); //$NON-NLS-1$
- FunctionDeclaration method1 = (FunctionDeclaration) statements.get(0);
- IFunctionBinding methodBinding1 = method1.resolveBinding();
- assertNotNull("No method binding for foo", methodBinding1); //$NON-NLS-1$
- SimpleName simpleName = method1.getName();
- assertTrue("not a declaration", simpleName.isDeclaration()); //$NON-NLS-1$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", binding.getName(), simpleName.getIdentifier()); //$NON-NLS-1$
- // search method foo
-// IFunctionBinding methodBinding = null;
-// loop: for (int i = 0, max = methods.length; i < max; i++) {
-// IFunctionBinding currentMethod = methods[i];
-// if ("foo".equals(currentMethod.getName())) {
-// methodBinding = currentMethod;
-// break loop;
-// }
-// }
-// assertNotNull("Cannot be null", methodBinding);
-// assertTrue("Canonical method binding", methodBinding1 == methodBinding); //$NON-NLS-1$
-// assertTrue("declaring class is canonical", typeBinding == methodBinding1.getDeclaringClass()); //$NON-NLS-1$
-// ITypeBinding[] exceptionTypes = methodBinding1.getExceptionTypes();
-// assertNotNull("No exception types", exceptionTypes); //$NON-NLS-1$
-// assertEquals("One exception", 1, exceptionTypes.length); //$NON-NLS-1$
-// assertEquals("wrong name for exception", "IOException", exceptionTypes[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong modifier", Modifier.PUBLIC, methodBinding1.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name for method", "foo", methodBinding1.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding[] parameters = methodBinding1.getParameterTypes();
- assertNotNull("No parameters", parameters); //$NON-NLS-1$
- assertEquals("wrong size", 1, parameters.length); //$NON-NLS-1$
-// assertEquals("wrong type", "int[]", parameters[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong return type", "void", methodBinding1.getReturnType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("A constructor", !methodBinding1.isConstructor()); //$NON-NLS-1$
-
- FunctionDeclaration method2 = (FunctionDeclaration) statements.get(1);
- IFunctionBinding methodBinding2 = method2.resolveBinding();
- assertNotNull("No method binding for main", methodBinding2); //$NON-NLS-1$
-// methodBinding = null;
-// loop: for (int i = 0, max = methods.length; i < max; i++) {
-// IFunctionBinding currentMethod = methods[i];
-// if ("main".equals(currentMethod.getName())) {
-// methodBinding = currentMethod;
-// break loop;
-// }
-// }
-// assertNotNull("Cannot be null", methodBinding);
-// assertTrue("Canonical method binding", methodBinding2 == methodBinding); //$NON-NLS-1$
-// assertTrue("declaring class is canonical", typeBinding == methodBinding2.getDeclaringClass()); //$NON-NLS-1$
-// ITypeBinding[] exceptionTypes2 = methodBinding2.getExceptionTypes();
-// assertNotNull("No exception types", exceptionTypes2); //$NON-NLS-1$
-// assertEquals("No exception", 0, exceptionTypes2.length); //$NON-NLS-1$
-// assertEquals("wrong modifier", Modifier.PUBLIC | Modifier.STATIC, methodBinding2.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name for method", "main", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding[] parameters2 = methodBinding2.getParameterTypes();
- assertNotNull("No parameters", parameters2); //$NON-NLS-1$
- assertEquals("wrong size", 1, parameters2.length); //$NON-NLS-1$
-// assertEquals("wrong type for parameter2[0]", "String[]", parameters2[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong return type", "void", methodBinding2.getReturnType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("A constructor", !methodBinding2.isConstructor()); //$NON-NLS-1$
-
- FunctionDeclaration method3 = (FunctionDeclaration) statements.get(2);
- IFunctionBinding methodBinding3 = method3.resolveBinding();
- assertNotNull("No method binding for main", methodBinding3); //$NON-NLS-1$
-// methodBinding = null;
-// loop: for (int i = 0, max = methods.length; i < max; i++) {
-// IFunctionBinding currentMethod = methods[i];
-// if ("bar".equals(currentMethod.getName())) {
-// methodBinding = currentMethod;
-// break loop;
-// }
-// }
-// assertNotNull("Cannot be null", methodBinding);
-// assertTrue("Canonical method binding", methodBinding3 == methodBinding); //$NON-NLS-1$
-// assertTrue("declaring class is canonical", typeBinding == methodBinding3.getDeclaringClass()); //$NON-NLS-1$
-// ITypeBinding[] exceptionTypes3 = methodBinding3.getExceptionTypes();
-// assertNotNull("No exception types", exceptionTypes3); //$NON-NLS-1$
-// assertEquals("No exception", 1, exceptionTypes3.length); //$NON-NLS-1$
-// assertEquals("wrong modifier", Modifier.PRIVATE, methodBinding3.getModifiers()); //$NON-NLS-1$
- assertEquals("wrong name for method", "bar", methodBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding[] parameters3 = methodBinding3.getParameterTypes();
- assertNotNull("No parameters", parameters3); //$NON-NLS-1$
- assertEquals("wrong size", 1, parameters3.length); //$NON-NLS-1$
- assertEquals("wrong type", "any", parameters3[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong return type", "any", methodBinding3.getReturnType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("A constructor", !methodBinding3.isConstructor()); //$NON-NLS-1$
- assertTrue("The binding is not canonical", parameters3[0] == methodBinding3.getReturnType()); //$NON-NLS-1$
- }
-
- /**
- * i++; IVariableBinding
- */
- public void test0173() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0173", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an expressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Not a postfixexpression", ex instanceof PostfixExpression); //$NON-NLS-1$
- PostfixExpression postfixExpression = (PostfixExpression) ex;
- Expression expr = postfixExpression.getOperand();
- assertTrue("Not a simpleName", expr instanceof SimpleName); //$NON-NLS-1$
- SimpleName name = (SimpleName) expr;
- assertTrue("a declaration", !name.isDeclaration()); //$NON-NLS-1$
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
-
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertTrue(variableBinding == binding);
- }
-
- /**
- * i++; IVariableBinding (field)
- */
- public void test0174() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0174", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an expressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Not a postfixexpression", ex instanceof PostfixExpression); //$NON-NLS-1$
- PostfixExpression postfixExpression = (PostfixExpression) ex;
- Expression expr = postfixExpression.getOperand();
- assertTrue("Not a simpleName", expr instanceof SimpleName); //$NON-NLS-1$
- SimpleName name = (SimpleName) expr;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
-
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node2;
- List fragments = fieldDeclaration.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertTrue(variableBinding == binding);
- }
-
- /**
- * int i = 0; Test IntBinding for the field declaration and the 0 literal
- */
- public void test0175() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0175", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node2;
- List fragments = fieldDeclaration.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- ITypeBinding typeBinding = fragment.getInitializer().resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not Number", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * i++; IVariableBinding
- */
- public void test0177() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0177", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 1, 1);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("Not an expressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Not a postfixexpression", ex instanceof PostfixExpression); //$NON-NLS-1$
- PostfixExpression postfixExpression = (PostfixExpression) ex;
- Expression expr = postfixExpression.getOperand();
- assertTrue("Not a simpleName", expr instanceof SimpleName); //$NON-NLS-1$
- SimpleName name = (SimpleName) expr;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
-
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertEquals("return type is not Number", "Number", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(variableBinding == binding);
- }
-//
-// /**
-// * SuperReference
-// */
-// public void test0178() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0178", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 1, 0, 0);
-// assertTrue("Return statement", node2 instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) node2;
-// Expression expr = returnStatement.getExpression();
-// assertTrue("Not a field access", expr instanceof SuperFieldAccess); //$NON-NLS-1$
-// SuperFieldAccess fieldAccess = (SuperFieldAccess) expr;
-// ITypeBinding typeBinding = fieldAccess.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertTrue("Not a primitive type", typeBinding.isPrimitive()); //$NON-NLS-1$
-// assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * Allocation expression
- */
- public void test0179() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0179", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- }
-
-// /**
-// * Allocation expression
-// */
-// public void test0180() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0180", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
-// List fragments = variableDeclarationStatement.fragments();
-// assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-// IVariableBinding variableBinding = fragment.resolveBinding();
-// Expression initialization = fragment.getInitializer();
-// assertTrue("No an array creation", initialization instanceof ArrayCreation); //$NON-NLS-1$
-// ITypeBinding typeBinding = initialization.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertTrue("Not an array", typeBinding.isArray()); //$NON-NLS-1$
-// assertTrue(variableBinding.getType() == typeBinding);
-// }
-//
-// /**
-// * Allocation expression
-// */
-// public void test0181() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0181", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
-// List fragments = variableDeclarationStatement.fragments();
-// assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-// IVariableBinding variableBinding = fragment.resolveBinding();
-// Expression initialization = fragment.getInitializer();
-// ITypeBinding typeBinding = initialization.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertTrue("Not an array", typeBinding.isArray()); //$NON-NLS-1$
-// assertTrue(variableBinding.getType() == typeBinding);
-// }
-
- /**
- * BinaryExpression
- */
- public void test0182() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0182", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0183() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0183", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10 && i < 20", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0184() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0184", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10 || i < 20", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0185() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0185", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i == 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0186() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0186", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node2;
- Expression expr = ifStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "o == o", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0187() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0187", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("IfStatement", node2 instanceof WhileStatement); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node2;
- Expression expr = whileStatement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i <= 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0188() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0188", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 2);
- assertTrue("DoStatement", node2 instanceof DoStatement); //$NON-NLS-1$
- DoStatement statement = (DoStatement) node2;
- Expression expr = statement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i <= 10", source); //$NON-NLS-1$
- }
-
- /**
- * BinaryExpression
- */
- public void test0189() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0189", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("ForStatement", node2 instanceof ForStatement); //$NON-NLS-1$
- ForStatement statement = (ForStatement) node2;
- Expression expr = statement.getExpression();
- assertNotNull("No condition", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "i < 10", source); //$NON-NLS-1$
- }
-//
-// /**
-// * BinaryExpression
-// */
-// public void test0190() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0190", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 2, 1);
-// assertTrue("IfStatement", node2 instanceof IfStatement); //$NON-NLS-1$
-// IfStatement statement = (IfStatement) node2;
-// Expression expr = statement.getExpression();
-// assertNotNull("No condition", expr); //$NON-NLS-1$
-// ITypeBinding typeBinding = expr.resolveTypeBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(expr, "scanner.x < selection.start && selection.start < scanner.y", source); //$NON-NLS-1$
-// }
-
- /**
- * BinaryExpression
- */
- public void test0191() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0191", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression ex = expressionStatement.getExpression();
- assertTrue("Assignment", ex instanceof Assignment); //$NON-NLS-1$
- Assignment statement = (Assignment) ex;
- Expression rightExpr = statement.getRightHandSide();
- assertTrue("Not an infix expression", rightExpr instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) rightExpr;
- Expression expr = infixExpression.getRightOperand();
- assertNotNull("No right hand side expression", expr); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not a boolean", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(expr, "2 < 20", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0192() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0192", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- Expression initialization = fragment.getInitializer();
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertTrue(variableBinding.getType() == typeBinding);
- checkSourceRange(initialization, "0", source); //$NON-NLS-1$
- }
-
-// /**
-// * Initializer
-// */
-// public void test0193() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0193", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
-// assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
-// List fragments = variableDeclarationStatement.fragments();
-// assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-// IVariableBinding variableBinding = fragment.resolveBinding();
-// Expression initialization = fragment.getInitializer();
-// ITypeBinding typeBinding = initialization.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertTrue(variableBinding.getType() == typeBinding);
-// checkSourceRange(initialization, "new Inner()", source); //$NON-NLS-1$
-// assertEquals("Wrong type", "Inner", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * Initializer
-// */
-// public void test0194() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0194", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
-// assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
-// List fragments = variableDeclarationStatement.fragments();
-// assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-// IVariableBinding variableBinding = fragment.resolveBinding();
-// Expression initialization = fragment.getInitializer();
-// ITypeBinding typeBinding = initialization.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertTrue(variableBinding.getType() == typeBinding);
-// checkSourceRange(initialization, "new Inner[10]", source); //$NON-NLS-1$
-// assertTrue("Not an array", typeBinding.isArray()); //$NON-NLS-1$
-// assertEquals("Wrong type", "Inner[]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
-// /**
-// * Initializer
-// */
-// public void test0195() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0195", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 1, 0, 1);
-// assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node2;
-// Expression ex = expressionStatement.getExpression();
-// assertTrue("FunctionInvocation", ex instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) ex;
-// checkSourceRange(methodInvocation, "a.useFile(/*]*/a.getFile()/*[*/)", source); //$NON-NLS-1$
-// List list = methodInvocation.arguments();
-// assertTrue("Parameter list not empty", list.size() == 1); //$NON-NLS-1$
-// Expression parameter = (Expression) list.get(0);
-// assertTrue("Not a method invocation", parameter instanceof FunctionInvocation); //$NON-NLS-1$
-// ITypeBinding typeBinding = parameter.resolveTypeBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Not a boolean", "File", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(parameter, "a.getFile()", source); //$NON-NLS-1$
-// }
-
-// /**
-// * Initializer
-// */
-// public void test0196() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0196", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 2);
-// assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node2;
-// Expression ex = expressionStatement.getExpression();
-// assertTrue("Assignment", ex instanceof Assignment); //$NON-NLS-1$
-// Assignment statement = (Assignment) ex;
-// Expression rightExpr = statement.getRightHandSide();
-// assertTrue("Not an instanceof expression", rightExpr instanceof InstanceofExpression); //$NON-NLS-1$
-// ITypeBinding typeBinding = rightExpr.resolveTypeBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertEquals("wrong type", "boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(rightExpr, "inner instanceof Inner", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Initializer
-// */
-// public void test0197() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0197", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
-// JavaScriptUnit unit = (JavaScriptUnit) result;
-// assertProblemsSize(unit, 0);
-// ASTNode node2 = getASTNode(unit, 1, 0, 1);
-// assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node2;
-// Expression ex = expressionStatement.getExpression();
-// assertTrue("FunctionInvocation", ex instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) ex;
-// checkSourceRange(methodInvocation, "a.getFile()/*[*/.getName()", source); //$NON-NLS-1$
-// Expression receiver = methodInvocation.getExpression();
-// assertTrue("Not a method invocation", receiver instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation2 = (FunctionInvocation) receiver;
-// ITypeBinding typeBinding = methodInvocation2.resolveTypeBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "File", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(methodInvocation2, "a.getFile()", source); //$NON-NLS-1$
-// }
-
- /**
- * Initializer
- */
- public void test0198() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0198", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node2;
- Expression expr = returnStatement.getExpression();
- assertTrue("Not an infixExpression", expr instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expr;
- Expression left = infixExpression.getLeftOperand();
- assertTrue("Not an InfixExpression", left instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression2 = (InfixExpression) left;
- Expression right = infixExpression2.getRightOperand();
- assertTrue("Not an InfixExpression", right instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression3 = (InfixExpression) right;
- assertEquals("A multiplication", InfixExpression.Operator.TIMES, infixExpression3.getOperator()); //$NON-NLS-1$
- ITypeBinding typeBinding = infixExpression3.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not Number", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(infixExpression3, "20 * 30", source); //$NON-NLS-1$
- }
-
- /**
- * Initializer
- */
- public void test0199() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0199", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
- List fragments = variableDeclarationStatement.fragments();
- assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not an infixExpression", initialization instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) initialization;
- Expression left = infixExpression.getLeftOperand();
- assertTrue("Not an InfixExpression", left instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression2 = (InfixExpression) left;
- Expression right = infixExpression2.getRightOperand();
- assertTrue("Not an InfixExpression", right instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression3 = (InfixExpression) right;
- assertEquals("A multiplication", InfixExpression.Operator.TIMES, infixExpression3.getOperator()); //$NON-NLS-1$
- ITypeBinding typeBinding = infixExpression3.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not Number", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(infixExpression3, "10 * 30", source); //$NON-NLS-1$
- }
-//
-// /**
-// * Initializer
-// */
-// public void test0200() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0200", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 1, 0, 0);
-// assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
-// List fragments = variableDeclarationStatement.fragments();
-// assertTrue("No fragment", fragments.size() == 1); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression initialization = fragment.getInitializer();
-// assertTrue("Not an infixExpression", initialization instanceof FieldAccess); //$NON-NLS-1$
-// FieldAccess fieldAccess = (FieldAccess) initialization;
-// Expression receiver = fieldAccess.getExpression();
-// assertTrue("ArrayCreation", receiver instanceof ArrayCreation); //$NON-NLS-1$
-// ArrayCreation arrayCreation = (ArrayCreation) receiver;
-// List dimensions = arrayCreation.dimensions();
-// assertEquals("Wrong dimension", 1, dimensions.size()); //$NON-NLS-1$
-// Expression dim = (Expression) dimensions.get(0);
-// assertTrue("InfixExpression", dim instanceof InfixExpression); //$NON-NLS-1$
-// InfixExpression infixExpression = (InfixExpression) dim;
-// ITypeBinding typeBinding = infixExpression.resolveTypeBinding();
-// assertNotNull("No binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(infixExpression, "1 + 2", source); //$NON-NLS-1$
-// }
-
- /**
- * Position inside for statement: PR 3300
- */
- public void test0201() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0201", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("ForStatement", node2 instanceof ForStatement); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node2;
- List initializers = forStatement.initializers();
- assertTrue("wrong size", initializers.size() == 1); //$NON-NLS-1$
- Expression init = (Expression) initializers.get(0);
- checkSourceRange(init, "var i= 0", source); //$NON-NLS-1$
- }
-
- /**
- * PR 7386
- */
- public void test0202() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0202", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node2;
- checkSourceRange(fieldDeclaration, "var f= (2);", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not a parenthesized expression", initialization instanceof ParenthesizedExpression); //$NON-NLS-1$
- checkSourceRange(initialization, "(2)", source); //$NON-NLS-1$
- ITypeBinding typeBinding = initialization.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not Number", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * PR 7386
- */
- public void test0203() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0203", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node2;
- checkSourceRange(fieldDeclaration, "var f= (2);", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not a parenthesized expression", initialization instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) initialization;
- checkSourceRange(parenthesizedExpression, "(2)", source); //$NON-NLS-1$
- Expression expr = parenthesizedExpression.getExpression();
- checkSourceRange(expr, "2", source); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not Number", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("type binding is canonical", typeBinding == parenthesizedExpression.resolveTypeBinding()); //$NON-NLS-1$
- }
-
- /**
- * PR 7386
- */
- public void test0204() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0204", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node2;
- checkSourceRange(fieldDeclaration, "var f= ((2));", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initialization = fragment.getInitializer();
- assertTrue("Not a parenthesized expression", initialization instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) initialization;
- checkSourceRange(parenthesizedExpression, "((2))", source); //$NON-NLS-1$
- Expression expr = parenthesizedExpression.getExpression();
- assertTrue("Not a parenthesized expression", expr instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression2 = (ParenthesizedExpression) expr;
- checkSourceRange(parenthesizedExpression2, "(2)", source); //$NON-NLS-1$
- expr = parenthesizedExpression2.getExpression();
- checkSourceRange(expr, "2", source); //$NON-NLS-1$
- ITypeBinding typeBinding = expr.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not Number", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = parenthesizedExpression.resolveTypeBinding();
- assertNotNull("no binding", typeBinding); //$NON-NLS-1$
- assertEquals("not Number", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("type binding is canonical", typeBinding == parenthesizedExpression2.resolveTypeBinding()); //$NON-NLS-1$
- }
-
-
-// /**
-// * Local class end position when trailing comment
-// * @deprecated using deprecated code
-// */
-// public void test0205() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0205", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("TypeDeclarationStatement", node2 instanceof TypeDeclarationStatement); //$NON-NLS-1$
-// TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node2;
-// TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
-// assertEquals("wrong name", "AA", typeDeclaration.getName().getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(typeDeclaration, "class AA extends Test {}", source); //$NON-NLS-1$
-// }
-
-// /**
-// * QualifiedName
-// */
-// public void test0206() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0206", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 5, 0);
-// assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) node2;
-// Expression expr = returnStatement.getExpression();
-// assertTrue("Not a qualifiedName", expr instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) expr;
-// ITypeBinding typeBinding = expr.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Not an int (typeBinding)", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(qualifiedName, "field1.field2.field3.field4.i", source); //$NON-NLS-1$
-// assertTrue("Not a simple name", qualifiedName.getName().isSimpleName()); //$NON-NLS-1$
-// SimpleName simpleName = qualifiedName.getName();
-// assertTrue("a declaration", !simpleName.isDeclaration()); //$NON-NLS-1$
-// checkSourceRange(simpleName, "i", source); //$NON-NLS-1$
-// ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
-// assertNotNull("No typebinding2", typeBinding2); //$NON-NLS-1$
-// assertEquals("Not an int (typeBinding2)", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding = simpleName.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding;
-// assertEquals("Not Test", "Test", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not default", Modifier.PUBLIC, variableBinding.getModifiers()); //$NON-NLS-1$
-// Name qualifierName = qualifiedName.getQualifier();
-// assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(qualifierName, "field1.field2.field3.field4", source); //$NON-NLS-1$
-// ITypeBinding typeBinding5 = qualifierName.resolveTypeBinding();
-// assertNotNull("No binding5", typeBinding5); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", typeBinding5.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// qualifiedName = (QualifiedName) qualifierName;
-// simpleName = qualifiedName.getName();
-// checkSourceRange(simpleName, "field4", source); //$NON-NLS-1$
-// ITypeBinding typeBinding6 = simpleName.resolveTypeBinding();
-// assertNotNull("No binding6", typeBinding6); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", typeBinding6.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// qualifierName = qualifiedName.getQualifier();
-// assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(qualifierName, "field1.field2.field3", source); //$NON-NLS-1$
-// ITypeBinding typeBinding7 = qualifierName.resolveTypeBinding();
-// assertNotNull("No binding7", typeBinding7); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", typeBinding7.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// qualifiedName = (QualifiedName) qualifierName;
-// simpleName = qualifiedName.getName();
-// checkSourceRange(simpleName, "field3", source); //$NON-NLS-1$
-// qualifierName = qualifiedName.getQualifier();
-// assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(qualifierName, "field1.field2", source); //$NON-NLS-1$
-// ITypeBinding typeBinding3 = qualifierName.resolveTypeBinding();
-// assertNotNull("No binding3", typeBinding3); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// qualifiedName = (QualifiedName) qualifierName;
-// simpleName = qualifiedName.getName();
-// checkSourceRange(simpleName, "field2", source); //$NON-NLS-1$
-// qualifierName = qualifiedName.getQualifier();
-// assertTrue("Not a simple name", qualifierName.isSimpleName()); //$NON-NLS-1$
-// assertTrue("a declaration", !((SimpleName)qualifierName).isDeclaration()); //$NON-NLS-1$
-// checkSourceRange(qualifierName, "field1", source); //$NON-NLS-1$
-// ITypeBinding typeBinding4 = qualifierName.resolveTypeBinding();
-// assertNotNull("No binding4", typeBinding4); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
- /**
- * Check javadoc for FunctionDeclaration
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0207() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0207", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- JSdoc javadoc = this.ast.newJSdoc();
- javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
- assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
- checkSourceRange(node, "/** JavaDoc Comment*/\n function foo( i) {}", source); //$NON-NLS-1$
- checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0208() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0208", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "function foo( i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for FunctionDeclaration
- */
- public void test0209() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0209", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- JSdoc actualJavadoc = ((FunctionDeclaration) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "function foo( i) {}", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for VariableDeclarationStatement
- * @deprecated marking deprecated since using deprecated code
- */
- public void test0210() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0210", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- JSdoc actualJavadoc = ((VariableDeclarationStatement) node).getJavadoc();
- JSdoc javadoc = this.ast.newJSdoc();
- javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
- assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
- checkSourceRange(node, "/** JavaDoc Comment*/\n var i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for VariableDeclarationStatement
- */
- public void test0211() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0211", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- JSdoc actualJavadoc = ((VariableDeclarationStatement) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "var i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for VariableDeclarationStatement
- */
- public void test0212() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0212", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- JSdoc actualJavadoc = ((VariableDeclarationStatement) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- checkSourceRange(node, "var i;", source); //$NON-NLS-1$
- }
-
- /**
- * Check javadoc for TypeDeclaration
- */
- public void test0213() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0213", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0,0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- assertTrue("The node is not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- JSdoc actualJavadoc = ((VariableDeclarationStatement) node).getJavadoc();
- assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
- String expectedContents = "" +//$NON-NLS-1$
- "var i;" +//$NON-NLS-1$
- "";//$NON-NLS-1$
- checkSourceRange(node, expectedContents, source); //$NON-NLS-1$ }
- }
-
-// /**
-// * Check javadoc for TypeDeclaration
-// */
-// public void test0214() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0214", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// String expectedContents = "public class Test {\n" +//$NON-NLS-1$
-// " int i;\n" +//$NON-NLS-1$
-// "}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for TypeDeclaration
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0215() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0215", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// "public class Test {\n" +//$NON-NLS-1$
-// " int i;\n" +//$NON-NLS-1$
-// "}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-// }
-
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0216() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0216", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// " class B {}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// */
-// public void test0217() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0217", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// checkSourceRange(node, "class B {}", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// */
-// public void test0218() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0218", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
-// }
-
-// /**
-// * Check javadoc for MemberTypeDeclaration
-// */
-// public void test0219() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0219", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// assertTrue("The node is not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((TypeDeclaration) node).getJavadoc();
-// assertTrue("Javadoc must be null", actualJavadoc == null);//$NON-NLS-1$
-// checkSourceRange(node, "public static class B {}", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * Checking initializers
-// */
-// public void test0220() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0220", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// checkSourceRange(node, "{}", source); //$NON-NLS-1$
-// }
-
-// /**
-// * Checking initializers
-// */
-// public void test0221() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0221", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// checkSourceRange(node, "static {}", source); //$NON-NLS-1$
-// }
-
-// /**
-// * Checking initializers
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0222() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0222", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((Initializer) node).getJavadoc();
-// assertNotNull("Javadoc comment should no be null", actualJavadoc); //$NON-NLS-1$
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// " static {}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-//
-// }
-
-// /**
-// * Checking initializers
-// * @deprecated marking deprecated since using deprecated code
-// */
-// public void test0223() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0223", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((Initializer) node).getJavadoc();
-// assertNotNull("Javadoc comment should not be null", actualJavadoc); //$NON-NLS-1$
-// Javadoc javadoc = this.ast.newJavadoc();
-// javadoc.setComment("/** JavaDoc Comment*/");//$NON-NLS-1$*/
-// assertTrue("Both AST trees should be identical", javadoc.subtreeMatch(new ASTMatcher(), actualJavadoc));//$NON-NLS-1$
-// String expectedContents =
-// "/** JavaDoc Comment*/\n" + //$NON-NLS-1$
-// " {}";//$NON-NLS-1$
-// checkSourceRange(node, expectedContents, source); //$NON-NLS-1$
-// checkSourceRange(actualJavadoc, "/** JavaDoc Comment*/", source); //$NON-NLS-1$
-//
-// }
-
-// /**
-// * Checking initializers
-// */
-// public void test0224() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0224", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertNotNull("Expression should not be null", node); //$NON-NLS-1$
-// Javadoc actualJavadoc = ((Initializer) node).getJavadoc();
-// assertNull("Javadoc comment should be null", actualJavadoc); //$NON-NLS-1$
-// checkSourceRange(node, "{}", source); //$NON-NLS-1$
-// }
-
- /**
- * Continue ==> ContinueStatement
- */
- public void test0225() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0225", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- checkSourceRange(labeledStatement.getLabel(), "label", source); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- ContinueStatement statement = (ContinueStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- ContinueStatement continueStatement = this.ast.newContinueStatement();
- continueStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", continueStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "continue label;", source); //$NON-NLS-1$
- checkSourceRange(statement.getLabel(), "label", source); //$NON-NLS-1$
- }
-
- /**
- * Break + label ==> BreakStatement
- */
- public void test0226() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0226", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- LabeledStatement labeledStatement = (LabeledStatement) getASTNode((JavaScriptUnit) result, 0, 0, 0);
- checkSourceRange(labeledStatement.getLabel(), "label", source); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) labeledStatement.getBody();
- BreakStatement statement = (BreakStatement) ((Block) forStatement.getBody()).statements().get(0);
- assertNotNull("Expression should not be null", statement); //$NON-NLS-1$
- BreakStatement breakStatement = this.ast.newBreakStatement();
- breakStatement.setLabel(this.ast.newSimpleName("label")); //$NON-NLS-1$
- assertTrue("Both AST trees should be identical", breakStatement.subtreeMatch(new ASTMatcher(), statement)); //$NON-NLS-1$
- checkSourceRange(statement, "break label;", source); //$NON-NLS-1$
- checkSourceRange(statement.getLabel(), "label", source); //$NON-NLS-1$
- }
-
-// /**
-// * QualifiedName
-// */
-// public void test0227() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0227", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 3, 2, 0);
-// assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) node2;
-// Expression expr = returnStatement.getExpression();
-// assertTrue("Not a qualifiedName", expr instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) expr;
-// ITypeBinding typeBinding = expr.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Not an long (typeBinding)", "long", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// checkSourceRange(qualifiedName, "field.fB.fA.j", source); //$NON-NLS-1$
-//
-// SimpleName simpleName = qualifiedName.getName();
-// checkSourceRange(simpleName, "j", source); //$NON-NLS-1$
-// ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
-// assertEquals("Not an long (typeBinding2)", "long", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding = simpleName.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding;
-// assertEquals("Not A", "A", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not default", Modifier.NONE, variableBinding.getModifiers()); //$NON-NLS-1$
-// assertEquals("wrong name", "j", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// Name qualifierName = qualifiedName.getQualifier();
-// assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(qualifierName, "field.fB.fA", source); //$NON-NLS-1$
-// qualifiedName = (QualifiedName) qualifierName;
-// ITypeBinding typeBinding3 = qualifiedName.resolveTypeBinding();
-// assertNotNull("No type binding3", typeBinding3); //$NON-NLS-1$
-// assertEquals("Not an A", "A", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// simpleName = qualifiedName.getName();
-// checkSourceRange(simpleName, "fA", source); //$NON-NLS-1$
-// ITypeBinding typeBinding4 = simpleName.resolveTypeBinding();
-// assertNotNull("No typeBinding4", typeBinding4); //$NON-NLS-1$
-// assertEquals("Not an A", "A", typeBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding2 = qualifiedName.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// assertTrue("VariableBinding", binding2 instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding2 = (IVariableBinding) binding2;
-// assertEquals("Not B", "B", variableBinding2.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not default", Modifier.NONE, variableBinding2.getModifiers()); //$NON-NLS-1$
-// assertEquals("wrong name", "fA", variableBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// qualifierName = qualifiedName.getQualifier();
-// assertTrue("Not a qualified name", qualifierName.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(qualifierName, "field.fB", source); //$NON-NLS-1$
-// qualifiedName = (QualifiedName) qualifierName;
-// ITypeBinding typeBinding5 = qualifiedName.resolveTypeBinding();
-// assertNotNull("No typeBinding5", typeBinding5); //$NON-NLS-1$
-// assertEquals("Not a B", "B", typeBinding5.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// simpleName = qualifiedName.getName();
-// checkSourceRange(simpleName, "fB", source); //$NON-NLS-1$
-// ITypeBinding typeBinding6 = simpleName.resolveTypeBinding();
-// assertNotNull("No typebinding6", typeBinding6); //$NON-NLS-1$
-// assertEquals("not a B", "B", typeBinding6.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding3 = qualifiedName.resolveBinding();
-// assertNotNull("No binding2", binding3); //$NON-NLS-1$
-// assertTrue("VariableBinding", binding3 instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding3 = (IVariableBinding) binding3;
-// assertEquals("Not C", "C", variableBinding3.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not default", Modifier.NONE, variableBinding3.getModifiers()); //$NON-NLS-1$
-// assertEquals("wrong name", "fB", variableBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// qualifierName = qualifiedName.getQualifier();
-// assertTrue("Not a simple name", qualifierName.isSimpleName()); //$NON-NLS-1$
-// checkSourceRange(qualifierName, "field", source); //$NON-NLS-1$
-// simpleName = (SimpleName) qualifierName;
-// ITypeBinding typeBinding7 = simpleName.resolveTypeBinding();
-// assertNotNull("No typeBinding7", typeBinding7); //$NON-NLS-1$
-// assertEquals("Not a C", "C", typeBinding7.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding4 = simpleName.resolveBinding();
-// assertNotNull("No binding4", binding4); //$NON-NLS-1$
-// assertTrue("VariableBinding", binding4 instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding4 = (IVariableBinding) binding4;
-// assertEquals("Not Test", "Test", variableBinding4.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not public", Modifier.PUBLIC, variableBinding4.getModifiers()); //$NON-NLS-1$
-// assertEquals("wrong name", "field", variableBinding4.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("wrong return type", "C", variableBinding4.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * QualifiedName as TypeReference
-// */
-// public void test0228() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0228", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
-// assertTrue("ReturnStatement", node2 instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) node2;
-// Expression expr = returnStatement.getExpression();
-// checkSourceRange(expr, "test0228.Test.foo()", source); //$NON-NLS-1$
-// assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expr;
-// Expression qualifier = methodInvocation.getExpression();
-// assertNotNull("no qualifier", qualifier); //$NON-NLS-1$
-// assertTrue("QualifiedName", qualifier instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) qualifier;
-// checkSourceRange(qualifiedName, "test0228.Test", source); //$NON-NLS-1$
-// ITypeBinding typeBinding = qualifiedName.resolveTypeBinding();
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong type", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding = qualifiedName.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("Not a type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
-//
-// }
-
-// /**
-// * FunctionInvocation
-// */
-// public void test0229() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0229", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node2;
-// Expression expr = expressionStatement.getExpression();
-// assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
-// checkSourceRange(expr, "System.err.println()", source); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expr;
-// Expression qualifier = methodInvocation.getExpression();
-// assertTrue("QualifiedName", qualifier instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) qualifier;
-// ITypeBinding typeBinding = qualifier.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "PrintStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding = qualifiedName.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding;
-// assertEquals("wrong name", "err", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// SimpleName methodName = methodInvocation.getName();
-// IBinding binding2 = methodName.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// }
-
-// /**
-// * FunctionInvocation
-// */
-// public void test0230() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0230", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 1, 0);
-// assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node2;
-// Expression expr = expressionStatement.getExpression();
-// assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
-// checkSourceRange(expr, "err.println()", source); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expr;
-// Expression qualifier = methodInvocation.getExpression();
-// assertTrue("SimpleName", qualifier instanceof SimpleName); //$NON-NLS-1$
-// SimpleName name = (SimpleName) qualifier;
-// IBinding binding = name.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("Wrong name", "err", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// ITypeBinding typeBinding = name.resolveTypeBinding();
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wron type name", "PrintStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
-// /**
-// * FunctionInvocation
-// */
-// public void test0231() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0231", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("ExpressionStatement", node2 instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node2;
-// Expression expr = expressionStatement.getExpression();
-// assertTrue("FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
-// checkSourceRange(expr, "System.err.println()", source); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expr;
-// Expression qualifier = methodInvocation.getExpression();
-// assertTrue("QualifiedName", qualifier instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) qualifier;
-// ITypeBinding typeBinding = qualifier.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "PrintStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding = qualifiedName.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("VariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding;
-// assertEquals("wrong name", "err", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// SimpleName methodName = methodInvocation.getName();
-// IBinding binding2 = methodName.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// Name name = qualifiedName.getQualifier();
-// assertTrue("SimpleName", name.isSimpleName()); //$NON-NLS-1$
-// SimpleName simpleName = (SimpleName) name;
-// ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
-// assertNotNull("No typeBinding2", typeBinding2); //$NON-NLS-1$
-// assertEquals("wrong type name", "System", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
-// /**
-// * FunctionInvocation
-// */
-// public void test0232() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0232", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// ASTNode node2 = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("VariableDeclarationStatement", node2 instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node2;
-// List fragments = variableDeclarationStatement.fragments();
-// assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression initialization = variableDeclarationFragment.getInitializer();
-// ITypeBinding typeBinding = initialization.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertTrue("Not a primitive type", typeBinding.isPrimitive()); //$NON-NLS-1$
-// assertEquals("wrong name", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("QualifiedName", initialization instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) initialization;
-// SimpleName simpleName = qualifiedName.getName();
-// ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
-// assertTrue("Not a primitive type", typeBinding2.isPrimitive()); //$NON-NLS-1$
-// assertEquals("wrong name", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding = simpleName.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("IVariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding;
-// assertNull("No declaring class", variableBinding.getDeclaringClass()); //$NON-NLS-1$
-// }
-
-// /**
-// * Checking that only syntax errors are reported for the MALFORMED tag
-// */
-// public void test0233() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0233", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("Expression should not be null", result); //$NON-NLS-1$
-// assertTrue("The compilation unit is malformed", !isMalformed(result)); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit unit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertTrue("The fiels is not malformed", !isMalformed(node)); //$NON-NLS-1$
-// assertEquals("No problem found", 1, unit.getMessages().length); //$NON-NLS-1$
-// assertEquals("No problem found", 1, unit.getProblems().length); //$NON-NLS-1$
-// }
-//
-// /**
-// * Checking that null is returned for a resolveBinding if the type is unknown
-// */
-// public void test0234() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0234", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertTrue("The fiels is not malformed", !isMalformed(node)); //$NON-NLS-1$
-// JavaScriptUnit unit = (JavaScriptUnit) result;
-// assertEquals("No problem found", 1, unit.getMessages().length); //$NON-NLS-1$
-// assertEquals("No problem found", 1, unit.getProblems().length); //$NON-NLS-1$
-// assertTrue("VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
-// List fragments = fieldDeclaration.fragments();
-// assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-// IVariableBinding variableBinding = fragment.resolveBinding();
-// assertNull("binding not null", variableBinding); //$NON-NLS-1$
-// }
-
- /**
- * Checking that null is returned for a resolveBinding if the type is unknown
- */
- public void test0235() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0235", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("The fiels is not malformed", !isMalformed(node)); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("problems found", 0, unit.getMessages().length); //$NON-NLS-1$
- assertEquals("problems found", 0, unit.getProblems().length); //$NON-NLS-1$
- assertTrue("VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding); //$NON-NLS-1$
- }
-
- /**
- * Test the removal of a IField inside a CU that has an initializer
- */
- public void test0236() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0236", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// IType type = sourceUnit.getType("Test"); //$NON-NLS-1$
-// assertNotNull("No type", type); //$NON-NLS-1$
- IField field = sourceUnit.getField("i"); //$NON-NLS-1$
- assertNotNull("No field", field); //$NON-NLS-1$
- field.delete(true, null);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=9452
- */
- public void test0237() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "junit.framework", "TestCase.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-
-// /**
-// * Check ThisExpression
-// * @deprecated using deprecated code
-// */
-// public void test0238() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0238", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// char[] source = sourceUnit.getSource().toCharArray();
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
-// TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
-// TypeDeclaration typeDecl = typeDeclarationStatement.getTypeDeclaration();
-// Object o = typeDecl.bodyDeclarations().get(0);
-// assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDecl = (FunctionDeclaration) o;
-// Block block = methodDecl.getBody();
-// List statements = block.statements();
-// assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
-// Statement stmt = (Statement) statements.get(0);
-// assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) stmt;
-// Expression expr = returnStatement.getExpression();
-// assertTrue("Not a method invocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expr;
-// checkSourceRange(methodInvocation, "Test.this.bar()", source); //$NON-NLS-1$
-// Expression qualifier = methodInvocation.getExpression();
-// assertTrue("Not a ThisExpression", qualifier instanceof ThisExpression); //$NON-NLS-1$
-// ThisExpression thisExpression = (ThisExpression) qualifier;
-// Name name = thisExpression.getQualifier();
-// IBinding binding = name.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("wrong name", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * Check ThisExpression
-// * @deprecated using deprecated code
-// */
-// public void test0239() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0239", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 0);
-// assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
-// TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
-// TypeDeclaration typeDecl = typeDeclarationStatement.getTypeDeclaration();
-// Object o = typeDecl.bodyDeclarations().get(0);
-// assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDecl = (FunctionDeclaration) o;
-// Block block = methodDecl.getBody();
-// List statements = block.statements();
-// assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
-// Statement stmt = (Statement) statements.get(0);
-// assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) stmt;
-// Expression expr = returnStatement.getExpression();
-// assertTrue("Not a SuperMethodInvocation", expr instanceof SuperMethodInvocation); //$NON-NLS-1$
-// SuperMethodInvocation superMethodInvocation = (SuperMethodInvocation) expr;
-// Name name = superMethodInvocation.getQualifier();
-// IBinding binding = name.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("A type binding", binding instanceof ITypeBinding); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// Name methodName = superMethodInvocation.getName();
-// IBinding binding2 = methodName.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// assertTrue("No an IFunctionBinding", binding2 instanceof IFunctionBinding); //$NON-NLS-1$
-// IFunctionBinding methodBinding = (IFunctionBinding) binding2;
-// assertEquals("Not bar", "bar", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not T", "T", methodBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
-// /**
-// * Check FieldAccess
-// * @deprecated using deprecated code
-// */
-// public void test0240() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0240", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
-// TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
-// TypeDeclaration typeDecl = typeDeclarationStatement.getTypeDeclaration();
-// Object o = typeDecl.bodyDeclarations().get(0);
-// assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDecl = (FunctionDeclaration) o;
-// Block block = methodDecl.getBody();
-// List statements = block.statements();
-// assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
-// Statement stmt = (Statement) statements.get(0);
-// assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) stmt;
-// Expression expr = returnStatement.getExpression();
-// assertTrue("Not a field access", expr instanceof FieldAccess); //$NON-NLS-1$
-// FieldAccess fieldAccess = (FieldAccess) expr;
-// Expression qualifier = fieldAccess.getExpression();
-// assertTrue("Not a ThisExpression", qualifier instanceof ThisExpression); //$NON-NLS-1$
-// ThisExpression thisExpression = (ThisExpression) qualifier;
-// Name name = thisExpression.getQualifier();
-// IBinding binding = name.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// Name fieldName = fieldAccess.getName();
-// IBinding binding2 = fieldName.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// assertEquals("Wrong name", "f", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Wrong modifier", Modifier.PUBLIC, binding2.getModifiers()); //$NON-NLS-1$
-// ITypeBinding typeBinding = fieldName.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
- /**
- * Check order of body declarations
- */
- public void test0241() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0241", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0);
-// assertTrue("Not a type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// assertTrue("Not a declaration", ((TypeDeclaration) node).getName().isDeclaration()); //$NON-NLS-1$
-// assertEquals("Wrong size", 11, ((TypeDeclaration)node).bodyDeclarations().size()); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
-// node = getASTNode((JavaScriptUnit) result, 0, 2);
-// assertTrue("Not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// node = getASTNode((JavaScriptUnit) result, 0, 3);
-// assertTrue("Not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not a field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- node = getASTNode((JavaScriptUnit) result, 0, 7);
- assertTrue("Not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
-// node = getASTNode((JavaScriptUnit) result, 0, 10);
-// assertTrue("Not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- }
-
-// /**
-// * Check ThisExpression
-// * @deprecated using deprecated code
-// */
-// public void test0242() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0242", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 0);
-// assertTrue("Not a type declaration statement", node instanceof TypeDeclarationStatement); //$NON-NLS-1$
-// TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
-// TypeDeclaration typeDecl = typeDeclarationStatement.getTypeDeclaration();
-// Object o = typeDecl.bodyDeclarations().get(0);
-// assertTrue("Not a method", o instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDecl = (FunctionDeclaration) o;
-// Block block = methodDecl.getBody();
-// List statements = block.statements();
-// assertEquals("Not 1", 1, statements.size()); //$NON-NLS-1$
-// Statement stmt = (Statement) statements.get(0);
-// assertTrue("Not a return statement", stmt instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) stmt;
-// Expression expr = returnStatement.getExpression();
-// assertTrue("Not a SuperFieldAccess", expr instanceof SuperFieldAccess); //$NON-NLS-1$
-// SuperFieldAccess superFieldAccess = (SuperFieldAccess) expr;
-// Name name = superFieldAccess.getQualifier();
-// IBinding binding = name.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("A type binding", binding instanceof ITypeBinding); //$NON-NLS-1$
-// assertEquals("Not Test", "Test", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// Name fieldName = superFieldAccess.getName();
-// IBinding binding2 = fieldName.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// assertTrue("No an IVariableBinding", binding2 instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding2;
-// assertEquals("Not f", "f", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not T", "T", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// ITypeBinding typeBinding2 = fieldName.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
-// assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * Check catch clause positions:
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10570
- */
- public void test0243() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0243", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a try statement", node instanceof TryStatement); //$NON-NLS-1$
- TryStatement tryStatement = (TryStatement) node;
- List catchClauses = tryStatement.catchClauses();
- assertEquals("wrong size", 1, catchClauses.size()); //$NON-NLS-1$
- CatchClause catchClause = (CatchClause) catchClauses.get(0);
- checkSourceRange(catchClause, "catch (e){m();}", source); //$NON-NLS-1$
- }
-
- /**
- * Check catch clause positions:
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10570
- */
- public void test0244() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0244", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a try statement", node instanceof TryStatement); //$NON-NLS-1$
- TryStatement tryStatement = (TryStatement) node;
- List catchClauses = tryStatement.catchClauses();
- assertEquals("wrong size", 1, catchClauses.size()); //$NON-NLS-1$
- CatchClause catchClause = (CatchClause) catchClauses.get(0);
- checkSourceRange(catchClause, "catch (e){m();}", source); //$NON-NLS-1$
-// catchClause = (CatchClause) catchClauses.get(1);
-// checkSourceRange(catchClause, "catch(e) {}", source); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=10587
- */
- public void test0245() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0245", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expr = returnStatement.getExpression();
- assertTrue("not a name", expr instanceof Name); //$NON-NLS-1$
- Name name = (Name) expr;
- IBinding binding = name.resolveBinding();
- assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Not i", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Not Number", "Number", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ASTNode declaringNode = unit.findDeclaringNode(variableBinding);
- assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
- assertTrue("Not a VariableDeclarationFragment", declaringNode instanceof VariableDeclarationFragment); //$NON-NLS-1$
- }
-
-// /**
-// * Test binding resolution for import declaration
-// */
-// public void test0246() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0246", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit unit = (JavaScriptUnit) result;
-// List imports = unit.imports();
-// assertEquals("wrong imports size", 2, imports.size()); //$NON-NLS-1$
-// ImportDeclaration importDeclaration = (ImportDeclaration) imports.get(0);
-// assertTrue("Not on demand", importDeclaration.isOnDemand()); //$NON-NLS-1$
-// checkSourceRange(importDeclaration, "import java.util.*;", source); //$NON-NLS-1$
-// IBinding binding = importDeclaration.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
-// assertEquals("Wrong name", "java.util", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// importDeclaration = (ImportDeclaration) imports.get(1);
-// assertTrue("On demand", !importDeclaration.isOnDemand()); //$NON-NLS-1$
-// checkSourceRange(importDeclaration, "import java.io.IOException;", source); //$NON-NLS-1$
-// binding = importDeclaration.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
-// assertEquals("Wrong name", "IOException", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * Test binding resolution for import declaration
-// */
-// public void test0247() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0247", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit unit = (JavaScriptUnit) result;
-// PackageDeclaration packageDeclaration = unit.getPackage();
-// checkSourceRange(packageDeclaration, "package test0247;", source); //$NON-NLS-1$
-// IPackageBinding binding = packageDeclaration.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
-// assertEquals("Wrong name", "test0247", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
- */
- public void test0248() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0248", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 1, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- Name name = singleVariableDeclaration.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong type", "any", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
-// */
-// public void test0249() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0249", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 2, 1);
-// assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node;
-// Expression expression = expressionStatement.getExpression();
-// assertTrue("Not an assignment", expression instanceof Assignment); //$NON-NLS-1$
-// Assignment assignment = (Assignment) expression;
-// Expression leftHandSide = assignment.getLeftHandSide();
-// assertTrue("Not a qualified name", leftHandSide instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) leftHandSide;
-// Name simpleName = qualifiedName.getName();
-// IBinding binding = simpleName.resolveBinding();
-// assertNotNull("no binding", binding); //$NON-NLS-1$
-// assertTrue("Not a IVariableBinding", binding instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding;
-// assertEquals("Wrong name", "k", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Wrong modifier", Modifier.STATIC, variableBinding.getModifiers()); //$NON-NLS-1$
-// assertEquals("Wrong type", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Wrong declaring class name", "j", variableBinding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
-// */
-// public void test0250() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0250", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
-// List parameters = methodDeclaration.parameters();
-// assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
-// SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
-// Name name = singleVariableDeclaration.getName();
-// IBinding binding = name.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding;
-// assertEquals("Wrong name", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Wrong type", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * Check qualified name resolution for static fields
-// */
-// public void test0251() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0251", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not a ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node;
-// Expression expression = expressionStatement.getExpression();
-// assertTrue("Not a method invocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expression;
-// checkSourceRange(methodInvocation, "java.lang.System.out.println()", source); //$NON-NLS-1$
-// Expression qualifier = methodInvocation.getExpression();
-// assertTrue("Not a qualified name", qualifier instanceof QualifiedName); //$NON-NLS-1$
-// checkSourceRange(qualifier, "java.lang.System.out", source); //$NON-NLS-1$
-// QualifiedName qualifiedName = (QualifiedName) qualifier;
-// Name typeName = qualifiedName.getQualifier();
-// assertTrue("Not a QualifiedName", typeName instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName qualifiedTypeName = (QualifiedName) typeName;
-// IBinding binding = qualifiedTypeName.getName().resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("Wrong name", "System", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// binding = qualifiedTypeName.getQualifier().resolveBinding();
-// assertNotNull("No binding2", binding); //$NON-NLS-1$
-// assertEquals("Wrong type binding", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
-// }
-//
-// /**
-// * Check binding for anonymous class
-// */
-// public void test0252() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0252", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
-// assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) node;
-// Expression expression = returnStatement.getExpression();
-// assertTrue("Not a classinstancecreation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
-// IFunctionBinding methodBinding = classInstanceCreation.resolveConstructorBinding();
-// assertNotNull("No methodBinding", methodBinding); //$NON-NLS-1$
-// assertTrue("Not a constructor", methodBinding.isConstructor()); //$NON-NLS-1$
-// assertTrue("Not an anonymous class", methodBinding.getDeclaringClass().isAnonymous()); //$NON-NLS-1$
-// assertEquals("Not an anonymous class of java.lang.Object", "Object", methodBinding.getDeclaringClass().getSuperclass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Not an anonymous class of java.lang.Object", "java.lang", methodBinding.getDeclaringClass().getSuperclass().getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * Check binding for allocation expression
- */
- public void test0253() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0253", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not a classinstancecreation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- IFunctionBinding methodBinding = classInstanceCreation.resolveConstructorBinding();
- assertNotNull("No methodBinding", methodBinding); //$NON-NLS-1$
- assertTrue("Not a constructor", methodBinding.isConstructor()); //$NON-NLS-1$
-// assertEquals("Wrong size", 1, methodBinding.getParameterTypes().length); //$NON-NLS-1$
-// assertEquals("Wrong type", "String", methodBinding.getParameterTypes()[0].getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// /**
-// * Check binding for allocation expression
-// */
-// public void test0254() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0254", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 1, 0);
-// assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) node;
-// Expression expression = returnStatement.getExpression();
-// assertTrue("Not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
-// IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertEquals("wrong type", "C", binding.getDeclaringClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
-
-// /**
-// * Check binding for allocation expression
-// */
-// public void test0255() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0255", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node;
-// Expression expression = expressionStatement.getExpression();
-// assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expression;
-// List arguments = methodInvocation.arguments();
-// assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
-// Expression expression2 = (Expression) arguments.get(0);
-// assertTrue("Not a CastExpression", expression2 instanceof CastExpression); //$NON-NLS-1$
-// CastExpression castExpression = (CastExpression) expression2;
-// Type type = castExpression.getType();
-// ITypeBinding binding = type.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("Not an array type", binding.isArray()); //$NON-NLS-1$
-// }
-
-// /**
-// * Check binding for allocation expression
-// */
-// public void test0256() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0256", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node;
-// Expression expression = expressionStatement.getExpression();
-// assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expression;
-// List arguments = methodInvocation.arguments();
-// assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
-// Expression expression2 = (Expression) arguments.get(0);
-// assertTrue("Not a CastExpression", expression2 instanceof CastExpression); //$NON-NLS-1$
-// CastExpression castExpression = (CastExpression) expression2;
-// Type type = castExpression.getType();
-// assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type;
-// ITypeBinding binding = type.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("Not a class", binding.isClass()); //$NON-NLS-1$
-// Name name = simpleType.getName();
-// IBinding binding2 = name.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// assertEquals("Wrong type", "Object", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * Check binding for allocation expression
-// */
-// public void test0257() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0257", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node;
-// Expression expression = expressionStatement.getExpression();
-// assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expression;
-// List arguments = methodInvocation.arguments();
-// assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
-// Expression expression2 = (Expression) arguments.get(0);
-// assertTrue("Not a CastExpression", expression2 instanceof CastExpression); //$NON-NLS-1$
-// CastExpression castExpression = (CastExpression) expression2;
-// Type type = castExpression.getType();
-// assertTrue("Not a primitive type", type.isPrimitiveType()); //$NON-NLS-1$
-// PrimitiveType primitiveType = (PrimitiveType) type;
-// assertEquals("Not int", PrimitiveType.INT, primitiveType.getPrimitiveTypeCode()); //$NON-NLS-1$
-// }
-
-// /**
-// * Check binding for allocation expression
-// */
-// public void test0258() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0258", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
-// assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
-// ExpressionStatement expressionStatement = (ExpressionStatement) node;
-// Expression expression = expressionStatement.getExpression();
-// assertTrue("Not a FunctionInvocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
-// FunctionInvocation methodInvocation = (FunctionInvocation) expression;
-// List arguments = methodInvocation.arguments();
-// assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
-// Expression expression2 = (Expression) arguments.get(0);
-// assertTrue("Not a CastExpression", expression2 instanceof CastExpression); //$NON-NLS-1$
-// CastExpression castExpression = (CastExpression) expression2;
-// Type type = castExpression.getType();
-// assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type;
-// ITypeBinding binding = type.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// assertTrue("Not a class", binding.isClass()); //$NON-NLS-1$
-// Name name = simpleType.getName();
-// IBinding binding2 = name.resolveBinding();
-// assertNotNull("No binding2", binding2); //$NON-NLS-1$
-// assertEquals("Wrong type", "Object", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10663
- */
- public void test0259() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0259", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10592
-// */
-// public void test0260() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0260", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
-// assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
-// List parameters = methodDeclaration.parameters();
-// assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
-// SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
-// IBinding binding = singleVariableDeclaration.resolveBinding();
-// assertNotNull("No binding", binding); //$NON-NLS-1$
-// Name name = singleVariableDeclaration.getName();
-// assertTrue("Not a simple name", name instanceof SimpleName); //$NON-NLS-1$
-// SimpleName simpleName = (SimpleName) name;
-// assertEquals("Wrong name", "i", simpleName.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
-// IBinding binding2 = name.resolveBinding();
-// assertNotNull("No binding", binding2); //$NON-NLS-1$
-// assertTrue("binding == binding2", binding == binding2); //$NON-NLS-1$
-// assertTrue("Not a variable binding", binding2 instanceof IVariableBinding); //$NON-NLS-1$
-// IVariableBinding variableBinding = (IVariableBinding) binding2;
-// assertEquals("Wrong name", "i", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertEquals("Wrong type", "int", variableBinding.getType().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10676
- */
- public void test0262() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0262", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expr = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- List arguments = methodInvocation.arguments();
- assertEquals("Wrong argument list size", 1, arguments.size()); //$NON-NLS-1$
- Expression expr2 = (Expression) arguments.get(0);
- assertTrue("Not a class instance creation", expr2 instanceof ClassInstanceCreation); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expr2;
- arguments = classInstanceCreation.arguments();
- assertEquals("Wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression expression2 = (Expression) arguments.get(0);
- assertTrue("Not a string literal", expression2 instanceof StringLiteral); //$NON-NLS-1$
- StringLiteral stringLiteral = (StringLiteral) expression2;
- ITypeBinding typeBinding = stringLiteral.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "String", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10700
- */
- public void test0263() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0263", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expr = expressionStatement.getExpression();
- assertTrue("Not a FunctionInvocation", expr instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expr;
- List arguments = methodInvocation.arguments();
- assertEquals("Wrong argument list size", 1, arguments.size()); //$NON-NLS-1$
- Expression expr2 = (Expression) arguments.get(0);
- assertTrue("Not a simple name", expr2 instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expr2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10699
- */
-// public void test0264() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0264", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// List fragments = variableDeclarationStatement.fragments();
-// assertEquals("Wrong fragment size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// assertTrue("Not a classinstancecreation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
-// AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
-// assertNotNull("No anonymousclassdeclaration", anonymousClassDeclaration); //$NON-NLS-1$
-// String expectedSourceRange =
-// "{\n"+ //$NON-NLS-1$
-// " void m(int k){\n"+ //$NON-NLS-1$
-// " k= i;\n"+ //$NON-NLS-1$
-// " }\n"+ //$NON-NLS-1$
-// " }"; //$NON-NLS-1$
-// checkSourceRange(anonymousClassDeclaration, expectedSourceRange, source);
-// List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
-// assertEquals("Wrong size", 1, bodyDeclarations.size()); //$NON-NLS-1$
-// BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
-// assertTrue("Not a method declaration", bodyDeclaration instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
-// assertEquals("Wrong name", "m", methodDeclaration.getName().getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10698
- */
- public void test0265() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0265", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
-// */
-// public void test0266() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0266", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// Type type = variableDeclarationStatement.getType();
-// checkSourceRange(type, "Inner\\u005b]", source); //$NON-NLS-1$
-// assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
-// ArrayType arrayType = (ArrayType) type;
-// Type type2 = arrayType.getElementType();
-// assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type2;
-// checkSourceRange(simpleType, "Inner", source); //$NON-NLS-1$
-// Name name = simpleType.getName();
-// assertTrue("not a simple name", name.isSimpleName()); //$NON-NLS-1$
-// SimpleName simpleName = (SimpleName) name;
-// checkSourceRange(simpleName, "Inner", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
-// */
-// public void test0267() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0267", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// Type type = variableDeclarationStatement.getType();
-// checkSourceRange(type, "Inner[]", source); //$NON-NLS-1$
-// assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
-// ArrayType arrayType = (ArrayType) type;
-// Type type2 = arrayType.getElementType();
-// assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type2;
-// checkSourceRange(simpleType, "Inner", source); //$NON-NLS-1$
-// Name name = simpleType.getName();
-// assertTrue("not a simple name", name.isSimpleName()); //$NON-NLS-1$
-// SimpleName simpleName = (SimpleName) name;
-// checkSourceRange(simpleName, "Inner", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
-// */
-// public void test0268() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0268", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// Type type = variableDeclarationStatement.getType();
-// checkSourceRange(type, "test0268.Test.Inner[]", source); //$NON-NLS-1$
-// assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
-// ArrayType arrayType = (ArrayType) type;
-// Type type2 = arrayType.getElementType();
-// assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type2;
-// checkSourceRange(simpleType, "test0268.Test.Inner", source); //$NON-NLS-1$
-// Name name = simpleType.getName();
-// assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(name, "test0268.Test.Inner", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
-// */
-// public void test0269() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0269", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// Type type = variableDeclarationStatement.getType();
-// checkSourceRange(type, "test0269.Test.Inner[/**/]", source); //$NON-NLS-1$
-// assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
-// ArrayType arrayType = (ArrayType) type;
-// Type type2 = arrayType.getElementType();
-// assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type2;
-// checkSourceRange(simpleType, "test0269.Test.Inner", source); //$NON-NLS-1$
-// Name name = simpleType.getName();
-// assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(name, "test0269.Test.Inner", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
-// */
-// public void test0270() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0270", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// Type type = variableDeclarationStatement.getType();
-// checkSourceRange(type, "test0270.Test.Inner", source); //$NON-NLS-1$
-// assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type;
-// Name name = simpleType.getName();
-// assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(name, "test0270.Test.Inner", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10759
-// */
-// public void test0271() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0271", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// Type type = variableDeclarationStatement.getType();
-// checkSourceRange(type, "test0271.Test.Inner[]", source); //$NON-NLS-1$
-// assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
-// ArrayType arrayType = (ArrayType) type;
-// Type type2 = arrayType.getElementType();
-// assertTrue("Not a simple type", type2.isSimpleType()); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type2;
-// checkSourceRange(simpleType, "test0271.Test.Inner", source); //$NON-NLS-1$
-// Name name = simpleType.getName();
-// assertTrue("not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
-// checkSourceRange(name, "test0271.Test.Inner", source); //$NON-NLS-1$
-// }
-//
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0272() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0272", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a For statement", node instanceof ForStatement); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- checkSourceRange(forStatement, "for (var i= 0; i < 10; i++) foo();", source); //$NON-NLS-1$
- Statement action = forStatement.getBody();
- checkSourceRange(action, "foo();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0273() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0273", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a For statement", node instanceof ForStatement); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- checkSourceRange(forStatement, "for (var i= 0; i < 10; i++) { foo(); }", source); //$NON-NLS-1$
- Statement action = forStatement.getBody();
- checkSourceRange(action, "{ foo(); }", source); //$NON-NLS-1$
- assertTrue("Not a block", action instanceof Block); //$NON-NLS-1$
- Block block = (Block) action;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- checkSourceRange(stmt, "foo();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0274() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0274", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not a While statement", node instanceof WhileStatement); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node;
- checkSourceRange(whileStatement, "while (i < 10) { foo(i++); }", source); //$NON-NLS-1$
- Statement action = whileStatement.getBody();
- checkSourceRange(action, "{ foo(i++); }", source); //$NON-NLS-1$
- assertTrue("Not a block", action instanceof Block); //$NON-NLS-1$
- Block block = (Block) action;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement stmt = (Statement) statements.get(0);
- checkSourceRange(stmt, "foo(i++);", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10843
- */
- public void test0275() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0275", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not a While statement", node instanceof WhileStatement); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node;
- checkSourceRange(whileStatement, "while (i < 10) foo(i++);", source); //$NON-NLS-1$
- Statement action = whileStatement.getBody();
- checkSourceRange(action, "foo(i++);", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10798
- */
- public void test0276() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0276", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "function foo() {\n" + //$NON-NLS-1$
- " foo();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " foo();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration.getBody(), expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10798
- */
- public void test0277() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0277", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "function foo() {\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration.getBody(), expectedSource, source);
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10861
-// */
-// public void test0278() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0278", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0);
-// assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
-// checkSourceRange(fieldDeclaration, "Class c = java.lang.String.class;", source); //$NON-NLS-1$
-// List fragments = fieldDeclaration.fragments();
-// assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// assertTrue("Not a type literal", expression instanceof TypeLiteral); //$NON-NLS-1$
-// ITypeBinding typeBinding = expression.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "Class", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10861
-// */
-// public void test0279() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0279", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0,0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// checkSourceRange(variableDeclarationStatement, "Class c = java.lang.String.class;", source); //$NON-NLS-1$
-// List fragments = variableDeclarationStatement.fragments();
-// assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// assertTrue("Not a type literal", expression instanceof TypeLiteral); //$NON-NLS-1$
-// ITypeBinding typeBinding = expression.resolveTypeBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "Class", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10865
- * Check well known types
- */
- public void test0280() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0280", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- AST newAst = result.getAST();
- ITypeBinding typeBinding = newAst.resolveWellKnownType("Boolean"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Boolean", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("String"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "String", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- typeBinding = newAst.resolveWellKnownType("Number"); //$NON-NLS-1$
- assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("short"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "short", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("int"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("long"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "long", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("float"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "float", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("double"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "double", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("void"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "void", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "Object", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.String"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "String", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.StringBuffer"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "StringBuffer", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Throwable"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "Throwable", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Exception"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "Exception", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.RuntimeException"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "RuntimeException", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Error"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "Error", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Class"); //$NON-NLS-1$
-// assertNotNull("No typeBinding", typeBinding); //$NON-NLS-1$
-// assertEquals("Wrong name", "Class", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Runnable"); //$NON-NLS-1$
-// assertNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Cloneable"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.io.Serializable"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Boolean"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Byte"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Character"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Double"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Float"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Integer"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Long"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Short"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
-// typeBinding = newAst.resolveWellKnownType("java.lang.Void"); //$NON-NLS-1$
-// assertNotNull("typeBinding not null", typeBinding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0281() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0281", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a VariableDeclarationStatement declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var o= /*]*/new Object()/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "new Object()", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0282() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0282", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a VariableDeclarationStatement declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var b = /*]*/true/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "true", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0283() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0283", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a VariableDeclarationStatement declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var c = /*]*/'c'/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "'c'", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0284() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0284", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var o = /*]*/null/*[*/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "null", source); //$NON-NLS-1$
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
-// */
-// public void test0285() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0285", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0);
-// assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
-// checkSourceRange(fieldDeclaration, "var o = /*]*/Object.class/*[*/;", source); //$NON-NLS-1$
-// List fragments = fieldDeclaration.fragments();
-// assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// checkSourceRange(expression, "Object.class", source); //$NON-NLS-1$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0286() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0286", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var i = /**/(2)/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "(2)", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0287() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0287", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a VariableDeclarationStatement declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var tab = /**/new String/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "new String", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0288() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0288", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a VariableDeclarationStatement declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var tab = /**/[]/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "[]", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- */
- public void test0289() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0289", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1);
- assertTrue("Not a VariableDeclarationStatement declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var s = /**/tab1[0]/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "tab1[0]", source); //$NON-NLS-1$
- }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
-// */
-// public void test0290() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0290", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0);
-// assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
-// checkSourceRange(fieldDeclaration, "var o = /*]*/new java.lang.Object()/*[*/;", source); //$NON-NLS-1$
-// List fragments = fieldDeclaration.fragments();
-// assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// checkSourceRange(expression, "new java.lang.Object()", source); //$NON-NLS-1$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10898
-// */
-// public void test0291() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0291", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit unit = (JavaScriptUnit) result;
-// assertEquals("no errors", 1, unit.getMessages().length); //$NON-NLS-1$
-// assertEquals("no errors", 1, unit.getProblems().length); //$NON-NLS-1$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10913
- */
- public void test0292() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0292", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not a FieldAccess", expression instanceof FieldAccess); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) expression;
- SimpleName simpleName = fieldAccess.getName();
- assertEquals("Wrong name", "x", simpleName.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("NO binding", binding); //$NON-NLS-1$
- assertTrue("Not a variable binding", binding instanceof IVariableBinding); //$NON-NLS-1$
- assertEquals("wrong name", "x", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Expression expr = fieldAccess.getExpression();
- assertTrue("Not a simpleName", expr instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleName2 = (SimpleName) expr;
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertTrue("Not a type binding", binding2 instanceof ITypeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Test", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10933
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10935
-// */
-// public void test0293() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0293", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// List fragments = variableDeclarationStatement.fragments();
-// assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// assertTrue("Not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
-// AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
-// assertNotNull("No body", anonymousClassDeclaration); //$NON-NLS-1$
-// String expectedSource =
-// "{\n" + //$NON-NLS-1$
-// " public void run() {\n" + //$NON-NLS-1$
-// " /*]*/foo();/*[*/\n" + //$NON-NLS-1$
-// " }\n" + //$NON-NLS-1$
-// " }"; //$NON-NLS-1$
-// checkSourceRange(anonymousClassDeclaration, expectedSource, source);
-// expectedSource =
-// "run= new Runnable() {\n" + //$NON-NLS-1$
-// " public void run() {\n" + //$NON-NLS-1$
-// " /*]*/foo();/*[*/\n" + //$NON-NLS-1$
-// " }\n" + //$NON-NLS-1$
-// " }"; //$NON-NLS-1$
-// checkSourceRange(variableDeclarationFragment, expectedSource, source);
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10984
- */
- public void test0294() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0294", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "function fails() {\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- Block block = methodDeclaration.getBody();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(block, expectedSource, source);
- node = getASTNode(compilationUnit, 0, 1);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10986
- */
- public void test0295() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0295", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$
-// assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not a method invocation", expression instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- ITypeBinding typeBinding = methodInvocation.resolveTypeBinding();
- assertNotNull("type binding is null", typeBinding); //$NON-NLS-1$
- }
-
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10984
- */
- public void test0296() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0296", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- String expectedSource =
- "function fails() {\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(methodDeclaration, expectedSource, source);
- Block block = methodDeclaration.getBody();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " foo()\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(block, expectedSource, source);
- node = getASTNode(compilationUnit, 0, 1);
- assertTrue("Not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11037
- */
- public void test0297() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0297", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- runConversion(sourceUnit, false);
- }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=10984
-// */
-// public void test0298() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0298", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, false);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
-// assertTrue("Not a ReturnStatement", node instanceof ReturnStatement); //$NON-NLS-1$
-// ReturnStatement returnStatement = (ReturnStatement) node;
-// Expression expression = returnStatement.getExpression();
-// checkSourceRange(expression, "a().length != 3", source); //$NON-NLS-1$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11104
- */
- public void test0299() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0299", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var i = (/**/2/**/);", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a parenthesized expression", expression instanceof ParenthesizedExpression); //$NON-NLS-1$
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression;
- Expression expression2 = parenthesizedExpression.getExpression();
- checkSourceRange(expression2, "2", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11104
- */
- public void test0300() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0300", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var b = /**/true/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "true", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=10874
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11104
- */
- public void test0301() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0301", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a Field declaration", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- checkSourceRange(fieldDeclaration, "var o = /**/null/**/;", source); //$NON-NLS-1$
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- checkSourceRange(expression, "null", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11106
- */
- public void test0302() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0302", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a DoStatement", node instanceof DoStatement); //$NON-NLS-1$
- DoStatement doStatement = (DoStatement) node;
- String expectedSource =
- "do\n" + //$NON-NLS-1$
- " foo();\n" + //$NON-NLS-1$
- " while(1 < 10);"; //$NON-NLS-1$
- checkSourceRange(doStatement, expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11129
- */
- public void test0303() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0303", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression2 = expressionStatement.getExpression();
- assertTrue("Not an Assignement", expression2 instanceof Assignment); //$NON-NLS-1$
- Assignment assignment = (Assignment) expression2;
- Expression expression = assignment.getRightHandSide();
-// assertTrue("Not a CastExpression", expression instanceof CastExpression); //$NON-NLS-1$
-// CastExpression castExpression = (CastExpression) expression;
- ITypeBinding typeBinding = expression.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// Type type = castExpression.getType();
-// ITypeBinding typeBinding2 = type.resolveBinding();
-// assertNotNull("No binding2", typeBinding2); //$NON-NLS-1$
-// assertEquals("Wrong name", "char", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11151
- */
- public void test0304() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0304", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- checkSourceRange(node, "function foo(arg);", source); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- assertNull("Has a body", block); //$NON-NLS-1$
- }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=11125
-// */
-// public void test0305() {
-// char[] source =
-// ("" + //$NON-NLS-1$
-// " function foo(arg) {}\n" + //$NON-NLS-1$
-// "").toCharArray(); //$NON-NLS-1$
-// IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
-// ASTNode result = runConversion(source, "Test.js", project, true); //$NON-NLS-1$
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0);
-// assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) node;
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-//// assertEquals("Wrong name", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//// assertEquals("Wrong package", "test0305", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//// assertTrue("Not an interface", typeBinding.isClass()); //$NON-NLS-1$
-// }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=11125
-// */
-// public void test0306() {
-// char[] source =
-// ("" + //$NON-NLS-1$
-// " function foo(arg) {}\n" + //$NON-NLS-1$
-// "").toCharArray(); //$NON-NLS-1$
-// IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
-// ASTNode result = runConversion(source, "Object.js", project, true); //$NON-NLS-1$
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0);
-// assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) node;
-// ITypeBinding typeBinding = typeDeclaration.resolveBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-//// assertEquals("Wrong name", "Object", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//// assertEquals("Wrong package", "java.lang", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
-//// assertTrue("Not an interface", typeBinding.isClass()); //$NON-NLS-1$
-// assertEquals("Wrong size", 2, typeBinding.getDeclaredMethods().length); //$NON-NLS-1$
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=11371
-// */
-// public void test0307() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0307", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
-// Block block = methodDeclaration.getBody();
-// assertNotNull("No body", block); //$NON-NLS-1$
-// List statements = block.statements();
-// assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
-// Statement statement = (Statement) statements.get(0);
-// assertTrue("Not a super constructor invocation", statement instanceof SuperConstructorInvocation); //$NON-NLS-1$
-// checkSourceRange(statement, "super(10);", source);
-// }
-//
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=11371
-// */
-// public void test0308() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0308", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
-// assertTrue("not a method declaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
-// Block block = methodDeclaration.getBody();
-// assertNotNull("No body", block); //$NON-NLS-1$
-// List statements = block.statements();
-// assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
-// Statement statement = (Statement) statements.get(0);
-// assertTrue("Not a super constructor invocation", statement instanceof SuperConstructorInvocation); //$NON-NLS-1$
-// SuperConstructorInvocation superConstructorInvocation = (SuperConstructorInvocation) statement;
-// IFunctionBinding methodBinding = superConstructorInvocation.resolveConstructorBinding();
-// assertNotNull("No methodBinding", methodBinding); //$NON-NLS-1$
-// IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding();
-// assertNotNull("No methodBinding2", methodBinding2); //$NON-NLS-1$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11380
- */
- public void test0309() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0309", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a conditional expression", expression instanceof ConditionalExpression); //$NON-NLS-1$
- ConditionalExpression conditionalExpression = (ConditionalExpression) expression;
- ITypeBinding typeBinding = conditionalExpression.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "Number", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11380
- */
- public void test0310() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0310", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a fieldAccess", expression instanceof FieldAccess); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) expression;
- SimpleName qualifier = (SimpleName)fieldAccess.getExpression();
- IBinding binding = qualifier.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", "I", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=11638
-// */
-// public void test0311() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0311", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// List fragments = variableDeclarationStatement.fragments();
-// assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// assertTrue("not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
-// AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
-// assertNotNull("No body", anonymousClassDeclaration); //$NON-NLS-1$
-// List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
-// assertEquals("wrong size for body declarations", 1, bodyDeclarations.size()); //$NON-NLS-1$
-// BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
-// assertTrue("Not a method declaration", bodyDeclaration instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
-// Block block = methodDeclaration.getBody();
-// assertNotNull("no body", block); //$NON-NLS-1$
-// List statements = block.statements();
-// assertEquals("Wrong size for statements", 1, statements.size()); //$NON-NLS-1$
-// Statement statement = (Statement) statements.get(0);
-// assertTrue("not a variable declaration statement", statement instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement2 = (VariableDeclarationStatement) statement;
-// List fragments2 = variableDeclarationStatement2.fragments();
-// assertEquals("wrong size for fragments2", 1, fragments2.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment2 = (VariableDeclarationFragment) fragments2.get(0);
-// Expression expression2 = variableDeclarationFragment2.getInitializer();
-// assertTrue("Not a name", expression2 instanceof Name); //$NON-NLS-1$
-// Name name = (Name) expression2;
-// checkSourceRange(name, "j", source); //$NON-NLS-1$
-// IBinding binding = name.resolveBinding();
-// ASTNode declaringNode = compilationUnit.findDeclaringNode(binding);
-// assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
-// checkSourceRange(declaringNode, "var j", source); //$NON-NLS-1$
-// assertTrue("Not a single variable declaration", declaringNode instanceof SingleVariableDeclaration); //$NON-NLS-1$
-// }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=11638
-// * There is a error in this source. A is unresolved. Then there is no
-// * declaring node.
-// */
-// public void test0312() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0312", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// List fragments = variableDeclarationStatement.fragments();
-// assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-// Expression expression = variableDeclarationFragment.getInitializer();
-// assertTrue("not a class instance creation", expression instanceof ClassInstanceCreation); //$NON-NLS-1$
-// ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
-// AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
-// assertNotNull("No body", anonymousClassDeclaration); //$NON-NLS-1$
-// List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
-// assertEquals("wrong size for body declarations", 1, bodyDeclarations.size()); //$NON-NLS-1$
-// BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
-// assertTrue("Not a method declaration", bodyDeclaration instanceof FunctionDeclaration); //$NON-NLS-1$
-// FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
-// Block block = methodDeclaration.getBody();
-// assertNotNull("no body", block); //$NON-NLS-1$
-// List statements = block.statements();
-// assertEquals("Wrong size for statements", 1, statements.size()); //$NON-NLS-1$
-// Statement statement = (Statement) statements.get(0);
-// assertTrue("not a variable declaration statement", statement instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement2 = (VariableDeclarationStatement) statement;
-// List fragments2 = variableDeclarationStatement2.fragments();
-// assertEquals("wrong size for fragments2", 1, fragments2.size()); //$NON-NLS-1$
-// VariableDeclarationFragment variableDeclarationFragment2 = (VariableDeclarationFragment) fragments2.get(0);
-// Expression expression2 = variableDeclarationFragment2.getInitializer();
-// assertTrue("Not a name", expression2 instanceof Name); //$NON-NLS-1$
-// Name name = (Name) expression2;
-// checkSourceRange(name, "j", source); //$NON-NLS-1$
-// IBinding binding = name.resolveBinding();
-// ASTNode declaringNode = compilationUnit.findDeclaringNode(binding);
-// assertNull("No declaring node is available", declaringNode); //$NON-NLS-1$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11659
- */
- public void test0313() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0313", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an InfixExpression", expression instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "i+j", source); //$NON-NLS-1$
- Expression expression2 = infixExpression.getLeftOperand();
- checkSourceRange(expression2, "i", source); //$NON-NLS-1$
- assertTrue("Not a name", expression2 instanceof Name); //$NON-NLS-1$
- Name name = (Name) expression2;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- ASTNode astNode = compilationUnit.findDeclaringNode(binding);
- assertNotNull("No declaring node", astNode); //$NON-NLS-1$
- checkSourceRange(astNode, "i", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=12326
- */
- public void test0314() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0314", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("No result", result); //$NON-NLS-1$
- assertTrue("Not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Wrong line number", 1, compilationUnit.getLineNumber(0)); //$NON-NLS-1$
- // ensure that last character is on the last line
- assertEquals("Wrong line number", 1, compilationUnit.getLineNumber(source.length - 1)); //$NON-NLS-1$
- // source.length is beyond the size of the compilation unit source
- assertEquals("Wrong line number", -1, compilationUnit.getLineNumber(source.length)); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=12326
- */
- public void test0315() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0315", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a Return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("Not an InfixExpression expression", expression instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression instanceOfExpression = (InfixExpression) expression;
- Expression rightOperand = instanceOfExpression.getRightOperand();
- assertTrue("Not a SimpleName", rightOperand instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleType = (SimpleName) rightOperand;
- assertTrue("wrong operator",instanceOfExpression.getOperator().equals(InfixExpression.Operator.INSTANCEOF));
-// Name n = simpleType.getName();
-// assertTrue("Not a qualified name", n instanceof QualifiedName); //$NON-NLS-1$
-// QualifiedName name = (QualifiedName) n;
- checkSourceRange(simpleType, "String", source); //$NON-NLS-1$
- ITypeBinding typeBinding = simpleType.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "String", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// Name qualifier = name.getQualifier();
-// assertTrue("Not a qualified name", qualifier instanceof QualifiedName); //$NON-NLS-1$
-// ITypeBinding typeBinding2 = qualifier.resolveTypeBinding();
-// assertNull("typebinding2 is not null", typeBinding2); //$NON-NLS-1$
-// IBinding binding = qualifier.resolveBinding();
-// assertNotNull("no binding", binding); //$NON-NLS-1$
-// assertEquals("Wrong type", IBinding.PACKAGE, binding.getKind()); //$NON-NLS-1$
-// IPackageBinding pBinding = (IPackageBinding) binding;
-// assertEquals("Wrong name", "java.io", pBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=12454
-// */
-// public void test0316() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Hello.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No result", result); //$NON-NLS-1$
-// assertTrue("Not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// assertEquals("Wrong size", 1, compilationUnit.getMessages().length); //$NON-NLS-1$
-// assertEquals("Wrong size", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=12781
- */
- public void test0317() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0317", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a return statement", node instanceof ReturnStatement); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("not an InfixExpression expression", expression instanceof InfixExpression); //$NON-NLS-1$
- InfixExpression instanceOfExpression = (InfixExpression) expression;
- assertTrue("wrong operator",instanceOfExpression.getOperator().equals(InfixExpression.Operator.INSTANCEOF));
- Expression left = instanceOfExpression.getLeftOperand();
- assertTrue("Not a Name", left instanceof Name); //$NON-NLS-1$
- Name name = (Name) left;
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", "x", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding = name.resolveTypeBinding();
- assertNotNull("No typebinding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong type", "any", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Expression right = instanceOfExpression.getRightOperand();
- assertTrue("Not a simpleName", right instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleType = (SimpleName) right;
- name = simpleType;//.getName();
- assertTrue("Not a simpleName", name instanceof SimpleName); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- IBinding binding2 = simpleName.resolveBinding();
- assertNotNull("No binding2", binding2); //$NON-NLS-1$
- assertEquals("Wrong name", "Boolean", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
- assertNotNull("No typeBinding2", typeBinding2); //$NON-NLS-1$
- assertEquals("Wrong name", "Boolean", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13233
- */
- public void test0318() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0318", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("No error", 1, unit.getMessages().length); //$NON-NLS-1$
- assertEquals("No error", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0319() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0319", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an array creation", expression instanceof ArrayInitializer); //$NON-NLS-1$
- ArrayInitializer arrayCreation = (ArrayInitializer) expression;
- ITypeBinding typeBinding = arrayCreation.resolveTypeBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "any[]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// ArrayType arrayType = arrayCreation.getType();
-// ITypeBinding typeBinding2 = arrayType.resolveBinding();
-// assertNotNull("no type binding2", typeBinding2); //$NON-NLS-1$
-// assertEquals("wrong name", "Object[]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// Type type = arrayType.getElementType();
-// assertTrue("Not a simple type", type instanceof SimpleType); //$NON-NLS-1$
-// SimpleType simpleType = (SimpleType) type;
-// ITypeBinding typeBinding3 = simpleType.resolveBinding();
-// assertNotNull("no type binding3", typeBinding3); //$NON-NLS-1$
-// assertEquals("wrong name", "Object", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
- */
- public void test0320() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0320", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
-
-
- IVariableBinding binding = variableDeclarationFragment.resolveBinding();
- ITypeBinding typeBinding = binding.getType();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "Number[]", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-
-// Type type = variableDeclarationStatement.getType();
-// checkSourceRange(type, "int[]", source); //$NON-NLS-1$
-// assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
-// ArrayType arrayType = (ArrayType) type;
-// ITypeBinding typeBinding = arrayType.resolveBinding();
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// Type elementType = arrayType.getElementType();
-// assertTrue("Not a simple type", elementType.isPrimitiveType()); //$NON-NLS-1$
-// ITypeBinding typeBinding2 = elementType.resolveBinding();
-// assertNotNull("No type binding2", typeBinding2); //$NON-NLS-1$
- }
-
-// /**
-// * http://dev.eclipse.org/bugs/show_bug.cgi?id=13807
-// */
-// public void test0321() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0321", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// char[] source = sourceUnit.getSource().toCharArray();
-// ASTNode result = runConversion(sourceUnit, true);
-// assertNotNull("No compilation unit", result); //$NON-NLS-1$
-// assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
-// assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
-// VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
-// Type type = variableDeclarationStatement.getType();
-// assertTrue("Not an array type", type.isArrayType()); //$NON-NLS-1$
-// ArrayType arrayType = (ArrayType) type;
-// ITypeBinding typeBinding = arrayType.resolveBinding();
-// checkSourceRange(type, "java.lang.Object[][]", source); //$NON-NLS-1$
-// assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
-// Type elementType = arrayType.getComponentType();
-// ITypeBinding typeBinding2 = elementType.resolveBinding();
-// assertNotNull("No type binding2", typeBinding2); //$NON-NLS-1$
-// assertEquals("wrong dimension", 1, typeBinding2.getDimensions()); //$NON-NLS-1$
-// assertEquals("wrong name", "Object[]", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// assertTrue("Not an array type", elementType.isArrayType()); //$NON-NLS-1$
-// Type elementType2 = ((ArrayType) elementType).getComponentType();
-// assertTrue("Not a simple type", elementType2.isSimpleType()); //$NON-NLS-1$
-// ITypeBinding typeBinding3 = elementType2.resolveBinding();
-// assertNotNull("No type binding3", typeBinding3); //$NON-NLS-1$
-// assertEquals("wrong dimension", 0, typeBinding3.getDimensions()); //$NON-NLS-1$
-// assertEquals("wrong name", "Object", typeBinding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=13231
- */
- public void test0322() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0322", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertTrue("Not a VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a null literal", expression instanceof NullLiteral); //$NON-NLS-1$
- NullLiteral nullLiteral = (NullLiteral) expression;
- ITypeBinding typeBinding = nullLiteral.resolveTypeBinding();
- assertNotNull("no type binding", typeBinding); //$NON-NLS-1$
- assertTrue("Not the null type", typeBinding.isNullType()); //$NON-NLS-1$
- assertEquals("Wrong qualified name", typeBinding.getQualifiedName(), "null"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14198
- */
- public void test0323() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0323", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression2 = expressionStatement.getExpression();
- assertTrue("Not an Assignement", expression2 instanceof Assignment); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14217
- */
- public void test0326() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0326", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- char[] source = sourceUnit.getSource().toCharArray();
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- checkSourceRange(expressionStatement.getExpression(), "a().f= a()", source); //$NON-NLS-1$
- checkSourceRange(expressionStatement, "a().f= a();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14322
- */
- public void test0331() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0331", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertTrue("Not an VariableDeclarationStatement", node instanceof VariableDeclarationStatement); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a QualifiedName", expression instanceof QualifiedName); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expression;
- IBinding binding = qualifiedName.getName().resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind()); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertTrue("Not a field", variableBinding.isField()); //$NON-NLS-1$
- assertNull("Got a declaring class", variableBinding.getDeclaringClass()); //$NON-NLS-1$
- assertEquals("wrong name", "length", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=15061
- */
- public void test0339() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0339", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No errors found", 3, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a Type declaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size()); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclarations.get(0);
- checkSourceRange(methodDeclaration, "function doQuery(boolean x);", source); //$NON-NLS-1$
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a FunctionDeclaration", node instanceof FunctionDeclaration); //$NON-NLS-1$
- String expectedSource =
- "function setX( x) {\n" + //$NON-NLS-1$
- " {\n" + //$NON-NLS-1$
- " z\n" + //$NON-NLS-1$
- " }\n" + //$NON-NLS-1$
- "}"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- int methodEndPosition = node.getStartPosition() + node.getLength();
- node = getASTNode(compilationUnit, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- int typeEndPosition = node.getStartPosition() + node.getLength();
- assertEquals("different positions", methodEndPosition, typeEndPosition); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=14852
- */
- public void test0340() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "p3", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not an method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertNotNull("No receiver", expression2); //$NON-NLS-1$
- ITypeBinding binding = expression2.resolveTypeBinding();
- assertNotNull("No type binding", binding); //$NON-NLS-1$
- assertEquals("wrong name", "A", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong name", "p2", binding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Not a qualified name", expression2.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) expression2;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "A", simpleName.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding = simpleName.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "A", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong name", "p2", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- Name name = qualifiedName.getQualifier();
- assertTrue("Not a simple name", name.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName2 = (SimpleName) name;
- assertEquals("wrong name", "p2", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("No binding", binding2); //$NON-NLS-1$
- assertEquals("wrong type", IBinding.PACKAGE, binding2.getKind()); //$NON-NLS-1$
- assertEquals("wrong name", "p2", binding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) node;
- Expression expression3 = expressionStatement2.getExpression();
- assertTrue("Not an method invocation", expression3.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression3;
- Expression expression4 = methodInvocation2.getExpression();
- assertNotNull("No receiver", expression4); //$NON-NLS-1$
- ITypeBinding binding3 = expression4.resolveTypeBinding();
- assertNotNull("No type binding", binding3); //$NON-NLS-1$
- assertEquals("wrong name", "A", binding3.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong name", "p1", binding3.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=15804
- */
- public void test0341() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0341", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an if statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- String expectedSource =
- "if (field != null) {\n" + //$NON-NLS-1$
- " throw new IOException();\n" + //$NON-NLS-1$
- " } else if (field == null) {\n" + //$NON-NLS-1$
- " throw new MalformedURLException();\n" + //$NON-NLS-1$
- " } else if (field == null) {\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " } else {\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- IfStatement ifStatement = (IfStatement) node;
- Statement thenStatement = ifStatement.getThenStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new IOException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(thenStatement, expectedSource, source);
- Statement elseStatement = ifStatement.getElseStatement();
- expectedSource =
- "if (field == null) {\n" + //$NON-NLS-1$
- " throw new MalformedURLException();\n" + //$NON-NLS-1$
- " } else if (field == null) {\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " } else {\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(elseStatement, expectedSource, source);
- assertTrue("Not a if statement", elseStatement.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- ifStatement = (IfStatement) elseStatement;
- thenStatement = ifStatement.getThenStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new MalformedURLException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(thenStatement, expectedSource, source);
- elseStatement = ifStatement.getElseStatement();
- expectedSource =
- "if (field == null) {\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " } else {\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(elseStatement, expectedSource, source);
- assertTrue("Not a if statement", elseStatement.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- ifStatement = (IfStatement) elseStatement;
- thenStatement = ifStatement.getThenStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new InterruptedIOException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(thenStatement, expectedSource, source);
- elseStatement = ifStatement.getElseStatement();
- expectedSource =
- "{\n" + //$NON-NLS-1$
- " throw new UnsupportedEncodingException();\n" + //$NON-NLS-1$
- " }"; //$NON-NLS-1$
- checkSourceRange(elseStatement, expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=16051
- */
- public void test0343() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0343", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an if statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- String expectedSource =
- "if (flag)\n" + //$NON-NLS-1$
- " i= 10;"; //$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=17922
- */
- public void test0345() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0345", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an ArrayCreation", expression.getNodeType() == ASTNode.ARRAY_CREATION); //$NON-NLS-1$
- ArrayCreation arrayCreation = (ArrayCreation) expression;
- ArrayType arrayType = arrayCreation.getType();
- IBinding binding2 = arrayType.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertEquals("not a type", binding2.getKind(), IBinding.TYPE); //$NON-NLS-1$
- ITypeBinding typeBinding2 = (ITypeBinding) binding2;
- assertTrue("Not an array type binding2", typeBinding2.isArray()); //$NON-NLS-1$
- Type type = arrayType.getElementType();
- assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("QualifiedName", name.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- SimpleName simpleName = ((QualifiedName) name).getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("no binding", binding); //$NON-NLS-1$
- assertEquals("not a type", binding.getKind(), IBinding.TYPE); //$NON-NLS-1$
- ITypeBinding typeBinding = (ITypeBinding) binding;
- assertTrue("An array type binding", !typeBinding.isArray()); //$NON-NLS-1$
- Type type2 = fieldDeclaration.getType();
- assertTrue("Not a array type", type2.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType2 = (ArrayType) type2;
- Type type3 = arrayType2.getElementType();
- assertTrue("Not a simple type", type3.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType2 = (SimpleType) type3;
- Name name2 = simpleType2.getName();
- assertTrue("Not a qualified name", name2.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- SimpleName simpleName2 = ((QualifiedName) name2).getName();
- IBinding binding3 = simpleName2.resolveBinding();
- assertNotNull("no binding", binding3); //$NON-NLS-1$
- assertEquals("not a type", binding3.getKind(), IBinding.TYPE); //$NON-NLS-1$
- ITypeBinding typeBinding3 = (ITypeBinding) binding3;
- assertTrue("An array type binding", !typeBinding3.isArray()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0346() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0346", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Vector", source); //$NON-NLS-1$
- assertTrue("not an array type", !type.isArrayType()); //$NON-NLS-1$
- assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("Not a simpleName", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- ITypeBinding typeBinding = (ITypeBinding) binding;
- assertTrue("An array", !typeBinding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- ITypeBinding typeBinding2 = simpleType.resolveBinding();
- assertNotNull("No binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, typeBinding2.getKind()); //$NON-NLS-1$
- assertTrue("An array", !typeBinding2.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0347() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0347", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Vector[]", source); //$NON-NLS-1$
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding binding = arrayType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not an array type", binding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector[]", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0348() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0348", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "Vector[][]", source); //$NON-NLS-1$
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding binding = arrayType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not an array type", binding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector[][]", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0349() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0349", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Vector[][]", source); //$NON-NLS-1$
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- ITypeBinding binding = arrayType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not an array type", binding.isArray()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector[][]", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18138
- */
- public void test0350() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0350", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- VariableDeclarationStatement fieldDeclaration = (VariableDeclarationStatement) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Vector", source); //$NON-NLS-1$
- assertTrue("not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- ITypeBinding binding = simpleType.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("An array type", binding.isClass()); //$NON-NLS-1$
- assertEquals("Wrong name", "Vector", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18169
- */
- public void test0351() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0351", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "var a", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "var b", source); //$NON-NLS-1$
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "var a", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "var b", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18169
- */
- public void test0352() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0352", "Test2.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "var a", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "var b", source); //$NON-NLS-1$
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- parameters = methodDeclaration.parameters();
- assertEquals("wrong size", 2, parameters.size()); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(singleVariableDeclaration, "vara", source); //$NON-NLS-1$
- singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(1);
- checkSourceRange(singleVariableDeclaration, "var b", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=18042
- */
- public void test0353() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0353", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("not null", node); //$NON-NLS-1$
- assertTrue("Not an variable declaration", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- checkSourceRange(type, "InputStream", source); //$NON-NLS-1$
- assertTrue("not a simple type", type.isSimpleType()); //$NON-NLS-1$
- ITypeBinding binding = type.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind()); //$NON-NLS-1$
- assertTrue("Not a class", binding.isClass()); //$NON-NLS-1$
- assertEquals("Wrong name", "InputStream", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "java.io", binding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- IBinding binding2 = name.resolveBinding();
- assertNotNull("No binding", binding2); //$NON-NLS-1$
- assertEquals("Wrong type", IBinding.TYPE, binding2.getKind()); //$NON-NLS-1$
- ITypeBinding typeBinding = (ITypeBinding) binding2;
- assertTrue("Not a class", typeBinding.isClass()); //$NON-NLS-1$
- assertEquals("Wrong name", "InputStream", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "java.io", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=19851
- */
- public void test0354() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0354", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 2, compilationUnit.getMessages().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=20520
- */
- public void test0355() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0355", "Foo.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not an if statement", node.getNodeType() == ASTNode.IF_STATEMENT); //$NON-NLS-1$
- IfStatement ifStatement = (IfStatement) node;
- Expression condition = ifStatement.getExpression();
- assertTrue("Not an infixExpression", condition.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) condition;
- Expression expression = infixExpression.getLeftOperand();
- assertTrue("Not a method invocation expression", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a parenthesis expression", expression2.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=20865
- */
- public void test0356() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0356", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 1, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- Type type = variableDeclarationStatement.getType();
- ITypeBinding binding = type.resolveBinding();
- assertNotNull("Binding should NOT be null for type: "+type, binding);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21757
- */
- public void test0357() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0357", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration statement", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- SimpleName name = typeDeclaration.getName();
- checkSourceRange(name, "A", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21768
- */
- public void test0358() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0358", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0);
- assertNotNull(node);
- assertTrue("Not a method declaration statement", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName name = methodDeclaration.getName();
- checkSourceRange(name, "mdd", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21768
- */
- public void test0359() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0359", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0);
- assertNotNull(node);
- assertTrue("Not a method declaration statement", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName name = methodDeclaration.getName();
- checkSourceRange(name, "mdd", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21916
- */
- public void test0360() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0360", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("Wrong size", 1, initializers.size()); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21916
- */
- public void test0361() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0361", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0,0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("Wrong size", 1, initializers.size()); //$NON-NLS-1$
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=21916
- * @deprecated using deprecated code
- */
- public void test0362() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0362", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- ForStatement forStatement = this.ast.newForStatement();
-
- VariableDeclarationFragment iFragment = this.ast.newVariableDeclarationFragment();
- iFragment.setName(this.ast.newSimpleName("i")); //$NON-NLS-1$
- iFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationFragment jFragment = this.ast.newVariableDeclarationFragment();
- jFragment.setName(this.ast.newSimpleName("j")); //$NON-NLS-1$
- jFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
- VariableDeclarationFragment kFragment = this.ast.newVariableDeclarationFragment();
- kFragment.setName(this.ast.newSimpleName("k")); //$NON-NLS-1$
- kFragment.setInitializer(this.ast.newNumberLiteral("0"));//$NON-NLS-1$
-
- VariableDeclarationExpression variableDeclarationExpression = this.ast.newVariableDeclarationExpression(iFragment);
- variableDeclarationExpression.setModifiers(Modifier.NONE);
-// variableDeclarationExpression.setType(this.ast.newPrimitiveType(PrimitiveType.INT));
- variableDeclarationExpression.fragments().add(jFragment);
- variableDeclarationExpression.fragments().add(kFragment);
- forStatement.initializers().add(variableDeclarationExpression);
-
- PostfixExpression iPostfixExpression = this.ast.newPostfixExpression();
- iPostfixExpression.setOperand(this.ast.newSimpleName("i"));//$NON-NLS-1$
- iPostfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(iPostfixExpression);
-
- PostfixExpression jPostfixExpression = this.ast.newPostfixExpression();
- jPostfixExpression.setOperand(this.ast.newSimpleName("j"));//$NON-NLS-1$
- jPostfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(jPostfixExpression);
-
- PostfixExpression kPostfixExpression = this.ast.newPostfixExpression();
- kPostfixExpression.setOperand(this.ast.newSimpleName("k"));//$NON-NLS-1$
- kPostfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
- forStatement.updaters().add(kPostfixExpression);
-
- forStatement.setBody(this.ast.newBlock());
-
- InfixExpression infixExpression = this.ast.newInfixExpression();
- infixExpression.setLeftOperand(this.ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.LESS);
- infixExpression.setRightOperand(this.ast.newNumberLiteral("10")); //$NON-NLS-1$
- forStatement.setExpression(infixExpression);
-
- assertTrue("Both AST trees should be identical", forStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- checkSourceRange(node, "for (var i=0, j=0, k=0; i<10 ; i++, j++, k++) {}", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22939
- */
- public void test0363() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0363", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 1);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not a parenthesized expression", expression.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION); //$NON-NLS-1$
- Expression expression2 = ((ParenthesizedExpression) expression).getExpression();
- checkSourceRange(expression2, "xxxx", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11529
- */
- public void test0364() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0364", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- checkSourceRange(variableDeclarationStatement, "var local;", source); //$NON-NLS-1$
- SimpleName simpleName = variableDeclarationFragment.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=11529
- */
- public void test0365() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0365", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("Wrong size", 1, initializers.size()); //$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) initializers.get(0);
- List fragments = variableDeclarationExpression.fragments();
- assertEquals("Wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) fragments.get(0);
- SimpleName simpleName = variableDeclarationFragment.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0366() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0366", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- checkSourceRange(forStatement, "for (var i = 0; i < 5; ++i);", source); //$NON-NLS-1$
- Statement statement = forStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0367() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0367", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("errors found", 0, compilationUnit.getMessages().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a while statement", node.getNodeType() == ASTNode.WHILE_STATEMENT); //$NON-NLS-1$
- WhileStatement whileStatement = (WhileStatement) node;
- checkSourceRange(whileStatement, "while(i == 2);", source); //$NON-NLS-1$
- Statement statement = whileStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0368() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0368", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertProblemsSize(compilationUnit, 1, "The label test is never explicitly referenced"); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a labeled statement", node.getNodeType() == ASTNode.LABELED_STATEMENT); //$NON-NLS-1$
- LabeledStatement labeledStatement = (LabeledStatement) node;
- checkSourceRange(labeledStatement, "test:;", source); //$NON-NLS-1$
- Statement statement = labeledStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23048
- */
- public void test0369() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0369", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertProblemsSize(compilationUnit, 1, "The label test is never explicitly referenced"); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a labeled statement", node.getNodeType() == ASTNode.LABELED_STATEMENT); //$NON-NLS-1$
- LabeledStatement labeledStatement = (LabeledStatement) node;
- checkSourceRange(labeledStatement, "test:\\u003B", source); //$NON-NLS-1$
- Statement statement = labeledStatement.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, "\\u003B", source); //$NON-NLS-1$
- }
-
- /**
- * DoStatement ==> DoStatement
- */
- public void test0370() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0370", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull("Expression should not be null", node); //$NON-NLS-1$
- DoStatement doStatement = this.ast.newDoStatement();
- doStatement.setBody(this.ast.newEmptyStatement());
- doStatement.setExpression(this.ast.newBooleanLiteral(true));
- assertTrue("Both AST trees should be identical", doStatement.subtreeMatch(new ASTMatcher(), node)); //$NON-NLS-1$
- String expectedSource = "do ; while(true);";//$NON-NLS-1$
- checkSourceRange(node, expectedSource, source);
- DoStatement doStatement2 = (DoStatement) node;
- Statement statement = doStatement2.getBody();
- assertTrue("Not an empty statement", statement.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- checkSourceRange(statement, ";", source); //$NON-NLS-1$
- }
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java
deleted file mode 100644
index 69fd0b4..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java
+++ /dev/null
@@ -1,5418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.*;
-import org.eclipse.wst.jsdt.core.tests.model.CancelCounter;
-import org.eclipse.wst.jsdt.core.tests.model.Canceler;
-import org.eclipse.wst.jsdt.core.tests.model.ReconcilerTests;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-public class ASTConverterTest2 extends ConverterTestSetup {
-
- /** @deprecated using deprecated code */
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS2);
- }
-
- public ASTConverterTest2(String name) {
- super(name);
- }
-
- static {
-// TESTS_NAMES = new String[] {"test0578"};
-// TESTS_NUMBERS = new int[] { 606 };
- }
- public static Test suite() {
- return buildModelTestSuite(ASTConverterTest2.class);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22560
- * @deprecated using deprecated code
- */
- public void test0401() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0401", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a return statement", statement.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) statement;
- Expression expression = returnStatement.getExpression();
- assertNotNull("there is no expression", expression); //$NON-NLS-1$
- // call the default initialization
- methodDeclaration.getReturnType();
- ITypeBinding typeBinding = expression.resolveTypeBinding();
- assertNotNull("No typebinding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23464
- */
- public void test0402() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0402", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 0);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not a super method invocation", node.getNodeType() == ASTNode.SUPER_CONSTRUCTOR_INVOCATION); //$NON-NLS-1$
- checkSourceRange(node, "new A().super();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0403() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0403", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "test", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IFunctionBinding methodBinding2 = methodInvocation.resolveMethodBinding();
- assertNotNull("No method binding2", methodBinding2);
- assertTrue("Wrong binding", methodBinding == methodBinding2);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0404() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0404", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0405() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0405", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0406() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0406", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "foo", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "foo", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertNull("Got a declaring node in the unit", unit.findDeclaringNode(methodBinding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23162
- */
- public void test0407() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0407", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName simpleName = methodDeclaration.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("Not a method binding", binding.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding;
- assertEquals("wrong name", "foo", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- methodDeclaration.setName(methodDeclaration.getAST().newSimpleName("foo2")); //$NON-NLS-1$
- IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding();
- assertNotNull("No methodbinding2", methodBinding2); //$NON-NLS-1$
- assertEquals("wrong name", "foo", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- simpleName = methodDeclaration.getName();
- IBinding binding2 = simpleName.resolveBinding();
- assertNull("Got a binding2", binding2); //$NON-NLS-1$
-
- ASTNode astNode = unit.findDeclaringNode(methodBinding);
- assertNotNull("No declaring node", astNode);
- assertEquals("wrong declaring node", methodDeclaration, astNode);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23162
- * @deprecated using deprecated code
- */
- public void test0408() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0408", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType();
- assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("Not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) name;
- name = qualifiedName.getQualifier();
- assertTrue("Not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- qualifiedName = (QualifiedName) name;
- name = qualifiedName.getQualifier();
- assertTrue("Not a simple name", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("Not a package binding", binding.getKind() == IBinding.PACKAGE); //$NON-NLS-1$
- assertEquals("Wrong name", "java", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23162
- */
- public void test0409() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0409", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertProblemsSize(compilationUnit, 0);
- BindingsCollectorVisitor bindingsCollectorVisitor = new BindingsCollectorVisitor();
- compilationUnit.accept(bindingsCollectorVisitor);
- assertEquals("wrong number", 3, bindingsCollectorVisitor.getUnresolvedNodesSet().size()); //$NON-NLS-1$
- Map bindingsMap = bindingsCollectorVisitor.getBindingsMap();
- assertEquals("wrong number", 205, bindingsMap.size()); //$NON-NLS-1$
- ASTNodesCollectorVisitor nodesCollector = new ASTNodesCollectorVisitor();
- compilationUnit.accept(nodesCollector);
- Set detachedNodes = nodesCollector.getDetachedAstNodes();
- int counter = 0;
- for (Iterator iterator = detachedNodes.iterator(); iterator.hasNext(); ) {
- ASTNode detachedNode = (ASTNode) iterator.next();
- counter++;
- IBinding binding = (IBinding) bindingsMap.get(detachedNode);
- assertNotNull(binding);
- switch(detachedNode.getNodeType()) {
- case ASTNode.ARRAY_ACCESS :
- case ASTNode.ARRAY_CREATION :
- case ASTNode.ARRAY_INITIALIZER :
- case ASTNode.ASSIGNMENT :
- case ASTNode.BOOLEAN_LITERAL :
- case ASTNode.CHARACTER_LITERAL :
- case ASTNode.CLASS_INSTANCE_CREATION :
- case ASTNode.CONDITIONAL_EXPRESSION :
- case ASTNode.FIELD_ACCESS :
- case ASTNode.INFIX_EXPRESSION :
- case ASTNode.INSTANCEOF_EXPRESSION :
- case ASTNode.FUNCTION_INVOCATION :
- case ASTNode.NULL_LITERAL :
- case ASTNode.NUMBER_LITERAL :
- case ASTNode.POSTFIX_EXPRESSION :
- case ASTNode.PREFIX_EXPRESSION :
- case ASTNode.THIS_EXPRESSION :
- case ASTNode.TYPE_LITERAL :
- case ASTNode.VARIABLE_DECLARATION_EXPRESSION :
- ITypeBinding typeBinding = ((Expression) detachedNode).resolveTypeBinding();
- if (!binding.equals(typeBinding)) {
- System.out.println(detachedNode);
- }
- assertTrue("binding not equals", binding.equals(typeBinding)); //$NON-NLS-1$
- break;
- case ASTNode.VARIABLE_DECLARATION_FRAGMENT :
- assertTrue("binding not equals", binding.equals(((VariableDeclarationFragment) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.ANONYMOUS_CLASS_DECLARATION :
- assertTrue("binding not equals", binding.equals(((AnonymousClassDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.QUALIFIED_NAME :
- case ASTNode.SIMPLE_NAME :
- IBinding newBinding = ((Name) detachedNode).resolveBinding();
- assertTrue("binding not equals", binding.equals(newBinding)); //$NON-NLS-1$
- break;
- case ASTNode.ARRAY_TYPE :
- case ASTNode.SIMPLE_TYPE :
- case ASTNode.PRIMITIVE_TYPE :
- assertTrue("binding not equals", binding.equals(((Type) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.CONSTRUCTOR_INVOCATION :
- assertTrue("binding not equals", binding.equals(((ConstructorInvocation) detachedNode).resolveConstructorBinding())); //$NON-NLS-1$
- break;
- case ASTNode.IMPORT_DECLARATION :
- assertTrue("binding not equals", binding.equals(((ImportDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.FUNCTION_DECLARATION :
- assertTrue("binding not equals", binding.equals(((FunctionDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.PACKAGE_DECLARATION :
- assertTrue("binding not equals", binding.equals(((PackageDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.TYPE_DECLARATION :
- assertTrue("binding not equals", binding.equals(((TypeDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- }
- }
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * Test for message on jdt-core-dev
- */
- public void test0410() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0410", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- Expression expression = ((ReturnStatement) node).getExpression();
- assertTrue("Not an infix expression", expression.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression;
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 3, extendedOperands.size()); //$NON-NLS-1$
- }
-
- /**
- * Test for message on jdt-core-dev
- */
- public void test0411() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0411", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- Expression expression = ((ReturnStatement) node).getExpression();
- assertTrue("Not an infix expression", expression.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression;
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 0, extendedOperands.size()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23901
- */
- public void test0412() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0412", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertNotNull("No declaring node", unit.findDeclaringNode(typeBinding)); //$NON-NLS-1$
- Name name = typeDeclaration.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- ASTNode declaringNode = unit.findDeclaringNode(binding);
- assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
- assertEquals("Wrong node", typeDeclaration, declaringNode); //$NON-NLS-1$
- typeBinding = name.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- declaringNode = unit.findDeclaringNode(typeBinding);
- assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
- assertEquals("Wrong node", typeDeclaration, declaringNode); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=20881
- */
- public void test0413() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0413", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List throwsException = methodDeclaration.thrownExceptions();
- assertEquals("wrong size", 2, throwsException.size()); //$NON-NLS-1$
- Name name = (Name) throwsException.get(0);
- IBinding binding = name.resolveBinding();
- assertNull("Got a binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23734
- * @deprecated using deprecated code
- */
- public void test0414() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0414", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType();
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- ASTNode declaringNode = unit.findDeclaringNode(typeBinding);
- assertNull("Got a declaring node", declaringNode); //$NON-NLS-1$
-
- node = getASTNode(unit, 0, 1);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration2 = (FunctionDeclaration) node;
- Type type2 = methodDeclaration2.getReturnType();
- ITypeBinding typeBinding2 = type2.resolveBinding();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- ASTNode declaringNode2 = unit.findDeclaringNode(typeBinding2);
- assertNotNull("No declaring node", declaringNode2); //$NON-NLS-1$
-
- IJavaScriptUnit sourceUnit2 = getCompilationUnit("Converter" , "src", "test0414", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- result = runConversion(sourceUnit2, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit2 = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit2.getProblems().length); //$NON-NLS-1$
- ASTNode declaringNode3 = unit2.findDeclaringNode(typeBinding);
- assertNull("Got a declaring node", declaringNode3); //$NON-NLS-1$
-
- ASTNode declaringNode4 = unit2.findDeclaringNode(typeBinding.getKey());
- assertNotNull("No declaring node", declaringNode4); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24268
- */
- public void test0415() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0415", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a switch statement", node.getNodeType() == ASTNode.SWITCH_STATEMENT); //$NON-NLS-1$
- SwitchStatement switchStatement = (SwitchStatement) node;
- List statements = switchStatement.statements();
- assertEquals("wrong size", statements.size(), 5); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(3);
- assertTrue("not a switch case (default)", statement.getNodeType() == ASTNode.SWITCH_CASE); //$NON-NLS-1$
- SwitchCase defaultCase = (SwitchCase) statement;
- assertTrue("not a default case", defaultCase.isDefault());
- checkSourceRange(defaultCase, "default:", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24324
- */
- public void test0416() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0416", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", fragments.size(), 1);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression init = fragment.getInitializer();
- assertTrue("not a qualified name", init.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) init;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("Wrong name", "CONST", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong modifier", variableBinding.getModifiers(), Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL);
- ASTNode declaringNode = unit.findDeclaringNode(variableBinding);
- assertNotNull("No declaring node", declaringNode);
- assertTrue("not a variable declaration fragment", declaringNode.getNodeType() == ASTNode.VARIABLE_DECLARATION_FRAGMENT);
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) declaringNode;
- FieldDeclaration fieldDeclaration = (FieldDeclaration) variableDeclarationFragment.getParent();
- assertEquals("Wrong modifier", fieldDeclaration.getModifiers(), Modifier.NONE);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24347
- */
- public void test0417() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0417", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertTrue("not a simple type", type.getNodeType() == ASTNode.SIMPLE_TYPE); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("Not a qualified name", name.isQualifiedName());
- QualifiedName qualifiedName = (QualifiedName) name;
- Name qualifier = qualifiedName.getQualifier();
- assertTrue("Not a simple name", qualifier.isSimpleName());
- IBinding binding = qualifier.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24406
- */
- public void test0418() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0418", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertNotNull("No node", node);
- assertTrue("not an expression statement ", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not an method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Name name = methodInvocation.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0419() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0419", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a name", expression2.getNodeType(), ASTNode.SIMPLE_NAME);
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNull(binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0420() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0420", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getRightOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "(2 + 3)", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "2 + 3", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0421() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0421", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "(1 + 2) + 3", source);
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "(1 + 2)", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "1 + 2", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0422() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0422", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "( 1 + 2 ) + 3", source);
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "( 1 + 2 )", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "1 + 2", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0423() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0423", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getRightOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "( 2 + 3 )", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "2 + 3", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0424() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0424", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- assertEquals("Wrong size", 1, infixExpression.extendedOperands().size());
- Expression expression2 = (Expression) infixExpression.extendedOperands().get(0);
- checkSourceRange(expression2, "( 2 + 3 )", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0425() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0425", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- assertEquals("Wrong size", 0, infixExpression.extendedOperands().size());
- Expression expression2 = infixExpression.getRightOperand();
- assertTrue("not an infix expression", expression2.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression2 = (InfixExpression) expression2;
- Expression expression3 = infixExpression2.getRightOperand();
- assertTrue("not a parenthesized expression", expression3.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION); //$NON-NLS-1$
- checkSourceRange(expression3, "( 2 + 3 )", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0426() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0426", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertTrue("not a simple type", type.getNodeType() == ASTNode.SIMPLE_TYPE);
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertNotNull("No name", name);
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0427() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0427", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a super field access", expression2.getNodeType(), ASTNode.SUPER_FIELD_ACCESS);
- SuperFieldAccess superFieldAccess = (SuperFieldAccess) expression2;
- Name name = superFieldAccess.getName();
- assertNotNull("No name", name);
- IBinding binding = name.resolveBinding();
- assertNull("Got a binding", binding);
- assertNull("Got a binding", superFieldAccess.resolveFieldBinding());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0428() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0428", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", expression2.getNodeType(), ASTNode.QUALIFIED_NAME);
- QualifiedName name = (QualifiedName) expression2;
- SimpleName simpleName = name.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- IBinding binding2 = name.resolveBinding();
- assertNotNull("No binding2", binding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0429() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0429", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", expression2.getNodeType(), ASTNode.QUALIFIED_NAME);
- QualifiedName name = (QualifiedName) expression2;
- SimpleName simpleName = name.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- IBinding binding2 = name.resolveBinding();
- assertNotNull("No binding2", binding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24499
- */
- public void test0430() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0430", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertTrue("Not a constructor invocation", node.getNodeType() == ASTNode.CONSTRUCTOR_INVOCATION);
- ConstructorInvocation constructorInvocation = (ConstructorInvocation) node;
- checkSourceRange(constructorInvocation, "this(coo2());", source);
- List arguments = constructorInvocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- Expression expression = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- SimpleName simpleName = methodInvocation.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24500
- */
- public void test0431() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0431", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertTrue("Not a constructor invocation", node.getNodeType() == ASTNode.CONSTRUCTOR_INVOCATION);
- ConstructorInvocation constructorInvocation = (ConstructorInvocation) node;
- List arguments = constructorInvocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- Expression expression = (Expression) arguments.get(0);
- assertTrue("Not a simple name", expression.getNodeType() == ASTNode.SIMPLE_NAME);
- SimpleName simpleName = (SimpleName) expression;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0432() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0432", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, expression2.getNodeType());
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0433() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0433", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a super field access", ASTNode.SUPER_FIELD_ACCESS, expression2.getNodeType());
- SuperFieldAccess superFieldAccess = (SuperFieldAccess) expression2;
- SimpleName simpleName = superFieldAccess.getName();
- assertEquals("wrong name", "fCoo", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Wrong binding", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = superFieldAccess.resolveFieldBinding();
- assertTrue("Different binding", binding == variableBinding);
- ASTNode astNode = unit.findDeclaringNode(variableBinding);
- assertTrue("Wrong type", astNode.getNodeType() == ASTNode.SINGLE_VARIABLE_DECLARATION || astNode.getNodeType() == ASTNode.VARIABLE_DECLARATION_FRAGMENT || astNode.getNodeType() == ASTNode.VARIABLE_DECLARATION_EXPRESSION);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0434() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0434", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression2.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) expression2;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "fCoo", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0435() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0435", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression2.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) expression2;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "fCoo", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24502
- */
- public void test0436() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0436", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 1, "The type A.CInner is not visible"); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertEquals("Not a simple type", ASTNode.SIMPLE_TYPE, type.getNodeType());
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, name.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) name;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "CInner", simpleName.getIdentifier());
- IBinding binding2 = simpleName.resolveBinding();
- assertNotNull("No binding", binding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24502
- */
- public void test0437() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0437", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 1, "The type CInner is not visible"); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertEquals("Not a simple type", ASTNode.SIMPLE_TYPE, type.getNodeType());
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType());
- SimpleName simpleName = (SimpleName) name;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24511
- */
- public void test0438() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0438", "D.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- List imports = unit.imports();
- assertEquals("Wrong size", 1, imports.size()); //$NON-NLS-1$<
- ImportDeclaration importDeclaration = (ImportDeclaration) imports.get(0);
- IBinding binding = importDeclaration.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24502
- */
- public void test0439() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0439", "E.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertEquals("Not a simple type", ASTNode.SIMPLE_TYPE, type.getNodeType());
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24622
- */
- public void test0440() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0440", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- // 2 * 3 + "" + (true)
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "2 * 3 + \"\" + (true)", source);
- Expression leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2 * 3 + \"\"", source);
- checkSourceRange(infixExpression.getRightOperand(), "(true)", source);
- assertEquals("wrong operator", infixExpression.getOperator(), InfixExpression.Operator.PLUS);
- assertEquals("wrong type", ASTNode.INFIX_EXPRESSION, leftOperand.getNodeType());
- infixExpression = (InfixExpression) leftOperand;
- checkSourceRange(infixExpression, "2 * 3 + \"\"", source);
- leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2 * 3", source);
- checkSourceRange(infixExpression.getRightOperand(), "\"\"", source);
- assertEquals("wrong operator", infixExpression.getOperator(), InfixExpression.Operator.PLUS);
- assertEquals("wrong type", ASTNode.INFIX_EXPRESSION, leftOperand.getNodeType());
- infixExpression = (InfixExpression) leftOperand;
- checkSourceRange(infixExpression, "2 * 3", source);
- leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2", source);
- checkSourceRange(infixExpression.getRightOperand(), "3", source);
- assertEquals("wrong operator", infixExpression.getOperator(), InfixExpression.Operator.TIMES);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24622
- */
- public void test0441() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0441", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "(2 + 2) * 3 * 1", source);
- Expression leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "(2 + 2)", source);
- checkSourceRange(infixExpression.getRightOperand(), "3", source);
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 1, extendedOperands.size());
- checkSourceRange((Expression) extendedOperands.get(0), "1", source);
- assertEquals("wrong operator", InfixExpression.Operator.TIMES, infixExpression.getOperator());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24622
- */
- public void test0442() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0442", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "2 + (2 * 3) + 1", source);
- Expression leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2", source);
- Expression rightOperand = infixExpression.getRightOperand();
- checkSourceRange(rightOperand, "(2 * 3)", source);
- assertEquals("wrong type", ASTNode.PARENTHESIZED_EXPRESSION, rightOperand.getNodeType());
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 1, extendedOperands.size());
- checkSourceRange((Expression) extendedOperands.get(0), "1", source);
- assertEquals("wrong operator", InfixExpression.Operator.PLUS, infixExpression.getOperator());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24623
- */
- public void test0443() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0443", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertNotNull("No body", methodDeclaration.getBody());
- assertNotNull("No binding", methodDeclaration.resolveBinding());
- assertTrue("Not an abstract method", Modifier.isAbstract(methodDeclaration.getModifiers()));
- assertTrue("Not malformed", isMalformed(methodDeclaration));
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24623
- */
- public void test0444() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0444", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0);
- assertEquals("Wrong type", ASTNode.TYPE_DECLARATION, node.getNodeType());
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 2, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration)bodyDeclarations.get(0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- assertEquals("Wrong name", "foo", methodDeclaration.getName().getIdentifier());
- assertNull("Got a binding", methodDeclaration.resolveBinding());
- bodyDeclaration = (BodyDeclaration)bodyDeclarations.get(1);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- assertEquals("Wrong name", "foo", ((FunctionDeclaration) bodyDeclaration).getName().getIdentifier());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24773
- */
- public void test0445() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0445", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25018
- */
- public void test0446() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0446", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25124
- */
- public void test0447() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0447", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 3, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25330
- * @deprecated using deprecated code
- */
- public void test0448() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0448", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", node.getNodeType(), ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- ITypeBinding returnTypeBinding = methodDeclaration.getReturnType().resolveBinding();
- assertNotNull("No return type binding", returnTypeBinding);
- Block block = methodDeclaration.getBody();
- assertNotNull("No method body", block);
- assertEquals("wrong size", 0, block.statements().size());
- }
-
- /**
- * Check that the implicit super constructor call is not there
- */
- public void test0449() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0449", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", node.getNodeType(), ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- Block block = methodDeclaration.getBody();
- assertNotNull("No method body", block);
- assertEquals("wrong size", 1, block.statements().size());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=26452
- */
- public void test0450() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0450", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0);
- assertEquals("Not a type declaration", node.getNodeType(), ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("not a toplevel type", typeBinding.isTopLevel());
- assertTrue("a local type", !typeBinding.isLocal());
- assertTrue("an anonymous type", !typeBinding.isAnonymous());
- assertTrue("a member type", !typeBinding.isMember());
- assertTrue("a nested type", !typeBinding.isNested());
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- Expression expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not a class instance creation", expression.getNodeType(), ASTNode.CLASS_INSTANCE_CREATION);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- typeBinding = anonymousClassDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("a toplevel type", !typeBinding.isTopLevel());
- assertTrue("not a local type", typeBinding.isLocal());
- assertTrue("not an anonymous type", typeBinding.isAnonymous());
- assertTrue("a member type", !typeBinding.isMember());
- assertTrue("not a nested type", typeBinding.isNested());
- ASTNode astNode = unit.findDeclaringNode(typeBinding);
- assertEquals("Wrong type", ASTNode.ANONYMOUS_CLASS_DECLARATION, astNode.getNodeType());
- assertNotNull("Didn't get a key", typeBinding.getKey());
- astNode = unit.findDeclaringNode(typeBinding.getKey());
- assertNotNull("Didn't get a declaring node", astNode);
-
- ITypeBinding typeBinding3 = classInstanceCreation.resolveTypeBinding();
- assertEquals("wrong binding", typeBinding, typeBinding3);
-
- List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("wrong size", 2, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("not a type declaration", bodyDeclaration.getNodeType() == ASTNode.TYPE_DECLARATION);
- typeDeclaration = (TypeDeclaration) bodyDeclaration;
-
- bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(1);
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- assertNotNull("No body", block);
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size());
- Statement statement = (Statement) statements.get(1);
- assertEquals("Not a variable declaration statement", statement.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement;
- Type type = variableDeclarationStatement.getType();
- assertNotNull("No type", type);
-
- ITypeBinding typeBinding2 = type.resolveBinding();
- typeBinding = typeDeclaration.resolveBinding();
- assertTrue("not equals", typeBinding == typeBinding2);
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("a toplevel type", !typeBinding.isTopLevel());
- assertTrue("an anonymous type", !typeBinding.isAnonymous());
- assertTrue("not a member type", typeBinding.isMember());
- assertTrue("not a nested type", typeBinding.isNested());
- assertTrue("a local type", !typeBinding.isLocal());
-
- bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("not a type declaration", bodyDeclaration.getNodeType() == ASTNode.TYPE_DECLARATION);
- typeDeclaration = (TypeDeclaration) bodyDeclaration;
- typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("a toplevel type", !typeBinding.isTopLevel());
- assertTrue("an anonymous type", !typeBinding.isAnonymous());
- assertTrue("not a member type", typeBinding.isMember());
- assertTrue("not a nested type", typeBinding.isNested());
- assertTrue("a local type", !typeBinding.isLocal());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24916
- * @deprecated using deprecated code
- */
- public void test0451() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0451", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType();
- checkSourceRange(type, "int", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=27204
- */
- public void test0452() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "NO_WORKING.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName name = methodDeclaration.getName();
- assertEquals("wrong line number", 3, compilationUnit.getLineNumber(name.getStartPosition()));
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=27173
- */
- public void test0453() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0453", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0,0);
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("not a super method invocation", expression.getNodeType() == ASTNode.SUPER_METHOD_INVOCATION); //$NON-NLS-1$
- SuperMethodInvocation methodInvocation = (SuperMethodInvocation) expression;
- IFunctionBinding methodBinding = methodInvocation.resolveMethodBinding();
- assertNotNull("No method binding", methodBinding);
- assertEquals("Wrong binding", "toString", methodBinding.getName());
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28296
- */
- public void test0454() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0454", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0,1);
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- checkSourceRange(expression, "(int) (3.14f * a)", source);
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0455() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0455", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i = 0; i < 10; i++) // for 1\n" +
- " for (int j = 0; j < 10; j++) // for 2\n" +
- " if (true) { }";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int j = 0; j < 10; j++) // for 2\n" +
- " if (true) { }";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = "if (true) { }";
- checkSourceRange(body, expectedSource, source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0456() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0456", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int x= 10; x < 20; x++)\n" +
- " main();";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "main();";
- checkSourceRange(body, expectedSource, source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0457() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0457", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i= 10; i < 10; i++)/*[*/\n"+
- " for (int z= 10; z < 10; z++)\n" +
- " foo();";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int z= 10; z < 10; z++)\n" +
- " foo();";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = "foo();";
- checkSourceRange(body, expectedSource, source);
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0458() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0458", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i= 10; i < 10; i++)/*[*/\n"+
- " for (int z= 10; z < 10; z++)\n" +
- " ;";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int z= 10; z < 10; z++)\n" +
- " ;";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = ";";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not an empty statement", body.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0459() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0459", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i= 10; i < 10; i++)/*[*/\n"+
- " for (int z= 10; z < 10; z++)\n" +
- " { }";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int z= 10; z < 10; z++)\n" +
- " { }";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = "{ }";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a block", body.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28869
- */
- public void test0460() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0460", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertTrue("Has error", compilationUnit.getProblems().length == 0); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("Malformed", !isMalformed(node));
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28824
- */
- public void test0461() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0461", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- char[] source = sourceUnit.getSource().toCharArray();
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertTrue("Has error", compilationUnit.getProblems().length == 0); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("Malformed", !isMalformed(node));
- assertTrue("not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not an assignment", expression.getNodeType() == ASTNode.ASSIGNMENT); //$NON-NLS-1$
- Assignment assignment = (Assignment) expression;
- checkSourceRange(assignment, "z= foo().y.toList()", source);
- Expression expression2 = assignment.getRightHandSide();
- checkSourceRange(expression2, "foo().y.toList()", source);
- assertTrue("not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- checkSourceRange(expression3, "foo().y", source);
- checkSourceRange(methodInvocation.getName(), "toList", source);
- assertTrue("not a field access", expression3.getNodeType() == ASTNode.FIELD_ACCESS);
- FieldAccess fieldAccess = (FieldAccess) expression3;
- checkSourceRange(fieldAccess.getName(), "y", source);
- Expression expression4 = fieldAccess.getExpression();
- checkSourceRange(expression4, "foo()", source);
- assertTrue("not a method invocation", expression4.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression4;
- checkSourceRange(methodInvocation2.getName(), "foo", source);
- assertNull("no null", methodInvocation2.getExpression());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=32338
- */
- public void test0462() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test462.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertTrue("Has error", compilationUnit.getProblems().length == 0); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertNotNull("No node", node);
- assertTrue("not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("Wrong name", "Test462", typeDeclaration.getName().getIdentifier());
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No binding", typeBinding);
- assertEquals("Wrong name", "Test462", typeBinding.getQualifiedName());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33450
- */
- public void test0463() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0463", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a string literal", expression.getNodeType() == ASTNode.STRING_LITERAL); //$NON-NLS-1$
- StringLiteral stringLiteral = (StringLiteral) expression;
- checkSourceRange(stringLiteral, "\"\\012\\015\\u0061\"", source);
- assertEquals("wrong value", "\012\015a", stringLiteral.getLiteralValue());
- assertEquals("wrong value", "\"\\012\\015\\u0061\"", stringLiteral.getEscapedValue());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33039
- */
- public void test0464() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0464", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("No error", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a null literal", expression.getNodeType() == ASTNode.NULL_LITERAL); //$NON-NLS-1$
- NullLiteral nullLiteral = (NullLiteral) expression;
- ITypeBinding typeBinding = nullLiteral.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding);
- assertFalse("A primitive type", typeBinding.isPrimitive());
- assertTrue("Null type", typeBinding.isNullType());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33831
- */
- public void test0465() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0465", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a field access", expression.getNodeType() == ASTNode.FIELD_ACCESS); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) expression;
- Name name = fieldAccess.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "i", variableBinding.getName());
- assertEquals("Wrong type", "int", variableBinding.getType().getName());
- IVariableBinding variableBinding2 = fieldAccess.resolveFieldBinding();
- assertTrue("different binding", variableBinding == variableBinding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33949
- */
- public void test0466() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0466", "Assert.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- checkSourceRange(node, "assert ref != null : message;", source);
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33949
- */
- public void test0467() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0467", "Assert.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- checkSourceRange(node, "assert ref != null : message\\u003B", source);
-
- node = getASTNode(compilationUnit, 0, 0, 1);
- checkSourceRange(node, "assert ref != null\\u003B", source);
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=36772
- */
- public void test0468() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0468", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a field access", expression.getNodeType() == ASTNode.FIELD_ACCESS); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) expression;
- Name name = fieldAccess.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "i", variableBinding.getName());
- assertEquals("Wrong type", "int", variableBinding.getType().getName());
- IVariableBinding variableBinding2 = fieldAccess.resolveFieldBinding();
- assertTrue("different binding", variableBinding == variableBinding2);
-
- node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("No node", node);
- assertEquals("Wrong type", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-
- ASTNode foundNode = compilationUnit.findDeclaringNode(variableBinding);
- assertNotNull("No found node", foundNode);
- assertEquals("wrong node", fragment, foundNode);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=36895
- */
- public void test0469() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "codeManipulation", "bug.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 2, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- ASTNode parent = node.getParent();
- assertNotNull(parent);
- assertTrue("not a block", parent.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=37381
- */
- public void test0470() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0470", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("wrong size", 1, initializers.size());
- Expression initializer = (Expression) initializers.get(0);
- assertTrue("not a variable declaration expression", initializer.getNodeType() == ASTNode.VARIABLE_DECLARATION_EXPRESSION); //$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) initializer;
- List fragments = variableDeclarationExpression.fragments();
- assertEquals("wrong size", 2, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- checkSourceRange(fragment, "i= 0", source);
- fragment = (VariableDeclarationFragment) fragments.get(1);
- checkSourceRange(fragment, "j= goo(3)", source);
- checkSourceRange(variableDeclarationExpression, "int i= 0, j= goo(3)", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=38447
- */
- public void test0471() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0471", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Is a constructor", !methodDeclaration.isConstructor());
- checkSourceRange(methodDeclaration, "private void foo(){", source);
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Is a constructor", !methodDeclaration.isConstructor());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=38447
- */
- public void test0472() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "junit.textui", "ResultPrinter.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 2, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 2);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=38732
- */
- public void test0473() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- newOptions.put(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.ERROR);
- JavaScriptCore.setOptions(newOptions);
-
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0473", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 2, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39259
- */
- public void test0474() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0474", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
- assertEquals("Not a while statement", node.getNodeType(), ASTNode.WHILE_STATEMENT);
- WhileStatement whileStatement = (WhileStatement) node;
- Statement statement = whileStatement.getBody();
- assertEquals("Not a while statement", statement.getNodeType(), ASTNode.WHILE_STATEMENT);
- WhileStatement whileStatement2 = (WhileStatement) statement;
- String expectedSource =
- "while(b())\n" +
- " foo();";
- checkSourceRange(whileStatement2, expectedSource, source);
- Statement statement2 = whileStatement2.getBody();
- checkSourceRange(statement2, "foo();", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39259
- */
- public void test0475() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0475", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
- assertEquals("Not an if statement", node.getNodeType(), ASTNode.IF_STATEMENT);
- IfStatement statement = (IfStatement) node;
- Statement statement2 = statement.getThenStatement();
- assertEquals("Not an if statement", statement2.getNodeType(), ASTNode.IF_STATEMENT);
- IfStatement statement3 = (IfStatement) statement2;
- String expectedSource =
- "if(b())\n" +
- " foo();";
- checkSourceRange(statement3, expectedSource, source);
- Statement statement4 = statement3.getThenStatement();
- checkSourceRange(statement4, "foo();", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39259
- */
- public void test0476() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0476", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
- assertEquals("Not a for statement", node.getNodeType(), ASTNode.FOR_STATEMENT);
- ForStatement statement = (ForStatement) node;
- Statement statement2 = statement.getBody();
- assertEquals("Not a for statement", statement2.getNodeType(), ASTNode.FOR_STATEMENT);
- ForStatement statement3 = (ForStatement) statement2;
- String expectedSource =
- "for(;b();)\n" +
- " foo();";
- checkSourceRange(statement3, expectedSource, source);
- Statement statement4 = statement3.getBody();
- checkSourceRange(statement4, "foo();", source);
- }
-
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39327
- */
- public void test0477() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0477", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
-
- checkSourceRange(node, "this(undef());", source);
- assertEquals("Not a constructor invocation", node.getNodeType(), ASTNode.CONSTRUCTOR_INVOCATION);
- ConstructorInvocation constructorInvocation = (ConstructorInvocation) node;
- List arguments = constructorInvocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- IFunctionBinding binding = constructorInvocation.resolveConstructorBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0478() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0478", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 2, types.length);
- IType type = types[1];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull(methodBinding);
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding2 = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0479() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0479", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 2, types.length);
- IType type = types[1];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNull("No binding", binding); //$NON-NLS-1$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0480() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0480", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0481() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0481", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0482() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0482", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- IFunction[] methods = memberType.getFunctions();
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0483() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0483", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "A", methodDeclaration.getName().getIdentifier());
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- IBinding binding = methodDeclaration.getName().resolveBinding();
- assertNotNull(binding);
- assertEquals("Wrong type", IBinding.METHOD, binding.getKind());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0484() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0482", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0485() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0482", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0486() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0486", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0487() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0487", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 3, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0488() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0488", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IInitializer[] initializers = type.getInitializers();
- assertEquals("wrong size", 2, initializers.length);
- IInitializer init = initializers[1];
- ISourceRange sourceRange = init.getSourceRange();
- ASTNode result = runConversion(sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40804
- */
- public void test0489() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0489", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertNull("Got a type binding", typeDeclaration.resolveBinding());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40804
- */
- public void test0490() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0490", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42647
- */
- public void test0491() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0491", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42647
- */
- public void test0492() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0492", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0493() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0493", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0494() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0494", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[][]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0495() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0495", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- assertEquals("wrong extra dimension", 1, fragment.getExtraDimensions());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0496() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0496", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][][][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[][][]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[][]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0497() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0497", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- */
- public void test0498() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0498", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=45199
- */
- public void test0499() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0499", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 1);
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- Expression expression = ((ExpressionStatement) node).getExpression();
- assertTrue("Not an assignment", expression.getNodeType() == ASTNode.ASSIGNMENT); //$NON-NLS-1$
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getRightHandSide();
- assertTrue("Not an infix expression", expression2.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression2;
- Expression expression3 = infixExpression.getLeftOperand();
- assertTrue("Not a simple name", expression3.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- ITypeBinding binding = expression3.resolveTypeBinding();
- assertNotNull("No binding", binding);
- Expression expression4 = assignment.getLeftHandSide();
- assertTrue("Not a simple name", expression4.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- ITypeBinding binding2 = expression4.resolveTypeBinding();
- assertNotNull("No binding", binding2);
- assertTrue("Should be the same", binding == binding2);
- }
-
- /**
- * Test for bug 45436 fix.
- * When this bug happened, the first assertion was false (2 problems found).
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45436">bug 45436</a>
- * @throws JavaScriptModelException
- */
- public void test0500() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0500", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IJavaScriptProject project = sourceUnit.getJavaScriptProject();
- Map originalOptions = project.getOptions(false);
- try {
- project.setOption(JavaScriptCore.COMPILER_PB_INVALID_JAVADOC, JavaScriptCore.ERROR);
- project.setOption(JavaScriptCore.COMPILER_PB_MISSING_JAVADOC_TAGS, JavaScriptCore.ERROR);
- project.setOption(JavaScriptCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS, JavaScriptCore.ERROR);
- JavaScriptUnit result = (JavaScriptUnit)runConversion(sourceUnit, true);
- IProblem[] problems= result.getProblems();
- assertTrue(problems.length == 1);
- assertEquals("Invalid warning", "Javadoc: Missing tag for parameter a", problems[0].getMessage());
- } finally {
- project.setOptions(originalOptions);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46012
- */
- public void test0501() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0501", "JavaEditor.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull(result);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'i' in initializer
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement)getASTNode(unit, 0, 0, 0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;#0#i", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'j' in 'then' block in initializer
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 0, 1);
- Block block = (Block)ifStatement.getThenStatement();
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) block.statements().get(0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;#0#0#j", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'i' in 'foo()'
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement)getASTNode(unit, 0, 1, 0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;.foo()V#i", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502d() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'j' in 'then' block in 'foo()'
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 1, 1);
- Block block = (Block)ifStatement.getThenStatement();
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) block.statements().get(0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;.foo()V#0#j", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502e() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'j' in 'else' block in 'foo()'
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 1, 1);
- Block block = (Block)ifStatement.getElseStatement();
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) block.statements().get(0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;.foo()V#1#j", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502f() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // first 'new Object(){...}' in 'foo()'
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 2);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$182;", typeBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- * @deprecated using deprecated code
- */
- public void test0502g() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'B' in 'foo()'
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 3);
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$206$B;", typeBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502h() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // second 'new Object(){...}' in 'foo()'
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 4);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$255;", typeBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- * @deprecated using deprecated code
- */
- public void test0502i() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'field' in 'B' in 'foo()'
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 3);
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- FieldDeclaration fieldDeclaration = typeDeclaration.getFields()[0];
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fieldDeclaration.fragments().get(0);
- IVariableBinding fieldBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$206$B;.field)I", fieldBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- * @deprecated using deprecated code
- */
- public void test0502j() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // 'bar()' in 'B' in 'foo()'
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 3);
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- FunctionDeclaration methodDeclaration = typeDeclaration.getMethods()[0];
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$206$B;.bar()V", methodBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // top level type A
- TypeDeclaration type = (TypeDeclaration)getASTNode(unit, 0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // member type B in A
- TypeDeclaration type = (TypeDeclaration)getASTNode(unit, 0, 0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$B", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- * @deprecated using deprecated code
- */
- public void test0503c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // local type E in foo() in A
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 0);
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1$E", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503d() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // anonymous type new Object() {...} in foo() in A
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$2", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503e() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // type F in anonymous type new Object() {...} in foo() in A
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- TypeDeclaration type = (TypeDeclaration) anonymousClassDeclaration.bodyDeclarations().get(0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$2$F", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- * @deprecated using deprecated code
- */
- public void test0503f() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // local type C in bar() in B in A
- FunctionDeclaration method = (FunctionDeclaration) getASTNode(unit, 0, 0, 0);
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) method.getBody().statements().get(0);
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1$C", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503g() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // anonymous type new Object() {...} in bar() in B in A
- FunctionDeclaration method = (FunctionDeclaration) getASTNode(unit, 0, 0, 0);
- ExpressionStatement expressionStatement = (ExpressionStatement) method.getBody().statements().get(1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503h() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // type D in anonymous type new Object() {...} in bar() in B in A
- FunctionDeclaration method = (FunctionDeclaration) getASTNode(unit, 0, 0, 0);
- ExpressionStatement expressionStatement = (ExpressionStatement) method.getBody().statements().get(1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- TypeDeclaration type = (TypeDeclaration) anonymousClassDeclaration.bodyDeclarations().get(0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1$D", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- * @deprecated using deprecated code
- */
- public void test0503i() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(sourceUnit, true);
-
- // unreachable type G in foo() in A
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 1, 2);
- Block block = (Block)ifStatement.getThenStatement();
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) block.statements().get(0);
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", null, typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=47396
- */
- public void test0504() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0504", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0);
- assertNotNull(node);
- assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- assertTrue("A constructor", !declaration.isConstructor());
- checkSourceRange(declaration, "public method(final int parameter);", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=47396
- */
- public void test0505() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0505", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0);
- assertNotNull(node);
- assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- assertTrue("A constructor", !declaration.isConstructor());
- checkSourceRange(declaration, "public method(final int parameter) { }", source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0506() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0506", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0507() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0507", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0508() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0508", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("not a default constructor", !binding.isDefaultConstructor());
- assertNotNull("Has no declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0509() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0509", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("not a default constructor", !binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0510() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0510", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertFalse("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0511() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0511", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertFalse("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=47326
- */
- public void test0512() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0512", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", declaration.isConstructor());
- checkSourceRange(declaration, "public A();", source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=49429
- */
- public void test0513() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0513", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48502
- */
- public void test0514() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0514", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=49204
- */
- public void test0515() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0515", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a if statement", node.getNodeType() == ASTNode.IF_STATEMENT);
- IfStatement ifStatement = (IfStatement) node;
- assertTrue("not an empty statement", ifStatement.getThenStatement().getNodeType() == ASTNode.EMPTY_STATEMENT);
- checkSourceRange(ifStatement.getThenStatement(), ";", source);
- Statement statement = ifStatement.getElseStatement();
- assertTrue("not a if statement", statement.getNodeType() == ASTNode.IF_STATEMENT);
- ifStatement = (IfStatement) statement;
- assertTrue("not an empty statement", ifStatement.getThenStatement().getNodeType() == ASTNode.EMPTY_STATEMENT);
- checkSourceRange(ifStatement.getThenStatement(), ";", source);
- Statement statement2 = ifStatement.getElseStatement();
- assertTrue("not an empty statement", statement2.getNodeType() == ASTNode.EMPTY_STATEMENT);
- checkSourceRange(statement2, ";", source);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0516() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0516", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a type declaration", result2.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) result2;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue(declaration.subtreeMatch(new ASTMatcher(), bodyDeclaration));
- ASTNode root = bodyDeclaration.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 3, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0517() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0517", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No comments", unit.getCommentList());
- assertEquals("Wrong size", 3, unit.getCommentList().size());
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
- FieldDeclaration declaration = (FieldDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a type declaration", result2.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) result2;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue(declaration.subtreeMatch(new ASTMatcher(), bodyDeclaration));
- ASTNode root = bodyDeclaration.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 2, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0518() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0518", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not an initializer", node.getNodeType() == ASTNode.INITIALIZER);
- Initializer declaration = (Initializer) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a type declaration", result2.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) result2;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue(declaration.subtreeMatch(new ASTMatcher(), bodyDeclaration));
- ASTNode root = bodyDeclaration.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 3, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0519() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0519", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No comments", unit.getCommentList());
- assertEquals("Wrong size", 2, unit.getCommentList().size());
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- ASTNode statement = node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_STATEMENTS);
- parser.setSource(source);
- parser.setSourceRange(statement.getStartPosition(), statement.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a block", result2.getNodeType() == ASTNode.BLOCK);
- Block block = (Block) result2;
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertTrue(statement.subtreeMatch(new ASTMatcher(), statement2));
- ASTNode root = statement2.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 1, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0520() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0520", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No comments", unit.getCommentList());
- assertEquals("Wrong size", 2, unit.getCommentList().size());
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a block", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_EXPRESSION);
- parser.setSource(source);
- parser.setSourceRange(expression.getStartPosition(), expression.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a method invocation", result2.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- assertTrue(expression.subtreeMatch(new ASTMatcher(), result2));
- ASTNode root = result2.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 1, compilationUnit.getCommentList().size());
- }
- /**
- * Ensure an OperationCanceledException is correcly thrown when progress monitor is canceled
- * @deprecated using deprecated code
- */
- public void test0521() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0521", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- // count the number of time isCanceled() is called when converting this source unit
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- CancelCounter counter = new CancelCounter();
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setSource(sourceUnit);
- parser.setResolveBindings(true);
- parser.setWorkingCopyOwner(owner);
- parser.createAST(counter);
-
- // throw an OperatonCanceledException at each point isCanceled() is called
- for (int i = 0; i < counter.count; i++) {
- boolean gotException = false;
- try {
- parser = ASTParser.newParser(AST.JLS2);
- parser.setSource(sourceUnit);
- parser.setResolveBindings(true);
- parser.setWorkingCopyOwner(owner);
- parser.createAST(new Canceler(i));
- } catch (OperationCanceledException e) {
- gotException = true;
- }
- assertTrue("Should get an OperationCanceledException (" + i + ")", gotException);
- }
-
- // last should not throw an OperationCanceledException
- parser = ASTParser.newParser(AST.JLS2);
- parser.setSource(sourceUnit);
- parser.setResolveBindings(true);
- parser.setWorkingCopyOwner(owner);
- parser.createAST(new Canceler(counter.count));
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0522() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0522", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull(methodBinding);
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding2 = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0523() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0523", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNull("No binding", binding); //$NON-NLS-1$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0524() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0524", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0525() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0525", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0526() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0526", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- IFunction[] methods = memberType.getFunctions();
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0527() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0527", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "A", methodDeclaration.getName().getIdentifier());
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- IBinding binding = methodDeclaration.getName().resolveBinding();
- assertNotNull(binding);
- assertEquals("Wrong type", IBinding.METHOD, binding.getKind());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0528() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0528", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0529() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0529", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0530() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0530", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 3, methods.length);
- IFunction method = methods[2];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0531() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0531", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 5, methods.length);
- IFunction method = methods[3];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0532() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0488", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IInitializer[] initializers = type.getInitializers();
- assertEquals("wrong size", 2, initializers.length);
- IInitializer init = initializers[1];
- ISourceRange sourceRange = init.getSourceRange();
- int position = sourceRange.getOffset() + sourceRange.getLength() / 2;
-
- IClassFile classFile = getClassFile("Converter" , "bins", "test0532", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- type = classFile.getType();
- initializers = type.getInitializers();
- assertEquals("wrong size", 0, initializers.length);
- ASTNode result = runConversion(classFile, position, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0533() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0533", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a compilation unit", result2.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result2;
- assertEquals("wrong problem size", 1, compilationUnit.getProblems().length);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0534() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0534", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
- FieldDeclaration declaration = (FieldDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a compilation unit", result2.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result2;
- assertEquals("wrong problem size", 1, compilationUnit.getProblems().length);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0535() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0535", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not an initializer", node.getNodeType() == ASTNode.INITIALIZER);
- Initializer declaration = (Initializer) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a compilation unit", result2.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result2;
- assertEquals("wrong problem size", 1, compilationUnit.getProblems().length);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=47396
- */
- public void test0536() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0536", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=51089
- */
- public void test0537a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0537", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=51089
- */
- public void test0537b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0537", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=51089
- */
- public void test0537c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0537", "C.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * Ensures that an AST can be created during reconcile.
- * @deprecated using deprecated code
- */
- public void test0538a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " int i;\n" +
- "}"
- );
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- assertNotNull("No level 2 compilation unit", unit);
- assertEquals("Compilation unit has wrong AST level (2)", AST.JLS2, unit.getAST().apiLevel());
- // TODO improve test for AST.JLS3
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /*
- * Ensures that no AST is created during reconcile if not requested.
- */
- public void test0538b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " int i;\n" +
- "}"
- );
- JavaScriptUnit unit = sourceUnit.reconcile(0, false, null, null);
- assertNull("Unexpected compilation unit", unit);
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that no AST is created during reconcile if consistent.
- * @deprecated using deprecated code
- */
- public void test0538c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- sourceUnit.becomeWorkingCopy(null);
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- assertNull("Unexpected compilation unit", unit);
- // TODO improve test for AST.JLS3
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if the problem requestor is active.
- * @deprecated using deprecated code
- */
- public void test0538d() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor();
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " Object field;\n" +
- "}"
- );
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("Not original", isOriginal(node));
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
- FieldDeclaration declaration = (FieldDeclaration) node;
- Type type = declaration.getType();
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertEquals("Wrong name", "Object", typeBinding.getName());
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if force problem detection is turned on.
- * @deprecated using deprecated code
- */
- public void test0538e() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor();
- sourceUnit.becomeWorkingCopy(null);
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, true/*force pb detection*/, null, null);
- ASTNode node = getASTNode(unit, 0);
- assertNotNull("No node", node);
- assertTrue("not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration declaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = declaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertEquals("Wrong name", "A", typeBinding.getName());
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if force problem detection is turned on.
- * Case of a unit containing an anonymous type.
- * (regression test for bug 55102 NPE when using ICU.reconcile(GET_AST_TRUE, ...))
- * @deprecated using deprecated code
- */
- public void test0538f() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor();
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, true/*force pb detection*/, null, null);
- ASTNode node = getASTNode(unit, 0);
- assertNotNull("No node", node);
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if force problem detection is turned on.
- * Case of a unit containing an anonymous type.
- * (regression test for bug 55102 NPE when using ICU.reconcile(GET_AST_TRUE, ...))
- * @deprecated using deprecated code
- */
- public void test0538g() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor();
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- sourceUnit.reconcile(IJavaScriptUnit.NO_AST, false/* don't force pb detection*/, null, null);
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, true/*force pb detection*/, null, null);
- ASTNode node = getASTNode(unit, 0);
- assertNotNull("No node", node);
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that asking for well known type doesn't throw a NPE if the problem requestor is not active.
- * (regression test for bug 64750 NPE in Java AST Creation - editing some random file)
- * @deprecated using deprecated code
- */
- public void test0538h() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor() {
- public boolean isActive() {
- return false;
- }
- };
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " Object field;\n" +
- "}"
- );
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- assertEquals("Unexpected well known type", null, unit.getAST().resolveWellKnownType("void"));
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=53477
- */
- public void test0539() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0539", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertNotNull("No node", node);
- assertTrue("not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- checkSourceRange(classInstanceCreation, "new A(){}.new Inner(){/*x*/}", source);
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- Expression expression2 = classInstanceCreation.getExpression();
- assertTrue("not a class instance creation", expression2.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION);
- ClassInstanceCreation classInstanceCreation2 = (ClassInstanceCreation) expression2;
- AnonymousClassDeclaration anonymousClassDeclaration2 = classInstanceCreation2.getAnonymousClassDeclaration();
- assertNotNull("No anonymous class declaration", anonymousClassDeclaration2);
- checkSourceRange(anonymousClassDeclaration2, "{}", source);
- assertNotNull("No anonymous class declaration", anonymousClassDeclaration);
- checkSourceRange(anonymousClassDeclaration, "{/*x*/}", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=54431
- */
- public void test0540() {
- char[] source =
- ("package test0540;\n" + //$NON-NLS-1$
- "\n" + //$NON-NLS-1$
- "class Test {\n" + //$NON-NLS-1$
- " public void foo(int arg) {\n" +//$NON-NLS-1$
- " assert true;\n" +//$NON-NLS-1$
- " }\n" + //$NON-NLS-1$
- "}").toCharArray(); //$NON-NLS-1$
- IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
- Map options = project.getOptions(true);
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_4);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_4);
- ASTNode result = runConversion(source, "Test.js", project, options, true); //$NON-NLS-1$
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Problems found", 0, compilationUnit.getProblems().length);
- ASTNode node = getASTNode(compilationUnit, 0);
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "test0540", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Not an interface", typeBinding.isClass()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=56697
- */
- public void test0541() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0541", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- class Change14FieldAccessASTVisitor extends ASTVisitor {
- int counter;
- Change14FieldAccessASTVisitor() {
- counter = 0;
- }
- public void endVisit(QualifiedName qualifiedName) {
- IBinding i_binding = qualifiedName.getQualifier().resolveBinding();
- ITypeBinding type_binding = qualifiedName.getQualifier().resolveTypeBinding();
- if (i_binding == null || type_binding == null) {
- counter++;
- }
- }
- }
- Change14FieldAccessASTVisitor visitor = new Change14FieldAccessASTVisitor();
- unit.accept(visitor);
- assertEquals("Missing binding", 0, visitor.counter);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55004
- */
- public void test0542() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0542", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "STRING_FIELD", variableBinding.getName());
- Object constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", "Hello world!", constantValue);
- Expression initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "\"Hello world!\"", source);
-
- node = getASTNode(unit, 0, 1);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "BOOLEAN_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Boolean(true), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "true", source);
-
- node = getASTNode(unit, 0, 2);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "BYTE_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Byte((byte)1), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "1", source);
-
- node = getASTNode(unit, 0, 3);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "CHAR_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Character('{'), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "\'{\'", source);
-
- node = getASTNode(unit, 0, 4);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "DOUBLE_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Double("3.1415"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "3.1415", source);
-
- node = getASTNode(unit, 0, 5);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "FLOAT_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Float("3.14159f"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "3.14159f", source);
-
- node = getASTNode(unit, 0, 6);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "INT_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", Integer.valueOf("7fffffff", 16), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "Integer.MAX_VALUE", source);
-
- node = getASTNode(unit, 0, 7);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "LONG_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Long("34"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "34L", source);
-
- node = getASTNode(unit, 0, 8);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "SHORT_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Short("130"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "130", source);
-
- node = getASTNode(unit, 0, 9);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "int_field", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNull("Got a constant", constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "Integer.MAX_VALUE", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=58436
- */
- public void test0543() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0543", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- unit.accept(new GetKeyVisitor());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51500
- */
- public void test0544() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0544", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not an abstract method", (methodDeclaration.getModifiers() & Modifier.ABSTRACT) != 0);
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull("No binding", methodBinding);
- assertTrue("Not an abstract method binding", (methodBinding.getModifiers() & Modifier.ABSTRACT) != 0);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59843
- */
- public void test0545() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0545", "First.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/First$Test;", typeBinding.getKey());
-
- sourceUnit = getCompilationUnit("Converter", "src", "test0545", "Second.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- result = runConversion(sourceUnit, true);
- unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- node = getASTNode(unit, 0, 0);
- assertEquals("not a method declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- typeDeclaration = (TypeDeclaration) node;
- typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/Second$Test;", typeBinding.getKey());
-
- sourceUnit = getCompilationUnit("Converter", "src", "test0545", "Third.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- result = runConversion(sourceUnit, true);
- unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- node = getASTNode(unit, 0, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- typeDeclaration = (TypeDeclaration) node;
- typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/Third$Test;", typeBinding.getKey());
-
-
- sourceUnit = getCompilationUnit("Converter", "src", "test0545", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- result = runConversion(sourceUnit, true);
- unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- node = getASTNode(unit, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- typeDeclaration = (TypeDeclaration) node;
- typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/Test;", typeBinding.getKey());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59848
- * @deprecated using deprecated code
- */
- public void test0546() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0546", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("not a variable declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- ITypeBinding typeBinding = variableBinding.getType();
- assertTrue("An anonymous type binding", !typeBinding.isAnonymous());
- Expression initializer = fragment.getInitializer();
- assertEquals("not a class instance creation", ASTNode.CLASS_INSTANCE_CREATION, initializer.getNodeType()); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) initializer;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding2 = anonymousClassDeclaration.resolveBinding();
- assertTrue("Not an anonymous type binding", typeBinding2.isAnonymous());
- ITypeBinding typeBinding3 = classInstanceCreation.resolveTypeBinding();
- assertTrue("Not an anonymous type binding", typeBinding3.isAnonymous());
- node = getASTNode(unit, 1, 0, 1);
- assertEquals("not a expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- ExpressionStatement statement = (ExpressionStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("not a method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType()); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertEquals("not a simple name", ASTNode.SIMPLE_NAME, expression2.getNodeType()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- ITypeBinding typeBinding4 = simpleName.resolveTypeBinding();
- assertTrue("An anonymous type binding", !typeBinding4.isAnonymous());
- Name name = classInstanceCreation.getName();
- IBinding binding = name.resolveBinding();
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind());
- ITypeBinding typeBinding5 = (ITypeBinding) binding;
- assertTrue("An anonymous type binding", !typeBinding5.isAnonymous());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60078
- * @deprecated using deprecated code
- */
- public void test0547() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0547", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0547/A$74$Local;", typeBinding.getKey());
-
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 3, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertEquals("not a type declaration statement", ASTNode.TYPE_DECLARATION, bodyDeclaration.getNodeType()); //$NON-NLS-1$
- TypeDeclaration typeDeclaration2 = (TypeDeclaration) bodyDeclaration;
-
- typeBinding = typeDeclaration2.resolveBinding();
- assertEquals("Wrong key", "Ltest0547/A$100$LocalMember;", typeBinding.getKey());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60581
- */
- public void test0548() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0548", "PaletteStackEditPart.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48502
- */
- public void test0549() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0549", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48502
- */
- public void test0550() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0550", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60848
- */
- public void test0551() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0551", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 1, problems.length); //$NON-NLS-1$
- IProblem problem = problems[0];
- assertEquals("wrong end position", source.length - 1, problem.getSourceEnd());
- }
-
- public void test0552() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0552", "Test.js");
- char[] source = sourceUnit.getSource().toCharArray();
- JavaScriptUnit result = (JavaScriptUnit) runConversion(sourceUnit, true);
- assertEquals("Got errors", 0, result.getProblems().length);
- TypeDeclaration declaration = (TypeDeclaration) result.types().get(0);
- Block body = declaration.getMethods()[0].getBody();
- ExpressionStatement expr = (ExpressionStatement) body.statements().get(0);
- FunctionInvocation invocation = (FunctionInvocation) expr.getExpression();
- InfixExpression node = (InfixExpression) invocation.arguments().get(0);
- ITypeBinding typeBinding = node.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- checkSourceRange(node, "\"a\" + \"a\" + \"a\"", source);
- List extendedOperands = node.extendedOperands();
- assertEquals("Wrong size", 1, extendedOperands.size());
- Expression leftOperand = node.getLeftOperand();
- checkSourceRange(leftOperand, "\"a\"", source);
- typeBinding = leftOperand.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- Expression rightOperand = node.getRightOperand();
- checkSourceRange(rightOperand, "\"a\"", source);
- typeBinding = rightOperand.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- Expression expression = (Expression) extendedOperands.get(0);
- checkSourceRange(expression, "\"a\"", source);
- typeBinding = expression.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61946
- */
- public void test0553() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0553", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- Object constantValue = variableBinding.getConstantValue();
- assertNull("Got a constant value", constantValue);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61946
- */
- public void test0554() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0554", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertEquals("Not a method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- checkSourceRange(expression2, "A", source);
- ITypeBinding typeBinding = expression2.resolveTypeBinding();
- assertEquals("wrong type", "test0554.A", typeBinding.getQualifiedName());
- IVariableBinding[] fields = typeBinding.getDeclaredFields();
- assertEquals("Wrong size", 1, fields.length);
- IVariableBinding variableBinding = fields[0];
- Object constantValue = variableBinding.getConstantValue();
- assertNotNull("Missing constant", constantValue);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61946
- */
- public void test0555() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0555", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) expression;
- Name name = qualifiedName.getQualifier();
- checkSourceRange(name, "A", source);
- ITypeBinding typeBinding = name.resolveTypeBinding();
- assertEquals("wrong type", "test0555.A", typeBinding.getQualifiedName());
- IVariableBinding[] fields = typeBinding.getDeclaredFields();
- assertEquals("Wrong size", 1, fields.length);
- IVariableBinding variableBinding = fields[0];
- Object constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant value", constantValue);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=62463
- */
- public void test0556() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0556", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- checkSourceRange(expression2, "(aa.bar())", source);
- SimpleName simpleName = methodInvocation.getName();
- checkSourceRange(simpleName, "size", source);
- checkSourceRange(expression, "(aa.bar()).size()", source);
- checkSourceRange(expressionStatement, "(aa.bar()).size();", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=62463
- */
- public void test0557() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0557", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- checkSourceRange(expression2, "(aa.bar())", source);
- SimpleName simpleName = methodInvocation.getName();
- checkSourceRange(simpleName, "get", source);
- checkSourceRange(expression, "(aa.bar()).get(0)", source);
- checkSourceRange(expressionStatement, "(aa.bar()).get(0);", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65090
- * @deprecated using deprecated code
- */
- public void test0558() {
- String src = "\tSystem.out.println(\"Hello\");\n\tSystem.out.println(\"World\");\n";
- char[] source = src.toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind (ASTParser.K_STATEMENTS);
- parser.setSource (source);
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- assertEquals("Wrong type", ASTNode.BLOCK, result.getNodeType());
- Block block = (Block) result;
- List statements = block.statements();
- assertNotNull("No statements", statements);
- assertEquals("Wrong size", 2, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0559() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0559", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0560() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0560", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0561() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0561", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0562() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0562", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0563() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0563", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- checkSourceRange(expression4, "new String()", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0564() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0564", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- checkSourceRange(expression4, "new String()", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0565() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0565", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- checkSourceRange(expression4, "(/**/ String /**/) new String()", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=69349
- */
- public void test0566() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0566", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- assertEquals("Wrong character", '}', source[node.getStartPosition() + node.getLength() - 1]);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=69349
- */
- public void test0567() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0567", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- assertEquals("Wrong character", '}', source[node.getStartPosition() + node.getLength() - 1]);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=74369
- * @deprecated using deprecated code
- */
- public void test0569() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0569", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 1);
- assertEquals("not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
- TypeDeclaration typeDeclaration = typeDeclarationStatement.getTypeDeclaration();
- assertEquals("wrong name", "Local", typeDeclaration.getName().getIdentifier());
- assertNull("Got a javadoc", typeDeclaration.getJavadoc());
- node = getASTNode(unit, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "A", typeDeclaration.getName().getIdentifier());
- assertNotNull("No javadoc", typeDeclaration.getJavadoc());
- node = getASTNode(unit, 0, 0);
- assertEquals("not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "method", methodDeclaration.getName().getIdentifier());
- assertNotNull("No javadoc", methodDeclaration.getJavadoc());
- }
-
- /*
- * Ensures that the type binding from an import and the type binding from a type ref are equals
- * when the AST is computed using IJavaScriptUnit#reconcile(...)
- * (regression test for bug 83210 Unidentical ITypeBindings for same type from same AST from reconcile)
- */
- public void test0570() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/X.js", true);
- JavaScriptUnit unit = (JavaScriptUnit) buildAST(
- "import java.util.List;\n" +
- "public class X{\n" +
- " List field;\n" +
- "}",
- workingCopy
- );
- ImportDeclaration importDeclaration = (ImportDeclaration) unit.imports().iterator().next();
- TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().iterator().next();
- FieldDeclaration fieldDeclaration = typeDeclaration.getFields()[0];
- Type type = fieldDeclaration.getType();
- IBinding importBinding = importDeclaration.resolveBinding();
- IBinding typeBinding = type.resolveBinding();
- assertEquals(importBinding,typeBinding);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that the bindings for a member type in a .class file can be created.
- */
- public void test0571() throws CoreException, IOException {
- try {
- IJavaScriptProject p = createJavaProject("P", new String[] {""}, new String[] {"CONVERTER_JCL_LIB"});
- String source =
- "public class X {\n" +
- " public class Y {\n" +
- " }\n" +
- "}";
- addLibrary(p, "test0571.jar", "test0571.zip", new String[] {"X.js", source }, "1.4");
- IClassFile classFile = getClassFile("P", "/P/test0571.jar", "", "X$Y.class");
- JavaScriptUnit unit = (JavaScriptUnit) runConversion(AST.JLS3, classFile, 0, true);
- IProblem[] problems = unit.getProblems();
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = problems.length; i < length; i++)
- Util.appendProblem(buffer, problems[i], source.toCharArray(), i);
- assertEquals("Unexpected problems", "", buffer.toString());
- } finally {
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that the method bindings of an anonymous type are correct.
- */
- public void test0572() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- AnonymousClassDeclaration type = (AnonymousClassDeclaration) buildAST(
- "public class X {\n" +
- " void foo() {\n" +
- " new X() /*start*/{\n" +
- " void bar() {}\n" +
- " }/*end*/;\n" +
- " }\n" +
- "}",
- workingCopy);
- ITypeBinding typeBinding = type.resolveBinding();
- assertBindingsEqual(
- "LX$40;.(LX;)V\n" +
- "LX$40;.bar()V",
- typeBinding.getDeclaredMethods());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that the Java element of a compilation is correct.
- */
- public void test0573() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- JavaScriptUnit cu = (JavaScriptUnit) buildAST(
- "public class X {\n" +
- "}",
- workingCopy);
- assertElementEquals("Unexpected Java element", "[Working copy] X.java [in <default> [in src [in Converter]]]", cu.getJavaElement());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /*
- * Ensures that strings are not optimized when creating the AST through a reconcile.
- * (regression test for bug 82830 AST: String concatenation represented as single node)
- */
- public void test0574() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode string = buildAST(
- "public class X {\n" +
- " String s = /*start*/\"a\" + \"b\"/*end*/;\n" +
- "}",
- workingCopy);
- assertEquals("Unexpected node type", ASTNode.INFIX_EXPRESSION, string.getNodeType());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that 2 different method bindings with the same return type are not "isEqualTo(...)".
- * (regression test for bug 99978 MalformedTreeException on Inline Method)
- */
- public void test0575() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- String contents =
- "public class X {\n" +
- " /*start1*/String foo(String o) {return null;}/*end1*/\n" +
- " /*start2*/String foo(Object o) {return null;}/*end2*/\n" +
- "}";
- IBinding[] firstBatch = resolveBindings(contents, workingCopy);
- IBinding[] secondBatch = resolveBindings(contents, workingCopy);
- assertTrue("2 different method type bindings should not be equals", !firstBatch[0].isEqualTo(secondBatch[1]));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that the binding key of a raw member type is correct.
- * (regression test for bug 100549 Strange binding keys from AST on class file of nested type)
- */
- public void test0576() throws CoreException, IOException {
- try {
- IJavaScriptProject project = createJavaProject("P1", new String[] {""}, new String[] {"CONVERTER_JCL15_LIB"}, "", "1.5");
- addLibrary(project, "lib.jar", "src.zip", new String[] {
- "/P1/p/X.js",
- "package p;\n" +
- "public class X<T> {\n" +
- " /*start*/public class Member {\n" +
- " }/*end*/\n" +
- "}",
- }, "1.5");
- IClassFile classFile = getClassFile("P1", "/P1/lib.jar", "p", "X$Member.class");
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("/*start*/") + "/*start*/".length()};
- markerInfo.astEnds = new int[] {source.indexOf("/*end*/")};
- ASTNode node = buildAST(markerInfo, classFile);
- ITypeBinding binding = ((TypeDeclaration) node).resolveBinding();
- assertBindingKeyEquals("Lp/X<TT;>.Member;", binding.getKey());
- } finally {
- deleteProject("P1");
- }
- }
-
- /*
- * Ensures that strings are not optimized when creating the AST through a reconcile
- * even if the working copy was consistent.
- * (regression test for bug 114909 AST: String concatenation represented as single node)
- */
- public void test0577() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy(
- "/Converter/src/X.js",
- "public class X {\n" +
- " String s = /*start*/\"a\" + \"b\"/*end*/;\n" +
- "}",
- true/*resolve*/);
- ASTNode string = buildAST(workingCopy);
- assertEquals("Unexpected node type", ASTNode.INFIX_EXPRESSION, string.getNodeType());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
-
-
- /*
- * Ensures that the start position of an argument that has a previous sibbling with a comment is correct
- * (regression test for bug 80904 Quick Fix "Assign parameter to new field" doesn't appear with commented type)
- */
- public void test0579() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy(
- "/Converter/src/X.js",
- "public class X {\n" +
- " /*start*/void foo(Object/*first arg*/ arg1, Object arg2) {\n" +
- " }/*end*/\n" +
- "}",
- true/*resolve*/);
- FunctionDeclaration method = (FunctionDeclaration) buildAST(workingCopy);
- SingleVariableDeclaration arg2 = (SingleVariableDeclaration) method.parameters().get(1);
- int start = arg2.getStartPosition();
- assertEquals("Unexpected range for arg2", "Object arg2", workingCopy.getSource().substring(start, start+arg2.getLength()));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- public void test0606() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0606", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 0);
- unit.accept(new ASTVisitor() {
- public boolean visit(FunctionDeclaration methodDeclaration) {
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- IJavaScriptElement javaElement = methodBinding.getJavaElement();
- assertNotNull("No java element", javaElement);
- return false;
- }
- });
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=173853
- */
- public void test0607() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy(
- "/Converter/src/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " #\n" +
- " /*start*/new Object() {\n" +
- " }/*end*/;\n" +
- " }\n" +
- "}",
- true/*resolve*/);
- ASTNode string = buildAST(null, workingCopy, true, true);
- assertEquals("Unexpected node type", ASTNode.CLASS_INSTANCE_CREATION, string.getNodeType());
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) string;
- ITypeBinding resolveTypeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull("Binding is null", resolveTypeBinding);
- IFunctionBinding[] declaredMethods = resolveTypeBinding.getDeclaredMethods();
- assertNotNull("Should have one method", declaredMethods);
- assertEquals("Should have one method", 1, declaredMethods.length);
- assertTrue("The method should be a default constructor", declaredMethods[0].isDefaultConstructor());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java
deleted file mode 100644
index db189c3..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java
+++ /dev/null
@@ -1,8652 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IInitializer;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.ISourceRange;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.ASTRequestor;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.TryStatement;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.WhileStatement;
-import org.eclipse.wst.jsdt.core.tests.model.CancelCounter;
-import org.eclipse.wst.jsdt.core.tests.model.Canceler;
-import org.eclipse.wst.jsdt.core.tests.model.ReconcilerTests;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-public class ASTConverterTestAST3_2 extends ConverterTestSetup {
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS3);
- }
-
- public ASTConverterTestAST3_2(String name) {
- super(name);
- }
-
- static {
-// TESTS_NAMES = new String[] {"test0602"};
-// TESTS_RANGE = new int[] { 664, -1 };
-// TESTS_NUMBERS = new int[] { 664 };
- }
- public static Test suite() {
- return buildModelTestSuite(ASTConverterTestAST3_2.class);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=22560
- */
- public void test0401() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0401", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a return statement", statement.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) statement;
- Expression expression = returnStatement.getExpression();
- assertNotNull("there is no expression", expression); //$NON-NLS-1$
- // call the default initialization
- methodDeclaration.getReturnType2();
- ITypeBinding typeBinding = expression.resolveTypeBinding();
- assertNotNull("No typebinding", typeBinding); //$NON-NLS-1$
- assertEquals("wrong name", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23464
- */
- public void test0402() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0402", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 0);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not a super method invocation", node.getNodeType() == ASTNode.SUPER_CONSTRUCTOR_INVOCATION); //$NON-NLS-1$
- checkSourceRange(node, "new A().super();", source); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0403() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0403", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "test", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- IFunctionBinding methodBinding2 = methodInvocation.resolveMethodBinding();
- assertNotNull("No method binding2", methodBinding2);
- assertTrue("Wrong binding", methodBinding == methodBinding2);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0404() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0404", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0405() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0405", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23597
- */
- public void test0406() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0406", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 1);
- assertEquals("Wrong number of problems", 1, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "foo", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "foo", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertNull("Got a declaring node in the unit", unit.findDeclaringNode(methodBinding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23162
- */
- public void test0407() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0407", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName simpleName = methodDeclaration.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("Not a method binding", binding.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding = (IFunctionBinding) binding;
- assertEquals("wrong name", "foo", methodBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- methodDeclaration.setName(methodDeclaration.getAST().newSimpleName("foo2")); //$NON-NLS-1$
- IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding();
- assertNotNull("No methodbinding2", methodBinding2); //$NON-NLS-1$
- assertEquals("wrong name", "foo", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- simpleName = methodDeclaration.getName();
- IBinding binding2 = simpleName.resolveBinding();
- assertNull("Got a binding2", binding2); //$NON-NLS-1$
-
- ASTNode astNode = unit.findDeclaringNode(methodBinding);
- assertNotNull("No declaring node", astNode);
- assertEquals("wrong declaring node", methodDeclaration, astNode);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23162
- */
- public void test0408() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0408", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- assertTrue("Not a simple type", type.isSimpleType()); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("Not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) name;
- name = qualifiedName.getQualifier();
- assertTrue("Not a qualified name", name.isQualifiedName()); //$NON-NLS-1$
- qualifiedName = (QualifiedName) name;
- name = qualifiedName.getQualifier();
- assertTrue("Not a simple name", name.isSimpleName()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) name;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("Not a package binding", binding.getKind() == IBinding.PACKAGE); //$NON-NLS-1$
- assertEquals("Wrong name", "java", binding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=23162
- */
- public void test0409() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0409", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertProblemsSize(compilationUnit, 0);
- BindingsCollectorVisitor bindingsCollectorVisitor = new BindingsCollectorVisitor();
- compilationUnit.accept(bindingsCollectorVisitor);
- assertEquals("wrong number", 3, bindingsCollectorVisitor.getUnresolvedNodesSet().size()); //$NON-NLS-1$
- Map bindingsMap = bindingsCollectorVisitor.getBindingsMap();
- assertEquals("wrong number", 211, bindingsMap.size()); //$NON-NLS-1$
- ASTNodesCollectorVisitor nodesCollector = new ASTNodesCollectorVisitor();
- compilationUnit.accept(nodesCollector);
- Set detachedNodes = nodesCollector.getDetachedAstNodes();
- int counter = 0;
- for (Iterator iterator = detachedNodes.iterator(); iterator.hasNext(); ) {
- ASTNode detachedNode = (ASTNode) iterator.next();
- counter++;
- IBinding binding = (IBinding) bindingsMap.get(detachedNode);
- assertNotNull(binding);
- switch(detachedNode.getNodeType()) {
- case ASTNode.ARRAY_ACCESS :
- case ASTNode.ARRAY_CREATION :
- case ASTNode.ARRAY_INITIALIZER :
- case ASTNode.ASSIGNMENT :
- case ASTNode.BOOLEAN_LITERAL :
- case ASTNode.CHARACTER_LITERAL :
- case ASTNode.CLASS_INSTANCE_CREATION :
- case ASTNode.CONDITIONAL_EXPRESSION :
- case ASTNode.FIELD_ACCESS :
- case ASTNode.INFIX_EXPRESSION :
- case ASTNode.INSTANCEOF_EXPRESSION :
- case ASTNode.FUNCTION_INVOCATION :
- case ASTNode.NULL_LITERAL :
- case ASTNode.NUMBER_LITERAL :
- case ASTNode.POSTFIX_EXPRESSION :
- case ASTNode.PREFIX_EXPRESSION :
- case ASTNode.THIS_EXPRESSION :
- case ASTNode.TYPE_LITERAL :
- case ASTNode.VARIABLE_DECLARATION_EXPRESSION :
- ITypeBinding typeBinding = ((Expression) detachedNode).resolveTypeBinding();
- if (!binding.equals(typeBinding)) {
- System.out.println(detachedNode);
- }
- assertTrue("binding not equals", binding.equals(typeBinding)); //$NON-NLS-1$
- break;
- case ASTNode.VARIABLE_DECLARATION_FRAGMENT :
- assertTrue("binding not equals", binding.equals(((VariableDeclarationFragment) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.ANONYMOUS_CLASS_DECLARATION :
- assertTrue("binding not equals", binding.equals(((AnonymousClassDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.QUALIFIED_NAME :
- case ASTNode.SIMPLE_NAME :
- IBinding newBinding = ((Name) detachedNode).resolveBinding();
- assertTrue("binding not equals", binding.equals(newBinding)); //$NON-NLS-1$
- break;
- case ASTNode.ARRAY_TYPE :
- case ASTNode.SIMPLE_TYPE :
- case ASTNode.PRIMITIVE_TYPE :
- assertTrue("binding not equals", binding.equals(((Type) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.CONSTRUCTOR_INVOCATION :
- assertTrue("binding not equals", binding.equals(((ConstructorInvocation) detachedNode).resolveConstructorBinding())); //$NON-NLS-1$
- break;
- case ASTNode.IMPORT_DECLARATION :
- assertTrue("binding not equals", binding.equals(((ImportDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.FUNCTION_DECLARATION :
- assertTrue("binding not equals", binding.equals(((FunctionDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.PACKAGE_DECLARATION :
- assertTrue("binding not equals", binding.equals(((PackageDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- case ASTNode.TYPE_DECLARATION :
- assertTrue("binding not equals", binding.equals(((TypeDeclaration) detachedNode).resolveBinding())); //$NON-NLS-1$
- break;
- }
- }
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * Test for message on jdt-core-dev
- */
- public void test0410() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0410", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- Expression expression = ((ReturnStatement) node).getExpression();
- assertTrue("Not an infix expression", expression.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression;
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 3, extendedOperands.size()); //$NON-NLS-1$
- }
-
- /**
- * Test for message on jdt-core-dev
- */
- public void test0411() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0411", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("Wrong number of problems", 0, ((JavaScriptUnit) result).getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertNotNull(node);
- assertTrue("Not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- Expression expression = ((ReturnStatement) node).getExpression();
- assertTrue("Not an infix expression", expression.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression;
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 0, extendedOperands.size()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23901
- */
- public void test0412() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0412", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0);
- assertNotNull(node);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertNotNull("No declaring node", unit.findDeclaringNode(typeBinding)); //$NON-NLS-1$
- Name name = typeDeclaration.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- ASTNode declaringNode = unit.findDeclaringNode(binding);
- assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
- assertEquals("Wrong node", typeDeclaration, declaringNode); //$NON-NLS-1$
- typeBinding = name.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- declaringNode = unit.findDeclaringNode(typeBinding);
- assertNotNull("No declaring node", declaringNode); //$NON-NLS-1$
- assertEquals("Wrong node", typeDeclaration, declaringNode); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=20881
- */
- public void test0413() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0413", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List throwsException = methodDeclaration.thrownExceptions();
- assertEquals("wrong size", 2, throwsException.size()); //$NON-NLS-1$
- Name name = (Name) throwsException.get(0);
- IBinding binding = name.resolveBinding();
- assertNull("Got a binding", binding); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=23734
- */
- public void test0414() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0414", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- ASTNode declaringNode = unit.findDeclaringNode(typeBinding);
- assertNull("Got a declaring node", declaringNode); //$NON-NLS-1$
-
- node = getASTNode(unit, 0, 1);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration2 = (FunctionDeclaration) node;
- Type type2 = methodDeclaration2.getReturnType2();
- ITypeBinding typeBinding2 = type2.resolveBinding();
- assertNotNull("No type binding", typeBinding2); //$NON-NLS-1$
- ASTNode declaringNode2 = unit.findDeclaringNode(typeBinding2);
- assertNotNull("No declaring node", declaringNode2); //$NON-NLS-1$
-
- IJavaScriptUnit sourceUnit2 = getCompilationUnit("Converter" , "src", "test0414", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- result = runConversion(AST.JLS3, sourceUnit2, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit2 = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit2.getProblems().length); //$NON-NLS-1$
- ASTNode declaringNode3 = unit2.findDeclaringNode(typeBinding);
- assertNull("Got a declaring node", declaringNode3); //$NON-NLS-1$
-
- ASTNode declaringNode4 = unit2.findDeclaringNode(typeBinding.getKey());
- assertNotNull("No declaring node", declaringNode4); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24268
- */
- public void test0415() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0415", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a switch statement", node.getNodeType() == ASTNode.SWITCH_STATEMENT); //$NON-NLS-1$
- SwitchStatement switchStatement = (SwitchStatement) node;
- List statements = switchStatement.statements();
- assertEquals("wrong size", statements.size(), 5); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(3);
- assertTrue("not a switch case (default)", statement.getNodeType() == ASTNode.SWITCH_CASE); //$NON-NLS-1$
- SwitchCase defaultCase = (SwitchCase) statement;
- assertTrue("not a default case", defaultCase.isDefault());
- checkSourceRange(defaultCase, "default:", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24324
- */
- public void test0416() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0416", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", fragments.size(), 1);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression init = fragment.getInitializer();
- assertTrue("not a qualified name", init.getNodeType() == ASTNode.QUALIFIED_NAME); //$NON-NLS-1$
- QualifiedName qualifiedName = (QualifiedName) init;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("Wrong name", "CONST", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong modifier", variableBinding.getModifiers(), Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL);
- ASTNode declaringNode = unit.findDeclaringNode(variableBinding);
- assertNotNull("No declaring node", declaringNode);
- assertTrue("not a variable declaration fragment", declaringNode.getNodeType() == ASTNode.VARIABLE_DECLARATION_FRAGMENT);
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment) declaringNode;
- FieldDeclaration fieldDeclaration = (FieldDeclaration) variableDeclarationFragment.getParent();
- assertEquals("Wrong modifier", fieldDeclaration.getModifiers(), Modifier.NONE);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24347
- */
- public void test0417() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0417", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertTrue("not a simple type", type.getNodeType() == ASTNode.SIMPLE_TYPE); //$NON-NLS-1$
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertTrue("Not a qualified name", name.isQualifiedName());
- QualifiedName qualifiedName = (QualifiedName) name;
- Name qualifier = qualifiedName.getQualifier();
- assertTrue("Not a simple name", qualifier.isSimpleName());
- IBinding binding = qualifier.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24406
- */
- public void test0418() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0418", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertNotNull("No node", node);
- assertTrue("not an expression statement ", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not an method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Name name = methodInvocation.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0419() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0419", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a name", expression2.getNodeType(), ASTNode.SIMPLE_NAME);
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNull(binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0420() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0420", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getRightOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "(2 + 3)", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "2 + 3", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0421() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0421", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "(1 + 2) + 3", source);
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "(1 + 2)", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "1 + 2", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0422() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0422", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "( 1 + 2 ) + 3", source);
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "( 1 + 2 )", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "1 + 2", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0423() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0423", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getRightOperand();
- assertEquals("Not a parenthesized expression", expression2.getNodeType(), ASTNode.PARENTHESIZED_EXPRESSION);
- checkSourceRange(expression2, "( 2 + 3 )", source);
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression2;
- Expression expression3 = parenthesizedExpression.getExpression();
- checkSourceRange(expression3, "2 + 3", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0424() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0424", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- assertEquals("Wrong size", 1, infixExpression.extendedOperands().size());
- Expression expression2 = (Expression) infixExpression.extendedOperands().get(0);
- checkSourceRange(expression2, "( 2 + 3 )", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24453
- */
- public void test0425() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0425", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", expression.getNodeType(), ASTNode.INFIX_EXPRESSION);
- InfixExpression infixExpression = (InfixExpression) expression;
- assertEquals("Wrong size", 0, infixExpression.extendedOperands().size());
- Expression expression2 = infixExpression.getRightOperand();
- assertTrue("not an infix expression", expression2.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression2 = (InfixExpression) expression2;
- Expression expression3 = infixExpression2.getRightOperand();
- assertTrue("not a parenthesized expression", expression3.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION); //$NON-NLS-1$
- checkSourceRange(expression3, "( 2 + 3 )", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0426() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0426", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not a variable declaration statement", node.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertTrue("not a simple type", type.getNodeType() == ASTNode.SIMPLE_TYPE);
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertNotNull("No name", name);
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0427() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0427", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a super field access", expression2.getNodeType(), ASTNode.SUPER_FIELD_ACCESS);
- SuperFieldAccess superFieldAccess = (SuperFieldAccess) expression2;
- Name name = superFieldAccess.getName();
- assertNotNull("No name", name);
- IBinding binding = name.resolveBinding();
- assertNull("Got a binding", binding);
- assertNull("Got a binding", superFieldAccess.resolveFieldBinding());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0428() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0428", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", expression2.getNodeType(), ASTNode.QUALIFIED_NAME);
- QualifiedName name = (QualifiedName) expression2;
- SimpleName simpleName = name.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- IBinding binding2 = name.resolveBinding();
- assertNotNull("No binding2", binding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24449
- */
- public void test0429() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0429", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", expression.getNodeType(), ASTNode.ASSIGNMENT);
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", expression2.getNodeType(), ASTNode.QUALIFIED_NAME);
- QualifiedName name = (QualifiedName) expression2;
- SimpleName simpleName = name.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- IBinding binding2 = name.resolveBinding();
- assertNotNull("No binding2", binding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24499
- */
- public void test0430() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0430", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertTrue("Not a constructor invocation", node.getNodeType() == ASTNode.CONSTRUCTOR_INVOCATION);
- ConstructorInvocation constructorInvocation = (ConstructorInvocation) node;
- checkSourceRange(constructorInvocation, "this(coo2());", source);
- List arguments = constructorInvocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- Expression expression = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- SimpleName simpleName = methodInvocation.getName();
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24500
- */
- public void test0431() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0431", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertTrue("Not a constructor invocation", node.getNodeType() == ASTNode.CONSTRUCTOR_INVOCATION);
- ConstructorInvocation constructorInvocation = (ConstructorInvocation) node;
- List arguments = constructorInvocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- Expression expression = (Expression) arguments.get(0);
- assertTrue("Not a simple name", expression.getNodeType() == ASTNode.SIMPLE_NAME);
- SimpleName simpleName = (SimpleName) expression;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0432() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0432", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, expression2.getNodeType());
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0433() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0433", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a super field access", ASTNode.SUPER_FIELD_ACCESS, expression2.getNodeType());
- SuperFieldAccess superFieldAccess = (SuperFieldAccess) expression2;
- SimpleName simpleName = superFieldAccess.getName();
- assertEquals("wrong name", "fCoo", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Wrong binding", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = superFieldAccess.resolveFieldBinding();
- assertTrue("Different binding", binding == variableBinding);
- ASTNode astNode = unit.findDeclaringNode(variableBinding);
- assertTrue("Wrong type", astNode.getNodeType() == ASTNode.SINGLE_VARIABLE_DECLARATION || astNode.getNodeType() == ASTNode.VARIABLE_DECLARATION_FRAGMENT || astNode.getNodeType() == ASTNode.VARIABLE_DECLARATION_EXPRESSION);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0434() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0434", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression2.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) expression2;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "fCoo", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24501
- */
- public void test0435() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0435", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getLeftHandSide();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression2.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) expression2;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "fCoo", simpleName.getIdentifier());
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24502
- */
- public void test0436() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0436", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 1, "The type A.CInner is not visible"); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertEquals("Not a simple type", ASTNode.SIMPLE_TYPE, type.getNodeType());
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, name.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) name;
- SimpleName simpleName = qualifiedName.getName();
- assertEquals("wrong name", "CInner", simpleName.getIdentifier());
- IBinding binding2 = simpleName.resolveBinding();
- assertNotNull("No binding", binding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24502
- */
- public void test0437() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0437", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 1, "The type CInner is not visible"); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertEquals("Not a simple type", ASTNode.SIMPLE_TYPE, type.getNodeType());
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType());
- SimpleName simpleName = (SimpleName) name;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24511
- */
- public void test0438() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0438", "D.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- List imports = unit.imports();
- assertEquals("Wrong size", 1, imports.size()); //$NON-NLS-1$<
- ImportDeclaration importDeclaration = (ImportDeclaration) imports.get(0);
- IBinding binding = importDeclaration.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24502
- */
- public void test0439() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0439", "E.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- Type type = statement.getType();
- assertEquals("Not a simple type", ASTNode.SIMPLE_TYPE, type.getNodeType());
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24622
- */
- public void test0440() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0440", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- // 2 * 3 + "" + (true)
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "2 * 3 + \"\" + (true)", source);
- Expression leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2 * 3 + \"\"", source);
- checkSourceRange(infixExpression.getRightOperand(), "(true)", source);
- assertEquals("wrong operator", infixExpression.getOperator(), InfixExpression.Operator.PLUS);
- assertEquals("wrong type", ASTNode.INFIX_EXPRESSION, leftOperand.getNodeType());
- infixExpression = (InfixExpression) leftOperand;
- checkSourceRange(infixExpression, "2 * 3 + \"\"", source);
- leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2 * 3", source);
- checkSourceRange(infixExpression.getRightOperand(), "\"\"", source);
- assertEquals("wrong operator", infixExpression.getOperator(), InfixExpression.Operator.PLUS);
- assertEquals("wrong type", ASTNode.INFIX_EXPRESSION, leftOperand.getNodeType());
- infixExpression = (InfixExpression) leftOperand;
- checkSourceRange(infixExpression, "2 * 3", source);
- leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2", source);
- checkSourceRange(infixExpression.getRightOperand(), "3", source);
- assertEquals("wrong operator", infixExpression.getOperator(), InfixExpression.Operator.TIMES);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24622
- */
- public void test0441() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0441", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "(2 + 2) * 3 * 1", source);
- Expression leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "(2 + 2)", source);
- checkSourceRange(infixExpression.getRightOperand(), "3", source);
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 1, extendedOperands.size());
- checkSourceRange((Expression) extendedOperands.get(0), "1", source);
- assertEquals("wrong operator", InfixExpression.Operator.TIMES, infixExpression.getOperator());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24622
- */
- public void test0442() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0442", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- checkSourceRange(infixExpression, "2 + (2 * 3) + 1", source);
- Expression leftOperand = infixExpression.getLeftOperand();
- checkSourceRange(leftOperand, "2", source);
- Expression rightOperand = infixExpression.getRightOperand();
- checkSourceRange(rightOperand, "(2 * 3)", source);
- assertEquals("wrong type", ASTNode.PARENTHESIZED_EXPRESSION, rightOperand.getNodeType());
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("wrong size", 1, extendedOperands.size());
- checkSourceRange((Expression) extendedOperands.get(0), "1", source);
- assertEquals("wrong operator", InfixExpression.Operator.PLUS, infixExpression.getOperator());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24623
- */
- public void test0443() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0443", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertNotNull("No body", methodDeclaration.getBody());
- assertNotNull("No binding", methodDeclaration.resolveBinding());
- assertTrue("Not an abstract method", Modifier.isAbstract(methodDeclaration.getModifiers()));
- List modifiers = methodDeclaration.modifiers();
- assertEquals("Wrong size", 2, modifiers.size());
- Modifier modifier1 = (Modifier) modifiers.get(0);
- assertTrue("Not a public modifier", modifier1.isPublic());
- Modifier modifier2 = (Modifier) modifiers.get(1);
- assertTrue("Not an abstract modifier", modifier2.isAbstract());
- assertTrue("Not malformed", isMalformed(methodDeclaration));
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24623
- */
- public void test0444() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0444", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0);
- assertEquals("Wrong type", ASTNode.TYPE_DECLARATION, node.getNodeType());
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 2, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration)bodyDeclarations.get(0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- assertEquals("Wrong name", "foo", methodDeclaration.getName().getIdentifier());
- assertNull("Got a binding", methodDeclaration.resolveBinding());
- bodyDeclaration = (BodyDeclaration)bodyDeclarations.get(1);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- assertEquals("Wrong name", "foo", ((FunctionDeclaration) bodyDeclaration).getName().getIdentifier());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24773
- */
- public void test0445() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0445", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25018
- */
- public void test0446() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0446", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25124
- */
- public void test0447() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0447", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 3, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=25330
- */
- public void test0448() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0448", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", node.getNodeType(), ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- assertNull("No return type", methodDeclaration.getReturnType2());
- Block block = methodDeclaration.getBody();
- assertNotNull("No method body", block);
- assertEquals("wrong size", 0, block.statements().size());
- }
-
- /**
- * Check that the implicit super constructor call is not there
- */
- public void test0449() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0449", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", node.getNodeType(), ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- Block block = methodDeclaration.getBody();
- assertNotNull("No method body", block);
- assertEquals("wrong size", 1, block.statements().size());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=26452
- */
- public void test0450() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0450", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0);
- assertEquals("Not a type declaration", node.getNodeType(), ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("not a toplevel type", typeBinding.isTopLevel());
- assertTrue("a local type", !typeBinding.isLocal());
- assertTrue("an anonymous type", !typeBinding.isAnonymous());
- assertTrue("a member type", !typeBinding.isMember());
- assertTrue("a nested type", !typeBinding.isNested());
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not an expression statement", node.getNodeType(), ASTNode.EXPRESSION_STATEMENT);
- Expression expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not a class instance creation", expression.getNodeType(), ASTNode.CLASS_INSTANCE_CREATION);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- typeBinding = anonymousClassDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("a toplevel type", !typeBinding.isTopLevel());
- assertTrue("not a local type", typeBinding.isLocal());
- assertTrue("not an anonymous type", typeBinding.isAnonymous());
- assertTrue("a member type", !typeBinding.isMember());
- assertTrue("not a nested type", typeBinding.isNested());
- ASTNode astNode = unit.findDeclaringNode(typeBinding);
- assertEquals("Wrong type", ASTNode.ANONYMOUS_CLASS_DECLARATION, astNode.getNodeType());
- assertNotNull("Didn't get a key", typeBinding.getKey());
- astNode = unit.findDeclaringNode(typeBinding.getKey());
- assertNotNull("Didn't get a declaring node", astNode);
-
- ITypeBinding typeBinding3 = classInstanceCreation.resolveTypeBinding();
- assertEquals("wrong binding", typeBinding, typeBinding3);
-
- List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("wrong size", 2, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("not a type declaration", bodyDeclaration.getNodeType() == ASTNode.TYPE_DECLARATION);
- typeDeclaration = (TypeDeclaration) bodyDeclaration;
-
- bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(1);
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- assertNotNull("No body", block);
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size());
- Statement statement = (Statement) statements.get(1);
- assertEquals("Not a variable declaration statement", statement.getNodeType(), ASTNode.VARIABLE_DECLARATION_STATEMENT);
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement;
- Type type = variableDeclarationStatement.getType();
- assertNotNull("No type", type);
-
- ITypeBinding typeBinding2 = type.resolveBinding();
- typeBinding = typeDeclaration.resolveBinding();
- assertTrue("not equals", typeBinding == typeBinding2);
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("a toplevel type", !typeBinding.isTopLevel());
- assertTrue("an anonymous type", !typeBinding.isAnonymous());
- assertTrue("not a member type", typeBinding.isMember());
- assertTrue("not a nested type", typeBinding.isNested());
- assertTrue("a local type", !typeBinding.isLocal());
-
- bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("not a type declaration", bodyDeclaration.getNodeType() == ASTNode.TYPE_DECLARATION);
- typeDeclaration = (TypeDeclaration) bodyDeclaration;
- typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertTrue("not a class", typeBinding.isClass());
- assertTrue("a toplevel type", !typeBinding.isTopLevel());
- assertTrue("an anonymous type", !typeBinding.isAnonymous());
- assertTrue("not a member type", typeBinding.isMember());
- assertTrue("not a nested type", typeBinding.isNested());
- assertTrue("a local type", !typeBinding.isLocal());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=24916
- */
- public void test0451() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0451", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Type type = methodDeclaration.getReturnType2();
- checkSourceRange(type, "int", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=27204
- */
- public void test0452() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "NO_WORKING.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- SimpleName name = methodDeclaration.getName();
- assertEquals("wrong line number", 3, compilationUnit.getLineNumber(name.getStartPosition()));
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=27173
- */
- public void test0453() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0453", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0,0);
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertTrue("not a super method invocation", expression.getNodeType() == ASTNode.SUPER_METHOD_INVOCATION); //$NON-NLS-1$
- SuperMethodInvocation methodInvocation = (SuperMethodInvocation) expression;
- IFunctionBinding methodBinding = methodInvocation.resolveMethodBinding();
- assertNotNull("No method binding", methodBinding);
- assertEquals("Wrong binding", "toString", methodBinding.getName());
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28296
- */
- public void test0454() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0454", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0,1);
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- checkSourceRange(expression, "(int) (3.14f * a)", source);
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0455() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0455", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i = 0; i < 10; i++) // for 1\n" +
- " for (int j = 0; j < 10; j++) // for 2\n" +
- " if (true) { }";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int j = 0; j < 10; j++) // for 2\n" +
- " if (true) { }";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = "if (true) { }";
- checkSourceRange(body, expectedSource, source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0456() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0456", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int x= 10; x < 20; x++)\n" +
- " main();";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "main();";
- checkSourceRange(body, expectedSource, source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0457() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0457", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i= 10; i < 10; i++)/*[*/\n"+
- " for (int z= 10; z < 10; z++)\n" +
- " foo();";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int z= 10; z < 10; z++)\n" +
- " foo();";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = "foo();";
- checkSourceRange(body, expectedSource, source);
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0458() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0458", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i= 10; i < 10; i++)/*[*/\n"+
- " for (int z= 10; z < 10; z++)\n" +
- " ;";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int z= 10; z < 10; z++)\n" +
- " ;";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = ";";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not an empty statement", body.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28682
- */
- public void test0459() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0459", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node; // first for loop
- String expectedSource = "for (int i= 10; i < 10; i++)/*[*/\n"+
- " for (int z= 10; z < 10; z++)\n" +
- " { }";
- checkSourceRange(forStatement, expectedSource, source);
- Statement body = forStatement.getBody();
- expectedSource = "for (int z= 10; z < 10; z++)\n" +
- " { }";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a for statement", body.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement2 = (ForStatement) body;
- body = forStatement2.getBody();
- expectedSource = "{ }";
- checkSourceRange(body, expectedSource, source);
- assertTrue("not a block", body.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28869
- */
- public void test0460() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0460", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertTrue("Has error", compilationUnit.getProblems().length == 0); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("Malformed", !isMalformed(node));
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=28824
- */
- public void test0461() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0461", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- char[] source = sourceUnit.getSource().toCharArray();
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertTrue("Has error", compilationUnit.getProblems().length == 0); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("Malformed", !isMalformed(node));
- assertTrue("not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not an assignment", expression.getNodeType() == ASTNode.ASSIGNMENT); //$NON-NLS-1$
- Assignment assignment = (Assignment) expression;
- checkSourceRange(assignment, "z= foo().y.toList()", source);
- Expression expression2 = assignment.getRightHandSide();
- checkSourceRange(expression2, "foo().y.toList()", source);
- assertTrue("not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- checkSourceRange(expression3, "foo().y", source);
- checkSourceRange(methodInvocation.getName(), "toList", source);
- assertTrue("not a field access", expression3.getNodeType() == ASTNode.FIELD_ACCESS);
- FieldAccess fieldAccess = (FieldAccess) expression3;
- checkSourceRange(fieldAccess.getName(), "y", source);
- Expression expression4 = fieldAccess.getExpression();
- checkSourceRange(expression4, "foo()", source);
- assertTrue("not a method invocation", expression4.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression4;
- checkSourceRange(methodInvocation2.getName(), "foo", source);
- assertNull("no null", methodInvocation2.getExpression());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=32338
- */
- public void test0462() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "", "Test462.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertTrue("Has error", compilationUnit.getProblems().length == 0); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0);
- assertNotNull("No node", node);
- assertTrue("not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("Wrong name", "Test462", typeDeclaration.getName().getIdentifier());
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No binding", typeBinding);
- assertEquals("Wrong name", "Test462", typeBinding.getQualifiedName());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33450
- */
- public void test0463() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0463", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a string literal", expression.getNodeType() == ASTNode.STRING_LITERAL); //$NON-NLS-1$
- StringLiteral stringLiteral = (StringLiteral) expression;
- checkSourceRange(stringLiteral, "\"\\012\\015\\u0061\"", source);
- assertEquals("wrong value", "\012\015a", stringLiteral.getLiteralValue());
- assertEquals("wrong value", "\"\\012\\015\\u0061\"", stringLiteral.getEscapedValue());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33039
- */
- public void test0464() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0464", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("No error", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a null literal", expression.getNodeType() == ASTNode.NULL_LITERAL); //$NON-NLS-1$
- NullLiteral nullLiteral = (NullLiteral) expression;
- ITypeBinding typeBinding = nullLiteral.resolveTypeBinding();
- assertNotNull("No type binding", typeBinding);
- assertFalse("A primitive type", typeBinding.isPrimitive());
- assertTrue("Null type", typeBinding.isNullType());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33831
- */
- public void test0465() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0465", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a field access", expression.getNodeType() == ASTNode.FIELD_ACCESS); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) expression;
- Name name = fieldAccess.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "i", variableBinding.getName());
- assertEquals("Wrong type", "int", variableBinding.getType().getName());
- IVariableBinding variableBinding2 = fieldAccess.resolveFieldBinding();
- assertTrue("different binding", variableBinding == variableBinding2);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33949
- */
- public void test0466() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0466", "Assert.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- checkSourceRange(node, "assert ref != null : message;", source);
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=33949
- */
- public void test0467() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0467", "Assert.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- checkSourceRange(node, "assert ref != null : message\\u003B", source);
-
- node = getASTNode(compilationUnit, 0, 0, 1);
- checkSourceRange(node, "assert ref != null\\u003B", source);
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=36772
- */
- public void test0468() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0468", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a return statement", node.getNodeType() == ASTNode.RETURN_STATEMENT); //$NON-NLS-1$
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertTrue("not a field access", expression.getNodeType() == ASTNode.FIELD_ACCESS); //$NON-NLS-1$
- FieldAccess fieldAccess = (FieldAccess) expression;
- Name name = fieldAccess.getName();
- IBinding binding = name.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Wrong type", IBinding.VARIABLE, binding.getKind());
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "i", variableBinding.getName());
- assertEquals("Wrong type", "int", variableBinding.getType().getName());
- IVariableBinding variableBinding2 = fieldAccess.resolveFieldBinding();
- assertTrue("different binding", variableBinding == variableBinding2);
-
- node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("No node", node);
- assertEquals("Wrong type", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
-
- ASTNode foundNode = compilationUnit.findDeclaringNode(variableBinding);
- assertNotNull("No found node", foundNode);
- assertEquals("wrong node", fragment, foundNode);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=36895
- */
- public void test0469() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "codeManipulation", "bug.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 2, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a variable declaration statement", node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- ASTNode parent = node.getParent();
- assertNotNull(parent);
- assertTrue("not a block", parent.getNodeType() == ASTNode.BLOCK); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=37381
- */
- public void test0470() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0470", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No node", node);
- assertTrue("not a for statement", node.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) node;
- List initializers = forStatement.initializers();
- assertEquals("wrong size", 1, initializers.size());
- Expression initializer = (Expression) initializers.get(0);
- assertTrue("not a variable declaration expression", initializer.getNodeType() == ASTNode.VARIABLE_DECLARATION_EXPRESSION); //$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression) initializer;
- List fragments = variableDeclarationExpression.fragments();
- assertEquals("wrong size", 2, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- checkSourceRange(fragment, "i= 0", source);
- fragment = (VariableDeclarationFragment) fragments.get(1);
- checkSourceRange(fragment, "j= goo(3)", source);
- checkSourceRange(variableDeclarationExpression, "int i= 0, j= goo(3)", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=38447
- */
- public void test0471() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0471", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Is a constructor", !methodDeclaration.isConstructor());
- checkSourceRange(methodDeclaration, "private void foo(){", source);
- node = getASTNode(compilationUnit, 0, 1);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Is a constructor", !methodDeclaration.isConstructor());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=38447
- */
- public void test0472() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "junit.textui", "ResultPrinter.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 2, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 2);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=38732
- */
- public void test0473() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- newOptions.put(JavaScriptCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaScriptCore.ERROR);
- JavaScriptCore.setOptions(newOptions);
-
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0473", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 2, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 0, 0);
- assertNotNull("No node", node);
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39259
- */
- public void test0474() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0474", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
- assertEquals("Not a while statement", node.getNodeType(), ASTNode.WHILE_STATEMENT);
- WhileStatement whileStatement = (WhileStatement) node;
- Statement statement = whileStatement.getBody();
- assertEquals("Not a while statement", statement.getNodeType(), ASTNode.WHILE_STATEMENT);
- WhileStatement whileStatement2 = (WhileStatement) statement;
- String expectedSource =
- "while(b())\n" +
- " foo();";
- checkSourceRange(whileStatement2, expectedSource, source);
- Statement statement2 = whileStatement2.getBody();
- checkSourceRange(statement2, "foo();", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39259
- */
- public void test0475() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0475", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
- assertEquals("Not an if statement", node.getNodeType(), ASTNode.IF_STATEMENT);
- IfStatement statement = (IfStatement) node;
- Statement statement2 = statement.getThenStatement();
- assertEquals("Not an if statement", statement2.getNodeType(), ASTNode.IF_STATEMENT);
- IfStatement statement3 = (IfStatement) statement2;
- String expectedSource =
- "if(b())\n" +
- " foo();";
- checkSourceRange(statement3, expectedSource, source);
- Statement statement4 = statement3.getThenStatement();
- checkSourceRange(statement4, "foo();", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39259
- */
- public void test0476() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0476", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 0, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
- assertEquals("Not a for statement", node.getNodeType(), ASTNode.FOR_STATEMENT);
- ForStatement statement = (ForStatement) node;
- Statement statement2 = statement.getBody();
- assertEquals("Not a for statement", statement2.getNodeType(), ASTNode.FOR_STATEMENT);
- ForStatement statement3 = (ForStatement) statement2;
- String expectedSource =
- "for(;b();)\n" +
- " foo();";
- checkSourceRange(statement3, expectedSource, source);
- Statement statement4 = statement3.getBody();
- checkSourceRange(statement4, "foo();", source);
- }
-
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=39327
- */
- public void test0477() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0477", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("No error", 1, compilationUnit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(compilationUnit, 0, 1, 0);
- assertNotNull("No node", node);
-
- checkSourceRange(node, "this(undef());", source);
- assertEquals("Not a constructor invocation", node.getNodeType(), ASTNode.CONSTRUCTOR_INVOCATION);
- ConstructorInvocation constructorInvocation = (ConstructorInvocation) node;
- List arguments = constructorInvocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- IFunctionBinding binding = constructorInvocation.resolveConstructorBinding();
- assertNotNull("No binding", binding);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0478() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0478", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 2, types.length);
- IType type = types[1];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull(methodBinding);
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding2 = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0479() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0479", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 2, types.length);
- IType type = types[1];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNull("No binding", binding); //$NON-NLS-1$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0480() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0480", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0481() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0481", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0482() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0482", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- IFunction[] methods = memberType.getFunctions();
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0483() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0483", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "A", methodDeclaration.getName().getIdentifier());
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- IBinding binding = methodDeclaration.getName().resolveBinding();
- assertNotNull(binding);
- assertEquals("Wrong type", IBinding.METHOD, binding.getKind());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0484() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0482", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0485() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0482", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0486() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0486", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0487() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0487", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 3, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40474
- */
- public void test0488() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0488", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IInitializer[] initializers = type.getInitializers();
- assertEquals("wrong size", 2, initializers.length);
- IInitializer init = initializers[1];
- ISourceRange sourceRange = init.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40804
- */
- public void test0489() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0489", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertNull("Got a type binding", typeDeclaration.resolveBinding());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=40804
- */
- public void test0490() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0490", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42647
- */
- public void test0491() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0491", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42647
- */
- public void test0492() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Hashtable newOptions = JavaScriptCore.getOptions();
- try {
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- JavaScriptCore.setOptions(newOptions);
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0492", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- } finally {
- JavaScriptCore.setOptions(options);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0493() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0493", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0494() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0494", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[][]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0495() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0495", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- assertEquals("wrong extra dimension", 1, fragment.getExtraDimensions());
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0496() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0496", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[][][][]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[][][]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[][]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("not an array type", componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class[]", source);
- arrayType = (ArrayType) componentType;
- componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=42839
- */
- public void test0497() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0497", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$<
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- Type type = fieldDeclaration.getType();
- checkSourceRange(type, "Class[]", source);
- assertTrue("not an array type", type.isArrayType()); //$NON-NLS-1$
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("is an array type", !componentType.isArrayType()); //$NON-NLS-1$
- checkSourceRange(componentType, "Class", source);
- }
-
- /**
- */
- public void test0498() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0498", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=45199
- */
- public void test0499() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0499", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 1);
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- Expression expression = ((ExpressionStatement) node).getExpression();
- assertTrue("Not an assignment", expression.getNodeType() == ASTNode.ASSIGNMENT); //$NON-NLS-1$
- Assignment assignment = (Assignment) expression;
- Expression expression2 = assignment.getRightHandSide();
- assertTrue("Not an infix expression", expression2.getNodeType() == ASTNode.INFIX_EXPRESSION); //$NON-NLS-1$
- InfixExpression infixExpression = (InfixExpression) expression2;
- Expression expression3 = infixExpression.getLeftOperand();
- assertTrue("Not a simple name", expression3.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- ITypeBinding binding = expression3.resolveTypeBinding();
- assertNotNull("No binding", binding);
- Expression expression4 = assignment.getLeftHandSide();
- assertTrue("Not a simple name", expression4.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- ITypeBinding binding2 = expression4.resolveTypeBinding();
- assertNotNull("No binding", binding2);
- assertTrue("Should be the same", binding == binding2);
- }
-
- /**
- * Test for bug 45436 fix.
- * When this bug happened, the first assertion was false (2 problems found).
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=45436">bug 45436</a>
- * @throws JavaScriptModelException
- */
- public void test0500() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0500", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IJavaScriptProject project = sourceUnit.getJavaScriptProject();
- Map originalOptions = project.getOptions(false);
- try {
- project.setOption(JavaScriptCore.COMPILER_PB_INVALID_JAVADOC, JavaScriptCore.ERROR);
- project.setOption(JavaScriptCore.COMPILER_PB_MISSING_JAVADOC_TAGS, JavaScriptCore.ERROR);
- project.setOption(JavaScriptCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS, JavaScriptCore.ERROR);
- JavaScriptUnit result = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
- IProblem[] problems= result.getProblems();
- assertTrue(problems.length == 1);
- assertEquals("Invalid warning", "Javadoc: Missing tag for parameter a", problems[0].getMessage());
- } finally {
- project.setOptions(originalOptions);
- }
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46012
- */
- public void test0501() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0501", "JavaEditor.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull(result);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'i' in initializer
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement)getASTNode(unit, 0, 0, 0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;#0#i", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'j' in 'then' block in initializer
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 0, 1);
- Block block = (Block)ifStatement.getThenStatement();
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) block.statements().get(0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;#0#0#j", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'i' in 'foo()'
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement)getASTNode(unit, 0, 1, 0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;.foo()V#i", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502d() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'j' in 'then' block in 'foo()'
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 1, 1);
- Block block = (Block)ifStatement.getThenStatement();
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) block.statements().get(0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;.foo()V#0#j", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502e() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'j' in 'else' block in 'foo()'
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 1, 1);
- Block block = (Block)ifStatement.getElseStatement();
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) block.statements().get(0);
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) variableDeclarationStatement.fragments().get(0);
- IVariableBinding localBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A;.foo()V#1#j", localBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502f() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // first 'new Object(){...}' in 'foo()'
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 2);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$182;", typeBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502g() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'B' in 'foo()'
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 3);
- AbstractTypeDeclaration typeDeclaration = typeDeclarationStatement.getDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$206$B;", typeBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502h() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // second 'new Object(){...}' in 'foo()'
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 4);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$255;", typeBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502i() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'field' in 'B' in 'foo()'
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 3);
- AbstractTypeDeclaration abstractTypeDeclaration = typeDeclarationStatement.getDeclaration();
- assertEquals("Wrong type", abstractTypeDeclaration.getNodeType(), ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) abstractTypeDeclaration;
- FieldDeclaration fieldDeclaration = typeDeclaration.getFields()[0];
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fieldDeclaration.fragments().get(0);
- IVariableBinding fieldBinding = fragment.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$206$B;.field)I", fieldBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46013
- */
- public void test0502j() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0502", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // 'bar()' in 'B' in 'foo()'
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 3);
- AbstractTypeDeclaration abstractTypeDeclaration = typeDeclarationStatement.getDeclaration();
- assertEquals("Wrong type", abstractTypeDeclaration.getNodeType(), ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) abstractTypeDeclaration;
- FunctionDeclaration methodDeclaration = typeDeclaration.getMethods()[0];
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertEquals("Unexpected key", "Ltest0502/A$206$B;.bar()V", methodBinding.getKey()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // top level type A
- TypeDeclaration type = (TypeDeclaration)getASTNode(unit, 0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // member type B in A
- TypeDeclaration type = (TypeDeclaration)getASTNode(unit, 0, 0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$B", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // local type E in foo() in A
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) getASTNode(unit, 0, 1, 0);
- AbstractTypeDeclaration typeDeclaration = typeDeclarationStatement.getDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1$E", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503d() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // anonymous type new Object() {...} in foo() in A
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$2", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503e() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // type F in anonymous type new Object() {...} in foo() in A
- ExpressionStatement expressionStatement = (ExpressionStatement) getASTNode(unit, 0, 1, 1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- TypeDeclaration type = (TypeDeclaration) anonymousClassDeclaration.bodyDeclarations().get(0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$2$F", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503f() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // local type C in bar() in B in A
- FunctionDeclaration method = (FunctionDeclaration) getASTNode(unit, 0, 0, 0);
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) method.getBody().statements().get(0);
- AbstractTypeDeclaration typeDeclaration = typeDeclarationStatement.getDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1$C", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503g() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // anonymous type new Object() {...} in bar() in B in A
- FunctionDeclaration method = (FunctionDeclaration) getASTNode(unit, 0, 0, 0);
- ExpressionStatement expressionStatement = (ExpressionStatement) method.getBody().statements().get(1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding = anonymousClassDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503h() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // type D in anonymous type new Object() {...} in bar() in B in A
- FunctionDeclaration method = (FunctionDeclaration) getASTNode(unit, 0, 0, 0);
- ExpressionStatement expressionStatement = (ExpressionStatement) method.getBody().statements().get(1);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- TypeDeclaration type = (TypeDeclaration) anonymousClassDeclaration.bodyDeclarations().get(0);
- ITypeBinding typeBinding = type.resolveBinding();
- assertEquals("Unexpected binary name", "test0503.A$1$D", typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=46057
- */
- public void test0503i() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0503", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- JavaScriptUnit unit = (JavaScriptUnit)runConversion(AST.JLS3, sourceUnit, true);
-
- // unreachable type G in foo() in A
- IfStatement ifStatement = (IfStatement) getASTNode(unit, 0, 1, 2);
- Block block = (Block)ifStatement.getThenStatement();
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) block.statements().get(0);
- AbstractTypeDeclaration typeDeclaration = typeDeclarationStatement.getDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Unexpected binary name", null, typeBinding.getBinaryName()); //$NON-NLS-1$
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=47396
- */
- public void test0504() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0504", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0);
- assertNotNull(node);
- assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- assertTrue("A constructor", !declaration.isConstructor());
- checkSourceRange(declaration, "public method(final int parameter);", source);
- }
-
- /**
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=47396
- */
- public void test0505() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0505", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertTrue("not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0);
- assertNotNull(node);
- assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- assertTrue("A constructor", !declaration.isConstructor());
- checkSourceRange(declaration, "public method(final int parameter) { }", source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0506() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0506", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0507() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0507", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0508() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0508", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("not a default constructor", !binding.isDefaultConstructor());
- assertNotNull("Has no declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0509() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0509", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertTrue("not a default constructor", !binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0510() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0510", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertFalse("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=46699
- */
- public void test0511() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0511", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong number of problems", 0, (unit).getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- assertTrue("Not a class instance creation", expressionStatement.getExpression().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expressionStatement.getExpression();
- IFunctionBinding binding = classInstanceCreation.resolveConstructorBinding();
- assertFalse("is default constructor", binding.isDefaultConstructor());
- assertNull("Has a declaring node", unit.findDeclaringNode(binding));
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=47326
- */
- public void test0512() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0512", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong number of problems", 2, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- assertTrue("Not a constructor", declaration.isConstructor());
- checkSourceRange(declaration, "public A();", source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=49429
- */
- public void test0513() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0513", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48502
- */
- public void test0514() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0514", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=49204
- */
- public void test0515() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0515", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a if statement", node.getNodeType() == ASTNode.IF_STATEMENT);
- IfStatement ifStatement = (IfStatement) node;
- assertTrue("not an empty statement", ifStatement.getThenStatement().getNodeType() == ASTNode.EMPTY_STATEMENT);
- checkSourceRange(ifStatement.getThenStatement(), ";", source);
- Statement statement = ifStatement.getElseStatement();
- assertTrue("not a if statement", statement.getNodeType() == ASTNode.IF_STATEMENT);
- ifStatement = (IfStatement) statement;
- assertTrue("not an empty statement", ifStatement.getThenStatement().getNodeType() == ASTNode.EMPTY_STATEMENT);
- checkSourceRange(ifStatement.getThenStatement(), ";", source);
- Statement statement2 = ifStatement.getElseStatement();
- assertTrue("not an empty statement", statement2.getNodeType() == ASTNode.EMPTY_STATEMENT);
- checkSourceRange(statement2, ";", source);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- */
- public void test0516() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0516", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a type declaration", result2.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) result2;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue(declaration.subtreeMatch(new ASTMatcher(), bodyDeclaration));
- ASTNode root = bodyDeclaration.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 3, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- */
- public void test0517() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0517", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No comments", unit.getCommentList());
- assertEquals("Wrong size", 3, unit.getCommentList().size());
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
- FieldDeclaration declaration = (FieldDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a type declaration", result2.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) result2;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue(declaration.subtreeMatch(new ASTMatcher(), bodyDeclaration));
- ASTNode root = bodyDeclaration.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 2, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- */
- public void test0518() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0518", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not an initializer", node.getNodeType() == ASTNode.INITIALIZER);
- Initializer declaration = (Initializer) node;
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a type declaration", result2.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration typeDeclaration = (TypeDeclaration) result2;
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue(declaration.subtreeMatch(new ASTMatcher(), bodyDeclaration));
- ASTNode root = bodyDeclaration.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 3, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- */
- public void test0519() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0519", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No comments", unit.getCommentList());
- assertEquals("Wrong size", 2, unit.getCommentList().size());
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- ASTNode statement = node;
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_STATEMENTS);
- parser.setSource(source);
- parser.setSourceRange(statement.getStartPosition(), statement.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a block", result2.getNodeType() == ASTNode.BLOCK);
- Block block = (Block) result2;
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertTrue(statement.subtreeMatch(new ASTMatcher(), statement2));
- ASTNode root = statement2.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 1, compilationUnit.getCommentList().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- */
- public void test0520() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0520", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- assertNotNull("No comments", unit.getCommentList());
- assertEquals("Wrong size", 2, unit.getCommentList().size());
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a block", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_EXPRESSION);
- parser.setSource(source);
- parser.setSourceRange(expression.getStartPosition(), expression.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a method invocation", result2.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- assertTrue(expression.subtreeMatch(new ASTMatcher(), result2));
- ASTNode root = result2.getRoot();
- assertNotNull("No root", root);
- assertTrue("not a compilation unit", root.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) root;
- assertEquals("wrong problem size", 0, compilationUnit.getProblems().length);
- assertNotNull("No comments", compilationUnit.getCommentList());
- assertEquals("Wrong size", 1, compilationUnit.getCommentList().size());
- }
- /**
- * Ensure an OperationCanceledException is correcly thrown when progress monitor is canceled
- * @deprecated using deprecated code
- */
- public void test0521() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0521", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- // count the number of time isCanceled() is called when converting this source unit
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- CancelCounter counter = new CancelCounter();
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setSource(sourceUnit);
- parser.setResolveBindings(true);
- parser.setWorkingCopyOwner(owner);
- parser.createAST(counter);
-
- // throw an OperatonCanceledException at each point isCanceled() is called
- for (int i = 0; i < counter.count; i++) {
- boolean gotException = false;
- try {
- parser = ASTParser.newParser(AST.JLS2);
- parser.setSource(sourceUnit);
- parser.setResolveBindings(true);
- parser.setWorkingCopyOwner(owner);
- parser.createAST(new Canceler(i));
- } catch (OperationCanceledException e) {
- gotException = true;
- }
- assertTrue("Should get an OperationCanceledException (" + i + ")", gotException);
- }
-
- // last should not throw an OperationCanceledException
- parser = ASTParser.newParser(AST.JLS2);
- parser.setSource(sourceUnit);
- parser.setResolveBindings(true);
- parser.setWorkingCopyOwner(owner);
- parser.createAST(new Canceler(counter.count));
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0522() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0522", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull(methodBinding);
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNotNull("No binding", binding); //$NON-NLS-1$
- assertTrue("wrong type", binding.getKind() == IBinding.VARIABLE); //$NON-NLS-1$
- IVariableBinding variableBinding = (IVariableBinding) binding;
- assertEquals("Wrong name", "a", variableBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- IBinding binding2 = simpleName2.resolveBinding();
- assertNotNull("no binding2", binding2); //$NON-NLS-1$
- assertTrue("Wrong type", binding2.getKind() == IBinding.METHOD); //$NON-NLS-1$
- IFunctionBinding methodBinding2 = (IFunctionBinding) binding2;
- assertEquals("Wrong name", "clone", methodBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0523() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0523", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 1, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 2, statements.size());
- ASTNode node2 = (ASTNode) statements.get(1);
- assertNotNull(node2);
- assertTrue("Not an expression statement", node2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) node2;
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertTrue("Not a simple name", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding = simpleName.resolveBinding();
- assertNull("No binding", binding); //$NON-NLS-1$
- SimpleName simpleName2 = methodInvocation.getName();
- assertEquals("Wrong name", "clone", simpleName2.getIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0524() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0524", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0525() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0525", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertNotNull(methods);
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0526() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0526", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- IFunction[] methods = memberType.getFunctions();
- assertEquals("wrong size", 2, methods.length);
- IFunction method = methods[1];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "test", methodDeclaration.getName().getIdentifier());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0527() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0527", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- assertNotNull(type);
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertEquals("wrong name", "A", methodDeclaration.getName().getIdentifier());
- assertTrue("Not a constructor", methodDeclaration.isConstructor());
- IBinding binding = methodDeclaration.getName().resolveBinding();
- assertNotNull(binding);
- assertEquals("Wrong type", IBinding.METHOD, binding.getKind());
- List statements = ((FunctionDeclaration) node).getBody().statements();
- assertEquals("wrong size", 1, statements.size());
- ASTNode node2 = (ASTNode) statements.get(0);
- assertNotNull(node2);
- assertTrue("Not an variable declaration statement", node2.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node2;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertTrue("Not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- ITypeBinding typeBinding = classInstanceCreation.resolveTypeBinding();
- assertNotNull(typeBinding);
- assertTrue(typeBinding.isAnonymous());
- assertEquals("Wrong name", "", typeBinding.getName());
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0528() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0528", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, true);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0529() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0529", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IType[] memberTypes = type.getTypes();
- assertNotNull(memberTypes);
- assertEquals("wrong size", 1, memberTypes.length);
- IType memberType = memberTypes[0];
- ISourceRange sourceRange = memberType.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("wrong name", "B", typeDeclaration.getName().getIdentifier());
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertTrue("Not a method declaration", bodyDeclaration.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0530() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0530", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 3, methods.length);
- IFunction method = methods[2];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0531() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("Converter" , "bins", "test0531", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- IType type = classFile.getType();
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 5, methods.length);
- IFunction method = methods[3];
- ISourceRange sourceRange = method.getSourceRange();
- ASTNode result = runConversion(AST.JLS3, classFile, sourceRange.getOffset() + sourceRange.getLength() / 2, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48292
- */
- public void test0532() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0488", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertNotNull(types);
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IInitializer[] initializers = type.getInitializers();
- assertEquals("wrong size", 2, initializers.length);
- IInitializer init = initializers[1];
- ISourceRange sourceRange = init.getSourceRange();
- int position = sourceRange.getOffset() + sourceRange.getLength() / 2;
-
- IClassFile classFile = getClassFile("Converter" , "bins", "test0532", "A.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertNotNull(classFile);
- assertNotNull(classFile.getSource());
- type = classFile.getType();
- initializers = type.getInitializers();
- assertEquals("wrong size", 0, initializers.length);
- ASTNode result = runConversion(AST.JLS3, classFile, position, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT); //$NON-NLS-1$
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 5);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 4);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Wrong name", "field", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 1);
- assertTrue("Not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Wrong name", "i", fragment.getName().getIdentifier());
- assertNotNull("No initializer", expression);
-
- node = getASTNode((JavaScriptUnit) result, 0, 2);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- Initializer initializer = (Initializer) node;
- assertEquals("Not static", Modifier.NONE, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 3);
- assertTrue("Not an initializer", node.getNodeType() == ASTNode.INITIALIZER); //$NON-NLS-1$
- initializer = (Initializer) node;
- assertEquals("Not static", Modifier.STATIC, initializer.getModifiers());
- block = initializer.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
-
- node = getASTNode((JavaScriptUnit) result, 0, 6);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- methodDeclaration = (FunctionDeclaration) node;
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 0, statements.size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0533() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0533", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION);
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a compilation unit", result2.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result2;
- assertEquals("wrong problem size", 1, compilationUnit.getProblems().length);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0534() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0534", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
- FieldDeclaration declaration = (FieldDeclaration) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a compilation unit", result2.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result2;
- assertEquals("wrong problem size", 1, compilationUnit.getProblems().length);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=48489
- * @deprecated using deprecated code
- */
- public void test0535() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0535", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("not an initializer", node.getNodeType() == ASTNode.INITIALIZER);
- Initializer declaration = (Initializer) node;
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- parser.setSourceRange(declaration.getStartPosition(), declaration.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a compilation unit", result2.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result2;
- assertEquals("wrong problem size", 1, compilationUnit.getProblems().length);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=47396
- */
- public void test0536() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0536", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=51089
- */
- public void test0537a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0537", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=51089
- */
- public void test0537b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0537", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=51089
- */
- public void test0537c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0537", "C.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertNotNull("No compilation unit", result);
- }
- /**
- * Ensures that an AST can be created during reconcile.
- * @deprecated using deprecated code
- */
- public void test0538a() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " int i;\n" +
- "}"
- );
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- assertNotNull("No level 2 compilation unit", unit);
- assertEquals("Compilation unit has wrong AST level (2)", AST.JLS2, unit.getAST().apiLevel());
- // TODO improve test for AST.JLS3
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /*
- * Ensures that no AST is created during reconcile if not requested.
- */
- public void test0538b() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " int i;\n" +
- "}"
- );
- JavaScriptUnit unit = sourceUnit.reconcile(0, false, null, null);
- assertNull("Unexpected compilation unit", unit);
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that no AST is created during reconcile if consistent.
- */
- public void test0538c() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- sourceUnit.becomeWorkingCopy(null);
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- assertNull("Unexpected compilation unit", unit);
- // TODO improve test for AST.JLS3
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if the problem requestor is active.
- */
- public void test0538d() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " Object field;\n" +
- "}"
- );
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertTrue("Not original", isOriginal(node));
- assertTrue("not a field declaration", node.getNodeType() == ASTNode.FIELD_DECLARATION);
- FieldDeclaration declaration = (FieldDeclaration) node;
- Type type = declaration.getType();
- ITypeBinding typeBinding = type.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertEquals("Wrong name", "Object", typeBinding.getName());
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if force problem detection is turned on.
- * @deprecated using deprecated code
- */
- public void test0538e() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor();
- sourceUnit.becomeWorkingCopy(null);
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, true/*force pb detection*/, null, null);
- ASTNode node = getASTNode(unit, 0);
- assertNotNull("No node", node);
- assertTrue("not a type declaration", node.getNodeType() == ASTNode.TYPE_DECLARATION);
- TypeDeclaration declaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = declaration.resolveBinding();
- assertNotNull("No type binding", typeBinding);
- assertEquals("Wrong name", "A", typeBinding.getName());
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if force problem detection is turned on.
- * Case of a unit containing an anonymous type.
- * (regression test for bug 55102 NPE when using ICU.reconcile(GET_AST_TRUE, ...))
- * @deprecated using deprecated code
- */
- public void test0538f() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor();
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, true/*force pb detection*/, null, null);
- ASTNode node = getASTNode(unit, 0);
- assertNotNull("No node", node);
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that bindings are created during reconcile if force problem detection is turned on.
- * Case of a unit containing an anonymous type.
- * (regression test for bug 55102 NPE when using ICU.reconcile(GET_AST_TRUE, ...))
- * @deprecated using deprecated code
- */
- public void test0538g() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor();
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " void foo() {\n" +
- " new Object() {\n" +
- " void bar() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- sourceUnit.reconcile(IJavaScriptUnit.NO_AST, false/* don't force pb detection*/, null, null);
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, true/*force pb detection*/, null, null);
- ASTNode node = getASTNode(unit, 0);
- assertNotNull("No node", node);
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * Ensures that asking for well known type doesn't throw a NPE if the problem requestor is not active.
- * (regression test for bug 64750 NPE in Java AST Creation - editing some random file)
- * @deprecated using deprecated code
- */
- public void test0538h() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0538", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- try {
- ReconcilerTests.ProblemRequestor pbRequestor = new ReconcilerTests.ProblemRequestor() {
- public boolean isActive() {
- return false;
- }
- };
- sourceUnit.becomeWorkingCopy(null);
- sourceUnit.getBuffer().setContents(
- "package test0538;\n" +
- "public class A {\n" +
- " Object field;\n" +
- "}"
- );
- // TODO improve test for AST.JLS3
- JavaScriptUnit unit = sourceUnit.reconcile(AST.JLS2, false, null, null);
- assertEquals("Unexpected well known type", null, unit.getAST().resolveWellKnownType("void"));
- } finally {
- sourceUnit.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=53477
- */
- public void test0539() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0539", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertNotNull("No node", node);
- assertTrue("not an expression statement", node.getNodeType() == ASTNode.EXPRESSION_STATEMENT);
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertTrue("not a class instance creation", expression.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION);
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- checkSourceRange(classInstanceCreation, "new A(){}.new Inner(){/*x*/}", source);
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- Expression expression2 = classInstanceCreation.getExpression();
- assertTrue("not a class instance creation", expression2.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION);
- ClassInstanceCreation classInstanceCreation2 = (ClassInstanceCreation) expression2;
- AnonymousClassDeclaration anonymousClassDeclaration2 = classInstanceCreation2.getAnonymousClassDeclaration();
- assertNotNull("No anonymous class declaration", anonymousClassDeclaration2);
- checkSourceRange(anonymousClassDeclaration2, "{}", source);
- assertNotNull("No anonymous class declaration", anonymousClassDeclaration);
- checkSourceRange(anonymousClassDeclaration, "{/*x*/}", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=54431
- */
- public void test0540() {
- char[] source =
- ("package test0540;\n" + //$NON-NLS-1$
- "\n" + //$NON-NLS-1$
- "class Test {\n" + //$NON-NLS-1$
- " public void foo(int arg) {\n" +//$NON-NLS-1$
- " assert true;\n" +//$NON-NLS-1$
- " }\n" + //$NON-NLS-1$
- "}").toCharArray(); //$NON-NLS-1$
- IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
- Map options = project.getOptions(true);
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_4);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_4);
- ASTNode result = runConversion(AST.JLS3, source, "Test.js", project, options, true); //$NON-NLS-1$
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertEquals("Problems found", 0, compilationUnit.getProblems().length);
- ASTNode node = getASTNode(compilationUnit, 0);
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNotNull("No type binding", typeBinding); //$NON-NLS-1$
- assertEquals("Wrong name", "Test", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong package", "test0540", typeBinding.getPackage().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Not an interface", typeBinding.isClass()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=56697
- */
- public void test0541() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0541", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- class Change14FieldAccessASTVisitor extends ASTVisitor {
- int counter;
- Change14FieldAccessASTVisitor() {
- counter = 0;
- }
- public void endVisit(QualifiedName qualifiedName) {
- IBinding i_binding = qualifiedName.getQualifier().resolveBinding();
- ITypeBinding type_binding = qualifiedName.getQualifier().resolveTypeBinding();
- if (i_binding == null || type_binding == null) {
- counter++;
- }
- }
- }
- Change14FieldAccessASTVisitor visitor = new Change14FieldAccessASTVisitor();
- unit.accept(visitor);
- assertEquals("Missing binding", 0, visitor.counter);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55004
- */
- public void test0542() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0542", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "STRING_FIELD", variableBinding.getName());
- Object constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", "Hello world!", constantValue);
- Expression initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "\"Hello world!\"", source);
-
- node = getASTNode(unit, 0, 1);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "BOOLEAN_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Boolean(true), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "true", source);
-
- node = getASTNode(unit, 0, 2);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "BYTE_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Byte((byte)1), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "1", source);
-
- node = getASTNode(unit, 0, 3);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "CHAR_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Character('{'), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "\'{\'", source);
-
- node = getASTNode(unit, 0, 4);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "DOUBLE_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Double("3.1415"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "3.1415", source);
-
- node = getASTNode(unit, 0, 5);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "FLOAT_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Float("3.14159f"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "3.14159f", source);
-
- node = getASTNode(unit, 0, 6);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "INT_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", Integer.valueOf("7fffffff", 16), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "Integer.MAX_VALUE", source);
-
- node = getASTNode(unit, 0, 7);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "LONG_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Long("34"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "34L", source);
-
- node = getASTNode(unit, 0, 8);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "SHORT_FIELD", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant", constantValue);
- assertEquals("Wrong value", new Short("130"), constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "130", source);
-
- node = getASTNode(unit, 0, 9);
- assertTrue("not a field declaration", node instanceof FieldDeclaration); //$NON-NLS-1$
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "int_field", variableBinding.getName());
- constantValue = variableBinding.getConstantValue();
- assertNull("Got a constant", constantValue);
- initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- checkSourceRange(initializer, "Integer.MAX_VALUE", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=58436
- */
- public void test0543() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0543", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- unit.accept(new GetKeyVisitor());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51500
- */
- public void test0544() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0544", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Not an abstract method", (methodDeclaration.getModifiers() & Modifier.ABSTRACT) != 0);
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- assertNotNull("No binding", methodBinding);
- assertTrue("Not an abstract method binding", (methodBinding.getModifiers() & Modifier.ABSTRACT) != 0);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59843
- */
- public void test0545() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0545", "First.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/First$Test;", typeBinding.getKey());
-
- sourceUnit = getCompilationUnit("Converter", "src", "test0545", "Second.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- result = runConversion(AST.JLS3, sourceUnit, true);
- unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- node = getASTNode(unit, 0, 0);
- assertEquals("not a method declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- typeDeclaration = (TypeDeclaration) node;
- typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/Second$Test;", typeBinding.getKey());
-
- sourceUnit = getCompilationUnit("Converter", "src", "test0545", "Third.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- result = runConversion(AST.JLS3, sourceUnit, true);
- unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- node = getASTNode(unit, 0, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- typeDeclaration = (TypeDeclaration) node;
- typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/Third$Test;", typeBinding.getKey());
-
-
- sourceUnit = getCompilationUnit("Converter", "src", "test0545", "Test.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- result = runConversion(AST.JLS3, sourceUnit, true);
- unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- node = getASTNode(unit, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- typeDeclaration = (TypeDeclaration) node;
- typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0545/Test;", typeBinding.getKey());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59848
- */
- public void test0546() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0546", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 0, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 1, 0, 0);
- assertEquals("not a variable declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) node;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- ITypeBinding typeBinding = variableBinding.getType();
- assertTrue("An anonymous type binding", !typeBinding.isAnonymous());
- Expression initializer = fragment.getInitializer();
- assertEquals("not a class instance creation", ASTNode.CLASS_INSTANCE_CREATION, initializer.getNodeType()); //$NON-NLS-1$
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) initializer;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- ITypeBinding typeBinding2 = anonymousClassDeclaration.resolveBinding();
- assertTrue("Not an anonymous type binding", typeBinding2.isAnonymous());
- ITypeBinding typeBinding3 = classInstanceCreation.resolveTypeBinding();
- assertTrue("Not an anonymous type binding", typeBinding3.isAnonymous());
- node = getASTNode(unit, 1, 0, 1);
- assertEquals("not a expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- ExpressionStatement statement = (ExpressionStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("not a method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType()); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- assertEquals("not a simple name", ASTNode.SIMPLE_NAME, expression2.getNodeType()); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- ITypeBinding typeBinding4 = simpleName.resolveTypeBinding();
- assertTrue("An anonymous type binding", !typeBinding4.isAnonymous());
- Type type = classInstanceCreation.getType();
- IBinding binding = type.resolveBinding();
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind());
- ITypeBinding typeBinding5 = (ITypeBinding) binding;
- assertTrue("An anonymous type binding", !typeBinding5.isAnonymous());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60078
- */
- public void test0547() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0547", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertEquals("Wrong number of problems", 1, unit.getProblems().length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType()); //$NON-NLS-1$
- TypeDeclarationStatement typeDeclarationStatement = (TypeDeclarationStatement) node;
- AbstractTypeDeclaration typeDeclaration = typeDeclarationStatement.getDeclaration();
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertEquals("Wrong key", "Ltest0547/A$74$Local;", typeBinding.getKey());
-
- List bodyDeclarations = typeDeclaration.bodyDeclarations();
- assertEquals("wrong size", 3, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertEquals("not a type declaration statement", ASTNode.TYPE_DECLARATION, bodyDeclaration.getNodeType()); //$NON-NLS-1$
- TypeDeclaration typeDeclaration2 = (TypeDeclaration) bodyDeclaration;
-
- typeBinding = typeDeclaration2.resolveBinding();
- assertEquals("Wrong key", "Ltest0547/A$100$LocalMember;", typeBinding.getKey());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60581
- */
- public void test0548() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0548", "PaletteStackEditPart.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48502
- */
- public void test0549() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0549", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48502
- */
- public void test0550() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0550", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60848
- */
- public void test0551() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0551", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 1, problems.length); //$NON-NLS-1$
- IProblem problem = problems[0];
- assertEquals("wrong end position", source.length - 1, problem.getSourceEnd());
- }
-
- public void test0552() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0552", "Test.js");
- char[] source = sourceUnit.getSource().toCharArray();
- JavaScriptUnit result = (JavaScriptUnit) runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("Got errors", 0, result.getProblems().length);
- TypeDeclaration declaration = (TypeDeclaration) result.types().get(0);
- Block body = declaration.getMethods()[0].getBody();
- ExpressionStatement expr = (ExpressionStatement) body.statements().get(0);
- FunctionInvocation invocation = (FunctionInvocation) expr.getExpression();
- InfixExpression node = (InfixExpression) invocation.arguments().get(0);
- ITypeBinding typeBinding = node.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- checkSourceRange(node, "\"a\" + \"a\" + \"a\"", source);
- List extendedOperands = node.extendedOperands();
- assertEquals("Wrong size", 1, extendedOperands.size());
- Expression leftOperand = node.getLeftOperand();
- checkSourceRange(leftOperand, "\"a\"", source);
- typeBinding = leftOperand.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- Expression rightOperand = node.getRightOperand();
- checkSourceRange(rightOperand, "\"a\"", source);
- typeBinding = rightOperand.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- Expression expression = (Expression) extendedOperands.get(0);
- checkSourceRange(expression, "\"a\"", source);
- typeBinding = expression.resolveTypeBinding();
- assertEquals("wrong type", "java.lang.String", typeBinding.getQualifiedName());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61946
- */
- public void test0553() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0553", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- Object constantValue = variableBinding.getConstantValue();
- assertNull("Got a constant value", constantValue);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61946
- */
- public void test0554() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0554", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertEquals("Not a method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- checkSourceRange(expression2, "A", source);
- ITypeBinding typeBinding = expression2.resolveTypeBinding();
- assertEquals("wrong type", "test0554.A", typeBinding.getQualifiedName());
- IVariableBinding[] fields = typeBinding.getDeclaredFields();
- assertEquals("Wrong size", 1, fields.length);
- IVariableBinding variableBinding = fields[0];
- Object constantValue = variableBinding.getConstantValue();
- assertNotNull("Missing constant", constantValue);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61946
- */
- public void test0555() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0555", "B.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement returnStatement = (ReturnStatement) node;
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) expression;
- Name name = qualifiedName.getQualifier();
- checkSourceRange(name, "A", source);
- ITypeBinding typeBinding = name.resolveTypeBinding();
- assertEquals("wrong type", "test0555.A", typeBinding.getQualifiedName());
- IVariableBinding[] fields = typeBinding.getDeclaredFields();
- assertEquals("Wrong size", 1, fields.length);
- IVariableBinding variableBinding = fields[0];
- Object constantValue = variableBinding.getConstantValue();
- assertNotNull("No constant value", constantValue);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=62463
- */
- public void test0556() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0556", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- checkSourceRange(expression2, "(aa.bar())", source);
- SimpleName simpleName = methodInvocation.getName();
- checkSourceRange(simpleName, "size", source);
- checkSourceRange(expression, "(aa.bar()).size()", source);
- checkSourceRange(expressionStatement, "(aa.bar()).size();", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=62463
- */
- public void test0557() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0557", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 1, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not an method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- Expression expression2 = methodInvocation.getExpression();
- checkSourceRange(expression2, "(aa.bar())", source);
- SimpleName simpleName = methodInvocation.getName();
- checkSourceRange(simpleName, "get", source);
- checkSourceRange(expression, "(aa.bar()).get(0)", source);
- checkSourceRange(expressionStatement, "(aa.bar()).get(0);", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65090
- * @deprecated using deprecated code
- */
- public void test0558() {
- String src = "\tSystem.out.println(\"Hello\");\n\tSystem.out.println(\"World\");\n";
- char[] source = src.toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS2);
- parser.setKind (ASTParser.K_STATEMENTS);
- parser.setSource (source);
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- assertEquals("Wrong type", ASTNode.BLOCK, result.getNodeType());
- Block block = (Block) result;
- List statements = block.statements();
- assertNotNull("No statements", statements);
- assertEquals("Wrong size", 2, statements.size());
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0559() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0559", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0560() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0560", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0561() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0561", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0562() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0562", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, expression4.getNodeType());
- checkSourceRange(expression4, "\" \"", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0563() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0563", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- checkSourceRange(expression4, "new String()", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0564() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0564", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- checkSourceRange(expression4, "new String()", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65562
- */
- public void test0565() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0565", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertEquals("Wrong type", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Wrong type", ASTNode.INFIX_EXPRESSION, expression.getNodeType());
- InfixExpression infixExpression = (InfixExpression) expression;
- Expression expression2 = infixExpression.getLeftOperand();
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression2.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression2;
- Expression expression3 = methodInvocation.getExpression();
- assertEquals("Wrong type", ASTNode.PARENTHESIZED_EXPRESSION, expression3.getNodeType());
- ParenthesizedExpression parenthesizedExpression = (ParenthesizedExpression) expression3;
- Expression expression4 = parenthesizedExpression.getExpression();
- checkSourceRange(expression4, "(/**/ String /**/) new String()", source);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=69349
- */
- public void test0566() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0566", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- assertEquals("Wrong character", '}', source[node.getStartPosition() + node.getLength() - 1]);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=69349
- */
- public void test0567() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0567", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- assertEquals("Wrong character", '}', source[node.getStartPosition() + node.getLength() - 1]);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=70398
- */
- public void test0568() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0568", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=70398
- */
- public void test0570() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0570", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- }
-
- /**
- * No binding when there is no unit name set
- */
- public void test0571() throws JavaScriptModelException {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- String source = "public class A {public boolean foo() {}}";
- parser.setSource(source.toCharArray());
- parser.setProject(getJavaProject("Converter"));
- // no unit name parser.setUnitName("A");
- parser.setResolveBindings(true);
- ASTNode node = parser.createAST(null);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) node;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- }
-
- /**
- * No binding when there is no unit name set
- */
- public void test0572() throws JavaScriptModelException {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- String source = "public class A {public boolean foo() {}}";
- parser.setSource(source.toCharArray());
- parser.setProject(getJavaProject("Converter"));
- parser.setUnitName("A");
- parser.setResolveBindings(true);
- ASTNode node = parser.createAST(null);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) node;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 1, problems.length); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=77968
- */
- public void test0573() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0573", "Z.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String source = sourceUnit.getSource();
- int pos = source.indexOf("his.ba");
- ASTNode result = runConversion(AST.JLS3, sourceUnit, pos, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("Missing node", node);
- assertEquals("Wrong type", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) node;
- Expression expression = expressionStatement.getExpression();
- assertNotNull("Missing node", expression);
- assertEquals("Wrong type", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 1, problems.length); //$NON-NLS-1$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78735
- */
- public void test0574() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0574", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("Missing node", node);
- assertEquals("Wrong type", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- node = getASTNode(unit, 0, 1, 0);
- assertNotNull("Missing node", node);
- assertEquals("Wrong type", ASTNode.FIELD_DECLARATION, node.getNodeType());
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding2 = fragment.resolveBinding();
- assertFalse("are Equals", variableBinding.isEqualTo(variableBinding2));
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78735
- */
- public void test0575() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0575", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- final IProblem[] problems = unit.getProblems();
- assertEquals("Wrong number of problems", 0, problems.length); //$NON-NLS-1$
- ASTNode node = getASTNode(unit, 0, 2);
- assertNotNull("Missing node", node);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
- node = getASTNode(unit, 0, 1, 1);
- assertNotNull("Missing node", node);
- assertEquals("Wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- methodDeclaration = (FunctionDeclaration) node;
- IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding();
- assertFalse("are Equals", methodBinding.isEqualTo(methodBinding2));
- }
-
-// /**
-// * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78740
-// * @deprecated marked deprecated to suppress JDOM-related deprecation warnings
-// */
-// public void test0576() throws JavaScriptModelException {
-// org.eclipse.wst.jsdt.core.jdom.DOMFactory factory = new org.eclipse.wst.jsdt.core.jdom.DOMFactory();
-// org.eclipse.wst.jsdt.core.jdom.IDOMCompilationUnit domCompilationUnit = factory.createCompilationUnit(
-// "package x; /** @model */ interface X {}", "NAME");
-// org.eclipse.wst.jsdt.core.jdom.IDOMType domType = (org.eclipse.wst.jsdt.core.jdom.IDOMType) domCompilationUnit.getFirstChild().getNextNode();
-// assertTrue("Not an interface", Flags.isInterface(domType.getFlags()));
-// domType.getComment();
-// assertTrue("Not an interface", Flags.isInterface(domType.getFlags()));
-// }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=77645
- */
- public void test0578() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0578", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 0);
- unit.accept(new ASTVisitor() {
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration)
- */
- public boolean visit(SingleVariableDeclaration node) {
- IVariableBinding binding = node.resolveBinding();
- assertNotNull("No method", binding.getDeclaringMethod());
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment)
- */
- public boolean visit(VariableDeclarationFragment node) {
- IVariableBinding binding = node.resolveBinding();
- ASTNode parent = node.getParent();
- if (parent != null && binding != null) {
- final IFunctionBinding declaringMethod = binding.getDeclaringMethod();
- final String variableBindingName = binding.getName();
- switch(parent.getNodeType()) {
- case ASTNode.FIELD_DECLARATION :
- assertNull("Got a method", declaringMethod);
- break;
- default :
- if (variableBindingName.equals("var1")
- || variableBindingName.equals("var2")) {
- assertNull("Got a method", declaringMethod);
- } else {
- assertNotNull("No method", declaringMethod);
- String methodName = declaringMethod.getName();
- if (variableBindingName.equals("var4")) {
- assertEquals("Wrong method", "foo", methodName);
- } else if (variableBindingName.equals("var5")) {
- assertEquals("Wrong method", "foo2", methodName);
- } else if (variableBindingName.equals("var7")) {
- assertEquals("Wrong method", "foo3", methodName);
- } else if (variableBindingName.equals("var8")) {
- assertEquals("Wrong method", "X", methodName);
- } else if (variableBindingName.equals("var9")) {
- assertEquals("Wrong method", "bar3", methodName);
- } else if (variableBindingName.equals("var10")) {
- assertEquals("Wrong method", "bar3", methodName);
- } else if (variableBindingName.equals("var11")) {
- assertEquals("Wrong method", "X", methodName);
- }
- }
- }
- }
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.FieldAccess)
- */
- public boolean visit(FieldAccess node) {
- IVariableBinding binding = node.resolveFieldBinding();
- assertNull("No method", binding.getDeclaringMethod());
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.SuperFieldAccess)
- */
- public boolean visit(SuperFieldAccess node) {
- IVariableBinding binding = node.resolveFieldBinding();
- assertNull("No method", binding.getDeclaringMethod());
- return false;
- }
- });
- }
-
-// /**
-// * https://bugs.eclipse.org/bugs/show_bug.cgi?id=77984
-// * @deprecated
-// */
-// public void test0579() throws JavaScriptModelException {
-// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0579", "ParserTask.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-// ASTNode result = AST.parseCompilationUnit(sourceUnit, true);
-// assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
-// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
-// ASTNode node = getASTNode(compilationUnit, 0);
-// assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
-// TypeDeclaration typeDeclaration = (TypeDeclaration) node;
-// assertEquals("Wrong number of body declarations", 3, typeDeclaration.bodyDeclarations().size());
-// }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79953
- */
- public void test0580() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/p/X.js", true/*resolve*/);
- String source = "package p;\n" +
- "public class X {\n" +
- " d String[][]tab;\n" +
- "}";
- ASTNode node = buildAST(
- source,
- workingCopy,
- false);
- assertEquals("wrong type", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- node = getASTNode(compilationUnit, 0, 0);
- assertEquals("wrong type", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- checkSourceRange(fieldDeclaration, "d String[][]", source.toCharArray());
- Type type = fieldDeclaration.getType();
- assertTrue("Not a simple type", type.isSimpleType());
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- assertEquals("Wrong extended dimensions", 2, fragment.getExtraDimensions());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=80041
- */
- public void test0581() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/p/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- "package p;\n" +
- "public class X {\n" +
- " void m(Object obj) {}\n" +
- " void foo(Object obj) {}\n" +
- "}",
- workingCopy);
- assertEquals("wrong type", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- node = getASTNode(compilationUnit, 0, 0);
- assertEquals("wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- IVariableBinding variableBinding = variableDeclaration.resolveBinding();
- node = getASTNode(compilationUnit, 0, 1);
- assertEquals("wrong type", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- methodDeclaration = (FunctionDeclaration) node;
- parameters = methodDeclaration.parameters();
- variableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- IVariableBinding variableBinding2 = variableDeclaration.resolveBinding();
- assertFalse("Bindings are equal", variableBinding.isEqualTo(variableBinding2));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=80338
- */
- // TODO (jerome) remove this test as it has nothing to do on ASTConverterTest and it is a dup of ExistenceTests#testMethodWithInvalidParameter()
- public void test0582() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0582", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IType[] types = sourceUnit.getTypes();
- assertEquals("wrong size", 1, types.length);
- IType type = types[0];
- IFunction[] methods = type.getFunctions();
- assertEquals("wrong size", 1, methods.length);
- IFunction method = methods[0];
- assertEquals("wrong number", 1, method.getNumberOfParameters());
- assertEquals("wrong signature", "([[I)[[[[[I", method.getSignature());
- assertEquals("wrong return type", "[[[[[I", method.getReturnType());
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0583() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\000\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\000', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0584() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\u0020\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", 32, literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0585() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\b\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\b', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0586() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\t\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\t', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0587() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\n\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\n', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0588() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\f\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\f', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0589() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\r\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\r', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0590() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\\"\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\"', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0591() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\'\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\'', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0592() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\\\\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\\', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0593() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\077\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a return statement", ASTNode.RETURN_STATEMENT, node.getNodeType());
- ReturnStatement statement = (ReturnStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a character literal", ASTNode.CHARACTER_LITERAL, expression.getNodeType());
- CharacterLiteral literal = (CharacterLiteral) expression;
- assertEquals("Wrong character", '\077', literal.charValue());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82616
- */
- public void test0594() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " private char nextChar() {\n" +
- " return \'\\777\';\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 1, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("not malformed", isMalformed(methodDeclaration));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82985
- */
- public void test0595() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0595", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(result);
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- assertProblemsSize(compilationUnit, 0);
- List imports = compilationUnit.imports();
- assertEquals("Wrong size", 1, imports.size());
- ImportDeclaration importDeclaration = (ImportDeclaration) imports.get(0);
- IBinding binding = importDeclaration.resolveBinding();
- assertNotNull("No binding", binding);
- assertEquals("Wrong type", IBinding.TYPE, binding.getKind());
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83098
- */
- public void test0596() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void m(String[] args) {\n" +
- " for (int i= 0; i < args.length; i++) {\n" +
- " String string= args[i];\n" +
- " }\n" +
- " for (int i= 0; i < args.length; i++) {\n" +
- " String string= args[i];\n" +
- " }\n" +
- " }\n" +
- "}\n";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Got problems", 0, compilationUnit.getProblems().length);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not a for statement", ASTNode.FOR_STATEMENT, node.getNodeType());
- ForStatement forStatement = (ForStatement) node;
- Statement action = forStatement.getBody();
- assertEquals("Not a block", ASTNode.BLOCK, action.getNodeType());
- Block block = (Block) action;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- Statement statement = (Statement) statements.get(0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement.getNodeType());
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
-
- node = getASTNode(compilationUnit, 0, 0, 1);
- assertEquals("Not a for statement", ASTNode.FOR_STATEMENT, node.getNodeType());
- forStatement = (ForStatement) node;
- action = forStatement.getBody();
- assertEquals("Not a block", ASTNode.BLOCK, action.getNodeType());
- block = (Block) action;
- statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- statement = (Statement) statements.get(0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement.getNodeType());
- variableDeclarationStatement = (VariableDeclarationStatement) statement;
- fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding2 = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding2);
-
- assertFalse("Bindings are equals", variableBinding.isEqualTo(variableBinding2));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83210
- */
- public void test0597() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0597", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Expression expression = ifStatement.getExpression();
- assertEquals("Not an instanceof expression", ASTNode.INSTANCEOF_EXPRESSION, expression.getNodeType());
- InstanceofExpression instanceofExpression = (InstanceofExpression) expression;
- Type type = instanceofExpression.getRightOperand();
- assertEquals("Not a simple type", ASTNode.SIMPLE_TYPE, type.getNodeType());
- SimpleType simpleType = (SimpleType) type;
- Name name = simpleType.getName();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType());
- SimpleName simpleName = (SimpleName) name;
- ITypeBinding typeBinding = simpleName.resolveTypeBinding();
-
- List imports = compilationUnit.imports();
- assertEquals("Wrong size", 2, imports.size());
- ImportDeclaration importDeclaration = (ImportDeclaration) imports.get(0);
- name = importDeclaration.getName();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, name.getNodeType());
- QualifiedName qualifiedName = (QualifiedName) name;
- simpleName = qualifiedName.getName();
- ITypeBinding typeBinding2 = simpleName.resolveTypeBinding();
-
- assertTrue("not identical", typeBinding == typeBinding2);
- assertTrue("not identical", typeBinding.isEqualTo(typeBinding2));
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=84778
- */
- public void test0598() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " int m(int i) {\n" +
- " return /*start*/1 + 2 + ++i/*end*/;\n" +
- " }\n" +
- "}\n";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, node.getNodeType());
- assertEquals("Wrong debug string", "1 + 2 + ++i", node.toString());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86541
- */
- public void test0599() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0599", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- String expectedResult =
- "The hierarchy of the type X is inconsistent\n" +
- "The type test0599.Zork2 cannot be resolved. It is indirectly referenced from required .class files";
- assertProblemsSize(compilationUnit, 2, expectedResult);
- compilationUnit.accept(new ASTVisitor() {
- public void endVisit(FunctionDeclaration methodDeclaration) {
- Block body = methodDeclaration.getBody();
- assertNotNull("No body", body);
- assertTrue("No statements", body.statements().size() != 0);
- }
- });
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=87777
- */
- public void test0600() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0600", "Try.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- node = getASTNode(compilationUnit, 0, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement statement = (ExpressionStatement) node;
- Expression expression = statement.getExpression();
- assertEquals("Not a method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- IFunctionBinding methodBinding = methodInvocation.resolveMethodBinding().getMethodDeclaration();
-
- sourceUnit = getCompilationUnit("Converter" , "src", "test0600", "C.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- node = getASTNode(compilationUnit, 0, 0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding().getMethodDeclaration();
-
- assertTrue("Not equals", methodBinding.isEqualTo(methodBinding2));
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=89014
- */
- public void test0601() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " Runnable one= new Runnable(){\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- " Runnable two= new Runnable(){\n" +
- " public void run() {\n" +
- " }\n" +
- " };\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- node = getASTNode(compilationUnit, 0, 0);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not a class instance creation", ASTNode.CLASS_INSTANCE_CREATION, expression.getNodeType());
- ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;
- AnonymousClassDeclaration anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- assertNotNull("No anonymous", anonymousClassDeclaration);
- List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
-
- node = getASTNode(compilationUnit, 0, 1);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- fieldDeclaration = (FieldDeclaration) node;
- fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Not a class instance creation", ASTNode.CLASS_INSTANCE_CREATION, expression.getNodeType());
- classInstanceCreation = (ClassInstanceCreation) expression;
- anonymousClassDeclaration = classInstanceCreation.getAnonymousClassDeclaration();
- assertNotNull("No anonymous", anonymousClassDeclaration);
- bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding();
-
- assertFalse("Bindings are equals", methodBinding.isEqualTo(methodBinding2));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=70526
- */
- public void test0602() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0602", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- compilationUnit.accept(new ASTVisitor() {
- public boolean visit(StringLiteral stringLiteral) {
- assertTrue("Wrong start position", stringLiteral.getStartPosition() != 0);
- assertTrue("Wrong length", stringLiteral.getLength() != -1);
- return false;
- }
- });
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91098
- */
- public void test0603() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0603", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- assertProblemsSize(compilationUnit, 0);
- compilationUnit.accept(new ASTVisitor() {
- public boolean visit(SimpleType type) {
- assertFalse("start cannot be -1", type.getStartPosition() == -1);
- assertFalse("length cannot be 0", type.getLength() == 0);
- return false;
- }
- public boolean visit(ArrayType type) {
- assertFalse("start cannot be -1", type.getStartPosition() == -1);
- assertFalse("length cannot be 0", type.getLength() == 0);
- return true;
- }
- });
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91098
- */
- public void test0604() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0604", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- assertProblemsSize(compilationUnit, 0);
- compilationUnit.accept(new ASTVisitor() {
- public boolean visit(SimpleType type) {
- assertFalse("start cannot be -1", type.getStartPosition() == -1);
- assertFalse("length cannot be 0", type.getLength() == 0);
- return false;
- }
- public boolean visit(ArrayType type) {
- assertFalse("start cannot be -1", type.getStartPosition() == -1);
- assertFalse("length cannot be 0", type.getLength() == 0);
- return true;
- }
- });
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=92059
- * check resolvedType binding from variable ref (of array type)
- */
- public void test0605() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0605", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode node = runJLS3Conversion(sourceUnit, true, false);
- assertNotNull(node);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- node = getASTNode(compilationUnit, 0, 0, 1);
- assertEquals("Not a variable declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement varDecl = (VariableDeclarationStatement) node;
- List fragments = varDecl.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression.getNodeType());
- IBinding arraylength = ((QualifiedName)expression).resolveBinding();
- IJavaScriptElement element = arraylength.getJavaElement();
- assertNull("Shouldn't be binding for arraylength", element);
- Name name = ((QualifiedName) expression).getQualifier();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType());
- ITypeBinding binding = name.resolveTypeBinding();
- assertNotNull("No binding", binding);
- assertTrue("No array", binding.isArray());
-
- node = getASTNode(compilationUnit, 0, 0, 4);
- assertEquals("Not a variable declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- varDecl = (VariableDeclarationStatement) node;
- fragments = varDecl.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression.getNodeType());
- name = ((QualifiedName) expression).getQualifier();
- assertEquals("Not a simple name", ASTNode.QUALIFIED_NAME, name.getNodeType());
- name = ((QualifiedName) name).getName();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType());
- ITypeBinding binding2 = name.resolveTypeBinding();
- assertNotNull("No binding", binding2);
- assertTrue("No array", binding2.isArray());
-
- assertEquals("Not same binding", binding, binding2);
-
- node = getASTNode(compilationUnit, 0, 0, 2);
- assertEquals("Not a variable declaration", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- varDecl = (VariableDeclarationStatement) node;
- fragments = varDecl.fragments();
- fragment = (VariableDeclarationFragment) fragments.get(0);
- expression = fragment.getInitializer();
- assertEquals("Not a qualified name", ASTNode.FIELD_ACCESS, expression.getNodeType());
- expression = ((FieldAccess) expression).getExpression();
- assertEquals("Not a simple name", ASTNode.FIELD_ACCESS, expression.getNodeType());
- name = ((FieldAccess) expression).getName();
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType());
- ITypeBinding binding3 = name.resolveTypeBinding();
- assertNotNull("No binding", binding3);
- assertTrue("No array", binding3.isArray());
-
- assertEquals("Not same binding", binding, binding3);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=89014
- */
- public void test0606() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int i = 0;\n" +
- " i += 1;\n" +
- " String s = \"\";\n" +
- " s += \"hello world\";\n" +
- " System.out.println(i+s);\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertProblemsSize(compilationUnit, 0);
- node = getASTNode(compilationUnit, 0, 0, 1);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- Expression expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- Assignment assignment = (Assignment) expression;
- assertEquals("Wrong operator", Assignment.Operator.PLUS_ASSIGN, assignment.getOperator());
- ITypeBinding typeBinding = assignment.resolveTypeBinding();
- assertNotNull("No binding", typeBinding);
- assertEquals("Wrong type", "int", typeBinding.getQualifiedName());
-
- node = getASTNode(compilationUnit, 0, 0, 3);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not an assignment", ASTNode.ASSIGNMENT, expression.getNodeType());
- assignment = (Assignment) expression;
- assertEquals("Wrong operator", Assignment.Operator.PLUS_ASSIGN, assignment.getOperator());
- typeBinding = assignment.resolveTypeBinding();
- assertNotNull("No binding", typeBinding);
- assertEquals("Wrong type", "java.lang.String", typeBinding.getQualifiedName());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=95262
- */
- public void test0607() throws JavaScriptModelException {
- final char[] source = "private static Category[] values = new Category[]{v1, v2, v3};".toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setSource(source);
- ASTNode root = parser.createAST(null);
- assertNotNull("cannot be null", root);
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=96698
- */
- public void test0608() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " for (int /*start*/i = 0/*end*/; i < args.length; i++) {\n" +
- " System.out.println(args[i]);\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a variable declaration fragment", ASTNode.VARIABLE_DECLARATION_FRAGMENT, node.getNodeType());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) node;
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- IJavaScriptElement javaElement = variableBinding.getJavaElement();
- assertNotNull("No java element", javaElement);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=96698
- */
- public void test0609() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int /*start*/i = 0/*end*/;\n" +
- " System.out.println(i);\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a variable declaration fragment", ASTNode.VARIABLE_DECLARATION_FRAGMENT, node.getNodeType());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) node;
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- IJavaScriptElement javaElement = variableBinding.getJavaElement();
- assertNotNull("No java element", javaElement);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=98088
- */
- public void test0610() throws JavaScriptModelException {
- final IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0610", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- final ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 1, "The type Test is deprecated");
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=96698
- */
- public void test0611() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "abstract class SearchPattern {\n" +
- "}\n" +
- "class InternalSearchPattern extends SearchPattern {\n" +
- " boolean mustResolve;\n" +
- "}\n" +
- "public class X {\n" +
- " public static final int POSSIBLE_MATCH = 0;\n" +
- " public static final int ACCURATE_MATCH = 1;\n" +
- " \n" +
- " public void foo(SearchPattern pattern) {\n" +
- " int declarationLevel = ((InternalSearchPattern) pattern).mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n" +
- " System.out.println(declarationLevel);\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 2, 2, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- checkSourceRange(expression, "((InternalSearchPattern) pattern).mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- public void test0612() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo(boolean[]value) {\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("Wrong size", 1, parameters.size());
- SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(variableDeclaration, "boolean[]value", contents);
- Type type = variableDeclaration.getType();
- checkSourceRange(type, "boolean[]", contents);
- assertTrue("Not an array type", type.isArrayType());
- ArrayType arrayType = (ArrayType) type;
- Type componentType = arrayType.getComponentType();
- assertTrue("Not a primitive type", componentType.isPrimitiveType());
- PrimitiveType primitiveType = (PrimitiveType) componentType;
- assertEquals("Not boolean", PrimitiveType.BOOLEAN, primitiveType.getPrimitiveTypeCode());
- checkSourceRange(primitiveType, "boolean", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- public void test0613() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo(boolean b) {\n" +
- " Zork z = null;\n" +
- " if (b) {\n" +
- " System.out.println(z);\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1, "Zork cannot be resolved to a type");
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding binding = fragment.resolveBinding();
- assertNull("Got a binding", binding);
-
- node = getASTNode(unit, 0, 0, 1);
- assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Statement statement2 = ifStatement.getThenStatement();
- assertEquals("Not a block", ASTNode.BLOCK, statement2.getNodeType());
- Block block = (Block) statement2;
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
-
- Statement statement3 = (Statement) statements.get(0);
- assertEquals("Not a expression statement", ASTNode.EXPRESSION_STATEMENT, statement3.getNodeType());
- ExpressionStatement expressionStatement = (ExpressionStatement) statement3;
- Expression expression = expressionStatement.getExpression();
- assertEquals("Not a method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- List arguments = methodInvocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- Expression expression2 = (Expression) arguments.get(0);
- ITypeBinding typeBinding = expression2.resolveTypeBinding();
- assertNull("Got a binding", typeBinding);
- assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, expression2.getNodeType());
- SimpleName simpleName = (SimpleName) expression2;
- IBinding binding2 = simpleName.resolveBinding();
- assertNull("Got a binding", binding2);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=105192
- public void test0614() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "class T { void m() { for (i=0, j=0; i<10; i++, j++) ; }}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", false/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- final String expectedOutput = "class T {\n" +
- " void m(){\n" +
- " for (i=0, j=0; i < 10; i++, j++) ;\n" +
- " }\n" +
- "}\n";
- assertEquals("Wrong output", Util.convertToIndependantLineDelimiter(expectedOutput), Util.convertToIndependantLineDelimiter(node.toString()));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=100041
- */
- public void test0615() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "class X {\n" +
- " static Object object;\n" +
- " static void foo() {\n" +
- " /**\n" +
- " * javadoc comment.\n" +
- " */\n" +
- " if (object instanceof String) {\n" +
- " final String clr = null;\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 1, 0);
- assertNotNull("No node", node);
- assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- String expectedSource = "if (object instanceof String) {\n" +
- " final String clr = null;\n" +
- " }";
- checkSourceRange(ifStatement, expectedSource, contents);
- Statement statement = ifStatement.getThenStatement();
- assertNotNull("No then statement", statement);
- assertEquals("not a block", ASTNode.BLOCK, statement.getNodeType());
- Block block = (Block) statement;
- expectedSource = "{\n" +
- " final String clr = null;\n" +
- " }";
- checkSourceRange(block, expectedSource, contents);
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement2.getNodeType());
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement2;
- checkSourceRange(variableDeclarationStatement, "final String clr = null;", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=109333
- */
- public void test0616() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "class X {\n" +
- " boolean val = true && false && true && false && true;\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertEquals("Not a field declaration ", ASTNode.FIELD_DECLARATION, node.getNodeType());
- final FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- final List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- final Expression initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, initializer.getNodeType());
- InfixExpression infixExpression = (InfixExpression) initializer;
- final List extendedOperands = infixExpression.extendedOperands();
- assertEquals("Wrong size", 3, extendedOperands.size());
- assertEquals("Wrong operator", InfixExpression.Operator.CONDITIONAL_AND, infixExpression.getOperator());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=109333
- */
- public void test0617() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "class X {\n" +
- " boolean val = true || false || true || false || true;\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertEquals("Not a field declaration ", ASTNode.FIELD_DECLARATION, node.getNodeType());
- final FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- final List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- final Expression initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, initializer.getNodeType());
- InfixExpression infixExpression = (InfixExpression) initializer;
- final List extendedOperands = infixExpression.extendedOperands();
- assertEquals("Wrong size", 3, extendedOperands.size());
- assertEquals("Wrong operator", InfixExpression.Operator.CONDITIONAL_OR, infixExpression.getOperator());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=109535
- */
- public void test0618() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " String f = \"\" + \"\" - 1;\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", false/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertEquals("Not a field declaration ", ASTNode.FIELD_DECLARATION, node.getNodeType());
- final FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- final List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- final Expression initializer = fragment.getInitializer();
- assertNotNull("No initializer", initializer);
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, initializer.getNodeType());
- InfixExpression infixExpression = (InfixExpression) initializer;
- List extendedOperands = infixExpression.extendedOperands();
- assertEquals("Wrong size", 0, extendedOperands.size());
- assertEquals("Wrong operator", InfixExpression.Operator.MINUS, infixExpression.getOperator());
- Expression leftOperand = infixExpression.getLeftOperand();
- assertEquals("Not an infix expression", ASTNode.INFIX_EXPRESSION, leftOperand.getNodeType());
- InfixExpression infixExpression2 = (InfixExpression) leftOperand;
- extendedOperands = infixExpression.extendedOperands();
- assertEquals("Wrong size", 0, extendedOperands.size());
- assertEquals("Wrong operator", InfixExpression.Operator.PLUS, infixExpression2.getOperator());
- assertEquals("Not a string literal", ASTNode.STRING_LITERAL, infixExpression2.getLeftOperand().getNodeType());
- assertEquals("Not a string literal", ASTNode.STRING_LITERAL, infixExpression2.getRightOperand().getNodeType());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=109646
- */
- public void test0619() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0619", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, false);
- final JavaScriptUnit unit = (JavaScriptUnit) result;
- assertProblemsSize(unit, 0);
- ASTNode node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- ASTNode statement = node;
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_STATEMENTS);
- parser.setSource(source);
- parser.setSourceRange(statement.getStartPosition(), statement.getLength());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result2 = parser.createAST(null);
- assertNotNull("No node", result2);
- assertTrue("not a block", result2.getNodeType() == ASTNode.BLOCK);
- Block block = (Block) result2;
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertEquals("Statement is not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement2.getNodeType());
- VariableDeclarationStatement declarationStatement = (VariableDeclarationStatement) statement2;
- assertEquals("Wrong number of fragments", 4, declarationStatement.fragments().size());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=109940
- */
- public void test0620() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println((int) \'\\0\');\n" +
- " System.out.println((int) \'\\1\');\n" +
- " System.out.println((int) \'\\2\');\n" +
- " System.out.println((int) \'\\3\');\n" +
- " System.out.println((int) \'\\4\');\n" +
- " System.out.println((int) \'\\5\');\n" +
- " System.out.println((int) \'\\6\');\n" +
- " System.out.println((int) \'\\7\');\n" +
- " System.out.println((int) \'\\077\');\n" +
- " System.out.println((int) \'\\55\');\n" +
- " System.out.println((int) \'\\77\');\n" +
- " System.out.println((int) \'\\377\');\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", false/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- unit.accept(new ASTVisitor() {
- public boolean visit(CharacterLiteral characterLiteral) {
- try {
- final String escapedValue = characterLiteral.getEscapedValue();
- final char charValue = characterLiteral.charValue();
- if (escapedValue.equals("\'\\0\'")) {
- assertEquals("Wrong value", 0, charValue);
- } else if (escapedValue.equals("\'\\1\'")) {
- assertEquals("Wrong value", 1, charValue);
- } else if (escapedValue.equals("\'\\2\'")) {
- assertEquals("Wrong value", 2, charValue);
- } else if (escapedValue.equals("\'\\3\'")) {
- assertEquals("Wrong value", 3, charValue);
- } else if (escapedValue.equals("\'\\4\'")) {
- assertEquals("Wrong value", 4, charValue);
- } else if (escapedValue.equals("\'\\5\'")) {
- assertEquals("Wrong value", 5, charValue);
- } else if (escapedValue.equals("\'\\6\'")) {
- assertEquals("Wrong value", 6, charValue);
- } else if (escapedValue.equals("\'\\7\'")) {
- assertEquals("Wrong value", 7, charValue);
- } else if (escapedValue.equals("\'\\077\'")) {
- assertEquals("Wrong value", 63, charValue);
- } else if (escapedValue.equals("\'\\55\'")) {
- assertEquals("Wrong value", 45, charValue);
- } else if (escapedValue.equals("\'\\77\'")) {
- assertEquals("Wrong value", 63, charValue);
- } else if (escapedValue.equals("\'\\377\'")) {
- assertEquals("Wrong value", 255, charValue);
- } else {
- assertTrue("Should not get there", false);
- }
- } catch(IllegalArgumentException e) {
- assertTrue("Should not happen", false);
- }
- return false;
- }
- });
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=109963
- */
- public void test0621() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public void foo(int y) {\n" +
- " switch (y) {\n" +
- " case 1:\n" +
- " int i,j;\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", false/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertNotNull("No node", node);
- assertEquals("Not a switch statement", ASTNode.SWITCH_STATEMENT, node.getNodeType());
- SwitchStatement switchStatement = (SwitchStatement) node;
- List statements = switchStatement.statements();
- assertEquals("Wrong size", 2, statements.size());
- Statement statement = (Statement) statements.get(1);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement.getNodeType());
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement;
- assertEquals("Wrong size", 2, variableDeclarationStatement.fragments().size());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=92866
- */
- public void test0622() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println((int) \'\\0\');\n" +
- " System.out.println((int) \'\\00\');\n" +
- " System.out.println((int) \'\\000\');\n" +
- " System.out.println((int) \'\\40\');\n" +
- " System.out.println((int) \'\\040\');\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", false/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- unit.accept(new ASTVisitor() {
- public boolean visit(CharacterLiteral characterLiteral) {
- try {
- characterLiteral.charValue();
- } catch(IllegalArgumentException e) {
- assertTrue("Should not happen", false);
- }
- return false;
- }
- });
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=116573
- */
- public void test0623() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "class X {\n" +
- " X(boolean x, String y, String z) {}\n" +
- " X(int x, String y) {}\n" +
- " X(String x) {\n" +
- " this(first, second);\n" +
- " }\n" +
- " void test() {\n" +
- " new X(first, second);\n" +
- " }\n" +
- " class Z extends X {\n" +
- " public Z() {\n" +
- " super(first, second);\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- String expectedOutput =
- "first cannot be resolved\n" +
- "second cannot be resolved\n" +
- "first cannot be resolved\n" +
- "second cannot be resolved\n" +
- "first cannot be resolved\n" +
- "second cannot be resolved";
- assertProblemsSize(unit, 6, expectedOutput);
- unit.accept(new ASTVisitor() {
- public boolean visit(ConstructorInvocation constructorInvocation) {
- assertNotNull("No binding", constructorInvocation.resolveConstructorBinding());
- return false;
- }
- public boolean visit(ClassInstanceCreation classInstanceCreation) {
- assertNotNull("No binding", classInstanceCreation.resolveConstructorBinding());
- return false;
- }
- });
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=118876
- */
- public void test0624() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X extend {}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- String expectedOutput =
- "Syntax error on token \"extend\", delete this token";
- assertProblemsSize(unit, 1, expectedOutput);
- unit.accept(new ASTVisitor() {
- public boolean visit(TypeDeclaration typeDeclaration) {
- assertTrue("Should be malformed", isMalformed(typeDeclaration));
- return false;
- }
- public boolean visit(JavaScriptUnit compilationUnit) {
- assertFalse("Should not be malformed", isMalformed(compilationUnit));
- return true;
- }
- });
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=118897
- */
- public void test0625() {
- char[] source =
- ("package test0305;\n" + //$NON-NLS-1$
- "\n" + //$NON-NLS-1$
- "class Test {\n" + //$NON-NLS-1$
- " public void foo(int arg) {}\n" + //$NON-NLS-1$
- "}").toCharArray(); //$NON-NLS-1$
- IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
- ASTNode result = runConversion(AST.JLS3, source, "Test.js", project); //$NON-NLS-1$
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0);
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNull("Got a type binding", typeBinding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=118897
- */
- public void test0626() {
- char[] source =
- ("package java.lang;\n" + //$NON-NLS-1$
- "\n" + //$NON-NLS-1$
- "class Object {\n" + //$NON-NLS-1$
- " public void foo(int arg) {}\n" + //$NON-NLS-1$
- "}").toCharArray(); //$NON-NLS-1$
- IJavaScriptProject project = getJavaProject("Converter"); //$NON-NLS-1$
- ASTNode result = runConversion(AST.JLS3, source, "Object.js", project); //$NON-NLS-1$
- assertNotNull("No compilation unit", result); //$NON-NLS-1$
- assertTrue("result is not a compilation unit", result instanceof JavaScriptUnit); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0);
- assertTrue("not a TypeDeclaration", node instanceof TypeDeclaration); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- ITypeBinding typeBinding = typeDeclaration.resolveBinding();
- assertNull("Got a type binding", typeBinding); //$NON-NLS-1$
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=116833
- */
- public void test0627() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void m() {\n" +
- " error();\n" +
- " new Cloneable() {\n" +
- " void xx() {}\n" +
- " };\n" +
- " new Cloneable() {\n" +
- " void xx() {}\n" +
- " };\n" + " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- String expectedOutput =
- "The method error() is undefined for the type X";
- assertProblemsSize(unit, 1, expectedOutput);
- node = getASTNode(unit, 0, 0, 1);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- Expression expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not a class instance creation", ASTNode.CLASS_INSTANCE_CREATION, expression.getNodeType());
- AnonymousClassDeclaration anonymousClassDeclaration = ((ClassInstanceCreation) expression).getAnonymousClassDeclaration();
- assertNotNull("No anonymous class declaration", anonymousClassDeclaration);
- List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- BodyDeclaration bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- IFunctionBinding methodBinding = methodDeclaration.resolveBinding();
-
- node = getASTNode(unit, 0, 0, 2);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not a class instance creation", ASTNode.CLASS_INSTANCE_CREATION, expression.getNodeType());
- anonymousClassDeclaration = ((ClassInstanceCreation) expression).getAnonymousClassDeclaration();
- assertNotNull("No anonymous class declaration", anonymousClassDeclaration);
- bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
- assertEquals("Wrong size", 1, bodyDeclarations.size());
- bodyDeclaration = (BodyDeclaration) bodyDeclarations.get(0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, bodyDeclaration.getNodeType());
- methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- IFunctionBinding methodBinding2 = methodDeclaration.resolveBinding();
-
- assertFalse("Should not be equal", methodBinding.isEqualTo(methodBinding2));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=125270
- */
- public void test0628() throws JavaScriptModelException {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_EXPRESSION);
- String source = "{\"red\", \"yellow\"}";
- parser.setSource(source.toCharArray());
- parser.setSourceRange(0, source.length());
- parser.setCompilerOptions(JavaScriptCore.getOptions());
- ASTNode result = parser.createAST(null);
- assertNotNull("No node", result);
- assertEquals("not an array initializer", ASTNode.ARRAY_INITIALIZER, result.getNodeType());
- ArrayInitializer arrayInitializer = (ArrayInitializer) result;
- List expressions = arrayInitializer.expressions();
- assertEquals("Wrong size", 2, expressions.size());
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, ((Expression) expressions.get(0)).getNodeType());
- assertEquals("Wrong type", ASTNode.STRING_LITERAL, ((Expression) expressions.get(1)).getNodeType());
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=126598
- */
- public void test0629() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0629", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- String expectedOutput =
- "Syntax error on token \",\", invalid VariableInitializer";
- assertProblemsSize(compilationUnit, 1, expectedOutput);
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertEquals("Not a compilation unit", ASTNode.FIELD_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- checkSourceRange(fragment, "s = {\"\",,,}", source);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=126598
- */
- public void test0630() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0630", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- String expectedOutput =
- "Syntax error on token \",\", invalid VariableInitializer";
- assertProblemsSize(compilationUnit, 1, expectedOutput);
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=126598
- */
- public void test0631() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0631", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- char[] source = sourceUnit.getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- String expectedOutput =
- "Syntax error, insert \"}\" to complete ArrayInitializer\n" +
- "Syntax error, insert \";\" to complete FieldDeclaration\n" +
- "Syntax error, insert \"}\" to complete ClassBody";
- assertProblemsSize(compilationUnit, 3, expectedOutput);
- ASTNode node = getASTNode(compilationUnit, 0, 0);
- assertEquals("Not a compilation unit", ASTNode.FIELD_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- checkSourceRange(fragment, "s = {\"\",,,", source);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128539
- */
- public void test0632() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void m(int state) {\n" +
- " switch (state) {\n" +
- " case 4:\n" +
- " double M0,M1;\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a switch statement", ASTNode.SWITCH_STATEMENT, node.getNodeType());
- SwitchStatement statement = (SwitchStatement) node;
- List statements = statement.statements();
- assertEquals("wrong size", 2, statements.size());
- assertEquals("Not a switch case", ASTNode.SWITCH_CASE, ((ASTNode) statements.get(0)).getNodeType());
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, ((ASTNode) statements.get(1)).getNodeType());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128539
- */
- public void test0633() {
- String src = "switch (state) {case 4:double M0,M1;}";
- char[] source = src.toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind (ASTParser.K_STATEMENTS);
- parser.setSource (source);
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- assertEquals("Wrong type", ASTNode.BLOCK, result.getNodeType());
- Block block = (Block) result;
- List statements = block.statements();
- assertNotNull("No statements", statements);
- assertEquals("Wrong size", 1, statements.size());
- final ASTNode node = (ASTNode) statements.get(0);
- assertEquals("Not a switch statement", ASTNode.SWITCH_STATEMENT, node.getNodeType());
- SwitchStatement statement = (SwitchStatement) node;
- statements = statement.statements();
- assertEquals("wrong size", 2, statements.size());
- assertEquals("Not a switch case", ASTNode.SWITCH_CASE, ((ASTNode) statements.get(0)).getNodeType());
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, ((ASTNode) statements.get(1)).getNodeType());
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128823
- */
- public void test0634() throws JavaScriptModelException {
- try {
- String src =
- "public class X {\n" +
- " void foo() {\n" +
- " int i1 i1;\n" +
- " int i2 i2;\n" +
- " int i3 i3;\n" +
- " int i4 i4;\n" +
- " int i5 i5;\n" +
- " int i6 i6;\n" +
- " int i7 i7;\n" +
- " int i8 i8;\n" +
- " int i9 i9;\n" +
- " int i10 i10;\n" +
- " int i11 i11;\n" +
- " \n" +
- " for for ;;){}\n" +
- " }\n" +
- "}";
-
- char[] source = src.toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind (ASTParser.K_COMPILATION_UNIT);
- parser.setSource (source);
- parser.setStatementsRecovery(true);
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- } catch (ArrayIndexOutOfBoundsException e) {
- assertTrue("ArrayIndexOutOfBoundsException", false);
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128960
- */
- public void test0635() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo(Object tab[]) {\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- List parameters = declaration.parameters();
- assertEquals("wrong number", 1, parameters.size());
- SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(variableDeclaration, "Object tab[]", contents);
- checkSourceRange(variableDeclaration.getType(), "Object", contents);
- checkSourceRange(variableDeclaration.getName(), "tab", contents);
- assertEquals("wrong number of extra dimensions", 1, variableDeclaration.getExtraDimensions());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128960
- */
- public void test0636() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo(java.lang.Object tab[]) {\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- List parameters = declaration.parameters();
- assertEquals("wrong number", 1, parameters.size());
- SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) parameters.get(0);
- checkSourceRange(variableDeclaration, "java.lang.Object tab[]", contents);
- checkSourceRange(variableDeclaration.getType(), "java.lang.Object", contents);
- checkSourceRange(variableDeclaration.getName(), "tab", contents);
- assertEquals("wrong number of extra dimensions", 1, variableDeclaration.getExtraDimensions());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128961
- */
- public void test0637() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo() {\n" +
- " for( int i = (1); ; ) {\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a for statement", ASTNode.FOR_STATEMENT, node.getNodeType());
- ForStatement forStatement = (ForStatement) node;
- List inits = forStatement.initializers();
- assertEquals("Wrong size", 1, inits.size());
- Expression expression = (Expression) inits.get(0);
- assertEquals("Not a variable declaration expression", ASTNode.VARIABLE_DECLARATION_EXPRESSION, expression.getNodeType());
- VariableDeclarationExpression declarationExpression = (VariableDeclarationExpression) expression;
- List fragments = declarationExpression.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initializer = fragment.getInitializer();
- checkSourceRange(initializer, "(1)", contents);
- checkSourceRange(fragment, "i = (1)", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128961
- */
- public void test0638() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " int i = (1);\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- List fragments = fieldDeclaration.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initializer = fragment.getInitializer();
- checkSourceRange(initializer, "(1)", contents);
- checkSourceRange(fragment, "i = (1)", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=128961
- */
- public void test0639() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo() {\n" +
- " for( int i = (1), j = 0; ; ) {\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a for statement", ASTNode.FOR_STATEMENT, node.getNodeType());
- ForStatement forStatement = (ForStatement) node;
- List inits = forStatement.initializers();
- assertEquals("Wrong size", 1, inits.size());
- Expression expression = (Expression) inits.get(0);
- assertEquals("Not a variable declaration expression", ASTNode.VARIABLE_DECLARATION_EXPRESSION, expression.getNodeType());
- VariableDeclarationExpression declarationExpression = (VariableDeclarationExpression) expression;
- List fragments = declarationExpression.fragments();
- assertEquals("Wrong size", 2, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression initializer = fragment.getInitializer();
- checkSourceRange(initializer, "(1)", contents);
- checkSourceRange(fragment, "i = (1)", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=129589
- * TODO (david) enable once fixed
- */
- public void _test0640() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " protected void primExecute() {\n" +
- " String temp= this.toString();\n" +
- " }\n" +
- " if (image != null) {\n" +
- " Object loc = null;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 2, "Syntax error on token \"}\", { expected after this token\n" +
- "Syntax error, insert \"}\" to complete ClassBody");
- node = getASTNode(unit, 0, 0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertFalse("A recovered node", isRecovered(methodDeclaration));
- assertFalse("A malformed node", isMalformed(methodDeclaration));
- assertFalse("A recovered node", isRecovered(methodDeclaration.getBody()));
- assertFalse("A malformed node", isMalformed(methodDeclaration.getBody()));
- node = getASTNode(unit, 0, 1);
- assertEquals("Not an initializer", ASTNode.INITIALIZER, node.getNodeType());
- Initializer initializer = (Initializer) node;
- assertTrue("Not a recovered node", isRecovered(initializer));
- assertTrue("Not a malformed node", isMalformed(initializer));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that 2 type bindings (one from .class file, the other from attache source) are "isEqualTo(...)".
- * (regression test for bug 130317 ASTParser with IClassFile as source creates type bindings that are not isEqualTo(..) binary bindings)
- */
- public void test0641() throws JavaScriptModelException {
- // Integer from attached source
- IClassFile classFile = getClassFile("Converter", getConverterJCLPath().toOSString(), "java.lang", "Integer.class");
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("public")};
- markerInfo.astEnds = new int[] {source.lastIndexOf('}') + 1};
- ASTNode node = buildAST(markerInfo, classFile);
- IBinding bindingFromAttachedSource = ((TypeDeclaration) node).resolveBinding();
-
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- String contents =
- "public class X {\n" +
- " /*start*/Integer/*end*/ field;\n" +
- "}";
- IBinding[] bindings = resolveBindings(contents, workingCopy);
- assertTrue("2 type bindings should be equals", bindingFromAttachedSource.isEqualTo(bindings[0]));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=129330
- */
- public void test0642() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "import java.awt.Point;\n" +
- "public class X {\n" +
- " public void foo(Point p, int[] a) {\n" +
- " p.x;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1, "Syntax error, insert \"AssignmentOperator Expression\" to complete Expression");
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- assertTrue("Not recovered", isRecovered(node));
- final Expression expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not a qualified name", ASTNode.QUALIFIED_NAME, expression.getNodeType());
- assertTrue("Not recovered", isRecovered(expression));
- checkSourceRange(expression, "p.x", contents);
- checkSourceRange(node, "p.x;", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=129330
- */
- public void test0643() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "import java.awt.Point;\n" +
- "public class X {\n" +
- " public void foo(Point p, int[] a) {\n" +
- " a[0];\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1, "Syntax error, insert \"AssignmentOperator Expression\" to complete Expression");
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- assertTrue("Not recovered", isRecovered(node));
- final Expression expression = ((ExpressionStatement) node).getExpression();
- assertEquals("Not an array access", ASTNode.ARRAY_ACCESS, expression.getNodeType());
- assertTrue("Not recovered", isRecovered(expression));
- checkSourceRange(expression, "a[0]", contents);
- checkSourceRange(node, "a[0];", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=129330
- */
- public void test0644() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public void foo() {\n" +
- " int x =;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1, "Syntax error on token \"=\", VariableInitializer expected after this token");
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a vaviable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertNull("No initializer", expression);
- assertTrue("Not recovered", isRecovered(fragment));
- checkSourceRange(fragment, "x =", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=135997
- */
- public void test0645() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " {\n" +
- " new Object();\n" +
- " Object.equ;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(
- unit,
- 2,
- "Object.equ cannot be resolved\n" +
- "Syntax error, insert \"AssignmentOperator Expression\" to complete Expression");
- node = getASTNode(unit, 0, 0);
- assertEquals("Not a field declaration statement", ASTNode.INITIALIZER, node.getNodeType());
- Initializer initializer = (Initializer) node;
- checkSourceRange(
- initializer,
- "{\n" +
- " new Object();\n" +
- " Object.equ;\n" +
- " }",
- contents);
- Block block = initializer.getBody();
- checkSourceRange(
- block,
- "{\n" +
- " new Object();\n" +
- " Object.equ;\n" +
- " }",
- contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=136972
- */
- public void test0646() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " static {\n" +
- " class A\n" +
- " Object o = new Object(){\n" +
- " void test(){\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=141043
- */
- public void test0647() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public void run(int i) {\n" +
- " }\n" +
- " public void foo() {\n" +
- " new Runnable() {\n" +
- " public void run() {\n" +
- " run(1); \n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1, "The method run() in the type new Runnable(){} is not applicable for the arguments (int)");
- node = getASTNode(unit, 0, 1, 0);
- assertEquals("Not an expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- Expression expression = ((ExpressionStatement) node).getExpression();
- ITypeBinding typeBinding = expression.resolveTypeBinding();
- IFunctionBinding[] methodBindings = typeBinding.getDeclaredMethods();
- assertEquals("Wrong size", 2, methodBindings.length);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=147877
- */
- public void test0648() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public void foo(int[] a) {\n" +
- " int i = a[0];\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a vaviable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertNotNull("No initializer", expression);
- checkSourceRange(expression, "a[0]", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=147877
- */
- public void test0649() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public void foo(int[] a) {\n" +
- " int i = a[0\\u005D;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a vaviable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertNotNull("No initializer", expression);
- checkSourceRange(expression, "a[0\\u005D", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=147877
- */
- public void test0650() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public void foo(int[] a) {\n" +
- " int[] i = new int[0];\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a vaviable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertNotNull("No initializer", expression);
- checkSourceRange(expression, "new int[0]", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=147877
- */
- public void test0651() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public void foo(int[] a) {\n" +
- " int[] i = new int[0\\u005D;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a vaviable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- Expression expression = fragment.getInitializer();
- assertNotNull("No initializer", expression);
- checkSourceRange(expression, "new int[0\\u005D", contents);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=149126
- */
- public void _test0652() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "import java.nio.ByteBuffer;\n" +
- "import java.nio.CharBuffer;\n" +
- "import java.nio.charset.Charset;\n" +
- "import java.nio.charset.CharsetDecoder;\n" +
- "import java.nio.charset.CharsetEncoder;\n" +
- "import java.nio.charset.CoderResult;\n" +
- "public class TestCharset extends Charset {\n" +
- " public CharsetDecoder newDecoder() {\n" +
- " return new CharsetDecoder(this, 2.0, 2.0) {\n" +
- " CharsetDecoder(CharSet\n" +
- " protected CoderResult decodeLoop(ByteBuffer in,\n" +
- "CharBuffer out) {\n" +
- " return null;\n" +
- " }\n" +
- " };;\n" +
- " }\n" +
- " public CharsetEncoder newEncoder() {\n" +
- " return null;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=150409
- * TODO (olivier) renable if the bindings are available
- */
- public void _test0653() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0653", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = runConversion(AST.JLS3, sourceUnit, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) result;
-
- ASTNode node = getASTNode(unit, 0, 2, 0);
- assertEquals("Not a method invocation", ASTNode.EXPRESSION_STATEMENT, node.getNodeType());
- ExpressionStatement statement = (ExpressionStatement) node;
- FunctionInvocation invocation = (FunctionInvocation) statement.getExpression();
- List arguments = invocation.arguments();
- assertEquals("Wrong size", 1, arguments.size());
- Expression argument = (Expression) arguments.get(0);
- assertEquals("Not a method invocation", ASTNode.FUNCTION_INVOCATION, argument.getNodeType());
- invocation = (FunctionInvocation) argument;
- Expression expression = invocation.getExpression();
- assertEquals("Not a method invocation", ASTNode.FIELD_ACCESS, expression.getNodeType());
- FieldAccess fieldAccess = (FieldAccess) expression;
- IVariableBinding variableBinding = fieldAccess.resolveFieldBinding();
- assertNotNull("No variable binding", variableBinding);
- }
-
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=148224
- */
- public void test0654() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " int i;\n" +
- " public void foo(int[] a) {\n" +
- " }\n" +
- " String s;\n" +
- " public String[][] bar() {\n" +
- " return null;\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false,
- true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 0);
- node = getASTNode(unit, 0, 0);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- FieldDeclaration declaration = (FieldDeclaration) node;
- Type type = declaration.getType();
- ITypeBinding typeBinding = type.resolveBinding();
- assertTrue("Not a primitive type", typeBinding.isPrimitive());
- assertEquals("Not int", "int", typeBinding.getName());
- try {
- typeBinding.createArrayType(-1);
- assertTrue("Should throw an exception", false);
- } catch(IllegalArgumentException exception) {
- // ignore
- }
- try {
- typeBinding.createArrayType(0);
- assertTrue("Should throw an exception", false);
- } catch(IllegalArgumentException exception) {
- // ignore
- }
- try {
- typeBinding.createArrayType(256);
- assertTrue("Should throw an exception", false);
- } catch(IllegalArgumentException exception) {
- // ignore
- }
- ITypeBinding binding = typeBinding.createArrayType(2);
- assertEquals("Wrong dimensions", 2, binding.getDimensions());
- assertTrue("Not an array type binding", binding.isArray());
- ITypeBinding componentType = binding.getComponentType();
- assertTrue("Not an array type binding", componentType.isArray());
- assertEquals("Wrong dimensions", 1, componentType.getDimensions());
- componentType = componentType.getComponentType();
- assertFalse("An array type binding", componentType.isArray());
- assertEquals("Wrong dimensions", 0, componentType.getDimensions());
-
- binding = typeBinding.createArrayType(1);
- node = getASTNode(unit, 0, 1);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- List parameters = methodDeclaration.parameters();
- assertEquals("Wrong size", 1, parameters.size());
- SingleVariableDeclaration parameter = (SingleVariableDeclaration) parameters.get(0);
- Type type2 = parameter.getType();
- ITypeBinding typeBinding2 = type2.resolveBinding();
- assertNotNull("No binding", typeBinding2);
- assertTrue("Not an array binding", typeBinding2.isArray());
- assertEquals("Wrong dimension", 1, typeBinding2.getDimensions());
- assertEquals("Wrong type", "int", typeBinding2.getElementType().getName());
- assertTrue("Should be equals", binding == typeBinding2);
-
- binding = typeBinding2.createArrayType(3);
- assertTrue("Not an array binding", binding.isArray());
- assertEquals("Wrong dimension", 4, binding.getDimensions());
-
- node = getASTNode(unit, 0, 2);
- assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType());
- declaration = (FieldDeclaration) node;
- type = declaration.getType();
- typeBinding = type.resolveBinding();
- assertTrue("A primitive type", !typeBinding.isPrimitive());
- assertEquals("Not String", "String", typeBinding.getName());
-
- binding = typeBinding.createArrayType(1);
- node = getASTNode(unit, 0, 3);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- methodDeclaration = (FunctionDeclaration) node;
- type = methodDeclaration.getReturnType2();
- assertNotNull("No return type", type);
- typeBinding2 = type.resolveBinding();
- assertNotNull("No binding", typeBinding2);
- assertTrue("Not an array binding", typeBinding2.isArray());
- assertEquals("Wrong dimension", 2, typeBinding2.getDimensions());
- assertEquals("Wrong type", "String", typeBinding2.getElementType().getName());
- typeBinding2 = typeBinding2.getComponentType();
- assertTrue("Not an array binding", typeBinding2.isArray());
- assertEquals("Wrong dimension", 1, typeBinding2.getDimensions());
- assertTrue("Should be equals", binding == typeBinding2);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=157570
- */
- public void _test0655() {
- String src = "public static void m1()\n" +
- " {\n" +
- " int a;\n" +
- " int b;\n" +
- " }\n" +
- "\n" +
- " public static void m2()\n" +
- " {\n" +
- " int c;\n" +
- " int d;\n" +
- " }";
- char[] source = src.toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind (ASTParser.K_STATEMENTS);
- parser.setStatementsRecovery(true);
- parser.setSource (source);
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- assertEquals("Not a block", ASTNode.BLOCK, result.getNodeType());
- Block block = (Block) result;
- List statements = block.statements();
- for (Iterator iterator = statements.iterator(); iterator.hasNext(); ) {
- Statement statement = (Statement) iterator.next();
- assertTrue(isMalformed(statement));
- }
- }
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=157570
- */
- public void test0656() {
- String src = "public static void m1()\n" +
- " {\n" +
- " int a;\n" +
- " int b;\n" +
- " }\n" +
- "\n" +
- " public static void m2()\n" +
- " {\n" +
- " int c;\n" +
- " int d;\n" +
- " }";
- char[] source = src.toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind (ASTParser.K_STATEMENTS);
- parser.setStatementsRecovery(false);
- parser.setSource (source);
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- assertEquals("Not a block", ASTNode.BLOCK, result.getNodeType());
- Block block = (Block) result;
- List statements = block.statements();
- assertEquals("Should be empty", 0, statements.size());
- }
-
- // http://dev.eclipse.org/bugs/show_bug.cgi?id=160198
- public void test0657() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0657", "X.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- IJavaScriptUnit sourceUnit2 = getCompilationUnit("Converter" , "src", "test0657", "A.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- class TestASTRequestor extends ASTRequestor {
- public ArrayList asts = new ArrayList();
- public void acceptAST(IJavaScriptUnit source, JavaScriptUnit compilationUnit) {
- this.asts.add(compilationUnit);
- }
- public void acceptBinding(String bindingKey, IBinding binding) {
- }
- }
- TestASTRequestor requestor = new TestASTRequestor();
- resolveASTs(
- new IJavaScriptUnit[] {sourceUnit, sourceUnit2},
- new String[0],
- requestor,
- getJavaProject("Converter"),
- sourceUnit.getOwner()
- );
- ArrayList arrayList = requestor.asts;
- assertEquals("Wrong size", 2, arrayList.size());
- int problemsCount = 0;
- for (int i = 0, max = arrayList.size(); i < max; i++) {
- Object current = arrayList.get(i);
- assertTrue("not a compilation unit", current instanceof JavaScriptUnit);
- JavaScriptUnit unit = (JavaScriptUnit) current;
- IProblem[] problems = unit.getProblems();
- problemsCount += problems.length;
- }
- assertEquals("wrong size", 1, problemsCount);
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=157570
- */
- public void test0658() {
- String src = "public static void m1()\n" +
- " {\n" +
- " int a;\n" +
- " int b;\n" +
- " }\n" +
- "\n" +
- " public static void m2()\n" +
- " {\n" +
- " int c;\n" +
- " int d;\n" +
- " }";
- char[] source = src.toCharArray();
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind (ASTParser.K_STATEMENTS);
- parser.setStatementsRecovery(true);
- parser.setSource (source);
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- assertEquals("Not a block", ASTNode.BLOCK, result.getNodeType());
- Block block = (Block) result;
- List statements = block.statements();
- assertEquals("Should be empty", 4, statements.size());
- assertTrue("Not recovered", isRecovered(block));
- ASTNode root = block.getRoot();
- assertNotNull("No root", root);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, root.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) root;
- String errors =
- "Syntax error on token(s), misplaced construct(s)\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "Syntax error on token(s), misplaced construct(s)\n" +
- "Syntax error, insert \";\" to complete Statement";
- assertProblemsSize(unit, 4, errors);
- }
-
- public void test0659() throws CoreException, JavaScriptModelException {
- IJavaScriptProject javaProject = createJavaProject("P659", new String[] { "src" }, new String[0]);
- try {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setKind(ASTParser.K_COMPILATION_UNIT);
- parser.setStatementsRecovery(true);
- String source ="package java.lang;\n" +
- "public class Object {\n" +
- " public String toString() {\n" +
- " return \"\";\n" +
- " }\n" +
- "}";
- parser.setSource(source.toCharArray());
- parser.setProject(javaProject);
- parser.setResolveBindings(true);
- parser.setUnitName("Object.js");
- ASTNode result = parser.createAST (null);
- assertNotNull("no result", result);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(unit, 0, 0);
- assertNotNull("No node", node);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, node.getNodeType());
- FunctionDeclaration declaration = (FunctionDeclaration) node;
- Block block = declaration.getBody();
- assertNotNull("no block", block);
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- ReturnStatement returnStatement = (ReturnStatement) statements.get(0);
- Expression expression = returnStatement.getExpression();
- assertNotNull("No expression", expression);
- ITypeBinding binding = expression.resolveTypeBinding();
- assertNull("No binding", binding);
- } finally {
- deleteProject("P659");
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=144858
- * TODO (frederic) check that keys are different (PR 149590)
- */
- public void test0660() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo() {\n" +
- " int x = 0;\n" +
- " String x = \"\"; //$NON-NLS-1$\n" +
- " x.toString();\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1, "Duplicate local variable x");
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "x", variableBinding.getName());
- // (PR 149590)
- // String key = variableBinding.getKey();
-
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- statement = (VariableDeclarationStatement) node;
- fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "x", variableBinding.getName());
- // (PR 149590)
- // String key2 = variableBinding.getKey();
- //assertFalse("Keys should not be equals", key2.equals(key));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=144858
- * TODO (frederic) check that keys are different (PR 149590)
- */
- public void test0661() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int x = 2;\n" +
- " try {\n" +
- "\n" +
- " } catch(NullPointerException x) {\n" +
- " } catch(Exception e) {\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertProblemsSize(unit, 1, "Duplicate parameter x");
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "x", variableBinding.getName());
- // (PR 149590)
- // String key = variableBinding.getKey();
-
- node = getASTNode(unit, 0, 0, 1);
- assertEquals("Not a try statement", ASTNode.TRY_STATEMENT, node.getNodeType());
- TryStatement statement2 = (TryStatement) node;
- List catchClauses = statement2.catchClauses();
- assertEquals("Wrong size", 2, catchClauses.size());
- CatchClause catchClause = (CatchClause) catchClauses.get(0);
- SingleVariableDeclaration variableDeclaration = catchClause.getException();
- variableBinding = variableDeclaration.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "x", variableBinding.getName());
- // (PR 149590)
- // String key2 = variableBinding.getKey();
- //assertFalse("Keys should not be equals", key2.equals(key));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=144858
- * TODO (frederic) check that keys are different (PR 149590)
- */
- public void test0662() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " int x = x = 0;\n" +
- " if (true) {\n" +
- " int x = x = 1;\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- String expectedLog =
- "The assignment to variable x has no effect\n" +
- "Duplicate local variable x\n" +
- "The assignment to variable x has no effect";
- assertProblemsSize(unit, 3, expectedLog);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
- VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
- List fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "x", variableBinding.getName());
- // (PR 149590)
- // String key = variableBinding.getKey();
-
- node = getASTNode(unit, 0, 0, 1);
- assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType());
- IfStatement ifStatement = (IfStatement) node;
- Block block = (Block) ifStatement.getThenStatement();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement2.getNodeType());
- statement = (VariableDeclarationStatement) statement2;
- fragments = statement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "x", variableBinding.getName());
-
- // (PR 149590)
- // String key2 = variableBinding.getKey();
- //assertFalse("Keys should not be equals", key2.equals(key));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=144858
- * TODO (frederic) check that keys are different (PR 149590)
- */
- public void test0663() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " for (int i = 0; i < 10; i++) {\n" +
- " for (int i = 0; i < 5; i++) {\n" +
- " // do something\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- String expectedLog = "Duplicate local variable i";
- assertProblemsSize(unit, 1, expectedLog);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a for statement", ASTNode.FOR_STATEMENT, node.getNodeType());
- ForStatement statement = (ForStatement) node;
- List initializers = statement.initializers();
- assertEquals("Wrong size", 1, initializers.size());
- Expression expression = (Expression) initializers.get(0);
- assertEquals("Not a variable declaration expression", ASTNode.VARIABLE_DECLARATION_EXPRESSION, expression.getNodeType());
- VariableDeclarationExpression expression2 = (VariableDeclarationExpression) expression;
- List fragments = expression2.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "i", variableBinding.getName());
- // (PR 149590)
- // String key = variableBinding.getKey();
-
- Block block = (Block) statement.getBody();
- List statements = block.statements();
- assertEquals("Wrong size", 1, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertEquals("Not a for statement", ASTNode.FOR_STATEMENT, statement2.getNodeType());
- statement = (ForStatement) statement2;
- initializers = statement.initializers();
- assertEquals("Wrong size", 1, initializers.size());
- expression = (Expression) initializers.get(0);
- assertEquals("Not a variable declaration expression", ASTNode.VARIABLE_DECLARATION_EXPRESSION, expression.getNodeType());
- expression2 = (VariableDeclarationExpression) expression;
- fragments = expression2.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- fragment = (VariableDeclarationFragment) fragments.get(0);
- variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "i", variableBinding.getName());
-
- // (PR 149590)
- // String key2 = variableBinding.getKey();
- //assertFalse("Keys should not be equals", key2.equals(key));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=165662
- */
- public void test0664() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " void foo() {}\n" +
- " }\n" +
- " {\n" +
- " class Local {\n" +
- " Local(int i) {\n" +
- " this.init(i);\n" +
- " }\n" +
- " void init(int i) {}\n" +
- " }\n" +
- " Local l = new Local(0);\n" +
- " }\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- String expectedLog = "Duplicate nested type Local";
- assertProblemsSize(unit, 1, expectedLog);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType());
- TypeDeclarationStatement statement = (TypeDeclarationStatement) node;
- ITypeBinding typeBinding = statement.resolveBinding();
- assertNotNull("No binding", typeBinding);
- String key = typeBinding.getKey();
- assertNotNull("No key", key);
-
- node = getASTNode(unit, 0, 0, 1);
- assertEquals("Not a block", ASTNode.BLOCK, node.getNodeType());
- Block block = (Block) node;
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertEquals("Not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, statement2.getNodeType());
- statement = (TypeDeclarationStatement) statement2;
- typeBinding = statement.resolveBinding();
- assertNotNull("No binding", typeBinding);
- String key2 = typeBinding.getKey();
- assertNotNull("No key2", key2);
- assertFalse("Keys should not be equals", key.equals(key2));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=165662
- */
- public void test0665() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- String contents =
- "public class X {\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " class Local {\n" +
- " Local(int i) {\n" +
- " this.init(i);\n" +
- " this.bar();\n" +
- " }\n" +
- " void init(int i) {}\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " Local l = new Local(0);\n" +
- " }\n" +
- " Local l = new Local();\n" +
- " l.foo();\n" +
- " }\n" +
- "}";
- workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- ASTNode node = buildAST(
- contents,
- workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- String expectedLog = "Duplicate nested type Local";
- assertProblemsSize(unit, 1, expectedLog);
- node = getASTNode(unit, 0, 0, 0);
- assertEquals("Not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, node.getNodeType());
- TypeDeclarationStatement statement = (TypeDeclarationStatement) node;
- ITypeBinding typeBinding = statement.resolveBinding();
- assertNotNull("No binding", typeBinding);
- String key = typeBinding.getKey();
- assertNotNull("No key", key);
-
- node = getASTNode(unit, 0, 0, 1);
- assertEquals("Not a block", ASTNode.BLOCK, node.getNodeType());
- Block block = (Block) node;
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size());
- Statement statement2 = (Statement) statements.get(0);
- assertEquals("Not a type declaration statement", ASTNode.TYPE_DECLARATION_STATEMENT, statement2.getNodeType());
- statement = (TypeDeclarationStatement) statement2;
- typeBinding = statement.resolveBinding();
- assertNotNull("No binding", typeBinding);
- String key2 = typeBinding.getKey();
- assertNotNull("No key2", key2);
- assertFalse("Keys should not be equals", key.equals(key2));
-
- Statement statement3 = (Statement) statements.get(1);
- assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement3.getNodeType());
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement3;
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("Wrong size", 1, fragments.size());
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- IVariableBinding variableBinding = fragment.resolveBinding();
- assertNotNull("No binding", variableBinding);
- assertEquals("Wrong name", "l", variableBinding.getName());
- Expression expression = fragment.getInitializer();
- ITypeBinding typeBinding2 = expression.resolveTypeBinding();
- assertNotNull("No type binding2", typeBinding2);
-
- AbstractTypeDeclaration declaration = statement.getDeclaration();
- List bodyDeclarations = declaration.bodyDeclarations();
- assertEquals("Wrong size", 3, bodyDeclarations.size());
- BodyDeclaration declaration2 = (BodyDeclaration) bodyDeclarations.get(0);
- assertEquals("Not a method declaration", ASTNode.FUNCTION_DECLARATION, declaration2.getNodeType());
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) declaration2;
- assertTrue("not a constructor", methodDeclaration.isConstructor());
- block = methodDeclaration.getBody();
- statements = block.statements();
- assertEquals("Wrong size", 2, statements.size());
- statement3 = (Statement) statements.get(1);
- assertEquals("Not a expression statement", ASTNode.EXPRESSION_STATEMENT, statement3.getNodeType());
- expression = ((ExpressionStatement) statement3).getExpression();
- assertEquals("Not a method invocation", ASTNode.FUNCTION_INVOCATION, expression.getNodeType());
- FunctionInvocation invocation = (FunctionInvocation) expression;
- IFunctionBinding methodBinding = invocation.resolveMethodBinding();
- assertNotNull(methodBinding);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTMatcherTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTMatcherTest.java
deleted file mode 100644
index 861606a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTMatcherTest.java
+++ /dev/null
@@ -1,1112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BlockComment;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.LineComment;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.QualifiedType;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.TagElement;
-import org.eclipse.wst.jsdt.core.dom.TextElement;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
-import org.eclipse.wst.jsdt.core.dom.TryStatement;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.WhileStatement;
-
-/**
- * Test suite for <code>ASTMatcher</code> and <code>ASTNode.subtreeMatch</code>.
- */
-public class ASTMatcherTest extends org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase {
-
- /** @deprecated using deprecated code */
- public static Test suite() {
- // TODO (frederic) use buildList + setAstLevel(init) instead...
- junit.framework.TestSuite suite = new junit.framework.TestSuite(ASTMatcherTest.class.getName());
-
- Class c = ASTMatcherTest.class;
- Method[] methods = c.getMethods();
- for (int i = 0, max = methods.length; i < max; i++) {
- if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$
- suite.addTest(new ASTMatcherTest(methods[i].getName(), AST.JLS2));
- suite.addTest(new ASTMatcherTest(methods[i].getName(), AST.JLS3));
- }
- }
- return suite;
- }
-
- AST ast;
- SimpleName N1;
- SimpleName N2;
- SimpleName N3;
- SimpleName N4;
- Expression E1;
- Expression E2;
- Type T1;
- String T1S;
- Type T2;
- String T2S;
- String PT1S;
- Statement S1;
- Statement S2;
- Block B1;
- SingleVariableDeclaration V1;
- SingleVariableDeclaration V2;
- VariableDeclarationFragment W1;
- VariableDeclarationFragment W2;
- FieldDeclaration FD1;
- FieldDeclaration FD2;
- PackageDeclaration PD1;
- ImportDeclaration ID1;
- ImportDeclaration ID2;
- TypeDeclaration TD1;
- TypeDeclaration TD2;
- AnonymousClassDeclaration ACD1;
- JSdoc JD1;
- JSdoc JD2;
- String JD2S;
- String TP1S;
- String TP2S;
- TagElement TAG1;
- TagElement TAG2;
- TextElement TEXT1;
- MemberRef MBREF1;
- FunctionRef MTHREF1;
- FunctionRefParameter MPARM1;
- LineComment LC1;
- BlockComment BC1;
- Modifier MOD1;
- Modifier MOD2;
-
- final StringBuffer b = new StringBuffer();
-
- int API_LEVEL;
-
- public ASTMatcherTest(String name, int apiLevel) {
- super(name);
- this.API_LEVEL = apiLevel;
- }
-
- /**
- * @deprecated (not really - just suppressing the warnings
- * that come from testing Javadoc.getComment())
- *
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- ast = AST.newAST(this.API_LEVEL);
- N1 = ast.newSimpleName("N"); //$NON-NLS-1$
- N2 = ast.newSimpleName("M"); //$NON-NLS-1$
- N3 = ast.newSimpleName("O"); //$NON-NLS-1$
- N4 = ast.newSimpleName("P"); //$NON-NLS-1$
- E1 = ast.newSimpleName("X"); //$NON-NLS-1$
- E2 = ast.newSimpleName("Y"); //$NON-NLS-1$
- T1 = ast.newSimpleType(ast.newSimpleName("Z")); //$NON-NLS-1$
- T1S = "(tS(nSZZnS)tS)"; //$NON-NLS-1$
- T2 = ast.newSimpleType(ast.newSimpleName("Y")); //$NON-NLS-1$
- T2S = "(tS(nSYYnS)tS)"; //$NON-NLS-1$
- S1 = ast.newContinueStatement();
- S2 = ast.newBreakStatement();
- B1 = ast.newBlock();
- V1 = ast.newSingleVariableDeclaration();
- V1.setType(ast.newPrimitiveType(PrimitiveType.INT));
- V1.setName(ast.newSimpleName("a")); //$NON-NLS-1$
- V2 = ast.newSingleVariableDeclaration();
- V2.setType(ast.newPrimitiveType(PrimitiveType.BYTE));
- V2.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- W1 = ast.newVariableDeclarationFragment();
- W1.setName(ast.newSimpleName("a")); //$NON-NLS-1$
- W2 = ast.newVariableDeclarationFragment();
- W2.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- {
- VariableDeclarationFragment temp = ast.newVariableDeclarationFragment();
- temp.setName(ast.newSimpleName("f")); //$NON-NLS-1$
- FD1 = ast.newFieldDeclaration(temp);
- FD1.setType(ast.newPrimitiveType(PrimitiveType.INT));
- }
- {
- VariableDeclarationFragment temp = ast.newVariableDeclarationFragment();
- temp.setName(ast.newSimpleName("g")); //$NON-NLS-1$
- FD2 = ast.newFieldDeclaration(temp);
- FD2.setType(ast.newPrimitiveType(PrimitiveType.CHAR));
- }
- PD1 = ast.newPackageDeclaration();
- PD1.setName(ast.newSimpleName("p")); //$NON-NLS-1$
- ID1 = ast.newImportDeclaration();
- ID1.setName(ast.newSimpleName("i")); //$NON-NLS-1$
- ID2 = ast.newImportDeclaration();
- ID2.setName(ast.newSimpleName("j")); //$NON-NLS-1$
- TD1 = ast.newTypeDeclaration();
- TD1.setName(ast.newSimpleName("c")); //$NON-NLS-1$
- TD2 = ast.newTypeDeclaration();
- TD2.setName(ast.newSimpleName("d")); //$NON-NLS-1$
-
- ACD1 = ast.newAnonymousClassDeclaration();
-
- JD1 = ast.newJSdoc();
- JD2 = ast.newJSdoc();
- if (ast.apiLevel() == AST.JLS2) {
- JD1.setComment("/**X*/"); //$NON-NLS-1$
- JD2.setComment("/**Y*/"); //$NON-NLS-1$
- }
-
- BC1 = ast.newBlockComment();
-
- TAG1 = ast.newTagElement();
- TAG1.setTagName("@foo"); //$NON-NLS-1$
-
- TAG2 = ast.newTagElement();
- TAG2.setTagName("@bar"); //$NON-NLS-1$
-
- TEXT1 = ast.newTextElement();
- TEXT1.setText("foo"); //$NON-NLS-1$
-
- MBREF1 = ast.newMemberRef();
- MBREF1.setName(ast.newSimpleName("p")); //$NON-NLS-1$
-
- MTHREF1 = ast.newFunctionRef();
- MTHREF1.setName(ast.newSimpleName("p")); //$NON-NLS-1$
-
- MPARM1 = ast.newFunctionRefParameter();
- MPARM1.setType(ast.newPrimitiveType(PrimitiveType.CHAR));
-
- if (ast.apiLevel() >= AST.JLS3) {
- PT1S = "[(tM[(tS[(nSZZnS)]tS)]tM)]"; //$NON-NLS-1$
-
- TP1S = "[(tTP[(nSxxnS)]tTP)]"; //$NON-NLS-1$
-
- TP2S = "[(tTP[(nSyynS)]tTP)]"; //$NON-NLS-1$
- LC1 = ast.newLineComment();
-
-
- MOD1 = ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
- MOD2 = ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD);
-
- }
-
- }
-
- protected void tearDown() throws Exception {
- ast = null;
- super.tearDown();
- }
-
- /** @deprecated using deprecated code */
- public String getName() {
- String name = super.getName();
- switch (this.API_LEVEL) {
- case AST.JLS2:
- name = "JLS2 - " + name;
- break;
- case AST.JLS3:
- name = "JLS3 - " + name;
- break;
- }
- return name;
- }
-
- /**
- * An ASTMatcher that simply records the arguments it is passed,
- * immediately returns a pre-ordained answer, and counts how many
- * times it is called.
- */
- class TestMatcher extends ASTMatcher {
-
- public Object receiverNode;
- public Object otherNode;
- public boolean result;
- public boolean superMatch;
- public boolean superMatchResult;
- public int matchCalls = 0;
-
- TestMatcher() {
- this(false);
- }
-
- TestMatcher(boolean visitDocTags) {
- super(visitDocTags);
- }
-
- boolean standardBody(ASTNode receiver, Object other, boolean matchResult) {
- matchCalls++;
- this.receiverNode = receiver;
- this.otherNode = other;
- this.superMatchResult = matchResult;
- if (superMatch) {
- return this.superMatchResult;
- }
- return this.result;
- }
-
- public boolean match(AnonymousClassDeclaration node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ArrayAccess node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ArrayCreation node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ArrayInitializer node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ArrayType node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(Assignment node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(Block node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(BlockComment node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(BooleanLiteral node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(BreakStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(CatchClause node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(CharacterLiteral node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ClassInstanceCreation node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(JavaScriptUnit node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ConditionalExpression node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ConstructorInvocation node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ContinueStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(DoStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(EmptyStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(EnhancedForStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ExpressionStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(FieldAccess node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(FieldDeclaration node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ForStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(IfStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ImportDeclaration node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(InfixExpression node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(Initializer node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(JSdoc node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(LabeledStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(LineComment node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(MemberRef node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(FunctionDeclaration node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(FunctionInvocation node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(FunctionRef node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(FunctionRefParameter node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(Modifier node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(NullLiteral node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(NumberLiteral node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(PackageDeclaration node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ParenthesizedExpression node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(PostfixExpression node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(PrefixExpression node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(PrimitiveType node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(QualifiedName node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(QualifiedType node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ReturnStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SimpleName node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SimpleType node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SingleVariableDeclaration node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(StringLiteral node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SuperConstructorInvocation node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SuperFieldAccess node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SuperMethodInvocation node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SwitchCase node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(SwitchStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
-
- public boolean match(TagElement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(TextElement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ThisExpression node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(ThrowStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(TryStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(TypeDeclaration node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(TypeDeclarationStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(TypeLiteral node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(VariableDeclarationExpression node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(VariableDeclarationFragment node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(VariableDeclarationStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- public boolean match(WhileStatement node, Object other) {
- return standardBody(node, other, superMatch ? super.match(node, other) : false);
- }
- }
-
- /**
- * AST node visitor that counts the nodes visited.
- */
- static class NodeCounter extends ASTVisitor {
- public NodeCounter(boolean visitDocTags) {
- super(visitDocTags);
- }
-
- public int count = 0;
-
- /* (no javadoc for this method)
- * Method declared on ASTVisitor.
- */
- public void preVisit(ASTNode node) {
- count++;
- }
-
- }
-
- /**
- * Returns the number of AST nodes in the given subtree.
- *
- * @param node the root of the subtree
- * @param visitDocTags true if doc tags should be visited
- * @return the number of nodes (always positive)
- */
- static int nodeCount(ASTNode node, boolean visitDocTags) {
- NodeCounter c = new NodeCounter(visitDocTags);
- node.accept(c);
- return c.count;
- }
-
- /**
- * Checks that the ASTNode.subtreeMatch mechanism is working
- * for a node of a given type.
- */
- void basicMatch(ASTNode node) {
- TestMatcher[] m = {
- new TestMatcher(),
- new TestMatcher(true),
- new TestMatcher(false)};
- for (int i = 0; i < m.length; i++) {
- // check that matcher was called with right arguments
- // and that matches succeed
- TestMatcher m1 = m[i];
- Object o1 = new Object();
- m1.result = true;
- boolean result = node.subtreeMatch(m1, o1);
- assertTrue(m1.matchCalls == 1);
- assertTrue(m1.receiverNode == node);
- assertTrue(m1.otherNode == o1);
- assertTrue(result == true);
- }
-
- m = new TestMatcher[] {
- new TestMatcher(),
- new TestMatcher(true),
- new TestMatcher(false)};
- for (int i = 0; i < m.length; i++) {
- // check that matcher was called with right arguments
- // and that non-matches fail
- TestMatcher m1 = m[i];
- Object o1 = new Object();
- m1.result = false;
- boolean result = node.subtreeMatch(m1, o1);
- assertTrue(m1.matchCalls == 1);
- assertTrue(m1.receiverNode == node);
- assertTrue(m1.otherNode == o1);
- assertTrue(result == false);
- }
-
- // check that ASTMatcher() default implementations delegate
- {
- int count = nodeCount(node, false); // ignore doc tags
- TestMatcher m1 = new TestMatcher();
- m1.superMatch = true;
- boolean result = node.subtreeMatch(m1, node);
- assertTrue(m1.matchCalls == count);
- assertTrue(result == true);
- }
-
- // check that ASTMatcher(false) default implementations delegate
- {
- int count = nodeCount(node, false); // ignore doc tags
- TestMatcher m1 = new TestMatcher(false);
- m1.superMatch = true;
- boolean result = node.subtreeMatch(m1, node);
- assertTrue(m1.matchCalls == count);
- assertTrue(result == true);
- }
-
- // check that ASTMatcher(true) default implementations delegate
- {
- int count = nodeCount(node, true); // include doc tags
- TestMatcher m1 = new TestMatcher(true);
- m1.superMatch = true;
- boolean result = node.subtreeMatch(m1, node);
- assertTrue(m1.matchCalls == count);
- assertTrue(result == true);
- }
-
- }
-
- // NAMES
- public void testSimpleName() {
- Name x1 = ast.newName(new String[]{"Z"}); //$NON-NLS-1$
- basicMatch(x1);
- }
-
- public void testQualifiedName() {
- Name x1 = ast.newName(new String[]{"X", "Y"}); //$NON-NLS-1$ //$NON-NLS-2$
- basicMatch(x1);
- }
-
-
- // TYPES
- public void testPrimitiveType() {
- Type x1 = ast.newPrimitiveType(PrimitiveType.CHAR);
- basicMatch(x1);
- }
-
- public void testSimpleType() {
- Type x1 = ast.newSimpleType(N1);
- basicMatch(x1);
- }
-
- public void testArrayType() {
- Type x0 = ast.newPrimitiveType(PrimitiveType.CHAR);
- Type x1 = ast.newArrayType(x0);
- basicMatch(x1);
- }
-
- /** @deprecated using deprecated code */
- public void testQualifiedType() {
- if (ast.apiLevel() == AST.JLS2) {
- return;
- }
- Type x1 = ast.newQualifiedType(T1, N1);
- basicMatch(x1);
- }
-
- // EXPRESSIONS and STATEMENTS
-
- public void testAnonymousClassDeclaration() {
- AnonymousClassDeclaration x1 = ast.newAnonymousClassDeclaration();
- x1.bodyDeclarations().add(FD1);
- x1.bodyDeclarations().add(FD2);
- basicMatch(x1);
- }
- public void testArrayAccess() {
- ArrayAccess x1 = ast.newArrayAccess();
- x1.setArray(E1);
- x1.setIndex(E2);
- basicMatch(x1);
- }
- public void testArrayCreation() {
- ArrayCreation x1 = ast.newArrayCreation();
- x1.setType(ast.newArrayType(T1));
- x1.dimensions().add(E1);
- x1.dimensions().add(E2);
- x1.setInitializer(ast.newArrayInitializer());
- basicMatch(x1);
- }
- public void testArrayInitializer() {
- ArrayInitializer x1 = ast.newArrayInitializer();
- x1.expressions().add(E1);
- x1.expressions().add(E2);
- basicMatch(x1);
- }
- public void testAssignment() {
- Assignment x1 = ast.newAssignment();
- x1.setLeftHandSide(E1);
- x1.setRightHandSide(E2);
- basicMatch(x1);
- }
- public void testBlock() {
- Block x1 = ast.newBlock();
- x1.statements().add(S1);
- x1.statements().add(S2);
- basicMatch(x1);
- }
-
- public void testBlockComment() {
- BlockComment x1 = ast.newBlockComment();
- basicMatch(x1);
- }
-
- public void testBooleanLiteral() {
- BooleanLiteral x1 = ast.newBooleanLiteral(true);
- basicMatch(x1);
- }
- public void testBreakStatement() {
- BreakStatement x1 = ast.newBreakStatement();
- x1.setLabel(N1);
- basicMatch(x1);
- }
- public void testCatchClause() {
- CatchClause x1 = ast.newCatchClause();
- x1.setException(V1);
- x1.setBody(B1);
- basicMatch(x1);
- }
- public void testCharacterLiteral() {
- CharacterLiteral x1 = ast.newCharacterLiteral();
- x1.setCharValue('q');
- basicMatch(x1);
- }
- /** @deprecated using deprecated code */
- public void testClassInstanceCreation() {
- ClassInstanceCreation x1 = ast.newClassInstanceCreation();
- x1.setExpression(E1);
- if (ast.apiLevel() == AST.JLS2) {
- x1.setName(N1);
- } else {
- x1.setType(T1);
- }
- x1.setAnonymousClassDeclaration(ACD1);
- basicMatch(x1);
- }
- public void testCompilationUnit() {
- JavaScriptUnit x1 = ast.newJavaScriptUnit();
- x1.setPackage(PD1);
- x1.imports().add(ID1);
- x1.imports().add(ID2);
- x1.types().add(TD1);
- x1.types().add(TD2);
- basicMatch(x1);
- }
- public void testConditionalExpression() {
- ConditionalExpression x1 = ast.newConditionalExpression();
- x1.setExpression(E1);
- x1.setThenExpression(E2);
- x1.setElseExpression(N1);
- basicMatch(x1);
- }
- public void testConstructorInvocation() {
- ConstructorInvocation x1 = ast.newConstructorInvocation();
-
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- basicMatch(x1);
- }
- public void testContinueStatement() {
- ContinueStatement x1 = ast.newContinueStatement();
- x1.setLabel(N1);
- basicMatch(x1);
- }
- public void testDoStatement() {
- DoStatement x1 = ast.newDoStatement();
- x1.setExpression(E1);
- x1.setBody(S1);
- basicMatch(x1);
- }
- public void testEmptyStatement() {
- EmptyStatement x1 = ast.newEmptyStatement();
- basicMatch(x1);
- }
- /** @deprecated using deprecated code */
- public void testEnhancedForStatement() {
- if (ast.apiLevel() == AST.JLS2) {
- return;
- }
- EnhancedForStatement x1 = ast.newEnhancedForStatement();
- x1.setParameter(V1);
- x1.setExpression(E1);
- x1.setBody(S1);
- basicMatch(x1);
- }
- public void testExpressionStatement() {
- ExpressionStatement x1 = ast.newExpressionStatement(E1);
- basicMatch(x1);
- }
- public void testFieldAccess() {
- FieldAccess x1 = ast.newFieldAccess();
- x1.setExpression(E1);
- x1.setName(N1);
- basicMatch(x1);
- }
- public void testFieldDeclaration() {
- FieldDeclaration x1 = ast.newFieldDeclaration(W1);
- x1.setJavadoc(JD1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.fragments().add(W2);
- basicMatch(x1);
- }
- public void testForStatement() {
- ForStatement x1 = ast.newForStatement();
- x1.initializers().add(E1);
- x1.initializers().add(E2);
- x1.setExpression(N1);
- x1.updaters().add(N2);
- x1.updaters().add(N3);
- x1.setBody(S1);
- basicMatch(x1);
- }
- public void testIfStatement() {
- IfStatement x1 = ast.newIfStatement();
- x1.setExpression(E1);
- x1.setThenStatement(S1);
- x1.setElseStatement(S2);
- basicMatch(x1);
- }
- public void testImportDeclaration() {
- ImportDeclaration x1 = ast.newImportDeclaration();
- x1.setName(N1);
- basicMatch(x1);
- }
- public void testInfixExpression() {
- InfixExpression x1 = ast.newInfixExpression();
- x1.setOperator(InfixExpression.Operator.PLUS);
- x1.setLeftOperand(E1);
- x1.setRightOperand(E2);
- x1.extendedOperands().add(N1);
- x1.extendedOperands().add(N2);
- basicMatch(x1);
- }
- public void testInitializer() {
- Initializer x1 = ast.newInitializer();
- x1.setJavadoc(JD1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setBody(B1);
- basicMatch(x1);
- }
- /**
- * @deprecated (not really - just suppressing the warnings
- * that come from testing Javadoc.getComment())
- *
- */
- public void testJavadoc() {
- JSdoc x1 = ast.newJSdoc();
- if (ast.apiLevel() == AST.JLS2) {
- x1.setComment("/**?*/"); //$NON-NLS-1$
- }
- x1.tags().add(TAG1);
- x1.tags().add(TAG2);
- basicMatch(x1);
- }
-
- public void testLabeledStatement() {
- LabeledStatement x1 = ast.newLabeledStatement();
- x1.setLabel(N1);
- x1.setBody(S1);
- basicMatch(x1);
- }
-
- public void testLineComment() {
- LineComment x1 = ast.newLineComment();
- basicMatch(x1);
- }
-
- public void testMemberRef() {
- MemberRef x1 = ast.newMemberRef();
- x1.setQualifier(N1);
- x1.setName(N2);
- basicMatch(x1);
- }
-
- /** @deprecated using deprecated code */
- public void testMethodDeclaration() {
- FunctionDeclaration x1 = ast.newFunctionDeclaration();
- x1.setJavadoc(JD1);
- if (ast.apiLevel() == AST.JLS2) {
- x1.setReturnType(T1);
- } else {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- x1.setReturnType2(T1);
- }
- x1.setName(N1);
- x1.parameters().add(V1);
- x1.parameters().add(V2);
- x1.thrownExceptions().add(N2);
- x1.thrownExceptions().add(N3);
- x1.setBody(B1);
- basicMatch(x1);
- }
- public void testMethodInvocation() {
- FunctionInvocation x1 = ast.newFunctionInvocation();
- x1.setExpression(N1);
-
- x1.setName(N2);
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- basicMatch(x1);
- }
-
- public void testMethodRef() {
- FunctionRef x1 = ast.newFunctionRef();
- basicMatch(x1);
- x1.setQualifier(N1);
- x1.setName(N2);
- x1.parameters().add(MPARM1);
- }
- public void testMethodRefParameter() {
- FunctionRefParameter x1 = ast.newFunctionRefParameter();
- x1.setType(T1);
- x1.setName(N1);
- basicMatch(x1);
- }
-
- public void testNullLiteral() {
- NullLiteral x1 = ast.newNullLiteral();
- basicMatch(x1);
- }
- public void testNumberLiteral() {
- NumberLiteral x1 = ast.newNumberLiteral("1.0"); //$NON-NLS-1$
- basicMatch(x1);
- }
- public void testParenthesizedExpression() {
- ParenthesizedExpression x1 = ast.newParenthesizedExpression();
- basicMatch(x1);
- }
- public void testPostfixExpression() {
- PostfixExpression x1 = ast.newPostfixExpression();
- x1.setOperand(E1);
- x1.setOperator(PostfixExpression.Operator.INCREMENT);
- basicMatch(x1);
- }
- public void testPrefixExpression() {
- PrefixExpression x1 = ast.newPrefixExpression();
- x1.setOperand(E1);
- x1.setOperator(PrefixExpression.Operator.INCREMENT);
- basicMatch(x1);
- }
- public void testReturnStatement() {
- ReturnStatement x1 = ast.newReturnStatement();
- x1.setExpression(E1);
- basicMatch(x1);
- }
- public void testSingleVariableDeclaration() {
- SingleVariableDeclaration x1 = ast.newSingleVariableDeclaration();
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.setName(N1);
- x1.setInitializer(E1);
- basicMatch(x1);
- }
- public void testStringLiteral() {
- StringLiteral x1 = ast.newStringLiteral();
- x1.setLiteralValue("H"); //$NON-NLS-1$
- basicMatch(x1);
- }
- public void testSuperConstructorInvocation() {
- SuperConstructorInvocation x1 = ast.newSuperConstructorInvocation();
- x1.setExpression(N1);
-
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- basicMatch(x1);
- }
- public void testSuperFieldAccess() {
- SuperFieldAccess x1 = ast.newSuperFieldAccess();
- x1.setQualifier(N1);
- x1.setName(N2);
- basicMatch(x1);
- }
- public void testSuperMethodInvocation() {
- SuperMethodInvocation x1 = ast.newSuperMethodInvocation();
- x1.setQualifier(N1);
-
- x1.setName(N2);
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- basicMatch(x1);
- }
- public void testSwitchCase() {
- SwitchCase x1 = ast.newSwitchCase();
- x1.setExpression(E1);
- basicMatch(x1);
- }
- public void testSwitchStatement() {
- SwitchStatement x1 = ast.newSwitchStatement();
- x1.setExpression(E1);
- x1.statements().add(S1);
- x1.statements().add(S2);
- basicMatch(x1);
- }
-
- public void testTagElement() {
- TagElement x1 = ast.newTagElement();
- x1.setTagName("@foo"); //$NON-NLS-1$
- x1.fragments().add(TAG1);
- x1.fragments().add(TEXT1);
- x1.fragments().add(N1);
- x1.fragments().add(MTHREF1);
- basicMatch(x1);
- }
- public void testTextElement() {
- TextElement x1 = ast.newTextElement();
- x1.setText("foo"); //$NON-NLS-1$
- basicMatch(x1);
- }
-
- public void testThisExpression() {
- ThisExpression x1 = ast.newThisExpression();
- x1.setQualifier(N1);
- basicMatch(x1);
- }
- public void testThrowStatement() {
- ThrowStatement x1 = ast.newThrowStatement();
- x1.setExpression(E1);
- basicMatch(x1);
- }
- public void testTryStatement() {
- TryStatement x1 = ast.newTryStatement();
- x1.setBody(B1);
- CatchClause c1 = ast.newCatchClause();
- c1.setException(V1);
- c1.setBody(ast.newBlock());
- x1.catchClauses().add(c1);
- CatchClause c2 = ast.newCatchClause();
- c2.setException(V2);
- c2.setBody(ast.newBlock());
- x1.catchClauses().add(c2);
- x1.setFinally(ast.newBlock());
- basicMatch(x1);
- }
- /** @deprecated using deprecated code */
- public void testTypeDeclaration() {
- TypeDeclaration x1 = ast.newTypeDeclaration();
- x1.setJavadoc(JD1);
- x1.setName(N1);
- if (ast.apiLevel() == AST.JLS2) {
- x1.setSuperclass(N2);
- } else {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.bodyDeclarations().add(FD1);
- x1.bodyDeclarations().add(FD2);
- basicMatch(x1);
- }
- public void testTypeDeclarationStatement() {
- TypeDeclarationStatement x1 = ast.newTypeDeclarationStatement(TD1);
- basicMatch(x1);
- }
- public void testTypeLiteral() {
- TypeLiteral x1 = ast.newTypeLiteral();
- x1.setType(T1);
- basicMatch(x1);
- }
- public void testVariableDeclarationFragment() {
- VariableDeclarationFragment x1 = ast.newVariableDeclarationFragment();
- x1.setName(N1);
- x1.setInitializer(E1);
- basicMatch(x1);
- }
- public void testVariableDeclarationExpression() {
- VariableDeclarationExpression x1 = ast.newVariableDeclarationExpression(W1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.fragments().add(W2);
- basicMatch(x1);
- }
- public void testVariableDeclarationStatement() {
- VariableDeclarationStatement x1 = ast.newVariableDeclarationStatement(W1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.fragments().add(W2);
- basicMatch(x1);
- }
- public void testWhileStatement() {
- WhileStatement x1 = ast.newWhileStatement();
- x1.setExpression(E1);
- x1.setBody(S1);
- basicMatch(x1);
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTModelBridgeTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTModelBridgeTests.java
deleted file mode 100644
index 2642df9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTModelBridgeTests.java
+++ /dev/null
@@ -1,1419 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclaration;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.tests.model.AbstractJavaSearchTests;
-
-/*
- * Test the bridge between the DOM AST and the Java model.
- */
-public class ASTModelBridgeTests extends AbstractASTTests {
-
- IJavaScriptUnit workingCopy;
-
- public ASTModelBridgeTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(ASTModelBridgeTests.class);
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
-// TESTS_PREFIX = "testBug86380";
-// TESTS_NAMES = new String[] { "testCreateBindings19" };
-// TESTS_NUMBERS = new int[] { 83230 };
-// TESTS_RANGE = new int[] { 83304, -1 };
- }
-
- /*
- * Removes the marker comments "*start*" and "*end*" from the given contents,
- * builds an AST from the resulting source, and returns the AST node that was delimited
- * by "*start*" and "*end*".
- */
- private ASTNode buildAST(String contents) throws JavaScriptModelException {
- return buildAST(contents, this.workingCopy);
- }
-
- private IBinding[] createBindings(String contents, IJavaScriptElement element) throws JavaScriptModelException {
- this.workingCopy.getBuffer().setContents(contents);
- this.workingCopy.makeConsistent(null);
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setProject(getJavaProject("P"));
- IJavaScriptElement[] elements = new IJavaScriptElement[] {element};
- return parser.createBindings(elements, null);
- }
-
- private IBinding[] createBinaryBindings(String contents, IJavaScriptElement element) throws CoreException {
- createClassFile("/P/lib", "A.class", contents);
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setProject(getJavaProject("P"));
- IJavaScriptElement[] elements = new IJavaScriptElement[] {element};
- return parser.createBindings(elements, null);
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- setUpJavaProject();
- }
-
- private void setUpJavaProject() throws CoreException, IOException, JavaScriptModelException {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"}, new String[] {"JCL15_LIB,JCL15_SRC", "/P/lib"}, "bin", "1.5");
- project.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
- project.setOption(JavaScriptCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER, JavaScriptCore.IGNORE);
- project.setOption(JavaScriptCore.COMPILER_PB_FIELD_HIDING, JavaScriptCore.IGNORE);
- project.setOption(JavaScriptCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaScriptCore.IGNORE);
- project.setOption(JavaScriptCore.COMPILER_PB_TYPE_PARAMETER_HIDING, JavaScriptCore.IGNORE);
- project.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- addLibrary(
- project,
- "lib.jar",
- "libsrc.zip",
- new String[] {
- "p/Y.js",
- "package p;\n" +
- "public class Y<T> {\n" +
- " public Y(T t) {\n" +
- " }\n" +
- "}",
- "p/Z.js",
- "package p;\n" +
- "public class Z {\n" +
- " /*start*/class Member {\n" +
- " }/*end*/\n" +
- " void foo() {\n" +
- " new Member() {};\n" +
- " }\n" +
- "}",
- "p/W.js",
- "package p;\n" +
- "public class W {\n" +
- " class Member {\n" +
- " /*start*/Member(String s) {\n" +
- " }/*end*/\n" +
- " }\n" +
- "}",
- "p/ABC.js",
- "package p;\n" +
- "public class ABC {\n" +
- "}",
- "Z.js",
- "public class Z {\n" +
- " /*start*/class Member {\n" +
- " }/*end*/\n" +
- " void foo() {\n" +
- " new Member() {};\n" +
- " }\n" +
- "}"
- },
- "1.5");
- this.workingCopy = getCompilationUnit("/P/src/X.js").getWorkingCopy(
- new WorkingCopyOwner() {},
- null/*no progress*/);
- }
-
- public void tearDownSuite() throws Exception {
- tearDownJavaProject();
- super.tearDownSuite();
- }
-
- private void tearDownJavaProject() throws JavaScriptModelException, CoreException {
- if (this.workingCopy != null)
- this.workingCopy.discardWorkingCopy();
- deleteProject("P");
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing an anonymous type is correct.
- */
- public void testAnonymousType() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " Object foo() {\n" +
- " return new Object() /*start*/{\n" +
- " }/*end*/;\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((AnonymousClassDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "<anonymous #1> [in foo() [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- public void testAnonymousType2() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " public void foo() {\n" +
- " new Y(0/*c*/) /*start*/{\n" +
- " Object field;\n" +
- " }/*end*/;\n" +
- " }\n" +
- "}\n" +
- "class Y {\n" +
- " Y(int i) {\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((AnonymousClassDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "<anonymous #1> [in foo() [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing an array type is correct.
- */
- public void testArrayType1() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/Object[]/*end*/ field;\n" +
- "}"
- );
- IBinding binding = ((ArrayType) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Object [in Object.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing an array type of base type null.
- * (regression test for bug 100142
- CCE when calling ITypeBinding#getJavaElement() on char[][]
- */
- public void testArrayType2() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/char[][]/*end*/ field;\n" +
- "}"
- );
- IBinding binding = ((ArrayType) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "<null>",
- element
- );
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method coming from a class file is correct.
- * (regression test for bug 91445 IFunctionBinding.getJavaElement() returns an "unopen" IFunction)
- */
- public void testBinaryMethod() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("P", getExternalJCLPathString("1.5"), "java.lang", "Enum.class");
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("protected Enum")};
- markerInfo.astEnds = new int[] {source.indexOf('}', markerInfo.astStarts[0]) + 1};
- ASTNode node = buildAST(markerInfo, classFile);
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Enum(java.lang.String, int) [in Enum [in Enum.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a constructor of a binary member type is correct.
- * (regression test for bug 119249 codeResolve, search, etc. don't work on constructor of binary inner class)
- */
- public void testBinaryMemberTypeConstructor() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("P", "/P/lib.jar", "p", "W$Member.class");
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("/*start*/") + "/*start*/".length()};
- markerInfo.astEnds = new int[] {source.indexOf("/*end*/")};
- ASTNode node = buildAST(markerInfo, classFile);
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Member(p.W, java.lang.String) [in Member [in W$Member.class [in p [in lib.jar [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a type coming from a class file is correct.
- */
- public void testBinaryType() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("P", getExternalJCLPathString("1.5"), "java.lang", "String.class");
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("public")};
- markerInfo.astEnds = new int[] {source.lastIndexOf('}') + 1};
- ASTNode node = buildAST(markerInfo, classFile);
- IBinding binding = ((TypeDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "String [in String.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a type coming from a class file is correct
- * after searching for references to this type.
- * (regression test for bug 136016 [refactoring] CCE during Use Supertype refactoring)
- */
- public void testBinaryType2() throws CoreException {
- IClassFile classFile = getClassFile("P", "lib.jar", "p", "ABC.class"); // class with no references
-
- // ensure classfile is open
- classFile.open(null);
-
- //search for references to p.ABC after adding references in exactly 1 file
- try {
- createFile(
- "/P/src/Test.js",
- "import p.ABC;\n" +
- "public class Test extends ABC {\n" +
- "}"
- );
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {getPackageFragmentRoot("/P/src")});
- search(classFile.getType(), IJavaScriptSearchConstants.REFERENCES, scope, new AbstractJavaSearchTests.JavaSearchResultCollector());
- } finally {
- deleteFile("/P/src/Test.js");
- }
-
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("public")};
- markerInfo.astEnds = new int[] {source.lastIndexOf('}') + 1};
- ASTNode node = buildAST(markerInfo, classFile);
- IBinding binding = ((TypeDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "ABC [in ABC.class [in p [in lib.jar [in P]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a type in a jar is correct after deleting the first project
- * referencing it.
- */
- public void testBinaryType3() throws CoreException, IOException {
- // force String to be put in the jar cache
- buildAST(
- "public class X {\n" +
- " /*start*/String/*end*/ field;\n" +
- "}"
- );
- try {
- tearDownJavaProject();
-
- createJavaProject("P1", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile(
- "/P1/X.js",
- "public class X {\n" +
- " /*start*/String/*end*/ field;\n" +
- "}"
- );
- ASTNode node = buildAST(getCompilationUnit("/P1/X.js"));
- IBinding binding = ((Type) node).resolveBinding();
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "String [in String.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- } finally {
- deleteProject("P1");
- setUpJavaProject();
- }
- }
-
- /*
- * Ensures that the IJavaScriptElement for a binary member type coming from an anoumous class file is correct.
- * (regression test for bug 100636 [model] Can't find overriden methods of protected nonstatic inner class.)
- */
- public void testBinaryMemberTypeFromAnonymousClassFile1() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("P", "/P/lib.jar", "p", "Z$1.class");
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("/*start*/") + "/*start*/".length()};
- markerInfo.astEnds = new int[] {source.indexOf("/*end*/")};
- ASTNode node = buildAST(markerInfo, classFile);
- IBinding binding = ((TypeDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Member [in Z$Member.class [in p [in lib.jar [in P]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement for a binary member type coming from an anoumous class file is correct.
- * (regression test for bug 100636 [model] Can't find overriden methods of protected nonstatic inner class.)
- */
- public void testBinaryMemberTypeFromAnonymousClassFile2() throws JavaScriptModelException {
- IClassFile classFile = getClassFile("P", "/P/lib.jar", "", "Z$1.class");
- String source = classFile.getSource();
- MarkerInfo markerInfo = new MarkerInfo(source);
- markerInfo.astStarts = new int[] {source.indexOf("/*start*/") + "/*start*/".length()};
- markerInfo.astEnds = new int[] {source.indexOf("/*end*/")};
- ASTNode node = buildAST(markerInfo, classFile);
- IBinding binding = ((TypeDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Member [in Z$Member.class [in <default> [in lib.jar [in P]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (test several kinds of elements)
- */
- public void testCreateBindings01() throws JavaScriptModelException {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setResolveBindings(true);
- parser.setProject(getJavaProject("P"));
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/P/src/X.js",
- "public class X {\n" +
- " public void foo(int i, String s) {\n" +
- " }\n" +
- "}",
- owner, false);
- this.workingCopies[1] = getWorkingCopy(
- "/P/src/Y.js",
- "public class Y extends X {\n" +
- " void bar() {\n" +
- " new Y() {};\n" +
- " }\n" +
- "}",
- owner, false);
- this.workingCopies[2] = getWorkingCopy(
- "/P/src/I.js",
- "public interface I {\n" +
- " int BAR;\n" +
- "}",
- owner, false);
- IType typeX = this.workingCopies[0].getType("X");
- IJavaScriptElement[] elements = new IJavaScriptElement[] {
- typeX,
- getClassFile("P", getExternalJCLPathString("1.5"), "java.lang", "Object.class").getType(),
- typeX.getFunction("foo", new String[] {"I", "QString;"}),
- this.workingCopies[2].getType("I").getField("BAR"),
- this.workingCopies[1].getType("Y").getFunction("bar", new String[0]).getType("", 1)
- };
- IBinding[] bindings = parser.createBindings(elements, null);
- assertBindingsEqual(
- "LX;\n" +
- "Ljava/lang/Object;\n" +
- "LX;.foo(ILjava/lang/String;)V\n" +
- "LI;.BAR)I\n" +
- "LY$50;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (top level type)
- */
- public void testCreateBindings02() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public class X {\n" +
- "}",
- this.workingCopy.getType("X")
- );
- assertBindingsEqual(
- "LX;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (member type)
- */
- public void testCreateBindings03() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public class X {\n" +
- " public class Member {\n" +
- " }\n" +
- "}",
- this.workingCopy.getType("X").getType("Member")
- );
- assertBindingsEqual(
- "LX$Member;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (anonymous type)
- */
- public void testCreateBindings04() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public class X {\n" +
- " void foo() {\n" +
- " new X() {\n" +
- " };\n" +
- " }\n" +
- "}",
- this.workingCopy.getType("X").getFunction("foo", new String[0]).getType("", 1)
- );
- assertBindingsEqual(
- "LX$40;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (local type)
- */
- public void testCreateBindings05() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " }\n" +
- " }\n" +
- "}",
- this.workingCopy.getType("X").getFunction("foo", new String[0]).getType("Y", 1)
- );
- assertBindingsEqual(
- "LX$42$Y;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (field)
- */
- public void testCreateBindings06() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public class X {\n" +
- " int field;\n" +
- "}",
- this.workingCopy.getType("X").getField("field")
- );
- assertBindingsEqual(
- "LX;.field)I",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (method)
- */
- public void testCreateBindings07() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public class X {\n" +
- " void foo() {}\n" +
- "}",
- this.workingCopy.getType("X").getFunction("foo", new String[0])
- );
- assertBindingsEqual(
- "LX;.foo()V",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (annotation declaration)
- */
- public void testCreateBindings08() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "@interface X {\n" +
- "}",
- this.workingCopy.getType("X")
- );
- assertBindingsEqual(
- "LX;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (enum declaration)
- */
- public void testCreateBindings09() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public enum X {\n" +
- "}",
- this.workingCopy.getType("X")
- );
- assertBindingsEqual(
- "LX;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (annotation member declaration)
- */
- public void testCreateBindings10() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "@interface X {\n" +
- " int foo();\n" +
- "}",
- this.workingCopy.getType("X").getFunction("foo", new String[0])
- );
- assertBindingsEqual(
- "LX;.foo()I",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (enum constant)
- */
- public void testCreateBindings11() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "public enum X {\n" +
- " FOO;\n" +
- "}",
- this.workingCopy.getType("X").getField("FOO")
- );
- assertBindingsEqual(
- "LX;.FOO)LX;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (import)
- */
- public void testCreateBindings12() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "import java.io.*;\n" +
- "public class X implements Serializable {\n" +
- " static final long serialVersionUID = 0;\n" +
- "}",
- this.workingCopy.getImport("java.io.*")
- );
- assertBindingsEqual(
- "java/io",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (import)
- */
- public void testCreateBindings13() throws JavaScriptModelException {
- IBinding[] bindings = createBindings(
- "import java.io.Serializable;\n" +
- "public class X implements Serializable {\n" +
- " static final long serialVersionUID = 0;\n" +
- "}",
- this.workingCopy.getImport("java.io.Serializable")
- );
- assertBindingsEqual(
- "Ljava/io/Serializable;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (binary type)
- */
- public void testCreateBindings15() throws CoreException {
- IBinding[] bindings = createBinaryBindings(
- "public class A {\n" +
- "}",
- getClassFile("/P/lib/A.class").getType()
- );
- assertBindingsEqual(
- "LA;",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (binary field)
- */
- public void testCreateBindings16() throws CoreException {
- IBinding[] bindings = createBinaryBindings(
- "public class A {\n" +
- " int field;\n" +
- "}",
- getClassFile("/P/lib/A.class").getType().getField("field")
- );
- assertBindingsEqual(
- "LA;.field)I",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (binary method)
- */
- public void testCreateBindings17() throws CoreException {
- IBinding[] bindings = createBinaryBindings(
- "public class A {\n" +
- " int foo(String s, boolean b) {\n" +
- " return -1;\n" +
- " }\n" +
- "}",
- getClassFile("/P/lib/A.class").getType().getFunction("foo", new String[] {"Ljava.lang.String;", "Z"})
- );
- assertBindingsEqual(
- "LA;.foo(Ljava/lang/String;Z)I",
- bindings);
- }
-
- /*
- * Ensures that the correct IBindings are created for a given set of IJavaScriptElement
- * (binary method)
- * (regression test for bug 122650 ASTParser.createBindings(IJavaScriptElement[]) returns wrong element)
- */
- public void testCreateBindings18() throws CoreException {
- IBinding[] bindings = createBinaryBindings(
- "public class A {\n" +
- " <E> void foo(E e) {\n" +
- " }\n" +
- "}",
- getClassFile("/P/lib/A.class").getType().getFunction("foo", new String[] {"TE;"})
- );
- assertBindingsEqual(
- "LA;.foo<E:Ljava/lang/Object;>(TE;)V",
- bindings);
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a field is correct.
- */
- public void testField1() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " Object /*start*/field/*end*/;\n" +
- "}"
- );
- IBinding binding = ((VariableDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "field [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a field is correct.
- */
- public void testField2() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " Object foo() {\n" +
- " return new Object() {\n" +
- " Object /*start*/field/*end*/;\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((VariableDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "field [in <anonymous #1> [in foo() [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a local type is correct.
- */
- public void testLocalType() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " void foo() {\n" +
- " /*start*/class Y {\n" +
- " }/*end*/\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((TypeDeclarationStatement) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Y [in foo() [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a local type
- * and coming from a binding key resolution is correct.
- */
- public void testLocalType2() throws CoreException {
- String filePath = "/P/src/Z.js";
- try {
- String contents =
- "public class Z {\n" +
- " void foo() {\n" +
- " /*start*/class Local {\n" +
- " }/*end*/\n" +
- " }\n" +
- "}";
- createFile(filePath, contents);
-
- // Get the binding key
- ASTNode node = buildAST(contents, getCompilationUnit(filePath));
- IBinding binding = ((TypeDeclarationStatement) node).resolveBinding();
- String bindingKey = binding.getKey();
-
- // Resolve the binding key
- BindingRequestor requestor = new BindingRequestor();
- String[] bindingKeys = new String[] {bindingKey};
- resolveASTs(
- new IJavaScriptUnit[] {},
- bindingKeys,
- requestor,
- getJavaProject("P"),
- workingCopy.getOwner()
- );
- IBinding[] bindings = requestor.getBindings(bindingKeys);
-
- // Ensure the Java element is correct
- IJavaScriptElement element = bindings[0].getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Local [in foo() [in Z [in Z.java [in <default> [in src [in P]]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- } finally {
- deleteFile(filePath);
- }
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a local variable is correct.
- * (regression test for bug 79610 IVariableBinding#getJavaElement() returns null for local variables)
- */
- public void testLocalVariable1() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " void foo() {\n" +
- " int /*start*/local/*end*/;\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((VariableDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- IJavaScriptElement expected = getLocalVariable(this.workingCopy, "local", "local");
- assertEquals(
- "Unexpected Java element",
- expected,
- element
- );
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a local variable is correct.
- * (regression test for bug 79610 IVariableBinding#getJavaElement() returns null for local variables)
- */
- public void testLocalVariable2() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " void foo() {\n" +
- " Object first, /*start*/second/*end*/, third;\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((VariableDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- IJavaScriptElement expected = getLocalVariable(this.workingCopy, "second", "second");
- assertEquals(
- "Unexpected Java element",
- expected,
- element
- );
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a local variable is correct.
- * (regression test for bug 80021 [1.5] CCE in VariableBinding.getJavaElement())
- */
- public void testLocalVariable3() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " void foo(/*start*/int arg/*end*/) {\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((VariableDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- IJavaScriptElement expected = getLocalVariable(this.workingCopy, "arg", "arg");
- assertEquals(
- "Unexpected Java element",
- expected,
- element
- );
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a member type is correct.
- */
- public void testMemberType() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/class Y {\n" +
- " }/*end*/\n" +
- "}"
- );
- IBinding binding = ((TypeDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Y [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method is correct.
- */
- public void testMethod01() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X<K, V> {\n" +
- " /*start*/void foo(int i, Object o, java.lang.String s, Class[] c, X<K, V> x) {\n" +
- " }/*end*/\n" +
- "}"
- );
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "foo(int, Object, java.lang.String, Class[], X<K,V>) [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method is correct.
- */
- public void testMethod02() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X<K, V> {\n" +
- " /*start*/void foo() {\n" +
- " }/*end*/\n" +
- "}"
- );
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "foo() [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method is correct.
- * (regression test for bug 78757 FunctionBinding.getJavaElement() returns null)
- */
- public void testMethod03() throws JavaScriptModelException {
- IJavaScriptUnit otherWorkingCopy = null;
- try {
- otherWorkingCopy = getWorkingCopy(
- "/P/src/Y.js",
- "public class Y {\n" +
- " void foo(int i, String[] args, java.lang.Class clazz) {}\n" +
- "}",
- this.workingCopy.getOwner(),
- null
- );
- ASTNode node = buildAST(
- "public class X {\n" +
- " void bar() {\n" +
- " Y y = new Y();\n" +
- " /*start*/y.foo(1, new String[0], getClass())/*end*/;\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((FunctionInvocation) node).resolveMethodBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "foo(int, String[], java.lang.Class) [in Y [in [Working copy] Y.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- } finally {
- if (otherWorkingCopy != null)
- otherWorkingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method is correct.
- * (regression test for bug 81258 IFunctionBinding#getJavaElement() is null with inferred method parameterization)
- */
- public void testMethod04() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " void foo() {\n" +
- " /*start*/bar(new B<Object>())/*end*/;\n" +
- " }\n" +
- " <T extends Object> void bar(A<? extends T> arg) {\n" +
- " }\n" +
- "}\n" +
- "class A<T> {\n" +
- "}\n" +
- "class B<T> extends A<T> { \n" +
- "}"
- );
- IBinding binding = ((FunctionInvocation) node).resolveMethodBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "bar(A<? extends T>) [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a parameterized method is correct.
- * (regression test for bug 82382 IFunctionBinding#getJavaElement() for method m(T t) in parameterized type Gen<T> is null)
- */
- public void testMethod05() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X<T> {\n" +
- " void m(T t) { }\n" +
- "}\n" +
- "\n" +
- "class Y {\n" +
- " {\n" +
- " /*start*/new X<String>().m(\"s\")/*end*/;\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((FunctionInvocation) node).resolveMethodBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "m(T) [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method inside an annotation is correct.
- * (regression test for bug 83300 [1.5] ClassCastException in #getJavaElement() on binding of annotation element)
- */
- public void testMethod06() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "@X(/*start*/value/*end*/=\"Hello\", count=-1)\n" +
- "@interface X {\n" +
- " String value();\n" +
- " int count();\n" +
- "}"
- );
- IBinding binding = ((SimpleName) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "value() [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method with array parameters is correct.
- * (regression test for bug 88769 IFunctionBinding#getJavaElement() drops extra array dimensions and varargs
- */
- public void testMethod07() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/public int[] bar(int a[]) {\n" +
- " return a;\n" +
- " }/*end*/\n" +
- "}"
- );
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "bar(int[]) [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method with array parameters is correct.
- * (regression test for bug 88769 IFunctionBinding#getJavaElement() drops extra array dimensions and varargs
- */
- public void testMethod08() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/public Object[] bar2(Object[] o[][]) [][] {\n" +
- " return o;\n" +
- " }/*end*/\n" +
- "}"
- );
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "bar2(Object[][][]) [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a method with varargs parameters is correct.
- * (regression test for bug 88769 IFunctionBinding#getJavaElement() drops extra array dimensions and varargs
- */
- public void testMethod09() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/public void bar3(Object... objs) {\n" +
- " }/*end*/\n" +
- "}"
- );
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "bar3(Object[]) [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that getting the IJavaScriptElement of an IBinding representing a method in an anonymous type
- * doesn't throw a ClassCastException if there is a syntax error.
- * (regression test for bug 149853 CCE in IFunctionBinding#getJavaElement() for recovered anonymous type)
- */
- public void testMethod10() throws CoreException {
- try {
- // use a compilation unit instead of a working copy to use the ASTParser instead of reconcile
- createFile(
- "/P/src/Test.js",
- "public class X {\n" +
- " void test() {\n" +
- " new Object() {\n" +
- " /*start*/public void yes() {\n" +
- " System.out.println(\"hello world\");\n" +
- " }/*end*/\n" +
- " } // missing semicolon;\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/src/Test.js");
-
- ASTNode node = buildAST(null/*use existing contents*/, cu, false/*don't report errors*/, true/*statement recovery*/);
- IBinding binding = ((FunctionDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "yes() [in <anonymous #1> [in test() [in X [in Test.java [in <default> [in src [in P]]]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- } finally {
- deleteFile("/P/src/Test.js");
- }
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a package is correct.
- */
- public void testPackage1() throws CoreException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/java.lang/*end*/.String field;\n" +
- "}"
- );
- IBinding binding = ((QualifiedName) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "java.lang [in "+ getExternalJCLPathString("1.5") + "]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a package is correct
- * (case of default package)
- */
- public void testPackage2() throws CoreException {
- ASTNode node = buildAST(
- "/*start*/public class X {\n" +
- "}/*end*/"
- );
- ITypeBinding typeBinding = ((TypeDeclaration) node).resolveBinding();
- assertNotNull("No binding", typeBinding);
- IPackageBinding binding = typeBinding.getPackage();
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "<default> [in src [in P]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a parameterized binary type is correct.
- * (regression test for bug 78087 [dom] TypeBinding#getJavaElement() throws IllegalArgumentException for parameterized or raw reference to binary type)
- */
- public void testParameterizedBinaryType() throws CoreException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/Comparable<String>/*end*/ field;\n" +
- "}"
- );
- IBinding binding = ((Type) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Comparable [in Comparable.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a parameterized binary method is correct.
- * (regression test for bug 88892 [1.5] IFunctionBinding#getJavaElement() returns nonexistent IMethods (wrong parameter types))
- */
- public void testParameterizedBinaryMethod() throws CoreException {
- ASTNode node = buildAST(
- "public class X extends p.Y<String> {\n" +
- " public X(String s) {\n" +
- " /*start*/super(s);/*end*/\n" +
- " }\n" +
- "}"
- );
- IBinding binding = ((SuperConstructorInvocation) node).resolveConstructorBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Y(T) [in Y [in Y.class [in p [in lib.jar [in P]]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a raw binary type is correct.
- * (regression test for bug 78087 [dom] TypeBinding#getJavaElement() throws IllegalArgumentException for parameterized or raw reference to binary type)
- */
- public void testRawBinaryType() throws CoreException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/Comparable/*end*/ field;\n" +
- "}"
- );
- IBinding binding = ((Type) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Comparable [in Comparable.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a top level type is correct.
- */
- public void testTopLevelType1() throws JavaScriptModelException {
- ASTNode node = buildAST(
- "/*start*/public class X {\n" +
- "}/*end*/"
- );
- IBinding binding = ((TypeDeclaration) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "X [in [Working copy] X.java [in <default> [in src [in P]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a top level type is correct
- * (the top level type being in another compilation unit)
- */
- public void testTopLevelType2() throws CoreException {
- try {
- createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- ASTNode node = buildAST(
- "public class X extends /*start*/Y/*end*/ {\n" +
- "}"
- );
- IBinding binding = ((Type) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "Y [in Y.java [in <default> [in src [in P]]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- } finally {
- deleteFile("/P/src/Y.js");
- }
- }
-
- /*
- * Ensures that the IJavaScriptElement of an IBinding representing a top level type is correct
- * (the top level type being in a jar)
- */
- public void testTopLevelType3() throws CoreException {
- ASTNode node = buildAST(
- "public class X {\n" +
- " /*start*/String/*end*/ field;\n" +
- "}"
- );
- IBinding binding = ((Type) node).resolveBinding();
- assertNotNull("No binding", binding);
- IJavaScriptElement element = binding.getJavaElement();
- assertElementEquals(
- "Unexpected Java element",
- "String [in String.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]",
- element
- );
- assertTrue("Element should exist", element.exists());
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=160637
- */
- public void testCreateBindings19() throws CoreException {
- IBinding[] bindings = createBinaryBindings(
- "public class A {\n" +
- " String foo(String s) {\n" +
- " return null;\n" +
- " }\n" +
- "}",
- getClassFile("/P/lib/A.class").getType().getFunction("foo", new String[] {"Ljava.lang.String;"})
- );
- assertNotNull("No bindings", bindings);
- assertEquals("Wrong size", 1, bindings.length);
- assertTrue("Not a method binding", bindings[0] instanceof IFunctionBinding);
- assertBindingsEqual(
- "LA;.foo(Ljava/lang/String;)Ljava/lang/String;",
- bindings);
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTNodesCollectorVisitor.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTNodesCollectorVisitor.java
deleted file mode 100644
index 2b9ec0e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTNodesCollectorVisitor.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-
-class ASTNodesCollectorVisitor extends ASTVisitor {
-
- private Set detachedAstNodes;
-
- /**
- *
- * @see java.lang.Object#Object()
- */
- ASTNodesCollectorVisitor() {
- // visit Javadoc.tags()
- super(true);
- this.detachedAstNodes = new HashSet();
- }
-
- private void add(ASTNode node) {
- this.detachedAstNodes.add(node);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration)
- */
- public void endVisit(AnonymousClassDeclaration node) {
- add(node);
- detachedListElement(node.bodyDeclarations());
- }
-
- private void detachedListElement(List list) {
- for (int i = 0; i < list.size(); i++) {
- list.remove(0);
- }
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation)
- * @deprecated using deprecated code
- */
- public void endVisit(ClassInstanceCreation node) {
- if (node.getAST().apiLevel() == AST.JLS2) {
- node.setName(
- node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.JavaScriptUnit)
- */
- public void endVisit(JavaScriptUnit node) {
- detachedListElement(node.imports());
- node.setPackage(node.getAST().newPackageDeclaration());
- }
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.FieldAccess)
- */
- public void endVisit(FieldAccess node) {
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.FieldDeclaration)
- */
- public void endVisit(FieldDeclaration node) {
- detachedListElement(node.fragments());
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.ImportDeclaration)
- */
- public void endVisit(ImportDeclaration node) {
- add(node);
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see ASTVisitor#endVisit(MemberRef)
- * @since 3.0
- */
- public void endVisit(MemberRef node) {
- add(node);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.FunctionDeclaration)
- */
- public void endVisit(FunctionDeclaration node) {
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.FunctionInvocation)
- */
- public void endVisit(FunctionInvocation node) {
- add(node);
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see ASTVisitor#endVisit(FunctionRef)
- * @since 3.0
- */
- public void endVisit(FunctionRef node) {
- add(node);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.PackageDeclaration)
- */
- public void endVisit(PackageDeclaration node) {
- add(node);
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.QualifiedName)
- */
- public void endVisit(QualifiedName node) {
- add(node);
- node.setQualifier(node.getAST().newSimpleName("sss")); //$NON-NLS-1$
- node.setName(node.getAST().newSimpleName("sss")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.SimpleName)
- */
- public void endVisit(SimpleName node) {
- ASTNode parent = node.getParent();
- switch(parent.getNodeType()) {
- case ASTNode.CONTINUE_STATEMENT :
- case ASTNode.BREAK_STATEMENT :
- case ASTNode.LABELED_STATEMENT :
- break;
- default :
- add(node);
- }
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.SimpleType)
- */
- public void endVisit(SimpleType node) {
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration)
- */
- public void endVisit(SingleVariableDeclaration node) {
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.SuperFieldAccess)
- */
- public void endVisit(SuperFieldAccess node) {
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- node.setQualifier(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation)
- */
- public void endVisit(SuperMethodInvocation node) {
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- node.setQualifier(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.ThisExpression)
- */
- public void endVisit(ThisExpression node) {
- node.setQualifier(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.TypeDeclaration)
- * @deprecated using deprecated code
- */
- public void endVisit(TypeDeclaration node) {
- add(node);
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- if (node.getAST().apiLevel() == AST.JLS2) {
- node.setSuperclass(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
- detachedListElement(node.bodyDeclarations());
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression)
- */
- public void endVisit(VariableDeclarationExpression node) {
- detachedListElement(node.fragments());
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment)
- */
- public void endVisit(VariableDeclarationFragment node) {
- add(node);
- node.setName(node.getAST().newSimpleName("XXX")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement)
- */
- public void endVisit(VariableDeclarationStatement node) {
- detachedListElement(node.fragments());
- }
-
- /**
- * Returns the detachedAstNodes.
- * @return Set
- */
- public Set getDetachedAstNodes() {
- return detachedAstNodes;
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTParserTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTParserTest.java
deleted file mode 100644
index 52c580e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTParserTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-
-public class ASTParserTest extends org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase {
-
- /** @deprecated using deprecated code */
- public static Test suite() {
- // TODO (frederic) use buildList + setAstLevel(init) instead...
- junit.framework.TestSuite suite = new junit.framework.TestSuite(ASTParserTest.class.getName());
-
- Class c = ASTParserTest.class;
- Method[] methods = c.getMethods();
- for (int i = 0, max = methods.length; i < max; i++) {
- if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$
- suite.addTest(new ASTParserTest(methods[i].getName(), AST.JLS2));
- //suite.addTest(new ASTParserTest(methods[i].getName(), AST.JLS3));
- }
- }
- return suite;
- }
-
- AST ast;
- ASTParser parser;
- int API_LEVEL;
-
- public ASTParserTest(String name, int apiLevel) {
- super(name);
- this.API_LEVEL = apiLevel;
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- ast = AST.newAST(this.API_LEVEL);
- parser = ASTParser.newParser(this.API_LEVEL);
- }
-
- protected void tearDown() throws Exception {
- ast = null;
- super.tearDown();
- }
-
- /** @deprecated using deprecated code */
- public String getName() {
- String name = super.getName();
- switch (this.API_LEVEL) {
- case AST.JLS2:
- name = "JLS2 - " + name;
- break;
- case AST.JLS3:
- name = "JLS3 - " + name;
- break;
- }
- return name;
- }
-
- public void testKConstants() {
- assertTrue(ASTParser.K_EXPRESSION == 1);
- assertTrue(ASTParser.K_STATEMENTS == 2);
- assertTrue(ASTParser.K_CLASS_BODY_DECLARATIONS == 4);
- assertTrue(ASTParser.K_COMPILATION_UNIT == 8);
- }
-
- public void testSetting() {
- // for now, just slam some values in
- parser.setKind(ASTParser.K_COMPILATION_UNIT);
- parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
- parser.setKind(ASTParser.K_EXPRESSION);
- parser.setKind(ASTParser.K_STATEMENTS);
-
- parser.setSource(new char[0]);
- parser.setSource((char[]) null);
- parser.setSource((IJavaScriptUnit) null);
- parser.setSource((IClassFile) null);
-
- parser.setResolveBindings(false);
- parser.setResolveBindings(true);
-
- parser.setSourceRange(0, -1);
- parser.setSourceRange(0, 1);
- parser.setSourceRange(1, 0);
- parser.setSourceRange(1, -1);
-
- parser.setWorkingCopyOwner(null);
-
- parser.setUnitName(null);
- parser.setUnitName("Foo.js"); //$NON-NLS-1$
-
- parser.setProject(null);
-
- parser.setFocalPosition(-1);
- parser.setFocalPosition(0);
-
- parser.setCompilerOptions(null);
- parser.setCompilerOptions(new HashMap());
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTPositionsTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTPositionsTest.java
deleted file mode 100644
index e95775a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTPositionsTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-
-public class ASTPositionsTest extends ConverterTestSetup {
-
- IJavaScriptUnit workingCopy;
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS3);
- }
-
- public ASTPositionsTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(ASTPositionsTest.class);
- }
-
- private void sanityCheck(final String contents, JavaScriptUnit compilationUnit) {
- for (int i = 0, max = contents.length(); i < max; i++) {
- final int lineNumber = compilationUnit.getLineNumber(i);
- assertTrue("Wrong value for char at " + i, lineNumber >= 1);
- final int columnNumber = compilationUnit.getColumnNumber(i);
- assertTrue("Wrong value for char at " + i, columnNumber >= 0);
- final int position = compilationUnit.getPosition(lineNumber, columnNumber);
- assertTrue("Wrong value for char at i", position >= 0);
- if (position == 0) {
- assertEquals("Only true for first character", 0, i);
- }
- assertEquals("Wrong char", contents.charAt(i), contents.charAt(position));
- }
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- if (this.workingCopy != null) {
- this.workingCopy.discardWorkingCopy();
- this.workingCopy = null;
- }
- }
-
- public void test001() throws JavaScriptModelException {
- this.workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- final String contents =
- "var d = new Date();\r\n" +
- "function X() {\r\n" +
- " var date= d;\r\n" +
- "}";
- ASTNode node = buildAST(
- contents,
- this.workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals("Wrong char", 'X', contents.charAt(compilationUnit.getPosition(2, 9)));
- assertEquals("Wrong char", 'v', contents.charAt(compilationUnit.getPosition(1, 0)));
- assertEquals("Wrong position", -1, compilationUnit.getPosition(1, -1));
- assertEquals("Wrong position", -1, compilationUnit.getPosition(-1, 0));
- assertEquals("Wrong position", -1, compilationUnit.getPosition(5, 0));
- assertEquals("Wrong position", -1, compilationUnit.getPosition(4, 1));
- assertEquals("Wrong char", '}', contents.charAt(compilationUnit.getPosition(4, 0)));
- assertEquals("Wrong char", '\r', contents.charAt(compilationUnit.getPosition(1, 19)));
-
- sanityCheck(contents, compilationUnit);
- }
-
- public void test002() throws JavaScriptModelException {
- this.workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- final String contents =
- "function X() {\n" +
- " var map= null;\n" +
- "}\n";
- ASTNode node = buildAST(
- contents,
- this.workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- sanityCheck(contents, compilationUnit);
- }
-
- public void test003() throws JavaScriptModelException {
- this.workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- final String contents =
- "function X() {\r" +
- " var map= null;\r" +
- "}\r";
- ASTNode node = buildAST(
- contents,
- this.workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- sanityCheck(contents, compilationUnit);
- }
-
- public void test004() throws JavaScriptModelException {
- this.workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- String contents =
- "function X() {}";
- ASTNode node = buildAST(
- contents,
- this.workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- sanityCheck(contents, compilationUnit);
- assertEquals(1, compilationUnit.getLineNumber(0));
- }
-
- public void test005() throws JavaScriptModelException {
- this.workingCopy = getWorkingCopy("/Converter/src/X.js", true/*resolve*/);
- String contents =
- "function X() {}";
- ASTNode node = buildAST(
- contents,
- this.workingCopy,
- false);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit compilationUnit = (JavaScriptUnit) node;
- assertEquals(1, compilationUnit.getLineNumber(0));
- sanityCheck(contents, compilationUnit);
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTStructuralPropertyTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTStructuralPropertyTest.java
deleted file mode 100644
index 13eab69..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTStructuralPropertyTest.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.dom.*;
-
-public class ASTStructuralPropertyTest extends org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase {
-
- /** @deprecated using deprecated code */
- public static Test suite() {
- // TODO (frederic) use buildList + setAstLevel(init) instead...
- junit.framework.TestSuite suite = new junit.framework.TestSuite(ASTStructuralPropertyTest.class.getName());
-
- Class c = ASTStructuralPropertyTest.class;
- Method[] methods = c.getMethods();
- for (int i = 0, max = methods.length; i < max; i++) {
- if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$
- suite.addTest(new ASTStructuralPropertyTest(methods[i].getName(), AST.JLS2));
- suite.addTest(new ASTStructuralPropertyTest(methods[i].getName(), AST.JLS3));
- }
- }
- return suite;
- }
-
- AST ast;
- ASTParser parser;
- int API_LEVEL;
-
- public ASTStructuralPropertyTest(String name, int apiLevel) {
- super(name);
- this.API_LEVEL = apiLevel;
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- ast = AST.newAST(this.API_LEVEL);
- parser = ASTParser.newParser(this.API_LEVEL);
- }
-
- protected void tearDown() throws Exception {
- ast = null;
- super.tearDown();
- }
-
- /** @deprecated using deprecated code */
- public String getName() {
- String name = super.getName();
- switch (this.API_LEVEL) {
- case AST.JLS2:
- name = "JLS2 - " + name;
- break;
- case AST.JLS3:
- name = "JLS3 - " + name;
- break;
- }
- return name;
- }
-
- public void testLocationInParent() {
- final ASTNode root = SampleASTs.oneOfEach(ast);
- ASTVisitor v = new ASTVisitor(true) {
- public void postVisit(ASTNode node) {
- StructuralPropertyDescriptor me = node.getLocationInParent();
- assertTrue(me != null || (node == root));
- ASTNode p = node.getParent();
- if (p != null) {
- List parentProperties = p.structuralPropertiesForType();
- boolean foundMe = false;
- for (Iterator it = parentProperties.iterator(); it
- .hasNext();) {
- StructuralPropertyDescriptor prop =
- (StructuralPropertyDescriptor) it.next();
- if (me == prop || prop.getId().equals(me.getId())) {
- foundMe = true;
- break;
- }
- }
- assertTrue(foundMe);
- }
- }
- };
- root.accept(v);
- }
-
- /**
- * @deprecated since using deprecated constant
- */
- public void testStructuralProperties() {
- final ASTNode root = SampleASTs.oneOfEach(ast);
-
- final Set simpleProperties = new HashSet(400);
- final Set childProperties = new HashSet(400);
- final Set childListProperties = new HashSet(400);
- final Set visitedProperties = new HashSet(400);
- final Set nodeClasses = new HashSet(100);
-
- ASTVisitor v = new ASTVisitor(true) {
- public void postVisit(ASTNode node) {
- StructuralPropertyDescriptor me = node.getLocationInParent();
- if (me != null) {
- visitedProperties.add(me);
- }
- visitedProperties.add(me);
- nodeClasses.add(node.getClass());
- List ps = node.structuralPropertiesForType();
- for (Iterator it = ps.iterator(); it.hasNext(); ) {
- StructuralPropertyDescriptor p = (StructuralPropertyDescriptor) it.next();
- Object o = node.getStructuralProperty(p);
- if (p.isSimpleProperty()) {
- simpleProperties.add(p);
- // slam simple properties
- node.setStructuralProperty(p, o);
- } else if (p.isChildProperty()) {
- childProperties.add(p);
- // replace child with a copy
- ASTNode copy = ASTNode.copySubtree(ast, (ASTNode) o);
- node.setStructuralProperty(p, copy);
- } else if (p.isChildListProperty()) {
- childListProperties.add(p);
- // replace child list with copies
- List list = (List) o;
- List copy = ASTNode.copySubtrees(ast, list);
- list.clear();
- list.addAll(copy);
- }
- }
- }
- };
- root.accept(v);
- switch(this.API_LEVEL) {
- case AST.JLS2 :
- assertEquals("Wrong number of visited node classes", 67, nodeClasses.size());
- assertEquals("Wrong number of visited properties", 82, visitedProperties.size());
- assertEquals("Wrong number of simple properties", 26, simpleProperties.size());
- assertEquals("Wrong number of child properties", 90, childProperties.size());
- assertEquals("Wrong number of child list properties", 26, childListProperties.size());
- break;
- case AST.JLS3 :
- assertEquals("Wrong number of visited node classes", 80, nodeClasses.size());
- assertEquals("Wrong number of visited properties", 104, visitedProperties.size());
- assertEquals("Wrong number of simple properties", 23, simpleProperties.size());
- assertEquals("Wrong number of child properties", 115, childProperties.size());
- assertEquals("Wrong number of child list properties", 52, childListProperties.size());
- }
- // visit should rebuild tree
- ASTNode newRoot = SampleASTs.oneOfEach(ast);
- assertTrue(root.subtreeMatch(new ASTMatcher(), newRoot));
- }
-
- public void testProtect() {
- final ASTNode root = SampleASTs.oneOfEach(ast);
-
- // check that all properties are again modifiable
- class Slammer extends ASTVisitor {
- boolean shouldBeProtected;
- Slammer(boolean shouldBeProtected){
- super(true); // visit doc
- this.shouldBeProtected = shouldBeProtected;
- }
- public void postVisit(ASTNode node) {
- try {
- node.setSourceRange(1, 1);
- assertTrue(!shouldBeProtected);
- } catch (RuntimeException e) {
- assertTrue(shouldBeProtected);
- }
- List ps = node.structuralPropertiesForType();
- for (Iterator it = ps.iterator(); it.hasNext(); ) {
- StructuralPropertyDescriptor p = (StructuralPropertyDescriptor) it.next();
- Object o = node.getStructuralProperty(p);
- if (p.isSimpleProperty()) {
- // slam simple properties
- try {
- node.setStructuralProperty(p, o);
- assertTrue(!shouldBeProtected);
- } catch (RuntimeException e) {
- assertTrue(shouldBeProtected);
- }
- } else if (p.isChildProperty()) {
- // replace child with a copy
- ASTNode copy = ASTNode.copySubtree(ast, (ASTNode) o);
- try {
- node.setStructuralProperty(p, copy);
- assertTrue(!shouldBeProtected);
- } catch (RuntimeException e) {
- assertTrue(shouldBeProtected);
- }
- } else if (p.isChildListProperty()) {
- // replace child list with copies
- List list = (List) o;
- List copy = ASTNode.copySubtrees(ast, list);
- if (!list.isEmpty()) {
- try {
- list.clear();
- assertTrue(!shouldBeProtected);
- } catch (RuntimeException e) {
- assertTrue(shouldBeProtected);
- }
- try {
- list.addAll(copy);
- assertTrue(!shouldBeProtected);
- } catch (RuntimeException e) {
- assertTrue(shouldBeProtected);
- }
- }
- }
- }
- }
- }
-
- class Protector extends ASTVisitor {
- boolean shouldBeProtected;
- Protector(boolean shouldBeProtected){
- super(true); // visit doc
- this.shouldBeProtected = shouldBeProtected;
- }
- public void preVisit(ASTNode node) {
- int f = node.getFlags();
- if (shouldBeProtected) {
- f |= ASTNode.PROTECT;
- } else {
- f &= ~ASTNode.PROTECT;
- }
- node.setFlags(f);
- }
- }
-
-
- // mark all nodes as protected
- root.accept(new Protector(true));
- root.accept(new Slammer(true));
-
- // mark all nodes as unprotected
- root.accept(new Protector(false));
- root.accept(new Slammer(false));
- }
-
- public void testDelete() {
- final ASTNode root = SampleASTs.oneOfEach(ast);
-
- // check that nodes can be deleted unless mandatory
- root.accept(new ASTVisitor(true) {
- public void postVisit(ASTNode node) {
- List ps = node.structuralPropertiesForType();
- for (Iterator it = ps.iterator(); it.hasNext(); ) {
- StructuralPropertyDescriptor p = (StructuralPropertyDescriptor) it.next();
- if (p.isChildProperty()) {
- ChildPropertyDescriptor c = (ChildPropertyDescriptor) p;
- ASTNode child = (ASTNode) node.getStructuralProperty(c);
- if (!c.isMandatory() && child != null) {
- try {
- child.delete();
- assertTrue(node.getStructuralProperty(c) == null);
- } catch (RuntimeException e) {
- assertTrue(false);
- }
- }
- } else if (p.isChildListProperty()) {
- // replace child list with copies
- List list = (List) node.getStructuralProperty(p);
- // iterate over a copy and try removing all members
- List copy = new ArrayList();
- copy.addAll(list);
- for (Iterator it2 = copy.iterator(); it2.hasNext(); ) {
- ASTNode n = (ASTNode) it2.next();
- try {
- n.delete();
- assertTrue(!list.contains(n));
- } catch (RuntimeException e) {
- assertTrue(false);
- }
- }
- }
- }
- }
- });
- }
-
- /** @deprecated using deprecated code */
- public void testCreateInstance() {
- for (int nodeType = 0; nodeType < 100; nodeType++) {
- Class nodeClass = null;
- try {
- nodeClass = ASTNode.nodeClassForType(nodeType);
- } catch (RuntimeException e) {
- // oops - guess that's not valid
- }
- if (nodeClass != null) {
- try {
- ASTNode node = ast.createInstance(nodeClass);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue((nodeType >= 1) && (nodeType <= 69));
- } else {
- assertTrue((nodeType >= 1) && (nodeType <= 83));
- }
- assertTrue(node.getNodeType() == nodeType);
- //ASTNode node2 = ast.createInstance(nodeType);
- //assertTrue(node2.getNodeType() == nodeType);
- } catch (RuntimeException e) {
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue((nodeType < 1) || (nodeType > 69));
- } else {
- assertTrue((nodeType < 1) || (nodeType > 83));
- }
- }
- }
- }
- }
-
- public void testNodeClassForType() {
- Set classes = new HashSet(100);
- // make sure node types are contiguous starting at 0
- int hi = 0;
- for (int nodeType = 1; nodeType < 100; nodeType++) {
- try {
- Class nodeClass = ASTNode.nodeClassForType(nodeType);
- assertTrue(ASTNode.class.isAssignableFrom(nodeClass));
- classes.add(nodeClass);
- if (nodeType > 1) {
- assertTrue(hi == nodeType - 1);
- }
- hi = nodeType;
- } catch (RuntimeException e) {
- // oops - guess that's not valid
- }
- }
- assertTrue(hi == 83); // last known one
- assertTrue(classes.size() == hi); // all classes are distinct
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java
deleted file mode 100644
index dfb9462..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java
+++ /dev/null
@@ -1,7191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BlockComment;
-import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.Comment;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.LineComment;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.QualifiedType;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.TagElement;
-import org.eclipse.wst.jsdt.core.dom.TextElement;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
-import org.eclipse.wst.jsdt.core.dom.TryStatement;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.WhileStatement;
-
-// testing
-
-public class ASTTest extends org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase {
-
- class CheckPositionsMatcher extends ASTMatcher {
-
- public CheckPositionsMatcher() {
- // include doc tags
- super(true);
- }
-
- private void checkPositions(Object source, Object destination) {
- assertTrue(source instanceof ASTNode);
- assertTrue(destination instanceof ASTNode);
- int startPosition = ((ASTNode)source).getStartPosition();
- if (startPosition != -1) {
- assertTrue(startPosition == ((ASTNode)destination).getStartPosition());
- }
- int length = ((ASTNode)source).getLength();
- if (length != 0) {
- assertTrue(length == ((ASTNode)destination).getLength());
- }
- }
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(AnonymousClassDeclaration, Object)
- */
- public boolean match(AnonymousClassDeclaration node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ArrayAccess, Object)
- */
- public boolean match(ArrayAccess node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ArrayCreation, Object)
- */
- public boolean match(ArrayCreation node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ArrayInitializer, Object)
- */
- public boolean match(ArrayInitializer node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ArrayType, Object)
- */
- public boolean match(ArrayType node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(Assignment, Object)
- */
- public boolean match(Assignment node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(Block, Object)
- */
- public boolean match(Block node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(BlockComment, Object)
- * @since 3.0
- */
- public boolean match(BlockComment node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(BooleanLiteral, Object)
- */
- public boolean match(BooleanLiteral node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(BreakStatement, Object)
- */
- public boolean match(BreakStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(CatchClause, Object)
- */
- public boolean match(CatchClause node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(CharacterLiteral, Object)
- */
- public boolean match(CharacterLiteral node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ClassInstanceCreation, Object)
- */
- public boolean match(ClassInstanceCreation node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(JavaScriptUnit, Object)
- */
- public boolean match(JavaScriptUnit node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ConditionalExpression, Object)
- */
- public boolean match(ConditionalExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ConstructorInvocation, Object)
- */
- public boolean match(ConstructorInvocation node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ContinueStatement, Object)
- */
- public boolean match(ContinueStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(DoStatement, Object)
- */
- public boolean match(DoStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(EmptyStatement, Object)
- */
- public boolean match(EmptyStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(EnhancedForStatement, Object)
- * @since 3.0
- */
- public boolean match(EnhancedForStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ExpressionStatement, Object)
- */
- public boolean match(ExpressionStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(FieldAccess, Object)
- */
- public boolean match(FieldAccess node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(FieldDeclaration, Object)
- */
- public boolean match(FieldDeclaration node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ForStatement, Object)
- */
- public boolean match(ForStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(IfStatement, Object)
- */
- public boolean match(IfStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ImportDeclaration, Object)
- */
- public boolean match(ImportDeclaration node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(InfixExpression, Object)
- */
- public boolean match(InfixExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(Initializer, Object)
- */
- public boolean match(Initializer node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(InstanceofExpression, Object)
- */
- public boolean match(InstanceofExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(JSdoc, Object)
- */
- public boolean match(JSdoc node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(LabeledStatement, Object)
- */
- public boolean match(LabeledStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(LineComment, Object)
- * @since 3.0
- */
- public boolean match(LineComment node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(MemberRef, Object)
- * @since 3.0
- */
- public boolean match(MemberRef node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(FunctionDeclaration, Object)
- */
- public boolean match(FunctionDeclaration node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(FunctionInvocation, Object)
- */
- public boolean match(FunctionInvocation node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(FunctionRef, Object)
- * @since 3.0
- */
- public boolean match(FunctionRef node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(FunctionRefParameter, Object)
- * @since 3.0
- */
- public boolean match(FunctionRefParameter node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(Modifier, Object)
- * @since 3.0
- */
- public boolean match(Modifier node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(NullLiteral, Object)
- */
- public boolean match(NullLiteral node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(NumberLiteral, Object)
- */
- public boolean match(NumberLiteral node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(PackageDeclaration, Object)
- */
- public boolean match(PackageDeclaration node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ParenthesizedExpression, Object)
- */
- public boolean match(ParenthesizedExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(PostfixExpression, Object)
- */
- public boolean match(PostfixExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(PrefixExpression, Object)
- */
- public boolean match(PrefixExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(PrimitiveType, Object)
- */
- public boolean match(PrimitiveType node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(QualifiedName, Object)
- */
- public boolean match(QualifiedName node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(QualifiedType, Object)
- * @since 3.0
- */
- public boolean match(QualifiedType node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ReturnStatement, Object)
- */
- public boolean match(ReturnStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SimpleName, Object)
- */
- public boolean match(SimpleName node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SimpleType, Object)
- */
- public boolean match(SimpleType node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SingleVariableDeclaration, Object)
- */
- public boolean match(SingleVariableDeclaration node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(StringLiteral, Object)
- */
- public boolean match(StringLiteral node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SuperConstructorInvocation, Object)
- */
- public boolean match(SuperConstructorInvocation node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SuperFieldAccess, Object)
- */
- public boolean match(SuperFieldAccess node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SuperMethodInvocation, Object)
- */
- public boolean match(SuperMethodInvocation node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SwitchCase, Object)
- */
- public boolean match(SwitchCase node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(SwitchStatement, Object)
- */
- public boolean match(SwitchStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(TagElement, Object)
- * @since 3.0
- */
- public boolean match(TagElement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(TextElement, Object)
- * @since 3.0
- */
- public boolean match(TextElement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ThisExpression, Object)
- */
- public boolean match(ThisExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(ThrowStatement, Object)
- */
- public boolean match(ThrowStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(TryStatement, Object)
- */
- public boolean match(TryStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(TypeDeclaration, Object)
- */
- public boolean match(TypeDeclaration node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(TypeDeclarationStatement, Object)
- */
- public boolean match(TypeDeclarationStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(TypeLiteral, Object)
- */
- public boolean match(TypeLiteral node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(VariableDeclarationExpression, Object)
- */
- public boolean match(VariableDeclarationExpression node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(VariableDeclarationFragment, Object)
- */
- public boolean match(VariableDeclarationFragment node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(VariableDeclarationStatement, Object)
- */
- public boolean match(VariableDeclarationStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTMatcher#match(WhileStatement, Object)
- */
- public boolean match(WhileStatement node, Object other) {
- checkPositions(node, other);
- return super.match(node, other);
- }
- }
-
- /** @deprecated using deprecated code */
- public static Test suite() {
- // TODO (frederic) use buildList + setAstLevel(init) instead...
- junit.framework.TestSuite suite = new junit.framework.TestSuite(ASTTest.class.getName());
-
- Class c = ASTTest.class;
- Method[] methods = c.getMethods();
- for (int i = 0, max = methods.length; i < max; i++) {
- if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$
- suite.addTest(new ASTTest(methods[i].getName(), AST.JLS2));
- //suite.addTest(new ASTTest(methods[i].getName(), AST.JLS3));
- }
- }
- return suite;
- }
-
- AST ast;
- int API_LEVEL;
-
-
- public ASTTest(String name, int apiLevel) {
- super(name);
- this.API_LEVEL = apiLevel;
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- ast = AST.newAST(this.API_LEVEL);
- }
-
- protected void tearDown() throws Exception {
- ast = null;
- super.tearDown();
- }
-
- /** @deprecated using deprecated code */
- public String getName() {
- String name = super.getName();
- switch (this.API_LEVEL) {
- case AST.JLS2:
- name = "JLS2 - " + name;
- break;
- case AST.JLS3:
- name = "JLS3 - " + name;
- break;
- }
- return name;
- }
-
- /**
- * Snippets that show how to...
- * @deprecated using deprecated code
- */
- public void testExampleSnippets() {
- {
- AST localAst = AST.newAST(ast.apiLevel());
- JavaScriptUnit cu = localAst.newJavaScriptUnit();
-
- // package com.example;
- PackageDeclaration pd = localAst.newPackageDeclaration();
- pd.setName(localAst.newName(new String[]{"com", "example"})); //$NON-NLS-1$ //$NON-NLS-2$
- cu.setPackage(pd);
- assertTrue(pd.getRoot() == cu);
-
- // import java.io;*;
- ImportDeclaration im1 = localAst.newImportDeclaration();
- im1.setName(localAst.newName(new String[]{"java", "io"})); //$NON-NLS-1$ //$NON-NLS-2$
- im1.setOnDemand(true);
- cu.imports().add(im1);
- assertTrue(im1.getRoot() == cu);
-
- // import java.util.List;
- ImportDeclaration im2 = localAst.newImportDeclaration();
- im2.setName(localAst.newName(new String[]{"java", "util", "List"})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- im2.setOnDemand(false);
- cu.imports().add(im2);
- assertTrue(im2.getRoot() == cu);
-
- // /** Spec. \n @deprecated Use {@link #foo() bar} instead. */public class MyClass {}
- TypeDeclaration td = localAst.newTypeDeclaration();
- if (ast.apiLevel() == AST.JLS2) {
- td.setModifiers(Modifier.PUBLIC);
- } else {
- td.modifiers().add(localAst.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
- }
- td.setName(localAst.newSimpleName("MyClass")); //$NON-NLS-1$
- {
- JSdoc jd = localAst.newJSdoc();
- TagElement tg0 = localAst.newTagElement();
- jd.tags().add(tg0);
- TextElement tx1 = localAst.newTextElement();
- tx1.setText("Spec."); //$NON-NLS-1$
- tg0.fragments().add(tx1);
- TagElement tg1 = localAst.newTagElement();
- tg1.setTagName(TagElement.TAG_DEPRECATED);
- jd.tags().add(tg1);
- TextElement tx2 = localAst.newTextElement();
- tx2.setText("Use "); //$NON-NLS-1$
- tg1.fragments().add(tx2);
- TagElement tg2 = localAst.newTagElement();
- tg2.setTagName(TagElement.TAG_LINK);
- tg1.fragments().add(tg2);
- FunctionRef mr1 = localAst.newFunctionRef();
- mr1.setName(localAst.newSimpleName("foo"));
- tg2.fragments().add(mr1);
- TextElement tx3 = localAst.newTextElement();
- tx3.setText("bar"); //$NON-NLS-1$
- tg2.fragments().add(tx3);
- TextElement tx4 = localAst.newTextElement();
- tx2.setText(" instead."); //$NON-NLS-1$
- tg1.fragments().add(tx4);
- }
-
- cu.types().add(td);
- assertTrue(td.getRoot() == cu);
-
- // private static boolean DEBUG = true;
- VariableDeclarationFragment f1 = localAst.newVariableDeclarationFragment();
- f1.setName(localAst.newSimpleName("DEBUG")); //$NON-NLS-1$
- f1.setInitializer(localAst.newBooleanLiteral(true));
- FieldDeclaration fd = localAst.newFieldDeclaration(f1);
- fd.setType(localAst.newPrimitiveType(PrimitiveType.BOOLEAN));
- if (ast.apiLevel() == AST.JLS2) {
- fd.setModifiers(Modifier.PRIVATE | Modifier.FINAL);
- } else {
- fd.modifiers().add(localAst.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD));
- fd.modifiers().add(localAst.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
- }
- td.bodyDeclarations().add(fd);
- assertTrue(fd.getRoot() == cu);
-
- // public static void main();
- FunctionDeclaration md = localAst.newFunctionDeclaration();
- if (ast.apiLevel() == AST.JLS2) {
- md.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
- md.setReturnType(localAst.newPrimitiveType(PrimitiveType.VOID));
- } else {
- md.modifiers().add(localAst.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
- md.modifiers().add(localAst.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
- md.setReturnType2(localAst.newPrimitiveType(PrimitiveType.VOID));
- }
- md.setConstructor(false);
- md.setName(localAst.newSimpleName("main")); //$NON-NLS-1$
- td.bodyDeclarations().add(md);
- assertTrue(md.getRoot() == cu);
-
- // String[] args
- SingleVariableDeclaration a1 = localAst.newSingleVariableDeclaration();
- a1.setType(localAst.newArrayType(
- localAst.newSimpleType(localAst.newSimpleName("String")))); //$NON-NLS-1$
- a1.setName(localAst.newSimpleName("args")); //$NON-NLS-1$
- md.parameters().add(a1);
- assertTrue(a1.getRoot() == cu);
-
- // {}
- Block b = localAst.newBlock();
- md.setBody(b);
- assertTrue(b.getRoot() == cu);
-
- // System.out.println("hello world");
- FunctionInvocation e = localAst.newFunctionInvocation();
- e.setExpression(localAst.newName(new String[] {"System", "out"})); //$NON-NLS-1$ //$NON-NLS-2$
- e.setName(localAst.newSimpleName("println")); //$NON-NLS-1$
- StringLiteral h = localAst.newStringLiteral();
- h.setLiteralValue("hello world"); //$NON-NLS-1$
- e.arguments().add(h);
-
- b.statements().add(localAst.newExpressionStatement(e));
- assertTrue(e.getRoot() == cu);
- assertTrue(h.getRoot() == cu);
-
- // new String[len];
- ArrayCreation ac1 = localAst.newArrayCreation();
- ac1.setType(
- localAst.newArrayType(
- localAst.newSimpleType(localAst.newSimpleName("String")))); //$NON-NLS-1$
- ac1.dimensions().add(localAst.newSimpleName("len")); //$NON-NLS-1$
- b.statements().add(localAst.newExpressionStatement(ac1));
- assertTrue(ac1.getRoot() == cu);
-
- // new double[7][24][];
- ArrayCreation ac2 = localAst.newArrayCreation();
- ac2.setType(
- localAst.newArrayType(
- localAst.newPrimitiveType(PrimitiveType.DOUBLE), 3));
- ac2.dimensions().add(localAst.newNumberLiteral("7")); //$NON-NLS-1$
- ac2.dimensions().add(localAst.newNumberLiteral("24")); //$NON-NLS-1$
- b.statements().add(localAst.newExpressionStatement(ac2));
- assertTrue(ac2.getRoot() == cu);
-
- // new int[] {1, 2};
- ArrayCreation ac3 = localAst.newArrayCreation();
- ac3.setType(
- localAst.newArrayType(
- localAst.newPrimitiveType(PrimitiveType.INT)));
- ArrayInitializer ai = localAst.newArrayInitializer();
- ac3.setInitializer(ai);
- ai.expressions().add(localAst.newNumberLiteral("1")); //$NON-NLS-1$
- ai.expressions().add(localAst.newNumberLiteral("2")); //$NON-NLS-1$
- b.statements().add(localAst.newExpressionStatement(ac3));
- assertTrue(ac3.getRoot() == cu);
- assertTrue(ai.getRoot() == cu);
-
- // new String(10);
- ClassInstanceCreation cr1 = localAst.newClassInstanceCreation();
- if (ast.apiLevel() == AST.JLS2) {
- cr1.setName(localAst.newSimpleName("String")); //$NON-NLS-1$
- } else {
- cr1.setType(localAst.newSimpleType(localAst.newSimpleName("String"))); //$NON-NLS-1$
- }
- cr1.arguments().add(localAst.newNumberLiteral("10")); //$NON-NLS-1$
- b.statements().add(localAst.newExpressionStatement(cr1));
- assertTrue(cr1.getRoot() == cu);
-
- // new Listener() {public void handleEvent() {} };
- ClassInstanceCreation cr2 = localAst.newClassInstanceCreation();
- AnonymousClassDeclaration ad1 = localAst.newAnonymousClassDeclaration();
- cr2.setAnonymousClassDeclaration(ad1);
- if (ast.apiLevel() == AST.JLS2) {
- cr2.setName(localAst.newSimpleName("Listener")); //$NON-NLS-1$
- } else {
- cr2.setType(localAst.newSimpleType(localAst.newSimpleName("Listener"))); //$NON-NLS-1$
- }
- FunctionDeclaration md0 = localAst.newFunctionDeclaration();
- if (ast.apiLevel() == AST.JLS2) {
- md0.setModifiers(Modifier.PUBLIC);
- } else {
- md0.modifiers().add(localAst.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
- }
- md0.setName(localAst.newSimpleName("handleEvent")); //$NON-NLS-1$
- md0.setBody(localAst.newBlock());
- ad1.bodyDeclarations().add(md0);
- b.statements().add(localAst.newExpressionStatement(cr2));
- assertTrue(cr2.getRoot() == cu);
- assertTrue(md0.getRoot() == cu);
- assertTrue(ad1.getRoot() == cu);
-
- }
- }
-
- abstract class Property {
-
- /**
- * Indicates whether this property is compulsory, in that every node
- * must have a value at all times.
- */
- private boolean compulsory;
-
- private Class nodeType;
- private String propertyName;
-
- /**
- * Creates a new property with the given name.
- */
- Property(String propertyName, boolean compulsory, Class nodeType) {
- this.propertyName = propertyName;
- this.compulsory = compulsory;
- this.nodeType = nodeType;
- }
-
- /**
- * Returns a sample node of a type suitable for storing
- * in this property.
- *
- * @param targetAST the target AST
- * @param parented <code>true</code> if the sample should be
- * parented, and <code>false</code> if unparented
- * @return a sample node
- */
- public abstract ASTNode sample(AST targetAST, boolean parented);
-
- /**
- * Returns examples of node of types unsuitable for storing
- * in this property.
- * <p>
- * This implementation returns an empty list. Subclasses
- * should reimplement to specify counter-examples.
- * </p>
- *
- * @param targetAST the target AST
- * @return a list of counter-example nodes
- */
- public ASTNode[] counterExamples(AST targetAST) {
- return new ASTNode[] {};
- }
-
- /**
- * Returns a sample node of a type suitable for storing
- * in this property. The sample embeds the node itself.
- * <p>
- * For instance, for an Expression-valued property of a given
- * Statement, this method returns an Expression that embeds
- * this Statement node (as a descendent).
- * </p>
- * <p>
- * Returns <code>null</code> if such an embedding is impossible.
- * For instance, for an Name-valued property of a given
- * Statement, this method returns <code>null</code> because
- * an Expression cannot be embedded in a Name.
- * </p>
- * <p>
- * This implementation returns <code>null</code>. Subclasses
- * should reimplement to specify an embedding.
- * </p>
- *
- * @return a sample node that embeds the given node,
- * and <code>null</code> if such an embedding is impossible
- */
- public ASTNode wrap() {
- return null;
- }
-
- /**
- * Undoes the effects of a previous <code>wrap</code>.
- * <p>
- * This implementation does nothing. Subclasses
- * should reimplement if they reimplement <code>wrap</code>.
- * </p>
- */
- public void unwrap() {
- }
-
- /**
- * Returns whether this property is compulsory, in that every node
- * must have a value at all times.
- *
- * @return <code>true</code> if the property is compulsory,
- * and <code>false</code> if the property may be null
- */
- public final boolean isCompulsory() {
- return compulsory;
- }
-
- /**
- * Returns the value of this property.
- * <p>
- * This implementation throws an unchecked exception. Subclasses
- * should reimplement.
- * </p>
- *
- * @return the property value, or <code>null</code> if no value
- */
- public ASTNode get() {
- throw new RuntimeException("get not implemented"); //$NON-NLS-1$
- }
-
- /**
- * Sets or clears the value of this property.
- * <p>
- * This implementation throws an unchecked exception. Subclasses
- * should reimplement.
- * </p>
- *
- * @param value the property value, or <code>null</code> if no value
- */
- public void set(ASTNode value) {
- throw new RuntimeException("get(" + value + ") not implemented"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public String toString() {
- return "Property(" + this.propertyName + ", " + this.compulsory + ", " + this.nodeType + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- }
-
- /**
- * Exercises the given property of the given node.
- *
- * @param node the node to test
- * @param prop the property descriptor
- */
- void genericPropertyTest(ASTNode node, Property prop) {
-
- ASTNode x1 = prop.sample(node.getAST(), false);
- prop.set(x1);
- assertTrue(prop.get() == x1);
- assertTrue(x1.getParent() == node);
-
- // check handling of null
- if (prop.isCompulsory()) {
- try {
- prop.set(null);
- } catch (RuntimeException e) {
- // pass
- }
- } else {
- long previousCount = node.getAST().modificationCount();
- prop.set(null);
- assertTrue(prop.get() == null);
- assertTrue(node.getAST().modificationCount() > previousCount);
- }
-
- // check that a child from a different AST is detected
- try {
- AST newAST = AST.newAST(node.getAST().apiLevel());
- prop.set(prop.sample(newAST, false));
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check that a child with a parent is detected
- try {
- ASTNode b1 = prop.sample(node.getAST(), true);
- prop.set(b1); // bogus: already has parent
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check that a cycle is detected
- assertTrue(node.getParent() == null);
- ASTNode s1 = null;
- try {
- s1 = prop.wrap();
- if (s1 != null) {
- prop.set(s1); // bogus: creates a cycle
- assertTrue(false);
- }
- } catch (RuntimeException e) {
- // pass
- } finally {
- if (s1 != null) {
- prop.unwrap();
- assertTrue(node.getParent() == null);
- }
- }
-
- // check that a child of the wrong type is detected
- ASTNode b1[] = prop.counterExamples(node.getAST());
- for (int i = 0; i < b1.length; i++) {
- try {
- prop.set(b1[i]); // bogus: wrong type
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- }
-
- }
-
- /**
- * Exercises the given property of the given node.
- *
- * @param node the node to test
- * @param children the node to test
- * @param prop the property descriptor
- */
- void genericPropertyListTest(ASTNode node, List children, Property prop) {
-
- // wipe the slate clean
- children.clear();
- assertTrue(children.size() == 0);
-
- // add a child
- ASTNode x1 = prop.sample(node.getAST(), false);
- long previousCount = node.getAST().modificationCount();
- children.add(x1);
- assertTrue(node.getAST().modificationCount() > previousCount);
- assertTrue(children.size() == 1);
- assertTrue(children.get(0) == x1);
- assertTrue(x1.getParent() == node);
-
- // add a second child
- ASTNode x2 = prop.sample(node.getAST(), false);
- previousCount = node.getAST().modificationCount();
- children.add(x2);
- assertTrue(node.getAST().modificationCount() > previousCount);
- assertTrue(children.size() == 2);
- assertTrue(children.get(0) == x1);
- assertTrue(children.get(1) == x2);
- assertTrue(x1.getParent() == node);
- assertTrue(x2.getParent() == node);
-
- // remove the first child
- previousCount = node.getAST().modificationCount();
- children.remove(0);
- assertTrue(node.getAST().modificationCount() > previousCount);
- assertTrue(children.size() == 1);
- assertTrue(children.get(0) == x2);
- assertTrue(x1.getParent() == null);
- assertTrue(x2.getParent() == node);
-
- // remove the remaining child
- previousCount = node.getAST().modificationCount();
- children.remove(x2);
- assertTrue(node.getAST().modificationCount() > previousCount);
- assertTrue(children.size() == 0);
- assertTrue(x1.getParent() == null);
- assertTrue(x2.getParent() == null);
-
- // check that null is never allowed
- try {
- children.add(null);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check that a child from a different AST is detected
- try {
- AST newAST = AST.newAST(node.getAST().apiLevel());
- children.add(prop.sample(newAST, false));
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check that a child with a parent is detected
- try {
- ASTNode b1 = prop.sample(node.getAST(), true);
- children.add(b1); // bogus: already has parent
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check that a cycle is detected
- assertTrue(node.getParent() == null);
- ASTNode s1 = null;
- try {
- s1 = prop.wrap();
- if (s1 != null) {
- children.add(s1); // bogus: creates a cycle
- assertTrue(false);
- }
- } catch (RuntimeException e) {
- // pass
- } finally {
- if (s1 != null) {
- prop.unwrap();
- assertTrue(node.getParent() == null);
- }
- }
-
- // check that a child of the wrong type is detected
- ASTNode b1[] = prop.counterExamples(node.getAST());
- for (int i = 0; i < b1.length; i++) {
- try {
- children.add(b1[i]); // bogus: wrong type
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- }
-
- }
-
- /** @deprecated using deprecated code */
- public void testAST() {
-
- assertTrue(AST.JLS2 == 2);
- assertTrue(AST.JLS3 == 3);
-
- AST a0 = new AST(); // deprecated, but still 2.0
- assertTrue(a0.apiLevel() == AST.JLS2);
- AST a1 = new AST(new HashMap()); // deprecated, but still 2.0
- assertTrue(a1.apiLevel() == AST.JLS2);
- AST a2 = AST.newAST(AST.JLS2);
- assertTrue(a2.apiLevel() == AST.JLS2);
- AST a3 = AST.newAST(AST.JLS3);
- assertTrue(a3.apiLevel() == AST.JLS3);
-
-
- // modification count is always non-negative
- assertTrue(ast.modificationCount() >= 0);
-
- // modification count increases for node creations
- long previousCount = ast.modificationCount();
- SimpleName x = ast.newSimpleName("first"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
-
- // modification count does not increase for reading node attributes
- previousCount = ast.modificationCount();
- x.getIdentifier();
- x.getParent();
- x.getRoot();
- x.getAST();
- x.getFlags();
- x.getStartPosition();
- x.getLength();
- x.equals(x);
- assertTrue(ast.modificationCount() == previousCount);
-
- // modification count does not increase for reading or writing properties
- previousCount = ast.modificationCount();
- x.getProperty("any"); //$NON-NLS-1$
- x.setProperty("any", "value"); // N.B. //$NON-NLS-1$ //$NON-NLS-2$
- x.properties();
- assertTrue(ast.modificationCount() == previousCount);
-
- // modification count increases for changing node attributes
- previousCount = ast.modificationCount();
- x.setIdentifier("second"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
-
- previousCount = ast.modificationCount();
- x.setFlags(0);
- assertTrue(ast.modificationCount() > previousCount);
-
- previousCount = ast.modificationCount();
- x.setSourceRange(-1,0);
- assertTrue(ast.modificationCount() > previousCount);
- }
-
- public void testWellKnownBindings() {
-
- // well known bindings
- String[] wkbs = {
- "byte", "char", "short", "int", "long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "boolean", "float", "double", "void", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "java.lang.Class", //$NON-NLS-1$
- "java.lang.Cloneable", //$NON-NLS-1$
- "java.lang.Error", //$NON-NLS-1$
- "java.lang.Exception", //$NON-NLS-1$
- "java.lang.Object", //$NON-NLS-1$
- "java.lang.RuntimeException", //$NON-NLS-1$
- "java.lang.String", //$NON-NLS-1$
- "java.lang.StringBuffer", //$NON-NLS-1$
- "java.lang.Throwable", //$NON-NLS-1$
- "java.io.Serializable", //$NON-NLS-1$
- "java.lang.Boolean", //$NON-NLS-1$
- "java.lang.Byte", //$NON-NLS-1$
- "java.lang.Character", //$NON-NLS-1$
- "java.lang.Double", //$NON-NLS-1$
- "java.lang.Float", //$NON-NLS-1$
- "java.lang.Integer", //$NON-NLS-1$
- "java.lang.Long", //$NON-NLS-1$
- "java.lang.Short", //$NON-NLS-1$
- "java.lang.Void", //$NON-NLS-1$
- };
-
- // no-so-well-known bindings
- String[] nwkbs = {
- "verylong", //$NON-NLS-1$
- "java.lang.Math", //$NON-NLS-1$
- "com.example.MyCode", //$NON-NLS-1$
- };
-
- // none of the well known bindings resolve in a plain AST
- for (int i = 0; i<wkbs.length; i++) {
- assertTrue(ast.resolveWellKnownType(wkbs[i]) == null);
- }
-
- // none of the no so well known bindings resolve either
- for (int i = 0; i<nwkbs.length; i++) {
- assertTrue(ast.resolveWellKnownType(nwkbs[i]) == null);
- }
- }
-
- public void testSimpleName() {
- long previousCount = ast.modificationCount();
- SimpleName x = ast.newSimpleName("foo"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue("foo".equals(x.getIdentifier())); //$NON-NLS-1$
- assertTrue("foo".equals(x.getFullyQualifiedName())); //$NON-NLS-1$
- assertTrue(x.getNodeType() == ASTNode.SIMPLE_NAME);
- assertTrue(x.isDeclaration() == false);
- assertTrue(x.structuralPropertiesForType() == SimpleName.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
- x.setIdentifier("bar"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue("bar".equals(x.getIdentifier())); //$NON-NLS-1$
- assertTrue("bar".equals(x.getFullyQualifiedName())); //$NON-NLS-1$
-
- // check that property cannot be set to null
- try {
- x.setIdentifier(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check that property cannot be set to keyword or reserved work
- String[] reserved =
- new String[] {
- "true", "false", "null", // literals //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "abstract", "default", "if", "private", "this", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "boolean", "do", "implements", "protected", "throw", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "break", "double", "import", "public", "throws", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "byte", "else", "instanceof", "return", "transient", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "case", "extends", "int", "short", "try", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "catch", "final", "interface", "static", "void", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "char", "finally", "long", "strictfp", "volatile", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "class", "float", "native", "super", "while", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "const", "for", "new", "switch", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "continue", "goto", "package", "synchronized"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- for (int i=0; i<reserved.length; i++) {
- try {
- x.setIdentifier(reserved[i]);
- } catch (RuntimeException e) {
- // pass
- }
- }
-
- // check that property cannot be set to keyword or reserved work
- String[] bogus =
- new String[] {
- "a b", "a ", " a", // literals //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "a-b", "a[]", "a<T>", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "", " ", "a.b"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- for (int i=0; i<bogus.length; i++) {
- try {
- x.setIdentifier(bogus[i]);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- }
- // check that "assert" is not considered a keyword
- // "assert" only became a keyword in J2SE 1.4 and we do *not* want to
- // preclude the AST API from being used to analyze pre-1.4 code
- x.setIdentifier("assert"); //$NON-NLS-1$
-
- // check that "enum" is not considered a keyword
- // "enum" only became a keyword in J2SE 1.5 and we do *not* want to
- // preclude the AST API from being used to analyze pre-1.5 code
- x.setIdentifier("enum"); //$NON-NLS-1$
-
- // check that isDeclaration works
- QualifiedName y = ast.newQualifiedName(ast.newSimpleName("a"), x); //$NON-NLS-1$
- assertTrue(x.isDeclaration() == false);
- y.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- assertTrue(x.isDeclaration() == false);
-
- TypeDeclaration td = ast.newTypeDeclaration();
- td.setName(x);
- assertTrue(x.isDeclaration() == true);
- td.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- assertTrue(x.isDeclaration() == false);
-
- FunctionDeclaration md = ast.newFunctionDeclaration();
- md.setName(x);
- assertTrue(x.isDeclaration() == true);
- md.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- assertTrue(x.isDeclaration() == false);
-
- SingleVariableDeclaration vd = ast.newSingleVariableDeclaration();
- vd.setName(x);
- assertTrue(x.isDeclaration() == true);
- vd.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- assertTrue(x.isDeclaration() == false);
-
- VariableDeclarationFragment fd = ast.newVariableDeclarationFragment();
- fd.setName(x);
- assertTrue(x.isDeclaration() == true);
- fd.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- assertTrue(x.isDeclaration() == false);
-
-
- }
-
- public void testQualifiedName() {
- long previousCount = ast.modificationCount();
- final QualifiedName x = ast.newQualifiedName(
- ast.newSimpleName("q"), //$NON-NLS-1$
- ast.newSimpleName("i")); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getQualifier().getParent() == x);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getName().isDeclaration() == false);
- assertTrue(x.getNodeType() == ASTNode.QUALIFIED_NAME);
- assertTrue("q.i".equals(x.getFullyQualifiedName())); //$NON-NLS-1$
- assertTrue(x.structuralPropertiesForType() == QualifiedName.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Qualifier", true, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- QualifiedName result = targetAst.newQualifiedName(
- targetAst.newSimpleName("a"), //$NON-NLS-1$
- targetAst.newSimpleName("b")); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- QualifiedName s1 = ast.newQualifiedName(x, ast.newSimpleName("z")); //$NON-NLS-1$
- return s1;
- }
- public void unwrap() {
- QualifiedName s1 = (QualifiedName) x.getParent();
- s1.setQualifier(ast.newSimpleName("z")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getQualifier();
- }
- public void set(ASTNode value) {
- x.setQualifier((Name) value);
- }
- });
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- // test fullyQualifiedName on nested names
- Name q0 = ast.newName(new String[] {"a", "bb", "ccc", "dddd", "eeeee", "ffffff"});
- assertTrue("a.bb.ccc.dddd.eeeee.ffffff".equals(q0.getFullyQualifiedName())); //$NON-NLS-1$
-
- }
-
- public void testNameFactories() {
- long previousCount = ast.modificationCount();
- Name x = ast.newName("foo"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue("foo".equals(x.getFullyQualifiedName())); //$NON-NLS-1$
- assertTrue(x.getNodeType() == ASTNode.SIMPLE_NAME);
-
- previousCount = ast.modificationCount();
- x = ast.newName("foo.bar"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue("foo.bar".equals(x.getFullyQualifiedName())); //$NON-NLS-1$
- assertTrue(x.getNodeType() == ASTNode.QUALIFIED_NAME);
- QualifiedName q = (QualifiedName) x;
- assertTrue("bar".equals(q.getName().getFullyQualifiedName())); //$NON-NLS-1$
- assertTrue("foo".equals(q.getQualifier().getFullyQualifiedName())); //$NON-NLS-1$
-
- // check that simple and qualified names work
- String[] legal =
- new String[] {
- "a", "abcdef", "XYZZY", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "a.b", "java.lang.Object", "a.b.c.d.e"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- for (int i=0; i<legal.length; i++) {
- try {
- x = ast.newName(legal[i]);
- assertTrue(legal[i].equals(x.getFullyQualifiedName()));
- } catch (RuntimeException e) {
- assertTrue(false);
- }
- }
-
- // check that property cannot be set to keyword or reserved work
- String[] bogus =
- new String[] {
- "", ".", ".a", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "a.", "a..b", "..a"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- for (int i=0; i<bogus.length; i++) {
- try {
- x = ast.newName(bogus[i]);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- }
- }
-
- public void testNullLiteral() {
- long previousCount = ast.modificationCount();
- NullLiteral x = ast.newNullLiteral();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.NULL_LITERAL);
- assertTrue(x.structuralPropertiesForType() == NullLiteral.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- }
-
- public void testBooleanLiteral() {
- long previousCount = ast.modificationCount();
- BooleanLiteral x = ast.newBooleanLiteral(true);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.booleanValue() == true);
- assertTrue(x.getNodeType() == ASTNode.BOOLEAN_LITERAL);
- assertTrue(x.structuralPropertiesForType() == BooleanLiteral.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
- x.setBooleanValue(false);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.booleanValue() == false);
-
- previousCount = ast.modificationCount();
- x.setBooleanValue(true);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.booleanValue() == true);
- }
-
- public void testStringLiteral() {
- long previousCount = ast.modificationCount();
- // check 0-arg factory first
- StringLiteral x = ast.newStringLiteral();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue("\"\"".equals(x.getEscapedValue())); //$NON-NLS-1$
- assertTrue("".equals(x.getLiteralValue())); //$NON-NLS-1$
- assertTrue(x.getNodeType() == ASTNode.STRING_LITERAL);
- assertTrue(x.structuralPropertiesForType() == StringLiteral.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
- x.setEscapedValue("\"bye\""); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue("\"bye\"".equals(x.getEscapedValue())); //$NON-NLS-1$
- assertTrue("bye".equals(x.getLiteralValue())); //$NON-NLS-1$
-
- previousCount = ast.modificationCount();
- x.setLiteralValue("hi"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue("\"hi\"".equals(x.getEscapedValue())); //$NON-NLS-1$
- assertTrue("hi".equals(x.getLiteralValue())); //$NON-NLS-1$
-
- previousCount = ast.modificationCount();
- x.setLiteralValue("\\012\\015"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertEquals("different", "\"\\\\012\\\\015\"", x.getEscapedValue()); //$NON-NLS-1$
- assertTrue("\\012\\015".equals(x.getLiteralValue())); //$NON-NLS-1$
-
- previousCount = ast.modificationCount();
- x.setLiteralValue("\012\015"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue("\n\r".equals(x.getLiteralValue())); //$NON-NLS-1$
- assertEquals("different", "\"\\n\\r\"", x.getEscapedValue()); //$NON-NLS-1$
-
- // check that property cannot be set to null
- try {
- x.setEscapedValue(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check that property cannot be set to null
- try {
- x.setLiteralValue(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- }
-
- public void testStringLiteralUnicode() {
- AST localAst = AST.newAST(ast.apiLevel());
- StringLiteral literal = localAst.newStringLiteral();
- literal.setEscapedValue("\"hello\\u0026\\u0050worl\\u0064\""); //$NON-NLS-1$
- assertTrue(literal.getLiteralValue().equals("hello&Pworld")); //$NON-NLS-1$
-
- localAst = AST.newAST(ast.apiLevel());
- literal = localAst.newStringLiteral();
- literal.setEscapedValue("\"hello\\nworld\""); //$NON-NLS-1$
- assertTrue(literal.getLiteralValue().equals("hello\nworld")); //$NON-NLS-1$
-
- localAst = AST.newAST(ast.apiLevel());
- literal = localAst.newStringLiteral();
- literal.setLiteralValue("hello\nworld"); //$NON-NLS-1$
- assertTrue(literal.getLiteralValue().equals("hello\nworld")); //$NON-NLS-1$
-
- localAst = AST.newAST(ast.apiLevel());
- literal = localAst.newStringLiteral();
- literal.setLiteralValue("\n"); //$NON-NLS-1$
- assertTrue(literal.getEscapedValue().equals("\"\\n\"")); //$NON-NLS-1$
- assertTrue(literal.getLiteralValue().equals("\n")); //$NON-NLS-1$
-
- localAst = AST.newAST(ast.apiLevel());
- literal = localAst.newStringLiteral();
- literal.setEscapedValue("\"hello\\\"world\""); //$NON-NLS-1$
- assertTrue(literal.getLiteralValue().equals("hello\"world")); //$NON-NLS-1$
-
- localAst = AST.newAST(ast.apiLevel());
- literal = localAst.newStringLiteral();
- literal.setLiteralValue("hello\\u0026world"); //$NON-NLS-1$
- assertTrue(literal.getLiteralValue().equals("hello\\u0026world")); //$NON-NLS-1$
-
- localAst = AST.newAST(ast.apiLevel());
- literal = localAst.newStringLiteral();
- literal.setLiteralValue("hello\\u0026world"); //$NON-NLS-1$
- assertTrue(literal.getEscapedValue().equals("\"hello\\\\u0026world\"")); //$NON-NLS-1$
-
- localAst = AST.newAST(ast.apiLevel());
- literal = localAst.newStringLiteral();
- literal.setLiteralValue("\\u0001"); //$NON-NLS-1$
- assertTrue(literal.getEscapedValue().equals("\"\\\\u0001\"")); //$NON-NLS-1$
- }
-
- public void testCharacterLiteral() {
- long previousCount = ast.modificationCount();
- CharacterLiteral x = ast.newCharacterLiteral();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getEscapedValue().startsWith("\'")); //$NON-NLS-1$
- assertTrue(x.getEscapedValue().endsWith("\'")); //$NON-NLS-1$
- assertTrue(x.getNodeType() == ASTNode.CHARACTER_LITERAL);
- assertTrue(x.structuralPropertiesForType() == CharacterLiteral.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
- x.setEscapedValue("\'z\'"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue("\'z\'".equals(x.getEscapedValue())); //$NON-NLS-1$
- assertTrue(x.charValue() == 'z');
-
- // test other factory method
- previousCount = ast.modificationCount();
- CharacterLiteral y = ast.newCharacterLiteral();
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(y.getAST() == ast);
- assertTrue(y.getParent() == null);
- String v = y.getEscapedValue();
- assertTrue(v.length() >= 3 && v.charAt(0) == '\'' & v.charAt(v.length()-1 ) == '\'');
-
- // check that property cannot be set to null
- try {
- x.setEscapedValue(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // test escaped characters
- // b, t, n, f, r, ", ', \, 0, 1, 2, 3, 4, 5, 6, or 7
- try {
- x.setEscapedValue("\'\\b\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\t\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\n\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\f\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\\"\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\'\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\\\\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\0\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\1\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\2\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\3\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\4\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\5\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\6\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\7\'"); //$NON-NLS-1$
- x.setEscapedValue("\'\\u0041\'"); //$NON-NLS-1$
- assertTrue(x.charValue() == 'A');
- } catch(IllegalArgumentException e) {
- assertTrue(false);
- }
-
- x.setCharValue('\u0041');
- assertTrue(x.getEscapedValue().equals("\'A\'")); //$NON-NLS-1$
- x.setCharValue('\t');
- assertTrue(x.getEscapedValue().equals("\'\\t\'")); //$NON-NLS-1$
- x.setEscapedValue("\'\\\\\'"); //$NON-NLS-1$
- assertTrue(x.getEscapedValue().equals("\'\\\\\'")); //$NON-NLS-1$
- assertTrue(x.charValue() == '\\');
- x.setEscapedValue("\'\\\'\'"); //$NON-NLS-1$
- assertTrue(x.getEscapedValue().equals("\'\\\'\'")); //$NON-NLS-1$
- assertTrue(x.charValue() == '\'');
- x.setCharValue('\'');
- assertTrue(x.getEscapedValue().equals("\'\\\'\'")); //$NON-NLS-1$
- assertTrue(x.charValue() == '\'');
- x.setCharValue('\\');
- assertTrue(x.getEscapedValue().equals("\'\\\\\'")); //$NON-NLS-1$
- assertTrue(x.charValue() == '\\');
- }
-
- public void testNumberLiteral() {
- long previousCount = ast.modificationCount();
- NumberLiteral x = ast.newNumberLiteral("1234"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue("1234".equals(x.getToken())); //$NON-NLS-1$
- assertTrue(x.getNodeType() == ASTNode.NUMBER_LITERAL);
- assertTrue(x.structuralPropertiesForType() == NumberLiteral.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // test other factory method
- previousCount = ast.modificationCount();
- NumberLiteral y = ast.newNumberLiteral();
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(y.getAST() == ast);
- assertTrue(y.getParent() == null);
- assertTrue("0".equals(y.getToken())); //$NON-NLS-1$
-
- final String[] samples =
- { "0", "1", "1234567890", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "0L", "1L", "1234567890L", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "0l", "1l", "1234567890l", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "077", "0177", "012345670", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "077L", "0177L", "012345670L", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "077l", "0177l", "012345670l", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "0x00", "0x1", "0x0123456789ABCDEF", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "0x00L", "0x1L", "0x0123456789ABCDEFL", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "0x00l", "0x1l", "0x0123456789ABCDEFl", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "1e1f", "2.f", ".3f", "0f", "3.14f", "6.022137e+23f", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- "1e1", "2.", ".3", "0.0", "3.14", "1e-9d", "1e137", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- };
- for (int i = 0; i < samples.length; i++) {
- previousCount = ast.modificationCount();
- x.setToken(samples[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(samples[i].equals(x.getToken()));
- }
-
- // check that property cannot be set to null
- try {
- x.setToken(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- }
-
- public void testSimpleType() {
- long previousCount = ast.modificationCount();
- final SimpleType x = ast.newSimpleType(ast.newSimpleName("String")); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.isSimpleType());
- assertTrue(!x.isArrayType());
- assertTrue(!x.isPrimitiveType());
- assertTrue(!x.isQualifiedType());
- assertTrue(x.getNodeType() == ASTNode.SIMPLE_TYPE);
- assertTrue(x.structuralPropertiesForType() == SimpleType.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Name", true, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("a"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((Name) value);
- }
- });
- }
-
- public void testPrimitiveType() {
- long previousCount = ast.modificationCount();
- PrimitiveType x = ast.newPrimitiveType(PrimitiveType.INT);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getPrimitiveTypeCode().equals(PrimitiveType.INT));
- assertTrue(!x.isSimpleType());
- assertTrue(!x.isArrayType());
- assertTrue(x.isPrimitiveType());
- assertTrue(!x.isQualifiedType());
- assertTrue(x.getNodeType() == ASTNode.PRIMITIVE_TYPE);
- assertTrue(x.structuralPropertiesForType() == PrimitiveType.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // check the names of the primitive type codes
- assertTrue(PrimitiveType.BYTE.toString().equals("byte")); //$NON-NLS-1$
- assertTrue(PrimitiveType.INT.toString().equals("int")); //$NON-NLS-1$
- assertTrue(PrimitiveType.BOOLEAN.toString().equals("boolean")); //$NON-NLS-1$
- assertTrue(PrimitiveType.CHAR.toString().equals("char")); //$NON-NLS-1$
- assertTrue(PrimitiveType.SHORT.toString().equals("short")); //$NON-NLS-1$
- assertTrue(PrimitiveType.LONG.toString().equals("long")); //$NON-NLS-1$
- assertTrue(PrimitiveType.FLOAT.toString().equals("float")); //$NON-NLS-1$
- assertTrue(PrimitiveType.DOUBLE.toString().equals("double")); //$NON-NLS-1$
- assertTrue(PrimitiveType.VOID.toString().equals("void")); //$NON-NLS-1$
-
-
- PrimitiveType.Code[] known = {
- PrimitiveType.BOOLEAN,
- PrimitiveType.BYTE,
- PrimitiveType.CHAR,
- PrimitiveType.INT,
- PrimitiveType.SHORT,
- PrimitiveType.LONG,
- PrimitiveType.FLOAT,
- PrimitiveType.DOUBLE,
- PrimitiveType.VOID,
- };
-
- // check all primitive type codes are distinct
- for (int i = 0; i < known.length; i++) {
- for (int j = 0; j < known.length; j++) {
- assertTrue(i == j || !known[i].equals(known[j]));
- }
- }
-
- // check all primitive type codes work
- for (int i = 0; i < known.length; i++) {
- previousCount = ast.modificationCount();
- x.setPrimitiveTypeCode(known[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getPrimitiveTypeCode().equals(known[i]));
- }
- // ensure null does not work as a primitive type code
- try {
- x.setPrimitiveTypeCode(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check toCode lookup of primitive type code by name
- for (int i = 0; i < known.length; i++) {
- String name = known[i].toString();
- assertTrue(PrimitiveType.toCode(name).equals(known[i]));
- }
- assertTrue(PrimitiveType.toCode("not-a-type") == null); //$NON-NLS-1$
- }
-
- public void testArrayType() {
- SimpleName x1 = ast.newSimpleName("String"); //$NON-NLS-1$
- SimpleType x2 = ast.newSimpleType(x1);
- long previousCount = ast.modificationCount();
- final ArrayType x = ast.newArrayType(x2);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getComponentType().getParent() == x);
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
- assertTrue(!x.isSimpleType());
- assertTrue(x.isArrayType());
- assertTrue(!x.isPrimitiveType());
- assertTrue(!x.isQualifiedType());
- assertTrue(x.getNodeType() == ASTNode.ARRAY_TYPE);
- assertTrue(x.structuralPropertiesForType() == ArrayType.propertyDescriptors(ast.apiLevel()));
-
- assertTrue(x.getDimensions() == 1);
- assertTrue(x.getElementType() == x2);
-
- genericPropertyTest(x, new Property("ComponentType", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("a")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ArrayType result = ast.newArrayType(x);
- return result;
- }
- public void unwrap() {
- ArrayType a = (ArrayType) x.getParent();
- a.setComponentType(ast.newPrimitiveType(PrimitiveType.INT));
- }
- public ASTNode get() {
- return x.getComponentType();
- }
- public void set(ASTNode value) {
- x.setComponentType((Type) value);
- }
- });
-
- x.setComponentType(
- ast.newArrayType(ast.newPrimitiveType(PrimitiveType.INT), 4));
-
- assertTrue(x.getDimensions() == 5);
- assertTrue(x.getElementType().isPrimitiveType());
- }
-
- /** @deprecated using deprecated code */
- public void testQualifiedType() {
- if (ast.apiLevel() == AST.JLS2) {
- // node type introduced in 3.0 API
- try {
- ast.newQualifiedType(
- ast.newSimpleType(ast.newSimpleName("q")), //$NON-NLS-1$
- ast.newSimpleName("i")); //$NON-NLS-1$
- assertTrue(false);
- } catch (UnsupportedOperationException e) {
- // pass
- }
- return;
- }
- long previousCount = ast.modificationCount();
- final QualifiedType x = ast.newQualifiedType(
- ast.newSimpleType(ast.newSimpleName("q")), //$NON-NLS-1$
- ast.newSimpleName("i")); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getQualifier().getParent() == x);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getName().isDeclaration() == false);
- assertTrue(x.getNodeType() == ASTNode.QUALIFIED_TYPE);
- assertTrue(!x.isSimpleType());
- assertTrue(!x.isArrayType());
- assertTrue(!x.isPrimitiveType());
- assertTrue(x.isQualifiedType());
- assertTrue(x.structuralPropertiesForType() == QualifiedType.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Qualifier", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result =
- targetAst.newSimpleType(
- targetAst.newSimpleName("a")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode wrap() {
- QualifiedType s1 = ast.newQualifiedType(x, ast.newSimpleName("z")); //$NON-NLS-1$
- return s1;
- }
- public void unwrap() {
- QualifiedType s1 = (QualifiedType) x.getParent();
- s1.setQualifier(ast.newSimpleType(ast.newSimpleName("z"))); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getQualifier();
- }
- public void set(ASTNode value) {
- x.setQualifier((Type) value);
- }
- });
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
- }
-
- public void testPackageDeclaration() {
- long previousCount = ast.modificationCount();
- final PackageDeclaration x = ast.newPackageDeclaration();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() >= AST.JLS3) {
- assertTrue(x.getJavadoc() == null);
- assertTrue(x.annotations().isEmpty());
- }
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.PACKAGE_DECLARATION);
- assertTrue(x.structuralPropertiesForType() == PackageDeclaration.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyTest(x, new Property("Javadoc", false, JSdoc.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- JSdoc result = targetAst.newJSdoc();
- if (parented) {
- targetAst.newInitializer().setJavadoc(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getJavadoc();
- }
- public void set(ASTNode value) {
- x.setJavadoc((JSdoc) value);
- }
- });
-
-
- }
-
- genericPropertyTest(x, new Property("Name", true, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("a"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((Name) value);
- }
- });
- }
-
- public void testImportDeclaration() {
- long previousCount = ast.modificationCount();
- final ImportDeclaration x = ast.newImportDeclaration();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.isOnDemand() == false);
- if (ast.apiLevel() >= AST.JLS3) {
- assertTrue(x.isStatic() == false);
- }
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.IMPORT_DECLARATION);
- assertTrue(x.structuralPropertiesForType() == ImportDeclaration.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Name", true, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("a"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((Name) value);
- }
- });
-
- previousCount = ast.modificationCount();
- x.setOnDemand(false);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isOnDemand() == false);
- previousCount = ast.modificationCount();
- x.setOnDemand(true);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isOnDemand() == true);
-
- if (ast.apiLevel() >= AST.JLS3) {
- x.setStatic(true);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isStatic() == true);
- }
- }
-
- public void testCompilationUnit() {
- long previousCount = ast.modificationCount();
- final JavaScriptUnit x = ast.newJavaScriptUnit();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getPackage() == null);
- assertTrue(x.imports().size() == 0);
- assertTrue(x.types().size() == 0);
- assertTrue(x.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- assertTrue(x.structuralPropertiesForType() == JavaScriptUnit.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tClientProperties(x);
-
- genericPropertyTest(x, new Property("Package", false, PackageDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- PackageDeclaration result = targetAst.newPackageDeclaration();
- if (parented) {
- JavaScriptUnit cu = targetAst.newJavaScriptUnit();
- cu.setPackage(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getPackage();
- }
- public void set(ASTNode value) {
- x.setPackage((PackageDeclaration) value);
- }
- });
-
- genericPropertyListTest(x, x.imports(), new Property("Imports", true, ImportDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- ImportDeclaration result = targetAst.newImportDeclaration();
- if (parented) {
- JavaScriptUnit cu = targetAst.newJavaScriptUnit();
- cu.imports().add(result);
- }
- return result;
- }
- });
-
- genericPropertyListTest(x, x.types(), new Property("Types", true, AbstractTypeDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- TypeDeclaration result = targetAst.newTypeDeclaration();
- if (parented) {
- JavaScriptUnit cu = targetAst.newJavaScriptUnit();
- cu.types().add(result);
- }
- return result;
- }
- });
-
- // check that TypeDeclarations in body are classified correctly
- TypeDeclaration t1 = ast.newTypeDeclaration();
- x.types().add(t1);
- assertTrue(t1.isLocalTypeDeclaration() == false);
- assertTrue(t1.isMemberTypeDeclaration() == false);
- assertTrue(t1.isPackageMemberTypeDeclaration() == true);
-
- }
-
- public void testCompilationUnitLineNumberTable() {
-// TO RUN THIS TEST YOU MUST TEMPORARILY MAKE PUBLIC
-// THE METHOD JavaScriptUnit.setLineEndTable
-
-// final JavaScriptUnit x = ast.newCompilationUnit();
-//
-// // table starts off empty
-// for (int i= -10; i < 10; i++) {
-// assertTrue(x.lineNumber(i) == 1);
-// }
-//
-// // supply a simple line table to test
-// String s = "AA\nBBB\nCC\nDDDD\nEEE";
-// assertTrue(s.length() == 18); // cross check
-// int le[] = new int[5];
-// le[0] = s.indexOf('\n');
-// le[1] = s.indexOf('\n', le[0] + 1);
-// le[2] = s.indexOf('\n', le[1] + 1);
-// le[3] = s.indexOf('\n', le[2] + 1);
-// le[4] = s.length() - 1;
-// long previousCount = ast.modificationCount();
-// x.setLineEndTable(le);
-// assertTrue(ast.modificationCount() > previousCount);
-//
-// assertTrue(x.lineNumber(0) == 1);
-// assertTrue(x.lineNumber(1) == 1);
-// assertTrue(x.lineNumber(2) == 1);
-// assertTrue(x.lineNumber(3) == 2);
-// assertTrue(x.lineNumber(4) == 2);
-// assertTrue(x.lineNumber(5) == 2);
-// assertTrue(x.lineNumber(6) == 2);
-// assertTrue(x.lineNumber(7) == 3);
-// assertTrue(x.lineNumber(8) == 3);
-// assertTrue(x.lineNumber(9) == 3);
-// assertTrue(x.lineNumber(10) == 4);
-// assertTrue(x.lineNumber(11) == 4);
-// assertTrue(x.lineNumber(12) == 4);
-// assertTrue(x.lineNumber(13) == 4);
-// assertTrue(x.lineNumber(14) == 4);
-// assertTrue(x.lineNumber(15) == 5);
-// assertTrue(x.lineNumber(16) == 5);
-// assertTrue(x.lineNumber(17) == 5);
-//
-// assertTrue(x.lineNumber(18) == 1);
-// assertTrue(x.lineNumber(100) == 1);
-// assertTrue(x.lineNumber(1000000) == 1);
-// assertTrue(x.lineNumber(-1) == 1);
-// assertTrue(x.lineNumber(-100) == 1);
-// assertTrue(x.lineNumber(-1000000) == 1);
-//
-// // slam table back to none
-// x.setLineEndTable(new int[0]);
-// for (int i= -10; i < 10; i++) {
-// assertTrue(x.lineNumber(i) == 1);
-// }
- }
-
- /** @deprecated using deprecated code */
- public void testTypeDeclaration() {
- long previousCount = ast.modificationCount();
- final TypeDeclaration x = ast.newTypeDeclaration();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getModifiers() == Modifier.NONE);
- assertTrue(x.getSuperclass() == null);
- } else {
- assertTrue(x.modifiers().size() == 0);
- assertTrue(x.getSuperclassType() == null);
- }
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getName().isDeclaration() == true);
- assertTrue(x.getJavadoc() == null);
- assertTrue(x.bodyDeclarations().size()== 0);
- assertTrue(x.getNodeType() == ASTNode.TYPE_DECLARATION);
- assertTrue(x.structuralPropertiesForType() == TypeDeclaration.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
-
- if (ast.apiLevel() == AST.JLS2) {
- int legal = Modifier.PUBLIC | Modifier.PROTECTED
- | Modifier.PRIVATE | Modifier.ABSTRACT | Modifier.STATIC
- | Modifier.FINAL | Modifier.STRICTFP;
- previousCount = ast.modificationCount();
- x.setModifiers(legal);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == legal);
-
- previousCount = ast.modificationCount();
- x.setModifiers(Modifier.NONE);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == Modifier.NONE);
- }
-
- tJavadocComment(x);
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- if (ast.apiLevel() == AST.JLS2) {
- genericPropertyTest(x, new Property("Superclass", false, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getSuperclass();
- }
- public void set(ASTNode value) {
- x.setSuperclass((Name) value);
- }
- });
- }
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyTest(x, new Property("SuperclassType", false, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getSuperclassType();
- }
- public void set(ASTNode value) {
- x.setSuperclassType((Type) value);
- }
- });
- }
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyListTest(x, null,
- new Property("SuperInterfaceTypes", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- });
- }
-
-
- genericPropertyListTest(x, x.bodyDeclarations(),
- new Property("BodyDeclarations", true, BodyDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- TypeDeclaration result = targetAst.newTypeDeclaration();
- if (parented) {
- JavaScriptUnit cu = targetAst.newJavaScriptUnit();
- cu.types().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- TypeDeclaration s1 = x.getAST().newTypeDeclaration();
- s1.bodyDeclarations().add(x);
- return s1;
- }
- public void unwrap() {
- TypeDeclaration s1 = (TypeDeclaration) x.getParent();
- s1.bodyDeclarations().remove(x);
- }
- });
-
- // check special bodyDeclaration methods
- x.bodyDeclarations().clear();
- FieldDeclaration f1 = ast.newFieldDeclaration(ast.newVariableDeclarationFragment());
- FieldDeclaration f2 = ast.newFieldDeclaration(ast.newVariableDeclarationFragment());
- FunctionDeclaration m1 = ast.newFunctionDeclaration();
- FunctionDeclaration m2 = ast.newFunctionDeclaration();
- TypeDeclaration t1 = ast.newTypeDeclaration();
- TypeDeclaration t2 = ast.newTypeDeclaration();
-
-
- x.bodyDeclarations().add(ast.newInitializer());
- x.bodyDeclarations().add(f1);
- x.bodyDeclarations().add(ast.newInitializer());
- x.bodyDeclarations().add(f2);
- x.bodyDeclarations().add(ast.newInitializer());
- x.bodyDeclarations().add(t1);
- x.bodyDeclarations().add(ast.newInitializer());
- x.bodyDeclarations().add(m1);
- x.bodyDeclarations().add(ast.newInitializer());
- x.bodyDeclarations().add(m2);
- x.bodyDeclarations().add(ast.newInitializer());
- x.bodyDeclarations().add(t2);
- x.bodyDeclarations().add(ast.newInitializer());
-
- List fs = Arrays.asList(x.getFields());
- assertTrue(fs.size() == 2);
- assertTrue(fs.contains(f1));
- assertTrue(fs.contains(f2));
-
- List ms = Arrays.asList(x.getMethods());
- assertTrue(ms.size() == 2);
- assertTrue(ms.contains(m1));
- assertTrue(ms.contains(m2));
-
- List ts = Arrays.asList(x.getTypes());
- assertTrue(ts.size() == 2);
- assertTrue(ts.contains(t1));
- assertTrue(ts.contains(t2));
-
- // check that TypeDeclarations in body are classified correctly
- assertTrue(t1.isLocalTypeDeclaration() == false);
- assertTrue(t1.isMemberTypeDeclaration() == true);
- assertTrue(t1.isPackageMemberTypeDeclaration() == false);
-
- }
-
- /** @deprecated using deprecated code */
- public void testSingleVariableDeclaration() {
- long previousCount = ast.modificationCount();
- final SingleVariableDeclaration x = ast.newSingleVariableDeclaration();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getModifiers() == Modifier.NONE);
- } else {
- assertTrue(x.modifiers().size() == 0);
- assertTrue(x.isVarargs() == false);
- }
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getName().isDeclaration() == true);
- assertTrue(x.getType().getParent() == x);
- assertTrue(x.getExtraDimensions() == 0);
- assertTrue(x.getInitializer() == null);
- assertTrue(x.getNodeType() == ASTNode.SINGLE_VARIABLE_DECLARATION);
- assertTrue(x.structuralPropertiesForType() == SingleVariableDeclaration.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- if (ast.apiLevel() == AST.JLS2) {
- int legal = Modifier.PUBLIC | Modifier.PROTECTED
- | Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL
- | Modifier.TRANSIENT | Modifier.VOLATILE;
- previousCount = ast.modificationCount();
- x.setModifiers(legal);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == legal);
-
- previousCount = ast.modificationCount();
- x.setModifiers(Modifier.NONE);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == Modifier.NONE);
- }
-
- previousCount = ast.modificationCount();
- x.setExtraDimensions(1);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getExtraDimensions() == 1);
-
- previousCount = ast.modificationCount();
- x.setExtraDimensions(0);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getExtraDimensions() == 0);
-
- if (ast.apiLevel() >= AST.JLS3) {
- previousCount = ast.modificationCount();
- x.setVarargs(true);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isVarargs() == true);
-
- previousCount = ast.modificationCount();
- x.setVarargs(false);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isVarargs() == false);
- }
-
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- genericPropertyTest(x, new Property("Type", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((Type) value);
- }
- });
-
- genericPropertyTest(x, new Property("Initializer", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return an Expression that embeds x
- CatchClause s1 = ast.newCatchClause();
- s1.setException(x);
- return s1;
- }
- public void unwrap() {
- CatchClause s1 = (CatchClause) x.getParent();
- s1.setException(ast.newSingleVariableDeclaration());
- }
- public ASTNode get() {
- return x.getInitializer();
- }
- public void set(ASTNode value) {
- x.setInitializer((Expression) value);
- }
- });
- }
-
- public void testVariableDeclarationFragment() {
- long previousCount = ast.modificationCount();
- final VariableDeclarationFragment x = ast.newVariableDeclarationFragment();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getName().isDeclaration() == true);
- assertTrue(x.getExtraDimensions() == 0);
- assertTrue(x.getInitializer() == null);
- assertTrue(x.getNodeType() == ASTNode.VARIABLE_DECLARATION_FRAGMENT);
- assertTrue(x.structuralPropertiesForType() ==
- VariableDeclarationFragment.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
- x.setExtraDimensions(1);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getExtraDimensions() == 1);
-
- previousCount = ast.modificationCount();
- x.setExtraDimensions(0);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getExtraDimensions() == 0);
-
- // check that property cannot be set negative
- try {
- x.setExtraDimensions(-1);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- genericPropertyTest(x, new Property("Initializer", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return an Expression that embeds x
- VariableDeclarationExpression s1 =
- ast.newVariableDeclarationExpression(x);
- return s1;
- }
- public void unwrap() {
- VariableDeclarationExpression s1 =
- (VariableDeclarationExpression) x.getParent();
- s1.fragments().remove(x);
- }
- public ASTNode get() {
- return x.getInitializer();
- }
- public void set(ASTNode value) {
- x.setInitializer((Expression) value);
- }
- });
- }
-
- /** @deprecated using deprecated code */
- public void testMethodDeclaration() {
- long previousCount = ast.modificationCount();
- final FunctionDeclaration x = ast.newFunctionDeclaration();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getModifiers() == Modifier.NONE);
- assertTrue(x.getReturnType().getParent() == x);
- assertTrue(x.getReturnType().isPrimitiveType());
- assertTrue(((PrimitiveType) x.getReturnType()).getPrimitiveTypeCode() == PrimitiveType.VOID);
- } else {
- assertTrue(x.modifiers().size() == 0);
- assertTrue(x.getReturnType2().getParent() == x);
- assertTrue(x.getReturnType2().isPrimitiveType());
- assertTrue(((PrimitiveType) x.getReturnType2()).getPrimitiveTypeCode() == PrimitiveType.VOID);
- }
- assertTrue(x.isConstructor() == false);
- //assertTrue(x.getName().getParent() == x);
- //assertTrue(x.getName().isDeclaration() == true);
- assertTrue(x.getExtraDimensions() == 0);
- assertTrue(x.getJavadoc() == null);
- assertTrue(x.parameters().size() == 0);
- assertTrue(x.thrownExceptions().size() == 0);
- assertTrue(x.getBody() == null);
- assertTrue(x.getNodeType() == ASTNode.FUNCTION_DECLARATION);
- assertTrue(x.structuralPropertiesForType() ==
- FunctionDeclaration.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
- x.setConstructor(true);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isConstructor() == true);
- //assertTrue(x.getName().isDeclaration() == false);
-
- previousCount = ast.modificationCount();
- x.setConstructor(false);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isConstructor() == false);
-
- if (ast.apiLevel() == AST.JLS2) {
- previousCount = ast.modificationCount();
- int legal = Modifier.PUBLIC | Modifier.PROTECTED
- | Modifier.PRIVATE | Modifier.ABSTRACT | Modifier.STATIC
- | Modifier.FINAL | Modifier.SYNCHRONIZED| Modifier.NATIVE
- | Modifier.STRICTFP;
- x.setModifiers(legal);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == legal);
-
- previousCount = ast.modificationCount();
- x.setModifiers(Modifier.NONE);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == Modifier.NONE);
- }
-
- previousCount = ast.modificationCount();
- x.setExtraDimensions(1);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getExtraDimensions() == 1);
-
- previousCount = ast.modificationCount();
- x.setExtraDimensions(0);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getExtraDimensions() == 0);
-
- tJavadocComment(x);
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- if (ast.apiLevel() == AST.JLS2) {
- genericPropertyTest(x, new Property("ReturnType", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getReturnType();
- }
- public void set(ASTNode value) {
- x.setReturnType((Type) value);
- }
- });
- }
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyTest(x, new Property("ReturnType2", false, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getReturnType2();
- }
- public void set(ASTNode value) {
- x.setReturnType2((Type) value);
- }
- });
- }
-
- genericPropertyListTest(x, x.parameters(),
- new Property("Parameters", true, SingleVariableDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SingleVariableDeclaration result = targetAst.newSingleVariableDeclaration();
- if (parented) {
- targetAst.newCatchClause().setException(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a SingleVariableDeclaration that embeds x
- SingleVariableDeclaration s1 = ast.newSingleVariableDeclaration();
- ClassInstanceCreation s2 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s2.setAnonymousClassDeclaration(a1);
- s1.setInitializer(s2);
- a1.bodyDeclarations().add(x);
- return s1;
- }
- public void unwrap() {
- AnonymousClassDeclaration a1 = (AnonymousClassDeclaration) x.getParent();
- a1.bodyDeclarations().remove(x);
- }
- });
-
- genericPropertyListTest(x, x.thrownExceptions(),
- new Property("ThrownExceptions", true, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- });
-
- genericPropertyTest(x, new Property("Body", false, Block.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Block that embeds x
- Block s1 = ast.newBlock();
- TypeDeclaration s2 = ast.newTypeDeclaration();
- s1.statements().add(ast.newTypeDeclarationStatement(s2));
- s2.bodyDeclarations().add(x);
- return s1;
- }
- public void unwrap() {
- TypeDeclaration s2 = (TypeDeclaration) x.getParent();
- s2.bodyDeclarations().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Block) value);
- }
- });
-
- if (ast.apiLevel() >= AST.JLS3) {
- // check isVariableArity convenience method
- x.parameters().clear();
- assertTrue(!x.isVarargs()); // 0 params
- x.parameters().add(ast.newSingleVariableDeclaration());
- assertTrue(!x.isVarargs()); // 1 params
- SingleVariableDeclaration v = ast.newSingleVariableDeclaration();
- x.parameters().add(v);
- assertTrue(!x.isVarargs()); // 2 param fixed arity
- v.setVarargs(true);
- assertTrue(x.isVarargs()); // 2 param fixed arity
- x.parameters().add(ast.newSingleVariableDeclaration());
- assertTrue(!x.isVarargs()); // only last param counts
- }
- }
-
- /** @deprecated using deprecated code */
- public void testInitializer() {
- long previousCount = ast.modificationCount();
- final Initializer x = ast.newInitializer();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getJavadoc() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getModifiers() == Modifier.NONE);
- } else {
- assertTrue(x.modifiers().size() == 0);
- }
- assertTrue(x.getBody().getParent() == x);
- assertTrue(x.getBody().statements().size() == 0);
- assertTrue(x.getNodeType() == ASTNode.INITIALIZER);
- assertTrue(x.structuralPropertiesForType() ==
- Initializer.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tJavadocComment(x);
-
- if (ast.apiLevel() == AST.JLS2) {
- int legal = Modifier.STATIC;
- previousCount = ast.modificationCount();
- x.setModifiers(legal);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == legal);
-
- previousCount = ast.modificationCount();
- x.setModifiers(Modifier.NONE);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == Modifier.NONE);
- }
-
- genericPropertyTest(x, new Property("Body", true, Block.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Block that embeds x
- Block s1 = ast.newBlock();
- TypeDeclaration s2 = ast.newTypeDeclaration();
- s1.statements().add(ast.newTypeDeclarationStatement(s2));
- s2.bodyDeclarations().add(x);
- return s1;
- }
- public void unwrap() {
- TypeDeclaration s2 = (TypeDeclaration) x.getParent();
- s2.bodyDeclarations().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Block) value);
- }
- });
- }
-
- /**
- * @deprecated (not really - its just that Javadoc.get/setComment
- * are deprecated, and this suppresses the extra warnings)
- */
- public void testJavadoc() {
- long previousCount = ast.modificationCount();
- final JSdoc x = ast.newJSdoc();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getComment().startsWith("/**")); //$NON-NLS-1$
- assertTrue(x.getComment().endsWith("*/")); //$NON-NLS-1$
- }
- assertTrue(x.getNodeType() == ASTNode.JSDOC);
- assertTrue(!x.isBlockComment());
- assertTrue(!x.isLineComment());
- assertTrue(x.isDocComment());
- assertTrue(x.tags().isEmpty());
- assertTrue(x.getAlternateRoot() == null);
- assertTrue(x.structuralPropertiesForType() ==
- JSdoc.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // check the constants
- assertTrue(TagElement.TAG_AUTHOR.equals("@author")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_DEPRECATED.equals("@deprecated")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_DOCROOT.equals("@docRoot")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_EXCEPTION.equals("@exception")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_INHERITDOC.equals("@inheritDoc")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_LINK.equals("@link")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_LINKPLAIN.equals("@linkplain")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_PARAM.equals("@param")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_RETURN.equals("@return")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_SEE.equals("@see")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_SERIAL.equals("@serial")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_SERIALDATA.equals("@serialData")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_SERIALFIELD.equals("@serialField")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_SINCE.equals("@since")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_THROWS.equals("@throws")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_VALUE.equals("@value")); //$NON-NLS-1$
- assertTrue(TagElement.TAG_VERSION.equals("@version")); //$NON-NLS-1$
-
- if (ast.apiLevel() == AST.JLS2) {
- final String[] samples =
- {
- "/** Hello there */", //$NON-NLS-1$
- "/**\n * Line 1\n * Line 2\n */", //$NON-NLS-1$
- "/***/", //$NON-NLS-1$
- };
- for (int i = 0; i < samples.length; i++) {
- previousCount = ast.modificationCount();
- x.setComment(samples[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(samples[i].equals(x.getComment()));
- }
-
- final String[] badSamples =
- {
- null,
- "", //$NON-NLS-1$
- "/* */", //$NON-NLS-1$
- "/**", //$NON-NLS-1$
- "*/", //$NON-NLS-1$
- };
-
- // check that property cannot be set to clearly illegal things
- for (int i = 0; i < badSamples.length; i++) {
- try {
- x.setComment(badSamples[i]);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- }
- }
-
- tAlternateRoot(x);
-
- genericPropertyListTest(x, x.tags(),
- new Property("Tags", true, TagElement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- TagElement result = targetAst.newTagElement();
- if (parented) {
- JSdoc parent = targetAst.newJSdoc();
- parent.tags().add(result);
- }
- return result;
- }
- public ASTNode[] counterExamples(AST targetAst) {
- return new ASTNode[] {
- targetAst.newEmptyStatement(),
- targetAst.newJavaScriptUnit(),
- targetAst.newTypeDeclaration(),
- targetAst.newJSdoc(),
- targetAst.newTextElement(),
- targetAst.newFunctionRef()
- };
- }
- });
- }
-
- public void testBlockComment() {
- long previousCount = ast.modificationCount();
- final BlockComment x = ast.newBlockComment();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.BLOCK_COMMENT);
- assertTrue(x.isBlockComment());
- assertTrue(!x.isLineComment());
- assertTrue(!x.isDocComment());
- assertTrue(x.getAlternateRoot() == null);
- assertTrue(x.structuralPropertiesForType() ==
- BlockComment.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tAlternateRoot(x);
- }
-
- public void testLineComment() {
- long previousCount = ast.modificationCount();
- final LineComment x = ast.newLineComment();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.LINE_COMMENT);
- assertTrue(!x.isBlockComment());
- assertTrue(x.isLineComment());
- assertTrue(!x.isDocComment());
- assertTrue(x.getAlternateRoot() == null);
- assertTrue(x.structuralPropertiesForType() ==
- LineComment.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tAlternateRoot(x);
- }
-
- public void testTagElement() {
- long previousCount = ast.modificationCount();
- final TagElement x = ast.newTagElement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.TAG_ELEMENT);
- assertTrue(x.getTagName() == null);
- assertTrue(x.fragments().isEmpty());
- assertTrue(x.structuralPropertiesForType() ==
- TagElement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // tagName property
- previousCount = ast.modificationCount();
- String s1 = new String("hello"); //$NON-NLS-1$
- x.setTagName(s1);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getTagName() == s1);
- previousCount = ast.modificationCount();
- String s2 = new String("bye"); //$NON-NLS-1$
- x.setTagName(s2);
- assertTrue(x.getTagName() == s2);
- assertTrue(ast.modificationCount() > previousCount);
- x.setTagName(null);
- assertTrue(x.getTagName() == null);
- assertTrue(ast.modificationCount() > previousCount);
-
- // check that fragments() can handle TagElement
- genericPropertyListTest(x, x.fragments(),
- new Property("Fragments", true, TagElement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- TagElement result = targetAst.newTagElement();
- if (parented) {
- JSdoc parent = targetAst.newJSdoc();
- parent.tags().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return TagElement that embeds x
- TagElement tagElement = ast.newTagElement();
- tagElement.fragments().add(x);
- return tagElement;
- }
- public void unwrap() {
- TagElement tagElement = (TagElement) x.getParent();
- tagElement.fragments().remove(x);
- }
- public ASTNode[] counterExamples(AST targetAst) {
- return new ASTNode[] {
- targetAst.newEmptyStatement(),
- targetAst.newJavaScriptUnit(),
- targetAst.newTypeDeclaration(),
- targetAst.newJSdoc(),
- };
- }
- });
- // check that fragments() can handle Name
- genericPropertyListTest(x, x.fragments(),
- new Property("Fragments", true, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- });
- // check that fragments() can handle TextElement
- genericPropertyListTest(x, x.fragments(),
- new Property("Fragments", true, TextElement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- TextElement result = targetAst.newTextElement();
- if (parented) {
- TagElement parent = targetAst.newTagElement();
- parent.fragments().add(result);
- }
- return result;
- }
- });
- // check that fragments() can handle FunctionRef
- genericPropertyListTest(x, x.fragments(),
- new Property("Fragments", true, FunctionRef.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- FunctionRef result = targetAst.newFunctionRef();
- if (parented) {
- TagElement parent = targetAst.newTagElement();
- parent.fragments().add(result);
- }
- return result;
- }
- });
- // check that fragments() can handle MemberRef
- genericPropertyListTest(x, x.fragments(),
- new Property("Fragments", true, MemberRef.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- MemberRef result = targetAst.newMemberRef();
- if (parented) {
- TagElement parent = targetAst.newTagElement();
- parent.fragments().add(result);
- }
- return result;
- }
- });
- }
-
- public void testTextElement() {
- long previousCount = ast.modificationCount();
- final TextElement x = ast.newTextElement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.TEXT_ELEMENT);
- assertTrue(x.getText().length() == 0);
- assertTrue(x.structuralPropertiesForType() ==
- TextElement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // text property
- previousCount = ast.modificationCount();
- String s1 = new String("hello");
- x.setText(s1);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getText() == s1);
- previousCount = ast.modificationCount();
- String s2 = new String("");
- x.setText(s2);
- assertTrue(x.getText() == s2);
- assertTrue(ast.modificationCount() > previousCount);
- // check that property cannot be set to null
- previousCount = ast.modificationCount();
- try {
- x.setText(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- assertTrue(ast.modificationCount() == previousCount);
- // check that property cannot include */
- previousCount = ast.modificationCount();
- try {
- x.setText("this would be the */ end of it"); //$NON-NLS-1$
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
- assertTrue(ast.modificationCount() == previousCount);
- }
-
- public void testMemberRef() {
- long previousCount = ast.modificationCount();
- final MemberRef x = ast.newMemberRef();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.MEMBER_REF);
- assertTrue(x.getQualifier() == null);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.structuralPropertiesForType() ==
- MemberRef.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Qualifier", false, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- QualifiedName result = targetAst.newQualifiedName(
- targetAst.newSimpleName("a"), //$NON-NLS-1$
- targetAst.newSimpleName("b")); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getQualifier();
- }
- public void set(ASTNode value) {
- x.setQualifier((Name) value);
- }
- });
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
- }
-
- public void testMethodRef() {
- long previousCount = ast.modificationCount();
- final FunctionRef x = ast.newFunctionRef();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.FUNCTION_REF);
- assertTrue(x.getQualifier() == null);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.parameters().isEmpty());
- assertTrue(x.structuralPropertiesForType() ==
- FunctionRef.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Qualifier", false, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- QualifiedName result = targetAst.newQualifiedName(
- targetAst.newSimpleName("a"), //$NON-NLS-1$
- targetAst.newSimpleName("b")); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getQualifier();
- }
- public void set(ASTNode value) {
- x.setQualifier((Name) value);
- }
- });
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- genericPropertyListTest(x, x.parameters(),
- new Property("Parameters", true, FunctionRefParameter.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- FunctionRefParameter result = targetAst.newFunctionRefParameter();
- if (parented) {
- FunctionRef parent = targetAst.newFunctionRef();
- parent.parameters().add(result);
- }
- return result;
- }
- });
- }
-
- public void testMethodRefParameter() {
- long previousCount = ast.modificationCount();
- final FunctionRefParameter x = ast.newFunctionRefParameter();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getNodeType() == ASTNode.FUNCTION_REF_PARAMETER);
- assertTrue(x.getType().getParent() == x);
- if (ast.apiLevel() >= AST.JLS3) {
- assertTrue(x.isVarargs() == false);
- }
- assertTrue(x.getName() == null);
- assertTrue(x.structuralPropertiesForType() ==
- FunctionRefParameter.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- if (ast.apiLevel() >= AST.JLS3) {
- previousCount = ast.modificationCount();
- x.setVarargs(true);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isVarargs() == true);
-
- previousCount = ast.modificationCount();
- x.setVarargs(false);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.isVarargs() == false);
- }
-
- genericPropertyTest(x, new Property("Type", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((Type) value);
- }
- });
-
- genericPropertyTest(x, new Property("Name", false, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
- }
-
- public void testBlock() {
- long previousCount = ast.modificationCount();
- final Block x = ast.newBlock();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.statements().size() == 0);
- assertTrue(x.getNodeType() == ASTNode.BLOCK);
- assertTrue(x.structuralPropertiesForType() ==
- Block.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyListTest(x, x.statements(),
- new Property("Statements", true, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- });
- }
-
- public void testMethodInvocation() {
- long previousCount = ast.modificationCount();
- final FunctionInvocation x = ast.newFunctionInvocation();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() >= AST.JLS3) {
- assertTrue(x.typeArguments().isEmpty());
- }
- //assertTrue(x.getName().getParent() == x);
- assertTrue(x.getExpression() == null);
- assertTrue(x.arguments().size() == 0);
- assertTrue(x.getNodeType() == ASTNode.FUNCTION_INVOCATION);
- assertTrue(x.structuralPropertiesForType() ==
- FunctionInvocation.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Expression", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyListTest(x, x.typeArguments(),
- new Property("TypeArguments", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Type result = targetAst.newSimpleType(targetAst.newSimpleName("X")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- });
- }
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- genericPropertyListTest(x, x.arguments(),
- new Property("Arguments", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- });
- }
-
- public void testExpressionStatement() {
- long previousCount = ast.modificationCount();
- SimpleName x1 = ast.newSimpleName("foo"); //$NON-NLS-1$
- final ExpressionStatement x = ast.newExpressionStatement(x1);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression() == x1);
- assertTrue(x1.getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.EXPRESSION_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- ExpressionStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- }
-
- /** @deprecated using deprecated code */
- public void testVariableDeclarationStatement() {
- VariableDeclarationFragment x1 = ast.newVariableDeclarationFragment();
- long previousCount = ast.modificationCount();
- final VariableDeclarationStatement x =
- ast.newVariableDeclarationStatement(x1);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getModifiers() == Modifier.NONE);
- } else {
- assertTrue(x.modifiers().size() == 0);
- }
- assertTrue(x.getType() != null);
- assertTrue(x.getType().getParent() == x);
- assertTrue(x.fragments().size() == 1);
- assertTrue(x.fragments().get(0) == x1);
- assertTrue(x1.getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- VariableDeclarationStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- if (ast.apiLevel() == AST.JLS2) {
- int legal = Modifier.FINAL;
- previousCount = ast.modificationCount();
- x.setModifiers(legal);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == legal);
-
- previousCount = ast.modificationCount();
- x.setModifiers(Modifier.NONE);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == Modifier.NONE);
- }
-
-
- genericPropertyTest(x, new Property("Type", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((Type) value);
- }
- });
-
- genericPropertyListTest(x, x.fragments(),
- new Property("VariableSpecifiers", true, VariableDeclarationFragment.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- VariableDeclarationFragment result = targetAst.newVariableDeclarationFragment();
- if (parented) {
- targetAst.newVariableDeclarationExpression(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return VariableDeclarationFragment that embeds x
- VariableDeclarationFragment s1 = ast.newVariableDeclarationFragment();
- ClassInstanceCreation s0 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s0.setAnonymousClassDeclaration(a1);
- s1.setInitializer(s0);
- Initializer s2 = ast.newInitializer();
- a1.bodyDeclarations().add(s2);
- s2.getBody().statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- });
- }
-
- /** @deprecated using deprecated code */
- public void testTypeDeclarationStatement() {
- AbstractTypeDeclaration x1 = ast.newTypeDeclaration();
- long previousCount = ast.modificationCount();
- final TypeDeclarationStatement x =
- ast.newTypeDeclarationStatement(x1);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getTypeDeclaration() == x1);
- } else {
- assertTrue(x.getDeclaration() == x1);
- }
- assertTrue(x1.getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.TYPE_DECLARATION_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- TypeDeclarationStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // check that TypeDeclaration inside is classified correctly
- assertTrue(x1.isLocalTypeDeclaration() == true);
- assertTrue(x1.isMemberTypeDeclaration() == false);
- assertTrue(x1.isPackageMemberTypeDeclaration() == false);
-
- tLeadingComment(x);
-
- if (ast.apiLevel() == AST.JLS2) {
- genericPropertyTest(x, new Property("TypeDeclaration", true, TypeDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- TypeDeclaration result = targetAst.newTypeDeclaration();
- if (parented) {
- targetAst.newTypeDeclarationStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return TypeDeclaration that embeds x
- TypeDeclaration s1 = ast.newTypeDeclaration();
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- s1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getTypeDeclaration();
- }
- public void set(ASTNode value) {
- x.setTypeDeclaration((TypeDeclaration) value);
- }
- });
- }
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyTest(x, new Property("Declaration", true, AbstractTypeDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- AbstractTypeDeclaration result = targetAst.newTypeDeclaration();
- if (parented) {
- targetAst.newTypeDeclarationStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return TypeDeclaration that embeds x
- TypeDeclaration s1 = ast.newTypeDeclaration();
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- s1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getDeclaration();
- }
- public void set(ASTNode value) {
- x.setDeclaration((AbstractTypeDeclaration) value);
- }
- });
- }
- }
-
- /** @deprecated using deprecated code */
- public void testVariableDeclarationExpression() {
- VariableDeclarationFragment x1 = ast.newVariableDeclarationFragment();
- long previousCount = ast.modificationCount();
- final VariableDeclarationExpression x =
- ast.newVariableDeclarationExpression(x1);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getModifiers() == Modifier.NONE);
- } else {
- assertTrue(x.modifiers().size() == 0);
- }
- assertTrue(x.getType() != null);
- assertTrue(x.getType().getParent() == x);
- assertTrue(x.fragments().size() == 1);
- assertTrue(x.fragments().get(0) == x1);
- assertTrue(x1.getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.VARIABLE_DECLARATION_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- VariableDeclarationExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- if (ast.apiLevel() == AST.JLS2) {
- int legal = Modifier.FINAL;
- previousCount = ast.modificationCount();
- x.setModifiers(legal);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == legal);
-
- previousCount = ast.modificationCount();
- x.setModifiers(Modifier.NONE);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == Modifier.NONE);
- }
-
-
- genericPropertyTest(x, new Property("Type", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((Type) value);
- }
- });
-
- genericPropertyListTest(x, x.fragments(),
- new Property("VariableSpecifiers", true, VariableDeclarationFragment.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- VariableDeclarationFragment result = targetAst.newVariableDeclarationFragment();
- if (parented) {
- targetAst.newVariableDeclarationExpression(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return VariableDeclarationFragment that embeds x
- VariableDeclarationFragment s1 = ast.newVariableDeclarationFragment();
- ClassInstanceCreation s0 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s0.setAnonymousClassDeclaration(a1);
- s1.setInitializer(s0);
- ForStatement s2 = ast.newForStatement();
- s2.initializers().add(x);
- Initializer s3 = ast.newInitializer();
- a1.bodyDeclarations().add(s3);
- s3.getBody().statements().add(s2);
- return s1;
- }
- public void unwrap() {
- ForStatement s2 = (ForStatement) x.getParent();
- s2.initializers().remove(x);
- }
- });
- }
-
- /** @deprecated using deprecated code */
- public void testFieldDeclaration() {
- VariableDeclarationFragment x1 = ast.newVariableDeclarationFragment();
- long previousCount = ast.modificationCount();
- final FieldDeclaration x = ast.newFieldDeclaration(x1);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getJavadoc() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getModifiers() == Modifier.NONE);
- } else {
- assertTrue(x.modifiers().size() == 0);
- }
- assertTrue(x.getType() != null);
- assertTrue(x.getType().getParent() == x);
- assertTrue(x.fragments().size() == 1);
- assertTrue(x.fragments().get(0) == x1);
- assertTrue(x1.getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.FIELD_DECLARATION);
- assertTrue(x.structuralPropertiesForType() ==
- FieldDeclaration.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- if (ast.apiLevel() == AST.JLS2) {
- int legal = Modifier.PUBLIC | Modifier.PROTECTED
- | Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL
- | Modifier.TRANSIENT | Modifier.VOLATILE;
- previousCount = ast.modificationCount();
- x.setModifiers(legal);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == legal);
-
- previousCount = ast.modificationCount();
- x.setModifiers(Modifier.NONE);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getModifiers() == Modifier.NONE);
- }
-
- tJavadocComment(x);
-
- genericPropertyTest(x, new Property("Type", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((Type) value);
- }
- });
-
- genericPropertyListTest(x, x.fragments(),
- new Property("VariableSpecifiers", true, VariableDeclarationFragment.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- VariableDeclarationFragment result = targetAst.newVariableDeclarationFragment();
- if (parented) {
- targetAst.newVariableDeclarationStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return VariableDeclarationFragment that embeds x
- VariableDeclarationFragment s1 = ast.newVariableDeclarationFragment();
- ClassInstanceCreation s2 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s2.setAnonymousClassDeclaration(a1);
- s1.setInitializer(s2);
- a1.bodyDeclarations().add(x);
- return s1;
- }
- public void unwrap() {
- AnonymousClassDeclaration a1 = (AnonymousClassDeclaration) x.getParent();
- a1.bodyDeclarations().remove(x);
- }
- });
-
- }
-
- public void testAssignment() {
- long previousCount = ast.modificationCount();
- final Assignment x = ast.newAssignment();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getOperator() == Assignment.Operator.ASSIGN);
- assertTrue(x.getLeftHandSide().getParent() == x);
- assertTrue(x.getRightHandSide().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.ASSIGNMENT);
- assertTrue(x.structuralPropertiesForType() ==
- Assignment.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- previousCount = ast.modificationCount();
- x.setOperator(Assignment.Operator.PLUS_ASSIGN);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getOperator() == Assignment.Operator.PLUS_ASSIGN);
- assertTrue(Assignment.Operator.PLUS_ASSIGN
- != Assignment.Operator.ASSIGN);
-
- // check the names of the primitive type codes
- assertTrue(Assignment.Operator.ASSIGN.toString().equals("=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.PLUS_ASSIGN.toString().equals("+=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.MINUS_ASSIGN.toString().equals("-=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.TIMES_ASSIGN.toString().equals("*=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.DIVIDE_ASSIGN.toString().equals("/=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.REMAINDER_ASSIGN.toString().equals("%=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.LEFT_SHIFT_ASSIGN.toString().equals("<<=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN.toString().equals(">>=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN.toString().equals(">>>=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.BIT_AND_ASSIGN.toString().equals("&=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.BIT_OR_ASSIGN.toString().equals("|=")); //$NON-NLS-1$
- assertTrue(Assignment.Operator.BIT_XOR_ASSIGN.toString().equals("^=")); //$NON-NLS-1$
-
- Assignment.Operator[] known = {
- Assignment.Operator.ASSIGN,
- Assignment.Operator.PLUS_ASSIGN,
- Assignment.Operator.MINUS_ASSIGN,
- Assignment.Operator.TIMES_ASSIGN,
- Assignment.Operator.DIVIDE_ASSIGN,
- Assignment.Operator.REMAINDER_ASSIGN,
- Assignment.Operator.LEFT_SHIFT_ASSIGN,
- Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN,
- Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN,
- Assignment.Operator.BIT_AND_ASSIGN,
- Assignment.Operator.BIT_OR_ASSIGN,
- Assignment.Operator.BIT_XOR_ASSIGN,
- };
-
- // check all operators are distinct
- for (int i = 0; i < known.length; i++) {
- for (int j = 0; j < known.length; j++) {
- assertTrue(i == j || !known[i].equals(known[j]));
- }
- }
-
- // check all operators work
- for (int i = 0; i < known.length; i++) {
- previousCount = ast.modificationCount();
- x.setOperator(known[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getOperator().equals(known[i]));
- }
- // ensure null does not work as a primitive type code
- try {
- x.setOperator(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check toOperator lookup of operators by name
- for (int i = 0; i < known.length; i++) {
- String name = known[i].toString();
- assertTrue(Assignment.Operator.toOperator(name).equals(known[i]));
- }
- assertTrue(Assignment.Operator.toOperator("not-an-op") == null); //$NON-NLS-1$
-
- genericPropertyTest(x, new Property("LeftHandSide", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getLeftHandSide();
- }
- public void set(ASTNode value) {
- x.setLeftHandSide((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("RightHandSide", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getRightHandSide();
- }
- public void set(ASTNode value) {
- x.setRightHandSide((Expression) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testBreakStatement() {
- long previousCount = ast.modificationCount();
- final BreakStatement x = ast.newBreakStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLabel() == null);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.BREAK_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- BreakStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Label", false, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getLabel();
- }
- public void set(ASTNode value) {
- x.setLabel((SimpleName) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testContinueStatement() {
- long previousCount = ast.modificationCount();
- final ContinueStatement x = ast.newContinueStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLabel() == null);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.CONTINUE_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- ContinueStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Label", false, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getLabel();
- }
- public void set(ASTNode value) {
- x.setLabel((SimpleName) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testIfStatement() {
- long previousCount = ast.modificationCount();
- final IfStatement x = ast.newIfStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getThenStatement().getParent() == x);
- assertTrue(x.getThenStatement() instanceof Block);
- assertTrue(((Block) x.getThenStatement()).statements().isEmpty());
- assertTrue(x.getElseStatement() == null);
- assertTrue(x.getNodeType() == ASTNode.IF_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- IfStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("ThenStatement", true, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getThenStatement();
- }
- public void set(ASTNode value) {
- x.setThenStatement((Statement) value);
- }
- });
-
- genericPropertyTest(x, new Property("ElseStatement", false, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getElseStatement();
- }
- public void set(ASTNode value) {
- x.setElseStatement((Statement) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testWhileStatement() {
- long previousCount = ast.modificationCount();
- final WhileStatement x = ast.newWhileStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getBody().getParent() == x);
- assertTrue(x.getBody() instanceof Block);
- assertTrue(((Block) x.getBody()).statements().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.WHILE_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- WhileStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("Body", true, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Statement) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testDoStatement() {
- long previousCount = ast.modificationCount();
- final DoStatement x = ast.newDoStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getBody().getParent() == x);
- assertTrue(x.getBody() instanceof Block);
- assertTrue(((Block) x.getBody()).statements().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.DO_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- DoStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("Body", true, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Statement) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testTryStatement() {
- long previousCount = ast.modificationCount();
- final TryStatement x = ast.newTryStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getBody().getParent() == x);
- assertTrue((x.getBody()).statements().isEmpty());
- assertTrue(x.getFinally() == null);
- assertTrue(x.catchClauses().size() == 0);
- assertTrue(x.getNodeType() == ASTNode.TRY_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- TryStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Body", true, Block.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Block that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Block) value);
- }
- });
-
- genericPropertyListTest(x, x.catchClauses(),
- new Property("CatchClauses", true, CatchClause.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- CatchClause result = targetAst.newCatchClause();
- if (parented) {
- TryStatement s1 = targetAst.newTryStatement();
- s1.catchClauses().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return CatchClause that embeds x
- CatchClause s1 = ast.newCatchClause();
- Block s2 = ast.newBlock();
- s1.setBody(s2);
- s2.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- });
-
- genericPropertyTest(x, new Property("Finally", false, Block.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Block that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getFinally();
- }
- public void set(ASTNode value) {
- x.setFinally((Block) value);
- }
- });
- }
-
- public void testCatchClause() {
- long previousCount = ast.modificationCount();
- final CatchClause x = ast.newCatchClause();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getBody().getParent() == x);
- assertTrue(x.getBody().statements().isEmpty());
- assertTrue(x.getException().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.CATCH_CLAUSE);
- assertTrue(x.structuralPropertiesForType() ==
- CatchClause.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Exception", true, SingleVariableDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SingleVariableDeclaration result = targetAst.newSingleVariableDeclaration();
- if (parented) {
- targetAst.newCatchClause().setException(result);
-
- }
- return result;
- }
- public ASTNode wrap() {
- // return SingleVariableDeclaration that embeds x
- SingleVariableDeclaration s1 = ast.newSingleVariableDeclaration();
- ClassInstanceCreation s2 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s2.setAnonymousClassDeclaration(a1);
- s1.setInitializer(s2);
- FunctionDeclaration s3 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s3);
- Block s4 = ast.newBlock();
- s3.setBody(s4);
- TryStatement s5 = ast.newTryStatement();
- s4.statements().add(s5);
- s5.catchClauses().add(x);
- return s1;
- }
- public void unwrap() {
- TryStatement s5 = (TryStatement) x.getParent();
- s5.catchClauses().remove(x);
- }
- public ASTNode get() {
- return x.getException();
- }
- public void set(ASTNode value) {
- x.setException((SingleVariableDeclaration) value);
- }
- });
-
- genericPropertyTest(x, new Property("Body", true, Block.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Block that embeds x
- Block s1 = ast.newBlock();
- TryStatement s2 = ast.newTryStatement();
- s1.statements().add(s2);
- s2.catchClauses().add(x);
- return s1;
- }
- public void unwrap() {
- TryStatement s2 = (TryStatement) x.getParent();
- s2.catchClauses().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Block) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testEmptyStatement() {
- long previousCount = ast.modificationCount();
- final EmptyStatement x = ast.newEmptyStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.EMPTY_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- EmptyStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
- }
-
- /**
- * Exercise the leadingComment property.
- *
- * @param x the statement to test
- * @deprecated (Uses get/setLeadingComment() which is deprecated)
- */
- void tLeadingComment(Statement x) {
-
- // check that null is allowed
- long previousCount = ast.modificationCount();
- x.setLeadingComment(null);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getLeadingComment() == null);
-
- // check that regular comment is allowed
- previousCount = ast.modificationCount();
- x.setLeadingComment("/* X */"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getLeadingComment() == "/* X */"); //$NON-NLS-1$
-
- // check that regular comment with line breaks is allowed
- previousCount = ast.modificationCount();
- x.setLeadingComment("/* X\n *Y\n */"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getLeadingComment() == "/* X\n *Y\n */"); //$NON-NLS-1$
-
- // check that end-of-line comment is allowed
- previousCount = ast.modificationCount();
- x.setLeadingComment("// X\n"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getLeadingComment() == "// X\n"); //$NON-NLS-1$
-
- // check that end-of-line comment without a line break at the end is allowed
- previousCount = ast.modificationCount();
- x.setLeadingComment("// X"); //$NON-NLS-1$
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getLeadingComment() == "// X"); //$NON-NLS-1$
-
- // check that end-of-line comment with embedded end of line
- // not allowed
- try {
- x.setLeadingComment("// X\n extra"); //$NON-NLS-1$
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- }
-
- /**
- * Exercise the javadoc property.
- *
- * @param x the body declaration to test
- */
- void tJavadocComment(final BodyDeclaration x) {
- genericPropertyTest(x, new Property("Javadoc", false, JSdoc.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- JSdoc result = targetAst.newJSdoc();
- if (parented) {
- targetAst.newInitializer().setJavadoc(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getJavadoc();
- }
- public void set(ASTNode value) {
- x.setJavadoc((JSdoc) value);
- }
- });
- }
-
- /**
- * Returns a list of all the different Modifier nodes.
- */
- Modifier[] allModifiers() {
- Modifier[] allMods = {
- ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD),
- ast.newModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD)
- };
- return allMods;
- }
-
-
- /**
- * Exercise the alternateRoot property of a Comment.
- *
- * @param x the comment to test
- * @since 3.0
- */
- void tAlternateRoot(final Comment x) {
- JavaScriptUnit cu = ast.newJavaScriptUnit();
- long previousCount = ast.modificationCount();
- x.setAlternateRoot(cu);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getAlternateRoot() == cu);
- previousCount = ast.modificationCount();
- x.setAlternateRoot(null);
- assertTrue(x.getAlternateRoot() == null);
- assertTrue(ast.modificationCount() > previousCount);
- }
-
- /**
- * Exercise the client properties of a node.
- *
- * @param x the node to test
- */
- void tClientProperties(ASTNode x) {
-
- long previousCount = ast.modificationCount();
-
- // a node initially has no properties
- assertTrue(x.properties().size() == 0);
- assertTrue(x.getProperty("1") == null); //$NON-NLS-1$
-
- // clearing an unset property does not add it to list of known ones
- x.setProperty("1", null); //$NON-NLS-1$
- assertTrue(x.getProperty("1") == null); //$NON-NLS-1$
- assertTrue(x.properties().size() == 0);
-
- // setting an unset property does add it to the list of known ones
- x.setProperty("1", "a1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("1") == "a1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().size() == 1);
- Map.Entry[] m = (Map.Entry[]) x.properties().entrySet().toArray(new Map.Entry[1]);
- assertTrue(m[0].getKey() == "1"); //$NON-NLS-1$
- assertTrue(m[0].getValue() == "a1"); //$NON-NLS-1$
-
- // setting an already set property just changes its value
- x.setProperty("1", "a2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("1") == "a2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().size() == 1);
- m = (Map.Entry[]) x.properties().entrySet().toArray(new Map.Entry[1]);
- assertTrue(m[0].getKey() == "1"); //$NON-NLS-1$
- assertTrue(m[0].getValue() == "a2"); //$NON-NLS-1$
-
- // clearing a set property removes it from list of known ones
- x.setProperty("1", null); //$NON-NLS-1$
- assertTrue(x.getProperty("1") == null); //$NON-NLS-1$
- assertTrue(x.properties().size() == 0);
-
-
- // ========= test 2 and 3 properties
- x.setProperty("1", "a1"); //$NON-NLS-1$ //$NON-NLS-2$
- x.setProperty("2", "b1"); //$NON-NLS-1$ //$NON-NLS-2$
- x.setProperty("3", "c1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("1") == "a1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("2") == "b1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("3") == "c1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().size() == 3);
- assertTrue(x.properties().get("1") == "a1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().get("2") == "b1"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().get("3") == "c1"); //$NON-NLS-1$ //$NON-NLS-2$
- x.setProperty("1", "a2"); //$NON-NLS-1$ //$NON-NLS-2$
- x.setProperty("2", "b2"); //$NON-NLS-1$ //$NON-NLS-2$
- x.setProperty("3", "c2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("1") == "a2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("2") == "b2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("3") == "c2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().size() == 3);
- assertTrue(x.properties().get("1") == "a2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().get("2") == "b2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().get("3") == "c2"); //$NON-NLS-1$ //$NON-NLS-2$
- x.setProperty("2", null); //$NON-NLS-1$
- assertTrue(x.getProperty("1") == "a2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.getProperty("2") == null); //$NON-NLS-1$
- assertTrue(x.getProperty("3") == "c2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().size() == 2);
- assertTrue(x.properties().get("1") == "a2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().get("2") == null); //$NON-NLS-1$
- assertTrue(x.properties().get("3") == "c2"); //$NON-NLS-1$ //$NON-NLS-2$
- x.setProperty("1", null); //$NON-NLS-1$
- assertTrue(x.getProperty("1") == null); //$NON-NLS-1$
- assertTrue(x.getProperty("2") == null); //$NON-NLS-1$
- assertTrue(x.getProperty("3") == "c2"); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(x.properties().size() == 1);
- assertTrue(x.properties().get("1") == null); //$NON-NLS-1$
- assertTrue(x.properties().get("2") == null); //$NON-NLS-1$
- assertTrue(x.properties().get("3") == "c2"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // none of this is considered to have affected the AST
- assertTrue(ast.modificationCount() == previousCount);
- }
-
- public void testReturnStatement() {
- long previousCount = ast.modificationCount();
- final ReturnStatement x = ast.newReturnStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression() == null);
- assertTrue(x.getNodeType() == ASTNode.RETURN_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- ReturnStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Expression", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testThrowStatement() {
- long previousCount = ast.modificationCount();
- final ThrowStatement x = ast.newThrowStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.THROW_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- ThrowStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testSwitchStatement() {
- long previousCount = ast.modificationCount();
- final SwitchStatement x = ast.newSwitchStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.statements().isEmpty());
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.SWITCH_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- SwitchStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- genericPropertyListTest(x, x.statements(),
- new Property("Statements", true, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testSwitchCase() {
- long previousCount = ast.modificationCount();
- final SwitchCase x = ast.newSwitchCase();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(!x.isDefault());
- assertTrue(x.getNodeType() == ASTNode.SWITCH_CASE);
- assertTrue(x.structuralPropertiesForType() ==
- SwitchCase.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Expression", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- SwitchStatement s4 = ast.newSwitchStatement();
- s3.statements().add(s4);
- s4.statements().add(x);
- return s1;
- }
- public void unwrap() {
- SwitchStatement s4 = (SwitchStatement) x.getParent();
- s4.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
- }
-
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testLabeledStatement() {
- long previousCount = ast.modificationCount();
- final LabeledStatement x = ast.newLabeledStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLabel().getParent() == x);
- assertTrue(x.getBody().getParent() == x);
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.LABELED_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- LabeledStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Label", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getLabel();
- }
- public void set(ASTNode value) {
- x.setLabel((SimpleName) value);
- }
- });
-
- genericPropertyTest(x, new Property("Body", true, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Statement) value);
- }
- });
- }
-
- /**
- * Walks the given AST and assigns properly-nested (but otherwise totally bogus)
- * source ranges to all nodes.
- */
- void assignSourceRanges(ASTNode target) {
- final StringBuffer buffer = new StringBuffer();
- final List stack = new ArrayList();
- // pretend that every construct begins with "(" and ends with ")"
- class PositionAssigner extends ASTVisitor {
- PositionAssigner() {
- // visit Javadoc.tags();
- super(true);
- }
- public void preVisit(ASTNode node) {
- int start = buffer.length();
- buffer.append("(");
- // push start position - popped by postVisit for same node
- stack.add(new Integer(start));
- }
- public void postVisit(ASTNode node) {
- // pop start position placed there by preVisit
- int start = ((Integer) stack.remove(stack.size() - 1)).intValue();
- buffer.append(")");
- int length = buffer.length() - start;
- node.setSourceRange(start, length);
- }
- }
- target.accept(new PositionAssigner());
- }
-
- public void testClone() {
- ASTNode x = SampleASTs.oneOfEach(ast);
- assignSourceRanges(x);
- assertTrue(x.subtreeMatch(new CheckPositionsMatcher(), x));
-
- // same AST clone
- ASTNode y = ASTNode.copySubtree(ast, x);
- assertTrue(x.subtreeMatch(new CheckPositionsMatcher(), y));
- assertTrue(y.subtreeMatch(new CheckPositionsMatcher(), x));
-
- // different AST clone
- AST newAST = AST.newAST(ast.apiLevel());
- ASTNode z = ASTNode.copySubtree(newAST, x);
- assertTrue(x.subtreeMatch(new CheckPositionsMatcher(), z));
- assertTrue(z.subtreeMatch(new CheckPositionsMatcher(), x));
- }
-
- public void testNullResolve() {
- ASTNode x = SampleASTs.oneOfEach(ast);
-
- ASTVisitor v = new ASTVisitor(true) {
- // NAMES
-
- public boolean visit(SimpleName node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(QualifiedName node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
-
- // TYPES
-
- public boolean visit(SimpleType node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(ArrayType node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(PrimitiveType node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(QualifiedType node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
-
- // EXPRESSIONS
-
- public boolean visit(Assignment node) {
- assertTrue(node.resolveTypeBinding() == null);
- return true;
- }
-
- public boolean visit(ClassInstanceCreation node) {
- assertTrue(node.resolveConstructorBinding() == null);
- return true;
- }
-
- public boolean visit(ConstructorInvocation node) {
- assertTrue(node.resolveConstructorBinding() == null);
- return true;
- }
-
- public boolean visit(SuperConstructorInvocation node) {
- assertTrue(node.resolveConstructorBinding() == null);
- return true;
- }
-
- // MAJOR DECLARATIONS
-
- public boolean visit(PackageDeclaration node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(ImportDeclaration node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(FunctionDeclaration node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(TypeDeclaration node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(TypeDeclarationStatement node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(SingleVariableDeclaration node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- public boolean visit(VariableDeclarationFragment node) {
- assertTrue(node.resolveBinding() == null);
- return true;
- }
- };
-
- x.accept(v);
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testForStatement() {
- long previousCount = ast.modificationCount();
- final ForStatement x = ast.newForStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.initializers().isEmpty());
- assertTrue(x.getExpression() == null);
- assertTrue(x.updaters().isEmpty());
- assertTrue(x.getBody().getParent() == x);
- assertTrue(x.getBody() instanceof Block);
- assertTrue(((Block) x.getBody()).statements().isEmpty());
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.FOR_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- ForStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyListTest(x, x.initializers(),
- new Property("Initializers", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- });
-
- genericPropertyTest(x, new Property("Expression", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- genericPropertyListTest(x, x.updaters(),
- new Property("Updaters", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- });
-
- genericPropertyTest(x, new Property("Body", true, Statement.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Block result = targetAst.newBlock();
- if (parented) {
- Block b2 = targetAst.newBlock();
- b2.statements().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return a Statement that embeds x
- Block s1 = ast.newBlock();
- s1.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s2 = (Block) x.getParent();
- s2.statements().remove(x);
- }
- public ASTNode get() {
- return x.getBody();
- }
- public void set(ASTNode value) {
- x.setBody((Statement) value);
- }
- });
- }
-
- /**
- * @deprecated (Uses getLeadingComment() which is deprecated)
- */
- public void testEnhancedForStatement() {
- if (ast.apiLevel() == AST.JLS2) {
- // node type introduced in 3.0 API
- try {
- ast.newEnhancedForStatement();
- assertTrue(false);
- } catch (UnsupportedOperationException e) {
- // pass
- }
- return;
- }
- long previousCount = ast.modificationCount();
- final EnhancedForStatement x = ast.newEnhancedForStatement();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getParameter() != null);
- assertTrue(x.getParameter().getParent() == x);
- assertTrue(x.getExpression() != null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getBody().getParent() == x);
- assertTrue(x.getBody() instanceof Block);
- assertTrue(((Block) x.getBody()).statements().isEmpty());
- assertTrue(x.getLeadingComment() == null);
- assertTrue(x.getNodeType() == ASTNode.ENHANCED_FOR_STATEMENT);
- assertTrue(x.structuralPropertiesForType() ==
- EnhancedForStatement.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- tLeadingComment(x);
-
- genericPropertyTest(x, new Property("Parameter", true, SingleVariableDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SingleVariableDeclaration result = targetAst.newSingleVariableDeclaration();
- if (parented) {
- CatchClause parent = targetAst.newCatchClause();
- parent.setException(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getParameter();
- }
- public void set(ASTNode value) {
- x.setParameter((SingleVariableDeclaration) value);
- }
- });
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST target, boolean parented) {
- Expression result = target.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- target.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
- }
-
- public void testConstructorInvocation() {
- long previousCount = ast.modificationCount();
- final ConstructorInvocation x = ast.newConstructorInvocation();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() >= AST.JLS3) {
- assertTrue(x.typeArguments().isEmpty());
- }
- assertTrue(x.arguments().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.CONSTRUCTOR_INVOCATION);
- assertTrue(x.structuralPropertiesForType() ==
- ConstructorInvocation.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyListTest(x, x.typeArguments(),
- new Property("TypeArguments", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Type result = targetAst.newSimpleType(targetAst.newSimpleName("X")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- });
- }
-
- genericPropertyListTest(x, x.arguments(),
- new Property("Arguments", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- });
- }
-
- public void testSuperConstructorInvocation() {
- long previousCount = ast.modificationCount();
- final SuperConstructorInvocation x = ast.newSuperConstructorInvocation();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression() == null);
- if (ast.apiLevel() >= AST.JLS3) {
- assertTrue(x.typeArguments().isEmpty());
- }
- assertTrue(x.arguments().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.SUPER_CONSTRUCTOR_INVOCATION);
- assertTrue(x.structuralPropertiesForType() ==
- SuperConstructorInvocation.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Expression", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyListTest(x, x.typeArguments(),
- new Property("TypeArguments", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Type result = targetAst.newSimpleType(targetAst.newSimpleName("X")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- });
- }
-
- genericPropertyListTest(x, x.arguments(),
- new Property("Arguments", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ClassInstanceCreation s1 = ast.newClassInstanceCreation();
- AnonymousClassDeclaration a1 = ast.newAnonymousClassDeclaration();
- s1.setAnonymousClassDeclaration(a1);
- FunctionDeclaration s2 = ast.newFunctionDeclaration();
- a1.bodyDeclarations().add(s2);
- Block s3 = ast.newBlock();
- s2.setBody(s3);
- s3.statements().add(x);
- return s1;
- }
- public void unwrap() {
- Block s3 = (Block) x.getParent();
- s3.statements().remove(x);
- }
- });
- }
-
- public void testThisExpression() {
- long previousCount = ast.modificationCount();
- final ThisExpression x = ast.newThisExpression();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getQualifier() == null);
- assertTrue(x.getNodeType() == ASTNode.THIS_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- ThisExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Qualifier", false, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- QualifiedName result = targetAst.newQualifiedName(
- targetAst.newSimpleName("a"), //$NON-NLS-1$
- targetAst.newSimpleName("b")); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getQualifier();
- }
- public void set(ASTNode value) {
- x.setQualifier((Name) value);
- }
- });
- }
-
- public void testFieldAccess() {
- long previousCount = ast.modificationCount();
- final FieldAccess x = ast.newFieldAccess();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.FIELD_ACCESS);
- assertTrue(x.structuralPropertiesForType() ==
- FieldAccess.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
- }
-
-
- public void testSuperFieldAccess() {
- long previousCount = ast.modificationCount();
- final SuperFieldAccess x = ast.newSuperFieldAccess();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getQualifier() == null);
- assertTrue(x.getNodeType() == ASTNode.SUPER_FIELD_ACCESS);
- assertTrue(x.structuralPropertiesForType() ==
- SuperFieldAccess.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Qualifier", false, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- QualifiedName result = targetAst.newQualifiedName(
- targetAst.newSimpleName("a"), //$NON-NLS-1$
- targetAst.newSimpleName("b")); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getQualifier();
- }
- public void set(ASTNode value) {
- x.setQualifier((Name) value);
- }
- });
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
- }
-
- public void testSuperMethodInvocation() {
- long previousCount = ast.modificationCount();
- final SuperMethodInvocation x = ast.newSuperMethodInvocation();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- if (ast.apiLevel() >= AST.JLS3) {
- assertTrue(x.typeArguments().isEmpty());
- }
- assertTrue(x.getName().getParent() == x);
- assertTrue(x.getQualifier() == null);
- assertTrue(x.arguments().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.SUPER_METHOD_INVOCATION);
- assertTrue(x.structuralPropertiesForType() ==
- SuperMethodInvocation.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Qualifier", false, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- QualifiedName result = targetAst.newQualifiedName(
- targetAst.newSimpleName("a"), //$NON-NLS-1$
- targetAst.newSimpleName("b")); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getQualifier();
- }
- public void set(ASTNode value) {
- x.setQualifier((Name) value);
- }
- });
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyListTest(x, x.typeArguments(),
- new Property("TypeArguments", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Type result = targetAst.newSimpleType(targetAst.newSimpleName("X")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- });
- }
-
- genericPropertyTest(x, new Property("Name", true, SimpleName.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((SimpleName) value);
- }
- });
-
- genericPropertyListTest(x, x.arguments(),
- new Property("Arguments", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- });
- }
-
- public void testTypeLiteral() {
- long previousCount = ast.modificationCount();
- final TypeLiteral x = ast.newTypeLiteral();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getType().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.TYPE_LITERAL);
- assertTrue(x.structuralPropertiesForType() ==
- TypeLiteral.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Type", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(
- targetAst.newSimpleName("a")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((Type) value);
- }
- });
- }
-
- public void testPrefixExpression() {
- long previousCount = ast.modificationCount();
- final PrefixExpression x = ast.newPrefixExpression();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getOperand().getParent() == x);
- assertTrue(x.getOperator() != null);
- assertTrue(x.getNodeType() == ASTNode.PREFIX_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- PrefixExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // Operator property - mandatory typesafe enumeration
- // check the names of the operators
- assertTrue(PrefixExpression.Operator.INCREMENT.toString().equals("++")); //$NON-NLS-1$
- assertTrue(PrefixExpression.Operator.DECREMENT.toString().equals("--")); //$NON-NLS-1$
- assertTrue(PrefixExpression.Operator.PLUS.toString().equals("+")); //$NON-NLS-1$
- assertTrue(PrefixExpression.Operator.MINUS.toString().equals("-")); //$NON-NLS-1$
- assertTrue(PrefixExpression.Operator.COMPLEMENT.toString().equals("~")); //$NON-NLS-1$
- assertTrue(PrefixExpression.Operator.NOT.toString().equals("!")); //$NON-NLS-1$
-
- PrefixExpression.Operator[] known = {
- PrefixExpression.Operator.INCREMENT,
- PrefixExpression.Operator.DECREMENT,
- PrefixExpression.Operator.PLUS,
- PrefixExpression.Operator.MINUS,
- PrefixExpression.Operator.COMPLEMENT,
- PrefixExpression.Operator.NOT,
- };
-
- // check all operators are distinct
- for (int i = 0; i < known.length; i++) {
- for (int j = 0; j < known.length; j++) {
- assertTrue(i == j || !known[i].equals(known[j]));
- }
- }
-
- // check all operators work
- for (int i = 0; i < known.length; i++) {
- previousCount = ast.modificationCount();
- x.setOperator(known[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getOperator().equals(known[i]));
- }
- // ensure null does not work as an operator
- try {
- x.setOperator(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check toOperator lookup of operator by name
- for (int i = 0; i < known.length; i++) {
- String name = known[i].toString();
- assertTrue(PrefixExpression.Operator.toOperator(name).equals(known[i]));
- }
- assertTrue(PrefixExpression.Operator.toOperator("huh") == null); //$NON-NLS-1$
-
- genericPropertyTest(x, new Property("Operand", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getOperand();
- }
- public void set(ASTNode value) {
- x.setOperand((Expression) value);
- }
- });
- }
-
- public void testPostfixExpression() {
- long previousCount = ast.modificationCount();
- final PostfixExpression x = ast.newPostfixExpression();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getOperand().getParent() == x);
- assertTrue(x.getOperator() != null);
- assertTrue(x.getNodeType() == ASTNode.POSTFIX_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- PostfixExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // Operator property - mandatory typesafe enumeration
- // check the names of the operators
- assertTrue(PostfixExpression.Operator.INCREMENT.toString().equals("++")); //$NON-NLS-1$
- assertTrue(PostfixExpression.Operator.DECREMENT.toString().equals("--")); //$NON-NLS-1$
-
- PostfixExpression.Operator[] known = {
- PostfixExpression.Operator.INCREMENT,
- PostfixExpression.Operator.DECREMENT,
- };
-
- // check all operators are distinct
- for (int i = 0; i < known.length; i++) {
- for (int j = 0; j < known.length; j++) {
- assertTrue(i == j || !known[i].equals(known[j]));
- }
- }
-
- // check all operators work
- for (int i = 0; i < known.length; i++) {
- previousCount = ast.modificationCount();
- x.setOperator(known[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getOperator().equals(known[i]));
- }
- // ensure null does not work as an operator
- try {
- x.setOperator(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check toOperator lookup of operator by name
- for (int i = 0; i < known.length; i++) {
- String name = known[i].toString();
- assertTrue(PostfixExpression.Operator.toOperator(name).equals(known[i]));
- }
- assertTrue(PostfixExpression.Operator.toOperator("huh") == null); //$NON-NLS-1$
-
- genericPropertyTest(x, new Property("Operand", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getOperand();
- }
- public void set(ASTNode value) {
- x.setOperand((Expression) value);
- }
- });
- }
-
- public void testInfixExpression() {
- long previousCount = ast.modificationCount();
- final InfixExpression x = ast.newInfixExpression();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLeftOperand().getParent() == x);
- assertTrue(x.getOperator() != null);
- assertTrue(x.getRightOperand().getParent() == x);
- assertTrue(x.extendedOperands().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.INFIX_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- InfixExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // Operator property - mandatory typesafe enumeration
- // check the names of the operators
- assertTrue(InfixExpression.Operator.TIMES.toString().equals("*")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.DIVIDE.toString().equals("/")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.REMAINDER.toString().equals("%")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.PLUS.toString().equals("+")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.MINUS.toString().equals("-")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.LEFT_SHIFT.toString().equals("<<")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.RIGHT_SHIFT_SIGNED.toString().equals(">>")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED.toString().equals(">>>")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.LESS.toString().equals("<")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.GREATER.toString().equals(">")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.LESS_EQUALS.toString().equals("<=")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.GREATER_EQUALS.toString().equals(">=")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.EQUALS.toString().equals("==")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.NOT_EQUALS.toString().equals("!=")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.XOR.toString().equals("^")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.OR.toString().equals("|")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.AND.toString().equals("&")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.CONDITIONAL_OR.toString().equals("||")); //$NON-NLS-1$
- assertTrue(InfixExpression.Operator.CONDITIONAL_AND.toString().equals("&&")); //$NON-NLS-1$
-
- InfixExpression.Operator[] known = {
- InfixExpression.Operator.TIMES,
- InfixExpression.Operator.DIVIDE,
- InfixExpression.Operator.REMAINDER,
- InfixExpression.Operator.PLUS,
- InfixExpression.Operator.MINUS,
- InfixExpression.Operator.LEFT_SHIFT,
- InfixExpression.Operator.RIGHT_SHIFT_SIGNED,
- InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED,
- InfixExpression.Operator.LESS,
- InfixExpression.Operator.GREATER,
- InfixExpression.Operator.LESS_EQUALS,
- InfixExpression.Operator.GREATER_EQUALS,
- InfixExpression.Operator.EQUALS,
- InfixExpression.Operator.NOT_EQUALS,
- InfixExpression.Operator.XOR,
- InfixExpression.Operator.OR,
- InfixExpression.Operator.AND,
- InfixExpression.Operator.CONDITIONAL_OR,
- InfixExpression.Operator.CONDITIONAL_AND,
- };
-
- // check all operators are distinct
- for (int i = 0; i < known.length; i++) {
- for (int j = 0; j < known.length; j++) {
- assertTrue(i == j || !known[i].equals(known[j]));
- }
- }
-
- // check all operators work
- for (int i = 0; i < known.length; i++) {
- previousCount = ast.modificationCount();
- x.setOperator(known[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getOperator().equals(known[i]));
- }
- // ensure null does not work as an operator
- try {
- x.setOperator(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check toOperator lookup of operator by name
- for (int i = 0; i < known.length; i++) {
- String name = known[i].toString();
- assertTrue(InfixExpression.Operator.toOperator(name).equals(known[i]));
- }
- assertTrue(InfixExpression.Operator.toOperator("huh") == null); //$NON-NLS-1$
-
- genericPropertyTest(x, new Property("LeftOperand", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getLeftOperand();
- }
- public void set(ASTNode value) {
- x.setLeftOperand((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("RightOperand", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getRightOperand();
- }
- public void set(ASTNode value) {
- x.setRightOperand((Expression) value);
- }
- });
-
- genericPropertyListTest(x, x.extendedOperands(),
- new Property("ExtendedOperands", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- });
- }
-
- public void testInstanceofExpression() {
- long previousCount = ast.modificationCount();
- final InstanceofExpression x = ast.newInstanceofExpression();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getLeftOperand().getParent() == x);
- assertTrue(x.getRightOperand().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.INSTANCEOF_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- InstanceofExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("LeftOperand", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getLeftOperand();
- }
- public void set(ASTNode value) {
- x.setLeftOperand((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("RightOperand", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Type result = localAst.newSimpleType(localAst.newSimpleName("Object")); //$NON-NLS-1$
- if (parented) {
- localAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getRightOperand();
- }
- public void set(ASTNode value) {
- x.setRightOperand((Type) value);
- }
- });
- }
-
- public void testConditionalExpression() {
- long previousCount = ast.modificationCount();
- final ConditionalExpression x = ast.newConditionalExpression();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getThenExpression().getParent() == x);
- assertTrue(x.getElseExpression().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.CONDITIONAL_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- ConditionalExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("ThenExpression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getThenExpression();
- }
- public void set(ASTNode value) {
- x.setThenExpression((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("ElseExpression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getElseExpression();
- }
- public void set(ASTNode value) {
- x.setElseExpression((Expression) value);
- }
- });
- }
-
- public void testArrayAccess() {
- long previousCount = ast.modificationCount();
- final ArrayAccess x = ast.newArrayAccess();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getArray().getParent() == x);
- assertTrue(x.getIndex().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.ARRAY_ACCESS);
- assertTrue(x.structuralPropertiesForType() ==
- ArrayAccess.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Array", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getArray();
- }
- public void set(ASTNode value) {
- x.setArray((Expression) value);
- }
- });
-
- genericPropertyTest(x, new Property("Index", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getIndex();
- }
- public void set(ASTNode value) {
- x.setIndex((Expression) value);
- }
- });
- }
-
- public void testArrayInitializer() {
- long previousCount = ast.modificationCount();
- final ArrayInitializer x = ast.newArrayInitializer();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.expressions().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.ARRAY_INITIALIZER);
- assertTrue(x.structuralPropertiesForType() ==
- ArrayInitializer.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyListTest(x, x.expressions(),
- new Property("Expressions", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- });
- }
-
- /** @deprecated using deprecated code */
- public void testClassInstanceCreation() {
- long previousCount = ast.modificationCount();
- final ClassInstanceCreation x = ast.newClassInstanceCreation();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression() == null);
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(x.getName().getParent() == x);
- } else {
- assertTrue(x.typeArguments().isEmpty());
- assertTrue(x.getType().getParent() == x);
- }
- assertTrue(x.arguments().isEmpty());
- assertTrue(x.getAnonymousClassDeclaration() == null);
- assertTrue(x.getNodeType() == ASTNode.CLASS_INSTANCE_CREATION);
- assertTrue(x.structuralPropertiesForType() ==
- ClassInstanceCreation.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Expression", false, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyListTest(x, x.typeArguments(),
- new Property("TypeArguments", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- Type result = targetAst.newSimpleType(targetAst.newSimpleName("X")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- });
- }
-
- if (ast.apiLevel() == AST.JLS2) {
- genericPropertyTest(x, new Property("Name", true, Name.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("a"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getName();
- }
- public void set(ASTNode value) {
- x.setName((Name) value);
- }
- });
- }
-
- if (ast.apiLevel() >= AST.JLS3) {
- genericPropertyTest(x, new Property("Type", true, Type.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleType result = targetAst.newSimpleType(targetAst.newSimpleName("foo")); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((Type) value);
- }
- });
- }
-
- genericPropertyListTest(x, x.arguments(),
- new Property("Arguments", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- });
-
- genericPropertyTest(x, new Property("AnonymousClassDeclaration", false, AnonymousClassDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- AnonymousClassDeclaration result = targetAst.newAnonymousClassDeclaration();
- if (parented) {
- targetAst.newClassInstanceCreation().setAnonymousClassDeclaration(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return AnonymousClassDeclaration that embeds x
- AnonymousClassDeclaration s0 = x.getAST().newAnonymousClassDeclaration();
- VariableDeclarationFragment s1 = x.getAST().newVariableDeclarationFragment();
- FieldDeclaration s2 = x.getAST().newFieldDeclaration(s1);
- s0.bodyDeclarations().add(s2);
- s1.setInitializer(x);
- return s0;
- }
- public void unwrap() {
- VariableDeclarationFragment s1 = (VariableDeclarationFragment) x.getParent();
- s1.setInitializer(null);
- }
- public ASTNode get() {
- return x.getAnonymousClassDeclaration();
- }
- public void set(ASTNode value) {
- x.setAnonymousClassDeclaration((AnonymousClassDeclaration) value);
- }
- });
-
- }
-
- public void testAnonymousClassDeclaration() {
- long previousCount = ast.modificationCount();
- final AnonymousClassDeclaration x = ast.newAnonymousClassDeclaration();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.bodyDeclarations().isEmpty());
- assertTrue(x.getNodeType() == ASTNode.ANONYMOUS_CLASS_DECLARATION);
- assertTrue(x.structuralPropertiesForType() ==
- AnonymousClassDeclaration.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyListTest(x, x.bodyDeclarations(),
- new Property("BodyDeclarations", true, BodyDeclaration.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- TypeDeclaration result = targetAst.newTypeDeclaration();
- if (parented) {
- JavaScriptUnit compilationUnit = targetAst.newJavaScriptUnit();
- compilationUnit.types().add(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return BodyDeclaration that embeds x
- VariableDeclarationFragment s0 = x.getAST().newVariableDeclarationFragment();
- FieldDeclaration s1 = x.getAST().newFieldDeclaration(s0);
- ClassInstanceCreation s2= x.getAST().newClassInstanceCreation();
- s0.setInitializer(s2);
- s2.setAnonymousClassDeclaration(x);
- return s1;
- }
- public void unwrap() {
- ClassInstanceCreation s2 = (ClassInstanceCreation) x.getParent();
- s2.setAnonymousClassDeclaration(null);
- }
- });
-
- // check that TypeDeclarations in body are classified correctly
- TypeDeclaration t1 = ast.newTypeDeclaration();
- x.bodyDeclarations().add(t1);
- assertTrue(t1.isLocalTypeDeclaration() == false);
- assertTrue(t1.isMemberTypeDeclaration() == true);
- assertTrue(t1.isPackageMemberTypeDeclaration() == false);
- }
-
- public void testArrayCreation() {
- long previousCount = ast.modificationCount();
- final ArrayCreation x = ast.newArrayCreation();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getType().getParent() == x);
- assertTrue(x.dimensions().isEmpty());
- assertTrue(x.getInitializer() == null);
- assertTrue(x.getNodeType() == ASTNode.ARRAY_CREATION);
- assertTrue(x.structuralPropertiesForType() ==
- ArrayCreation.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Type", true, ArrayType.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- ArrayType result = targetAst.newArrayType(
- targetAst.newSimpleType(targetAst.newSimpleName("a"))); //$NON-NLS-1$
- if (parented) {
- targetAst.newArrayType(result);
- }
- return result;
- }
- public ASTNode get() {
- return x.getType();
- }
- public void set(ASTNode value) {
- x.setType((ArrayType) value);
- }
- });
-
- genericPropertyListTest(x, x.dimensions(),
- new Property("Dimensions", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- SimpleName result = targetAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return Expression that embeds x
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("x")); //$NON-NLS-1$
- }
- });
-
- genericPropertyTest(x, new Property("Initializer", false, ArrayInitializer.class) { //$NON-NLS-1$
- public ASTNode sample(AST targetAst, boolean parented) {
- ArrayInitializer result = targetAst.newArrayInitializer();
- if (parented) {
- targetAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- // return ArrayInitializer that embeds x
- ArrayInitializer s1 = ast.newArrayInitializer();
- s1.expressions().add(x);
- return s1;
- }
- public void unwrap() {
- ArrayInitializer s1 = (ArrayInitializer) x.getParent();
- s1.expressions().remove(x);
- }
- public ASTNode get() {
- return x.getInitializer();
- }
- public void set(ASTNode value) {
- x.setInitializer((ArrayInitializer) value);
- }
- });
- }
-
- public void testParenthesizedExpression() {
- long previousCount = ast.modificationCount();
- final ParenthesizedExpression x = ast.newParenthesizedExpression();
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getExpression().getParent() == x);
- assertTrue(x.getNodeType() == ASTNode.PARENTHESIZED_EXPRESSION);
- assertTrue(x.structuralPropertiesForType() ==
- ParenthesizedExpression.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- genericPropertyTest(x, new Property("Expression", true, Expression.class) { //$NON-NLS-1$
- public ASTNode sample(AST localAst, boolean parented) {
- Expression result = localAst.newSimpleName("foo"); //$NON-NLS-1$
- if (parented) {
- localAst.newExpressionStatement(result);
- }
- return result;
- }
- public ASTNode wrap() {
- ParenthesizedExpression s1 = ast.newParenthesizedExpression();
- s1.setExpression(x);
- return s1;
- }
- public void unwrap() {
- ParenthesizedExpression s1 = (ParenthesizedExpression) x.getParent();
- s1.setExpression(ast.newSimpleName("fie")); //$NON-NLS-1$
- }
- public ASTNode get() {
- return x.getExpression();
- }
- public void set(ASTNode value) {
- x.setExpression((Expression) value);
- }
- });
- }
-
-
- /** @deprecated using deprecated code */
- public void testModifiers() {
-
- // check all modifiers match their JVM spec values
- assertTrue(Modifier.ABSTRACT == 0x0400);
- assertTrue(Modifier.FINAL == 0x0010);
- assertTrue(Modifier.NATIVE == 0x0100);
- assertTrue(Modifier.NONE == 0x0000);
- assertTrue(Modifier.PRIVATE == 0x0002);
- assertTrue(Modifier.PROTECTED == 0x0004);
- assertTrue(Modifier.PUBLIC == 0x0001);
- assertTrue(Modifier.STATIC == 0x0008);
- assertTrue(Modifier.STRICTFP == 0x0800);
- assertTrue(Modifier.SYNCHRONIZED == 0x0020);
- assertTrue(Modifier.TRANSIENT == 0x0080);
- assertTrue(Modifier.VOLATILE == 0x0040);
-
- // check that all
- final int[] mods =
- {
- Modifier.ABSTRACT,
- Modifier.FINAL,
- Modifier.NATIVE,
- Modifier.PRIVATE,
- Modifier.PROTECTED,
- Modifier.PUBLIC,
- Modifier.STATIC,
- Modifier.STRICTFP,
- Modifier.SYNCHRONIZED,
- Modifier.TRANSIENT,
- Modifier.VOLATILE,
- };
-
- for (int i=0; i< mods.length; i++) {
- int m = mods[i];
- assertTrue(Modifier.isAbstract(m) == (m == Modifier.ABSTRACT));
- assertTrue(Modifier.isFinal(m) == (m == Modifier.FINAL));
- assertTrue(Modifier.isNative(m) == (m == Modifier.NATIVE));
- assertTrue(Modifier.isPrivate(m) == (m == Modifier.PRIVATE));
- assertTrue(Modifier.isProtected(m) == (m == Modifier.PROTECTED));
- assertTrue(Modifier.isPublic(m) == (m == Modifier.PUBLIC));
- assertTrue(Modifier.isStatic(m) == (m == Modifier.STATIC));
- assertTrue(Modifier.isStrictfp(m) == (m == Modifier.STRICTFP));
- assertTrue(Modifier.isSynchronized(m) == (m == Modifier.SYNCHRONIZED));
- assertTrue(Modifier.isTransient(m) == (m == Modifier.TRANSIENT));
- assertTrue(Modifier.isVolatile(m) == (m == Modifier.VOLATILE));
- }
-
- if (ast.apiLevel() == AST.JLS2) {
- // node type introduced in 3.0 API
- try {
- ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
- assertTrue(false);
- } catch (UnsupportedOperationException e) {
- // pass
- }
- try {
- ast.newModifiers(Modifier.NONE);
- assertTrue(false);
- } catch (UnsupportedOperationException e) {
- // pass
- }
- // skip rest of tests
- return;
- }
-
- // JLS3 only
- long previousCount = ast.modificationCount();
- final Modifier x = ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
- assertTrue(ast.modificationCount() > previousCount);
- previousCount = ast.modificationCount();
- assertTrue(x.getAST() == ast);
- assertTrue(x.getParent() == null);
- assertTrue(x.getKeyword() == Modifier.ModifierKeyword.PUBLIC_KEYWORD);
- assertTrue(x.getNodeType() == ASTNode.MODIFIER);
- assertTrue(x.structuralPropertiesForType() ==
- Modifier.propertyDescriptors(ast.apiLevel()));
- // make sure that reading did not change modification count
- assertTrue(ast.modificationCount() == previousCount);
-
- // ModifierKeyword property - mandatory typesafe enumeration
- // check the names of the modifiers
- assertTrue(Modifier.ModifierKeyword.PUBLIC_KEYWORD.toString().equals("public")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.PROTECTED_KEYWORD.toString().equals("protected")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.PRIVATE_KEYWORD.toString().equals("private")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.STATIC_KEYWORD.toString().equals("static")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.ABSTRACT_KEYWORD.toString().equals("abstract")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.FINAL_KEYWORD.toString().equals("final")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD.toString().equals("synchronized")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.NATIVE_KEYWORD.toString().equals("native")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.TRANSIENT_KEYWORD.toString().equals("transient")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.VOLATILE_KEYWORD.toString().equals("volatile")); //$NON-NLS-1$
- assertTrue(Modifier.ModifierKeyword.STRICTFP_KEYWORD.toString().equals("strictfp")); //$NON-NLS-1$
-
- final Modifier.ModifierKeyword[] known = {
- Modifier.ModifierKeyword.PUBLIC_KEYWORD,
- Modifier.ModifierKeyword.PROTECTED_KEYWORD,
- Modifier.ModifierKeyword.PRIVATE_KEYWORD,
- Modifier.ModifierKeyword.STATIC_KEYWORD,
- Modifier.ModifierKeyword.ABSTRACT_KEYWORD,
- Modifier.ModifierKeyword.FINAL_KEYWORD,
- Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD,
- Modifier.ModifierKeyword.NATIVE_KEYWORD,
- Modifier.ModifierKeyword.TRANSIENT_KEYWORD,
- Modifier.ModifierKeyword.VOLATILE_KEYWORD,
- Modifier.ModifierKeyword.STRICTFP_KEYWORD,
- };
-
- // check all modifiers are distinct
- for (int i = 0; i < known.length; i++) {
- for (int j = 0; j < known.length; j++) {
- assertTrue(i == j || !known[i].equals(known[j]));
- }
- }
-
- // check all modifiers work
- for (int i = 0; i < known.length; i++) {
- previousCount = ast.modificationCount();
- x.setKeyword(known[i]);
- assertTrue(ast.modificationCount() > previousCount);
- assertTrue(x.getKeyword().equals(known[i]));
- }
- // ensure null does not work as an operator
- try {
- x.setKeyword(null);
- assertTrue(false);
- } catch (RuntimeException e) {
- // pass
- }
-
- // check toKeyword lookup of modifier by name
- for (int i = 0; i < known.length; i++) {
- String name = known[i].toString();
- assertTrue(Modifier.ModifierKeyword.toKeyword(name).equals(known[i]));
- }
- assertTrue(Modifier.ModifierKeyword.toKeyword("huh") == null); //$NON-NLS-1$
-
- // check AST.newModifiers(flags)
- for (int i = 0; i < mods.length; i++) {
- int m = mods[i];
- List result = ast.newModifiers(m);
- assertEquals(1, result.size());
- Modifier modNode = (Modifier) result.get(0);
- assertEquals(m, modNode.getKeyword().toFlagValue());
- }
-
- // check AST.newModifiers ordering
- final Modifier.ModifierKeyword[] expectedOrder = {
- Modifier.ModifierKeyword.PUBLIC_KEYWORD,
- Modifier.ModifierKeyword.PROTECTED_KEYWORD,
- Modifier.ModifierKeyword.PRIVATE_KEYWORD,
- Modifier.ModifierKeyword.ABSTRACT_KEYWORD,
- Modifier.ModifierKeyword.STATIC_KEYWORD,
- Modifier.ModifierKeyword.FINAL_KEYWORD,
- Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD,
- Modifier.ModifierKeyword.NATIVE_KEYWORD,
- Modifier.ModifierKeyword.STRICTFP_KEYWORD,
- Modifier.ModifierKeyword.TRANSIENT_KEYWORD,
- Modifier.ModifierKeyword.VOLATILE_KEYWORD,
- };
- int all = 0;
- for (int i = 0; i < mods.length; i++) {
- all |= mods[i];
- }
- List result = ast.newModifiers(all);
- assertEquals(expectedOrder.length, result.size());
- for (int i = 0; i< expectedOrder.length; i++) {
- final Modifier modifier = ((Modifier) result.get(i));
- assertEquals(expectedOrder[i], modifier.getKeyword());
- if (modifier.isAbstract()) {
- assertEquals(Modifier.ModifierKeyword.ABSTRACT_KEYWORD, modifier.getKeyword());
- } else if (modifier.isFinal()) {
- assertEquals(Modifier.ModifierKeyword.FINAL_KEYWORD, modifier.getKeyword());
- } else if (modifier.isNative()) {
- assertEquals(Modifier.ModifierKeyword.NATIVE_KEYWORD, modifier.getKeyword());
- } else if (modifier.isPrivate()) {
- assertEquals(Modifier.ModifierKeyword.PRIVATE_KEYWORD, modifier.getKeyword());
- } else if (modifier.isProtected()) {
- assertEquals(Modifier.ModifierKeyword.PROTECTED_KEYWORD, modifier.getKeyword());
- } else if (modifier.isPublic()) {
- assertEquals(Modifier.ModifierKeyword.PUBLIC_KEYWORD, modifier.getKeyword());
- } else if (modifier.isStatic()) {
- assertEquals(Modifier.ModifierKeyword.STATIC_KEYWORD, modifier.getKeyword());
- } else if (modifier.isStrictfp()) {
- assertEquals(Modifier.ModifierKeyword.STRICTFP_KEYWORD, modifier.getKeyword());
- } else if (modifier.isSynchronized()) {
- assertEquals(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD, modifier.getKeyword());
- } else if (modifier.isTransient()) {
- assertEquals(Modifier.ModifierKeyword.TRANSIENT_KEYWORD, modifier.getKeyword());
- } else {
- assertEquals(Modifier.ModifierKeyword.VOLATILE_KEYWORD, modifier.getKeyword());
- }
- }
- }
-
- public void testSubtreeBytes() {
- ASTNode x = SampleASTs.oneOfEach(ast);
- final int subtreeBytes = x.subtreeBytes();
- assertTrue(subtreeBytes > 0);
- }
-
- public void testNodeTypeConstants() {
- // it would be a breaking API change to change the numeric values of
- // public static final ints
- assertTrue(ASTNode.ANONYMOUS_CLASS_DECLARATION == 1);
- assertTrue(ASTNode.ARRAY_ACCESS == 2);
- assertTrue(ASTNode.ARRAY_CREATION == 3);
- assertTrue(ASTNode.ARRAY_INITIALIZER == 4);
- assertTrue(ASTNode.ARRAY_TYPE == 5);
- assertTrue(ASTNode.ASSIGNMENT == 7);
- assertTrue(ASTNode.BLOCK == 8);
- assertTrue(ASTNode.BOOLEAN_LITERAL == 9);
- assertTrue(ASTNode.BREAK_STATEMENT == 10);
- assertTrue(ASTNode.CATCH_CLAUSE == 12);
- assertTrue(ASTNode.CHARACTER_LITERAL == 13);
- assertTrue(ASTNode.CLASS_INSTANCE_CREATION == 14);
- assertTrue(ASTNode.JAVASCRIPT_UNIT == 15);
- assertTrue(ASTNode.CONDITIONAL_EXPRESSION == 16);
- assertTrue(ASTNode.CONSTRUCTOR_INVOCATION == 17);
- assertTrue(ASTNode.CONTINUE_STATEMENT == 18);
- assertTrue(ASTNode.DO_STATEMENT == 19);
- assertTrue(ASTNode.EMPTY_STATEMENT == 20);
- assertTrue(ASTNode.EXPRESSION_STATEMENT == 21);
- assertTrue(ASTNode.FIELD_ACCESS == 22);
- assertTrue(ASTNode.FIELD_DECLARATION == 23);
- assertTrue(ASTNode.FOR_STATEMENT == 24);
- assertTrue(ASTNode.IF_STATEMENT == 25);
- assertTrue(ASTNode.IMPORT_DECLARATION == 26);
- assertTrue(ASTNode.INFIX_EXPRESSION == 27);
- assertTrue(ASTNode.INITIALIZER == 28);
- assertTrue(ASTNode.JSDOC == 29);
- assertTrue(ASTNode.LABELED_STATEMENT == 30);
- assertTrue(ASTNode.FUNCTION_DECLARATION == 31);
- assertTrue(ASTNode.FUNCTION_INVOCATION == 32);
- assertTrue(ASTNode.NULL_LITERAL == 33);
- assertTrue(ASTNode.NUMBER_LITERAL == 34);
- assertTrue(ASTNode.PACKAGE_DECLARATION == 35);
- assertTrue(ASTNode.PARENTHESIZED_EXPRESSION == 36);
- assertTrue(ASTNode.POSTFIX_EXPRESSION == 37);
- assertTrue(ASTNode.PREFIX_EXPRESSION == 38);
- assertTrue(ASTNode.PRIMITIVE_TYPE == 39);
- assertTrue(ASTNode.QUALIFIED_NAME == 40);
- assertTrue(ASTNode.RETURN_STATEMENT == 41);
- assertTrue(ASTNode.SIMPLE_NAME == 42);
- assertTrue(ASTNode.SIMPLE_TYPE == 43);
- assertTrue(ASTNode.SINGLE_VARIABLE_DECLARATION == 44);
- assertTrue(ASTNode.STRING_LITERAL == 45);
- assertTrue(ASTNode.SUPER_CONSTRUCTOR_INVOCATION == 46);
- assertTrue(ASTNode.SUPER_FIELD_ACCESS == 47);
- assertTrue(ASTNode.SUPER_METHOD_INVOCATION == 48);
- assertTrue(ASTNode.SWITCH_CASE == 49);
- assertTrue(ASTNode.SWITCH_STATEMENT == 50);
- assertTrue(ASTNode.THIS_EXPRESSION == 52);
- assertTrue(ASTNode.THROW_STATEMENT == 53);
- assertTrue(ASTNode.TRY_STATEMENT == 54);
- assertTrue(ASTNode.TYPE_DECLARATION == 55);
- assertTrue(ASTNode.TYPE_DECLARATION_STATEMENT == 56);
- assertTrue(ASTNode.TYPE_LITERAL == 57);
- assertTrue(ASTNode.VARIABLE_DECLARATION_EXPRESSION == 58);
- assertTrue(ASTNode.VARIABLE_DECLARATION_FRAGMENT == 59);
- assertTrue(ASTNode.VARIABLE_DECLARATION_STATEMENT == 60);
- assertTrue(ASTNode.WHILE_STATEMENT == 61);
- assertTrue(ASTNode.INSTANCEOF_EXPRESSION == 62);
- assertTrue(ASTNode.LINE_COMMENT == 63);
- assertTrue(ASTNode.BLOCK_COMMENT == 64);
- assertTrue(ASTNode.TAG_ELEMENT == 65);
- assertTrue(ASTNode.TEXT_ELEMENT == 66);
- assertTrue(ASTNode.MEMBER_REF == 67);
- assertTrue(ASTNode.FUNCTION_REF == 68);
- assertTrue(ASTNode.FUNCTION_REF_PARAMETER == 69);
- assertTrue(ASTNode.ENHANCED_FOR_STATEMENT == 70);
- assertTrue(ASTNode.QUALIFIED_TYPE == 75);
- assertTrue(ASTNode.MODIFIER == 100);
-
- // ensure that all constants are distinct, positive, and small
- // (this may seem paranoid, but this test did uncover a stupid bug!)
- int[] all= {
- ASTNode.ANONYMOUS_CLASS_DECLARATION,
- ASTNode.ARRAY_ACCESS,
- ASTNode.ARRAY_CREATION,
- ASTNode.ARRAY_INITIALIZER,
- ASTNode.ARRAY_TYPE,
- ASTNode.ASSIGNMENT,
- ASTNode.BLOCK,
- ASTNode.BLOCK_COMMENT,
- ASTNode.BOOLEAN_LITERAL,
- ASTNode.BREAK_STATEMENT,
- ASTNode.CATCH_CLAUSE,
- ASTNode.CHARACTER_LITERAL,
- ASTNode.CLASS_INSTANCE_CREATION,
- ASTNode.JAVASCRIPT_UNIT,
- ASTNode.CONDITIONAL_EXPRESSION,
- ASTNode.CONSTRUCTOR_INVOCATION,
- ASTNode.CONTINUE_STATEMENT,
- ASTNode.DO_STATEMENT,
- ASTNode.EMPTY_STATEMENT,
- ASTNode.ENHANCED_FOR_STATEMENT,
- ASTNode.EXPRESSION_STATEMENT,
- ASTNode.FIELD_ACCESS,
- ASTNode.FIELD_DECLARATION,
- ASTNode.FOR_STATEMENT,
- ASTNode.IF_STATEMENT,
- ASTNode.IMPORT_DECLARATION,
- ASTNode.INFIX_EXPRESSION,
- ASTNode.INSTANCEOF_EXPRESSION,
- ASTNode.INITIALIZER,
- ASTNode.JSDOC,
- ASTNode.LABELED_STATEMENT,
- ASTNode.LINE_COMMENT,
- ASTNode.MEMBER_REF,
- ASTNode.FUNCTION_DECLARATION,
- ASTNode.FUNCTION_INVOCATION,
- ASTNode.FUNCTION_REF,
- ASTNode.FUNCTION_REF_PARAMETER,
- ASTNode.MODIFIER,
- ASTNode.NULL_LITERAL,
- ASTNode.NUMBER_LITERAL,
- ASTNode.PACKAGE_DECLARATION,
- ASTNode.PARENTHESIZED_EXPRESSION,
- ASTNode.POSTFIX_EXPRESSION,
- ASTNode.PREFIX_EXPRESSION,
- ASTNode.PRIMITIVE_TYPE,
- ASTNode.QUALIFIED_NAME,
- ASTNode.QUALIFIED_TYPE,
- ASTNode.RETURN_STATEMENT,
- ASTNode.SIMPLE_NAME,
- ASTNode.SIMPLE_TYPE,
- ASTNode.SINGLE_VARIABLE_DECLARATION,
- ASTNode.STRING_LITERAL,
- ASTNode.SUPER_CONSTRUCTOR_INVOCATION,
- ASTNode.SUPER_FIELD_ACCESS,
- ASTNode.SUPER_METHOD_INVOCATION,
- ASTNode.SWITCH_CASE,
- ASTNode.SWITCH_STATEMENT,
- ASTNode.TAG_ELEMENT,
- ASTNode.TEXT_ELEMENT,
- ASTNode.THIS_EXPRESSION,
- ASTNode.THROW_STATEMENT,
- ASTNode.TRY_STATEMENT,
- ASTNode.TYPE_DECLARATION,
- ASTNode.TYPE_DECLARATION_STATEMENT,
- ASTNode.TYPE_LITERAL,
- ASTNode.VARIABLE_DECLARATION_EXPRESSION,
- ASTNode.VARIABLE_DECLARATION_FRAGMENT,
- ASTNode.VARIABLE_DECLARATION_STATEMENT,
- ASTNode.WHILE_STATEMENT,
- };
- int MIN = 1;
- int MAX = 100;
- Set s = new HashSet();
- for (int i=0; i<all.length; i++) {
- assertTrue(MIN <= all[i] && all[i] <= MAX);
- s.add(new Integer(all[i]));
- }
- assertTrue(s.size() == all.length);
- // ensure that Integers really do compare properly with equals
- assertTrue(new Integer(1).equals(new Integer(1)));
- }
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTVisitorTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTVisitorTest.java
deleted file mode 100644
index 90e2867..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTVisitorTest.java
+++ /dev/null
@@ -1,1951 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BlockComment;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.LineComment;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.QualifiedType;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.TagElement;
-import org.eclipse.wst.jsdt.core.dom.TextElement;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
-import org.eclipse.wst.jsdt.core.dom.TryStatement;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.WhileStatement;
-
-public class ASTVisitorTest extends org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase {
-
- /** @deprecated using deprecated code */
- public static Test suite() {
- // TODO (frederic) use buildList + setAstLevel(init) instead...
- junit.framework.TestSuite suite = new junit.framework.TestSuite(ASTVisitorTest.class.getName());
-
- Class c = ASTVisitorTest.class;
- Method[] methods = c.getMethods();
- for (int i = 0, max = methods.length; i < max; i++) {
- if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$
- suite.addTest(new ASTVisitorTest(methods[i].getName(), AST.JLS2));
- //suite.addTest(new ASTVisitorTest(methods[i].getName(), AST.JLS3));
- }
- }
- return suite;
- }
-
- AST ast;
- SimpleName N1;
- String N1S;
- SimpleName N2;
- String N2S;
- SimpleName N3;
- String N3S;
- SimpleName N4;
- String N4S;
- Expression E1;
- String E1S;
- Expression E2;
- String E2S;
- Type T1;
- String T1S;
- Type T2;
- String T2S;
- String PT1S;
- Statement S1;
- String S1S;
- Statement S2;
- Block B1;
- String B1S;
- String S2S;
- SingleVariableDeclaration V1;
- String V1S;
- SingleVariableDeclaration V2;
- String V2S;
- VariableDeclarationFragment W1;
- String W1S;
- VariableDeclarationFragment W2;
- String W2S;
- FieldDeclaration FD1;
- String FD1S;
- FieldDeclaration FD2;
- String FD2S;
- PackageDeclaration PD1;
- String PD1S;
- ImportDeclaration ID1;
- String ID1S;
- ImportDeclaration ID2;
- String ID2S;
- TypeDeclaration TD1;
- String TD1S;
- TypeDeclaration TD2;
- String TD2S;
- JSdoc JD1;
- String JD1S;
- TagElement TAG1;
- String TAG1S;
- TextElement TEXT1;
- String TEXT1S;
- MemberRef MBREF1;
- String MBREF1S;
- FunctionRef MTHREF1;
- String MTHREF1S;
- FunctionRefParameter MPARM1;
- String MPARM1S;
- LineComment LC1;
- String LC1S;
- BlockComment BC1;
- String BC1S;
- AnonymousClassDeclaration ACD1;
- String ACD1S;
- String TP1S;
- String TP2S;
- String MVP1S;
- String MVP2S;
- Modifier MOD1;
- String MOD1S;
- Modifier MOD2;
- String MOD2S;
- String ANO1S;
- String ANO2S;
- String EC1S;
- String EC2S;
-
- final StringBuffer b = new StringBuffer();
-
- int API_LEVEL;
-
- public ASTVisitorTest(String name, int apiLevel) {
- super(name);
- this.API_LEVEL = apiLevel;
- }
-
- /**
- * @deprecated (not really - just suppressing the warnings
- * that come from testing Javadoc.getComment())
- *
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- ast = AST.newAST(this.API_LEVEL);
- N1 = ast.newSimpleName("N"); //$NON-NLS-1$
- N1S = "[(nSNNnS)]"; //$NON-NLS-1$
- N2 = ast.newSimpleName("M"); //$NON-NLS-1$
- N2S = "[(nSMMnS)]"; //$NON-NLS-1$
- N3 = ast.newSimpleName("O"); //$NON-NLS-1$
- N3S = "[(nSOOnS)]"; //$NON-NLS-1$
- N4 = ast.newSimpleName("P"); //$NON-NLS-1$
- N4S = "[(nSPPnS)]"; //$NON-NLS-1$
- E1 = ast.newSimpleName("X"); //$NON-NLS-1$
- E1S = "[(nSXXnS)]"; //$NON-NLS-1$
- E2 = ast.newSimpleName("Y"); //$NON-NLS-1$
- E2S = "[(nSYYnS)]"; //$NON-NLS-1$
- T1 = ast.newSimpleType(ast.newSimpleName("Z")); //$NON-NLS-1$
- T1S = "[(tS[(nSZZnS)]tS)]"; //$NON-NLS-1$
- T2 = ast.newSimpleType(ast.newSimpleName("X")); //$NON-NLS-1$
- T2S = "[(tS[(nSXXnS)]tS)]"; //$NON-NLS-1$
- S1 = ast.newContinueStatement();
- S1S = "[(sCNsCN)]"; //$NON-NLS-1$
- S2 = ast.newBreakStatement();
- S2S = "[(sBRsBR)]"; //$NON-NLS-1$
- B1 = ast.newBlock();
- B1S = "[(sBsB)]"; //$NON-NLS-1$
- V1 = ast.newSingleVariableDeclaration();
- V1.setType(ast.newPrimitiveType(PrimitiveType.INT));
- V1.setName(ast.newSimpleName("a")); //$NON-NLS-1$
- V1S = "[(VD[(tPintinttP)][(nSaanS)]VD)]"; //$NON-NLS-1$
- V2 = ast.newSingleVariableDeclaration();
- V2.setType(ast.newPrimitiveType(PrimitiveType.BYTE));
- V2.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- V2S = "[(VD[(tPbytebytetP)][(nSbbnS)]VD)]"; //$NON-NLS-1$
- W1 = ast.newVariableDeclarationFragment();
- W1.setName(ast.newSimpleName("a")); //$NON-NLS-1$
- W1S = "[(VS[(nSaanS)]VS)]"; //$NON-NLS-1$
- W2 = ast.newVariableDeclarationFragment();
- W2.setName(ast.newSimpleName("b")); //$NON-NLS-1$
- W2S = "[(VS[(nSbbnS)]VS)]"; //$NON-NLS-1$
- {
- VariableDeclarationFragment temp = ast.newVariableDeclarationFragment();
- temp.setName(ast.newSimpleName("f")); //$NON-NLS-1$
- FD1 = ast.newFieldDeclaration(temp);
- FD1.setType(ast.newPrimitiveType(PrimitiveType.INT));
- FD1S = "[(FD[(tPintinttP)][(VS[(nSffnS)]VS)]FD)]"; //$NON-NLS-1$
- }
- {
- VariableDeclarationFragment temp = ast.newVariableDeclarationFragment();
- temp.setName(ast.newSimpleName("g")); //$NON-NLS-1$
- FD2 = ast.newFieldDeclaration(temp);
- FD2.setType(ast.newPrimitiveType(PrimitiveType.CHAR));
- FD2S = "[(FD[(tPcharchartP)][(VS[(nSggnS)]VS)]FD)]"; //$NON-NLS-1$
- }
- PD1 = ast.newPackageDeclaration();
- PD1.setName(ast.newSimpleName("p")); //$NON-NLS-1$
- PD1S = "[(PD[(nSppnS)]PD)]"; //$NON-NLS-1$
- ID1 = ast.newImportDeclaration();
- ID1.setName(ast.newSimpleName("i")); //$NON-NLS-1$
- ID1S = "[(ID[(nSiinS)]ID)]"; //$NON-NLS-1$
- ID2 = ast.newImportDeclaration();
- ID2.setName(ast.newSimpleName("j")); //$NON-NLS-1$
- ID2S = "[(ID[(nSjjnS)]ID)]"; //$NON-NLS-1$
- TD1 = ast.newTypeDeclaration();
- TD1.setName(ast.newSimpleName("c")); //$NON-NLS-1$
- TD1S = "[(TD[(nSccnS)]TD)]"; //$NON-NLS-1$
- TD2 = ast.newTypeDeclaration();
- TD2.setName(ast.newSimpleName("d")); //$NON-NLS-1$
- TD2S = "[(TD[(nSddnS)]TD)]"; //$NON-NLS-1$
-
- ACD1 = ast.newAnonymousClassDeclaration();
- ACD1S = "[(ACDACD)]"; //$NON-NLS-1$
-
- JD1 = ast.newJSdoc();
- JD1S = "[(JDJD)]"; //$NON-NLS-1$
-
- LC1 = ast.newLineComment();
- LC1S = "[(//*//)]"; //$NON-NLS-1$
-
- BC1 = ast.newBlockComment();
- BC1S = "[(/**/)]"; //$NON-NLS-1$
-
- TAG1 = ast.newTagElement();
- TAG1.setTagName("@foo"); //$NON-NLS-1$
- TAG1S = "[(TG@foo@fooTG)]"; //$NON-NLS-1$
-
- TEXT1 = ast.newTextElement();
- TEXT1.setText("foo"); //$NON-NLS-1$
- TEXT1S = "[(TXfoofooTX)]"; //$NON-NLS-1$
-
- MBREF1 = ast.newMemberRef();
- MBREF1.setName(ast.newSimpleName("p")); //$NON-NLS-1$
- MBREF1S = "[(MBREF[(nSppnS)]MBREF)]"; //$NON-NLS-1$
-
- MTHREF1 = ast.newFunctionRef();
- MTHREF1.setName(ast.newSimpleName("p")); //$NON-NLS-1$
- MTHREF1S = "[(MTHREF[(nSppnS)]MTHREF)]"; //$NON-NLS-1$
-
- MPARM1 = ast.newFunctionRefParameter();
- MPARM1.setType(ast.newPrimitiveType(PrimitiveType.CHAR));
- MPARM1S = "[(MPARM[(tPcharchartP)]MPARM)]"; //$NON-NLS-1$
-
- if (ast.apiLevel() >= AST.JLS3) {
- PT1S = "[(tM[(tS[(nSZZnS)]tS)]tM)]"; //$NON-NLS-1$
-
- TP1S = "[(tTP[(nSxxnS)]tTP)]"; //$NON-NLS-1$
-
- TP2S = "[(tTP[(nSyynS)]tTP)]"; //$NON-NLS-1$
-
-
- MOD1 = ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
- MOD1S = "[(MODpublicpublicMOD)]"; //$NON-NLS-1$
- MOD2 = ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD);
- MOD2S = "[(MODfinalfinalMOD)]"; //$NON-NLS-1$
-
- }
-
- }
-
- protected void tearDown() throws Exception {
- ast = null;
- super.tearDown();
- }
-
- /** @deprecated using deprecated code */
- public String getName() {
- String name = super.getName();
- switch (this.API_LEVEL) {
- case AST.JLS2:
- name = "JLS2 - " + name;
- break;
- case AST.JLS3:
- name = "JLS3 - " + name;
- break;
- }
- return name;
- }
-
- class TestVisitor extends ASTVisitor {
-
- boolean visitTheKids = true;
-
- boolean visitDocTags;
-
- TestVisitor() {
- this(false);
- }
-
- TestVisitor(boolean visitDocTags) {
- super(visitDocTags);
- this.visitDocTags = visitDocTags;
- }
-
- public boolean isVisitingChildren() {
- return visitTheKids;
- }
-
- public void setVisitingChildren(boolean visitChildren) {
- visitTheKids = visitChildren;
- }
-
- // NAMES
-
- public boolean visit(SimpleName node) {
- b.append("(nS"); //$NON-NLS-1$
- b.append(node.getIdentifier());
- return isVisitingChildren();
- }
- public void endVisit(SimpleName node) {
- b.append(node.getIdentifier());
- b.append("nS)"); //$NON-NLS-1$
- }
- public boolean visit(QualifiedName node) {
- b.append("(nQ"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(QualifiedName node) {
- b.append("nQ)"); //$NON-NLS-1$
- }
-
- // TYPES
-
- public boolean visit(SimpleType node) {
- b.append("(tS"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(SimpleType node) {
- b.append("tS)"); //$NON-NLS-1$
- }
- public boolean visit(ArrayType node) {
- b.append("(tA"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ArrayType node) {
- b.append("tA)"); //$NON-NLS-1$
- }
- public boolean visit(PrimitiveType node) {
- b.append("(tP"); //$NON-NLS-1$
- b.append(node.getPrimitiveTypeCode().toString());
- return isVisitingChildren();
- }
- public void endVisit(PrimitiveType node) {
- b.append(node.getPrimitiveTypeCode().toString());
- b.append("tP)"); //$NON-NLS-1$
- }
- public boolean visit(QualifiedType node) {
- b.append("(tQ"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(QualifiedType node) {
- b.append("tQ)"); //$NON-NLS-1$
- }
-
- // EXPRESSIONS and STATEMENTS
-
-
- public boolean visit(ArrayAccess node) {
- b.append("(eAA"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ArrayAccess node) {
- b.append("eAA)"); //$NON-NLS-1$
- }
-
- public boolean visit(ArrayCreation node) {
- b.append("(eAC"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ArrayCreation node) {
- b.append("eAC)"); //$NON-NLS-1$
- }
-
- public boolean visit(ArrayInitializer node) {
- b.append("(eAI"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ArrayInitializer node) {
- b.append("eAI)"); //$NON-NLS-1$
- }
-
- public boolean visit(Assignment node) {
- b.append("("); //$NON-NLS-1$
- b.append(node.getOperator().toString());
- return isVisitingChildren();
- }
- public void endVisit(Assignment node) {
- b.append(node.getOperator().toString());
- b.append(")"); //$NON-NLS-1$
- }
-
- public boolean visit(Block node) {
- b.append("(sB"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(Block node) {
- b.append("sB)"); //$NON-NLS-1$
- }
-
- public boolean visit(BooleanLiteral node) {
- b.append("(eBL"); //$NON-NLS-1$
- b.append(node.booleanValue() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- return isVisitingChildren();
- }
- public void endVisit(BooleanLiteral node) {
- b.append(node.booleanValue() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- b.append("eBL)"); //$NON-NLS-1$
- }
-
- public boolean visit(BreakStatement node) {
- b.append("(sBR"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(BreakStatement node) {
- b.append("sBR)"); //$NON-NLS-1$
- }
-
- public boolean visit(CatchClause node) {
- b.append("(cc"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(CatchClause node) {
- b.append("cc)"); //$NON-NLS-1$
- }
-
- public boolean visit(CharacterLiteral node) {
- b.append("(eCL"); //$NON-NLS-1$
- b.append(node.getEscapedValue());
- return isVisitingChildren();
- }
- public void endVisit(CharacterLiteral node) {
- b.append(node.getEscapedValue());
- b.append("eCL)"); //$NON-NLS-1$
- }
-
- public boolean visit(ClassInstanceCreation node) {
- b.append("(eCI"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ClassInstanceCreation node) {
- b.append("eCI)"); //$NON-NLS-1$
- }
-
- public boolean visit(AnonymousClassDeclaration node) {
- b.append("(ACD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(AnonymousClassDeclaration node) {
- b.append("ACD)"); //$NON-NLS-1$
- }
-
- public boolean visit(JavaScriptUnit node) {
- b.append("(CU"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(JavaScriptUnit node) {
- b.append("CU)"); //$NON-NLS-1$
- }
-
- public boolean visit(ConditionalExpression node) {
- b.append("(eCO"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ConditionalExpression node) {
- b.append("eCO)"); //$NON-NLS-1$
- }
-
- public boolean visit(ConstructorInvocation node) {
- b.append("(sCI"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ConstructorInvocation node) {
- b.append("sCI)"); //$NON-NLS-1$
- }
-
- public boolean visit(ContinueStatement node) {
- b.append("(sCN"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ContinueStatement node) {
- b.append("sCN)"); //$NON-NLS-1$
- }
-
- public boolean visit(DoStatement node) {
- b.append("(sDO"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(DoStatement node) {
- b.append("sDO)"); //$NON-NLS-1$
- }
-
- public boolean visit(EmptyStatement node) {
- b.append("(sEM"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(EmptyStatement node) {
- b.append("sEM)"); //$NON-NLS-1$
- }
-
- public boolean visit(EnhancedForStatement node) {
- b.append("(sEFR"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(EnhancedForStatement node) {
- b.append("sEFR)"); //$NON-NLS-1$
- }
-
- public boolean visit(ExpressionStatement node) {
- b.append("(sEX"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ExpressionStatement node) {
- b.append("sEX)"); //$NON-NLS-1$
- }
-
- public boolean visit(FieldAccess node) {
- b.append("(eFA"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(FieldAccess node) {
- b.append("eFA)"); //$NON-NLS-1$
- }
-
- public boolean visit(FieldDeclaration node) {
- b.append("(FD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(FieldDeclaration node) {
- b.append("FD)"); //$NON-NLS-1$
- }
-
- public boolean visit(ForStatement node) {
- b.append("(sFR"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ForStatement node) {
- b.append("sFR)"); //$NON-NLS-1$
- }
-
- public boolean visit(IfStatement node) {
- b.append("(sIF"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(IfStatement node) {
- b.append("sIF)"); //$NON-NLS-1$
- }
-
- public boolean visit(ImportDeclaration node) {
- b.append("(ID"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ImportDeclaration node) {
- b.append("ID)"); //$NON-NLS-1$
- }
-
- public boolean visit(InfixExpression node) {
- b.append("(eIN"); //$NON-NLS-1$
- b.append(node.getOperator().toString());
- return isVisitingChildren();
- }
- public void endVisit(InfixExpression node) {
- b.append(node.getOperator().toString());
- b.append("eIN)"); //$NON-NLS-1$
- }
-
- public boolean visit(InstanceofExpression node) {
- b.append("(eIO"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(InstanceofExpression node) {
- b.append("eIO)"); //$NON-NLS-1$
- }
-
- public boolean visit(Initializer node) {
- b.append("(IN"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(Initializer node) {
- b.append("IN)"); //$NON-NLS-1$
- }
-
- /**
- * @deprecated (not really - just suppressing the warnings
- * that come from testing Javadoc.getComment())
- *
- */
- public boolean visit(JSdoc node) {
- b.append("(JD"); //$NON-NLS-1$
-
- // verify that children of Javadoc nodes are visited only if requested
- if (visitDocTags) {
- assertTrue(super.visit(node) == true);
- } else {
- assertTrue(super.visit(node) == false);
- }
- return isVisitingChildren() && super.visit(node);
- }
-
- /**
- * @deprecated (not really - just suppressing the warnings
- * that come from testing Javadoc.getComment())
- *
- */
- public void endVisit(JSdoc node) {
- b.append("JD)"); //$NON-NLS-1$
- }
-
- public boolean visit(BlockComment node) {
- b.append("(/*"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(BlockComment node) {
- b.append("*/)"); //$NON-NLS-1$
- }
-
- public boolean visit(LineComment node) {
- b.append("(//"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(LineComment node) {
- b.append("//)"); //$NON-NLS-1$
- }
-
- public boolean visit(TagElement node) {
- b.append("(TG"); //$NON-NLS-1$
- b.append(node.getTagName());
- return isVisitingChildren();
- }
- public void endVisit(TagElement node) {
- b.append(node.getTagName());
- b.append("TG)"); //$NON-NLS-1$
- }
-
- public boolean visit(TextElement node) {
- b.append("(TX"); //$NON-NLS-1$
- b.append(node.getText());
- return isVisitingChildren();
- }
- public void endVisit(TextElement node) {
- b.append(node.getText());
- b.append("TX)"); //$NON-NLS-1$
- }
-
- public boolean visit(MemberRef node) {
- b.append("(MBREF"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(MemberRef node) {
- b.append("MBREF)"); //$NON-NLS-1$
- }
-
- public boolean visit(FunctionRef node) {
- b.append("(MTHREF"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(FunctionRef node) {
- b.append("MTHREF)"); //$NON-NLS-1$
- }
-
- public boolean visit(FunctionRefParameter node) {
- b.append("(MPARM"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(FunctionRefParameter node) {
- b.append("MPARM)"); //$NON-NLS-1$
- }
-
- public boolean visit(LabeledStatement node) {
- b.append("(sLA"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(LabeledStatement node) {
- b.append("sLA)"); //$NON-NLS-1$
- }
-
- public boolean visit(FunctionDeclaration node) {
- b.append("(MD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(FunctionDeclaration node) {
- b.append("MD)"); //$NON-NLS-1$
- }
-
- public boolean visit(FunctionInvocation node) {
- b.append("(eMI"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(FunctionInvocation node) {
- b.append("eMI)"); //$NON-NLS-1$
- }
-
- public boolean visit(NullLiteral node) {
- b.append("(eNL"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(NullLiteral node) {
- b.append("eNL)"); //$NON-NLS-1$
- }
-
- public boolean visit(NumberLiteral node) {
- b.append("(eNU"); //$NON-NLS-1$
- b.append(node.getToken());
- return isVisitingChildren();
- }
- public void endVisit(NumberLiteral node) {
- b.append(node.getToken());
- b.append("eNU)"); //$NON-NLS-1$
- }
-
- public boolean visit(PackageDeclaration node) {
- b.append("(PD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(PackageDeclaration node) {
- b.append("PD)"); //$NON-NLS-1$
- }
-
- public boolean visit(ParenthesizedExpression node) {
- b.append("(ePA"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ParenthesizedExpression node) {
- b.append("ePA)"); //$NON-NLS-1$
- }
-
- public boolean visit(PostfixExpression node) {
- b.append("(ePO"); //$NON-NLS-1$
- b.append(node.getOperator().toString());
- return isVisitingChildren();
- }
- public void endVisit(PostfixExpression node) {
- b.append(node.getOperator().toString());
- b.append("ePO)"); //$NON-NLS-1$
- }
-
- public boolean visit(PrefixExpression node) {
- b.append("(ePR"); //$NON-NLS-1$
- b.append(node.getOperator().toString());
- return isVisitingChildren();
- }
- public void endVisit(PrefixExpression node) {
- b.append(node.getOperator().toString());
- b.append("ePR)"); //$NON-NLS-1$
- }
-
- public boolean visit(ReturnStatement node) {
- b.append("(sRT"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ReturnStatement node) {
- b.append("sRT)"); //$NON-NLS-1$
- }
-
- public boolean visit(SingleVariableDeclaration node) {
- b.append("(VD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(SingleVariableDeclaration node) {
- b.append("VD)"); //$NON-NLS-1$
- }
-
- public boolean visit(StringLiteral node) {
- b.append("(eSL"); //$NON-NLS-1$
- b.append(node.getLiteralValue());
- return isVisitingChildren();
- }
- public void endVisit(StringLiteral node) {
- b.append(node.getLiteralValue());
- b.append("eSL)"); //$NON-NLS-1$
- }
-
- public boolean visit(SuperConstructorInvocation node) {
- b.append("(sSC"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(SuperConstructorInvocation node) {
- b.append("sSC)"); //$NON-NLS-1$
- }
-
- public boolean visit(SuperFieldAccess node) {
- b.append("(eSF"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(SuperFieldAccess node) {
- b.append("eSF)"); //$NON-NLS-1$
- }
-
- public boolean visit(SuperMethodInvocation node) {
- b.append("(eSM"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(SuperMethodInvocation node) {
- b.append("eSM)"); //$NON-NLS-1$
- }
-
- public boolean visit(SwitchCase node) {
- b.append("(sSC"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(SwitchCase node) {
- b.append("sSC)"); //$NON-NLS-1$
- }
-
- public boolean visit(SwitchStatement node) {
- b.append("(sSW"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(SwitchStatement node) {
- b.append("sSW)"); //$NON-NLS-1$
- }
-
- public boolean visit(ThisExpression node) {
- b.append("(eTH"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ThisExpression node) {
- b.append("eTH)"); //$NON-NLS-1$
- }
-
- public boolean visit(ThrowStatement node) {
- b.append("(sTR"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(ThrowStatement node) {
- b.append("sTR)"); //$NON-NLS-1$
- }
-
- public boolean visit(TryStatement node) {
- b.append("(sTY"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(TryStatement node) {
- b.append("sTY)"); //$NON-NLS-1$
- }
-
- public boolean visit(TypeDeclaration node) {
- b.append("(TD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(TypeDeclaration node) {
- b.append("TD)"); //$NON-NLS-1$
- }
-
- public boolean visit(TypeDeclarationStatement node) {
- b.append("(sTD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(TypeDeclarationStatement node) {
- b.append("sTD)"); //$NON-NLS-1$
- }
-
- public boolean visit(TypeLiteral node) {
- b.append("(eTL"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(TypeLiteral node) {
- b.append("eTL)"); //$NON-NLS-1$
- }
-
- public boolean visit(VariableDeclarationExpression node) {
- b.append("(eVD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(VariableDeclarationExpression node) {
- b.append("eVD)"); //$NON-NLS-1$
- }
-
- public boolean visit(VariableDeclarationFragment node) {
- b.append("(VS"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(VariableDeclarationFragment node) {
- b.append("VS)"); //$NON-NLS-1$
- }
-
- public boolean visit(VariableDeclarationStatement node) {
- b.append("(sVD"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(VariableDeclarationStatement node) {
- b.append("sVD)"); //$NON-NLS-1$
- }
-
- public boolean visit(WhileStatement node) {
- b.append("(sWH"); //$NON-NLS-1$
- return isVisitingChildren();
- }
- public void endVisit(WhileStatement node) {
- b.append("sWH)"); //$NON-NLS-1$
- }
-
-
- public boolean visit(Modifier node) {
- b.append("(MOD"); //$NON-NLS-1$
- b.append(node.getKeyword().toString());
- return isVisitingChildren();
- }
- public void endVisit(Modifier node) {
- b.append(node.getKeyword().toString());
- b.append("MOD)"); //$NON-NLS-1$
- }
-
- public void preVisit(ASTNode node) {
- b.append("["); //$NON-NLS-1$
- }
-
- public void postVisit(ASTNode node) {
- b.append("]"); //$NON-NLS-1$
- }
-
- }
- // NAMES
- public void testSimpleName() {
- Name x1 = ast.newName(new String[]{"Z"}); //$NON-NLS-1$
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(nSZZnS)]".equals(result)); //$NON-NLS-1$
- }
-
- public void testQualifiedName() {
- Name x1 = ast.newName(new String[]{"X", "Y"}); //$NON-NLS-1$ //$NON-NLS-2$
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(nQ[(nSXXnS)][(nSYYnS)]nQ)]".equals(result)); //$NON-NLS-1$
- }
-
-
- // TYPES
- public void testPrimitiveType() {
- Type x1 = ast.newPrimitiveType(PrimitiveType.CHAR);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(tPcharchartP)]".equals(result)); //$NON-NLS-1$
- }
-
- public void testSimpleType() {
- Type x1 = ast.newSimpleType(ast.newName(new String[]{"Z"})); //$NON-NLS-1$
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(tS[(nSZZnS)]tS)]".equals(result)); //$NON-NLS-1$
- }
-
- public void testArrayType() {
- Type x0 = ast.newPrimitiveType(PrimitiveType.CHAR);
- Type x1 = ast.newArrayType(x0);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(tA[(tPcharchartP)]tA)]".equals(result)); //$NON-NLS-1$
- }
-
- /** @deprecated using deprecated code */
- public void testQualifiedType() {
- if (ast.apiLevel() == AST.JLS2) {
- return;
- }
- QualifiedType x1 = ast.newQualifiedType(T1, N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(tQ"+T1S+N1S+"tQ)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // EXPRESSIONS and STATEMENTS
-
- public void testArrayAccess() {
- ArrayAccess x1 = ast.newArrayAccess();
- x1.setArray(E1);
- x1.setIndex(E2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eAA"+E1S+E2S+"eAA)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testArrayCreation() {
- ArrayCreation x1 = ast.newArrayCreation();
- x1.setType(ast.newArrayType(T1));
- x1.dimensions().add(E1);
- x1.dimensions().add(E2);
- x1.setInitializer(ast.newArrayInitializer());
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eAC"+"[(tA"+T1S+"tA)]"+E1S+E2S+"[(eAIeAI)]eAC)]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- public void testArrayInitializer() {
- ArrayInitializer x1 = ast.newArrayInitializer();
- x1.expressions().add(E1);
- x1.expressions().add(E2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eAI"+E1S+E2S+"eAI)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testAssignment() {
- Assignment x1 = ast.newAssignment();
- x1.setLeftHandSide(E1);
- x1.setRightHandSide(E2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(="+E1S+E2S+"=)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testBlock() {
- Block x1 = ast.newBlock();
- x1.statements().add(S1);
- x1.statements().add(S2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sB"+S1S+S2S+"sB)]")); //$NON-NLS-1$ //$NON-NLS-2$
-
- // check that visiting children can be cut off
- v1.setVisitingChildren(false);
- b.setLength(0);
- x1.accept(v1);
- result = b.toString();
- assertTrue(result.equals("[(sBsB)]")); //$NON-NLS-1$
- }
-
- public void testBlockComment() {
- BlockComment x1 = ast.newBlockComment();
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(/**/)]".equals(result)); //$NON-NLS-1$
- }
-
- public void testBooleanLiteral() {
- BooleanLiteral x1 = ast.newBooleanLiteral(true);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eBLtruetrueeBL)]")); //$NON-NLS-1$
- }
- public void testBreakStatement() {
- BreakStatement x1 = ast.newBreakStatement();
- x1.setLabel(N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sBR"+N1S+"sBR)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testCatchClause() {
- CatchClause x1 = ast.newCatchClause();
- x1.setException(V1);
- x1.setBody(B1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(cc"+V1S+B1S+"cc)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testCharacterLiteral() {
- CharacterLiteral x1 = ast.newCharacterLiteral();
- x1.setCharValue('q');
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eCL'q''q'eCL)]")); //$NON-NLS-1$
- }
- /** @deprecated using deprecated code */
- public void testClassInstanceCreation() {
- ClassInstanceCreation x1 = ast.newClassInstanceCreation();
- x1.setExpression(E1);
- if (ast.apiLevel() == AST.JLS2) {
- x1.setName(N1);
- } else {
- x1.setType(T1);
- }
- x1.setAnonymousClassDeclaration(ACD1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(eCI"+E1S+N1S+ACD1S+"eCI)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(eCI"+E1S+PT1S+T1S+ACD1S+"eCI)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void testAnonymousClassDeclaration() {
- AnonymousClassDeclaration x1 = ast.newAnonymousClassDeclaration();
- x1.bodyDeclarations().add(FD1);
- x1.bodyDeclarations().add(FD2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(ACD"+FD1S+FD2S+"ACD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testCompilationUnit() {
- JavaScriptUnit x1 = ast.newJavaScriptUnit();
- x1.setPackage(PD1);
- x1.imports().add(ID1);
- x1.imports().add(ID2);
- x1.types().add(TD1);
- x1.types().add(TD2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(CU"+PD1S+ID1S+ID2S+TD1S+TD2S+"CU)]")); //$NON-NLS-1$ //$NON-NLS-2$
-
- // check that visiting children can be cut off
- v1.setVisitingChildren(false);
- b.setLength(0);
- x1.accept(v1);
- result = b.toString();
- assertTrue(result.equals("[(CUCU)]")); //$NON-NLS-1$
- }
- public void testConditionalExpression() {
- ConditionalExpression x1 = ast.newConditionalExpression();
- x1.setExpression(E1);
- x1.setThenExpression(E2);
- x1.setElseExpression(N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eCO"+E1S+E2S+N1S+"eCO)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /** @deprecated using deprecated code */
- public void testConstructorInvocation() {
- ConstructorInvocation x1 = ast.newConstructorInvocation();
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(sCI"+E1S+E2S+"sCI)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(sCI"+PT1S+E1S+E2S+"sCI)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void testContinueStatement() {
- ContinueStatement x1 = ast.newContinueStatement();
- x1.setLabel(N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sCN"+N1S+"sCN)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testDoStatement() {
- DoStatement x1 = ast.newDoStatement();
- x1.setExpression(E1);
- x1.setBody(S1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sDO"+S1S+E1S+"sDO)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testEmptyStatement() {
- EmptyStatement x1 = ast.newEmptyStatement();
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sEMsEM)]")); //$NON-NLS-1$
- }
- public void testExpressionStatement() {
- ExpressionStatement x1 = ast.newExpressionStatement(E1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sEX"+E1S+"sEX)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testFieldAccess() {
- FieldAccess x1 = ast.newFieldAccess();
- x1.setExpression(E1);
- x1.setName(N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eFA"+E1S+N1S+"eFA)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /** @deprecated using deprecated code */
- public void testFieldDeclaration() {
- FieldDeclaration x1 = ast.newFieldDeclaration(W1);
- x1.setJavadoc(JD1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.fragments().add(W2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(FD"+JD1S+T1S+W1S+W2S+"FD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(FD"+JD1S+MOD1S+MOD2S+T1S+W1S+W2S+"FD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void testForStatement() {
- ForStatement x1 = ast.newForStatement();
- x1.initializers().add(E1);
- x1.initializers().add(E2);
- x1.setExpression(N1);
- x1.updaters().add(N2);
- x1.updaters().add(N3);
- x1.setBody(S1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sFR"+E1S+E2S+N1S+N2S+N3S+S1S+"sFR)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /** @deprecated using deprecated code */
- public void testEnhancedForStatement() {
- if (ast.apiLevel() == AST.JLS2) {
- return;
- }
- EnhancedForStatement x1 = ast.newEnhancedForStatement();
- x1.setParameter(V1);
- x1.setExpression(E1);
- x1.setBody(S1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sEFR"+V1S+E1S+S1S+"sEFR)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testIfStatement() {
- IfStatement x1 = ast.newIfStatement();
- x1.setExpression(E1);
- x1.setThenStatement(S1);
- x1.setElseStatement(S2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sIF"+E1S+S1S+S2S+"sIF)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testImportDeclaration() {
- ImportDeclaration x1 = ast.newImportDeclaration();
- x1.setName(N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(ID"+N1S+"ID)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testInfixExpression() {
- InfixExpression x1 = ast.newInfixExpression();
- x1.setOperator(InfixExpression.Operator.PLUS);
- x1.setLeftOperand(E1);
- x1.setRightOperand(E2);
- x1.extendedOperands().add(N1);
- x1.extendedOperands().add(N2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eIN+"+E1S+E2S+N1S+N2S+"+eIN)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testInstanceofExpression() {
- InstanceofExpression x1 = ast.newInstanceofExpression();
- x1.setLeftOperand(E1);
- x1.setRightOperand(T1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eIO"+E1S+T1S+"eIO)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /** @deprecated using deprecated code */
- public void testInitializer() {
- Initializer x1 = ast.newInitializer();
- x1.setJavadoc(JD1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setBody(B1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(IN"+JD1S+B1S+"IN)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(IN"+JD1S+MOD1S+MOD2S+B1S+"IN)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @deprecated (not really - just suppressing the warnings
- * that come from testing Javadoc.getComment())
- *
- */
- public void testJavadoc() {
- JSdoc x1 = ast.newJSdoc();
- x1.tags().add(TAG1);
-
- // ASTVisitor() does not visit doc tags
- {
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(("[(JDJD)]").equals(result)); //$NON-NLS-1$
- }
-
- // ASTVisitor(false) does not visit doc tags
- {
- TestVisitor v1 = new TestVisitor(false);
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(("[(JDJD)]").equals(result)); //$NON-NLS-1$
- }
-
- // ASTVisitor(true) does visit doc tags
- {
- TestVisitor v1 = new TestVisitor(true);
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(("[(JD"+TAG1S+"JD)]").equals(result)); //$NON-NLS-1$
- }
- }
-
- public void testLabeledStatement() {
- LabeledStatement x1 = ast.newLabeledStatement();
- x1.setLabel(N1);
- x1.setBody(S1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sLA"+N1S+S1S+"sLA)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testLineComment() {
- LineComment x1 = ast.newLineComment();
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(////)]".equals(result)); //$NON-NLS-1$
- }
-
- public void testMemberRef() {
- MemberRef x1 = ast.newMemberRef();
- x1.setQualifier(N1);
- x1.setName(N2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(MBREF"+N1S+N2S+"MBREF)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /** @deprecated using deprecated code */
- public void testMethodDeclaration() {
- FunctionDeclaration x1 = ast.newFunctionDeclaration();
- x1.setJavadoc(JD1);
- if (ast.apiLevel() == AST.JLS2) {
- x1.setReturnType(T1);
- } else {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- x1.setReturnType2(T1);
- }
- x1.setName(N1);
- x1.parameters().add(V1);
- x1.parameters().add(V2);
- x1.thrownExceptions().add(N2);
- x1.thrownExceptions().add(N3);
- x1.setBody(B1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(MD"+JD1S+T1S+N1S+V1S+V2S+N2S+N3S+B1S+"MD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(MD"+JD1S+MOD1S+MOD2S+TP1S+T1S+N1S+V1S+V2S+N2S+N3S+B1S+"MD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- /** @deprecated using deprecated code */
- public void testMethodInvocation() {
- FunctionInvocation x1 = ast.newFunctionInvocation();
- x1.setExpression(N1);
- x1.setName(N2);
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(eMI"+N1S+N2S+E1S+E2S+"eMI)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(eMI"+N1S+PT1S+N2S+E1S+E2S+"eMI)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public void testMethodRef() {
- FunctionRef x1 = ast.newFunctionRef();
- x1.setQualifier(N1);
- x1.setName(N2);
- x1.parameters().add(MPARM1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(MTHREF"+N1S+N2S+MPARM1S+"MTHREF)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testMethodRefParameter() {
- FunctionRefParameter x1 = ast.newFunctionRefParameter();
- x1.setType(T1);
- x1.setName(N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(MPARM"+T1S+N1S+"MPARM)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /** @deprecated using deprecated code */
- public void testModifier() {
- if (ast.apiLevel() == AST.JLS2) {
- return;
- }
- Modifier x1 = ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(MODprivateprivateMOD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testNullLiteral() {
- NullLiteral x1 = ast.newNullLiteral();
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eNLeNL)]")); //$NON-NLS-1$
- }
- public void testNumberLiteral() {
- NumberLiteral x1 = ast.newNumberLiteral("1.0"); //$NON-NLS-1$
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eNU1.01.0eNU)]")); //$NON-NLS-1$
- }
- public void testParenthesizedExpression() {
- ParenthesizedExpression x1 = ast.newParenthesizedExpression();
- x1.setExpression(E1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(ePA"+E1S+"ePA)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testPostfixExpression() {
- PostfixExpression x1 = ast.newPostfixExpression();
- x1.setOperand(E1);
- x1.setOperator(PostfixExpression.Operator.INCREMENT);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(ePO++"+E1S+"++ePO)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testPrefixExpression() {
- PrefixExpression x1 = ast.newPrefixExpression();
- x1.setOperand(E1);
- x1.setOperator(PrefixExpression.Operator.INCREMENT);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(ePR++"+E1S+"++ePR)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testReturnStatement() {
- ReturnStatement x1 = ast.newReturnStatement();
- x1.setExpression(E1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sRT"+E1S+"sRT)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testStringLiteral() {
- StringLiteral x1 = ast.newStringLiteral();
- x1.setLiteralValue("H"); //$NON-NLS-1$
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eSLHHeSL)]")); //$NON-NLS-1$
- }
- /** @deprecated using deprecated code */
- public void testSuperConstructorInvocation() {
- SuperConstructorInvocation x1 = ast.newSuperConstructorInvocation();
- x1.setExpression(N1);
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(sSC"+N1S+E1S+E2S+"sSC)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(sSC"+N1S+PT1S+E1S+E2S+"sSC)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void testSuperFieldAccess() {
- SuperFieldAccess x1 = ast.newSuperFieldAccess();
- x1.setQualifier(N1);
- x1.setName(N2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eSF"+N1S+N2S+"eSF)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /** @deprecated using deprecated code */
- public void testSuperMethodInvocation() {
- SuperMethodInvocation x1 = ast.newSuperMethodInvocation();
- x1.setQualifier(N1);
- x1.setName(N2);
- x1.arguments().add(E1);
- x1.arguments().add(E2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(eSM"+N1S+N2S+E1S+E2S+"eSM)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(eSM"+N1S+PT1S+N2S+E1S+E2S+"eSM)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void testSwitchCase() {
- SwitchCase x1 = ast.newSwitchCase();
- x1.setExpression(E1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sSC"+E1S+"sSC)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testSwitchStatement() {
- SwitchStatement x1 = ast.newSwitchStatement();
- x1.setExpression(E1);
- x1.statements().add(S1);
- x1.statements().add(S2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sSW"+E1S+S1S+S2S+"sSW)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testTagElement() {
- TagElement x1 = ast.newTagElement();
- x1.setTagName("x"); //$NON-NLS-1$
- x1.fragments().add(TAG1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(("[(TGx"+TAG1S+"xTG)]").equals(result)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testTextElement() {
- TextElement x1 = ast.newTextElement();
- x1.setText("x"); //$NON-NLS-1$
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue("[(TXxxTX)]".equals(result)); //$NON-NLS-1$
- }
-
- public void testThisExpression() {
- ThisExpression x1 = ast.newThisExpression();
- x1.setQualifier(N1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eTH"+N1S+"eTH)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testThrowStatement() {
- ThrowStatement x1 = ast.newThrowStatement();
- x1.setExpression(E1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sTR"+E1S+"sTR)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testTryStatement() {
- TryStatement x1 = ast.newTryStatement();
- x1.setBody(B1);
- CatchClause c1 = ast.newCatchClause();
- c1.setException(V1);
- c1.setBody(ast.newBlock());
- x1.catchClauses().add(c1);
- CatchClause c2 = ast.newCatchClause();
- c2.setException(V2);
- c2.setBody(ast.newBlock());
- x1.catchClauses().add(c2);
- x1.setFinally(ast.newBlock());
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sTY"+B1S+"[(cc"+V1S+"[(sBsB)]"+"cc)]"+"[(cc"+V2S+"[(sBsB)]"+"cc)]"+"[(sBsB)]"+"sTY)]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- }
- /** @deprecated using deprecated code */
- public void testTypeDeclaration() {
- TypeDeclaration x1 = ast.newTypeDeclaration();
- x1.setJavadoc(JD1);
- x1.setName(N1);
- if (ast.apiLevel() == AST.JLS2) {
- x1.setSuperclass(N2);
- } else {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.bodyDeclarations().add(FD1);
- x1.bodyDeclarations().add(FD2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(TD"+JD1S+N1S+N2S+FD1S+FD2S+"TD)]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else {
- assertTrue(result.equals("[(TD"+JD1S+MOD1S+MOD2S+N1S+TP1S+PT1S+T1S+T2S+FD1S+FD2S+"TD)]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- public void testTypeDeclarationStatement() {
- TypeDeclarationStatement x1 = ast.newTypeDeclarationStatement(TD1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sTD"+TD1S+"sTD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testTypeLiteral() {
- TypeLiteral x1 = ast.newTypeLiteral();
- x1.setType(T1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(eTL"+T1S+"eTL)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /** @deprecated using deprecated code */
- public void testSingleVariableDeclaration() {
- SingleVariableDeclaration x1 = ast.newSingleVariableDeclaration();
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.setName(N1);
- x1.setInitializer(E1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(VD"+T1S+N1S+E1S+"VD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(VD"+MOD1S+MOD2S+T1S+N1S+E1S+"VD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void testVariableDeclarationFragment() {
- VariableDeclarationFragment x1 = ast.newVariableDeclarationFragment();
- x1.setName(N1);
- x1.setInitializer(E1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(VS"+N1S+E1S+"VS)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- /** @deprecated using deprecated code */
- public void testVariableDeclarationExpression() {
- VariableDeclarationExpression x1 = ast.newVariableDeclarationExpression(W1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.fragments().add(W2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(eVD"+T1S+W1S+W2S+"eVD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(eVD"+MOD1S+MOD2S+T1S+W1S+W2S+"eVD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- /** @deprecated using deprecated code */
- public void testVariableDeclarationStatement() {
- VariableDeclarationStatement x1 = ast.newVariableDeclarationStatement(W1);
- if (ast.apiLevel() >= AST.JLS3) {
- x1.modifiers().add(MOD1);
- x1.modifiers().add(MOD2);
- }
- x1.setType(T1);
- x1.fragments().add(W2);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- if (ast.apiLevel() == AST.JLS2) {
- assertTrue(result.equals("[(sVD"+T1S+W1S+W2S+"sVD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- assertTrue(result.equals("[(sVD"+MOD1S+MOD2S+T1S+W1S+W2S+"sVD)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void testWhileStatement() {
- WhileStatement x1 = ast.newWhileStatement();
- x1.setExpression(E1);
- x1.setBody(S1);
- TestVisitor v1 = new TestVisitor();
- b.setLength(0);
- x1.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[(sWH"+E1S+S1S+"sWH)]")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testPrePost() {
- SimpleName n1 = ast.newSimpleName("a"); //$NON-NLS-1$
- SimpleName n2 = ast.newSimpleName("b"); //$NON-NLS-1$
- QualifiedName q = ast.newQualifiedName(n1, n2);
- TestVisitor v1 = new TestVisitor() {
- public void preVisit(ASTNode node) {
- b.append("["); //$NON-NLS-1$
- switch (node.getNodeType()) {
- case ASTNode.QUALIFIED_NAME :
- b.append("q"); //$NON-NLS-1$
- break;
- case ASTNode.SIMPLE_NAME :
- b.append(((SimpleName) node).getIdentifier());
- break;
- }
- }
-
- public void postVisit(ASTNode node) {
- switch (node.getNodeType()) {
- case ASTNode.QUALIFIED_NAME :
- b.append("q"); //$NON-NLS-1$
- break;
- case ASTNode.SIMPLE_NAME :
- b.append(((SimpleName) node).getIdentifier());
- break;
- }
- b.append("]"); //$NON-NLS-1$
- }
- };
-
- b.setLength(0);
- q.accept(v1);
- String result = b.toString();
- assertTrue(result.equals("[q(nQ" + "[a(nSaanS)a]" + "[b(nSbbnS)b]" + "nQ)q]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- public void testTraverseAndModify() {
- final TypeDeclaration typeDeclaration = ast.newTypeDeclaration();
- typeDeclaration.setName(N1);
- FunctionDeclaration methodDeclaration = ast.newFunctionDeclaration();
- methodDeclaration.setName(ast.newSimpleName("M1")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(0, methodDeclaration);
- final FunctionDeclaration methodDeclaration2 = ast.newFunctionDeclaration();
- methodDeclaration2.setName(ast.newSimpleName("M2")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(1, methodDeclaration2);
- FunctionDeclaration methodDeclaration3 = ast.newFunctionDeclaration();
- methodDeclaration3.setName(ast.newSimpleName("M3")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(2, methodDeclaration3);
- // insert a new before the current node during a traverse
- TestVisitor v1 = new TestVisitor() {
- public boolean visit(FunctionDeclaration node) {
- if (node == methodDeclaration2) {
- FunctionDeclaration methodDeclaration4 = ast.newFunctionDeclaration();
- methodDeclaration4.setName(ast.newSimpleName("M4")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(0, methodDeclaration4);
- }
- return super.visit(node);
- }
- };
- b.setLength(0);
- typeDeclaration.accept(v1);
- assertEquals("wrong output", "[(TD[(nSNNnS)][(MD[(tPvoidvoidtP)][(nSM1M1nS)]MD)][(MD[(tPvoidvoidtP)][(nSM2M2nS)]MD)][(MD[(tPvoidvoidtP)][(nSM3M3nS)]MD)]TD)]", b.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testTraverseAndModify_2() {
- final TypeDeclaration typeDeclaration = ast.newTypeDeclaration();
- typeDeclaration.setName(N1);
- FunctionDeclaration methodDeclaration = ast.newFunctionDeclaration();
- methodDeclaration.setName(ast.newSimpleName("M1")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(0, methodDeclaration);
- final FunctionDeclaration methodDeclaration2 = ast.newFunctionDeclaration();
- methodDeclaration2.setName(ast.newSimpleName("M2")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(1, methodDeclaration2);
- FunctionDeclaration methodDeclaration3 = ast.newFunctionDeclaration();
- methodDeclaration3.setName(ast.newSimpleName("M3")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(2, methodDeclaration3);
- // insert a new after the current node during a traverse
- TestVisitor v1 = new TestVisitor() {
- public boolean visit(FunctionDeclaration node) {
- if (node == methodDeclaration2) {
- FunctionDeclaration methodDeclaration4 = ast.newFunctionDeclaration();
- methodDeclaration4.setName(ast.newSimpleName("M4")); //$NON-NLS-1$
- typeDeclaration.bodyDeclarations().add(3, methodDeclaration4);
- }
- return super.visit(node);
- }
- };
- b.setLength(0);
- typeDeclaration.accept(v1);
- assertEquals("wrong output", "[(TD[(nSNNnS)][(MD[(tPvoidvoidtP)][(nSM1M1nS)]MD)][(MD[(tPvoidvoidtP)][(nSM2M2nS)]MD)][(MD[(tPvoidvoidtP)][(nSM3M3nS)]MD)][(MD[(tPvoidvoidtP)][(nSM4M4nS)]MD)]TD)]", b.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testTraverseAndModify_3() {
- final InfixExpression infixExpression = ast.newInfixExpression();
- infixExpression.setLeftOperand(ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(ast.newNumberLiteral("10")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- // insert a new after the current node during a traverse
- TestVisitor v1 = new TestVisitor() {
- public boolean visit(SimpleName node) {
- infixExpression.setRightOperand(ast.newNumberLiteral("22")); //$NON-NLS-1$
- return super.visit(node);
- }
- };
- b.setLength(0);
- infixExpression.accept(v1);
- assertEquals("wrong output", "[(eIN+[(nSiinS)][(eNU2222eNU)]+eIN)]", b.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void testTraverseAndModify_4() {
- final InfixExpression infixExpression = ast.newInfixExpression();
- infixExpression.setLeftOperand(ast.newSimpleName("i")); //$NON-NLS-1$
- infixExpression.setRightOperand(ast.newNumberLiteral("10")); //$NON-NLS-1$
- infixExpression.setOperator(InfixExpression.Operator.PLUS);
- // insert a new before the current node during a traverse
- TestVisitor v1 = new TestVisitor() {
- public boolean visit(NumberLiteral node) {
- infixExpression.setLeftOperand(ast.newSimpleName("j")); //$NON-NLS-1$
- return super.visit(node);
- }
- };
- b.setLength(0);
- infixExpression.accept(v1);
- assertEquals("wrong output", "[(eIN+[(nSiinS)][(eNU1010eNU)]+eIN)]", b.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/AbstractASTTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/AbstractASTTests.java
deleted file mode 100644
index a4e30de..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/AbstractASTTests.java
+++ /dev/null
@@ -1,548 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IProblemRequestor;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.ASTRequestor;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.tests.model.ModifyingResourceTests;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-public class AbstractASTTests extends ModifyingResourceTests {
-
- public AbstractASTTests(String name) {
- super(name);
- }
-
- /*
- * Removes the *start* and *end* markers from the given source and remembers
- * the positions.
- */
- public class MarkerInfo {
- String path;
- String source;
- int[] astStarts, astEnds;
-
- public MarkerInfo(String source) {
- this(null, source);
- }
-
- public MarkerInfo(String path, String source) {
- this.path = path;
- this.source = source;
-
- int markerIndex = 1;
- while (source.indexOf("/*start" + markerIndex + "*/") != -1) {
- markerIndex++;
- }
- int astNumber = source.indexOf("/*start*/") != -1 ? markerIndex
- : markerIndex - 1;
- this.astStarts = new int[astNumber];
- this.astEnds = new int[astNumber];
-
- for (int i = 1; i < markerIndex; i++)
- setStartAndEnd(i);
- if (astNumber == markerIndex)
- setStartAndEnd(-1);
- }
-
- public int indexOfASTStart(int astStart) {
- for (int i = 0, length = this.astStarts.length; i < length; i++)
- if (this.astStarts[i] == astStart)
- return i;
- return -1;
- }
-
- private void removeMarkerFromSource(String marker, int sourceIndex,
- int astNumber) {
- char[] markerChars = marker.toCharArray();
- this.source = new String(CharOperation.replace(this.source
- .toCharArray(), markerChars, CharOperation.NO_CHAR));
- // shift previously recorded positions
- int markerLength = markerChars.length;
- for (int i = 0; i < astNumber; i++) {
- if (this.astStarts[i] > sourceIndex)
- this.astStarts[i] -= markerLength;
- if (this.astEnds[i] > sourceIndex)
- this.astEnds[i] -= markerLength;
- }
- }
-
- private void setStartAndEnd(int markerIndex) {
- String markerNumber;
- if (markerIndex == -1) {
- markerNumber = "";
- markerIndex = this.astStarts.length; // *start* is always last
- } else
- markerNumber = Integer.toString(markerIndex);
-
- String markerStart = "/*start" + markerNumber + "*/";
- String markerEnd = "/*end" + markerNumber + "*/";
- int astStart = source.indexOf(markerStart); // start of AST
- // inclusive
- this.astStarts[markerIndex - 1] = astStart;
- removeMarkerFromSource(markerStart, astStart, markerIndex - 1);
- int astEnd = this.source.indexOf(markerEnd); // end of AST exclusive
- this.astEnds[markerIndex - 1] = astEnd;
- removeMarkerFromSource(markerEnd, astEnd, markerIndex - 1);
- }
-
- }
-
- public class BindingRequestor extends ASTRequestor {
- HashMap bindings = new HashMap();
-
- public void acceptBinding(String bindingKey, IBinding binding) {
- this.bindings.put(bindingKey, binding);
- }
-
- public IBinding[] getBindings(String[] bindingKeys) {
- int length = this.bindings.size();
- IBinding[] result = new IBinding[length];
- for (int i = 0; i < length; i++) {
- result[i] = (IBinding) this.bindings.get(bindingKeys[i]);
- }
- return result;
- }
- }
-
- protected void assertASTNodeEquals(String expected, ASTNode node) {
- String actual = node.toString();
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, 3) + ",");
- }
- assertEquals("Unexpected ast node", expected, actual);
- }
-
- protected void assertASTNodesEqual(String expected, List nodes) {
- StringBuffer buffer = new StringBuffer();
- Iterator iterator = nodes.iterator();
- while (iterator.hasNext()) {
- ASTNode node = (ASTNode) iterator.next();
- buffer.append(node);
- if (node instanceof JavaScriptUnit) {
- IProblem[] problems = ((JavaScriptUnit) node).getProblems();
- if (problems != null) {
- for (int i = 0, length = problems.length; i < length; i++) {
- IProblem problem = problems[i];
- buffer.append('\n');
- buffer.append(problem);
- }
- }
- }
- buffer.append('\n');
- }
- String actual = buffer.toString();
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, 4) + ",");
- }
- assertEquals("Unexpected ast nodes", expected, actual);
- }
-
- protected void assertBindingKeyEquals(String expected, String actual) {
- assertBindingKeysEqual(expected, new String[] { actual });
- }
-
- protected void assertBindingKeysEqual(String expected, String[] actualKeys) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = actualKeys.length; i < length; i++) {
- if (i > 0)
- buffer.append('\n');
- buffer.append(actualKeys[i]);
- }
- String actual = buffer.toString();
- if (!expected.equals(actual)) {
- System.out.print(displayString(actual, 4));
- System.out.println(',');
- }
- assertEquals("Unexpected binding keys", expected, actual);
- }
-
- protected void assertBindingEquals(String expected, IBinding binding) {
- assertBindingsEqual(expected, new IBinding[] { binding });
- }
-
- protected void assertBindingsEqual(String expected,
- IBinding[] actualBindings) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = actualBindings.length; i < length; i++) {
- if (i > 0)
- buffer.append('\n');
- if (actualBindings[i] == null)
- buffer.append("<null>");
- else
- buffer.append(actualBindings[i].getKey());
- }
- String actual = buffer.toString();
- if (!expected.equals(actual)) {
- System.out.print(displayString(actual, 3));
- System.out.println(',');
- }
- assertEquals("Unexpected bindings", expected, actual);
- }
-
- /*
- * Builds an AST from the info source (which is assumed to be the source
- * attached to the given class file), and returns the AST node that was
- * delimited by the astStart and astEnd of the marker info.
- */
- protected ASTNode buildAST(MarkerInfo markerInfo, IClassFile classFile,
- boolean reportErrors) throws JavaScriptModelException {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(classFile);
- parser.setResolveBindings(true);
- JavaScriptUnit unit = (JavaScriptUnit) parser.createAST(null);
-
- if (reportErrors) {
- StringBuffer buffer = new StringBuffer();
- IProblem[] problems = unit.getProblems();
- for (int i = 0, length = problems.length; i < length; i++)
- Util.appendProblem(buffer, problems[i], markerInfo.source
- .toCharArray(), i + 1);
- if (buffer.length() > 0)
- System.err.println(buffer.toString());
- }
-
- return findNode(unit, markerInfo);
- }
-
- protected ASTNode buildAST(IJavaScriptUnit cu)
- throws JavaScriptModelException {
- return buildAST(null/* use existing contents */, cu, true/* report errors */);
- }
-
- protected ASTNode buildAST(String newContents, IJavaScriptUnit cu)
- throws JavaScriptModelException {
- return buildAST(newContents, cu, true/* report errors */);
- }
-
- protected ASTNode buildAST(MarkerInfo markerInfo, IClassFile classFile)
- throws JavaScriptModelException {
- return buildAST(markerInfo, classFile, true/* report errors */);
- }
-
- /*
- * Removes the marker comments "*start*" and "*end*" from the given
- * contents, builds an AST from the resulting source, and returns the AST
- * node that was delimited by "*start*" and "*end*".
- */
- protected ASTNode buildAST(String newContents, IJavaScriptUnit cu,
- boolean reportErrors) throws JavaScriptModelException {
- return buildAST(newContents, cu, reportErrors, false/*
- * no statement
- * recovery
- */);
- }
-
- protected ASTNode buildAST(String newContents, IJavaScriptUnit cu,
- boolean reportErrors, boolean enableStatementRecovery)
- throws JavaScriptModelException {
- ASTNode[] nodes = buildASTs(newContents, cu, reportErrors,
- enableStatementRecovery);
- if (nodes.length == 0)
- return null;
- return nodes[0];
- }
-
- protected ASTNode[] buildASTs(String contents, IJavaScriptUnit cu)
- throws JavaScriptModelException {
- return buildASTs(contents, cu, true);
- }
-
- /*
- * Removes the marker comments "*start?*" and "*end?*" from the given new
- * contents (where ? is either empty or a number), or use the current
- * contents if the given new contents is null. Builds an AST from the
- * resulting source. For each of the pairs, returns the AST node that was
- * delimited by "*start?*" and "*end?*".
- */
- protected ASTNode[] buildASTs(String newContents, IJavaScriptUnit cu,
- boolean reportErrors) throws JavaScriptModelException {
- return buildASTs(newContents, cu, reportErrors, false);
- }
-
- protected ASTNode[] buildASTs(String newContents, IJavaScriptUnit cu,
- boolean reportErrors, boolean enableStatementRecovery)
- throws JavaScriptModelException {
- MarkerInfo markerInfo;
- if (newContents == null) {
- markerInfo = new MarkerInfo(cu.getSource());
- } else {
- markerInfo = new MarkerInfo(newContents);
- }
- newContents = markerInfo.source;
-
- JavaScriptUnit unit;
- if (cu.isWorkingCopy()) {
- cu.getBuffer().setContents(newContents);
- unit = cu.reconcile(AST.JLS3, reportErrors,
- enableStatementRecovery, null, null);
- } else {
- IBuffer buffer = cu.getBuffer();
- buffer.setContents(newContents);
- buffer.save(null, false);
-
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(cu);
- parser.setResolveBindings(true);
- parser.setStatementsRecovery(enableStatementRecovery);
- unit = (JavaScriptUnit) parser.createAST(null);
- }
-
- if (reportErrors) {
- StringBuffer buffer = new StringBuffer();
- IProblem[] problems = unit.getProblems();
- for (int i = 0, length = problems.length; i < length; i++)
- Util.appendProblem(buffer, problems[i], newContents
- .toCharArray(), i + 1);
- if (buffer.length() > 0)
- System.err.println(buffer.toString());
- }
-
- ASTNode[] nodes = findNodes(unit, markerInfo);
- if (nodes.length == 0)
- return new ASTNode[] { unit };
- return nodes;
- }
-
- protected MarkerInfo[] createMarkerInfos(String[] pathAndSources) {
- MarkerInfo[] markerInfos = new MarkerInfo[pathAndSources.length / 2];
- int index = 0;
- for (int i = 0, length = pathAndSources.length; i < length; i++) {
- String path = pathAndSources[i];
- String source = pathAndSources[++i];
- markerInfos[index++] = new MarkerInfo(path, source);
- }
- return markerInfos;
- }
-
- protected IVariableBinding[] createVariableBindings(
- String[] pathAndSources, String[] bindingKeys)
- throws JavaScriptModelException {
- WorkingCopyOwner owner = new WorkingCopyOwner() {
- };
- this.workingCopies = createWorkingCopies(pathAndSources, owner);
- IBinding[] bindings = resolveBindings(bindingKeys, getJavaProject("P"),
- owner);
- int length = bindings.length;
- IVariableBinding[] result = new IVariableBinding[length];
- System.arraycopy(bindings, 0, result, 0, length);
- return result;
- }
-
- protected IFunctionBinding[] createMethodBindings(String[] pathAndSources,
- String[] bindingKeys) throws JavaScriptModelException {
- return createMethodBindings(pathAndSources, bindingKeys,
- getJavaProject("P"));
- }
-
- protected IFunctionBinding[] createMethodBindings(String[] pathAndSources,
- String[] bindingKeys, IJavaScriptProject project)
- throws JavaScriptModelException {
- WorkingCopyOwner owner = new WorkingCopyOwner() {
- };
- this.workingCopies = createWorkingCopies(pathAndSources, owner);
- IBinding[] bindings = resolveBindings(bindingKeys, project, owner);
- int length = bindings.length;
- IFunctionBinding[] result = new IFunctionBinding[length];
- System.arraycopy(bindings, 0, result, 0, length);
- return result;
- }
-
- protected ITypeBinding[] createTypeBindings(String[] pathAndSources,
- String[] bindingKeys) throws JavaScriptModelException {
- return createTypeBindings(pathAndSources, bindingKeys,
- getJavaProject("P"));
- }
-
- protected ITypeBinding[] createTypeBindings(String[] pathAndSources,
- String[] bindingKeys, IJavaScriptProject project)
- throws JavaScriptModelException {
- WorkingCopyOwner owner = new WorkingCopyOwner() {
- };
- this.workingCopies = createWorkingCopies(pathAndSources, owner);
- IBinding[] bindings = resolveBindings(bindingKeys, project, owner);
- int length = bindings.length;
- ITypeBinding[] result = new ITypeBinding[length];
- System.arraycopy(bindings, 0, result, 0, length);
- return result;
- }
-
- protected IJavaScriptUnit[] createWorkingCopies(String[] pathAndSources,
- WorkingCopyOwner owner) throws JavaScriptModelException {
- MarkerInfo[] markerInfos = createMarkerInfos(pathAndSources);
- return createWorkingCopies(markerInfos, owner);
- }
-
- protected IJavaScriptUnit[] createWorkingCopies(MarkerInfo[] markerInfos,
- WorkingCopyOwner owner) throws JavaScriptModelException {
- return createWorkingCopies(markerInfos, owner, null);
- }
-
- protected IJavaScriptUnit[] createWorkingCopies(MarkerInfo[] markerInfos,
- WorkingCopyOwner owner, IProblemRequestor problemRequestor)
- throws JavaScriptModelException {
- int length = markerInfos.length;
- IJavaScriptUnit[] copies = new IJavaScriptUnit[length];
- for (int i = 0; i < length; i++) {
- MarkerInfo markerInfo = markerInfos[i];
- IJavaScriptUnit workingCopy = getCompilationUnit(markerInfo.path)
- .getWorkingCopy(owner, null);
- workingCopy.getBuffer().setContents(markerInfo.source);
- workingCopy.makeConsistent(null);
- copies[i] = workingCopy;
- }
- return copies;
- }
-
- protected ASTNode findNode(JavaScriptUnit unit, final MarkerInfo markerInfo) {
- ASTNode[] nodes = findNodes(unit, markerInfo);
- if (nodes.length == 0)
- return unit;
- return nodes[0];
- }
-
- protected ASTNode[] findNodes(JavaScriptUnit unit,
- final MarkerInfo markerInfo) {
- class Visitor extends ASTVisitor {
- ArrayList found = new ArrayList();
-
- public void preVisit(ASTNode node) {
- if (node instanceof JavaScriptUnit)
- return;
- int index = markerInfo.indexOfASTStart(node.getStartPosition());
- if (index != -1
- && node.getStartPosition() + node.getLength() == markerInfo.astEnds[index]) {
- this.found.add(node);
- markerInfo.astStarts[index] = -1; // so that 2 nodes with
- // the same start and
- // end will not be found
- }
- }
- }
- Visitor visitor = new Visitor();
- unit.accept(visitor);
- int size = visitor.found.size();
- ASTNode[] result = new ASTNode[size];
- visitor.found.toArray(result);
- return result;
- }
-
- protected void resolveASTs(IJavaScriptUnit[] cus, String[] bindingKeys,
- ASTRequestor requestor, IJavaScriptProject project,
- WorkingCopyOwner owner) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setResolveBindings(true);
- parser.setProject(project);
- parser.setWorkingCopyOwner(owner);
- parser.createASTs(cus, bindingKeys, requestor, null);
- }
-
- protected IBinding resolveBinding(ASTNode node) {
- switch (node.getNodeType()) {
- case ASTNode.PACKAGE_DECLARATION:
- return ((PackageDeclaration) node).resolveBinding();
- case ASTNode.TYPE_DECLARATION:
- return ((TypeDeclaration) node).resolveBinding();
- case ASTNode.ANONYMOUS_CLASS_DECLARATION:
- return ((AnonymousClassDeclaration) node).resolveBinding();
- case ASTNode.TYPE_DECLARATION_STATEMENT:
- return ((TypeDeclarationStatement) node).resolveBinding();
- case ASTNode.FUNCTION_DECLARATION:
- return ((FunctionDeclaration) node).resolveBinding();
- case ASTNode.FUNCTION_INVOCATION:
- return ((FunctionInvocation) node).resolveMethodBinding();
- case ASTNode.SIMPLE_NAME:
- return ((SimpleName) node).resolveBinding();
- case ASTNode.ARRAY_TYPE:
- return ((ArrayType) node).resolveBinding();
- case ASTNode.ASSIGNMENT:
- return ((Assignment) node).getRightHandSide().resolveTypeBinding();
- case ASTNode.SIMPLE_TYPE:
- return ((SimpleType) node).resolveBinding();
- case ASTNode.QUALIFIED_NAME:
- return ((QualifiedName) node).resolveBinding();
- default:
- throw new Error("Not yet implemented for this type of node: "
- + node);
- }
- }
-
- protected IBinding[] resolveBindings(String[] bindingKeys,
- IJavaScriptProject project, WorkingCopyOwner owner) {
- BindingRequestor requestor = new BindingRequestor();
- resolveASTs(new IJavaScriptUnit[0], bindingKeys, requestor, project,
- owner);
- return requestor.getBindings(bindingKeys);
- }
-
- /*
- * Resolve the bindings of the nodes marked with *start?* and *end?*.
- */
- protected IBinding[] resolveBindings(String contents, IJavaScriptUnit cu)
- throws JavaScriptModelException {
- return resolveBindings(contents, cu, true/* report errors */);
- }
-
- /*
- * Resolve the bindings of the nodes marked with *start?* and *end?*.
- */
- protected IBinding[] resolveBindings(String contents, IJavaScriptUnit cu,
- boolean reportErrors) throws JavaScriptModelException {
- ASTNode[] nodes = buildASTs(contents, cu, reportErrors);
- if (nodes == null)
- return null;
- int length = nodes.length;
- IBinding[] result = new IBinding[length];
- for (int i = 0; i < length; i++) {
- result[i] = resolveBinding(nodes[i]);
- }
- return result;
- }
-
- // protected void tearDown() throws Exception {
- // discardWorkingCopies(this.workingCopies);
- // this.workingCopies = null;
- // }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BatchASTCreationTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BatchASTCreationTests.java
deleted file mode 100644
index ea147ef..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BatchASTCreationTests.java
+++ /dev/null
@@ -1,1670 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.BindingKey;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IProblemRequestor;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.ASTRequestor;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-
-public class BatchASTCreationTests extends AbstractASTTests {
-
- public class TestASTRequestor extends ASTRequestor {
- public ArrayList asts = new ArrayList();
- public void acceptAST(IJavaScriptUnit source, JavaScriptUnit ast) {
- this.asts.add(ast);
- }
- public void acceptBinding(String bindingKey, IBinding binding) {
- }
- }
-
- class BindingResolver extends TestASTRequestor {
- private ArrayList bindingKeys = new ArrayList();
- int index = -1;
- private ArrayList foundKeys = new ArrayList();
- MarkerInfo[] markerInfos;
- public BindingResolver(MarkerInfo[] markerInfos) {
- this.markerInfos = markerInfos;
- }
- public void acceptAST(IJavaScriptUnit source, JavaScriptUnit cu) {
- super.acceptAST(source, cu);
- ASTNode[] nodes = findNodes(cu, this.markerInfos[++this.index]);
- for (int i = 0, length = nodes.length; i < length; i++) {
- IBinding binding = resolveBinding(nodes[i]);
- String bindingKey = binding == null ? "null" : binding.getKey();
-
- // case of a capture binding
- if (bindingKey.indexOf('!') != -1 && binding.getKind() == IBinding.METHOD) {
- bindingKey = ((IFunctionBinding) binding).getReturnType().getKey();
- }
-
- this.bindingKeys.add(bindingKey);
- }
- }
- public void acceptBinding(String key, IBinding binding) {
- super.acceptBinding(key, binding);
- this.foundKeys.add(binding == null ? "null" : binding.getKey());
- }
-
- public String[] getBindingKeys() {
- int length = this.bindingKeys.size();
- String[] result = new String[length];
- this.bindingKeys.toArray(result);
- return result;
- }
-
- public String[] getFoundKeys() {
- int length = this.foundKeys.size();
- String[] result = new String[length];
- this.foundKeys.toArray(result);
- return result;
- }
- }
-
- public WorkingCopyOwner owner = new WorkingCopyOwner() {};
-
- public BatchASTCreationTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(BatchASTCreationTests.class);
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
-// TESTS_PREFIX = "testBug86380";
-// TESTS_NAMES = new String[] { "test056" };
-// TESTS_NUMBERS = new int[] { 78, 79, 80 };
- TESTS_RANGE = new int[] { 0, 2 };
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- }
-
- public void tearDownSuite() throws Exception {
- deleteProject("P");
- super.tearDownSuite();
- }
-
- /*
- * Resolves the given cus and binding key as a batch.
- * While resolving, for the ASTNode that is marked, ensures that its binding key is the expected one.
- * Ensures that the returned binding corresponds to the expected key.
- */
- private void assertRequestedBindingFound(String[] pathAndSources, final String expectedKey) throws JavaScriptModelException {
- assertRequestedBindingsFound(pathAndSources, new String[] {expectedKey});
- }
-
- /*
- * Resolves the given cus and binding key as a batch.
- * While resolving, for the ASTNode that is marked, ensures that its binding key is the expected one.
- * Ensures that the returned binding corresponds to the expected key.
- */
- private void assertRequestedBindingsFound(String[] pathAndSources, final String[] expectedKeys) throws JavaScriptModelException {
- BindingResolver resolver = requestBindings(pathAndSources, expectedKeys);
-
- assertStringsEqual("Unexpected binding for marked node", expectedKeys, resolver.getBindingKeys());
-
- assertStringsEqual("Unexpected binding found by acceptBinding", expectedKeys, resolver.getFoundKeys());
- }
-
- /*
- * Creates working copies from the given path and sources.
- * Resolves a dummy cu as a batch and on the first accept, create a binding with the expected key using ASTRequestor#createBindings.
- * Ensures that the returned binding corresponds to the expected key.
- */
- private void assertBindingCreated(String[] pathAndSources, final String expectedKey) throws JavaScriptModelException {
- assertBindingsCreated(pathAndSources, new String[] {expectedKey});
- }
- /*
- * Creates working copies from the given path and sources.
- * Resolves a dummy cu as a batch and on the first accept, create a binding with the expected key using ASTRequestor#createBindings.
- * Ensures that the returned binding corresponds to the expected key.
- */
- private void assertBindingsCreated(String[] pathAndSources, final String[] expectedKeys) throws JavaScriptModelException {
- IJavaScriptUnit[] copies = null;
- try {
- copies = createWorkingCopies(pathAndSources);
- class Requestor extends TestASTRequestor {
- ArrayList createdBindingKeys = new ArrayList();
- public void acceptAST(IJavaScriptUnit source, JavaScriptUnit cu) {
- super.acceptAST(source, cu);
- IBinding[] bindings = createBindings(expectedKeys);
- if (bindings != null && bindings.length > 0 && bindings[0] != null)
- this.createdBindingKeys.add(bindings[0].getKey());
- }
- public String getCreatedKeys() {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = this.createdBindingKeys.size(); i < length; i++) {
- buffer.append(this.createdBindingKeys.get(i));
- if (i < length - 1)
- buffer.append('\n');
- }
- return buffer.toString();
- }
- }
- Requestor requestor = new Requestor();
- IJavaScriptUnit[] dummyWorkingCopies = null;
- try {
- dummyWorkingCopies = createWorkingCopies(new String[] {
- "/P/Test.js",
- "public class Test {\n" +
- "}"
- });
- resolveASTs(dummyWorkingCopies, new String[] {}, requestor, getJavaProject("P"), this.owner);
- } finally {
- discardWorkingCopies(dummyWorkingCopies);
- }
-
- String expectedKey = toString(expectedKeys);
- String actualKey = requestor.getCreatedKeys();
- if (!expectedKey.equals(actualKey)) {
- BindingResolver resolver = requestBindings(pathAndSources, null);
- String[] markedKeys = resolver.getBindingKeys();
- if (markedKeys.length > 0) {
- assertStringsEqual("Inconsistent expected key ", expectedKeys, markedKeys);
- }
- }
- assertEquals("Unexpected created binding", expectedKey, actualKey);
- } finally {
- discardWorkingCopies(copies);
- }
- }
-
- private void createASTs(IJavaScriptUnit[] cus, TestASTRequestor requestor) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.createASTs(cus, new String[] {}, requestor, null);
- }
-
- protected IJavaScriptUnit[] createWorkingCopies(String[] pathAndSources) throws JavaScriptModelException {
- return createWorkingCopies(pathAndSources, this.owner);
- }
-
- protected IJavaScriptUnit[] createWorkingCopies(String[] pathAndSources, boolean resolve) throws JavaScriptModelException {
- IProblemRequestor problemRequestor = resolve
- ? new IProblemRequestor() {
- public void acceptProblem(IProblem problem) {}
- public void beginReporting() {}
- public void endReporting() {}
- public boolean isActive() {
- return true;
- }
- }
- : null;
- MarkerInfo[] markerInfos = createMarkerInfos(pathAndSources);
- return createWorkingCopies(markerInfos, this.owner, problemRequestor);
- }
-
- private void resolveASTs(IJavaScriptUnit[] cus, TestASTRequestor requestor) {
- resolveASTs(cus, new String[0], requestor, getJavaProject("P"), this.owner);
- }
-
- private BindingResolver requestBindings(String[] pathAndSources, final String[] expectedKeys) throws JavaScriptModelException {
- IJavaScriptUnit[] copies = null;
- try {
- MarkerInfo[] markerInfos = createMarkerInfos(pathAndSources);
- copies = createWorkingCopies(markerInfos, this.owner);
- BindingResolver resolver = new BindingResolver(markerInfos);
- resolveASTs(copies, expectedKeys == null ? new String[0] : expectedKeys, resolver, copies.length > 0 ? copies[0].getJavaScriptProject() : getJavaProject("P"), this.owner);
- return resolver;
- } finally {
- discardWorkingCopies(copies);
- }
- }
-
-
- /*
- * Tests the batch creation of 2 ASTs without resolving.
- */
- public void test001() throws CoreException {
- this.workingCopies = createWorkingCopies(new String[] {
- "/P/X.js",
- "function X(){}\n" +
- "X.prototype = new Y();",
- "/P/Y.js",
- "function Y() {}"
- });
- TestASTRequestor requestor = new TestASTRequestor();
- createASTs(this.workingCopies, requestor);
- assertASTNodesEqual(
- "function X(){\n}\n" +
- "X.prototype=new Y();\n" +
- "\n" +
- "function Y(){\n}\n" +
- "\n",
- requestor.asts
- );
- }
-
- /*
- * Tests the batch creation of 2 ASTs with resolving.
- */
- public void test002() throws CoreException {
- MarkerInfo[] markerInfos = createMarkerInfos(new String[] {
- "/P/X.js",
- "function X/*start*/()/*end*/ {\n}\n" +
- "X.prototype = new Y();",
- "/P/Y.js",
- "/*start*/function Y() {\n" +
- "}/*end*/",
- });
- this.workingCopies = createWorkingCopies(markerInfos, this.owner);
- TestASTRequestor requestor = new TestASTRequestor();
- resolveASTs(this.workingCopies, requestor);
- assertASTNodesEqual(
- "function X(){\n}\n" +
- "X.prototype=new Y();\n" +
- "\n" +
- "function Y(){\n}\n" +
- "\n",
- requestor.asts
- );
-
- // compare the bindings coming from the 2 ASTs
- Type superX = (Type) findNode((JavaScriptUnit) requestor.asts.get(0), markerInfos[0]);
- TypeDeclaration typeY = (TypeDeclaration) findNode((JavaScriptUnit) requestor.asts.get(1), markerInfos[1]);
- IBinding superXBinding = superX.resolveBinding();
- IBinding typeYBinding = typeY.resolveBinding();
- assertTrue("Super of X and Y should be the same", superXBinding == typeYBinding);
- }
-
- /*
- * Ensures that ASTs that are required by original source but were not asked for are not handled.
- */
- public void test003() throws CoreException {
- IJavaScriptUnit[] otherWorkingCopies = null;
- try {
- this.workingCopies = createWorkingCopies(new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X extends Y {\n" +
- "}",
- });
- otherWorkingCopies = createWorkingCopies(new String[] {
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- });
- TestASTRequestor requestor = new TestASTRequestor();
- resolveASTs(this.workingCopies, requestor);
-
- assertASTNodesEqual(
- "package p1;\n" +
- "public class X extends Y {\n" +
- "}\n" +
- "\n",
- requestor.asts
- );
- } finally {
- // Note: this.workingCopies are discarded in tearDown
- discardWorkingCopies(otherWorkingCopies);
- }
- }
-
- /*
- * Ensures that a package binding can be retrieved using its key.
- */
- public void test004() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "/*start*/package p1;/*end*/\n" +
- "public class X {\n" +
- "}",
- },
- "p1");
- }
-
- /*
- * Ensures that a type binding can be retrieved using its key.
- */
- public void test005() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "/*start*/public class X extends Y {\n" +
- "}/*end*/",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- },
- "Lp1/X;");
- }
-
- /*
- * Ensures that a type binding can be retrieved using its key.
- */
- public void test006() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X extends Y {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "/*start*/public class Y {\n" +
- "}/*end*/",
- },
- "Lp1/Y;");
- }
-
- /*
- * Ensures that a member type binding can be retrieved using its key.
- */
- public void test007() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " /*start*/class Member {\n" +
- " }/*end*/" +
- "}",
- },
- "Lp1/X$Member;");
- }
-
- /*
- * Ensures that a member type binding can be retrieved using its key.
- */
- public void test008() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " class Member1 {\n" +
- " /*start*/class Member2 {\n" +
- " }/*end*/" +
- " }\n" +
- "}",
- },
- "Lp1/X$Member1$Member2;");
- }
- /*
- * Ensures that an anonymous type binding can be retrieved using its key.
- */
- public void test009() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " new X() /*start*/{\n" +
- " }/*end*/;" +
- " }\n" +
- "}",
- },
- "Lp1/X$52;");
- }
- /*
- * Ensures that a local type binding can be retrieved using its key.
- */
- public void test010() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " /*start*/class Y {\n" +
- " }/*end*/;" +
- " }\n" +
- "}",
- },
- "Lp1/X$54$Y;");
- }
-
- /*
- * Ensures that a package binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test011() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- },
- "p1");
- }
-
- /*
- * Ensures that a type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test012() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X extends Y {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- },
- "Lp1/X;");
- }
-
- /*
- * Ensures that a type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test013() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X extends Y {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- },
- "Lp1/Y;");
- }
-
- /*
- * Ensures that a member type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test014() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " class Member {\n" +
- " }" +
- "}",
- },
- "Lp1/X$Member;");
- }
-
- /*
- * Ensures that a member type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test015() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " class Member1 {\n" +
- " class Member2 {\n" +
- " }" +
- " }\n" +
- "}",
- },
- "Lp1/X$Member1$Member2;");
- }
-
- /*
- * Ensures that an anonymous type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test016() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " new X() /*start*/{\n" +
- " }/*end*/;" +
- " }\n" +
- "}",
- },
- "Lp1/X$52;");
- }
-
- /*
- * Ensures that a local type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test017() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " /*start*/class Y {\n" +
- " }/*end*/;" +
- " }\n" +
- "}",
- },
- "Lp1/X$54$Y;");
- }
-
- /*
- * Ensures that a method binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test018() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;.foo()V");
- }
-
- /*
- * Ensures that a method binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test019() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo(Object o) {\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;.foo(Ljava/lang/Object;)V");
- }
-
- /*
- * Ensures that a method binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test020() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;.(Ljava/lang/Object;)V");
- }
-
- /*
- * Ensures that a field binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test021() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " int field;\n" +
- "}",
- },
- "Lp1/X;.field)I");
- }
-
- /*
- * Ensures that a base type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test022() throws CoreException {
- assertBindingCreated(new String[0],"I");
- }
-
- /*
- * Ensures that an array binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test023() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- },
- "[Lp1/X;");
- }
-
- /*
- * Ensures that an array binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test024() throws CoreException {
- assertBindingCreated(new String[0],"[[I");
- }
-
- /*
- * Ensures that a method binding in an anonymous type with several kind of parameters can be created using its key in ASTRequestor#createBindings
- */
- public void test025() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " class Y {\n" +
- " }\n" +
- " void foo() {\n" +
- " new X() {\n" +
- " /*start*/void bar(int i, X x, String[][] s, Y[] args, boolean b, Object o) {\n" +
- " }/*end*/\n" +
- " };\n" +
- " }\n" +
- "}",
- },
- "Lp1/X$68;.bar(ILp1/X;[[Ljava/lang/String;[Lp1/X$Y;ZLjava/lang/Object;)V"
- );
- }
-
- /*
- * Ensures that a generic type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test026() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- "}",
- },
- "Lp1/X<TT;>;");
- }
-
- /*
- * Ensures that a generic type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test027() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T extends Y & I, U extends Y> {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- "/P/p1/I.js",
- "package p1;\n" +
- "public interface I {\n" +
- "}",
- },
- "Lp1/X<TT;TU;>;");
- }
-
- /*
- * Ensures that a parameterized type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test028() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " X<String> field;\n" +
- "}",
- },
- "Lp1/X<Ljava/lang/String;>;");
- }
-
- /*
- * Ensures that a member parameterized type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test029() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T,U> {\n" +
- " class Y<V> {\n" +
- " X<Error,Exception>.Y<String> field;\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Ljava/lang/Error;Ljava/lang/Exception;>.Y<Ljava/lang/String;>;");
- }
-
- /*
- * Ensures that a raw type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test030() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T,U> {\n" +
- " X field;\n" +
- "}",
- },
- "Lp1/X<>;");
- }
-
- /*
- * Ensures that a member raw type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test031() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T,U> {\n" +
- " class Y<V> {\n" +
- " X<Error,Exception>.Y field;\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Ljava/lang/Error;Ljava/lang/Exception;>.Y<>;");
- }
-
- /*
- * Ensures that a parameterized method binding can be created using its key in ASTRequestor#createBindings
- */
- public void test032() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " <T> void foo() {\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;.foo<T:Ljava/lang/Object;>()V");
- }
-
- /*
- * Ensures that a local variable binding can be created using its key in ASTRequestor#createBindings
- */
- public void test033() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " int i;\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;.foo()V#i");
- }
-
- /*
- * Ensures that a local variable binding can be created using its key in ASTRequestor#createBindings
- */
- public void test034() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " int i = 1;\n" +
- " if (i == 0) {\n" +
- " int a;\n" +
- " } else {\n" +
- " int b;\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;.foo()V#1#b");
- }
-
- /*
- * Ensures that a parameterized method binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test035() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " void foo(T t) {\n" +
- " }\n" +
- " void bar() {\n" +
- " new X<String>().foo(\"\");\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Ljava/lang/String;>;.foo(Ljava/lang/String;)V");
- }
-
- /*
- * Ensures that a parameterized generic method binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test036() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " <U> void foo(T t, U u) {\n" +
- " }\n" +
- " void bar() {\n" +
- " /*start*/new X<String>().foo(\"\", this)/*end*/;\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Ljava/lang/String;>;.foo<U:Ljava/lang/Object;>(Ljava/lang/String;TU;)V%<Lp1/X;>"
- );
- }
-
- /*
- * Ensures that a raw generic method binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test037() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " <U> void foo(T t, U u) {\n" +
- " }\n" +
- " void bar() {\n" +
- " /*start*/new X().foo(\"\", this)/*end*/;\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;.foo<U:Ljava/lang/Object;>(TT;TU;)V%<>");
- }
-
- /*
- * Ensures that a parameterized method binding (where the parameter is an unbound wildcard) can be created using its key in ASTRequestor#createBindings.
- */
- public void test038() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar(X<?> x) {\n" +
- " x.foo();\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Lp1/X;*>;.foo()V");
- }
-
- /*
- * Ensures that a parameterized method binding (where the parameter is an extends wildcard) can be created using its key in ASTRequestor#createBindings.
- */
- public void test039() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar(X<? extends Object> x) {\n" +
- " x.foo();\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Lp1/X;+Ljava/lang/Object;>;.foo()V");
- }
-
- /*
- * Ensures that a parameterized method binding (where the parameter is a super wildcard) can be created using its key in ASTRequestor#createBindings.
- */
- public void test040() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar(X<? super Error> x) {\n" +
- " x.foo();\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Lp1/X;-Ljava/lang/Error;>;.foo()V");
- }
-
- /*
- * Ensures that a parameterized method binding (where the parameters contain wildcards) can be created using its key in ASTRequestor#createBindings.
- */
- public void test041() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T, U, V, W> {\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar(X<? super Error, ?, String, ? extends Object> x) {\n" +
- " x.foo();\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Lp1/X;-Ljava/lang/Error;Lp1/X;*Ljava/lang/String;Lp1/X;+Ljava/lang/Object;>;.foo()V");
- }
-
- /*
- * Ensures that requesting 2 bindings and an AST for the same compilation unit reports the 2 bindings.
- */
- public void test042() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy(
- "/P/X.js",
- "public class X {\n" +
- " int field;\n" +
- "}"
- );
- BindingRequestor requestor = new BindingRequestor();
- String[] bindingKeys =
- new String[] {
- "LX;",
- "LX;.field)I"
- };
- resolveASTs(
- new IJavaScriptUnit[] {workingCopy},
- bindingKeys,
- requestor,
- getJavaProject("P"),
- workingCopy.getOwner()
- );
- assertBindingsEqual(
- "LX;\n" +
- "LX;.field)I",
- requestor.getBindings(bindingKeys));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that a source parameterized type binding (where the parameters contain wildcard with a super bound) can be created using its key in ASTRequestor#createBindings.
- */
- public void test043() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " X<? super T> field;\n" +
- "}",
- },
- "Lp1/X<Lp1/X;-Lp1/X;:TT;>;");
- }
-
- /*
- * Ensures that a binary parameterized type binding (where the parameters contain wildcard with a super bound) can be created using its key in ASTRequestor#createBindings.
- * (regression test for 83499 ClassCastException when restoring ITypeBinding from key)
- */
- public void test044() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<E> {\n" +
- " Class<? extends E> field;\n" +
- "}",
- },
- "Ljava/lang/Class<Lp1/X;+Lp1/X;:TE;>;");
- }
-
- /*
- * Ensures that restoring a second key that references a type in a first key doesn't throw a NPE
- * (regression test for bug 83499 NPE when restoring ITypeBinding from key)
- */
- public void test045() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y<E> {\n" +
- "}"
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y<Lp1/Y;+Lp1/X;>;"
- }
- );
- assertBindingsEqual(
- "Lp1/X;\n" +
- "Lp1/Y<Lp1/Y;+Lp1/X;>;",
- bindings);
- }
-
- /*
- * Ensures that a binary array parameterized type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test046() throws CoreException {
- assertBindingCreated(
- new String[] {},
- "[Ljava/lang/Class<Ljava/lang/Object;>;");
- }
-
- /*
- * Ensures that the null type binding can be created using its key in batch creation.
- */
- public void test047() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {"N"});
- assertBindingsEqual(
- "N",
- bindings);
- }
-
- /*
- * Ensures that a binary array type binding can be created using its key in batch creation.
- */
- public void test048() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {"[Ljava/lang/Object;"});
- assertBindingsEqual(
- "[Ljava/lang/Object;",
- bindings);
- }
-
- /*
- * Ensures that a type variable binding can be created using its key in batch creation.
- */
- public void test049() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {"Ljava/lang/Class<TT;>;:TT;"});
- assertBindingsEqual(
- "Ljava/lang/Class;:TT;",
- bindings);
- }
-
- /*
- * Ensures that a parameterized type binding with a wildcard that extends an array the can be created using its key in batch creation.
- */
- public void test050() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {"Ljava/lang/Class<Ljava/lang/Class<TT;>;+[Ljava/lang/Object;>;"});
- assertBindingsEqual(
- "Ljava/lang/Class<Ljava/lang/Class;+[Ljava/lang/Object;>;",
- bindings);
- }
-
- /*
- * Ensures that attempting to create a top level type that doesn't exist using its key i in batch creation.
- * returns null.
- */
- public void test051() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {"Lp1/DoesNotExist;"});
- assertBindingsEqual(
- "<null>",
- bindings);
- }
-
- /*
- * Ensures that a secondary type binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test052() throws CoreException {
- try {
- createFolder("/P/p1");
- createFile(
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}\n" +
- "class Y {\n" +
- "}"
- );
- assertBindingCreated(new String[] {}, "Lp1/X~Y;");
- } finally {
- deleteFolder("/P/p1");
- }
- }
-
- /*
- * Ensures that an anonymous type binding coming from secondary type can be created using its key in ASTRequestor#createBindings.
- */
- public void test053() throws CoreException {
- try {
- createFolder("/P/p1");
- createFile(
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}\n" +
- "class Y {\n" +
- " void foo() {\n" +
- " new Y() {};\n" +
- " }\n" +
- "}"
- );
- assertBindingCreated(new String[] {}, "Lp1/X~Y$64;");
- } finally {
- deleteFolder("/P/p1");
- }
- }
-
- /*
- * Ensures that an anonymous type binding inside a local type can be retrieved using its key.
- */
- public void test054() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " void bar() {\n" +
- " new X() /*start*/{\n" +
- " }/*end*/;" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}",
- },
- "Lp1/X$89;"
- );
- }
-
- /*
- * Ensures that a parameterized generic method binding can be created using its key in ASTRequestor#createBindings.
- */
- public void test055() throws CoreException {
- assertBindingCreated(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " <U> void foo(U u) {\n" +
- " }\n" +
- " void bar() {\n" +
- " /*start*/new X<String>().foo(new X() {})/*end*/;\n" +
- " }\n" +
- "}",
- },
- "Lp1/X<Ljava/lang/String;>;.foo<U:Ljava/lang/Object;>(TU;)V%<Lp1/X$101;>"
- );
- }
-
- /*
- * Ensures that creating a binary member type binding returns the correct binding
- * (regression test for bug 86967 [1.5][dom] NPE in BindingKeyResolver for multi-level parameterized type binding)
- */
- public void test056() throws CoreException, IOException {
- try {
- IJavaScriptProject project = createJavaProject("BinaryProject", new String[0], new String[] {"JCL15_LIB"}, "", "1.5");
- addLibrary(project, "lib.jar", "src.zip", new String[] {
- "/BinaryProject/p/X.js",
- "package p;\n" +
- "public class X<K, V> {\n" +
- " public class Y<K1, V1> {\n" +
- " }\n" +
- "}"
- }, "1.5");
- ITypeBinding[] bindings = createTypeBindings(new String[0], new String[] {
- "Lp/X<>.Y<Lp/X;:TK;Lp/X;:TV;>;"
- }, project);
- assertBindingsEqual(
- "Lp/X<>.Y<Lp/X;:TK;Lp/X;:TV;>;",
- bindings);
- } finally {
- deleteProject("BinaryProject");
- }
- }
-
- /*
- * Ensures that creating a missing binary member type binding doesn't throw a NPE
- * (regression test for bug 86967 [1.5][dom] NPE in BindingKeyResolver for multi-level parameterized type binding)
- */
- public void test057() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {"Lp/Missing$Member;"});
- assertBindingsEqual(
- "<null>",
- bindings);
- }
-
- /*
- * Ensures that a type parameter binding can be created using its key in batch creation.
- * (regression test for bug 87050 ASTParser#createASTs(..) cannot resolve method type parameter binding from key)
- */
- public void test058() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " </*start*/T/*end*/> void foo(T t) {\n" +
- " }" +
- "}",
- },
- "Lp1/X;.foo<T:Ljava/lang/Object;>(TT;)V:TT;");
- }
-
- /*
- * Ensures that a capture binding can be created using its key in batch creation.
- */
- public void test059() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " Object foo(X<?> list) {\n" +
- " return /*start*/list.get()/*end*/;\n" +
- " }\n" +
- " T get() {\n" +
- " return null;\n" +
- " }\n" +
- "}",
- },
- "Lp1/X;&!Lp1/X;*77;"
- );
- }
-
- /*
- * Ensures that a capture binding can be created using its key in batch creation.
- */
- public void test060() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/xy/Cap.js",
- "package xy;\n" +
- "import java.util.Vector;\n" +
- "public class Cap {\n" +
- " {\n" +
- " Vector<?> v= null;\n" +
- " /*start*/v.get(0)/*end*/;\n" +
- " }\n" +
- "}",
- "/P/java/util/Vector.js",
- "package java.util;\n" +
- "public class Vector<T> {\n" +
- " public T get(int i) {\n" +
- " return null;\n" +
- " }\n" +
- "}"
- },
- "Lxy/Cap;&!Ljava/util/Vector;*82;"
- );
- }
-
- /*
- * Ensures that a generic constructor binding can be created using its key in batch creation.
- */
- public void test061() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " /*start*/<T> X() {\n" +
- " }/*end*/\n" +
- "}",
- },
- "Lp1/X;.<T:Ljava/lang/Object;>()V"
- );
- }
-
- /*
- * Ensures that an array binding whose leaf type is a type variable binding can be created using its key in batch creation.
- * (regression test for bug 94206 CCE in BindingKeyResolver when restoring array type of method type parameter)
- */
- public void test062() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " <T> /*start*/T[]/*end*/ foo(T[] a) {\n" +
- " return null;\n" +
- " }\n" +
- "}",
- },
- "[Lp1/X;.foo<T:Ljava/lang/Object;>([TT;)[TT;:TT;"
- );
- }
-
- /*
- * Ensures that a raw method binding can be created using its key in batch creation.
- * (regression test for bug 87749 different IMethodBindings of generic method have equal getKey())
- */
- public void test063() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " public static <T extends Y<? super T>> void foo(Z<T> z) {\n" +
- " }\n" +
- " /**\n" +
- " * @see #foo(Z)\n" +
- " */\n" +
- " void bar() {\n" +
- " /*start*/foo(new W())/*end*/;\n" +
- " }\n" +
- "}\n" +
- "class Y<T> {\n" +
- "}\n" +
- "class Z<T> {\n" +
- "}\n" +
- "class W<T> extends Z<T> {\n" +
- "}",
- },
- "Lp1/X;.foo<T:Lp1/Y<-TT;>;>(Lp1/Z<TT;>;)V%<>"
- );
- }
-
- /*
- * Ensures that a parameterized type binding with a capture binding in its arguments can be created using its key in batch creation.
- * (regression test for bug 94092 ASTParser#createASTs(..) restores wrong bindings from capture keys)
- */
- public void test064() throws CoreException {
- assertRequestedBindingsFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "/*start1*/public class X {\n" +
- " Object o= null;\n" +
- " Y<?> field;\n" +
- " void foo() {\n" +
- " /*start2*/o = field/*end2*/;\n" +
- " }\n" +
- "}/*end1*/\n",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y<T> {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/X;&Lp1/Y<!Lp1/Y;*83;>;",
- }
- );
- }
-
- /*
- * Ensures that a parameterized type binding with a type variable of the current's method in its arguments can be created using its key in batch creation.
- * (regression test for bug 97902 NPE on Open Declaration on reference to generic type)
- */
- public void test065() throws CoreException {
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " <T> void foo(/*start*/Y<T>/*end*/ y) {\n" +
- " }\n" +
- "}\n" +
- "class Y<E> {\n" +
- "}",
- },
- "Lp1/X~Y<Lp1/X;:1TT;>;"
- );
- }
-
- /*
- * Ensures that the compilation with a owner is used instead of a primary working copy when looking up a type.
- * (regression test for bug 97542 ASTParser#createASTs does not correctly resolve bindings in working copies)
- */
- public void test066() throws CoreException {
- IJavaScriptUnit primaryWorkingCopy = null;
- IJavaScriptUnit ownedWorkingcopy = null;
- try {
- // primary working copy with no method foo()
- primaryWorkingCopy = getCompilationUnit("/P/p1/X.js");
- primaryWorkingCopy.becomeWorkingCopy(null/*no progress*/);
- primaryWorkingCopy.getBuffer().setContents(
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- primaryWorkingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- // working copy for the test's owner with a method foo()
- ownedWorkingcopy = getWorkingCopy(
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {}\n" +
- "}",
- this.owner,
- false/*don't compute problems*/
- );
-
- // create bindings
- assertRequestedBindingFound(
- new String[] {
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- " void bar() {\n" +
- " /*start*/new X().foo()/*end*/;\n" +
- "}",
- },
- "Lp1/X;.foo()V"
- );
- } finally {
- if (primaryWorkingCopy != null)
- primaryWorkingCopy.discardWorkingCopy();
- if (ownedWorkingcopy != null)
- ownedWorkingcopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that the declaring class of a member parameterized type binding with a raw enclosing type is correct
- */
- public void test067() throws CoreException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<K, V> {\n" +
- " public class Y<K1, V1> {\n" +
- " }\n" +
- " /*start*/Y<K, V>/*end*/ field;\n" +
- "}"
- },
- new String[] {"Lp1/X$Y<Lp1/X;:TK;Lp1/X;:TV;>;"}
- );
- assertBindingEquals(
- "Lp1/X<>;",
- bindings.length == 0 ? null : bindings[0].getDeclaringClass()
- );
- }
-
- /*
- * Ensures that a raw member type can be created using its key in batch creation.
- */
- public void test068() throws CoreException, IOException {
- try {
- IJavaScriptProject project = createJavaProject("P1", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- addLibrary(project, "lib.jar", "src.zip", new String[] {
- "/P1/p/X.js",
- "package p;\n" +
- "public class X<K, V> {\n" +
- " public static class Member<K1, V1> {\n" +
- " }\n" +
- "}",
- "/P1/p/Y.js",
- "package p;\n" +
- "public class Y {\n" +
- " void foo(X.Member x) {\n" +
- " }\n" +
- "}",
- }, "1.5");
- assertRequestedBindingFound(
- new String[] {
- "/P1/p1/Z.js",
- "package p1;\n" +
- "public class Z extends p.Y {\n" +
- " /*start*/p.X.Member/*end*/ field;\n" +
- "}"
- },
- "Lp/X$Member<>;"
- );
- } finally {
- deleteProject("P1");
- }
- }
-
- /*
- * Ensures that requesting a CU needing a constant in a previously processed CU doesn't throw an NPE
- * (regression test for bug 111822 DOMParser.createASTs() NPE at FieldReference.getConstantFor(FieldReference.java:408))
- */
- public void test069() throws CoreException {
- this.workingCopies = createWorkingCopies(new String[] {
- "/P/pkg/RefAnnoAndClassWithAnno.js",
- "package pkg;\n" +
- "public class RefMyAnnoAndClassWithAnno {\n" +
- " final Class anno = MyAnno.class;\n" +
- " final Class withAnno = ClassWithAnnotation.class;\n" +
- "}",
- "/P/pkg/MyAnno.js",
- "package pkg;\n" +
- "public @interface MyAnno {\n" +
- " public enum EnumColor{\n" +
- " BLUE, RED, WHITE;\n" +
- " }\n" +
- " EnumColor aEnum();\n" +
- "}",
- "/P/pkg/ClassWithAnnotation.js",
- "package pkg;\n" +
- "import pkg.MyAnno.EnumColor;\n" +
- "@MyAnno(aEnum = EnumColor.BLUE)\n" +
- "public class ClassWithAnnotation {}"
- });
- String key = BindingKey.createTypeBindingKey("pkg.RefMyAnnoAndClassWithAnno");
- BindingResolver resolver = new BindingResolver(new MarkerInfo[0]);
- resolveASTs(new IJavaScriptUnit[0], new String[] {key}, resolver, getJavaProject("P"), this.owner);
- assertStringsEqual(
- "Unexpected bindings",
- "Lpkg/RefAnnoAndClassWithAnno~RefMyAnnoAndClassWithAnno;\n",
- resolver.getFoundKeys());
- }
-
- /*
- * Ensures that unrequested compilation units are not resolved
- * (regression test for bug 114935 ASTParser.createASTs parses more CUs then required)
- */
- public void test070() throws CoreException {
- MarkerInfo[] markerInfos = createMarkerInfos(new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X extends /*start*/Y/*end*/ {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- " static final int CONST = 2 + 3;\n" +
- "}",
- });
- this.workingCopies = createWorkingCopies(markerInfos, this.owner);
- TestASTRequestor requestor = new TestASTRequestor();
- resolveASTs(new IJavaScriptUnit[] {this.workingCopies[0]}, requestor);
-
- // get the binding for Y
- Type y = (Type) findNode((JavaScriptUnit) requestor.asts.get(0), markerInfos[0]);
- ITypeBinding yBinding = y.resolveBinding();
-
- // ensure that the fields for Y are not resolved
- assertBindingsEqual("", yBinding.getDeclaredFields());
- }
-
- /*
- * Ensures that unrequested compilation units are not resolved
- * (regression test for bug 117018 IVariableBinding#getConstantValue() could be lazy resolved)
- */
- public void test071() throws CoreException {
- final MarkerInfo[] markerInfos = createMarkerInfos(new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X extends /*start*/Y/*end*/ {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- " static final int CONST = 2 + 3;\n" +
- "}",
- });
- this.workingCopies = createWorkingCopies(markerInfos, this.owner);
- class Requestor extends TestASTRequestor {
- Object constantValue = null;
- public void acceptAST(IJavaScriptUnit source, JavaScriptUnit ast) {
- super.acceptAST(source, ast);
- Type y = (Type) findNode(ast, markerInfos[0]);
- ITypeBinding typeBinding = y.resolveBinding();
- IVariableBinding fieldBinding = typeBinding.getDeclaredFields()[0];
- this.constantValue = fieldBinding.getConstantValue();
- }
- }
- Requestor requestor = new Requestor();
- resolveASTs(new IJavaScriptUnit[] {this.workingCopies[0]}, requestor);
-
- assertEquals("Unexpected constant value", new Integer(5), requestor.constantValue);
- }
-
- /*
- * Ensures that the declaring method of a local variable binding retrieved using its key
- * is not null
- * (regression test for bug 129804 Local variable bindings from ASTParser#createASTs(.., String[], .., ..) have no declaring method)
- */
- public void _test072() throws CoreException {
- IVariableBinding[] bindings = createVariableBindings(
- new String[] {
- "/P/X.js",
- "public class X {\n" +
- " void m() {\n" +
- " Object o;\n" +
- " }\n" +
- "}"
- },
- new String[] {
- "LX;.m()V#o"
- }
- );
- assertBindingEquals(
- "LX;.m()V",
- bindings[0].getDeclaringMethod());
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BindingsCollectorVisitor.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BindingsCollectorVisitor.java
deleted file mode 100644
index b4426d0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BindingsCollectorVisitor.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.HashMap;
-import java.util.HashSet;
-
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-/**
- * @author oliviert
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-class BindingsCollectorVisitor extends ASTVisitor {
-
- private HashMap hashMap;
- private HashSet set;
-
- BindingsCollectorVisitor() {
- // visit Javadoc.tags() as well
- super(true);
- this.hashMap = new HashMap();
- this.set = new HashSet();
- }
-
- private void collectBindings(
- ASTNode node,
- IBinding binding) {
- if (binding != null) {
- hashMap.put(node, binding);
- } else {
- set.add(node);
- }
- }
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(AnonymousClassDeclaration)
- */
- public void endVisit(AnonymousClassDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayAccess)
- */
- public void endVisit(ArrayAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayCreation)
- */
- public void endVisit(ArrayCreation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayInitializer)
- */
- public void endVisit(ArrayInitializer node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayType)
- */
- public void endVisit(ArrayType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(Assignment)
- */
- public void endVisit(Assignment node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(BooleanLiteral)
- */
- public void endVisit(BooleanLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(CharacterLiteral)
- */
- public void endVisit(CharacterLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ClassInstanceCreation)
- */
- public void endVisit(ClassInstanceCreation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ConditionalExpression)
- */
- public void endVisit(ConditionalExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ConstructorInvocation)
- */
- public void endVisit(ConstructorInvocation node) {
- IFunctionBinding methodBinding = node.resolveConstructorBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FieldAccess)
- */
- public void endVisit(FieldAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ImportDeclaration)
- */
- public void endVisit(ImportDeclaration node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(InfixExpression)
- */
- public void endVisit(InfixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(InstanceofExpression)
- */
- public void endVisit(InstanceofExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see ASTVisitor#endVisit(MemberRef)
- * @since 3.0
- */
- public void endVisit(MemberRef node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- public void endVisit(ListExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FunctionDeclaration)
- */
- public void endVisit(FunctionDeclaration node) {
- IFunctionBinding methodBinding = node.resolveBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FunctionInvocation)
- */
- public void endVisit(FunctionInvocation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see ASTVisitor#endVisit(FunctionRef )
- * @since 3.0
- */
- public void endVisit(FunctionRef node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(NullLiteral)
- */
- public void endVisit(NullLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(NumberLiteral)
- */
- public void endVisit(NumberLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PackageDeclaration)
- */
- public void endVisit(PackageDeclaration node) {
- IPackageBinding packageBinding = node.resolveBinding();
- collectBindings(node, packageBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ParenthesizedExpression)
- */
- public void endVisit(ParenthesizedExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PostfixExpression)
- */
- public void endVisit(PostfixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PrefixExpression)
- */
- public void endVisit(PrefixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PrimitiveType)
- */
- public void endVisit(PrimitiveType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(QualifiedName)
- */
- public void endVisit(QualifiedName node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SimpleName)
- */
- public void endVisit(SimpleName node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SimpleType)
- */
- public void endVisit(SimpleType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SingleVariableDeclaration)
- */
- public void endVisit(SingleVariableDeclaration node) {
- IVariableBinding variableBinding = node.resolveBinding();
- collectBindings(node, variableBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(StringLiteral)
- */
- public void endVisit(StringLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperConstructorInvocation)
- */
- public void endVisit(SuperConstructorInvocation node) {
- IFunctionBinding methodBinding = node.resolveConstructorBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperFieldAccess)
- */
- public void endVisit(SuperFieldAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperMethodInvocation)
- */
- public void endVisit(SuperMethodInvocation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ThisExpression)
- */
- public void endVisit(ThisExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(TypeDeclaration)
- */
- public void endVisit(TypeDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(TypeLiteral)
- */
- public void endVisit(TypeLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(VariableDeclarationExpression)
- */
- public void endVisit(VariableDeclarationExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(VariableDeclarationFragment)
- */
- public void endVisit(VariableDeclarationFragment node) {
- IVariableBinding variableBinding = node.resolveBinding();
- collectBindings(node, variableBinding);
- }
-
- /**
- * Returns the hashMap.
- * @return HashMap
- */
- public HashMap getBindingsMap() {
- return hashMap;
- }
-
- /**
- * Returns the set.
- * @return HashSet
- */
- public HashSet getUnresolvedNodesSet() {
- return set;
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/CompatibilityRulesTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/CompatibilityRulesTests.java
deleted file mode 100644
index bd91f13..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/CompatibilityRulesTests.java
+++ /dev/null
@@ -1,787 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-
-import junit.framework.Test;
-
-public class CompatibilityRulesTests extends AbstractASTTests {
-
- public CompatibilityRulesTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(CompatibilityRulesTests.class);
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
-// TESTS_PREFIX = "testBug86380";
-// TESTS_NAMES = new String[] { "test032" };
-// TESTS_NUMBERS = new int[] { 83230 };
-// TESTS_RANGE = new int[] { 83304, -1 };
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- }
-
- public void tearDownSuite() throws Exception {
- deleteProject("P");
- super.tearDownSuite();
- }
-
- /*
- * Ensures that a subtype is subtype compatible with its super type
- */
- public void test001() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should be subtype compatible with Y", bindings[1].isSubTypeCompatible(bindings[0]));
- }
-
- /*
- * Ensures that a type is subtype compatible with itself
- */
- public void test002() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- });
- assertTrue("X should be subtype compatible with itself", bindings[0].isSubTypeCompatible(bindings[0]));
- }
-
- /*
- * Ensures that a supertype is not subtype compatible with its subtype
- */
- public void test003() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should not be subtype compatible with Y", !bindings[0].isSubTypeCompatible(bindings[1]));
- }
-
- /*
- * Ensures that a type is not subtype compatible with an unrelated type.
- */
- public void test004() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should not be subtype compatible with Y", !bindings[0].isSubTypeCompatible(bindings[1]));
- }
-
- /*
- * Ensures that the int base type is not subtype compatible with the long base type
- */
- public void test005() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {
- "I",
- "J"
- });
- assertTrue("int should not be subtype compatible with long", !bindings[0].isSubTypeCompatible(bindings[1]));
- }
-
- /*
- * Ensures that the int base type is not subtype compatible with the java.lang.Object type
- */
- public void test006() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {
- "I",
- "Ljava/lang/Object;"
- });
- assertTrue("int should not be subtype compatible with Object", !bindings[0].isSubTypeCompatible(bindings[1]));
- }
-
- /*
- * Ensures that a subtype is assignment compatible with its super type
- */
- public void test007() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should be assignment compatible with Y", bindings[1].isAssignmentCompatible(bindings[0]));
- }
-
- /*
- * Ensures that a type is assignment compatible with itself
- */
- public void test008() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- });
- assertTrue("X should be assignment compatible with itself", bindings[0].isAssignmentCompatible(bindings[0]));
- }
-
- /*
- * Ensures that a supertype is not assignment compatible with its subtype
- */
- public void test009() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should not be assignment compatible with Y", !bindings[0].isAssignmentCompatible(bindings[1]));
- }
-
- /*
- * Ensures that a type is not assigment compatible with an unrelated type.
- */
- public void test010() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should not be assigment compatible with Y", !bindings[0].isAssignmentCompatible(bindings[1]));
- }
-
- /*
- * Ensures that the int base type is assignment compatible with the long base type
- */
- public void test011() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {
- "I",
- "J"
- });
- assertTrue("int should be assignment compatible with long", bindings[0].isAssignmentCompatible(bindings[1]));
- }
-
- /*
- * Ensures that the int base type is not assignment compatible with the java.lang.Object type in 1.4 mode.
- */
- public void test012() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P14", new String[] {""}, new String[] {"JCL_LIB"}, "", "1.4");
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {
- "I",
- "Ljava/lang/Object;"
- },
- project);
- assertTrue("int should not be assignment compatible with Object", !bindings[0].isAssignmentCompatible(bindings[1]));
- } finally {
- deleteProject("P14");
- }
- }
-
- /*
- * Ensures that a subtype is cast compatible with its super type
- */
- public void test013() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should be cast compatible with Y", bindings[1].isCastCompatible(bindings[0]));
- }
-
- /*
- * Ensures that a type is cast compatible with itself
- */
- public void test014() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- });
- assertTrue("X should be cast compatible with itself", bindings[0].isCastCompatible(bindings[0]));
- }
-
- /*
- * Ensures that a supertype is cast compatible with its subtype
- */
- public void test015() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should be cast compatible with Y", bindings[0].isCastCompatible(bindings[1]));
- }
-
- /*
- * Ensures that a type is not cast compatible with an unrelated type.
- */
- public void test016() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;",
- "Lp1/Y;"
- });
- assertTrue("X should not be cast compatible with Y", !bindings[0].isCastCompatible(bindings[1]));
- }
-
- /*
- * Ensures that the int base type is cast compatible with the long base type
- */
- public void test017() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {
- "I",
- "J"
- });
- assertTrue("int should be cast compatible with long", bindings[0].isCastCompatible(bindings[1]));
- }
-
- /*
- * Ensures that the int base type is not cast compatible with the java.lang.Object type
- */
- public void test018() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {
- "I",
- "Ljava/lang/Object;"
- });
- assertTrue("int should not be cast compatible with Object", !bindings[0].isCastCompatible(bindings[1]));
- }
-
- /*
- * Ensures that a method in a subtype overrides the corresponding method in the super type.
- */
- public void test019() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/Y;.foo()V",
- "Lp1/X;.foo()V"
- });
- assertTrue("Y#foo() should override X#foo()", bindings[0].overrides(bindings[1]));
- }
-
- /*
- * Ensures that a method in a super type doesn't override the corresponding method in a subtype.
- */
- public void test020() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/X;.foo()V",
- "Lp1/Y;.foo()V"
- });
- assertTrue("X#foo() should not override Y#foo()", !bindings[0].overrides(bindings[1]));
- }
-
- /*
- * Ensures that a method doesn't override the corresponding method in an unrelated type.
- */
- public void test021() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/X;.foo()V",
- "Lp1/Y;.foo()V"
- });
- assertTrue("X#foo() should not override Y#foo()", !bindings[0].overrides(bindings[1]));
- }
-
- /*
- * Ensures that IFunctionBinding#ovverides(IFunctionBinding) doesn't throw a NullPointerException if
- * the method was not built in a batch.
- * (regression test for bug 79635 NPE when asking an IFunctionBinding whether it overrides itself)
- */
- public void test022() throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getWorkingCopy("/P/p1/X.js", true/*compute problems to get bindings*/);
- ASTNode node = buildAST(
- "package p1;\n" +
- "public class X {\n" +
- " /*start*/void foo() {\n" +
- " }/*end*/\n" +
- "}",
- workingCopy);
- IFunctionBinding methodBinding = ((FunctionDeclaration) node).resolveBinding();
- assertTrue("X#foo() should not override itself", !methodBinding.overrides(methodBinding));
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
-
- /*
- * Ensures that a base type is assignment compatible with its wrapper type
- * (regression test for bug 80455 [5.0] ITypeBinding.canAssign not aware of type boxing)
- */
- public void test023() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {
- "/P/java/lang/Integer.js",
- "package java.lang;\n" +
- "public class Integer {\n" +
- "}",
- },
- new String[] {
- "I",
- "Ljava/lang/Integer;",
- });
- assertTrue("int should be assignment compatible with Integer", bindings[0].isAssignmentCompatible(bindings[1]));
- }
-
- /*
- * Ensures that a base type is assignment compatible with Object
- */
- public void test024() throws JavaScriptModelException {
- ITypeBinding[] bindings = createTypeBindings(
- new String[] {},
- new String[] {
- "I",
- "Ljava/lang/Object;",
- });
- assertTrue("int should be assignment compatible with Object", bindings[0].isAssignmentCompatible(bindings[1]));
- }
-
- /*
- * Ensures that a method is subsignature of itself.
- */
- public void test025() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/X;.foo()V"
- });
- assertTrue("X#foo() should be a subsignature of X#foo()", bindings[0].isSubsignature(bindings[0]));
- }
-
- /*
- * Ensures that a method is subsignature of its super method.
- */
- public void test026() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " String foo(Object o) {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " String foo(Object o) {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/X;.foo(Ljava/lang/Object;)Ljava/lang/String;",
- "Lp1/Y;.foo(Ljava/lang/Object;)Ljava/lang/String;",
- });
- assertTrue("Y#foo(Object) should be a subsignature of X#foo(Object)", bindings[1].isSubsignature(bindings[0]));
- }
-
- /*
- * Ensures that a method is subsignature of its super generic method.
- */
- public void test027() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " Z<T> foo(Z<T> o) {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " Z foo(Z o) {\n" +
- " }\n" +
- "}",
- "/P/p1/Z.js",
- "package p1;\n" +
- "public class Z<T> {\n" +
- "}",
- },
- new String[] {
- "Lp1/X;.foo(Lp1/Z<TT;>;)Lp1/Z<TT;>;",
- "Lp1/Y;.foo(Lp1/Z;)Lp1/Z;",
- });
- assertTrue("Y#foo(Z) should be a subsignature of X#foo(Z<T>)", bindings[1].isSubsignature(bindings[0]));
- }
-
- /*
- * Ensures that a method is not the subsignature of an unrelated method.
- */
- public void test028() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y {\n" +
- " void bar() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/X;.foo()V",
- "Lp1/Y;.bar()V",
- });
- assertTrue("Y#bar() should not be a subsignature of X#foo()", !bindings[1].isSubsignature(bindings[0]));
- }
-
- /*
- * Ensures that a method in a subtype doesn't override the a method with same parameters but with different name in the super type.
- */
- public void test029() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " void bar() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/Y;.bar()V",
- "Lp1/X;.foo()V"
- });
- assertTrue("Y#bar() should not override X#foo()", !bindings[0].overrides(bindings[1]));
- }
-
- /*
- * Ensures that a method in a subtype overrides a method in the super parameterized type.
- * (regression test for bug 99608 IFunctionBinding#overrides returns false on overridden method)
- */
- public void test030() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X<T> {\n" +
- " void foo(T t) {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X<String> {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/Y;.foo(Ljava/lang/String;)V",
- "Lp1/X;.foo(TT;)V"
- });
- assertTrue("Y#foo(String) should override X#foo(T)", bindings[0].overrides(bindings[1]));
- }
-
- /*
- * Ensures that a method with the same parameter types but with different type parameters is not a subsignature of its super method.
- * (regression test for bug 107110 IFunctionBinding.isSubsignature not yet correctly implemented)
- */
- public void test031() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "class Y extends X {\n" +
- " <T> void foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/X;.foo()V",
- "Lp1/Y;.foo<T:Ljava/lang/Object;>()V"
- });
- assertFalse("Y#foo() should not be a subsignature of X#foo()", bindings[1].isSubsignature(bindings[0]));
- }
-
- /*
- * Ensures that a method in a subtype overrides the corresponding method in the super type
- * even if the two methods have different return types.
- * (regression test for bug 105808 [1.5][dom] FunctionBinding#overrides(..) should not consider return types)
- */
- public void test032() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, "", "1.4");
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " Object foo() {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " String foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/Y;.foo()Ljava/lang/String;",
- "Lp1/X;.foo()Ljava/lang/Object;"
- },
- project);
- assertTrue("Y#foo() should override X#foo()", bindings[0].overrides(bindings[1]));
- } finally {
- deleteProject("P2");
- }
- }
-
- /*
- * Ensures that a method in a subtype doesn't override the corresponding private method in the super type.
- * (regression test for bug 132191 IFunctionBinding.overrides(IFunctionBinding) returns true even if the given argument is private.)
- */
- public void test033() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " private void foo() {\n" +
- " }\n" +
- "}",
- "/P/p1/Y.js",
- "package p1;\n" +
- "public class Y extends X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp1/Y;.foo()V",
- "Lp1/X;.foo()V"
- });
- assertTrue("Y#foo() should not override X#foo()", !bindings[0].overrides(bindings[1]));
- }
-
- /*
- * Ensures that a method in a subtype doesn't override the corresponding default method in the super type in a different package.
- * (regression test for bug 132191 IFunctionBinding.overrides(IFunctionBinding) returns true even if the given argument is private.)
- */
- public void test034() throws JavaScriptModelException {
- IFunctionBinding[] bindings = createMethodBindings(
- new String[] {
- "/P/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- "/P/p2/Y.js",
- "package p2;\n" +
- "public class Y extends p1.X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- },
- new String[] {
- "Lp2/Y;.foo()V",
- "Lp1/X;.foo()V"
- });
- assertTrue("Y#foo() should not override X#foo()", !bindings[0].overrides(bindings[1]));
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ConverterTestSetup.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ConverterTestSetup.java
deleted file mode 100644
index 34650fd..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ConverterTestSetup.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.compiler.libraries.SystemLibraryLocation;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.QualifiedType;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-public abstract class ConverterTestSetup extends AbstractASTTests {
-
- /** @deprecated Using deprecated code */
- public static final int AST_INTERNAL_JLS2 = AST.JLS2;
-
- protected AST ast;
- static List TEST_SUITES = null;
- static boolean PROJECT_SETUP = false;
-
- protected ConverterTestSetup(String name) {
- super(name);
- }
-
- protected IPath getConverterJCLPath() {
- return getConverterJCLPath(""); //$NON-NLS-1$
- }
-
- protected IPath getConverterJCLPath(String compliance) {
- return new Path(new SystemLibraryLocation().getLibraryPath("system.js"));
- }
-
- protected IPath getConverterJCLRootSourcePath() {
- return new Path(""); //$NON-NLS-1$
- }
-
- /**
- * Reset the jar placeholder and delete project.
- */
- public void tearDownSuite() throws Exception {
- ast = null;
- if (TEST_SUITES == null) {
- this.deleteProject("Converter"); //$NON-NLS-1$
- } else {
- TEST_SUITES.remove(getClass());
- if (TEST_SUITES.size() == 0) {
- this.deleteProject("Converter"); //$NON-NLS-1$
- }
- }
- super.tearDown();
- }
-
- public void setUpJCLClasspathVariables() throws JavaScriptModelException, IOException {
- if (JavaScriptCore.getIncludepathVariable("CONVERTER_JCL_LIB") == null) {
- JavaScriptCore.setIncludepathVariables(
- new String[] {"CONVERTER_JCL_LIB", "CONVERTER_JCL_SRCROOT"},
- new IPath[] {getConverterJCLPath(), getConverterJCLRootSourcePath()},
- null);
- }
- }
-
- /**
- * Create project and set the jar placeholder.
- */
- public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- if (!PROJECT_SETUP) {
- setUpJavaProject("Converter"); //$NON-NLS-1$
- waitUntilIndexesReady(); // needed to find secondary types
- PROJECT_SETUP = true;
- }
- }
-
- public ASTNode runConversion(IJavaScriptUnit unit, boolean resolveBindings) {
- return runConversion(AST_INTERNAL_JLS2, unit, resolveBindings);
- }
-
- public ASTNode runConversion(IJavaScriptUnit unit, int position, boolean resolveBindings) {
- return runConversion(AST_INTERNAL_JLS2, unit, position, resolveBindings);
- }
-
- public ASTNode runConversion(IClassFile classFile, int position, boolean resolveBindings) {
- return runConversion(AST_INTERNAL_JLS2, classFile, position, resolveBindings);
- }
-
- public ASTNode runConversion(char[] source, String unitName, IJavaScriptProject project) {
- return runConversion(AST_INTERNAL_JLS2, source, unitName, project);
- }
-
- public ASTNode runConversion(char[] source, String unitName, IJavaScriptProject project, boolean resolveBindings) {
- return runConversion(AST_INTERNAL_JLS2, source, unitName, project, resolveBindings);
- }
-
- public ASTNode runConversion(int astLevel, IJavaScriptUnit unit, boolean resolveBindings) {
- return runConversion(astLevel, unit, resolveBindings, false);
- }
-
- public ASTNode runConversion(int astLevel, IJavaScriptUnit unit, boolean resolveBindings, boolean statementsRecovery) {
- ASTParser parser = ASTParser.newParser(astLevel);
- parser.setSource(unit);
- parser.setResolveBindings(resolveBindings);
- parser.setStatementsRecovery(statementsRecovery);
- return parser.createAST(null);
- }
-
- class NullBindingVerifier extends ASTVisitor {
-
- public void endVisit(ArrayAccess node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ArrayCreation node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ArrayInitializer node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(Assignment node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(BooleanLiteral node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(CharacterLiteral node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ClassInstanceCreation node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ConditionalExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(FieldAccess node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(InfixExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(InstanceofExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(FunctionInvocation node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(NullLiteral node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(NumberLiteral node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ParenthesizedExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(PostfixExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(PrefixExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(StringLiteral node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(SuperFieldAccess node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(SuperMethodInvocation node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ThisExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(TypeLiteral node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(VariableDeclarationExpression node) {
- assertNotNull(node+" should have a binding", node.resolveTypeBinding());
- super.endVisit(node);
- }
-
- public void endVisit(AnonymousClassDeclaration node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ArrayType node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(ImportDeclaration node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(MemberRef node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(FunctionDeclaration node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(FunctionRef node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(PackageDeclaration node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(PrimitiveType node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(QualifiedName node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(QualifiedType node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(SimpleName node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(SimpleType node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(SingleVariableDeclaration node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(TypeDeclaration node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(TypeDeclarationStatement node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- public void endVisit(VariableDeclarationFragment node) {
- assertNotNull(node+" should have a binding", node.resolveBinding());
- super.endVisit(node);
- }
-
- }
- public ASTNode runJLS3Conversion(IJavaScriptUnit unit, boolean resolveBindings, boolean checkJLS2) {
-
- // Create parser
- ASTParser parser;
- if (checkJLS2) {
- parser = ASTParser.newParser(AST_INTERNAL_JLS2);
- parser.setSource(unit);
- parser.setResolveBindings(resolveBindings);
- parser.createAST(null);
- }
-
- parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(unit);
- parser.setResolveBindings(resolveBindings);
-
- // Parse compilation unit
- ASTNode result = parser.createAST(null);
-
- // Verify we get a compilation unit node and that binding are correct
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- if (resolveBindings && compilationUnit.getProblems().length == 0) {
- compilationUnit.accept(new NullBindingVerifier());
- }
- return result;
- }
-
- public ASTNode runConversion(int astLevel, IJavaScriptUnit unit, int position, boolean resolveBindings) {
-
- // Create parser
- ASTParser parser = ASTParser.newParser(astLevel);
- parser.setSource(unit);
- parser.setFocalPosition(position);
- parser.setResolveBindings(resolveBindings);
-
- // Parse compilation unit
- ASTNode result = parser.createAST(null);
-
- // Verify we get a compilation unit node and that binding are correct
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- if (resolveBindings && compilationUnit.getProblems().length == 0) {
- compilationUnit.accept(new NullBindingVerifier());
- }
- return result;
- }
-
- public ASTNode runConversion(int astLevel, IClassFile classFile, int position, boolean resolveBindings) {
-
- // Create parser
- ASTParser parser = ASTParser.newParser(astLevel);
- parser.setSource(classFile);
- parser.setFocalPosition(position);
- parser.setResolveBindings(resolveBindings);
-
- // Parse compilation unit
- ASTNode result = parser.createAST(null);
-
- // Verify we get a compilation unit node and that binding are correct
- assertTrue("Not a compilation unit", result.getNodeType() == ASTNode.JAVASCRIPT_UNIT);
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- if (resolveBindings && compilationUnit.getProblems().length == 0) {
- compilationUnit.accept(new NullBindingVerifier());
- }
- return result;
- }
-
- public ASTNode runConversion(int astLevel, char[] source, String unitName, IJavaScriptProject project) {
- return runConversion(astLevel, source, unitName, project, false);
- }
-
- public ASTNode runConversion(int astLevel, char[] source, String unitName, IJavaScriptProject project, boolean resolveBindings) {
- return runConversion(astLevel, source, unitName, project, null, resolveBindings);
- }
-
- public ASTNode runConversion(int astLevel, char[] source, String unitName, IJavaScriptProject project, Map options, boolean resolveBindings) {
- ASTParser parser = ASTParser.newParser(astLevel);
- parser.setSource(source);
- parser.setUnitName(unitName);
- parser.setProject(project);
- if (options != null) {
- parser.setCompilerOptions(options);
- }
- parser.setResolveBindings(resolveBindings);
- return parser.createAST(null);
- }
-
- public ASTNode runConversion(int astLevel, char[] source, String unitName, IJavaScriptProject project, Map options) {
- return runConversion(astLevel, source, unitName, project, options, false);
- }
-
- public ASTNode runConversion(char[] source, String unitName, IJavaScriptProject project, Map options, boolean resolveBindings) {
- return runConversion(AST_INTERNAL_JLS2, source, unitName, project, options, resolveBindings);
- }
- public ASTNode runConversion(char[] source, String unitName, IJavaScriptProject project, Map options) {
- return runConversion(AST_INTERNAL_JLS2, source, unitName, project, options);
- }
-
- protected ASTNode getASTNodeToCompare(org.eclipse.wst.jsdt.core.dom.JavaScriptUnit unit) {
- ExpressionStatement statement = (ExpressionStatement) getASTNode(unit, 0, 0, 0);
- return (ASTNode) ((FunctionInvocation) statement.getExpression()).arguments().get(0);
- }
-
- protected ASTNode getASTNode(org.eclipse.wst.jsdt.core.dom.JavaScriptUnit unit, int typeIndex, int bodyIndex, int statementIndex) {
- BodyDeclaration bodyDeclaration = (BodyDeclaration) getASTNode(unit, typeIndex, bodyIndex);
- if (bodyDeclaration instanceof FunctionDeclaration) {
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) bodyDeclaration;
- Block block = methodDeclaration.getBody();
- return (ASTNode) block.statements().get(statementIndex);
- } else if (bodyDeclaration instanceof TypeDeclaration) {
- TypeDeclaration typeDeclaration = (TypeDeclaration) bodyDeclaration;
- return (ASTNode) typeDeclaration.bodyDeclarations().get(statementIndex);
- } else if (bodyDeclaration instanceof Initializer) {
- Initializer initializer = (Initializer) bodyDeclaration;
- Block block = initializer.getBody();
- return (ASTNode) block.statements().get(statementIndex);
- }
- return null;
- }
-
- protected ASTNode getASTNode(org.eclipse.wst.jsdt.core.dom.JavaScriptUnit unit, int typeIndex, int bodyIndex) {
- return (ASTNode) unit.statements().get(bodyIndex);
- }
-
- protected ASTNode getASTNode(org.eclipse.wst.jsdt.core.dom.JavaScriptUnit unit, int typeIndex) {
- return (ASTNode) unit.types().get(typeIndex);
- }
-
- protected void checkSourceRange(ASTNode node, String expectedContents, String source) {
- assertNotNull("The node is null", node); //$NON-NLS-1$
- assertTrue("The node(" + node.getClass() + ").getLength() == 0", node.getLength() != 0); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("The node.getStartPosition() == -1", node.getStartPosition() != -1); //$NON-NLS-1$
- int length = node.getLength();
- int start = node.getStartPosition();
- String actualContentsString = source.substring(start, start + length);
- assertSourceEquals("Unexpected source", Util.convertToIndependantLineDelimiter(expectedContents), Util.convertToIndependantLineDelimiter(actualContentsString));
- }
-
- protected void checkSourceRange(ASTNode node, String expectedContents, char[] source) {
- assertNotNull("The node is null", node); //$NON-NLS-1$
- assertTrue("The node(" + node.getClass() + ").getLength() == 0", node.getLength() != 0); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("The node.getStartPosition() == -1", node.getStartPosition() != -1); //$NON-NLS-1$
- int length = node.getLength();
- int start = node.getStartPosition();
- char[] actualContents = new char[length];
- System.arraycopy(source, start, actualContents, 0, length);
- String actualContentsString = new String(actualContents);
- assertSourceEquals("Unexpected source", Util.convertToIndependantLineDelimiter(expectedContents), Util.convertToIndependantLineDelimiter(actualContentsString));
- }
-
- protected boolean isMalformed(ASTNode node) {
- return (node.getFlags() & ASTNode.MALFORMED) != 0;
- }
-
- protected boolean isRecovered(ASTNode node) {
- return (node.getFlags() & ASTNode.RECOVERED) != 0;
- }
-
- protected boolean isOriginal(ASTNode node) {
- return (node.getFlags() & ASTNode.ORIGINAL) != 0;
- }
-
- protected void assertProblemsSize(JavaScriptUnit compilationUnit, int expectedSize) {
- assertProblemsSize(compilationUnit, expectedSize, "");
- }
- protected void assertProblemsSize(JavaScriptUnit compilationUnit, int expectedSize, String expectedOutput) {
- final IProblem[] problems = compilationUnit.getProblems();
- final int length = problems.length;
- if (length != expectedSize) {
- checkProblemMessages(expectedOutput, problems, length);
- assertEquals("Wrong size", expectedSize, length);
- }
- checkProblemMessages(expectedOutput, problems, length);
- }
-
- private void checkProblemMessages(String expectedOutput, final IProblem[] problems, final int length) {
- if (length != 0) {
- if (expectedOutput != null) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < length; i++) {
- buffer.append(problems[i].getMessage());
- if (i < length - 1) {
- buffer.append('\n');
- }
- }
- String actualOutput = String.valueOf(buffer);
- expectedOutput = Util.convertToIndependantLineDelimiter(expectedOutput);
- actualOutput = Util.convertToIndependantLineDelimiter(actualOutput);
- if (!expectedOutput.equals(actualOutput)) {
- System.out.println(Util.displayString(actualOutput));
- assertEquals("different output", expectedOutput, actualOutput);
- }
- }
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/GetKeyVisitor.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/GetKeyVisitor.java
deleted file mode 100644
index 650a0d7..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/GetKeyVisitor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import junit.framework.Assert;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-
-class GetKeyVisitor extends ASTVisitor {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.SimpleName)
- */
- public boolean visit(ClassInstanceCreation node) {
- IFunctionBinding constructorBinding = node.resolveConstructorBinding();
- Assert.assertNotNull(constructorBinding);
- Assert.assertNotNull(constructorBinding.getKey());
- return super.visit(node);
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ProfilingASTConvertionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ProfilingASTConvertionTest.java
deleted file mode 100644
index 00ecd2b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ProfilingASTConvertionTest.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.io.File;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests;
-
-public class ProfilingASTConvertionTest extends AbstractJavaModelTests {
-
- static class Result implements Comparable {
- long length;
- long time;
- String unitName;
- Result(String unitName, long time, long length) {
- this.time = time;
- this.unitName = unitName;
- this.length = length / 1024;
- }
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Object o) {
- Result result = (Result) o;
- if (this.time < result.time) {
- return -1;
- } else if (this.time == result.time) {
- return 0;
- }
- return 1;
- }
- }
- private static final int INCREMENTS = 100;
-
- private static boolean RESOLVE_BINDINGS = false;
-
- public static Test suite() {
- return buildModelTestSuite(ProfilingASTConvertionTest.class);
- }
-
- IJavaScriptUnit[] compilationUnits;
-
- public ProfilingASTConvertionTest(String name) {
- super(name);
- }
-
- public String display(int value, int numberOfFiguresForRange) {
- int numberOfFigures = value == 0 ? 1 : (int) (Math.log(value)/ Math.log(10));
- if ((value % 10) == 0) {
- numberOfFigures = (int) (Math.log(value + 1)/ Math.log(10));
- }
- StringBuffer buffer = new StringBuffer();
- while(numberOfFigures < numberOfFiguresForRange) {
- buffer.append(" ");
- numberOfFigures++;
- }
- buffer.append(value);
- return String.valueOf(buffer);
- }
-
- /**
- * @param array
- * @param increment
- */
- private void printDistribution(long[] array, int increment) {
- int bound = increment;
- int counter = 0;
- int totalCounter = 0;
- int length = array.length;
- long max = array[length - 1];
- int numberOfFiguresForRange = (int) (Math.log(max)/ Math.log(10));
- if ((max % increment) == 0) {
- numberOfFiguresForRange = (int) (Math.log(max + 1)/ Math.log(10));
- }
- int numberOfFiguresForCounter = (int) (Math.log(length)/ Math.log(10));
- if ((length % increment) == 0) {
- numberOfFiguresForCounter = (int) (Math.log(length + 1)/ Math.log(10));
- }
- for (int i = 0; i < length; i++) {
- if (array[i] < bound) {
- counter++;
- } else {
- i--;
- totalCounter += counter;
- printRange(counter, bound, increment, totalCounter, length, numberOfFiguresForRange, numberOfFiguresForCounter);
- counter = 0;
- bound += increment;
- }
- }
- totalCounter += counter;
- printRange(counter, bound, increment, totalCounter, length, numberOfFiguresForRange, numberOfFiguresForCounter);
- }
-
- /**
- * @param counter
- * @param bound
- */
- private void printRange(int counter, int bound, int increment, int totalCounter, int length, int numberOfFiguresForRange, int numberOfFiguresForCounters) {
- if (counter != 0) {
- StringBuffer buffer = new StringBuffer();
- int low = bound - increment;
- if (low != 0) {
- low++;
- }
- DecimalFormat format = new DecimalFormat("###.##");
- buffer
- .append(display(low, numberOfFiguresForRange))
- .append(" - ")
- .append(display(bound, numberOfFiguresForRange))
- .append(" : ")
- .append(display(counter, numberOfFiguresForCounters))
- .append("\t\t")
- .append(format.format(100.0 * ((double) totalCounter / length)));
- System.out.println(String.valueOf(buffer));
- }
- }
-
- /**
- * @param totalTime
- * @param length
- * @param times
- * @param arrayList
- * @deprecated using deprecated code
- */
- private void reportResults(int apiLevel, long totalTime, int length, long[] times, ArrayList arrayList) {
- System.out.println("===============================================================================");
- System.out.print("================================ ");
- switch(apiLevel) {
- case AST.JLS2 :
- System.out.print("JLS2");
- break;
- case AST.JLS3 :
- System.out.print("JLS3");
- break;
- }
- System.out.print(" BINDING IS ");
- System.out.print(RESOLVE_BINDINGS ? "ON " : "OFF ");
- System.out.println("==========================");
- System.out.println("===============================================================================");
- Arrays.sort(times);
- System.out.println("===================================== TIMES ===================================");
- System.out.println("Fastest = " + times[0] + "ms");
- long maxTime = times[length - 1];
- System.out.println("Slowest = " + maxTime + "ms");
- System.out.println("Total = " + totalTime + "ms");
- System.out.println("================================== DISTRIBUTION ===============================");
- printDistribution(times, INCREMENTS);
- System.out.println("================================= SORTED BY TIME ==============================");
- Collections.sort(arrayList);
- for (Iterator iterator = arrayList.iterator(); iterator.hasNext(); ) {
- final Result next = (Result) iterator.next();
- System.out.println(next.unitName + "(" + next.length + "KB) - " + next.time + "ms");
- }
- System.out.println("================================ SORTED BY LENGTH =============================");
- Collections.sort(arrayList, new Comparator() {
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- Result r1 = (Result) o1;
- Result r2 = (Result) o2;
- if (r1.length < r2.length) {
- return -1;
- } else if (r1.length == r2.length) {
- return 0;
- }
- return 1;
- }
- });
- for (Iterator iterator = arrayList.iterator(); iterator.hasNext(); ) {
- final Result next = (Result) iterator.next();
- System.out.println(next.unitName + "(" + next.length + "KB) - " + next.time + "ms");
- }
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- // ensure variables are set
- if (JavaScriptCore.getIncludepathVariable("CONVERTER_JCL_LIB") == null) { //$NON-NLS-1$
- setupExternalJCL("converterJclMin");
- JavaScriptCore.setIncludepathVariables(
- new String[] {"CONVERTER_JCL_LIB", "CONVERTER_JCL_SRC", "CONVERTER_JCL_SRCROOT"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- new Path[] {new Path(getExternalPath() + "converterJclMin.jar"), new Path(getExternalPath() + "converterJclMinsrc.zip"), new Path("")},
- null);
- }
-
- IJavaScriptProject javaProject = setUpJavaProject("Compiler", "1.4"); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull("No java project", javaProject);
- IPackageFragment[] packageFragments = javaProject.getPackageFragments();
- assertNotNull("No package fragments", packageFragments);
- ArrayList collector = new ArrayList();
- for (int i = 0, max = packageFragments.length; i < max; i++) {
- IJavaScriptUnit[] units = packageFragments[i].getJavaScriptUnits();
- if (units != null) {
- for (int j = 0, max2 = units.length; j < max2; j++) {
- collector.add(units[j]);
- }
- }
- }
- this.compilationUnits = new IJavaScriptUnit[collector.size()];
- collector.toArray(this.compilationUnits);
- }
-
- public void test0000() throws JavaScriptModelException {
- try {
- RESOLVE_BINDINGS = true;
- final int apiLevel = AST.JLS3;
- ASTParser parser = ASTParser.newParser(apiLevel);
- parser.setResolveBindings(RESOLVE_BINDINGS);
- long totalTime = 0;
- int length = this.compilationUnits.length;
- long[] times = new long[length];
- ArrayList arrayList = new ArrayList(length);
- for (int i = 0; i < length; i++) {
- parser.setSource(this.compilationUnits[i]);
- parser.setResolveBindings(RESOLVE_BINDINGS);
- long time = System.currentTimeMillis();
- ASTNode node = parser.createAST(null);
- times[i] = System.currentTimeMillis() - time;
- totalTime += times[i];
- assertNotNull("No node", node);
- assertEquals("Wrong type", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertEquals("Has problem", 0, unit.getProblems().length);
- TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0);
- StringBuffer buffer = new StringBuffer();
- buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName());
- IResource resource = this.compilationUnits[i].getResource();
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- File f = new File(file.getLocation().toOSString());
- if (f.exists()) {
- arrayList.add(new Result(String.valueOf(buffer), times[i], f.length()));
- }
- }
- }
- } finally {
- RESOLVE_BINDINGS = false;
- }
- }
-
- public void test0001() throws JavaScriptModelException {
- try {
- RESOLVE_BINDINGS = true;
- final int apiLevel = AST.JLS3;
- ASTParser parser = ASTParser.newParser(apiLevel);
- parser.setResolveBindings(RESOLVE_BINDINGS);
- long totalTime = 0;
- int length = this.compilationUnits.length;
- long[] times = new long[length];
- ArrayList arrayList = new ArrayList(length);
- for (int i = 0; i < length; i++) {
- parser.setSource(this.compilationUnits[i]);
- parser.setResolveBindings(RESOLVE_BINDINGS);
- long time = System.currentTimeMillis();
- ASTNode node = parser.createAST(null);
- times[i] = System.currentTimeMillis() - time;
- totalTime += times[i];
- assertNotNull("No node", node);
- assertEquals("Wrong type", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertEquals("Has problem", 0, unit.getProblems().length);
- TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0);
- StringBuffer buffer = new StringBuffer();
- buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName());
- IResource resource = this.compilationUnits[i].getResource();
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- File f = new File(file.getLocation().toOSString());
- if (f.exists()) {
- arrayList.add(new Result(String.valueOf(buffer), times[i], f.length()));
- }
- }
- }
- reportResults(apiLevel, totalTime, length, times, arrayList);
- } finally {
- RESOLVE_BINDINGS = false;
- }
- }
-
- public void test0002() throws JavaScriptModelException {
- try {
- RESOLVE_BINDINGS = false;
- final int apiLevel = AST.JLS3;
- ASTParser parser = ASTParser.newParser(apiLevel);
- parser.setResolveBindings(RESOLVE_BINDINGS);
- long totalTime = 0;
- int length = this.compilationUnits.length;
- long[] times = new long[length];
- ArrayList arrayList = new ArrayList(length);
- for (int i = 0; i < length; i++) {
- parser.setSource(this.compilationUnits[i]);
- parser.setResolveBindings(RESOLVE_BINDINGS);
- long time = System.currentTimeMillis();
- ASTNode node = parser.createAST(null);
- times[i] = System.currentTimeMillis() - time;
- totalTime += times[i];
- assertNotNull("No node", node);
- assertEquals("Wrong type", ASTNode.JAVASCRIPT_UNIT, node.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) node;
- assertEquals("Has problem", 0, unit.getProblems().length);
- TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0);
- StringBuffer buffer = new StringBuffer();
- buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName());
- IResource resource = this.compilationUnits[i].getResource();
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- File f = new File(file.getLocation().toOSString());
- if (f.exists()) {
- arrayList.add(new Result(String.valueOf(buffer), times[i], f.length()));
- }
- }
- }
- reportResults(apiLevel, totalTime, length, times, arrayList);
- } finally {
- RESOLVE_BINDINGS = false;
- }
- }
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunAllTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunAllTests.java
deleted file mode 100644
index 2d7e91f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunAllTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.*;
-
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class RunAllTests extends junit.framework.TestCase {
-public RunAllTests(String name) {
- super(name);
-}
-public static Class[] getAllTestClasses() {
- return new Class[] {
- //org.eclipse.wst.jsdt.core.tests.dom.RunConverterTests.class,
- org.eclipse.wst.jsdt.core.tests.dom.ASTTest.class,
- org.eclipse.wst.jsdt.core.tests.dom.ASTVisitorTest.class,
- //org.eclipse.wst.jsdt.core.tests.dom.ASTMatcherTest.class,
- //org.eclipse.wst.jsdt.core.tests.dom.ASTStructuralPropertyTest.class,
- org.eclipse.wst.jsdt.core.tests.dom.ASTParserTest.class,
- //org.eclipse.wst.jsdt.core.tests.dom.ASTModelBridgeTests.class,
- // org.eclipse.wst.jsdt.core.tests.dom.BatchASTCreationTests.class,
- //org.eclipse.wst.jsdt.core.tests.dom.CompatibilityRulesTests.class,
- org.eclipse.wst.jsdt.core.tests.rewrite.describing.ASTRewritingTest.class,
- org.eclipse.wst.jsdt.core.tests.rewrite.modifying.ASTRewritingModifyingTest.class,
- org.eclipse.wst.jsdt.core.tests.dom.ASTPositionsTest.class,
- };
-}
-public static Test suite() {
- TestSuite ts = new TestSuite(RunAllTests.class.getName());
-
- Class[] testClasses = getAllTestClasses();
- // Reset forgotten subsets of tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS = null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
-
- for (int i = 0; i < testClasses.length; i++) {
- Class testClass = testClasses[i];
-
- // call the suite() method and add the resulting suite to the suite
- try {
- Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
- Test suite = (Test)suiteMethod.invoke(null, new Object[0]);
- ts.addTest(suite);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- return ts;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunConverterTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunConverterTests.java
deleted file mode 100644
index af8f0ec..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunConverterTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class RunConverterTests extends junit.framework.TestCase {
-public RunConverterTests(String name) {
- super(name);
-}
-public static Class[] getAllTestClasses() {
- return new Class[] {
- ASTConverterTest.class,
- ASTConverterTest2.class,
- ASTConverterJavadocTest.class,
- ASTConverterAST3Test.class,
- ASTConverterTestAST3_2.class,
- ASTConverterBindingsTest.class,
- ASTConverterRecoveryTest.class
- };
-}
-public static Test suite() {
- TestSuite ts = new TestSuite(RunConverterTests.class.getName());
-
- ConverterTestSetup.TEST_SUITES = new ArrayList(Arrays.asList(getAllTestClasses()));
- // Reset forgotten subsets of tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS = null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
-
- for (int i = 0, l=ConverterTestSetup.TEST_SUITES.size(); i < l; i++) {
- Class testClass = (Class) ConverterTestSetup.TEST_SUITES.get(i);
-
- // call the suite() method and add the resulting suite to the suite
- try {
- Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
- Test suite = (Test)suiteMethod.invoke(null, new Object[0]);
- ts.addTest(suite);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- return ts;
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/SampleASTs.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/SampleASTs.java
deleted file mode 100644
index 63e7bea..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/SampleASTs.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.QualifiedType;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.TagElement;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
-import org.eclipse.wst.jsdt.core.dom.TryStatement;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.WhileStatement;
-
-public class SampleASTs {
- /**
- * Returns a subtree of sample of AST nodes. The sample includes
- * one of each kind (except for BlockComment and LineComment,
- * which cannot be connected directly to a JavaScriptUnit),
- * but otherwise does not make sense.
- */
- public static ASTNode oneOfEach(AST target) {
- JavaScriptUnit cu = target.newJavaScriptUnit();
- PackageDeclaration pd = target.newPackageDeclaration();
- cu.setPackage(pd);
-
- ImportDeclaration im = target.newImportDeclaration();
- cu.imports().add(im);
-
- TypeDeclaration td = target.newTypeDeclaration();
- cu.types().add(td);
- JSdoc javadoc = target.newJSdoc();
- td.setJavadoc(javadoc);
- TagElement tg = target.newTagElement();
- javadoc.tags().add(tg);
- tg.fragments().add(target.newTextElement());
- tg.fragments().add(target.newMemberRef());
- FunctionRef mr = target.newFunctionRef();
- tg.fragments().add(mr);
- mr.parameters().add(target.newFunctionRefParameter());
-
- VariableDeclarationFragment variableDeclarationFragment = target.newVariableDeclarationFragment();
- FieldDeclaration fd =
- target.newFieldDeclaration(variableDeclarationFragment);
- td.bodyDeclarations().add(fd);
-
- Initializer in = target.newInitializer();
- td.bodyDeclarations().add(in);
-
-
- FunctionDeclaration md = target.newFunctionDeclaration();
- SingleVariableDeclaration singleVariableDeclaration = target.newSingleVariableDeclaration();
- md.parameters().add(singleVariableDeclaration);
- td.bodyDeclarations().add(md);
-
- SimpleName sn1 = target.newSimpleName("one"); //$NON-NLS-1$
- SimpleName sn2 =target.newSimpleName("two"); //$NON-NLS-1$
- QualifiedName qn = target.newQualifiedName(sn1, sn2);
-
- PrimitiveType pt = target.newPrimitiveType(PrimitiveType.INT);
- ArrayType at = target.newArrayType(pt);
- fd.setType(at);
-
- if (target.apiLevel() >= AST.JLS3) {
- SimpleType st = target.newSimpleType(qn);
- QualifiedType qt = target.newQualifiedType(st, target.newSimpleName("x")); //$NON-NLS-1$
- }
-
- Block b = target.newBlock();
- md.setBody(b);
-
- // all statements (in alphabetic order of statement type)
- Block block = target.newBlock();
- b.statements().add(block);
- BreakStatement breakStatement = target.newBreakStatement();
- b.statements().add(breakStatement);
- ContinueStatement continueStatement = target.newContinueStatement();
- b.statements().add(continueStatement);
- ConstructorInvocation constructorInvocation = target.newConstructorInvocation();
- b.statements().add(constructorInvocation);
- DoStatement doStatement = target.newDoStatement();
- b.statements().add(doStatement);
- EmptyStatement emptyStatement = target.newEmptyStatement();
- b.statements().add(emptyStatement);
- NullLiteral nullLiteral = target.newNullLiteral();
- ExpressionStatement expressionStatement = target.newExpressionStatement(nullLiteral);
- b.statements().add(expressionStatement);
- ForStatement forStatement = target.newForStatement();
- b.statements().add(forStatement);
- if (target.apiLevel() >= AST.JLS3) {
- EnhancedForStatement foreachStatement = target.newEnhancedForStatement();
- b.statements().add(foreachStatement);
- }
- IfStatement ifStatement = target.newIfStatement();
- b.statements().add(ifStatement);
- LabeledStatement labeledStatement = target.newLabeledStatement();
- b.statements().add(labeledStatement);
- ReturnStatement returnStatement = target.newReturnStatement();
- b.statements().add(returnStatement);
- SuperConstructorInvocation superConstructorInvocation = target.newSuperConstructorInvocation();
- b.statements().add(superConstructorInvocation);
- SwitchStatement ss = target.newSwitchStatement();
- SwitchCase switchCase = target.newSwitchCase();
- ss.statements().add(switchCase);
- b.statements().add(ss);
- SwitchStatement switchStatement = target.newSwitchStatement();
- b.statements().add(switchStatement);
- SwitchCase switchCase2 = target.newSwitchCase();
- b.statements().add(switchCase2);
- ThrowStatement throwStatement = target.newThrowStatement();
- b.statements().add(throwStatement);
- TryStatement tr = target.newTryStatement();
- CatchClause catchClause = target.newCatchClause();
- tr.catchClauses().add(catchClause);
- b.statements().add(tr);
-
- TypeDeclaration typeDeclaration = target.newTypeDeclaration();
- TypeDeclarationStatement typeDeclarationStatement = target.newTypeDeclarationStatement(typeDeclaration);
- b.statements().add(typeDeclarationStatement);
- VariableDeclarationFragment variableDeclarationFragment2 = target.newVariableDeclarationFragment();
- VariableDeclarationStatement variableDeclarationStatement = target.newVariableDeclarationStatement(variableDeclarationFragment2);
- b.statements().add(variableDeclarationStatement);
- WhileStatement whileStatement = target.newWhileStatement();
- b.statements().add(whileStatement);
-
- // all expressions (in alphabetic order of expressions type)
- FunctionInvocation inv = target.newFunctionInvocation();
- ExpressionStatement expressionStatement2 = target.newExpressionStatement(inv);
- b.statements().add(expressionStatement2);
- List z = inv.arguments();
- ArrayAccess arrayAccess = target.newArrayAccess();
- z.add(arrayAccess);
- ArrayCreation arrayCreation = target.newArrayCreation();
- z.add(arrayCreation);
- ArrayInitializer arrayInitializer = target.newArrayInitializer();
- z.add(arrayInitializer);
- Assignment assignment = target.newAssignment();
- z.add(assignment);
- BooleanLiteral booleanLiteral = target.newBooleanLiteral(true);
- z.add(booleanLiteral);
- CharacterLiteral characterLiteral = target.newCharacterLiteral();
- z.add(characterLiteral);
- ClassInstanceCreation cic = target.newClassInstanceCreation();
- AnonymousClassDeclaration anonymousClassDeclaration = target.newAnonymousClassDeclaration();
- cic.setAnonymousClassDeclaration(anonymousClassDeclaration);
- z.add(cic);
- ConditionalExpression conditionalExpression = target.newConditionalExpression();
- z.add(conditionalExpression);
- FieldAccess fieldAccess = target.newFieldAccess();
- z.add(fieldAccess);
- InfixExpression infixExpression = target.newInfixExpression();
- z.add(infixExpression);
- InstanceofExpression instanceofExpression = target.newInstanceofExpression();
- z.add(instanceofExpression);
- FunctionInvocation methodInvocation = target.newFunctionInvocation();
- z.add(methodInvocation);
- Name name = target.newName(new String[]{"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- z.add(name);
- NullLiteral nullLiteral2 = target.newNullLiteral();
- z.add(nullLiteral2);
- NumberLiteral numberLiteral = target.newNumberLiteral("1024"); //$NON-NLS-1$
- z.add(numberLiteral);
- ParenthesizedExpression parenthesizedExpression = target.newParenthesizedExpression();
- z.add(parenthesizedExpression);
- PostfixExpression postfixExpression = target.newPostfixExpression();
- z.add(postfixExpression);
- PrefixExpression prefixExpression = target.newPrefixExpression();
- z.add(prefixExpression);
- StringLiteral stringLiteral = target.newStringLiteral();
- z.add(stringLiteral);
- SuperFieldAccess superFieldAccess = target.newSuperFieldAccess();
- z.add(superFieldAccess);
- SuperMethodInvocation superMethodInvocation = target.newSuperMethodInvocation();
- z.add(superMethodInvocation);
- ThisExpression thisExpression = target.newThisExpression();
- z.add(thisExpression);
- TypeLiteral typeLiteral = target.newTypeLiteral();
- z.add(typeLiteral);
- VariableDeclarationFragment variableDeclarationFragment3 = target.newVariableDeclarationFragment();
- VariableDeclarationExpression variableDeclarationExpression = target.newVariableDeclarationExpression(variableDeclarationFragment3);
- z.add(variableDeclarationExpression);
-
-
- return cu;
- }
-
- /**
- * Returns a flat list of sample nodes of each type.
- * The sample includes one of each kind, including
- * BlockComment and LineComment.
- */
- public static List oneOfEachList(AST target) {
- List result = new ArrayList(100);
- for (int nodeType = 0; nodeType < 100; nodeType++) {
- Class nodeClass = null;
- try {
- nodeClass = ASTNode.nodeClassForType(nodeType);
- } catch (RuntimeException e) {
- // oops - guess that's not valid
- }
- if (nodeClass != null) {
- result.add(target.createInstance(nodeClass));
- }
- }
- return result;
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/DecodeCodeFormatterPreferences.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/DecodeCodeFormatterPreferences.java
deleted file mode 100644
index a4bec45..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/DecodeCodeFormatterPreferences.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.LineNumberReader;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class DecodeCodeFormatterPreferences extends DefaultHandler {
-
- private boolean record;
- private Map entries;
- private String profileName;
-
- public static Map decodeCodeFormatterOptions(String fileName) {
- try {
- LineNumberReader reader = new LineNumberReader(new FileReader(fileName));
- Map options = new HashMap();
- String line;
- while ((line = reader.readLine()) != null) {
- if (line.startsWith("#")) {
- continue;
- }
- StringTokenizer stringTokenizer = new StringTokenizer(line, "=");
- options.put(stringTokenizer.nextElement(), stringTokenizer.nextElement());
- }
- reader.close();
- return options;
- } catch (IOException e) {
- // ignore
- }
- return null;
- }
-
- public static Map decodeCodeFormatterOptions(String fileName, String profileName) {
- try {
- SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
- final DecodeCodeFormatterPreferences preferences = new DecodeCodeFormatterPreferences(profileName);
- saxParser.parse(new File(fileName), preferences);
- return preferences.getEntries();
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- } catch (SAXException e) {
- e.printStackTrace();
- } catch (FactoryConfigurationError e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static Map decodeCodeFormatterOptions(String zipFileName, String zipEntryName, String profileName) {
- ZipFile zipFile = null;
- BufferedInputStream inputStream = null;
- try {
- zipFile = new ZipFile(zipFileName);
- ZipEntry zipEntry = zipFile.getEntry(zipEntryName);
- if (zipEntry == null) {
- return null;
- }
- inputStream = new BufferedInputStream(zipFile.getInputStream(zipEntry));
- SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
- final DecodeCodeFormatterPreferences preferences = new DecodeCodeFormatterPreferences(profileName);
- saxParser.parse(inputStream, preferences);
- return preferences.getEntries();
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- } catch (SAXException e) {
- e.printStackTrace();
- } catch (FactoryConfigurationError e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- if (inputStream != null) {
- inputStream.close();
- }
- if (zipFile != null) {
- zipFile.close();
- }
- } catch (IOException e1) {
- // Do nothing
- }
- }
- return null;
- }
-
- DecodeCodeFormatterPreferences(String profileName) {
- this.profileName = profileName;
- }
-
- /* (non-Javadoc)
- * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
-
- int attributesLength = attributes.getLength();
- if ("profile".equals(qName)) {
- for (int i = 0; i < attributesLength; i++) {
- if ("name".equals(attributes.getQName(i)) && profileName.equals(attributes.getValue(i))) {
- record = true;
- entries = new HashMap();
- break;
- }
- }
- } else if ("setting".equals(qName) && record) {
- if (attributesLength == 2) {
- entries.put(attributes.getValue(0), attributes.getValue(1));
- }
- }
- }
- /* (non-Javadoc)
- * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
- */
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- if ("profile".equals(qName) && record) {
- record = false;
- }
- }
- /**
- * @return Returns the entries.
- */
- public Map getEntries() {
- return entries;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java
deleted file mode 100644
index 8bc4a4f..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java
+++ /dev/null
@@ -1,9164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.ToolFactory;
-import org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatter;
-import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatterOptions;
-import org.eclipse.text.edits.TextEdit;
-
-public class FormatterRegressionTests extends AbstractJavaModelTests {
-
- public static final int UNKNOWN_KIND = 0;
- public static final String IN = "_in";
- public static final String OUT = "_out";
- public static final boolean DEBUG = false;
- private static final String LINE_SEPARATOR = System.getProperty("line.separator");
- private long time;
-
- static {
-// TESTS_NUMBERS = new int[] { 650 };
-// TESTS_RANGE = new int[] { 650, -1 };
- }
- public static Test suite() {
- return buildModelTestSuite(FormatterRegressionTests.class);
- }
-
- public FormatterRegressionTests(String name) {
- super(name);
- }
-
- /**
- * Returns the OS path to the directory that contains this plugin.
- */
- protected String getPluginDirectoryPath() {
- try {
- URL platformURL = Platform.getBundle("org.eclipse.wst.jsdt.core.tests.model").getEntry("/");
- return new File(FileLocator.toFileURL(platformURL).getFile()).getAbsolutePath();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- private String getResource(String packageName, String resourceName) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IResource resource = workspaceRoot.findMember(new Path("/Formatter/" + packageName + "/" + resourceName));
- assertNotNull("No resource found", resource);
- return resource.getLocation().toOSString();
- }
-
- private String getZipEntryContents(String fileName, String zipEntryName) {
- ZipFile zipFile = null;
- BufferedInputStream inputStream = null;
- try {
- zipFile = new ZipFile(fileName);
- ZipEntry zipEntry = zipFile.getEntry(zipEntryName);
- inputStream = new BufferedInputStream(zipFile.getInputStream(zipEntry));
- return new String(org.eclipse.wst.jsdt.internal.compiler.util.Util.getInputStreamAsCharArray(inputStream, -1, null));
- } catch (IOException e) {
- } finally {
- try {
- if (inputStream != null) {
- inputStream.close();
- }
- if (zipFile != null) {
- zipFile.close();
- }
- } catch (IOException e1) {
- // Do nothing
- }
- }
- return null;
- }
-
- public String getSourceWorkspacePath() {
- return getPluginDirectoryPath() + java.io.File.separator + "workspace";
- }
-
- private String runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator) {
-// long time = System.currentTimeMillis();
- TextEdit edit = codeFormatter.format(kind, source, offset, length, indentationLevel, lineSeparator);//$NON-NLS-1$
-// System.out.println((System.currentTimeMillis() - time) + " ms");
- if (edit == null) return null;
-// System.out.println(edit.getChildrenSize() + " edits");
- String result = org.eclipse.wst.jsdt.internal.core.util.Util.editedString(source, edit);
-
- if (length == source.length()) {
-// time = System.currentTimeMillis();
- edit = codeFormatter.format(kind, result, 0, result.length(), indentationLevel, lineSeparator);//$NON-NLS-1$
-// System.out.println((System.currentTimeMillis() - time) + " ms");
- if (edit == null) return null;
-// assertEquals("Should not have edits", 0, edit.getChildren().length);
- final String result2 = org.eclipse.wst.jsdt.internal.core.util.Util.editedString(result, edit);
- if (!result.equals(result2)) {
- assertSourceEquals("Different reformatting", Util.convertToIndependantLineDelimiter(result), Util.convertToIndependantLineDelimiter(result2));
- }
- }
- return result;
- }
-
- /**
- * Create project and set the jar placeholder.
- */
- public void setUpSuite() throws Exception {
- // ensure autobuilding is turned off
- IWorkspaceDescription description = getWorkspace().getDescription();
- if (description.isAutoBuilding()) {
- description.setAutoBuilding(false);
- getWorkspace().setDescription(description);
- }
- setUpJavaProject("Formatter"); //$NON-NLS-1$
- if (DEBUG) {
- this.time = System.currentTimeMillis();
- }
- }
-
- /**
- * Reset the jar placeholder and delete project.
- */
- public void tearDownSuite() throws Exception {
- this.deleteProject("Formatter"); //$NON-NLS-1$
- if (DEBUG) {
- System.out.println("Time spent = " + (System.currentTimeMillis() - this.time));//$NON-NLS-1$
- }
- super.tearDown();
- }
-
- private String getIn(String compilationUnitName) {
- assertNotNull(compilationUnitName);
- int dotIndex = compilationUnitName.indexOf('.');
- assertTrue(dotIndex != -1);
- return compilationUnitName.substring(0, dotIndex) + IN + compilationUnitName.substring(dotIndex);
- }
-
- private String getOut(String compilationUnitName) {
- assertNotNull(compilationUnitName);
- int dotIndex = compilationUnitName.indexOf('.');
- assertTrue(dotIndex != -1);
- return compilationUnitName.substring(0, dotIndex) + OUT + compilationUnitName.substring(dotIndex);
- }
-
- private void assertLineEquals(String actualContents, String originalSource, String expectedContents, boolean checkNull) {
- if (actualContents == null) {
- assertTrue("actualContents is null", checkNull);
- assertEquals(expectedContents, originalSource);
- return;
- }
- assertSourceEquals("Different number of length", Util.convertToIndependantLineDelimiter(expectedContents), actualContents);
- }
-
- private void runTest(String packageName, String compilationUnitName) {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, packageName, compilationUnitName, CodeFormatter.K_JAVASCRIPT_UNIT, 0);
- }
-
- private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName) {
- runTest(codeFormatter, packageName, compilationUnitName, CodeFormatter.K_JAVASCRIPT_UNIT, 0);
- }
-
- private void runTest(String packageName, String compilationUnitName, int kind) {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, packageName, compilationUnitName, kind, 0);
- }
-
- private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind) {
- runTest(codeFormatter, packageName, compilationUnitName, kind, 0, false, 0, -1);
- }
-
- private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, boolean checkNull) {
- runTest(codeFormatter, packageName, compilationUnitName, kind, 0, checkNull, 0, -1);
- }
-
- private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel) {
- runTest(codeFormatter, packageName, compilationUnitName, kind, indentationLevel, false, 0, -1);
- }
- private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, int offset, int length) {
- runTest(codeFormatter, packageName, compilationUnitName, kind, indentationLevel, checkNull, offset, length, null);
- }
-
- private void runTest(String input, String output, CodeFormatter codeFormatter, int kind, int indentationLevel, boolean checkNull, int offset, int length, String lineSeparator) {
- String result;
- if (length == -1) {
- result = runFormatter(codeFormatter, input, kind, indentationLevel, offset, input.length(), lineSeparator);
- } else {
- result = runFormatter(codeFormatter, input, kind, indentationLevel, offset, length, lineSeparator);
- }
- assertLineEquals(result, input, output, checkNull);
- }
-
- private void runTest(String source, String expectedResult, CodeFormatter codeFormatter, int kind, int indentationLevel, boolean checkNull, int offset, int length) {
- String result;
- if (length == -1) {
- result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, source.length(), null);
- } else {
- result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, length, null);
- }
- assertLineEquals(result, source, expectedResult, checkNull);
- }
-
- private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, int offset, int length, String lineSeparator) {
- try {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Formatter" , "", packageName, getIn(compilationUnitName)); //$NON-NLS-1$ //$NON-NLS-2$
- String s = sourceUnit.getSource();
- assertNotNull(s);
- IJavaScriptUnit outputUnit = getCompilationUnit("Formatter" , "", packageName, getOut(compilationUnitName)); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull(outputUnit);
- String result;
- if (length == -1) {
- result = runFormatter(codeFormatter, s, kind, indentationLevel, offset, s.length(), lineSeparator);
- } else {
- result = runFormatter(codeFormatter, s, kind, indentationLevel, offset, length, lineSeparator);
- }
- assertLineEquals(result, s, outputUnit.getSource(), checkNull);
- } catch (JavaScriptModelException e) {
- e.printStackTrace();
- assertTrue(false);
- }
- }
-
- String getSource(ASTNode astNode, char[] source) {
- String result = new String(CharOperation.subarray(source, astNode.getStartPosition() + 1, astNode.getStartPosition() + astNode.getLength() - 1));
- if (result.endsWith("\\n")) {
- return result.substring(0, result.length() - 2) + LINE_SEPARATOR;
- }
- return result;
- }
-
- public void test000() {
- runTest("test002", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
-
- public void test001() {
- runTest("test001", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- public void test002() {
- runTest("test002", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// public void test003() {
-// runTest("test003", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// public void test004() {
-// runTest("test004", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
-// }
-// public void test005() {
-// runTest("test005", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// public void test006() {
-// runTest("test006", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// public void test007() {
-// runTest("test007", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// public void test008() {
-// runTest("test008", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
-// }
-
- public void test009() {
- runTest("test009", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test010() {
- runTest("test010", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test011() {
- runTest("test011", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test012() {
- runTest("test012", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test013() {
- runTest("test013", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test014() {
- runTest("test014", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test015() {
- runTest("test015", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test016() {
- runTest("test016", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test017() {
- runTest("test017", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test018() {
- runTest("test018", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test019() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test019", "A_1.js");//$NON-NLS-1$ //$NON-NLS-2$
-
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test019", "A_2.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test020() {
- runTest("test020", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test021() {
- runTest("test021", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test022() {
- runTest("test022", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test023() {
- runTest("test023", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test024() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test024", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test025() {
- runTest("test025", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test026() {
- runTest("test026", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test027() {
- runTest("test027", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test028() {
- runTest("test028", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test029() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.compact_else_if = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter,"test029", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test030() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test030", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test031() {
- runTest("test031", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test032() {
- runTest("test032", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test033() {
- runTest("test033", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test034() {
- runTest("test034", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test035() {
- runTest("test035", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test036() {
- runTest("test036", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test037() {
- runTest("test037", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test038() {
- runTest("test038", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test039() {
- runTest("test039", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test040() {
- runTest("test040", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test041() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_type_declaration = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test041", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test042() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_space_before_opening_brace_in_block = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test042", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test043() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_type_declaration = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test043", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test044() {
- runTest("test044", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test045() {
- runTest("test045", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test046() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = false;
- preferences.insert_space_before_assignment_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test046", "A.js", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test047() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = true;
- preferences.insert_space_before_assignment_operator = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test047", "A.js", CodeFormatter.K_STATEMENTS, 2);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test048() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = true;
- preferences.insert_space_before_assignment_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test048", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test049() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = true;
- preferences.insert_space_before_assignment_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test049", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test050() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_binary_operator = false;
- preferences.insert_space_before_unary_operator = false;
- preferences.insert_space_after_unary_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test050", "A.js", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test051() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = true;
- preferences.insert_space_before_assignment_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test051", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test052() {
- runTest("test052", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test053() {
- runTest("test053", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test054() {
- runTest("test054", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test055() {
- runTest("test055", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test056() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_else_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test056", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test057() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String)options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
- assertEquals(DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
- assertEquals(DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.align_type_members_on_columns = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test057", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test058() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String)options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
- assertEquals(DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
- assertEquals(DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.align_type_members_on_columns = true;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.blank_lines_between_import_groups = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test058", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test059() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.align_type_members_on_columns = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test059", "Parser.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test060() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.align_type_members_on_columns = false;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.blank_lines_between_import_groups = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- //long time = System.currentTimeMillis();
- runTest(codeFormatter, "test060", "Parser.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test061() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.blank_lines_between_import_groups = 0;
- preferences.align_type_members_on_columns = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test061", "Parser.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test062() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = true;
- preferences.insert_space_before_assignment_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test062", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test063() {
- runTest("test063", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test064() {
- runTest("test064", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Line break inside an array initializer (line comment)
- public void test065() {
- runTest("test065", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test066() {
- runTest("test066", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test067() {
- runTest("test067", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 3181
- public void test068() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test068", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 3327
- public void test069() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.blank_lines_before_method = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test069", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // 5691
- public void test070() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test070", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test071() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.indent_body_declarations_compare_to_type_header = false;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.align_type_members_on_columns = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test071", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 7224
- public void test072() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test072", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 7439
- public void test073() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test073", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 12321
- public void test074() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_new_line_before_catch_in_try_statement = true;
- preferences.insert_new_line_before_else_in_if_statement = true;
- preferences.insert_new_line_before_finally_in_try_statement = true;
- preferences.insert_new_line_before_while_in_do_statement = true;
- preferences.keep_simple_if_on_one_line = false;
- preferences.keep_then_statement_on_same_line = false;
- preferences.keep_else_statement_on_same_line = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test074", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 14659
- public void test075() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test075", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 16231
- public void test076() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test076", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 16233
- public void test077() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test077", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 17349
- public void test078() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test078", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 19811
- public void test079() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test079", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 19811
- public void test080() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.continuation_indentation = 2;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test080", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 19811
- public void test081() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test081", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 19999
- public void test082() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 2;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test082", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 20721
- public void test083() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test083", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 21943
- public void test084() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_space_before_opening_paren_in_if = false;
- preferences.insert_space_before_opening_paren_in_for = false;
- preferences.insert_space_before_opening_paren_in_while = false;
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test084", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 21943
- public void test085() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_space_before_opening_paren_in_if = true;
- preferences.insert_space_before_opening_paren_in_for = true;
- preferences.insert_space_before_opening_paren_in_while = true;
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test085", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 22313
- public void test086() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_before_catch_in_try_statement = true;
- preferences.insert_new_line_before_else_in_if_statement = true;
- preferences.insert_new_line_before_finally_in_try_statement = true;
- preferences.insert_new_line_before_while_in_do_statement = true;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.insert_space_before_binary_operator = false;
- preferences.insert_space_after_binary_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test086", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 23144
- public void test087() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.keep_simple_if_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test087", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 23144
- public void test088() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.keep_simple_if_on_one_line = false;
- preferences.keep_guardian_clause_on_one_line = false;
- preferences.keep_then_statement_on_same_line = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test088", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 24200
- public void test089() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_opening_paren_in_parenthesized_expression = true;
- preferences.insert_space_before_closing_paren_in_parenthesized_expression = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test089", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 24200
- public void test090() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_opening_bracket_in_array_reference = true;
- preferences.insert_space_before_closing_bracket_in_array_reference = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test090", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 25559
- public void test091() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = false;
- preferences.insert_space_before_assignment_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test091", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 25559
- public void test092() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_binary_operator = false;
- preferences.insert_space_before_binary_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test092", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 25559
- public void test093() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_closing_paren_in_cast = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test093", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 25559
- public void test094() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_assignment_operator = false;
- preferences.insert_space_before_assignment_operator = false;
- preferences.insert_space_after_comma_in_method_invocation_arguments = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test094", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 27196
- public void test095() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
- preferences.indent_statements_compare_to_block = false;
- preferences.indent_statements_compare_to_body = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test095", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 28098
- public void test096() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test096", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 34897
- public void test097() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_opening_paren_in_method_invocation = true;
- preferences.insert_space_before_closing_paren_in_method_invocation = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test097", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 35173
- public void test098() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test098", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 35433
- public void test099() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_before_opening_paren_in_method_declaration = true;
- preferences.insert_space_before_opening_paren_in_for = true;
- preferences.insert_space_after_semicolon_in_for = false;
- preferences.put_empty_statement_on_new_line = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test099", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test100() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_before_opening_brace_in_array_initializer = true;
- preferences.insert_space_after_opening_brace_in_array_initializer = true;
- preferences.insert_space_before_closing_brace_in_array_initializer = true;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test100", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 36832
- public void test101() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test101", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 37057
- public void test102() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 1;
- preferences.line_separator = "\n";//$NON-NLS-1$
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test102", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 37106
- public void test103() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test103", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 37657
- public void test104() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_opening_paren_in_if = true;
- preferences.insert_space_before_closing_paren_in_if = true;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
- preferences.insert_new_line_before_catch_in_try_statement = true;
- preferences.insert_new_line_before_else_in_if_statement = true;
- preferences.insert_new_line_before_finally_in_try_statement = true;
- preferences.insert_new_line_before_while_in_do_statement = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test104", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 38151
- public void test105() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test105", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 39603
- public void test106() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test106", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 39607
- public void test107() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.keep_then_statement_on_same_line = false;
- preferences.keep_simple_if_on_one_line = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test107", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 40777
- public void test108() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test108", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test109() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.blank_lines_before_package = 2;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test109", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test110() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.blank_lines_before_package = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test110", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test111() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.blank_lines_after_package = 1;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.blank_lines_before_new_chunk = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test111", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test112() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.blank_lines_after_package = 1;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.blank_lines_before_new_chunk = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test112", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test113() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test113", "A.js");//$NON-NLS-1$ //$NON-NLS-2
- }
-
- // bug 14659
- public void test114() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test114", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 14659
- public void test115() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test115", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // bug 14659
- public void test116() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test116", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // JDT/UI tests
- public void test117() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test117", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // JDT/UI tests
- public void test118() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test118", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // JDT/UI tests
- public void test119() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test119", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // JDT/UI tests
- public void test120() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test120", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // JDT/UI tests
- public void test121() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test121", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // probing statements
- public void test122() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test122", "A.js", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // probing compilation unit
- public void test123() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test123", "A.js", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // probing class body declarations
- public void test124() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test124", "A.js", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // probing expression
- public void test125() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_binary_operator = false;
- preferences.insert_space_before_unary_operator = false;
- preferences.insert_space_after_unary_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test125", "A.js", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // probing unrecognized source
- public void test126() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test126", "A.js", CodeFormatter.K_UNKNOWN, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // probing unrecognized source
- public void test127() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test127", "A.js", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // probing unrecognized source
- public void test128() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test128", "A.js", CodeFormatter.K_UNKNOWN, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test129() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test129", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test130() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test130", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test131() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test131", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test132() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test132", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test133() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.blank_lines_between_import_groups = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test133", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test134() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test134", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test135() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test135", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test136() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test136", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test137() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test137", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test138() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test138", "A.js", CodeFormatter.K_STATEMENTS, 2, true, 8, 37);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test139() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test139", "A.js", CodeFormatter.K_STATEMENTS, 0, true, 0, 5);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test140() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test140", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test141() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.indent_switchstatements_compare_to_cases = false;
- preferences.indent_switchstatements_compare_to_switch = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test141", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test142() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test142", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test143() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test143", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test144() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test144", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test145() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test145", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test146() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test146", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test147() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_before_assignment_operator = false;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test147", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test148() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test148", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test149() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test149", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test150() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test150", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test151() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test151", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test152() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test152", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test153() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.align_type_members_on_columns = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test153", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test154() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test154", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test155() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test155", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=44036
- public void test156() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test156", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test157() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test157", "A.js", CodeFormatter.K_STATEMENTS, 0, true, 11, 7);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test158() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test158", "A.js", CodeFormatter.K_STATEMENTS, 0, true, 11, 8);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test159() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test159", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
- */
- public void test160() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.insert_new_line_before_catch_in_try_statement = false;
- preferences.insert_new_line_before_else_in_if_statement = false;
- preferences.insert_new_line_before_finally_in_try_statement = false;
- preferences.insert_new_line_before_while_in_do_statement = false;
- preferences.compact_else_if = true;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test160", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
- */
- public void test161() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_new_line_before_catch_in_try_statement = false;
- preferences.insert_new_line_before_else_in_if_statement = false;
- preferences.insert_new_line_before_finally_in_try_statement = false;
- preferences.insert_new_line_before_while_in_do_statement = false;
- preferences.compact_else_if = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test161", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
- */
- public void test162() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_new_line_before_catch_in_try_statement = true;
- preferences.insert_new_line_before_else_in_if_statement = true;
- preferences.insert_new_line_before_finally_in_try_statement = true;
- preferences.insert_new_line_before_while_in_do_statement = true;
- preferences.compact_else_if = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test162", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
- */
- public void test163() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_new_line_before_catch_in_try_statement = true;
- preferences.insert_new_line_before_else_in_if_statement = true;
- preferences.insert_new_line_before_finally_in_try_statement = true;
- preferences.insert_new_line_before_while_in_do_statement = true;
- preferences.compact_else_if = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test163", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
- */
- public void test164() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test164", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test165() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test165", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44546
- */
- public void test166() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test166", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44503
- */
- public void test167() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test167", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44503
- */
- public void test169() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test169", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44503
- */
- public void test170() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test170", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44576
- */
- public void test171() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_switch = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.compact_else_if = false;
- preferences.insert_new_line_before_catch_in_try_statement = true;
- preferences.insert_new_line_before_else_in_if_statement = true;
- preferences.insert_new_line_before_finally_in_try_statement = true;
- preferences.insert_new_line_before_while_in_do_statement = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test171", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44576
- */
- public void test172() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.brace_position_for_switch = DefaultCodeFormatterConstants.END_OF_LINE;
- preferences.compact_else_if = false;
- preferences.insert_new_line_before_catch_in_try_statement = true;
- preferences.insert_new_line_before_else_in_if_statement = true;
- preferences.insert_new_line_before_finally_in_try_statement = true;
- preferences.insert_new_line_before_while_in_do_statement = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test172", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test173() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test173", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test174() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test174", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test175() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test175", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test176() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = true;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test176", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test177() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test177", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test178() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = true;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test178", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test179() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = true;
- preferences.insert_new_line_in_empty_type_declaration = true;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test179", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
- */
- public void test180() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test180", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44651
- */
- public void test181() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test181", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44651
- */
- public void test182() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test182", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
- */
- public void test183() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test183", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
- */
- public void test184() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test184", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
- */
- public void test185() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test185", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- */
- public void _test186() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test186", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44839
- */
- public void test187() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.blank_lines_between_import_groups = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test187", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44839
- */
- public void test188() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test188", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44839
- */
- public void test189() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test189", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- */
- public void test190() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test190", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- */
- public void test191() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test191", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test192() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.align_type_members_on_columns = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test192", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test193() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test193", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test194() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test194", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test195() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test195", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test196() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test196", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test197() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test197", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test198() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test198", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test199() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test199", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test201() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test201", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * TODO Fix multi local declaration alignment
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44909
- */
- public void test202() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test202", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * TODO Fix multi local declaration alignment
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44909
- */
- public void _test203() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test203", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test204() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test204", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test205() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test205", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test206() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test206", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test207() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test207", "A.js", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test208() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test208", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test209() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test209", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test210() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test210", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test211() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test211", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test212() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test212", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test213() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test213", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test214() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test214", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test215() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test215", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test216() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test216", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test217() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test217", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test218() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test218", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test219() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test219", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test220() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test220", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test221() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test221", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test222() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test222", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
- public void test223() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test223", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test224() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test224", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test225() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test225", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test226() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test226", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test227() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test227", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test228() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test228", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test229() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test229", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test230() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test230", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test231() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test231", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test232() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test232", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test233() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test233", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test234() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test234", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test235() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test235", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test236() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test236", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test237() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test237", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test238() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test238", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test239() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test239", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test240() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test240", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test241() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test241", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test242() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test242", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test243() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test243", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test244() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test244", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test245() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test245", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test246() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test246", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test247() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test247", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test248() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test248", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test249() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test249", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test250() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test250", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test251() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test251", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test252() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test252", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test253() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test253", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test254() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test254", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test255() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test255", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test256() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test256", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test257() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test257", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test258() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test258", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test259() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test259", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test260() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test260", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test261() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test261", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test262() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test262", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test263() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test263", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test264() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test264", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test265() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test265", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test266() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test266", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test267() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test267", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test268() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test268", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test269() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test269", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test270() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test270", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test271() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test271", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test272() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test272", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test273() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test273", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test274() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test274", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test275() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test275", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test276() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test276", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test277() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test277", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test278() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test278", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test279() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test279", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test280() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test280", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test281() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test281", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test282() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test282", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test283() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test283", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test284() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test284", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test285() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test285", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test286() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test286", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test287() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test287", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test288() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test288", "A.js", CodeFormatter.K_STATEMENTS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test289() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test289", "A.js", CodeFormatter.K_STATEMENTS, 1);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test290() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test290", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test291() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test291", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test292() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test292", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test293() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test293", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test294() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test294", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test295() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test295", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test296() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test296", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test297() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.SPACE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "100");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test297", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test298() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test298", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test299() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test299", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test300() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test300", "A.js", CodeFormatter.K_EXPRESSION, 2);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test301() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test301", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test302() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test302", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test303() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.indent_switchstatements_compare_to_cases = true;
- preferences.indent_switchstatements_compare_to_switch = true;
- preferences.indent_breaks_compare_to_cases = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test303", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test304() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.indent_switchstatements_compare_to_cases = true;
- preferences.indent_switchstatements_compare_to_switch = true;
- preferences.indent_breaks_compare_to_cases = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test304", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test305() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.indent_switchstatements_compare_to_cases = false;
- preferences.indent_switchstatements_compare_to_switch = true;
- preferences.indent_breaks_compare_to_cases = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test305", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test306() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.indent_switchstatements_compare_to_cases = true;
- preferences.indent_switchstatements_compare_to_switch = true;
- preferences.indent_breaks_compare_to_cases = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test306", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test307() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.indent_switchstatements_compare_to_cases = true;
- preferences.indent_switchstatements_compare_to_switch = true;
- preferences.indent_breaks_compare_to_cases = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test307", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test308() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.indent_switchstatements_compare_to_cases = false;
- preferences.indent_switchstatements_compare_to_switch = false;
- preferences.indent_breaks_compare_to_cases = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test308", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test309() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.indent_switchstatements_compare_to_cases = false;
- preferences.indent_switchstatements_compare_to_switch = false;
- preferences.indent_breaks_compare_to_cases = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test309", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test310() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test310", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test311() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test311", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test312() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test312", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test313() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test313", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test314() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test314", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test315() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\n" +
- "/*\n" +
- " \n" +
- "*/\n" +
- "}";
- String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r\n" +
- " /*\r\n" +
- " \r\n" +
- " */\r\n" +
- "}";
- runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
- }
-
- public void test316() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r" +
- "/*\r" +
- " \r" +
- "*/\r" +
- "}";
- String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r\n" +
- " /*\r\n" +
- " \r\n" +
- " */\r\n" +
- "}";
- runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
- }
-
- public void test317() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.line_separator = "\n";
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r\n" +
- "/*\r\n" +
- " \r\n" +
- "*/\r\n" +
- "}";
- String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\n" +
- " /*\n" +
- " \n" +
- " */\n" +
- "}";
- runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
- }
-
- public void test318() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.line_separator = "\r";
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r" +
- "/*\r" +
- " \r" +
- "*/\r" +
- "}";
- String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r" +
- " /*\r" +
- " \r" +
- " */\r" +
- "}";
- runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
- }
-
- public void test319() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test319", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test320() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test320", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test321() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test321", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test322() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test322", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test323() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = false;
- preferences.insert_new_line_in_empty_method_body = false;
- preferences.insert_new_line_in_empty_block = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test323", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45141
- */
- public void test324() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test324", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45220
- */
- public void test325() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test325", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45465
- */
- public void test326() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test326", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45508
- */
- public void test327() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test327", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22073
- */
- public void test328() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test328", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=29473
- */
- public void test329() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test329", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=27249
- */
- public void test330() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.keep_empty_array_initializer_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test330", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=23709
- */
- public void test331() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test331", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=23709
- */
- public void test332() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test332", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45968
- */
- public void test333() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 5;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test333", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46058
- */
- public void test334() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.put_empty_statement_on_new_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test334", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46033
- */
- public void test335() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test335", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46023
- */
- public void test336() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test336", "A.js", CodeFormatter.K_STATEMENTS, 8);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46150
- */
- public void test337() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test337", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46686
- */
- public void test338() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test338", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46686
- */
- public void test339() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test339", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46686
- */
- public void test340() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test340", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46689
- */
- public void test341() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_before_unary_operator = false;
- preferences.insert_space_after_assignment_operator = false;
- preferences.insert_space_after_binary_operator = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test341", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
- */
- public void test342() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_multiple_local_declarations = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test342", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
- */
- public void test343() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_multiple_field_declarations = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test343", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
- */
- public void test344() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_multiple_field_declarations = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test344", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
- */
- public void test345() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_multiple_local_declarations = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test345", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
- */
- public void test347() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.blank_lines_before_method = 1;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.insert_new_line_in_empty_method_body = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test347", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
- */
- public void test348() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.blank_lines_before_method = 1;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.insert_new_line_in_empty_method_body = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test348", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
- */
- public void test349() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test349", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
- */
- public void test350() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test350", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44765
- */
- public void test351() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test351", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
- */
- public void test352() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test352", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
- */
- public void test353() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test353", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47799
- */
- public void test354() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test354", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47799
- */
- public void test355() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test355", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47800
- */
- public void test356() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test356", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47801
- */
- public void test357() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test357", "A.js", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47801
- */
- public void test358() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test358", "A.js", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47811
- */
- public void test359() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test359", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47811
- */
- public void test360() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "2");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test360", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47811
- */
- public void test361() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test361", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47802
- */
- public void test362() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test362", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47800
- */
- public void test363() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test363", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
- */
- public void test364() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_for_inits = false;
- preferences.insert_space_after_comma_in_for_increments = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test364", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
- */
- public void test365() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_for_inits = false;
- preferences.insert_space_after_comma_in_for_increments = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test365", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
- */
- public void test366() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_for_inits = true;
- preferences.insert_space_before_comma_in_for_inits = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test366", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
- */
- public void test367() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_after_comma_in_for_inits = true;
- preferences.insert_space_before_comma_in_for_inits = true;
- preferences.insert_space_after_comma_in_multiple_local_declarations = false;
- preferences.insert_space_before_comma_in_multiple_local_declarations = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test367", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
- */
- public void test368() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "0");
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test368", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
- */
- public void test369() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test369", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
- */
- public void test370() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test370", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
- */
- public void test371() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "0");
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test371", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
- */
- public void test372() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "0");
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test372", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
- */
- public void test373() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test373", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
- */
- public void test374() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test374", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
- */
- public void test375() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test375", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
- */
- public void test376() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test376", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
- */
- public void test377() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test377", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
- */
- public void test378() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test378", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47997
- */
- public void test379() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test379", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47997
- */
- public void test380() {
- Hashtable options = new Hashtable();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.SPACE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "100");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test380", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47997
- */
- public void test381() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "0");
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test381", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48131
- */
- public void test382() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
- runTest(codeFormatter, "test382", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48141
- */
- public void test383() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- preferences.blank_lines_before_first_class_body_declaration = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test383", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
- */
- public void _test384() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test384", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
- */
- public void test385() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION)));
- assertTrue(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE != DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_first_class_body_declaration = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test385", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
- */
- public void test386() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_first_class_body_declaration = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test386", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
- */
- public void _test387() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
-// options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.page_width = 40;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test387", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
- */
- public void test388() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.page_width = 40;
- preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
- preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
- preferences.blank_lines_before_first_class_body_declaration = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test388", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
- */
- public void test389() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.continuation_indentation_for_array_initializer = 1;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.page_width = 40;
- preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
- preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
- preferences.blank_lines_before_first_class_body_declaration = 0;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test389", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
- */
- public void test390() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.continuation_indentation_for_array_initializer = 1;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.page_width = 40;
- preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
- preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
- preferences.blank_lines_before_first_class_body_declaration = 0;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test390", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
- */
- public void test391() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_first_class_body_declaration = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.continuation_indentation_for_array_initializer = 3;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.page_width = 40;
- preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
- preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test391", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
- */
- public void test392() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_first_class_body_declaration = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.continuation_indentation_for_array_initializer = 3;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
- preferences.page_width = 40;
- preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
- preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test392", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
- */
- public void test393() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.blank_lines_before_first_class_body_declaration = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.continuation_indentation_for_array_initializer = 1;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
- preferences.page_width = 40;
- preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
- preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test393", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48404
- */
- public void test394() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test394", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49318
- */
- public void test395() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.insert_space_before_opening_paren_in_method_declaration = true;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test395", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49243
- */
- public void test396() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.insert_space_before_semicolon_in_for = true;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test396", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test397() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_package = 2;
- preferences.blank_lines_after_package = 0;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test397", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test398() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.blank_lines_before_package = 0;
- preferences.blank_lines_after_package = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test398", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test399() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_package = 1;
- preferences.blank_lines_after_package = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test399", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test400() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "2");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, "2");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test400", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49361
- */
- public void test401() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test401", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49361
- */
- public void test402() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test402", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
- */
- public void test403() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test403", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
- */
- public void test404() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test404", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test405() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "10");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test405", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
- */
- public void test406() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test406", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49481
- */
- public void test407() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.blank_lines_before_first_class_body_declaration = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test407", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49481
- */
- public void test408() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.blank_lines_before_first_class_body_declaration = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test408", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49378
- */
- public void test409() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, DefaultCodeFormatterConstants.NEXT_LINE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.indent_switchstatements_compare_to_cases = false;
- preferences.indent_switchstatements_compare_to_switch = true;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_switch = DefaultCodeFormatterConstants.NEXT_LINE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test409", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49577
- */
- public void test410() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_between_type_declarations = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test410", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49577
- */
- public void test411() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_between_type_declarations = 2;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test411", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
- */
- public void test412() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test412", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
- */
- public void test413() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_between_type_declarations = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test413", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
- */
- public void test414() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test414", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
- */
- public void test415() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_between_type_declarations = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test415", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
- */
- public void test416() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_between_type_declarations = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test416", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49571
- */
- public void test417() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_before_opening_paren_in_constructor_declaration = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test417", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49571
- */
- public void test418() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_before_opening_paren_in_constructor_declaration = true;
- preferences.insert_space_before_opening_paren_in_method_declaration = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test418", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49162
- */
- public void _test419() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test419", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49623
- */
- public void _test420() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.align_type_members_on_columns = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test420", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
- */
- public void test421() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test421", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
- */
- public void test422() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test422", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test423() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test423", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test424() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test424", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test425() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test425", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test426() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test426", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test427() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test427", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test428() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test428", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test429() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test429", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test430() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test430", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
- */
- public void test431() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test431", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49370
- */
- public void test432() {
- String resourcePath = getResource("test432", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "AIS");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test432", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49370
- */
- public void test433() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test433", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
- */
- public void test434() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- assertEquals(true, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION)));
- assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION)));
- assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 3;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.insert_space_after_opening_paren_in_method_invocation = true;
- preferences.insert_space_before_closing_paren_in_method_invocation = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test434", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49772
- */
- public void test435() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test435", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49772
- */
- public void test436() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_constructor_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test436", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
- */
- public void test437() {
- String resourcePath = getResource("test437", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Felix");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test437", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
- */
- public void test438() {
- String resourcePath = getResource("test438", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Felix");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test438", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
- */
- public void test439() {
- String resourcePath = getResource("test439", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Felix");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test439", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
- */
- public void test440() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test440", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
- */
- public void test441() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test441", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
- */
- public void test442() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test442", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
- */
- public void test443() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test443", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
- */
- public void test444() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test444", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
- */
- public void test445() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test445", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49327
- */
- public void test446() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test446", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test447() {
- String resourcePath = getResource("test447", "test447.zip");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "settings.xml", "Toms");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String input = getZipEntryContents(resourcePath, getIn("Format.js"));
- assertNotNull("No input", input);
- String output = getZipEntryContents(resourcePath, getOut("Format.js"));
- assertNotNull("No output", output);
- int start = input.indexOf("private");
- int end = input.indexOf(";");
- runTest(input, output, codeFormatter, CodeFormatter.K_JAVASCRIPT_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49953
- */
- public void test448() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_space_before_opening_bracket_in_array_allocation_expression = true;
- preferences.insert_space_after_opening_bracket_in_array_allocation_expression = true;
- preferences.insert_space_before_closing_bracket_in_array_allocation_expression = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test448", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49953
- */
- public void test449() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.number_of_empty_lines_to_preserve = 0;
- preferences.insert_space_before_opening_bracket_in_array_allocation_expression = false;
- preferences.insert_space_after_opening_bracket_in_array_allocation_expression = true;
- preferences.insert_space_before_closing_bracket_in_array_allocation_expression = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test449", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50225
- */
- public void test450() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test450", "A.js", CodeFormatter.K_UNKNOWN, 0, false, 0, 0);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test451() {
- String resourcePath = getResource("test451", "test451.zip");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "settings.xml", "Toms");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String input = getZipEntryContents(resourcePath, getIn("Format.js"));
- assertNotNull("No input", input);
- String output = getZipEntryContents(resourcePath, getOut("Format.js"));
- assertNotNull("No output", output);
- int start = input.indexOf("private");
- int end = input.indexOf(";");
- runTest(input, output, codeFormatter, CodeFormatter.K_JAVASCRIPT_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
- */
- public void test452() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "2");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, "2");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test452", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50719
- */
- public void test453() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test453", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50736
- */
- public void test454() {
- String resourcePath = getResource("test454", "test454.zip");
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String input = getZipEntryContents(resourcePath, getIn("A.js"));
- assertNotNull("No input", input);
- String output = getZipEntryContents(resourcePath, getOut("A.js"));
- assertNotNull("No output", output);
- int start = input.indexOf("launch.setAttribute");
- int end = input.indexOf(";", start + 1);
- runTest(input, output, codeFormatter, CodeFormatter.K_JAVASCRIPT_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50736
- */
- public void test455() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test455", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50736
- */
- public void test456() {
- String resourcePath = getResource("test456", "test456.zip");
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- String input = getZipEntryContents(resourcePath, getIn("A.js"));
- assertNotNull("No input", input);
- String output = getZipEntryContents(resourcePath, getOut("A.js"));
- assertNotNull("No output", output);
- int start = input.indexOf("launch.setAttribute");
- int end = input.indexOf(";", start + 1);
- runTest(input, output, codeFormatter, CodeFormatter.K_JAVASCRIPT_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
- */
- public void test457() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test457", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Check null options
- */
- public void test458() {
- CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(null);
- runTest(codeFormatter, "test458", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51158
- */
- public void test459() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- true,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE
- ));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE
- ));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test459", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51158
- */
- public void test460() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_COMPACT,
- DefaultCodeFormatterConstants.INDENT_BY_ONE
- ));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test460", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51190
- */
- public void test461() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test461", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51158
- */
- public void test462() {
- String resourcePath = getResource("test462", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "neils");
- assertNotNull("No preferences", options);
-
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- true,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test462", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50276
- */
- public void test463() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test463", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51128
- */
- public void test464() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
-
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test464", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
- * @deprecated
- */
- public void test465() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test465", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
- * @deprecated
- */
- public void test466() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- true,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test466", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
- * @deprecated
- */
- public void test467() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- false,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_BY_ONE));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test467", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51128
- */
- public void test468() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
-
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test468", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51201
- */
- public void test469() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
-
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test469", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51035
- */
- public void test470() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test470", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
- */
- public void test471() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test471", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
- */
- public void test472() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test472", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
- */
- public void test473() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test473", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
- */
- public void test474() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test474", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
- */
- public void test475() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test475", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51768
- */
- public void test476() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER, DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test476", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51603
- */
- public void test477() {
- String option =
- DefaultCodeFormatterConstants.createAlignmentValue(
- true,
- DefaultCodeFormatterConstants.WRAP_NO_SPLIT,
- DefaultCodeFormatterConstants.INDENT_BY_ONE);
- assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_BY_ONE, DefaultCodeFormatterConstants.getIndentStyle(option));
-
- option = DefaultCodeFormatterConstants.setForceWrapping(option, false);
- assertFalse("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_BY_ONE, DefaultCodeFormatterConstants.getIndentStyle(option));
-
- option = DefaultCodeFormatterConstants.setIndentStyle(option, DefaultCodeFormatterConstants.INDENT_ON_COLUMN);
- assertFalse("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle(option));
-
-
- option = DefaultCodeFormatterConstants.setIndentStyle(option, DefaultCodeFormatterConstants.INDENT_DEFAULT);
- assertFalse("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
-
-
- option = DefaultCodeFormatterConstants.setForceWrapping(option, true);
- assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
-
-
- option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_COMPACT);
- assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
-
-
- option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK);
- assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
-
- option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE);
- assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
-
- option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED);
- assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
-
- option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE);
- assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
- assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle(option));
- assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52246
- */
- public void test478() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
- runTest(codeFormatter, "test478", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52479
- */
- public void test479() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test479", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52479
- */
- public void test480() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test480", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52283
- */
- public void test481() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test481", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52283
- */
- public void test482() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test482", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52851
- */
- public void test483() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test483", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
- */
- public void test484() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test484", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
- */
- public void test485() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test485", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
- */
- public void test486() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test486", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test487() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test487", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test488() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test488", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test489() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test489", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52747
- */
- public void test490() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.NEXT_LINE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test490", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59451
- */
- public void _test491() {
- String resourcePath = getResource("test491", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "DOI");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test491", "BundleChain.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59575
- */
- public void test492() {
- String resourcePath = getResource("test492", "core_formatting.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
- assertNotNull("No preferences", options);
- options.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.ERROR);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
- runTest(codeFormatter, "test492", "Main.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59716
- */
- public void test493() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS, "1");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test493", "MyClass.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60035
- */
- public void test494() {
- String resourcePath = getResource("test494", "format.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "AGPS default");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
- runTest(codeFormatter, "test494", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=58565
- */
- public void test495() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test495", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=58565
- */
- public void test496() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test496", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test497() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test497", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test498() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test498", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test499() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.blank_lines_before_first_class_body_declaration = 1;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test499", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test500() {
- Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test500", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
- */
- public void test501() {
- String resourcePath = getResource("test501", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "GMTI");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test501", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=69806
- */
- public void test502() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test502", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Formatting foreach
- */
- public void test503() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test503", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Formatting parameterized type
- */
- public void test504() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test504", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * Formatting parameterized type
- */
- public void test505() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test505", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * Formatting parameterized type
- */
- public void test506() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test506", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * Formatting enum declaration
- */
- public void test507() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test507", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * Formatting annotation type declaration
- */
- public void test508() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test508", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
- */
- public void test509() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.compact_else_if = true;
- preferences.insert_new_line_at_end_of_file_if_missing = true;
- preferences.number_of_empty_lines_to_preserve = 0;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter,"test509", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
- */
- public void test510() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.compact_else_if = true;
- preferences.insert_new_line_at_end_of_file_if_missing = false;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter,"test510", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
- */
- public void test511() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.compact_else_if = true;
- preferences.insert_new_line_at_end_of_file_if_missing = false;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter,"test511", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
- */
- public void test512() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
- preferences.keep_simple_if_on_one_line = true;
- preferences.keep_then_statement_on_same_line = true;
- preferences.keep_guardian_clause_on_one_line = true;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.compact_else_if = true;
- preferences.insert_new_line_at_end_of_file_if_missing = true;
- preferences.number_of_empty_lines_to_preserve = 1;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter,"test512", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=73371
- */
- public void test513() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test513", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75488
- */
- public void test514() {
- String resourcePath = getResource("test514", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
- assertNotNull("No preferences", options);
- options.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.ERROR);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
- runTest(codeFormatter, "test514", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
- */
- public void test515() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test515", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
- */
- public void test516() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test516", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
- */
- public void test517() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test517", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
- */
- public void test518() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test518", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
- */
- public void test519() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test519", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * Formatting enum declaration
- */
- public void test520() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test520", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76642
- */
- public void test521() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test521", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76642
- */
- public void test522() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test522", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
- */
- public void test523() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_type_declaration = true;
- preferences.insert_new_line_in_empty_enum_constant = false;
- preferences.insert_new_line_in_empty_enum_declaration = false;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test523", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
- */
- public void test524() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_type_declaration = true;
- preferences.insert_new_line_in_empty_enum_constant = false;
- preferences.insert_new_line_in_empty_enum_declaration = true;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test524", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
- */
- public void test525() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_type_declaration = true;
- preferences.insert_new_line_in_empty_enum_constant = true;
- preferences.insert_new_line_in_empty_enum_declaration = false;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test525", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
- */
- public void test526() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.insert_new_line_in_empty_type_declaration = true;
- preferences.insert_new_line_in_empty_enum_constant = true;
- preferences.insert_new_line_in_empty_enum_declaration = true;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test526", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=77249
- */
- public void test527() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test527", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79779
- */
- public void test528() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test528", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79779
- */
- public void test529() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test529", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
- */
- public void test530() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test530", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
- */
- public void test531() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test531", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
- */
- public void test532() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test532", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
- */
- public void test533() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test533", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78698
- */
- public void test534() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test534", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78698
- */
- public void test535() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test535", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83078
- */
- public void test538() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter,"test538", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83515
- */
- public void test539() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test539", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83515
- */
- public void test540() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test540", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83684
- */
- public void test541() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test541", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- public void test542() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test542", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void test543() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test543", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86410
- */
- public void test544() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.insert_space_after_closing_angle_bracket_in_type_parameters = true;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test544", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86878
- */
- public void test545() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test545", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86908
- */
- public void test546() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test546", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Add support for comment formatting
- */
- public void test547() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test547", "A.js", CodeFormatter.K_MULTI_LINE_COMMENT, false);//$NON-NLS-1$ //$NON-NLS-2$
-
- runTest(codeFormatter, "test547", "A.js", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Add support for comment formatting
- */
- public void test548() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test548", "A.js", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
-
- runTest(codeFormatter, "test548", "A.js", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
- public void test549() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.indentation_size = 4;
- preferences.tab_size = 8;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test549", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
- public void test550() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.indentation_size = 4;
- preferences.tab_size = 8;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test550", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
- public void test551() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.indentation_size = 4;
- preferences.tab_size = 8;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test551", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
- public void test552() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.indentation_size = 4;
- preferences.tab_size = 8;
- preferences.page_width = 57;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test552", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Add support for comment formatting
- */
- public void test553() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test553", "A.js", CodeFormatter.K_SINGLE_LINE_COMMENT, false);//$NON-NLS-1$ //$NON-NLS-2$
-
- runTest(codeFormatter, "test553", "A.js", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Add support for comment formatting
- */
- public void test554() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test554", "A.js", CodeFormatter.K_SINGLE_LINE_COMMENT, false);//$NON-NLS-1$ //$NON-NLS-2$
-
- runTest(codeFormatter, "test554", "A.js", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
- public void test555() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.indentation_size = 4;
- preferences.tab_size = 8;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test555", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * Empty array initializer formatting
- */
- public void test556() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test556", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * Empty array initializer formatting
- */
- public void test557() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.keep_empty_array_initializer_on_one_line = true;
- preferences.insert_space_between_empty_braces_in_array_initializer = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test557", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89302
- public void test558() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.insert_space_after_comma_in_enum_declarations = false;
- preferences.insert_new_line_after_annotation = false;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test558", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89302
- public void test559() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.insert_space_after_comma_in_enum_declarations = true;
- preferences.insert_new_line_after_annotation = false;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test559", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81497
- public void test560() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.keep_empty_array_initializer_on_one_line = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test560", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81497
- public void test561() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.keep_empty_array_initializer_on_one_line = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test561", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89318
- public void test562() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- preferences.insert_space_after_closing_angle_bracket_in_type_arguments = false;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test562", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89318
- public void test563() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.insert_space_after_closing_angle_bracket_in_type_arguments = true;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test563", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=89299
- public void test564() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 4;
- preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.keep_empty_array_initializer_on_one_line = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test564", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test565() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.use_tabs_only_for_leading_indentations = true;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test565", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }*/
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73658
- public void test566() {
- Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.brace_position_for_enum_constant = DefaultCodeFormatterConstants.NEXT_LINE;
- preferences.brace_position_for_enum_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test566", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test567() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.use_tabs_only_for_leading_indentations = true;
- preferences.page_width = 35;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test567", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test568() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.indentation_size = 4;
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.use_tabs_only_for_leading_indentations = true;
- preferences.page_width = 35;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test568", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test569() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.indentation_size = 4;
- preferences.tab_size = 4;
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.use_tabs_only_for_leading_indentations = false;
- preferences.page_width = 40;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test569", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77809
- public void test570() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test570", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77809
- public void test571() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test571", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90213
- public void test572() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.insert_space_after_opening_brace_in_array_initializer = false;
- preferences.insert_space_before_closing_brace_in_array_initializer = false;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test572", "A.js", CodeFormatter.K_STATEMENTS, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=90213
- public void test573() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test573", "A.js", CodeFormatter.K_STATEMENTS, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=91238
- public void test574() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test574", "A.js", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77809
- public void test575() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test575", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=95431
- public void test576() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test576", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98037
- public void test577() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test577", "A.js", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98037
- public void test578() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test578", "A.js", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98139
- public void test579() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test579", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98139
- public void test580() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test580", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=99084
- public void test581() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test581", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=99084
- public void test582() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.insert_space_after_closing_angle_bracket_in_type_arguments = false;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test582", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=100062
- public void test583() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test583", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test584() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "65");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test584", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test585() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test585", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test586() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "65");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test586", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
- public void test587() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test587", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=101230
- public void test588() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test588", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104796
- public void test589() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test589", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=103706
- public void test590() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, DefaultCodeFormatterConstants.TRUE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test590", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=103706
- public void test591() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, DefaultCodeFormatterConstants.FALSE);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test591", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98089
- public void test592() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.SPACE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test592", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
- public void test593() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test593", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
- public void test594() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test594", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
- public void test595() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test595", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
- public void test596() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test596", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87193
- public void test597() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test597", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87193
- public void test598() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test598", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=87193
- public void test599() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
- DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test599", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // test Scribe2.hasNLSTag()
- public void test600() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test600", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // Binary expression
- public void _test601() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test601", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=108916
- public void test605() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
- DefaultCodeFormatterConstants.createAlignmentValue(
- true,
- DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test605", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=110304
- public void test606() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test606", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=111270
- public void test607() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test607", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=111270
- public void _test608() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test608", "A.js", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=116858
- public void test609() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.indent_switchstatements_compare_to_cases = true;
- preferences.indent_switchstatements_compare_to_switch = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test609", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=122914
- */
- public void test610() {
- String resourcePath = getResource("test610", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "mhdk");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test610", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=111446
- */
- public void test611() {
- {
- // only tabs, indentation size = 4, tab size = 4
- // indentation size is ignored
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 4;
- preferences.indentation_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- assertEquals("Wrong indentation string", "\t", codeFormatter.createIndentationString(1));
- assertEquals("Wrong indentation string", "\t\t", codeFormatter.createIndentationString(2));
- assertEquals("Wrong indentation string", "\t\t\t", codeFormatter.createIndentationString(3));
- }
- {
- // only tabs, indentation size = 4, tab size = 8
- // indentation size is ignored
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.TAB;
- preferences.tab_size = 8;
- preferences.indentation_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- assertEquals("Wrong indentation string", "\t", codeFormatter.createIndentationString(1));
- assertEquals("Wrong indentation string", "\t\t", codeFormatter.createIndentationString(2));
- assertEquals("Wrong indentation string", "\t\t\t", codeFormatter.createIndentationString(3));
- }
- {
- // only spaces, indentation size = 4, tab size = 2
- // indentation size is ignored
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
- preferences.tab_size = 2;
- preferences.indentation_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- assertEquals("Wrong indentation string", " ", codeFormatter.createIndentationString(1));
- assertEquals("Wrong indentation string", " ", codeFormatter.createIndentationString(2));
- assertEquals("Wrong indentation string", " ", codeFormatter.createIndentationString(3));
- }
- {
- // mixed, indentation size = 4, tab size = 2
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.tab_size = 2;
- preferences.indentation_size = 4;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- assertEquals("Wrong indentation string", "\t\t", codeFormatter.createIndentationString(1));
- assertEquals("Wrong indentation string", "\t\t\t\t", codeFormatter.createIndentationString(2));
- }
- {
- // mixed, indentation size = 2, tab size = 4
- // indentation size is ignored
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
- preferences.tab_size = 4;
- preferences.indentation_size = 2;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- assertEquals("Wrong indentation string", " ", codeFormatter.createIndentationString(1));
- assertEquals("Wrong indentation string", "\t", codeFormatter.createIndentationString(2));
- assertEquals("Wrong indentation string", "\t ", codeFormatter.createIndentationString(3));
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=126625
- public void test612() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.indent_body_declarations_compare_to_annotation_declaration_header = false;
- preferences.indent_body_declarations_compare_to_type_header = true;
- preferences.insert_new_line_in_empty_annotation_declaration = false;
- preferences.insert_new_line_in_empty_type_declaration = true;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test612", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=126625
- public void test613() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.indent_body_declarations_compare_to_annotation_declaration_header = true;
- preferences.indent_body_declarations_compare_to_type_header = false;
- preferences.insert_new_line_in_empty_annotation_declaration = true;
- preferences.insert_new_line_in_empty_type_declaration = false;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test613", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=128848
- public void test614() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test614", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=128848
- public void test615() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test615", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=128848
- public void test616() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test616", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=131013
- public void test617() {
- String resourcePath = getResource("test617", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "JRK");
- assertNotNull("No preferences", options);
- options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- true,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test617", "A.js", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=137224
- public void test618() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test618", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=137224
- public void test619() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test619", "A.js", CodeFormatter.K_CLASS_BODY_DECLARATIONS, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=139291
- public void test620() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test620", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=139291
- public void test621() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test621", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=148370
- public void test622() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test622", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=148370
- public void test623() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test623", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=148370
- public void test624() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test624", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
- public void test625() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(
- DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
- DefaultCodeFormatterConstants.createAlignmentValue(
- true,
- DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
- DefaultCodeFormatterConstants.INDENT_DEFAULT));
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test625", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=152725
- public void test626() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test626", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
- public void test627() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test627", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
- public void test628() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test628", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
- public void test629() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP;
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- Hashtable newJavaCoreOptions = JavaScriptCore.getOptions();
- newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- JavaScriptCore.setOptions(newJavaCoreOptions);
-
- Map compilerOptions = new HashMap();
- compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
- runTest(codeFormatter, "test629", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
- public void test630() {
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
- preferences.insert_space_after_opening_paren_in_parenthesized_expression = true;
- preferences.insert_space_before_closing_paren_in_parenthesized_expression = true;
- preferences.insert_space_before_parenthesized_expression_in_throw = true;
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test630", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
- public void test631() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test631", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
- public void test632() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test632", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test633() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "3");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test633", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test634() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test634", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test635() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, "0");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test635", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test636() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "3");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test636", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test637() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "2");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test637", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test638() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test638", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test639() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "2");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test639", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
- public void test640() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test640", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=168109
- public void test641() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
- options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "36");
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "2");
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test641", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=166962
- public void test642() {
- String resourcePath = getResource("test642", "formatter.xml");
- Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Visionnaire");
- assertNotNull("No preferences", options);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test642", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
- public void test643() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test643", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
- public void test644() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test644", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
- public void test645() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaScriptCore.INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test645", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
- public void test646() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test646", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
- public void test647() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaScriptCore.DO_NOT_INSERT);
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test647", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
- public void test648() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaScriptCore.DO_NOT_INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test648", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
- public void test649() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaScriptCore.INSERT);
- options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test649", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
- public void test650() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test650", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
- public void test651() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test651", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
- public void test652() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test652", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
- public void test653() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test653", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
- public void test654() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test654", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
- public void test655() {
- final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
- DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
- runTest(codeFormatter, "test655", "A.js");//$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentFormatterUtil.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentFormatterUtil.java
deleted file mode 100644
index 7b6407b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentFormatterUtil.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter.comment;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextUtilities;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.ToolFactory;
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
-
-/**
- * Utilities for the comment formatter.
- *
- * @since 3.0
- */
-public class CommentFormatterUtil {
- /**
- * Formats the source string as a comment region of the specified kind.
- * <p>
- * Both offset and length must denote a valid comment partition, that is
- * to say a substring that starts and ends with the corresponding
- * comment delimiter tokens.
- *
- * @param kind the kind of the comment
- * @param source the source string to format
- * @param offset the offset relative to the source string where to
- * format
- * @param length the length of the region in the source string to format
- * @param preferences preferences for the comment formatter
- * @return the formatted source string
- */
- public static String format(int kind, String source, int offset, int length, Map preferences) {
- Assert.isNotNull(source);
- IDocument document= new Document(source);
-
- try {
- int indentOffset= document.getLineOffset(document.getLineOfOffset(offset));
- int indentationLevel= inferIndentationLevel(document.get(indentOffset, offset - indentOffset), getTabSize(preferences));
- return format(kind, source, offset, length, indentationLevel, preferences);
- } catch (BadLocationException x) {
- throw new RuntimeException(x);
- }
- }
-
- /**
- * Formats the source string as a comment region of the specified kind.
- * <p>
- * Both offset and length must denote a valid comment partition, that is
- * to say a substring that starts and ends with the corresponding
- * comment delimiter tokens.
- *
- * @param kind the kind of the comment
- * @param source the source string to format
- * @param offset the offset relative to the source string where to
- * format
- * @param length the length of the region in the source string to format
- * @param preferences preferences for the comment formatter
- * @return the formatted source string
- */
- public static String format(int kind, String source, int offset, int length, int indentationLevel, Map preferences) {
- Assert.isTrue(kind == CodeFormatter.K_JAVA_DOC || kind == CodeFormatter.K_MULTI_LINE_COMMENT || kind == CodeFormatter.K_SINGLE_LINE_COMMENT);
-
- Assert.isNotNull(source);
- Assert.isNotNull(preferences);
-
- Assert.isTrue(offset >= 0);
- Assert.isTrue(length <= source.length());
-
- IDocument document= new Document(source);
-
- TextEdit edit;
- edit= ToolFactory.createCodeFormatter(preferences).format(kind, source, offset, length, indentationLevel, TextUtilities.getDefaultLineDelimiter(document));
-
- try {
- if (edit != null)
- edit.apply(document);
- } catch (MalformedTreeException x) {
- throw new RuntimeException(x);
- } catch (BadLocationException x) {
- throw new RuntimeException(x);
- }
- return document.get();
- }
-
- /**
- * Infer the indentation level based on the given reference indentation,
- * tab size and text measurement.
- *
- * @param reference the reference indentation
- * @param tabSize the tab size
- * @return the inferred indentation level
- * @since 3.1
- */
- private static int inferIndentationLevel(String reference, int tabSize) {
- StringBuffer expanded= expandTabs(reference, tabSize);
-
- int spaceWidth, referenceWidth;
- spaceWidth= 1;
- referenceWidth= expanded.length();
-
- int level= referenceWidth / (tabSize * spaceWidth);
- if (referenceWidth % (tabSize * spaceWidth) > 0)
- level++;
- return level;
- }
-
- /**
- * Expands the given string's tabs according to the given tab size.
- *
- * @param string the string
- * @param tabSize the tab size
- * @return the expanded string
- * @since 3.1
- */
- private static StringBuffer expandTabs(String string, int tabSize) {
- StringBuffer expanded= new StringBuffer();
- for (int i= 0, n= string.length(), chars= 0; i < n; i++) {
- char ch= string.charAt(i);
- if (ch == '\t') {
- for (; chars < tabSize; chars++)
- expanded.append(' ');
- chars= 0;
- } else {
- expanded.append(ch);
- chars++;
- if (chars >= tabSize)
- chars= 0;
- }
-
- }
- return expanded;
- }
-
- /**
- * Returns the value of {@link DefaultCodeFormatterConstants#FORMATTER_TAB_SIZE}
- * from the given preferences.
- *
- * @param preferences the preferences
- * @return the value of {@link DefaultCodeFormatterConstants#FORMATTER_TAB_SIZE}
- * from the given preferences
- * @since 3.1
- */
- private static int getTabSize(Map preferences) {
- if (preferences.containsKey(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE))
- try {
- return Integer.parseInt((String) preferences.get(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE));
- } catch (NumberFormatException e) {
- // use default
- }
- return 4;
- }
-
- /**
- * Creates a formatting options with all default options and the given custom user options.
- *
- * @param user the custom user options
- * @return the formatting options
- * @since 3.1
- */
- public static Map createOptions(Map user) {
- final Map map= JavaScriptCore.getOptions();
-
- if (user != null) {
-
- for (final Iterator iterator= user.keySet().iterator(); iterator.hasNext();) {
-
- Object key= iterator.next();
- Object value = user.get(key);
- map.put(key, value);
- }
- }
- return map;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentTestCase.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentTestCase.java
deleted file mode 100644
index 453cc16..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentTestCase.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter.comment;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextUtilities;
-
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-import org.eclipse.wst.jsdt.core.tests.model.SuiteOfTestCases;
-
-public abstract class CommentTestCase extends SuiteOfTestCases {
- public static Test buildTestSuite(Class evaluationTestClass) {
- return buildTestSuite(evaluationTestClass, null); //$NON-NLS-1$
- }
-
- public static Test buildTestSuite(Class evaluationTestClass, String suiteName) {
- TestSuite suite = new Suite(suiteName==null?evaluationTestClass.getName():suiteName);
- List tests = buildTestsList(evaluationTestClass);
- for (int index=0, size=tests.size(); index<size; index++) {
- suite.addTest((Test)tests.get(index));
- }
- return suite;
- }
-
- public static final String DELIMITER= TextUtilities.getDefaultLineDelimiter(new Document());
-
- private Map fUserOptions;
-
- protected CommentTestCase(String name) {
- super(name);
- }
-
- /*
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- fUserOptions= null;
- }
-
- protected abstract int getCommentKind();
-
- protected Map getUserOptions() {
- return fUserOptions;
- }
-
- protected void setUserOption(String name, String value) {
- if (fUserOptions == null)
- fUserOptions= new HashMap();
-
- fUserOptions.put(name, value);
- }
-
- protected void setUserOption(Map options) {
- if (fUserOptions == null) {
- fUserOptions= options;
- } else {
- fUserOptions.putAll(options);
- }
- }
-
- protected final String testFormat(String text) {
- return testFormat(text, 0, text.length());
- }
-
- protected final String testFormat(String text, Map options) {
- return testFormat(text, 0, text.length(), getCommentKind(), options);
- }
- protected String testFormat(String text, int offset, int length) {
- return testFormat(text, offset, length, getCommentKind());
- }
-
- protected String testFormat(String text, int offset, int length, int kind) {
- return testFormat(text, offset, length, kind, getUserOptions());
- }
-
- protected String testFormat(String text, int offset, int length, int kind, Map options) {
- assertNotNull(text);
- assertTrue(offset >= 0);
- assertTrue(offset < text.length());
- assertTrue(length >= 0);
- assertTrue(offset + length <= text.length());
-
- assertTrue(kind == CodeFormatter.K_JAVA_DOC || kind == CodeFormatter.K_MULTI_LINE_COMMENT || kind == CodeFormatter.K_SINGLE_LINE_COMMENT);
-
- return CommentFormatterUtil.format(kind, text, offset, length, CommentFormatterUtil.createOptions(options));
- }
- protected String testFormat(String text, int offset, int length, int kind, int indentationLevel) {
- assertNotNull(text);
- assertTrue(offset >= 0);
- assertTrue(offset < text.length());
- assertTrue(length >= 0);
- assertTrue(offset + length <= text.length());
-
- assertTrue(kind == CodeFormatter.K_JAVA_DOC || kind == CodeFormatter.K_MULTI_LINE_COMMENT || kind == CodeFormatter.K_SINGLE_LINE_COMMENT);
-
- return CommentFormatterUtil.format(kind, text, offset, length, indentationLevel, CommentFormatterUtil.createOptions(getUserOptions()));
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentsTestSuite.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentsTestSuite.java
deleted file mode 100644
index 2b3c196..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentsTestSuite.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter.comment;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- * @since 3.0
- */
-public class CommentsTestSuite extends TestSuite {
-
- public static Test suite() {
- return new CommentsTestSuite();
- }
-
- public CommentsTestSuite() {
- addTest(MultiLineTestCase.suite());
- addTest(SingleLineTestCase.suite());
- //addTest(JavaDocTestCase.suite());
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/JavaDocTestCase.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/JavaDocTestCase.java
deleted file mode 100644
index e50b9d5..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/JavaDocTestCase.java
+++ /dev/null
@@ -1,703 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter.comment;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
-
-import org.eclipse.wst.jsdt.internal.formatter.comment.JavaDocLine;
-import org.eclipse.wst.jsdt.internal.formatter.comment.MultiCommentLine;
-
-public class JavaDocTestCase extends CommentTestCase {
-
- static {
-// TESTS_NAMES = new String[] { "test75460" } ;
- }
-
- protected static final String INFIX= MultiCommentLine.MULTI_COMMENT_CONTENT_PREFIX;
-
- protected static final String POSTFIX= MultiCommentLine.MULTI_COMMENT_END_PREFIX;
-
- protected static final String PREFIX= JavaDocLine.JAVADOC_START_PREFIX;
-
- public static Test suite() {
- return buildTestSuite(JavaDocTestCase.class);
- }
-
- public JavaDocTestCase(String name) {
- super(name);
- }
-
- protected int getCommentKind() {
- return CodeFormatter.K_JAVA_DOC;
- }
-
- public void testSingleLineComment1() {
- assertEquals(PREFIX + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat(PREFIX + "\t\t" + DELIMITER + "*\t test*/")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testSingleLineComment2() {
- assertEquals(PREFIX + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat(PREFIX + "test" + DELIMITER + "\t" + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testSingleLineComment3() {
- assertEquals(PREFIX + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat(PREFIX + DELIMITER + "* test\t*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineComment4() {
- assertEquals(PREFIX + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat(PREFIX + "test" + DELIMITER + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentSpace1() {
- assertEquals(PREFIX + " test" + POSTFIX, testFormat(PREFIX + "test*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentSpace2() {
- assertEquals(PREFIX + " test" + POSTFIX, testFormat(PREFIX + "test" + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentSpace3() {
- assertEquals(PREFIX + " test" + POSTFIX, testFormat(PREFIX + "test*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentSpace4() {
- assertEquals(PREFIX + " test test" + POSTFIX, testFormat(PREFIX + " test test*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentTabs1() {
- assertEquals(PREFIX + " test test" + POSTFIX, testFormat(PREFIX + "\ttest\ttest" + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentTabs2() {
- assertEquals(PREFIX + " test test" + POSTFIX, testFormat(PREFIX + "\ttest\ttest*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testMultiLineCommentBreak1() {
- String input= PREFIX + " test<br>test" + POSTFIX; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + INFIX + "test<br>" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals(expected, testFormat(input));
- }
-
- public void testMultiLineCommentCodeSnippet1() {
- String prefix= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX; //$NON-NLS-1$
- String postfix= DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + "while (i != 0) i--;" + postfix; //$NON-NLS-1$
- String expected= prefix + "while (i != 0)" + DELIMITER + INFIX + "\ti--;" + postfix; //$NON-NLS-1$//$NON-NLS-2$
- String result= testFormat(input);
- assertEquals(expected, result);
-
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
-
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Error in formatting parts of java code snippets in comment
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44035
- */
- public void testMultiLineCommentCodeSnippet2() {
- String prefix= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX; //$NON-NLS-1$
- String postfix= DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + "while (i != 0) { i--; }" + postfix; //$NON-NLS-1$
- String expected= prefix + "while (i != 0) {" + DELIMITER + INFIX + "\ti--;" + DELIMITER + INFIX + "}" + postfix; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String result= testFormat(input);
- assertEquals(expected, result);
-
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
-
- assertEquals(expected, result);
- }
-
- public void testMultiLineCommentCodeSnippet3() {
- String input= PREFIX + DELIMITER + "<pre>" + DELIMITER + "while (i != 0)" + DELIMITER + "i--;" + DELIMITER + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String expected= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX + "while (i != 0)" + DELIMITER + INFIX + "\ti--;" + DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String result= testFormat(input);
- assertEquals(expected, result);
-
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
-
- assertEquals(expected, result);
- }
-
- public void testMultiLineCommentCodeSnippetHtmlEntities1() {
- String prefix= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX; //$NON-NLS-1$
- String postfix= DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + "System.out.println(\"test\");" + postfix; //$NON-NLS-1$
- String expected= prefix + "System.out.println(&quot;test&quot;);" + postfix; //$NON-NLS-1$
- String result= testFormat(input);
- assertEquals(expected, result);
-
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
-
- assertEquals(expected, result);
- }
-
- public void testMultiLineCommentIndentTabs1() {
- String prefix= "public class Test {" + DELIMITER + "\t\t"; //$NON-NLS-1$ //$NON-NLS-2$
- String content= PREFIX + DELIMITER + "\t\t\t" + INFIX + "test test" + DELIMITER + "\t\t\t\t" + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- String postfix= DELIMITER + "}"; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + "\t\t" + INFIX + "test test" + DELIMITER + "\t\t" + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- assertEquals(prefix + expected + postfix, testFormat(prefix + content + postfix, prefix.length(), content.length()));
- }
-
- /**
- * [formatting] Comments formatter inserts tabs when it should use spaces
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47491
- */
- public void testMultiLineCommentIndentSpaces1() {
- String prefix= "public class Test {" + DELIMITER + "\t"; //$NON-NLS-1$ //$NON-NLS-2$
- String content= PREFIX + DELIMITER + "\t\t" + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- String postfix= DELIMITER + "}"; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + " " + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.SPACE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "3"); //$NON-NLS-1$
- assertEquals(prefix + expected + postfix, testFormat(prefix + content + postfix, prefix.length(), content.length()));
- }
-
- public void testMultiLineCommentIndentSpaces2() {
- String prefix= "public class Test {" + DELIMITER + " "; //$NON-NLS-1$ //$NON-NLS-2$
- String content= PREFIX + DELIMITER + "\t\t" + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- String postfix= DELIMITER + "}"; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + " " + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.SPACE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "3"); //$NON-NLS-1$
- assertEquals(prefix + expected + postfix, testFormat(prefix + content + postfix, prefix.length(), content.length()));
- }
-
- public void testMultiLineCommentIndentSpaces3() {
- String prefix= "public class Test {" + DELIMITER + " \t "; //$NON-NLS-1$ //$NON-NLS-2$
- String content= PREFIX + DELIMITER + "\t\t" + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- String postfix= DELIMITER + "}"; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + " " + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.SPACE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "3"); //$NON-NLS-1$
- assertEquals(prefix + expected + postfix, testFormat(prefix + content + postfix, prefix.length(), content.length()));
- }
-
- public void testMultiLineCommentIndentSpaces4() {
- String prefix= "public class Test {" + DELIMITER + " \t "; //$NON-NLS-1$ //$NON-NLS-2$
- String content= PREFIX + DELIMITER + "\t\t" + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- String postfix= DELIMITER + "}"; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + " " + INFIX + "test test" + DELIMITER + " " + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.SPACE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "3"); //$NON-NLS-1$
- assertEquals(prefix + expected + postfix, testFormat(prefix + content + postfix, prefix.length(), content.length()));
- }
-
- /**
- * [formatting] Repeated insertion of new line when formatting javadoc comment
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50212
- */
- public void testMultiLineCommentBlankLineAfterPre1() {
- String input= PREFIX + DELIMITER + INFIX + "<pre></pre>" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$
- String expected= PREFIX + DELIMITER + INFIX + "<pre></pre>" + DELIMITER + INFIX + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$
- String result= testFormat(input);
- assertEquals(expected, result);
- result= testFormat(result);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting][implementation] comment line length not correctly applied
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46341
- * Do not wrap.
- */
- public void testMultiLineCommentLineBreakBeforeImmutableRegions1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "22"); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "a <code>test</code>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting][implementation] comment line length not correctly applied
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46341
- * Do wrap.
- */
- public void testMultiLineCommentLineBreakBeforeImmutableRegions2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "21"); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "a <code>test</code>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + INFIX + "a" + DELIMITER + INFIX + "<code>test</code>" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting][implementation] comment line length not correctly applied
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46341
- * Do not wrap. (Consecutive immutable regions on multiple lines.)
- */
- public void testMultiLineCommentLineBreakBeforeImmutableRegions3() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "20"); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "a <code>" + DELIMITER + INFIX + "testestestestestestestestestest" + DELIMITER + INFIX + "</code>" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do not insert blank line before Javadoc tags
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.DO_NOT_INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "Description" + DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do insert blank line before Javadoc tags
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.TRUE); //$NON-NLS-1$
- String prefix= PREFIX + DELIMITER + INFIX + "Description"; //$NON-NLS-1$
- String postfix= DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + postfix;
- String expected= prefix + DELIMITER + INFIX + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do not remove blank line before Javadoc tags
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags3() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.TRUE); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "Description" + DELIMITER + INFIX + DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do remove blank line before Javadoc tags
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags4() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.DO_NOT_INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT,DefaultCodeFormatterConstants.TRUE); //$NON-NLS-1$
- String prefix= PREFIX + DELIMITER + INFIX + "Description"; //$NON-NLS-1$
- String postfix= DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + DELIMITER + INFIX + postfix;
- String expected= prefix + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do not insert blank line before Javadoc tags
- * @deprecated
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags5() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.DO_NOT_INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES, DefaultCodeFormatterConstants.FALSE); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "Description" + DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do insert blank line before Javadoc tags
- * @deprecated
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags6() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES, DefaultCodeFormatterConstants.TRUE); //$NON-NLS-1$
- String prefix= PREFIX + DELIMITER + INFIX + "Description"; //$NON-NLS-1$
- String postfix= DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + postfix;
- String expected= prefix + DELIMITER + INFIX + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do not remove blank line before Javadoc tags
- * @deprecated
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags7() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES, DefaultCodeFormatterConstants.TRUE); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "Description" + DELIMITER + INFIX + DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * Prefs > Java > Code Formatter > Comments: Preview incorrect
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55204
- * Do remove blank line before Javadoc tags
- * @deprecated
- */
- public void testMultiLineCommentBlankLineBeforeJavadoctags8() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, JavaScriptCore.DO_NOT_INSERT); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES,DefaultCodeFormatterConstants.TRUE); //$NON-NLS-1$
- String prefix= PREFIX + DELIMITER + INFIX + "Description"; //$NON-NLS-1$
- String postfix= DELIMITER + INFIX + "@param test" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + DELIMITER + INFIX + postfix;
- String expected= prefix + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] javadoc formatter removes blank lines between empty javadoc tags (xdoclet fails)
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68577
- */
- public void testLineBreaksBetweenEmptyJavaDocTags1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "@custom1" + DELIMITER + INFIX + DELIMITER + INFIX + "@custom2" + DELIMITER + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] javadoc formatter removes blank lines between empty javadoc tags (xdoclet fails)
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68577
- */
- public void testLineBreaksBetweenEmptyJavaDocTags2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE); //$NON-NLS-1$
- String input= PREFIX + DELIMITER + INFIX + "@custom1" + DELIMITER + INFIX + "@custom2" + DELIMITER + POSTFIX; //$NON-NLS-1$//$NON-NLS-2$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- public void testNoChange1() {
- String content= PREFIX + DELIMITER + POSTFIX;
- assertEquals(content, testFormat(content));
- }
-
- public void testNoFormat1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE);
- String content= PREFIX + DELIMITER + INFIX + "test" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX;
- assertEquals(content, testFormat(content));
- }
-
- /**
- * @deprecated
- */
- public void testNoFormat2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT, DefaultCodeFormatterConstants.FALSE);
- String content= PREFIX + DELIMITER + INFIX + "test" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX;
- assertEquals(content, testFormat(content));
- }
-
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testInlineTag1() {
- String input= PREFIX + DELIMITER + INFIX + "{@link Object} has many methods." + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testInlineTag2() {
- String input= PREFIX + DELIMITER + INFIX + "{@link Object}s are cool." + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testMultilineInlineTag1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "20"); //$NON-NLS-1$
- final String prefix= PREFIX + DELIMITER + INFIX + "{@link Object}";
- final String postfix= "has many methods." + DELIMITER + POSTFIX;
- String input= prefix + " " + postfix; //$NON-NLS-1$
- String expected= prefix + DELIMITER + INFIX + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testMultilineInlineTag2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "20"); //$NON-NLS-1$
- final String prefix= PREFIX + DELIMITER + INFIX + "{@link Objecterr}s";
- final String postfix= "are cool." + DELIMITER + POSTFIX;
- String input= prefix + " " + postfix; //$NON-NLS-1$
- String expected= prefix + DELIMITER + INFIX + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testTagWordbreaks1() {
- String input= PREFIX + DELIMITER + INFIX + "<code>Object</code> rocks." + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testTagWordbreaks2() {
- String input= PREFIX + DELIMITER + INFIX + "<code>Object</code>s are cool." + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= input;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testMultilineTagWordbreaks1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "20"); //$NON-NLS-1$
- String prefix= PREFIX + DELIMITER + INFIX + "<code>Object</code>";
- String postfix= "rocks." + DELIMITER + POSTFIX; //$NON-NLS-1$
- String input= prefix + " " + postfix;
- String expected= prefix + DELIMITER + INFIX + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc Formatter mishandles spaces in comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49686
- */
- public void testMultilineTagWordbreaks2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "20"); //$NON-NLS-1$
- final String prefix= PREFIX + DELIMITER + INFIX + "Foo";
- final String postfix= "<code>Obj</code>s" + DELIMITER + POSTFIX;
- String input= prefix + " " + postfix;
- String expected= prefix + DELIMITER + INFIX + postfix;
- String result= testFormat(input);
- assertEquals(expected, result);
- }
-
- public void testMultiLineComment() {
- String input= PREFIX + DELIMITER + " TOTO " + POSTFIX; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + INFIX + "TOTO" + DELIMITER + POSTFIX; //$NON-NLS-1$
- final String result = testFormat(input);
- assertEquals(expected, result);
- }
-
- public void testMultiLineComment2() {
- String input= PREFIX + DELIMITER + "TOTO" + POSTFIX; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + INFIX + "TOTO" + DELIMITER + POSTFIX; //$NON-NLS-1$
- final String result = testFormat(input);
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc formatting: extra newline with [pre]
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52921
- * <p>
- * This test only formats once.
- * </p>
- */
- public void testNoExtraNewlineWithPre1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, DefaultCodeFormatterConstants.TRUE);
- String input= PREFIX + DELIMITER + INFIX + "<pre>wrap here</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX + "wrap here" + DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$; //$NON-NLS-2$; //$NON-NLS-3$;
- String result= testFormat(input);
- assertEquals(expected, result);
-
- // now re-format several times
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
-
- expected= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX + "wrap here" + DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$; //$NON-NLS-2$; //$NON-NLS-3$;
- assertEquals(expected, result);
- }
-
- /**
- * [formatting] Javadoc formatting: extra newline with [pre]
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52921
- * <p>
- * This test only formats once.
- * </p>
- */
- public void testNoExtraNewlineWithPre2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, DefaultCodeFormatterConstants.FALSE);
- String input= PREFIX + DELIMITER + INFIX + "<pre>wrap here</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String expected= PREFIX + DELIMITER + INFIX + "<pre>wrap here</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- String result= testFormat(input);
- assertEquals(expected, result);
-
- // now re-format several times
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
- result= testFormat(result);
-
- expected= PREFIX + DELIMITER + INFIX + "<pre>wrap here</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$
- assertEquals(expected, result);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=109605
- public void test109605() {
- String input = "/**" + DELIMITER +
- " * <pre>" + DELIMITER +
- " * " + DELIMITER +
- " * </pre>" + DELIMITER +
- " * " + DELIMITER +
- " * " + DELIMITER +
- " * @author Darren Pearce" + DELIMITER +
- " * @version 22-Sep-2005" + DELIMITER +
- " * " + DELIMITER +
- " */";
-
- String expected = "/**" + DELIMITER +
- " * <pre>" + DELIMITER +
- " * </pre>" + DELIMITER +
- " * " + DELIMITER +
- " * " + DELIMITER +
- " * @author Darren Pearce" + DELIMITER +
- " * @version 22-Sep-2005" + DELIMITER +
- " * " + DELIMITER +
- " */";
- String result=testFormat(input);
- assertEquals(expected, result);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=60453
- public void test60453() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "80");
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE);
-
- String input = "/** Creates a new instance of DynamicEventChannel sdf sdfs dsdf dsfsd fd fsd fsdf sdf dsfsd (on the same line)" + DELIMITER +
- "* @pre obj != null" + DELIMITER +
- "*/";
-
- String expected = "/**" + DELIMITER +
- " * Creates a new instance of DynamicEventChannel sdf sdfs dsdf dsfsd fd fsd fsdf" + DELIMITER +
- " * sdf dsfsd (on the same line)" + DELIMITER +
- " * " + DELIMITER +
- " * @pre obj != null" + DELIMITER +
- " */";
- String result=testFormat(input, options);
- assertEquals(expected, result);
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60453
- * @deprecated
- */
- public void test60453_2() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "80");
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES, DefaultCodeFormatterConstants.FALSE);
-
- String input = "/** Creates a new instance of DynamicEventChannel sdf sdfs dsdf dsfsd fd fsd fsdf sdf dsfsd (on the same line)" + DELIMITER +
- "* @pre obj != null" + DELIMITER +
- "*/";
-
- String expected = "/**" + DELIMITER +
- " * Creates a new instance of DynamicEventChannel sdf sdfs dsdf dsfsd fd fsd fsdf" + DELIMITER +
- " * sdf dsfsd (on the same line)" + DELIMITER +
- " * " + DELIMITER +
- " * @pre obj != null" + DELIMITER +
- " */";
- String result=testFormat(input, options);
- assertEquals(expected, result);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=75460
- public void test75460() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "200");
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE);
-
- String input = "/**" + DELIMITER +
- "<pre>"+ DELIMITER +
- " Object[] objects = new Object[3];" + DELIMITER +
- " objects[0] = new String(\"Hallo Welt !!!\");" + DELIMITER +
- " objects[1] = new String(\"Test !!!\");" + DELIMITER +
- " objects[2] = new Integer(\"1980\");" + DELIMITER +
- " ObjectFile.write(pathname, objects);" + DELIMITER +
- " Object[] objs = ObjectFile.read(pathname);" + DELIMITER +
- " for(int i = 0; i < objs.length; i++)" + DELIMITER +
- " {" + DELIMITER +
- " System.out.println(objs[i].toString());" + DELIMITER +
- " }" + DELIMITER +
- "</pre>"+ DELIMITER +
- "*/";
-
- String expected = "/**" + DELIMITER +
- " * <pre>" + DELIMITER +
- " * Object[] objects = new Object[3];" + DELIMITER +
- " * objects[0] = new String(&quot;Hallo Welt !!!&quot;);" + DELIMITER +
- " * objects[1] = new String(&quot;Test !!!&quot;);" + DELIMITER +
- " * objects[2] = new Integer(&quot;1980&quot;);" + DELIMITER +
- " * ObjectFile.write(pathname, objects);" + DELIMITER +
- " * Object[] objs = ObjectFile.read(pathname);" + DELIMITER +
- " * for (int i = 0; i &lt; objs.length; i++) {" + DELIMITER +
- " * System.out.println(objs[i].toString());" + DELIMITER +
- " * }" + DELIMITER +
- " * </pre>" + DELIMITER +
- " */";
- String result=testFormat(input, options);
- assertEquals(expected, result);
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/MultiLineTestCase.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/MultiLineTestCase.java
deleted file mode 100644
index 0fbc781..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/MultiLineTestCase.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter.comment;
-
-import java.util.Map;
-
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.formatter.comment.MultiCommentLine;
-
-public class MultiLineTestCase extends CommentTestCase {
- protected static final String INFIX= MultiCommentLine.MULTI_COMMENT_CONTENT_PREFIX;
-
- protected static final String POSTFIX= MultiCommentLine.MULTI_COMMENT_END_PREFIX;
-
- protected static final String PREFIX= MultiCommentLine.MULTI_COMMENT_START_PREFIX;
-
- public static Test suite() {
- return buildTestSuite(MultiLineTestCase.class);
- }
-
- public MultiLineTestCase(String name) {
- super(name);
- }
-
- protected int getCommentKind() {
- return CodeFormatter.K_MULTI_LINE_COMMENT;
- }
-
- public void testSingleLineComment1() {
- assertEquals("/*" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat("/*\t\t" + DELIMITER + "*\t test*/")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- public void testSingleLineComment2() {
- assertEquals("/*" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat(PREFIX + "test" + DELIMITER + "\t" + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- public void testSingleLineComment3() {
- assertEquals("/*" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat(PREFIX + DELIMITER + "* test\t*/")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testSingleLineComment4() {
- assertEquals("/*" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX, testFormat("/*test" + DELIMITER + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testSingleLineCommentSpace1() {
- assertEquals(PREFIX + "test" + POSTFIX, testFormat("/*test*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentSpace2() {
- assertEquals(PREFIX + "test" + POSTFIX, testFormat("/*test" + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentSpace3() {
- assertEquals(PREFIX + "test" + POSTFIX, testFormat(PREFIX + "test*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentSpace4() {
- assertEquals(PREFIX + "test test" + POSTFIX, testFormat("/* test test*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentTabs1() {
- assertEquals(PREFIX + "test test" + POSTFIX, testFormat("/*\ttest\ttest" + POSTFIX)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testSingleLineCommentTabs2() {
- assertEquals(PREFIX + "test test" + POSTFIX, testFormat("/*\ttest\ttest*/")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * [formatting] formatter removes last line with block comments
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51654
- */
- public void testMultiLineCommentAsterisk1() {
- // test3 (currently) forces the comment formatter to actually do something, it wouldn't do anything otherwise.
- String input= PREFIX + INFIX + "test1" + DELIMITER + "test2" + INFIX + DELIMITER + "test3" + DELIMITER + "test4" + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String result= testFormat(input);
- assertTrue(result.indexOf("test1") != -1); //$NON-NLS-1$
- assertTrue(result.indexOf("test2") != -1); //$NON-NLS-1$
- assertTrue(result.indexOf("test3") != -1); //$NON-NLS-1$
- assertTrue(result.indexOf("test4") != -1); //$NON-NLS-1$
- }
-
- public void testNoChange1() {
- String content= PREFIX + DELIMITER + POSTFIX;
- assertEquals(content, testFormat(content));
- }
-
- public void testNoFormat1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
- String content= PREFIX + DELIMITER + INFIX + "test" + DELIMITER + INFIX + "test" + DELIMITER + POSTFIX;
- assertEquals(content, testFormat(content));
- }
-
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=145544
- */
- public void testMultiLineCommentFor145544() {
- setUserOption(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- String input= "/**\n" + //$NON-NLS-1$
- " * Member comment\n" +//$NON-NLS-1$
- " */";//$NON-NLS-1$
- String result= testFormat(input, 0, input.length(), CodeFormatter.K_MULTI_LINE_COMMENT , 2);
- String expectedOutput = "/***********************************************************************\n" +
- " * Member comment\n" +
- " */";
- assertEquals("Different output", expectedOutput, result);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=75460
- public void test75460() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "200");
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
-
- String input = "/*" + DELIMITER +
- " var objects = new Array(3);" + DELIMITER +
- " objects[0] = new String(\"Hallo Welt !!!\");" + DELIMITER +
- " objects[1] = new String(\"Test !!!\");" + DELIMITER +
- " objects[2] = new Number(\"1980\");" + DELIMITER +
- " var objs = ObjectFile.read(pathname);" + DELIMITER +
- " for(int i = 0; i < objs.length; i++)" + DELIMITER +
- " {" + DELIMITER +
- " alert(objs[i].toString());" + DELIMITER +
- " }" + DELIMITER +
- "*/";
-
- String expected = input;
- String result=testFormat(input, options);
- assertEquals(expected, result);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49412
- // check backward compatibility
- public void test49412() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "200");
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, DefaultCodeFormatterConstants.TRUE);
-
- String input = "/*" + DELIMITER + DELIMITER +
- " test block comment with a blank line" + DELIMITER +
- "*/";
-
- String expected= "/*" + DELIMITER +
- " * test block comment with a blank line" + DELIMITER +
- " */";
-
- String result=testFormat(input, options);
- assertEquals(expected, result);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49412
- // check backward compatibility
- public void test49412_2() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "200");
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, DefaultCodeFormatterConstants.TRUE);
-
- String input = "/*" + DELIMITER + DELIMITER +
- " test block comment with a blank line" + DELIMITER +
- "*/";
-
- String expected= input;
-
- String result=testFormat(input, options);
- assertEquals(expected, result);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=49412
- // check backward compatibility
- public void test49412_3() {
- Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "200");
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT, DefaultCodeFormatterConstants.TRUE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
-
- String input = "/*" + DELIMITER + DELIMITER +
- " test block comment with a blank line" + DELIMITER +
- "*/";
-
- String expected= "/*" + DELIMITER +
- " * "+ DELIMITER +
- " * test block comment with a blank line" + DELIMITER +
- " */";
-
- String result=testFormat(input, options);
- assertEquals(expected, result);
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/SingleLineTestCase.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/SingleLineTestCase.java
deleted file mode 100644
index 8130848..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/SingleLineTestCase.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.formatter.comment;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
-import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
-
-import org.eclipse.wst.jsdt.internal.formatter.comment.SingleCommentLine;
-
-public class SingleLineTestCase extends CommentTestCase {
- protected static final String PREFIX= SingleCommentLine.SINGLE_COMMENT_PREFIX;
-
- public static Test suite() {
- return buildTestSuite(SingleLineTestCase.class);
- }
-
- public SingleLineTestCase(String name) {
- super(name);
- }
-
- protected int getCommentKind() {
- return CodeFormatter.K_SINGLE_LINE_COMMENT;
- }
-
- public void testClearBlankLines1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "5"); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE);
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test\ttest" + DELIMITER + "//" + DELIMITER + "//\t\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- }
-
- public void testClearBlankLines2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "5"); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE);
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test\t\ttest" + DELIMITER + PREFIX + DELIMITER + "//\t\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
-
- public void testClearBlankLines3() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "5"); //$NON-NLS-1$
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, DefaultCodeFormatterConstants.FALSE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, DefaultCodeFormatterConstants.FALSE);
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test\ttest" + DELIMITER + "//" + DELIMITER + PREFIX + "test\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- }
-
- public void testCommentBegin1() {
- assertEquals(PREFIX + "test" + DELIMITER, testFormat("//test")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentBegin2() {
- assertEquals(PREFIX + "test" + DELIMITER, testFormat(PREFIX + "test")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentBegin3() {
- assertEquals(PREFIX + "test" + DELIMITER, testFormat("//\t\ttest " + DELIMITER)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentDelimiter1() {
- assertEquals(PREFIX + "test" + DELIMITER, testFormat("//\t\ttest " + DELIMITER + DELIMITER)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentDelimiter2() {
- assertEquals(PREFIX + "test" + DELIMITER, testFormat(PREFIX + "test " + DELIMITER + DELIMITER + DELIMITER)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentSpace1() {
- assertEquals(PREFIX + "test test" + DELIMITER, testFormat("//test\t \t test")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentSpace2() {
- assertEquals(PREFIX + "test test" + DELIMITER, testFormat("//test test")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentSpace3() {
- assertEquals(PREFIX + "test test" + DELIMITER, testFormat(PREFIX + "test \t \t test")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testCommentWrapping1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "5"); //$NON-NLS-1$
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testCommentWrapping2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "1"); //$NON-NLS-1$
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testCommentWrapping3() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "32"); //$NON-NLS-1$
- assertEquals(PREFIX + "test test" + DELIMITER, testFormat("//test\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testCommentWrapping4() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "32"); //$NON-NLS-1$
- assertEquals(PREFIX + "test test" + DELIMITER, testFormat("//test\ttest" + DELIMITER)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testCommentWrapping5() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaScriptCore.TAB);
- String prefix= "public class Test {" + DELIMITER + " int test; // test test test test test test test test test test test test";
- String inputInfix= " ";
- String expectedInfix= DELIMITER + "\t\t\t\t" + PREFIX;
- String suffix= "test" + DELIMITER + "}" + DELIMITER;
- String input= prefix + inputInfix + suffix;
- int offset= input.indexOf("//");
- assertEquals(prefix + expectedInfix + suffix, testFormat(input, offset, input.indexOf(DELIMITER, offset) + DELIMITER.length() - offset));
- }
-
- public void testHeaderComment1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER, DefaultCodeFormatterConstants.FALSE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "12"); //$NON-NLS-1$
- assertEquals(PREFIX + "test test" + DELIMITER + PREFIX + "test test" + DELIMITER + PREFIX + "test test" + DELIMITER, testFormat("//test\t\t\t\ttest" + DELIMITER + PREFIX + "test test test test")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
-
- public void testHeaderComment2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER, DefaultCodeFormatterConstants.FALSE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "24"); //$NON-NLS-1$
- assertEquals(PREFIX + "test test test test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test\t\t\t" + DELIMITER + PREFIX + "test test test test" + DELIMITER)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- public void testIllegalLineLength1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "1"); //$NON-NLS-1$
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testIllegalLineLength2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "-16"); //$NON-NLS-1$
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat(PREFIX + "\t\t test\ttest")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testMultipleComments1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "5"); //$NON-NLS-1$
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test test" + DELIMITER + PREFIX + "test test test test")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
- }
-
- public void testMultipleComments2() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "12"); //$NON-NLS-1$
- assertEquals(PREFIX + "test test" + DELIMITER + PREFIX + "test test" + DELIMITER + PREFIX + "test test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("//test test\ttest" + DELIMITER + PREFIX + DELIMITER + PREFIX + "test test test test")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
-
- public void testMultipleComments3() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "11"); //$NON-NLS-1$
- assertEquals(PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER + PREFIX + "test" + DELIMITER, testFormat("// test\t\t\ttest\ttest" + DELIMITER + PREFIX + "test test test test")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- }
-
- public void testIndentedComment1() {
- String prefix= "public class Test {" + DELIMITER + "\t";
- String comment= PREFIX + "test" + DELIMITER;
- String postfix= "}" + DELIMITER;
- String string= prefix + comment + postfix;
- assertEquals(string, testFormat(string, prefix.length(), comment.length()));
- }
-
- public void testIndentedComment2() {
- String prefix= "public class Test {" + DELIMITER + "\tpublic void test() {" + DELIMITER + "\t\t";
- String comment= PREFIX + "test" + DELIMITER;
- String postfix= "\t}" + DELIMITER + "}" + DELIMITER;
- String string= prefix + comment + postfix;
- assertEquals(string, testFormat(string, prefix.length(), comment.length()));
- }
-
- public void testIndentedComment3() {
- String prefix= "public class Test {" + DELIMITER + "\tpublic void test() {" + DELIMITER + "\t\tif (true) {" + DELIMITER + "\t\t\t";
- String comment= PREFIX + "test" + DELIMITER;
- String postfix= "\t\t}" + DELIMITER + "\t}" + DELIMITER + "}" + DELIMITER;
- String string= prefix + comment + postfix;
- assertEquals(string, testFormat(string, prefix.length(), comment.length()));
- }
-
- public void testNoChange1() {
- String content= PREFIX;
- assertEquals(content, testFormat(content));
- }
-
- public void testNoFormat1() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "1");
- String content= PREFIX + "test test";
- assertEquals(content, testFormat(content));
- }
- public void _test109581() {
- setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
- String content= "//// some comment ////";
- assertEquals(content + DELIMITER, testFormat(content));
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelCompletionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelCompletionTests.java
deleted file mode 100644
index 15f8beb..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelCompletionTests.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-
-import junit.framework.*;
-
-public abstract class AbstractJavaModelCompletionTests extends AbstractJavaModelTests implements RelevanceConstants {
- public static List COMPLETION_SUITES = null;
- protected static IJavaScriptProject COMPLETION_PROJECT;
- protected class CompletionResult {
- public String proposals;
- public String context;
- public int cursorLocation;
- public int tokenStart;
- public int tokenEnd;
- }
- Hashtable oldOptions;
- IJavaScriptUnit wc = null;
-public AbstractJavaModelCompletionTests(String name) {
- super(name);
-}
-protected void addLibrary(String projectName, String jarName, String sourceZipName, String docZipName, boolean exported) throws JavaScriptModelException {
- IJavaScriptProject javaProject = getJavaProject(projectName);
- IProject project = javaProject.getProject();
- String projectPath = '/' + project.getName() + '/';
-
- IIncludePathAttribute[] extraAttributes;
- if(docZipName == null) {
- extraAttributes = new IIncludePathAttribute[0];
- } else {
- extraAttributes =
- new IIncludePathAttribute[]{
- JavaScriptCore.newIncludepathAttribute(
- IIncludePathAttribute.JSDOC_LOCATION_ATTRIBUTE_NAME,
- "jar:platform:/resource"+projectPath+docZipName+"!/")};
- }
-
- addLibraryEntry(
- javaProject,
- new Path(projectPath + jarName),
- sourceZipName == null ? null : new Path(projectPath + sourceZipName),
- sourceZipName == null ? null : new Path(""),
- null,
- null,
- extraAttributes,
- exported);
-}
-protected void removeLibrary(String projectName, String jarName) throws CoreException, IOException {
- IJavaScriptProject javaProject = getJavaProject(projectName);
- IProject project = javaProject.getProject();
- String projectPath = '/' + project.getName() + '/';
- removeLibraryEntry(javaProject, new Path(projectPath + jarName));
-}
-public IJavaScriptUnit getWorkingCopy(String path, String source) throws JavaScriptModelException {
- return super.getWorkingCopy(path, source, this.wcOwner, null);
-}
-protected CompletionResult complete(String path, String source, String completeBehind) throws JavaScriptModelException {
- return this.complete(path, source, false, completeBehind);
-}
-protected CompletionResult complete(String path, String source, boolean showPositions, String completeBehind) throws JavaScriptModelException {
- return this.complete(path,source,showPositions, completeBehind, null, null);
-}
-protected CompletionResult complete(String path, String source, boolean showPositions, String completeBehind, String tokenStartBehind, String token) throws JavaScriptModelException {
- this.wc = getWorkingCopy(path, source);
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, showPositions);
- String str = this.wc.getSource();
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- int tokenStart = -1;
- int tokenEnd = -1;
- if(tokenStartBehind != null && token != null) {
- tokenStart = str.lastIndexOf(tokenStartBehind) + tokenStartBehind.length();
- tokenEnd = tokenStart + token.length() - 1;
- }
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- CompletionResult result = new CompletionResult();
- result.proposals = requestor.getResults();
- result.context = requestor.getContext();
- result.cursorLocation = cursorLocation;
- result.tokenStart = tokenStart;
- result.tokenEnd = tokenEnd;
- return result;
-}
-protected CompletionResult contextComplete(IJavaScriptUnit cu, int cursorLocation) throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false);
- cu.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- CompletionResult result = new CompletionResult();
- result.proposals = requestor.getResults();
- result.context = requestor.getContext();
- result.cursorLocation = cursorLocation;
- return result;
-}
-protected CompletionResult snippetContextComplete(
- IType type,
- String snippet,
- int insertion,
- int cursorLocation,
- boolean isStatic) throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false);
- type.codeComplete(snippet.toCharArray(), insertion, cursorLocation, null, null, null, isStatic, requestor, this.wcOwner);
-
- CompletionResult result = new CompletionResult();
- result.proposals = requestor.getResults();
- result.context = requestor.getContext();
- result.cursorLocation = cursorLocation;
- return result;
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.oldOptions = JavaScriptCore.getOptions();
- waitUntilIndexesReady();
-}
-protected void setUp() throws Exception {
- super.setUp();
- this.wcOwner = new WorkingCopyOwner(){};
-}
-public void tearDownSuite() throws Exception {
- JavaScriptCore.setOptions(this.oldOptions);
- this.oldOptions = null;
- if (COMPLETION_SUITES == null) {
- deleteProject("Completion");
- } else {
- COMPLETION_SUITES.remove(getClass());
- if (COMPLETION_SUITES.size() == 0) {
- deleteProject("Completion");
- COMPLETION_SUITES = null;
- }
- }
- super.tearDownSuite();
-}
-protected void tearDown() throws Exception {
- if(this.wc != null) {
- this.wc.discardWorkingCopy();
- this.wc = null;
- }
- super.tearDown();
-}
-protected void assertResults(String expected, String actual) {
- try {
- assertEquals(expected, actual);
- } catch(ComparisonFailure c) {
- System.out.println(actual);
- System.out.println();
- throw c;
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelTests.java
deleted file mode 100644
index ca77cbc..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelTests.java
+++ /dev/null
@@ -1,2261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.*;
-import java.net.URL;
-import java.util.*;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.compiler.libraries.SystemLibraryLocation;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.search.*;
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.core.ClasspathEntry;
-import org.eclipse.wst.jsdt.internal.core.JavaCorePreferenceInitializer;
-import org.eclipse.wst.jsdt.internal.core.JavaElement;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.NameLookup;
-import org.eclipse.wst.jsdt.internal.core.ResolvedSourceMethod;
-import org.eclipse.wst.jsdt.internal.core.ResolvedSourceType;
-import org.eclipse.wst.jsdt.internal.core.search.BasicSearchEngine;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-
-public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
-
- /**
- * The java.io.File path to the directory that contains the external jars.
- */
- protected static String EXTERNAL_JAR_DIR_PATH;
-
- // used java project
- protected IJavaScriptProject currentProject;
-
- // working copies usage
- protected IJavaScriptUnit[] workingCopies;
- protected WorkingCopyOwner wcOwner;
-
- // infos for invalid results
- protected int tabs = 2;
- protected boolean displayName = false;
- protected String endChar = ",";
-
- public static class ProblemRequestor implements IProblemRequestor {
- public StringBuffer problems;
- public int problemCount;
- protected char[] unitSource;
- public ProblemRequestor() {
- initialize(null);
- }
- public void acceptProblem(IProblem problem) {
- org.eclipse.wst.jsdt.core.tests.util.Util.appendProblem(this.problems, problem, this.unitSource, ++this.problemCount);
- this.problems.append("----------\n");
- }
- public void beginReporting() {
- this.problems.append("----------\n");
- }
- public void endReporting() {
- if (this.problemCount == 0)
- this.problems.append("----------\n");
- }
- public boolean isActive() {
- return true;
- }
- public void initialize(char[] source) {
- this.problems = new StringBuffer();
- this.problemCount = 0;
- this.unitSource = source;
- }
- }
-
- /**
- * Delta listener
- */
- protected class DeltaListener implements IElementChangedListener {
- /**
- * Deltas received from the java model. See
- * <code>#startDeltas</code> and
- * <code>#stopDeltas</code>.
- */
- public IJavaScriptElementDelta[] deltas;
-
- public ByteArrayOutputStream stackTraces;
-
- public void elementChanged(ElementChangedEvent ev) {
- IJavaScriptElementDelta[] copy= new IJavaScriptElementDelta[deltas.length + 1];
- System.arraycopy(deltas, 0, copy, 0, deltas.length);
- copy[deltas.length]= ev.getDelta();
- deltas= copy;
-
-// new Throwable("Caller of IElementChangedListener#elementChanged").printStackTrace(new PrintStream(this.stackTraces));
- }
- public JavaScriptUnit getCompilationUnitAST(IJavaScriptUnit workingCopy) {
- for (int i=0, length= this.deltas.length; i<length; i++) {
- JavaScriptUnit result = getCompilationUnitAST(workingCopy, this.deltas[i]);
- if (result != null)
- return result;
- }
- return null;
- }
- private JavaScriptUnit getCompilationUnitAST(IJavaScriptUnit workingCopy, IJavaScriptElementDelta delta) {
- if ((delta.getFlags() & IJavaScriptElementDelta.F_AST_AFFECTED) != 0 && workingCopy.equals(delta.getElement()))
- return delta.getJavaScriptUnitAST();
- return null;
- }
- protected void sortDeltas(IJavaScriptElementDelta[] elementDeltas) {
- org.eclipse.wst.jsdt.internal.core.util.Util.Comparer comparer = new org.eclipse.wst.jsdt.internal.core.util.Util.Comparer() {
- public int compare(Object a, Object b) {
- IJavaScriptElementDelta deltaA = (IJavaScriptElementDelta)a;
- IJavaScriptElementDelta deltaB = (IJavaScriptElementDelta)b;
- return deltaA.getElement().getElementName().compareTo(deltaB.getElement().getElementName());
- }
- };
- org.eclipse.wst.jsdt.internal.core.util.Util.sort(elementDeltas, comparer);
- for (int i = 0, max = elementDeltas.length; i < max; i++) {
- IJavaScriptElementDelta delta = elementDeltas[i];
- IJavaScriptElementDelta[] children = delta.getAffectedChildren();
- if (children != null) {
- sortDeltas(children);
- }
- }
- }
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- for (int i=0, length= this.deltas.length; i<length; i++) {
- IJavaScriptElementDelta delta = this.deltas[i];
- IJavaScriptElementDelta[] children = delta.getAffectedChildren();
- int childrenLength=children.length;
- IResourceDelta[] resourceDeltas = delta.getResourceDeltas();
- int resourceDeltasLength = resourceDeltas == null ? 0 : resourceDeltas.length;
- if (childrenLength == 0 && resourceDeltasLength == 0) {
- buffer.append(delta);
- } else {
- sortDeltas(children);
- for (int j=0; j<childrenLength; j++) {
- buffer.append(children[j]);
- if (j != childrenLength-1) {
- buffer.append("\n");
- }
- }
- for (int j=0; j<resourceDeltasLength; j++) {
- if (j == 0 && buffer.length() != 0) {
- buffer.append("\n");
- }
- buffer.append(resourceDeltas[j]);
- if (j != resourceDeltasLength-1) {
- buffer.append("\n");
- }
- }
- }
- if (i != length-1) {
- buffer.append("\n\n");
- }
- }
- return buffer.toString();
- }
- }
- protected DeltaListener deltaListener = new DeltaListener();
-
-
- public AbstractJavaModelTests(String name) {
- super(name);
- }
-
- public AbstractJavaModelTests(String name, int tabs) {
- super(name);
- this.tabs = tabs;
- }
-
- /**
- * Build a test suite with all tests computed from public methods starting with "test"
- * found in the given test class.
- * Test suite name is the name of the given test class.
- *
- * Note that this lis maybe reduced using some mechanisms detailed in {@link #buildTestsList(Class)} method.
- *
- * This test suite differ from this computed in {@link TestCase} in the fact that this is
- * a {@link SuiteOfTestCases.Suite} instead of a simple framework {@link TestSuite}.
- *
- * @param evaluationTestClass
- * @return a test suite ({@link Test})
- */
- public static Test buildModelTestSuite(Class evaluationTestClass) {
- return buildModelTestSuite(evaluationTestClass, ORDERING);
- }
-
- /**
- * Build a test suite with all tests computed from public methods starting with "test"
- * found in the given test class and sorted in alphabetical order.
- * Test suite name is the name of the given test class.
- *
- * Note that this lis maybe reduced using some mechanisms detailed in {@link #buildTestsList(Class)} method.
- *
- * This test suite differ from this computed in {@link TestCase} in the fact that this is
- * a {@link SuiteOfTestCases.Suite} instead of a simple framework {@link TestSuite}.
- *
- * @param evaluationTestClass
- * @param ordering kind of sort use for the list (see {@link #ORDERING} for possible values)
- * @return a test suite ({@link Test})
- */
- public static Test buildModelTestSuite(Class evaluationTestClass, long ordering) {
- TestSuite suite = new Suite(evaluationTestClass.getName());
- List tests = buildTestsList(evaluationTestClass, 0, ordering);
- for (int index=0, size=tests.size(); index<size; index++) {
- suite.addTest((Test)tests.get(index));
- }
- return suite;
- }
-
- protected void addJavaNature(String projectName) throws CoreException {
- IProject project = getWorkspaceRoot().getProject(projectName);
- IProjectDescription description = project.getDescription();
- description.setNatureIds(new String[] {JavaScriptCore.NATURE_ID});
- project.setDescription(description, null);
- }
- protected void assertSearchResults(String expected, Object collector) {
- assertSearchResults("Unexpected search results", expected, collector);
- }
- protected void assertSearchResults(String message, String expected, Object collector) {
- String actual = collector.toString();
- if (!expected.equals(actual)) {
- if (this.displayName) System.out.println(getName()+" actual result is:");
- System.out.print(displayString(actual, this.tabs));
- System.out.println(",");
- }
- assertEquals(
- message,
- expected,
- actual
- );
- }
- protected void addLibrary(String jarName, String sourceZipName, String[] pathAndContents, String compliance) throws CoreException, IOException {
- addLibrary(this.currentProject, jarName, sourceZipName, pathAndContents, null, null, compliance);
- }
- protected void addLibrary(IJavaScriptProject javaProject, String jarName, String sourceZipName, String[] pathAndContents, String compliance) throws CoreException, IOException {
- addLibrary(javaProject, jarName, sourceZipName, pathAndContents, null, null, compliance);
- }
- protected void addLibrary(IJavaScriptProject javaProject, String libraryPath, String sourceZipName, String[] pathAndContents, String[] librariesInclusionPatterns, String[] librariesExclusionPatterns, String compliance) throws CoreException, IOException {
- IProject project = javaProject.getProject();
- String projectLocation = project.getLocation().toOSString();
- boolean projectbased=libraryPath==null;
- if (projectbased)
- libraryPath=projectLocation;
-
- for (int i = 0; i < pathAndContents.length; i+=2) {
-
- String jarPath = libraryPath + File.separator + pathAndContents[i];
- org.eclipse.wst.jsdt.core.tests.util.Util.createFile(jarPath, pathAndContents[i+1]);
- if (projectbased)
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- String projectPath = '/' + project.getName() + '/';
- Path path = (projectbased) ?
- new Path(projectPath + pathAndContents[i]) :
- new Path(jarPath);
- addLibraryEntry(
- javaProject,
- path,
- null,
- null,
- toIPathArray(librariesInclusionPatterns),
- toIPathArray(librariesExclusionPatterns),
- true
- );
-
- }
-
- }
- protected void addLibraryEntry(String path, boolean exported) throws JavaScriptModelException {
- addLibraryEntry(this.currentProject, new Path(path), null, null, null, null, exported);
- }
- protected void addLibraryEntry(IJavaScriptProject project, String path, boolean exported) throws JavaScriptModelException {
- addLibraryEntry(project, new Path(path), null, null, null, null, exported);
- }
- protected void addLibraryEntry(IJavaScriptProject project, String path, String srcAttachmentPath, String srcAttachmentPathRoot, boolean exported) throws JavaScriptModelException{
- addLibraryEntry(
- project,
- new Path(path),
- srcAttachmentPath == null ? null : new Path(srcAttachmentPath),
- srcAttachmentPathRoot == null ? null : new Path(srcAttachmentPathRoot),
- null,
- null,
- new IIncludePathAttribute[0],
- exported
- );
- }
- protected void addLibraryEntry(IJavaScriptProject project, IPath path, IPath srcAttachmentPath, IPath srcAttachmentPathRoot, IPath[] accessibleFiles, IPath[] nonAccessibleFiles, boolean exported) throws JavaScriptModelException{
- addLibraryEntry(
- project,
- path,
- srcAttachmentPath,
- srcAttachmentPathRoot,
- accessibleFiles,
- nonAccessibleFiles,
- new IIncludePathAttribute[0],
- exported
- );
- }
- protected void addLibraryEntry(IJavaScriptProject project, IPath path, IPath srcAttachmentPath, IPath srcAttachmentPathRoot, IPath[] accessibleFiles, IPath[] nonAccessibleFiles, IIncludePathAttribute[] extraAttributes, boolean exported) throws JavaScriptModelException{
- IIncludePathEntry[] entries = project.getRawIncludepath();
- int length = entries.length;
- System.arraycopy(entries, 0, entries = new IIncludePathEntry[length + 1], 0, length);
- entries[length] = JavaScriptCore.newLibraryEntry(
- path,
- srcAttachmentPath,
- srcAttachmentPathRoot,
- ClasspathEntry.getAccessRules(accessibleFiles, nonAccessibleFiles),
- extraAttributes,
- exported);
- project.setRawIncludepath(entries, null);
- }
- protected void assertSortedElementsEqual(String message, String expected, IJavaScriptElement[] elements) {
- sortElements(elements);
- assertElementsEqual(message, expected, elements);
- }
-
-
- protected void assertResourcesEqual(String message, String expected, Object[] resources) {
- sortResources(resources);
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = resources.length; i < length; i++) {
- if (resources[i] instanceof IResource) {
- buffer.append(((IResource) resources[i]).getFullPath().toString());
- } else if (resources[i] instanceof IStorage) {
- buffer.append(((IStorage) resources[i]).getFullPath().toString());
- } else if (resources[i] == null) {
- buffer.append("<null>");
- }
- if (i != length-1)buffer.append("\n");
- }
- if (!expected.equals(buffer.toString())) {
- System.out.print(org.eclipse.wst.jsdt.core.tests.util.Util.displayString(buffer.toString(), 2));
- System.out.println(this.endChar);
- }
- assertEquals(
- message,
- expected,
- buffer.toString()
- );
- }
- protected void assertResourceNamesEqual(String message, String expected, Object[] resources) {
- sortResources(resources);
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = resources.length; i < length; i++) {
- if (resources[i] instanceof IResource) {
- buffer.append(((IResource)resources[i]).getName());
- } else if (resources[i] instanceof IStorage) {
- buffer.append(((IStorage) resources[i]).getName());
- } else if (resources[i] == null) {
- buffer.append("<null>");
- }
- if (i != length-1)buffer.append("\n");
- }
- if (!expected.equals(buffer.toString())) {
- System.out.print(org.eclipse.wst.jsdt.core.tests.util.Util.displayString(buffer.toString(), 2));
- System.out.println(this.endChar);
- }
- assertEquals(
- message,
- expected,
- buffer.toString()
- );
- }
- protected void assertElementEquals(String message, String expected, IJavaScriptElement element) {
- String actual = element == null ? "<null>" : ((JavaElement) element).toStringWithAncestors(false/*don't show key*/);
- if (!expected.equals(actual)) {
- if (this.displayName) System.out.println(getName()+" actual result is:");
- System.out.println(displayString(actual, this.tabs) + this.endChar);
- }
- assertEquals(message, expected, actual);
- }
- protected void assertElementsEqual(String message, String expected, IJavaScriptElement[] elements) {
- assertElementsEqual(message, expected, elements, false/*don't show key*/);
- }
- protected void assertElementsEqual(String message, String expected, IJavaScriptElement[] elements, boolean showResolvedInfo) {
- StringBuffer buffer = new StringBuffer();
- if (elements != null) {
- for (int i = 0, length = elements.length; i < length; i++){
- JavaElement element = (JavaElement)elements[i];
- if (element == null) {
- buffer.append("<null>");
- } else {
- buffer.append(element.toStringWithAncestors(showResolvedInfo));
- }
- if (i != length-1) buffer.append("\n");
- }
- } else {
- buffer.append("<null>");
- }
- String actual = buffer.toString();
- if (!expected.equals(actual)) {
- if (this.displayName) System.out.println(getName()+" actual result is:");
- System.out.println(displayString(actual, this.tabs) + this.endChar);
- }
- assertEquals(message, expected, actual);
- }
- protected void assertExceptionEquals(String message, String expected, JavaScriptModelException exception) {
- String actual = exception == null ? "<null>" : exception.getStatus().getMessage();
- if (!expected.equals(actual)) {
- if (this.displayName) System.out.println(getName()+" actual result is:");
- System.out.println(displayString(actual, this.tabs) + this.endChar);
- }
- assertEquals(message, expected, actual);
- }
- protected void assertHierarchyEquals(String expected, ITypeHierarchy hierarchy) {
- String actual = hierarchy.toString();
- if (!expected.equals(actual)) {
- if (this.displayName) System.out.println(getName()+" actual result is:");
- System.out.println(displayString(actual, this.tabs) + this.endChar);
- }
- assertEquals("Unexpected type hierarchy", expected, actual);
- }
- protected void assertMarkers(String message, String expectedMarkers, IJavaScriptProject project) throws CoreException {
- waitForAutoBuild();
- IMarker[] markers = project.getProject().findMarkers(IJavaScriptModelMarker.BUILDPATH_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
- sortMarkers(markers);
- assertMarkers(message, expectedMarkers, markers);
- }
- protected void sortMarkers(IMarker[] markers) {
- org.eclipse.wst.jsdt.internal.core.util.Util.Comparer comparer = new org.eclipse.wst.jsdt.internal.core.util.Util.Comparer() {
- public int compare(Object a, Object b) {
- IMarker markerA = (IMarker)a;
- IMarker markerB = (IMarker)b;
- return markerA.getAttribute(IMarker.MESSAGE, "").compareTo(markerB.getAttribute(IMarker.MESSAGE, "")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- };
- org.eclipse.wst.jsdt.internal.core.util.Util.sort(markers, comparer);
- }
- protected void assertMarkers(String message, String expectedMarkers, IMarker[] markers) throws CoreException {
- StringBuffer buffer = new StringBuffer();
- if (markers != null) {
- for (int i = 0, length = markers.length; i < length; i++) {
- IMarker marker = markers[i];
- buffer.append(marker.getAttribute(IMarker.MESSAGE));
- if (i != length-1) {
- buffer.append("\n");
- }
- }
- }
- String actual = buffer.toString();
- if (!expectedMarkers.equals(actual)) {
- System.out.println(org.eclipse.wst.jsdt.core.tests.util.Util.displayString(actual, 2));
- }
- assertEquals(message, expectedMarkers, actual);
- }
-
- protected void assertProblems(String message, String expected, ProblemRequestor problemRequestor) {
- String actual = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(problemRequestor.problems.toString());
- String independantExpectedString = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(expected);
- if (!independantExpectedString.equals(actual)){
- System.out.println(org.eclipse.wst.jsdt.core.tests.util.Util.displayString(actual, this.tabs));
- }
- assertEquals(
- message,
- independantExpectedString,
- actual);
- }
- /*
- * Asserts that the given actual source (usually coming from a file content) is equal to the expected one.
- * Note that 'expected' is assumed to have the '\n' line separator.
- * The line separators in 'actual' are converted to '\n' before the comparison.
- */
- protected void assertSourceEquals(String message, String expected, String actual) {
- if (actual == null) {
- assertEquals(message, expected, null);
- return;
- }
- actual = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(actual);
- if (!actual.equals(expected)) {
- System.out.print(org.eclipse.wst.jsdt.core.tests.util.Util.displayString(actual.toString(), 2));
- System.out.println(this.endChar);
- }
- assertEquals(message, expected, actual);
- }
- /*
- * Ensures that the toString() of the given AST node is as expected.
- */
- public void assertASTNodeEquals(String message, String expected, ASTNode actual) {
- String actualString = actual == null ? "null" : actual.toString();
- assertSourceEquals(message, expected, actualString);
- }
- /**
- * Ensures the elements are present after creation.
- */
- public void assertCreation(IJavaScriptElement[] newElements) {
- for (int i = 0; i < newElements.length; i++) {
- IJavaScriptElement newElement = newElements[i];
- assertTrue("Element should be present after creation", newElement.exists());
- }
- }
- protected void assertClasspathEquals(IIncludePathEntry[] classpath, String expected) {
- String actual;
- if (classpath == null) {
- actual = "<null>";
- } else {
- StringBuffer buffer = new StringBuffer();
- int length = classpath.length;
- for (int i=0; i<length; i++) {
- buffer.append(classpath[i]);
- if (i < length-1)
- buffer.append('\n');
- }
- actual = buffer.toString();
- }
- if (!actual.equals(expected)) {
- System.out.print(org.eclipse.wst.jsdt.core.tests.util.Util.displayString(actual, 2));
- }
- assertEquals(expected, actual);
- }
- /**
- * Ensures the element is present after creation.
- */
- public void assertCreation(IJavaScriptElement newElement) {
- assertCreation(new IJavaScriptElement[] {newElement});
- }
- /**
- * Creates an operation to delete the given elements, asserts
- * the operation is successful, and ensures the elements are no
- * longer present in the model.
- */
- public void assertDeletion(IJavaScriptElement[] elementsToDelete) throws JavaScriptModelException {
- IJavaScriptElement elementToDelete = null;
- for (int i = 0; i < elementsToDelete.length; i++) {
- elementToDelete = elementsToDelete[i];
- assertTrue("Element must be present to be deleted", elementToDelete.exists());
- }
-
- getJavaModel().delete(elementsToDelete, false, null);
-
- for (int i = 0; i < elementsToDelete.length; i++) {
- elementToDelete = elementsToDelete[i];
- assertTrue("Element should not be present after deletion: " + elementToDelete, !elementToDelete.exists());
- }
- }
- protected void assertDeltas(String message, String expected) {
- String actual = this.deltaListener.toString();
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, 2));
- System.err.println(this.deltaListener.stackTraces.toString());
- }
- assertEquals(
- message,
- expected,
- actual);
- }
- protected void assertDeltas(String message, String expected, IJavaScriptElementDelta delta) {
- String actual = delta == null ? "<null>" : delta.toString();
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, 2));
- System.err.println(this.deltaListener.stackTraces.toString());
- }
- assertEquals(
- message,
- expected,
- actual);
- }
- protected void assertTypesEqual(String message, String expected, IType[] types) {
- assertTypesEqual(message, expected, types, true);
- }
- protected void assertTypesEqual(String message, String expected, IType[] types, boolean sort) {
- if (sort) this.sortTypes(types);
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < types.length; i++){
- if (types[i] == null)
- buffer.append("<null>");
- else
- buffer.append(types[i].getFullyQualifiedName());
- buffer.append("\n");
- }
- String actual = buffer.toString();
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, 2) + this.endChar);
- }
- assertEquals(message, expected, actual);
- }
- protected void assertSortedStringsEqual(String message, String expected, String[] strings) {
- Util.sort(strings);
- assertStringsEqual(message, expected, strings);
- }
- protected void assertStringsEqual(String message, String expected, String[] strings) {
- String actual = toString(strings, true/*add extra new lines*/);
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, this.tabs) + this.endChar);
- }
- assertEquals(message, expected, actual);
- }
- protected void assertStringsEqual(String message, String[] expectedStrings, String[] actualStrings) {
- String expected = toString(expectedStrings, false/*don't add extra new lines*/);
- String actual = toString(actualStrings, false/*don't add extra new lines*/);
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, this.tabs) + this.endChar);
- }
- assertEquals(message, expected, actual);
- }
- /**
- * Attaches a source zip to the given jar package fragment root.
- */
- protected void attachSource(IPackageFragmentRoot root, String sourcePath, String sourceRoot) throws JavaScriptModelException {
- IJavaScriptProject javaProject = root.getJavaScriptProject();
- IIncludePathEntry[] entries = (IIncludePathEntry[])javaProject.getRawIncludepath().clone();
- for (int i = 0; i < entries.length; i++){
- IIncludePathEntry entry = entries[i];
- if (entry.getPath().toOSString().toLowerCase().equals(root.getPath().toOSString().toLowerCase())) {
- entries[i] = JavaScriptCore.newLibraryEntry(
- root.getPath(),
- sourcePath == null ? null : new Path(sourcePath),
- sourceRoot == null ? null : new Path(sourceRoot),
- false);
- break;
- }
- }
- javaProject.setRawIncludepath(entries, null);
- }
- /**
- * Creates an operation to delete the given element, asserts
- * the operation is successfull, and ensures the element is no
- * longer present in the model.
- */
- public void assertDeletion(IJavaScriptElement elementToDelete) throws JavaScriptModelException {
- assertDeletion(new IJavaScriptElement[] {elementToDelete});
- }
- /**
- * Empties the current deltas.
- */
- public void clearDeltas() {
- this.deltaListener.deltas = new IJavaScriptElementDelta[0];
- this.deltaListener.stackTraces = new ByteArrayOutputStream();
- }
- protected IJavaScriptElement[] codeSelect(ISourceReference sourceReference, String selectAt, String selection) throws JavaScriptModelException {
- String str = sourceReference.getSource();
- int start = str.indexOf(selectAt);
- int length = selection.length();
- return ((ICodeAssist)sourceReference).codeSelect(start, length);
- }
- protected IJavaScriptElement[] codeSelectAt(ISourceReference sourceReference, String selectAt) throws JavaScriptModelException {
- String str = sourceReference.getSource();
- int start = str.indexOf(selectAt) + selectAt.length();
- int length = 0;
- return ((ICodeAssist)sourceReference).codeSelect(start, length);
- }
- /**
- * Copy file from src (path to the original file) to dest (path to the destination file).
- */
- public void copy(File src, File dest) throws IOException {
- // read source bytes
- byte[] srcBytes = this.read(src);
-
- if (convertToIndependantLineDelimiter(src)) {
- String contents = new String(srcBytes);
- contents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(contents);
- srcBytes = contents.getBytes();
- }
-
- // write bytes to dest
- FileOutputStream out = new FileOutputStream(dest);
- out.write(srcBytes);
- out.close();
- }
-
- public boolean convertToIndependantLineDelimiter(File file) {
- return file.getName().endsWith(".js");
- }
-
- /**
- * Copy the given source directory (and all its contents) to the given target directory.
- */
- protected void copyDirectory(File source, File target) throws IOException {
- if (!target.exists()) {
- target.mkdirs();
- }
- File[] files = source.listFiles();
- if (files == null) return;
- for (int i = 0; i < files.length; i++) {
- File sourceChild = files[i];
- String name = sourceChild.getName();
- if (name.equals("CVS") || name.equals(".svn")) continue;
- File targetChild = new File(target, name);
- if (sourceChild.isDirectory()) {
- copyDirectory(sourceChild, targetChild);
- } else {
- copy(sourceChild, targetChild);
- }
- }
- }
- protected IFolder createFolder(IPath path) throws CoreException {
- final IFolder folder = getWorkspaceRoot().getFolder(path);
- getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IContainer parent = folder.getParent();
- if (parent instanceof IFolder && !parent.exists()) {
- createFolder(parent.getFullPath());
- }
- folder.create(true, true, null);
- }
- },
- null);
-
- return folder;
- }
- /*
- * Creates a Java project where prj=src=bin and with JCL_LIB on its classpath.
- */
- protected IJavaScriptProject createJavaProject(String projectName) throws CoreException {
- return this.createJavaProject(projectName, new String[] {""}, new String[] {"JCL_LIB"});
- }
- /*
- * Creates a Java project with the given source folders an output location.
- * Add those on the project's classpath.
- */
- protected IJavaScriptProject createJavaProject(String projectName, String[] sourceFolders) throws CoreException {
- return
- this.createJavaProject(
- projectName,
- sourceFolders,
- null/*no lib*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no exported project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- "1.4"
- );
- }
- /*
- * Creates a Java project with the given source folders an output location.
- * Add those on the project's classpath.
- */
- protected IJavaScriptProject createJavaProject(String projectName, String[] sourceFolders, String output, String[] sourceOutputs) throws CoreException {
- return
- this.createJavaProject(
- projectName,
- sourceFolders,
- null/*no lib*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no exported project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- "1.4"
- );
- }
- protected IJavaScriptProject createJavaProject(String projectName, String[] sourceFolders, String[] libraries) throws CoreException {
- return
- this.createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no exported project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- "1.4"
- );
- }
- protected IJavaScriptProject createJavaProject(String projectName, String[] sourceFolders, String[] libraries, String output, String compliance) throws CoreException {
- return
- this.createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no exported project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- compliance
- );
- }
- protected IJavaScriptProject createJavaProject(String projectName, String[] sourceFolders, String[] libraries, String[] projects) throws CoreException {
- return
- this.createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- projects,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no exported project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- "1.4"
- );
- }
- protected SearchPattern createPattern(IJavaScriptElement element, int limitTo) {
- return SearchPattern.createPattern(element, limitTo);
- }
- protected SearchPattern createPattern(String stringPattern, int searchFor, int limitTo, boolean isCaseSensitive) {
- int matchMode = stringPattern.indexOf('*') != -1 || stringPattern.indexOf('?') != -1
- ? SearchPattern.R_PATTERN_MATCH
- : SearchPattern.R_EXACT_MATCH;
- int matchRule = isCaseSensitive ? matchMode | SearchPattern.R_CASE_SENSITIVE : matchMode;
- return SearchPattern.createPattern(stringPattern, searchFor, limitTo, matchRule);
- }
- protected IJavaScriptProject createJavaProject(String projectName, String[] sourceFolders, String[] libraries, String[] projects, boolean[] exportedProject, String projectOutput) throws CoreException {
- return
- this.createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- projects,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- exportedProject,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- "1.4"
- );
- }
- protected IJavaScriptProject createJavaProject(String projectName, String[] sourceFolders, String[] libraries, String[] projects, String projectOutput, String compliance) throws CoreException {
- return
- createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- projects,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- null/*no exported project*/,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- compliance
- );
- }
- protected IJavaScriptProject createJavaProject(final String projectName, final String[] sourceFolders, final String[] libraries, final String[] projects, final boolean[] exportedProjects, final String projectOutput, final String[] sourceOutputs, final String[][] inclusionPatterns, final String[][] exclusionPatterns, final String compliance) throws CoreException {
- return
- this.createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- projects,
- null/*no inclusion pattern*/,
- null/*no exclusion pattern*/,
- exportedProjects,
- inclusionPatterns,
- exclusionPatterns,
- compliance
- );
- }
- protected IJavaScriptProject createJavaProject(
- final String projectName,
- final String[] sourceFolders,
- final String[] libraries,
- final String[][] librariesInclusionPatterns,
- final String[][] librariesExclusionPatterns,
- final String[] projects,
- final String[][] projectsInclusionPatterns,
- final String[][] projectsExclusionPatterns,
- final boolean[] exportedProjects,
- final String[][] inclusionPatterns,
- final String[][] exclusionPatterns,
- final String compliance) throws CoreException {
- return createJavaProject(
- projectName,
- sourceFolders,
- libraries,
- librariesInclusionPatterns,
- librariesExclusionPatterns,
- projects,
- projectsInclusionPatterns,
- projectsExclusionPatterns,
- true, // combine access restrictions by default
- exportedProjects,
- inclusionPatterns,
- exclusionPatterns,
- compliance);
- }
- protected IJavaScriptProject createJavaProject(
- final String projectName,
- final String[] sourceFolders,
- final String[] libraries,
- final String[][] librariesInclusionPatterns,
- final String[][] librariesExclusionPatterns,
- final String[] projects,
- final String[][] projectsInclusionPatterns,
- final String[][] projectsExclusionPatterns,
- final boolean combineAccessRestrictions,
- final boolean[] exportedProjects,
- final String[][] inclusionPatterns,
- final String[][] exclusionPatterns,
- final String compliance) throws CoreException {
- final IJavaScriptProject[] result = new IJavaScriptProject[1];
- IWorkspaceRunnable create = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- // create project
- createProject(projectName);
-
- // set java nature
- addJavaNature(projectName);
-
- // create classpath entries
-
- IProject project = getWorkspaceRoot().getProject(projectName);
- IPath projectPath = project.getFullPath();
- int sourceLength = sourceFolders == null ? 0 : sourceFolders.length;
- int libLength = libraries == null ? 0 : libraries.length;
- int projectLength = projects == null ? 0 : projects.length;
- /*
- *
- * Default JRE entry
- */
-
-
-
- IIncludePathEntry[] entries = new IIncludePathEntry[sourceLength+libLength+projectLength+1];
- for (int i= 0; i < sourceLength; i++) {
- IPath sourcePath = new Path(sourceFolders[i]);
- int segmentCount = sourcePath.segmentCount();
- if (segmentCount > 0) {
- // create folder and its parents
- IContainer container = project;
- for (int j = 0; j < segmentCount; j++) {
- IFolder folder = container.getFolder(new Path(sourcePath.segment(j)));
- if (!folder.exists()) {
- folder.create(true, true, null);
- }
- container = folder;
- }
- }
-
- // inclusion patterns
- IPath[] inclusionPaths;
- if (inclusionPatterns == null) {
- inclusionPaths = new IPath[0];
- } else {
- String[] patterns = inclusionPatterns[i];
- int length = patterns.length;
- inclusionPaths = new IPath[length];
- for (int j = 0; j < length; j++) {
- String inclusionPattern = patterns[j];
- inclusionPaths[j] = new Path(inclusionPattern);
- }
- }
- // exclusion patterns
- IPath[] exclusionPaths;
- if (exclusionPatterns == null) {
- exclusionPaths = new IPath[0];
- } else {
- String[] patterns = exclusionPatterns[i];
- int length = patterns.length;
- exclusionPaths = new IPath[length];
- for (int j = 0; j < length; j++) {
- String exclusionPattern = patterns[j];
- exclusionPaths[j] = new Path(exclusionPattern);
- }
- }
- // create source entry
- entries[i] =
- JavaScriptCore.newSourceEntry(
- projectPath.append(sourcePath),
- inclusionPaths,
- exclusionPaths,
- null
- );
- }
-
-
-
- for (int i= 0; i < libLength; i++) {
- String lib = libraries[i];
- if (lib.startsWith("JCL")) {
- try {
- // ensure JCL variables are set
- setUpJCLClasspathVariables(compliance);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- // accessible files
- IPath[] accessibleFiles;
- if (librariesInclusionPatterns == null) {
- accessibleFiles = new IPath[0];
- } else {
- String[] patterns = librariesInclusionPatterns[i];
- int length = patterns.length;
- accessibleFiles = new IPath[length];
- for (int j = 0; j < length; j++) {
- String inclusionPattern = patterns[j];
- accessibleFiles[j] = new Path(inclusionPattern);
- }
- }
- // non accessible files
- IPath[] nonAccessibleFiles;
- if (librariesExclusionPatterns == null) {
- nonAccessibleFiles = new IPath[0];
- } else {
- String[] patterns = librariesExclusionPatterns[i];
- int length = patterns.length;
- nonAccessibleFiles = new IPath[length];
- for (int j = 0; j < length; j++) {
- String exclusionPattern = patterns[j];
- nonAccessibleFiles[j] = new Path(exclusionPattern);
- }
- }
- if (lib.indexOf(File.separatorChar) == -1 && lib.charAt(0) != '/' && lib.equals(lib.toUpperCase())) { // all upper case is a var
- char[][] vars = CharOperation.splitOn(',', lib.toCharArray());
- entries[sourceLength+i] = JavaScriptCore.newVariableEntry(
- new Path(new String(vars[0])),
- vars.length > 1 ? new Path(new String(vars[1])) : null,
- vars.length > 2 ? new Path(new String(vars[2])) : null);
- } else if (lib.startsWith("org.eclipse.wst.jsdt.core.tests.model.")) { // container
- entries[sourceLength+i] = JavaScriptCore.newContainerEntry(
- new Path(lib),
- ClasspathEntry.getAccessRules(accessibleFiles, nonAccessibleFiles),
- new IIncludePathAttribute[0],
- false);
- } else {
- IPath libPath = new Path(lib);
- if (!libPath.isAbsolute() && libPath.segmentCount() > 0 && libPath.getFileExtension() == null) {
- project.getFolder(libPath).create(true, true, null);
- libPath = projectPath.append(libPath);
- }
- entries[sourceLength+i] = JavaScriptCore.newLibraryEntry(
- libPath,
- null,
- null,
- ClasspathEntry.getAccessRules(accessibleFiles, nonAccessibleFiles),
- new IIncludePathAttribute[0],
- false);
- }
- }
- for (int i= 0; i < projectLength; i++) {
- boolean isExported = exportedProjects != null && exportedProjects.length > i && exportedProjects[i];
-
- // accessible files
- IPath[] accessibleFiles;
- if (projectsInclusionPatterns == null) {
- accessibleFiles = new IPath[0];
- } else {
- String[] patterns = projectsInclusionPatterns[i];
- int length = patterns.length;
- accessibleFiles = new IPath[length];
- for (int j = 0; j < length; j++) {
- String inclusionPattern = patterns[j];
- accessibleFiles[j] = new Path(inclusionPattern);
- }
- }
- // non accessible files
- IPath[] nonAccessibleFiles;
- if (projectsExclusionPatterns == null) {
- nonAccessibleFiles = new IPath[0];
- } else {
- String[] patterns = projectsExclusionPatterns[i];
- int length = patterns.length;
- nonAccessibleFiles = new IPath[length];
- for (int j = 0; j < length; j++) {
- String exclusionPattern = patterns[j];
- nonAccessibleFiles[j] = new Path(exclusionPattern);
- }
- }
-
- entries[sourceLength+libLength+i] =
- JavaScriptCore.newProjectEntry(
- new Path(projects[i]),
- ClasspathEntry.getAccessRules(accessibleFiles, nonAccessibleFiles),
- combineAccessRestrictions,
- new IIncludePathAttribute[0],
- isExported);
- }
-
- // set classpath and output location
- IJavaScriptProject javaProject = JavaScriptCore.create(project);
-
-
-
-
- /* ensure system.js entry */
- IIncludePathEntry jreEntry = JavaScriptCore.newContainerEntry(new Path("org.eclipse.wst.jsdt.launching.JRE_CONTAINER"));
- entries[entries.length-1] = jreEntry;
-
-
- javaProject.setRawIncludepath(entries, null);
-
- // set compliance level options
- if ("1.5".equals(compliance)) {
- Map options = new HashMap();
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
- javaProject.setOptions(options);
- }
-
- result[0] = javaProject;
- }
- };
-
- getWorkspace().run(create, null);
-
-
- return result[0];
- }
- /*
- * Create simple project.
- */
- protected IProject createProject(final String projectName) throws CoreException {
- final IProject project = getProject(projectName);
- IWorkspaceRunnable create = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- project.create(null);
- project.open(null);
- }
- };
- getWorkspace().run(create, null);
- return project;
- }
- public void deleteFile(File file) {
- int retryCount = 0;
- while (++retryCount <= 60) { // wait 1 minute at most
- if (org.eclipse.wst.jsdt.core.tests.util.Util.delete(file)) {
- break;
- }
- }
- }
- protected void deleteFolder(IPath folderPath) throws CoreException {
- deleteResource(getFolder(folderPath));
- }
- protected void deleteProject(String projectName) throws CoreException {
- IProject project = this.getProject(projectName);
- if (project.exists() && !project.isOpen()) { // force opening so that project can be deleted without logging (see bug 23629)
- project.open(null);
- }
- deleteResource(project);
- }
- protected void deleteProject(IJavaScriptProject project) throws CoreException {
- if (project.exists() && !project.isOpen()) { // force opening so that project can be deleted without logging (see bug 23629)
- project.open(null);
- }
- deleteResource(project.getProject());
- }
-
- /**
- * Batch deletion of projects
- */
- protected void deleteProjects(final String[] projectNames) throws CoreException {
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- if (projectNames != null){
- for (int i = 0, max = projectNames.length; i < max; i++){
- if (projectNames[i] != null)
- deleteProject(projectNames[i]);
- }
- }
- }
- },
- null);
- }
- /**
- * Delete this resource.
- */
- public void deleteResource(IResource resource) throws CoreException {
- int retryCount = 0; // wait 1 minute at most
- while (++retryCount <= 60) {
- if (!org.eclipse.wst.jsdt.core.tests.util.Util.delete(resource)) {
- System.gc();
- }
- }
- }
- /**
- * Returns true if this delta is flagged as having changed children.
- */
- protected boolean deltaChildrenChanged(IJavaScriptElementDelta delta) {
- return delta.getKind() == IJavaScriptElementDelta.CHANGED &&
- (delta.getFlags() & IJavaScriptElementDelta.F_CHILDREN) != 0;
- }
- /**
- * Returns true if this delta is flagged as having had a content change
- */
- protected boolean deltaContentChanged(IJavaScriptElementDelta delta) {
- return delta.getKind() == IJavaScriptElementDelta.CHANGED &&
- (delta.getFlags() & IJavaScriptElementDelta.F_CONTENT) != 0;
- }
- /**
- * Returns true if this delta is flagged as having moved from a location
- */
- protected boolean deltaMovedFrom(IJavaScriptElementDelta delta) {
- return delta.getKind() == IJavaScriptElementDelta.ADDED &&
- (delta.getFlags() & IJavaScriptElementDelta.F_MOVED_FROM) != 0;
- }
- /**
- * Returns true if this delta is flagged as having moved to a location
- */
- protected boolean deltaMovedTo(IJavaScriptElementDelta delta) {
- return delta.getKind() == IJavaScriptElementDelta.REMOVED &&
- (delta.getFlags() & IJavaScriptElementDelta.F_MOVED_TO) != 0;
- }
- /**
- * Ensure that the positioned element is in the correct position within the parent.
- */
- public void ensureCorrectPositioning(IParent container, IJavaScriptElement sibling, IJavaScriptElement positioned) throws JavaScriptModelException {
- IJavaScriptElement[] children = container.getChildren();
- if (sibling != null) {
- // find the sibling
- boolean found = false;
- for (int i = 0; i < children.length; i++) {
- if (children[i].equals(sibling)) {
- assertTrue("element should be before sibling", i > 0 && children[i - 1].equals(positioned));
- found = true;
- break;
- }
- }
- assertTrue("Did not find sibling", found);
- }
- }
- /**
- * Returns the specified compilation unit in the given project, root, and
- * package fragment or <code>null</code> if it does not exist.
- */
- public IClassFile getClassFile(String projectName, String rootPath, String packageName, String className) throws JavaScriptModelException {
- IPackageFragment pkg= getPackageFragment(projectName, rootPath, packageName);
- if (pkg == null) {
- return null;
- }
- return pkg.getClassFile(className);
- }
- protected IJavaScriptUnit getCompilationUnit(String path) {
- return (IJavaScriptUnit)JavaScriptCore.create(getFile(path));
- }
- /**
- * Returns the specified compilation unit in the given project, root, and
- * package fragment or <code>null</code> if it does not exist.
- */
- public IJavaScriptUnit getCompilationUnit(String projectName, String rootPath, String packageName, String cuName) throws JavaScriptModelException {
- IPackageFragment pkg= getPackageFragment(projectName, rootPath, packageName);
- if (pkg == null) {
- return null;
- }
- return pkg.getJavaScriptUnit(cuName);
- }
- /**
- * Returns the specified compilation unit in the given project, root, and
- * package fragment or <code>null</code> if it does not exist.
- */
- public IJavaScriptUnit[] getCompilationUnits(String projectName, String rootPath, String packageName) throws JavaScriptModelException {
- IPackageFragment pkg= getPackageFragment(projectName, rootPath, packageName);
- if (pkg == null) {
- return null;
- }
- return pkg.getJavaScriptUnits();
- }
- protected IJavaScriptUnit getCompilationUnitFor(IJavaScriptElement element) {
-
- if (element instanceof IJavaScriptUnit) {
- return (IJavaScriptUnit)element;
- }
-
- if (element instanceof IMember) {
- return ((IMember)element).getJavaScriptUnit();
- }
-
- if (element instanceof IImportDeclaration) {
- return (IJavaScriptUnit)element.getParent();
- }
-
- return null;
-
- }
- /**
- * Returns the last delta for the given element from the cached delta.
- */
- protected IJavaScriptElementDelta getDeltaFor(IJavaScriptElement element) {
- return getDeltaFor(element, false);
- }
- /**
- * Returns the delta for the given element from the cached delta.
- * If the boolean is true returns the first delta found.
- */
- protected IJavaScriptElementDelta getDeltaFor(IJavaScriptElement element, boolean returnFirst) {
- IJavaScriptElementDelta[] deltas = this.deltaListener.deltas;
- if (deltas == null) return null;
- IJavaScriptElementDelta result = null;
- for (int i = 0; i < deltas.length; i++) {
- IJavaScriptElementDelta delta = searchForDelta(element, this.deltaListener.deltas[i]);
- if (delta != null) {
- if (returnFirst) {
- return delta;
- }
- result = delta;
- }
- }
- return result;
- }
-
- /**
- * Returns the IPath to the external java class library (e.g. jclMin.jar)
- */
- protected IPath getExternalJCLPath(String compliance) {
- return new Path(getExternalJCLPathString(compliance));
- }
-
- /**
- * Returns the java.io path to the external java class library (e.g. jclMin.jar)
- */
- protected String getExternalJCLPathString(String compliance) {
- return getSystemJsPathString();
-// return SystemLibraries.getLibraryPath("system.js");
-// return getExternalPath() + "jclMin" + compliance + ".jar";
- }
-
- protected IPath getSystemJsPath() {
- return new Path(getSystemJsPathString());
- }
-
- protected String getSystemJsPathString()
- {
- IPath targetRoot = (new Path(System.getProperty("user.dir"))).removeLastSegments(1);
- IPath pluginDir = targetRoot.append(new Path("org.eclipse.wst.jsdt.core"));
- IPath libDir = pluginDir.append(new Path(new String(SystemLibraryLocation.LIBRARY_PLUGIN_DIRECTORY)));
- IPath fullDir = libDir.append(new Path(new String(SystemLibraryLocation.SYSTEM_LIBARAY_NAME)));
- return fullDir.toOSString();
- }
-
- /**
- * Returns the IPath to the root source of the external java class library (e.g. "src")
- */
- protected IPath getExternalJCLRootSourcePath() {
- return new Path("src");
- }
- /**
- * Returns the IPath to the source of the external java class library (e.g. jclMinsrc.zip)
- */
- protected IPath getExternalJCLSourcePath() {
- return new Path(getExternalJCLSourcePathString(""));
- }
- /**
- * Returns the IPath to the source of the external java class library (e.g. jclMinsrc.zip)
- */
- protected IPath getExternalJCLSourcePath(String compliance) {
- return new Path(getExternalJCLSourcePathString(compliance));
- }
- /**
- * Returns the java.io path to the source of the external java class library (e.g. jclMinsrc.zip)
- */
- protected String getExternalJCLSourcePathString() {
- return getExternalJCLSourcePathString("");
- }
- /**
- * Returns the java.io path to the source of the external java class library (e.g. jclMinsrc.zip)
- */
- protected String getExternalJCLSourcePathString(String compliance) {
- return getExternalPath() + "jclMin" + compliance + "src.zip";
- }
- /*
- * Returns the OS path to the external directory that contains external jar files.
- * This path ends with a File.separatorChar.
- */
- protected String getExternalPath() {
- if (EXTERNAL_JAR_DIR_PATH == null)
- try {
- String path = getWorkspaceRoot().getLocation().toFile().getParentFile().getCanonicalPath();
- if (path.charAt(path.length()-1) != File.separatorChar)
- path += File.separatorChar;
- EXTERNAL_JAR_DIR_PATH = path;
- } catch (IOException e) {
- e.printStackTrace();
- }
- return EXTERNAL_JAR_DIR_PATH;
- }
- protected IFile getFile(String path) {
- return getWorkspaceRoot().getFile(new Path(path));
- }
- protected IFolder getFolder(IPath path) {
- return getWorkspaceRoot().getFolder(path);
- }
- /**
- * Returns the Java Model this test suite is running on.
- */
- public IJavaScriptModel getJavaModel() {
- return JavaScriptCore.create(getWorkspaceRoot());
- }
- /**
- * Returns the Java Project with the given name in this test
- * suite's model. This is a convenience method.
- */
- public IJavaScriptProject getJavaProject(String name) {
- IProject project = getProject(name);
- return JavaScriptCore.create(project);
- }
- protected ILocalVariable getLocalVariable(ISourceReference cu, String selectAt, String selection) throws JavaScriptModelException {
- IJavaScriptElement[] elements = codeSelect(cu, selectAt, selection);
- if (elements.length == 0) return null;
- if (elements[0] instanceof ILocalVariable) {
- return (ILocalVariable)elements[0];
- }
- return null;
- }
- protected ILocalVariable getLocalVariable(String cuPath, String selectAt, String selection) throws JavaScriptModelException {
- ISourceReference cu = getCompilationUnit(cuPath);
- return getLocalVariable(cu, selectAt, selection);
- }
- protected String getNameSource(String cuSource, IJavaScriptElement element) throws JavaScriptModelException {
- ISourceRange nameRange = ((IMember) element).getNameRange();
- int start = nameRange.getOffset();
- int end = start+nameRange.getLength();
- String actualSource = start >= 0 && end >= start ? cuSource.substring(start, end) : "";
- return actualSource;
- }
- /**
- * Returns the specified package fragment in the given project and root, or
- * <code>null</code> if it does not exist.
- * The rootPath must be specified as a project relative path. The empty
- * path refers to the default package fragment.
- */
- public IPackageFragment getPackageFragment(String projectName, String rootPath, String packageName) throws JavaScriptModelException {
- IPackageFragmentRoot root= getPackageFragmentRoot(projectName, rootPath);
- if (root == null) {
- return null;
- }
- return root.getPackageFragment(packageName);
- }
- /**
- * Returns the specified package fragment root in the given project, or
- * <code>null</code> if it does not exist.
- * If relative, the rootPath must be specified as a project relative path.
- * The empty path refers to the package fragment root that is the project
- * folder iteslf.
- * If absolute, the rootPath refers to either an external jar, or a resource
- * internal to the workspace
- */
- public IPackageFragmentRoot getPackageFragmentRoot(
- String projectName,
- String rootPath)
- throws JavaScriptModelException {
-
- IJavaScriptProject project = getJavaProject(projectName);
- if (project == null) {
- return null;
- }
- IPath path = new Path(rootPath);
- if (path.isAbsolute()) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IResource resource = workspaceRoot.findMember(path);
- IPackageFragmentRoot root;
- if (resource == null) {
- // external jar
- root = project.getPackageFragmentRoot(rootPath);
- } else {
- // resource in the workspace
- root = project.getPackageFragmentRoot(resource);
- }
- return root;
- } else {
- IPackageFragmentRoot[] roots = project.getPackageFragmentRoots();
- if (roots == null || roots.length == 0) {
- return null;
- }
- for (int i = 0; i < roots.length; i++) {
- IPackageFragmentRoot root = roots[i];
- if (!root.isExternal()
- && root.getUnderlyingResource().getProjectRelativePath().equals(path)) {
- return root;
- }
- }
- }
- return null;
- }
- protected IProject getProject(String project) {
- return getWorkspaceRoot().getProject(project);
- }
- /**
- * Returns the OS path to the directory that contains this plugin.
- */
- protected String getPluginDirectoryPath() {
- try {
- URL platformURL = Platform.getBundle("org.eclipse.wst.jsdt.core.tests.model").getEntry("/");
- return new File(FileLocator.toFileURL(platformURL).getFile()).getAbsolutePath();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
- public String getSourceWorkspacePath() {
- return getPluginDirectoryPath() + java.io.File.separator + "workspace";
- }
- public IJavaScriptUnit getWorkingCopy(String path, boolean computeProblems) throws JavaScriptModelException {
- return getWorkingCopy(path, "", computeProblems);
- }
- public IJavaScriptUnit getWorkingCopy(String path, String source) throws JavaScriptModelException {
- return getWorkingCopy(path, source, false);
- }
- public IJavaScriptUnit getWorkingCopy(String path, String source, boolean computeProblems) throws JavaScriptModelException {
- if (this.wcOwner == null) this.wcOwner = new WorkingCopyOwner() {};
- return getWorkingCopy(path, source, this.wcOwner, computeProblems);
- }
- public IJavaScriptUnit getWorkingCopy(String path, String source, WorkingCopyOwner owner, boolean computeProblems) throws JavaScriptModelException {
- IProblemRequestor problemRequestor = computeProblems
- ? new IProblemRequestor() {
- public void acceptProblem(IProblem problem) {}
- public void beginReporting() {}
- public void endReporting() {}
- public boolean isActive() {
- return true;
- }
- }
- : null;
- return getWorkingCopy(path, source, owner, problemRequestor);
- }
- public IJavaScriptUnit getWorkingCopy(String path, String source, WorkingCopyOwner owner, IProblemRequestor problemRequestor) throws JavaScriptModelException {
- IJavaScriptUnit workingCopy = getCompilationUnit(path);
- if (owner != null)
- workingCopy = workingCopy.getWorkingCopy(owner, null/*no progress monitor*/);
- else
- workingCopy.becomeWorkingCopy(null/*no progress monitor*/);
- workingCopy.getBuffer().setContents(source);
- if (problemRequestor instanceof ProblemRequestor)
- ((ProblemRequestor) problemRequestor).initialize(source.toCharArray());
- workingCopy.makeConsistent(null/*no progress monitor*/);
- return workingCopy;
- }
- /**
- * Returns the IWorkspace this test suite is running on.
- */
- public IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
- public IWorkspaceRoot getWorkspaceRoot() {
- return getWorkspace().getRoot();
- }
- protected void discardWorkingCopies(IJavaScriptUnit[] units) throws JavaScriptModelException {
- if (units == null) return;
- for (int i = 0, length = units.length; i < length; i++)
- if (units[i] != null)
- units[i].discardWorkingCopy();
- }
-
- protected String displayString(String toPrint, int indent) {
- char[] toDisplay =
- CharOperation.replace(
- toPrint.toCharArray(),
- getSystemJsPathString().toCharArray(),
- "getSystemJsPathString()".toCharArray());
- toDisplay =
- CharOperation.replace(
- toDisplay,
- getExternalJCLPathString("1.5").toCharArray(),
- "getExternalJCLPathString(\"1.5\")".toCharArray());
- toDisplay =
- CharOperation.replace(
- toDisplay,
- org.eclipse.wst.jsdt.core.tests.util.Util.displayString(getExternalJCLSourcePathString(), 0).toCharArray(),
- "getExternalJCLSourcePathString()".toCharArray());
- toDisplay =
- CharOperation.replace(
- toDisplay,
- org.eclipse.wst.jsdt.core.tests.util.Util.displayString(getExternalJCLSourcePathString("1.5"), 0).toCharArray(),
- "getExternalJCLSourcePathString(\"1.5\")".toCharArray());
- toDisplay = org.eclipse.wst.jsdt.core.tests.util.Util.displayString(new String(toDisplay), indent).toCharArray();
- toDisplay =
- CharOperation.replace(
- toDisplay,
- "getExternalJCLPathString()".toCharArray(),
- ("\"+ getExternalJCLPathString() + \"").toCharArray());
- toDisplay =
- CharOperation.replace(
- toDisplay,
- "getExternalJCLPathString(\\\"1.5\\\")".toCharArray(),
- ("\"+ getExternalJCLPathString(\"1.5\") + \"").toCharArray());
- toDisplay =
- CharOperation.replace(
- toDisplay,
- "getExternalJCLSourcePathString()".toCharArray(),
- ("\"+ getExternalJCLSourcePathString() + \"").toCharArray());
- toDisplay =
- CharOperation.replace(
- toDisplay,
- "getExternalJCLSourcePathString(\\\"1.5\\\")".toCharArray(),
- ("\"+ getExternalJCLSourcePathString(\"1.5\") + \"").toCharArray());
- return new String(toDisplay);
- }
-
- protected IJavaScriptUnit newExternalWorkingCopy(String name, final String contents) throws JavaScriptModelException {
- return newExternalWorkingCopy(name, null/*no classpath*/, null/*no problem requestor*/, contents);
- }
- protected IJavaScriptUnit newExternalWorkingCopy(String name, IIncludePathEntry[] classpath, IProblemRequestor problemRequestor, final String contents) throws JavaScriptModelException {
- WorkingCopyOwner owner = new WorkingCopyOwner() {
- public IBuffer createBuffer(IJavaScriptUnit wc) {
- IBuffer buffer = super.createBuffer(wc);
- buffer.setContents(contents);
- return buffer;
- }
- };
- return owner.newWorkingCopy(name, classpath, null/*no progress monitor*/);
- }
-
- public byte[] read(java.io.File file) throws java.io.IOException {
- int fileLength;
- byte[] fileBytes = new byte[fileLength = (int) file.length()];
- java.io.FileInputStream stream = new java.io.FileInputStream(file);
- int bytesRead = 0;
- int lastReadSize = 0;
- while ((lastReadSize != -1) && (bytesRead != fileLength)) {
- lastReadSize = stream.read(fileBytes, bytesRead, fileLength - bytesRead);
- bytesRead += lastReadSize;
- }
- stream.close();
- return fileBytes;
- }
- protected void removeJavaNature(String projectName) throws CoreException {
- IProject project = this.getProject(projectName);
- IProjectDescription description = project.getDescription();
- description.setNatureIds(new String[] {});
- project.setDescription(description, null);
- }
- protected void removeLibrary(IJavaScriptProject javaProject, String jarName, String sourceZipName) throws CoreException, IOException {
- IProject project = javaProject.getProject();
- String projectPath = '/' + project.getName() + '/';
- removeLibraryEntry(javaProject, new Path(projectPath + jarName));
- org.eclipse.wst.jsdt.core.tests.util.Util.delete(project.getFile(jarName));
- if (sourceZipName != null && sourceZipName.length() != 0) {
- org.eclipse.wst.jsdt.core.tests.util.Util.delete(project.getFile(sourceZipName));
- }
- }
- protected void removeLibraryEntry(Path path) throws JavaScriptModelException {
- removeLibraryEntry(this.currentProject, path);
- }
- protected void removeLibraryEntry(IJavaScriptProject project, Path path) throws JavaScriptModelException {
- IIncludePathEntry[] entries = project.getRawIncludepath();
- int length = entries.length;
- IIncludePathEntry[] newEntries = null;
- for (int i = 0; i < length; i++) {
- IIncludePathEntry entry = entries[i];
- if (entry.getPath().equals(path)) {
- newEntries = new IIncludePathEntry[length-1];
- if (i > 0)
- System.arraycopy(entries, 0, newEntries, 0, i);
- if (i < length-1)
- System.arraycopy(entries, i+1, newEntries, i, length-1-i);
- break;
- }
- }
- if (newEntries != null)
- project.setRawIncludepath(newEntries, null);
- }
-
- /**
- * Returns a delta for the given element in the delta tree
- */
- protected IJavaScriptElementDelta searchForDelta(IJavaScriptElement element, IJavaScriptElementDelta delta) {
-
- if (delta == null) {
- return null;
- }
- if (delta.getElement().equals(element)) {
- return delta;
- }
- for (int i= 0; i < delta.getAffectedChildren().length; i++) {
- IJavaScriptElementDelta child= searchForDelta(element, delta.getAffectedChildren()[i]);
- if (child != null) {
- return child;
- }
- }
- return null;
- }
- protected void search(IJavaScriptElement element, int limitTo, IJavaScriptSearchScope scope, SearchRequestor requestor) throws CoreException {
- search(element, limitTo, SearchPattern.R_EXACT_MATCH|SearchPattern.R_CASE_SENSITIVE, scope, requestor);
- }
- protected void search(IJavaScriptElement element, int limitTo, int matchRule, IJavaScriptSearchScope scope, SearchRequestor requestor) throws CoreException {
- SearchPattern pattern = SearchPattern.createPattern(element, limitTo, matchRule);
- assertNotNull("Pattern should not be null", pattern);
- new SearchEngine().search(
- pattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- scope,
- requestor,
- null
- );
- }
- protected void search(String patternString, int searchFor, int limitTo, IJavaScriptSearchScope scope, SearchRequestor requestor) throws CoreException {
- search(patternString, searchFor, limitTo, SearchPattern.R_EXACT_MATCH|SearchPattern.R_CASE_SENSITIVE, scope, requestor);
- }
- protected void search(String patternString, int searchFor, int limitTo, int matchRule, IJavaScriptSearchScope scope, SearchRequestor requestor) throws CoreException {
- if (patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1)
- matchRule |= SearchPattern.R_PATTERN_MATCH;
- SearchPattern pattern = SearchPattern.createPattern(
- patternString,
- searchFor,
- limitTo,
- matchRule);
- assertNotNull("Pattern should not be null", pattern);
- new SearchEngine().search(
- pattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- scope,
- requestor,
- null);
- }
-
- /*
- * Selection of java elements.
- */
-
- /*
- * Search several occurences of a selection in a compilation unit source and returns its start and length.
- * If occurence is negative, then perform a backward search from the end of file.
- * If selection starts or ends with a comment (to help identification in source), it is removed from returned selection info.
- */
- int[] selectionInfo(IJavaScriptUnit cu, String selection, int occurences) throws JavaScriptModelException {
- String source = cu.getSource();
- int index = occurences < 0 ? source.lastIndexOf(selection) : source.indexOf(selection);
- int max = Math.abs(occurences)-1;
- for (int n=0; index >= 0 && n<max; n++) {
- index = occurences < 0 ? source.lastIndexOf(selection, index) : source.indexOf(selection, index+selection.length());
- }
- StringBuffer msg = new StringBuffer("Selection '");
- msg.append(selection);
- if (index >= 0) {
- if (selection.startsWith("/**")) { // comment is before
- int start = source.indexOf("*/", index);
- if (start >=0) {
- return new int[] { start+2, selection.length()-(start+2-index) };
- } else {
- msg.append("' starts with an unterminated comment");
- }
- } else if (selection.endsWith("*/")) { // comment is after
- int end = source.lastIndexOf("/**", index+selection.length());
- if (end >=0) {
- return new int[] { index, index-end };
- } else {
- msg.append("' ends with an unstartted comment");
- }
- } else { // no comment => use whole selection
- return new int[] { index, selection.length() };
- }
- } else {
- msg.append("' was not found in ");
- }
- msg.append(cu.getElementName());
- msg.append(":\n");
- msg.append(source);
- assertTrue(msg.toString(), false);
- return null;
- }
-
- /**
- * Select a field in a compilation unit identified with the first occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @return IField
- * @throws JavaScriptModelException
- */
- protected IField selectField(IJavaScriptUnit unit, String selection) throws JavaScriptModelException {
- return selectField(unit, selection, 1);
- }
-
- /**
- * Select a field in a compilation unit identified with the nth occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @param occurences
- * @return IField
- * @throws JavaScriptModelException
- */
- protected IField selectField(IJavaScriptUnit unit, String selection, int occurences) throws JavaScriptModelException {
- return (IField) selectJavaElement(unit, selection, occurences, IJavaScriptElement.FIELD);
- }
-
- /**
- * Select a local variable in a compilation unit identified with the first occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @return IType
- * @throws JavaScriptModelException
- */
- protected ILocalVariable selectLocalVariable(IJavaScriptUnit unit, String selection) throws JavaScriptModelException {
- return selectLocalVariable(unit, selection, 1);
- }
-
- /**
- * Select a local variable in a compilation unit identified with the nth occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @param occurences
- * @return IType
- * @throws JavaScriptModelException
- */
- protected ILocalVariable selectLocalVariable(IJavaScriptUnit unit, String selection, int occurences) throws JavaScriptModelException {
- return (ILocalVariable) selectJavaElement(unit, selection, occurences, IJavaScriptElement.LOCAL_VARIABLE);
- }
-
- /**
- * Select a method in a compilation unit identified with the first occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @return IFunction
- * @throws JavaScriptModelException
- */
- protected IFunction selectMethod(IJavaScriptUnit unit, String selection) throws JavaScriptModelException {
- return selectMethod(unit, selection, 1);
- }
-
- /**
- * Select a method in a compilation unit identified with the nth occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @param occurences
- * @return IFunction
- * @throws JavaScriptModelException
- */
- protected IFunction selectMethod(IJavaScriptUnit unit, String selection, int occurences) throws JavaScriptModelException {
- return (IFunction) selectJavaElement(unit, selection, occurences, IJavaScriptElement.METHOD);
- }
-
- /**
- * Select a parameterized source method in a compilation unit identified with the first occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @return ParameterizedSourceMethod
- * @throws JavaScriptModelException
- */
- protected ResolvedSourceMethod selectParameterizedMethod(IJavaScriptUnit unit, String selection) throws JavaScriptModelException {
- return selectParameterizedMethod(unit, selection, 1);
- }
-
- /**
- * Select a parameterized source method in a compilation unit identified with the nth occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @param occurences
- * @return ParameterizedSourceMethod
- * @throws JavaScriptModelException
- */
- protected ResolvedSourceMethod selectParameterizedMethod(IJavaScriptUnit unit, String selection, int occurences) throws JavaScriptModelException {
- IFunction type = selectMethod(unit, selection, occurences);
- assertTrue("Not a parameterized source type: "+type.getElementName(), type instanceof ResolvedSourceMethod);
- return (ResolvedSourceMethod) type;
- }
-
- /**
- * Select a parameterized source type in a compilation unit identified with the first occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @return ParameterizedSourceType
- * @throws JavaScriptModelException
- */
- protected ResolvedSourceType selectParameterizedType(IJavaScriptUnit unit, String selection) throws JavaScriptModelException {
- return selectParameterizedType(unit, selection, 1);
- }
-
- /**
- * Select a parameterized source type in a compilation unit identified with the nth occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @param occurences
- * @return ParameterizedSourceType
- * @throws JavaScriptModelException
- */
- protected ResolvedSourceType selectParameterizedType(IJavaScriptUnit unit, String selection, int occurences) throws JavaScriptModelException {
- IType type = selectType(unit, selection, occurences);
- assertTrue("Not a parameterized source type: "+type.getElementName(), type instanceof ResolvedSourceType);
- return (ResolvedSourceType) type;
- }
-
- /**
- * Select a type in a compilation unit identified with the first occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @return IType
- * @throws JavaScriptModelException
- */
- protected IType selectType(IJavaScriptUnit unit, String selection) throws JavaScriptModelException {
- return selectType(unit, selection, 1);
- }
-
- /**
- * Select a type in a compilation unit identified with the nth occurence in the source of a given selection.
- * @param unit
- * @param selection
- * @param occurences
- * @return IType
- * @throws JavaScriptModelException
- */
- protected IType selectType(IJavaScriptUnit unit, String selection, int occurences) throws JavaScriptModelException {
- return (IType) selectJavaElement(unit, selection, occurences, IJavaScriptElement.TYPE);
- }
-
- /**
- * Select a java element in a compilation unit identified with the nth occurence in the source of a given selection.
- * Do not allow subclasses to call this method as we want to verify IJavaScriptElement kind.
- */
- IJavaScriptElement selectJavaElement(IJavaScriptUnit unit, String selection, int occurences, int elementType) throws JavaScriptModelException {
- int[] selectionPositions = selectionInfo(unit, selection, occurences);
- IJavaScriptElement[] elements = null;
- if (wcOwner == null) {
- elements = unit.codeSelect(selectionPositions[0], selectionPositions[1]);
- } else {
- elements = unit.codeSelect(selectionPositions[0], selectionPositions[1], wcOwner);
- }
- assertEquals("Invalid selection number", 1, elements.length);
- assertEquals("Invalid java element type: "+elements[0].getElementName(), elements[0].getElementType(), elementType);
- return elements[0];
- }
-
- /* ************
- * Suite set-ups *
- *************/
- /**
- * Sets the class path of the Java project.
- */
- public void setClasspath(IJavaScriptProject javaProject, IIncludePathEntry[] classpath) {
- try {
- javaProject.setRawIncludepath(classpath, null);
- } catch (JavaScriptModelException e) {
- assertTrue("failed to set classpath", false);
- }
- }
- /**
- * Check locally for the required JCL files, <jclName>.jar and <jclName>src.zip.
- * If not available, copy from the project resources.
- */
- public void setupExternalJCL(String jclName) throws IOException {
- String externalPath = getExternalPath();
- String separator = java.io.File.separator;
- String resourceJCLDir = getPluginDirectoryPath() + separator + "JCL";
- java.io.File jclDir = new java.io.File(externalPath);
- java.io.File jclMin =
- new java.io.File(externalPath + jclName + ".jar");
- java.io.File jclMinsrc = new java.io.File(externalPath + jclName + "src.zip");
- if (!jclDir.exists()) {
- if (!jclDir.mkdir()) {
- //mkdir failed
- throw new IOException("Could not create the directory " + jclDir);
- }
- //copy the two files to the JCL directory
- java.io.File resourceJCLMin =
- new java.io.File(resourceJCLDir + separator + jclName + ".jar");
- copy(resourceJCLMin, jclMin);
- java.io.File resourceJCLMinsrc =
- new java.io.File(resourceJCLDir + separator + jclName + "src.zip");
- copy(resourceJCLMinsrc, jclMinsrc);
- } else {
- //check that the two files, jclMin.jar and jclMinsrc.zip are present
- //copy either file that is missing or less recent than the one in workspace
- java.io.File resourceJCLMin =
- new java.io.File(resourceJCLDir + separator + jclName + ".jar");
- if ((jclMin.lastModified() < resourceJCLMin.lastModified())
- || (jclMin.length() != resourceJCLMin.length())) {
- copy(resourceJCLMin, jclMin);
- }
- java.io.File resourceJCLMinsrc =
- new java.io.File(resourceJCLDir + separator + jclName + "src.zip");
- if ((jclMinsrc.lastModified() < resourceJCLMinsrc.lastModified())
- || (jclMinsrc.length() != resourceJCLMinsrc.length())) {
- copy(resourceJCLMinsrc, jclMinsrc);
- }
- }
- }
- protected IJavaScriptProject setUpJavaProject(final String projectName) throws CoreException, IOException {
- this.currentProject = setUpJavaProject(projectName, "1.4");
- return this.currentProject;
- }
- protected IJavaScriptProject setUpJavaProject(final String projectName, String compliance) throws CoreException, IOException {
- // copy files in project from source workspace to target workspace
- String sourceWorkspacePath = getSourceWorkspacePath();
- String targetWorkspacePath = getWorkspaceRoot().getLocation().toFile().getCanonicalPath();
- copyDirectory(new File(sourceWorkspacePath, projectName), new File(targetWorkspacePath, projectName));
-
- // ensure variables are set
- setUpJCLClasspathVariables(compliance);
-
- // create project
- final IProject project = getWorkspaceRoot().getProject(projectName);
- IWorkspaceRunnable populate = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- project.create(null);
- project.open(null);
- }
- };
- getWorkspace().run(populate, null);
- IJavaScriptProject javaProject = JavaScriptCore.create(project);
- setUpProjectCompliance(javaProject, compliance);
- javaProject.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
- javaProject.setOption(JavaScriptCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER, JavaScriptCore.IGNORE);
- javaProject.setOption(JavaScriptCore.COMPILER_PB_FIELD_HIDING, JavaScriptCore.IGNORE);
- javaProject.setOption(JavaScriptCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaScriptCore.IGNORE);
- javaProject.setOption(JavaScriptCore.COMPILER_PB_TYPE_PARAMETER_HIDING, JavaScriptCore.IGNORE);
- return javaProject;
- }
-
- protected void setUpProjectCompliance(IJavaScriptProject javaProject, String compliance) throws JavaScriptModelException, IOException {
- // Look for version to set and return if that's already done
- String version = CompilerOptions.VERSION_1_4;
- String jclLibString = null;
- String newJclLibString = null;
- String newJclSrcString = null;
- switch (compliance.charAt(2)) {
- case '5':
- version = CompilerOptions.VERSION_1_5;
- if (version.equals(javaProject.getOption(CompilerOptions.OPTION_Compliance, false))) {
- return;
- }
- jclLibString = "JCL_LIB";
- newJclLibString = "JCL15_LIB";
- newJclSrcString = "JCL15_SRC";
- break;
- case '3':
- version = CompilerOptions.VERSION_1_3;
- default:
- if (version.equals(javaProject.getOption(CompilerOptions.OPTION_Compliance, false))) {
- return;
- }
- jclLibString = "JCL15_LIB";
- newJclLibString = "JCL_LIB";
- newJclSrcString = "JCL_SRC";
- break;
- }
-
- // ensure variables are set
- setUpJCLClasspathVariables(compliance);
-
- // set options
- Map options = new HashMap();
- options.put(CompilerOptions.OPTION_Compliance, version);
- options.put(CompilerOptions.OPTION_Source, version);
- options.put(CompilerOptions.OPTION_TargetPlatform, version);
- javaProject.setOptions(options);
-
- // replace JCL_LIB with JCL15_LIB, and JCL_SRC with JCL15_SRC
- IIncludePathEntry[] classpath = javaProject.getRawIncludepath();
- IPath jclLib = new Path(jclLibString);
- for (int i = 0, length = classpath.length; i < length; i++) {
- IIncludePathEntry entry = classpath[i];
- if (entry.getPath().equals(jclLib)) {
- classpath[i] = JavaScriptCore.newVariableEntry(
- new Path(newJclLibString),
- new Path(newJclSrcString),
- entry.getSourceAttachmentRootPath(),
- entry.getAccessRules(),
- new IIncludePathAttribute[0],
- entry.isExported());
- break;
- }
- }
- javaProject.setRawIncludepath(classpath, null);
- }
- public void setUpJCLClasspathVariables(String compliance) throws JavaScriptModelException, IOException {
- if ("1.5".equals(compliance)) {
- if (JavaScriptCore.getIncludepathVariable("JCL15_LIB") == null) {
-// setupExternalJCL("jclMin1.5");
- JavaScriptCore.setIncludepathVariables(
- new String[] {"JCL15_LIB", "JCL15_SRC", "JCL_SRCROOT"},
- new IPath[] {getExternalJCLPath(compliance), getExternalJCLSourcePath(compliance), getExternalJCLRootSourcePath()},
- null);
- }
- } else {
- if (JavaScriptCore.getIncludepathVariable("JCL_LIB") == null) {
-// setupExternalJCL("jclMin");
- JavaScriptCore.setIncludepathVariables(
- new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
- new IPath[] {getExternalJCLPath(""), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
- null);
- }
- }
- }
- public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- // ensure autobuilding is turned off
- IWorkspaceDescription description = getWorkspace().getDescription();
- if (description.isAutoBuilding()) {
- description.setAutoBuilding(false);
- getWorkspace().setDescription(description);
- }
- }
- protected void setUp () throws Exception {
- super.setUp();
- if (NameLookup.VERBOSE || BasicSearchEngine.VERBOSE || JavaModelManager.VERBOSE) {
- System.out.println("--------------------------------------------------------------------------------");
- System.out.println("Running test "+getName()+"...");
- }
- }
- protected void sortElements(IJavaScriptElement[] elements) {
- Util.Comparer comparer = new Util.Comparer() {
- public int compare(Object a, Object b) {
- JavaElement elementA = (JavaElement)a;
- JavaElement elementB = (JavaElement)b;
- char[] tempJCLPath = "<externalJCLPath>".toCharArray();
- String idA = new String(CharOperation.replace(
- elementA.toStringWithAncestors().toCharArray(),
- getSystemJsPathString().toCharArray(),
- tempJCLPath));
- String idB = new String(CharOperation.replace(
- elementB.toStringWithAncestors().toCharArray(),
- getSystemJsPathString().toCharArray(),
- tempJCLPath));
- return idA.compareTo(idB);
- }
- };
- Util.sort(elements, comparer);
- }
- protected void sortResources(Object[] resources) {
- Util.Comparer comparer = new Util.Comparer() {
- public int compare(Object a, Object b) {
- IResource resourceA = (IResource)a;
- IResource resourceB = (IResource)b;
- return resourceA.getFullPath().toString().compareTo(resourceB.getFullPath().toString()); }
- };
- Util.sort(resources, comparer);
- }
- protected void sortTypes(IType[] types) {
- Util.Comparer comparer = new Util.Comparer() {
- public int compare(Object a, Object b) {
- IType typeA = (IType)a;
- IType typeB = (IType)b;
- return typeA.getFullyQualifiedName().compareTo(typeB.getFullyQualifiedName());
- }
- };
- Util.sort(types, comparer);
- }
- /*
- * Simulate a save/exit of the workspace
- */
- protected void simulateExit() throws CoreException {
- waitForAutoBuild();
- getWorkspace().save(true/*full save*/, null/*no progress*/);
- JavaModelManager.getJavaModelManager().shutdown();
- }
- /*
- * Simulate a save/exit/restart of the workspace
- */
- protected void simulateExitRestart() throws CoreException {
- simulateExit();
- simulateRestart();
- }
- /*
- * Simulate a restart of the workspace
- */
- protected void simulateRestart() throws CoreException {
- JavaModelManager.doNotUse(); // reset the MANAGER singleton
- JavaModelManager.getJavaModelManager().startup();
- new JavaCorePreferenceInitializer().initializeDefaultPreferences();
- }
- /**
- * Starts listening to element deltas, and queues them in fgDeltas.
- */
- public void startDeltas() {
- clearDeltas();
- JavaScriptCore.addElementChangedListener(this.deltaListener);
- }
- /**
- * Stops listening to element deltas, and clears the current deltas.
- */
- public void stopDeltas() {
- JavaScriptCore.removeElementChangedListener(this.deltaListener);
- clearDeltas();
- }
- protected IPath[] toIPathArray(String[] paths) {
- if (paths == null) return null;
- int length = paths.length;
- IPath[] result = new IPath[length];
- for (int i = 0; i < length; i++) {
- result[i] = new Path(paths[i]);
- }
- return result;
- }
- protected String toString(String[] strings) {
- return toString(strings, false/*don't add extra new line*/);
- }
- protected String toString(String[] strings, boolean addExtraNewLine) {
- if (strings == null) return "null";
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = strings.length; i < length; i++){
- buffer.append(strings[i]);
- if (addExtraNewLine || i < length - 1)
- buffer.append("\n");
- }
- return buffer.toString();
- }
- protected void tearDown() throws Exception {
- super.tearDown();
- if (this.workingCopies != null) {
- discardWorkingCopies(this.workingCopies);
- this.workingCopies = null;
- }
- this.wcOwner = null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.SuiteOfTestCases#tearDownSuite()
- */
- public void tearDownSuite() throws Exception {
- super.tearDownSuite();
- }
-
- /**
- * Wait for autobuild notification to occur
- */
- public static void waitForAutoBuild() {
- boolean wasInterrupted = false;
- do {
- try {
- Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- wasInterrupted = false;
- } catch (OperationCanceledException e) {
- e.printStackTrace();
- } catch (InterruptedException e) {
- wasInterrupted = true;
- }
- } while (wasInterrupted);
- }
-
- public static void waitUntilIndexesReady() {
- // dummy query for waiting until the indexes are ready
- SearchEngine engine = new SearchEngine();
- IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope();
- try {
- engine.searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "!@$#!@".toCharArray(),
- SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
- IJavaScriptSearchConstants.CLASS,
- scope,
- new TypeNameRequestor() {
- public void acceptType(
- int modifiers,
- char[] packageName,
- char[] simpleTypeName,
- char[][] enclosingTypeNames,
- String path) {}
- },
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- } catch (CoreException e) {
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java
deleted file mode 100644
index 0e7f507..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java
+++ /dev/null
@@ -1,607 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.search.*;
-import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit;
-import org.eclipse.wst.jsdt.internal.core.PackageFragment;
-//import org.eclipse.wst.jsdt.internal.core.ResolvedSourceMethod;
-//import org.eclipse.wst.jsdt.internal.core.ResolvedSourceType;
-import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
-import org.eclipse.wst.jsdt.internal.core.search.matching.PatternLocator;
-
-/**
- * Abstract class for Java Search tests.
- */
-public class AbstractJavaSearchTests extends AbstractJavaModelTests implements IJavaScriptSearchConstants {
-
- public static List JAVA_SEARCH_SUITES = null;
- protected static IJavaScriptProject JAVA_PROJECT;
- protected static boolean COPY_DIRS = true;
- protected static int EXACT_RULE = SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE;
- protected static int EQUIVALENT_RULE = EXACT_RULE | SearchPattern.R_EQUIVALENT_MATCH;
- protected static int ERASURE_RULE = EXACT_RULE | SearchPattern.R_ERASURE_MATCH;
- protected static int RAW_RULE = EXACT_RULE | SearchPattern.R_ERASURE_MATCH | SearchPattern.R_EQUIVALENT_MATCH;
-
-// IJavaScriptUnit[] workingCopies;
-// boolean discard;
-
- /**
- * Collects results as a string.
- */
- public static class JavaSearchResultCollector extends SearchRequestor {
- protected SearchMatch match;
- public StringBuffer results = new StringBuffer(), line;
- public boolean showAccuracy;
- public boolean showContext;
- public boolean showRule;
- public boolean showInsideDoc;
- public boolean showPotential = true;
- public boolean showProject;
- public boolean showSynthetic;
- public int showFlavors = 0;
- public int count = 0;
- public void acceptSearchMatch(SearchMatch searchMatch) throws CoreException {
- count++;
- this.match = searchMatch;
- writeLine();
- if (line != null) {
- writeLineToResult();
- }
- }
- protected void writeLineToResult() {
- if (match.getAccuracy() == SearchMatch.A_ACCURATE || showPotential) {
- if (results.length() > 0) results.append("\n");
- results.append(line);
- }
- }
- protected void writeLine() throws CoreException {
- try {
- IResource resource = match.getResource();
- IJavaScriptElement element = getElement(match);
- line = new StringBuffer(getPathString(resource, element));
- if (this.showProject) {
- IProject project = element.getJavaScriptProject().getProject();
- line.append(" [in ");
- line.append(project.getName());
- line.append("]");
- }
- IJavaScriptUnit unit = null;
- if (element instanceof IFunction) {
- line.append(" ");
- IFunction method = (IFunction)element;
- append(method);
- unit = method.getJavaScriptUnit();
- } else if (element instanceof IType) {
- line.append(" ");
- IType type = (IType)element;
- append(type);
- unit = type.getJavaScriptUnit();
- } else if (element instanceof IField) {
- line.append(" ");
- IField field = (IField)element;
- append(field);
- unit = field.getJavaScriptUnit();
- } else if (element instanceof IInitializer) {
- line.append(" ");
- IInitializer initializer = (IInitializer)element;
- append(initializer);
- unit = initializer.getJavaScriptUnit();
- } else if (element instanceof IPackageFragment) {
- line.append(" ");
- append((IPackageFragment)element);
- } else if (element instanceof ILocalVariable) {
- line.append(" ");
- ILocalVariable localVar = (ILocalVariable)element;
- IJavaScriptElement parent = localVar.getParent();
- if (parent instanceof IInitializer) {
- IInitializer initializer = (IInitializer)parent;
- append(initializer);
- line.append(".");
- } else if (parent instanceof IFunction){ // IFunction
- IFunction method = (IFunction)parent;
- append(method);
- line.append(".");
- }
- line.append(localVar.getElementName());
- unit = (IJavaScriptUnit)localVar.getAncestor(IJavaScriptElement.JAVASCRIPT_UNIT);
- } else if (element instanceof IImportDeclaration) {
- IImportDeclaration importDeclaration = (IImportDeclaration)element;
- unit = (IJavaScriptUnit)importDeclaration.getAncestor(IJavaScriptElement.JAVASCRIPT_UNIT);
- }
- if (resource instanceof IFile) {
- char[] contents = getSource(resource, element, unit);
- int start = match.getOffset();
- int end = start + match.getLength();
- if (start == -1 || (contents != null && contents.length > 0)) { // retrieving attached source not implemented here
- line.append(" [");
- if (start > -1) {
- if (this.showContext) {
- int lineStart1 = CharOperation.lastIndexOf('\n', contents, 0, start);
- int lineStart2 = CharOperation.lastIndexOf('\r', contents, 0, start);
- int lineStart = Math.max(lineStart1, lineStart2) + 1;
- line.append(CharOperation.subarray(contents, lineStart, start));
- line.append("<");
- }
- line.append(CharOperation.subarray(contents, start, end));
- if (this.showContext) {
- line.append(">");
- int lineEnd1 = CharOperation.indexOf('\n', contents, end);
- int lineEnd2 = CharOperation.indexOf('\r', contents, end);
- int lineEnd = lineEnd1 > 0 && lineEnd2 > 0 ? Math.min(lineEnd1, lineEnd2) : Math.max(lineEnd1, lineEnd2);
- if (lineEnd == -1) lineEnd = contents.length;
- line.append(CharOperation.subarray(contents, end, lineEnd));
- }
- } else {
- line.append("No source");
- }
- line.append("]");
- }
- }
- if (this.showAccuracy) {
- line.append(" ");
- if (match.getAccuracy() == SearchMatch.A_ACCURATE) {
- if (this.showRule) {
- if (match.isExact()) {
- line.append("EXACT_");
- } else if (match.isEquivalent()) {
- line.append("EQUIVALENT_");
- } else if (match.isErasure()) {
- line.append("ERASURE_");
- } else {
- line.append("INVALID_RULE_");
- }
- if (match.isRaw()) {
- line.append("RAW_");
- }
- } else {
- line.append("EXACT_");
- }
- line.append("MATCH");
- } else {
- line.append("POTENTIAL_MATCH");
- }
- }
- if (this.showInsideDoc) {
- line.append(" ");
- if (match.isInsideDocComment()) {
- line.append("INSIDE_JAVADOC");
- } else {
- line.append("OUTSIDE_JAVADOC");
- }
- }
- if (this.showSynthetic) {
- if (match instanceof MethodReferenceMatch) {
- MethodReferenceMatch methRef = (MethodReferenceMatch) match;
- }
- }
- if (this.showFlavors > 0) {
- if (match instanceof MethodReferenceMatch) {
- MethodReferenceMatch methRef = (MethodReferenceMatch) match;
- if (methRef.isSuperInvocation() && showSuperInvocation()) {
- line.append(" SUPER INVOCATION");
- }
- }
- }
- } catch (JavaScriptModelException e) {
- results.append("\n");
- results.append(e.toString());
- }
- }
- private boolean showSuperInvocation() {
- return (this.showFlavors & PatternLocator.SUPER_INVOCATION_FLAVOR) != 0;
- }
- protected void append(IField field) throws JavaScriptModelException {
- append(field.getDeclaringType());
- line.append(".");
- line.append(field.getElementName());
- }
- private void append(IInitializer initializer) throws JavaScriptModelException {
- append(initializer.getDeclaringType());
- line.append(".");
- if (Flags.isStatic(initializer.getFlags())) {
- line.append("static ");
- }
- line.append("{}");
- }
- private void append(IFunction method) throws JavaScriptModelException {
- if (!method.isConstructor() && method.getReturnType()!=null) {
- line.append(Signature.toString(method.getReturnType()));
- line.append(" ");
- }
- if (method.getDeclaringType()!=null)
- {
- append(method.getDeclaringType());
- line.append(".");
- }
- if (!method.isConstructor()) {
- line.append(method.getElementName());
- }
- line.append("(");
- String[] parameters = method.getParameterTypes();
- boolean varargs = Flags.isVarargs(method.getFlags());
- for (int i = 0, length=parameters.length; i<length; i++) {
- if (i < length - 1) {
- line.append(Signature.toString(parameters[i]));
- line.append(", "); //$NON-NLS-1$
- } else if (varargs) {
- // remove array from signature
- String parameter = parameters[i].substring(1);
- line.append(Signature.toString(parameter));
- line.append(" ..."); //$NON-NLS-1$
- } else {
- line.append(Signature.toString(parameters[i]));
- }
- }
- line.append(")");
- }
- private void append(IPackageFragment pkg) {
- line.append(pkg.getElementName());
- }
- private void append(IType type) throws JavaScriptModelException {
- IJavaScriptElement parent = type.getParent();
- boolean isLocal = false;
- switch (parent.getElementType()) {
- case IJavaScriptElement.JAVASCRIPT_UNIT:
- IPackageFragment pkg = type.getPackageFragment();
- append(pkg);
- if (!pkg.getElementName().equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) {
- line.append(".");
- }
- break;
- case IJavaScriptElement.CLASS_FILE:
- IType declaringType = type.getDeclaringType();
- if (declaringType != null) {
- append(type.getDeclaringType());
- line.append("$");
- } else {
- pkg = type.getPackageFragment();
- append(pkg);
- if (!pkg.getElementName().equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) {
- line.append(".");
- }
- }
- break;
- case IJavaScriptElement.TYPE:
- append((IType)parent);
- line.append("$");
- break;
- case IJavaScriptElement.FIELD:
- append((IField)parent);
- isLocal = true;
- break;
- case IJavaScriptElement.INITIALIZER:
- append((IInitializer)parent);
- isLocal = true;
- break;
- case IJavaScriptElement.METHOD:
- append((IFunction)parent);
- isLocal = true;
- break;
- }
- if (isLocal) {
- line.append(":");
- }
- String typeName = type.getElementName();
- if (typeName.length() == 0) {
- line.append("<anonymous>");
- } else {
- line.append(typeName);
- }
- if (isLocal) {
- line.append("#");
- line.append(((SourceRefElement)type).occurrenceCount);
- }
- }
- protected IJavaScriptElement getElement(SearchMatch searchMatch) {
- return (IJavaScriptElement) searchMatch.getElement();
- }
- protected String getPathString(IResource resource, IJavaScriptElement element) {
- String pathString;
- if (resource != null) {
- IPath path = resource.getProjectRelativePath();
- if (path.segmentCount() == 0) {
- IJavaScriptElement root = element;
- while (root != null && !(root instanceof IPackageFragmentRoot)) {
- root = root.getParent();
- }
- if (root != null) {
- IPackageFragmentRoot pkgFragmentRoot = (IPackageFragmentRoot)root;
- if (pkgFragmentRoot.isExternal()) {
- pathString = pkgFragmentRoot.getPath().toOSString();
- } else {
- pathString = pkgFragmentRoot.getPath().toString();
- }
- } else {
- pathString = "";
- }
- } else {
- pathString = path.toString();
- }
- } else {
- pathString = element.getPath().toString();
- }
- return pathString;
- }
- protected char[] getSource(IResource resource, IJavaScriptElement element, IJavaScriptUnit unit) throws CoreException {
- char[] contents = CharOperation.NO_CHAR;
- if ("js".equals(resource.getFileExtension())) {
- IJavaScriptUnit cu = (IJavaScriptUnit)element.getAncestor(IJavaScriptElement.JAVASCRIPT_UNIT);
- if (cu != null && cu.isWorkingCopy()) {
- // working copy
- contents = unit.getBuffer().getCharacters();
- } else {
- IFile file = ((IFile) resource);
- try {
- contents = new org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit(
- null,
- file.getLocation().toFile().getPath(),
- file.getCharset()).getContents();
- } catch(AbortCompilationUnit e) {
- // TODO (philippe) occured with a FileNotFoundException
- // ignore
- }
- }
- }
- return contents;
- }
- public String toString() {
- return results.toString();
- }
- }
-
- static class TypeNameMatchCollector extends TypeNameMatchRequestor {
- List matches = new ArrayList();
- public void acceptTypeNameMatch(TypeNameMatch match) {
- IType type = match.getType();
- if (type != null) {
- this.matches.add(type);
- }
- }
- public int size() {
- return this.matches.size();
- }
- private String toString(int kind) {
- int size = size();
- if (size == 0) return "";
- String[] strings = new String[size];
- for (int i=0; i<size; i++) {
- IType type = (IType) this.matches.get(i);
- switch (kind) {
- case 1: // fully qualified name
- strings[i] = type.getFullyQualifiedName();
- break;
- case 0:
- default:
- strings[i] = type.toString();
- }
- }
- Arrays.sort(strings);
- StringBuffer buffer = new StringBuffer();
- for (int i=0; i<size; i++) {
- if (i>0) buffer.append('\n');
- buffer.append(strings[i]);
- }
- return buffer.toString();
- }
- public String toString() {
- return toString(0);
- }
- public String toFullyQualifiedNamesString() {
- return toString(1);
- }
- }
-
-protected JavaSearchResultCollector resultCollector;
-
- public AbstractJavaSearchTests(String name) {
- this(name, 2);
- }
- public AbstractJavaSearchTests(String name, int tabs) {
- super(name, tabs);
- this.displayName = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests#assertSearchResults(java.lang.String, java.lang.Object)
- */
- protected void assertSearchResults(String expected) {
- assertSearchResults(expected, resultCollector);
- }
- protected void assertSearchResults(String expected, JavaSearchResultCollector collector) {
- assertSearchResults("Unexpected search results", expected, collector);
- }
- protected void assertSearchResults(String message, String expected, JavaSearchResultCollector collector) {
- String actual = collector.toString();
- if (!expected.equals(actual)) {
- if (this.displayName) {
- System.out.print(getName());
- System.out.print(" got ");
- if (collector.count==0)
- System.out.println("no result!");
- else {
- System.out.print(collector.count);
- System.out.print(" result");
- if (collector.count==1)
- System.out.println(":");
- else
- System.out.println("s:");
- }
- }
- if (!displayName || collector.count>0) {
- System.out.print(displayString(actual, this.tabs));
- System.out.println(this.endChar);
- }
- if (this.workingCopies != null) {
- int length = this.workingCopies.length;
- String[] sources = new String[length*2];
- for (int i=0; i<length; i++) {
- sources[i*2] = this.workingCopies[i].getPath().toString();
- try {
- sources[i*2+1] = this.workingCopies[i].getSource();
- } catch (JavaScriptModelException e) {
- // ignore
- }
- }
- System.out.println("--------------------------------------------------------------------------------");
- for (int i=0; i<length; i+=2) {
- System.out.println(sources[i]);
- System.out.println(sources[i+1]);
- }
- }
- }
- assertEquals(
- message,
- expected,
- actual
- );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests#copyDirectory(java.io.File, java.io.File)
- */
- protected void copyDirectory(File sourceDir, File targetDir) throws IOException {
- if (COPY_DIRS) {
- super.copyDirectory(sourceDir, targetDir);
- } else {
- targetDir.mkdirs();
- File sourceFile = new File(sourceDir, ".project");
- File targetFile = new File(targetDir, ".project");
- targetFile.createNewFile();
- copy(sourceFile, targetFile);
- sourceFile = new File(sourceDir, ".classpath");
- targetFile = new File(targetDir, ".classpath");
- targetFile.createNewFile();
- copy(sourceFile, targetFile);
- }
- }
- IJavaScriptSearchScope getJavaSearchScope() {
- return SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("JSSearch")});
- }
- IJavaScriptSearchScope getJavaSearchScope15() {
- return SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("JavaSearch15")});
- }
- IJavaScriptSearchScope getJavaSearchScope15(String packageName, boolean addSubpackages) throws JavaScriptModelException {
- if (packageName == null) return getJavaSearchScope15();
- return getJavaSearchPackageScope("JavaSearch15", packageName, addSubpackages);
- }
- IJavaScriptSearchScope getJavaSearchPackageScope(String projectName, String packageName, boolean addSubpackages) throws JavaScriptModelException {
- IPackageFragment fragment = getPackageFragment(projectName, "src", packageName);
- if (fragment == null) return null;
- IJavaScriptElement[] searchPackages = null;
- if (addSubpackages) {
- // Create list of package with first found one
- List packages = new ArrayList();
- packages.add(fragment);
- // Add all possible subpackages
- IJavaScriptElement[] children= ((IPackageFragmentRoot)fragment.getParent()).getChildren();
- String[] names = ((PackageFragment)fragment).names;
- int namesLength = names.length;
- nextPackage: for (int i= 0, length = children.length; i < length; i++) {
- PackageFragment currentPackage = (PackageFragment) children[i];
- String[] otherNames = currentPackage.names;
- if (otherNames.length <= namesLength) continue nextPackage;
- for (int j = 0; j < namesLength; j++) {
- if (!names[j].equals(otherNames[j]))
- continue nextPackage;
- }
- packages.add(currentPackage);
- }
- searchPackages = new IJavaScriptElement[packages.size()];
- packages.toArray(searchPackages);
- } else {
- searchPackages = new IJavaScriptElement[1];
- searchPackages[0] = fragment;
- }
- return SearchEngine.createJavaSearchScope(searchPackages);
- }
- IJavaScriptSearchScope getJavaSearchCUScope(String projectName, String packageName, String cuName) throws JavaScriptModelException {
- IJavaScriptUnit cu = getCompilationUnit(projectName, "src", packageName, cuName);
- return SearchEngine.createJavaSearchScope(new IJavaScriptUnit[] { cu });
- }
- protected void search(IJavaScriptElement element, int limitTo, IJavaScriptSearchScope scope) throws CoreException {
- search(element, limitTo, EXACT_RULE, scope, resultCollector);
- }
- IJavaScriptSearchScope getJavaSearchWorkingCopiesScope(IJavaScriptUnit workingCopy) throws JavaScriptModelException {
- return SearchEngine.createJavaSearchScope(new IJavaScriptUnit[] { workingCopy });
- }
- IJavaScriptSearchScope getJavaSearchWorkingCopiesScope() throws JavaScriptModelException {
- return SearchEngine.createJavaSearchScope(this.workingCopies);
- }
- protected void search(IJavaScriptElement element, int limitTo, int matchRule, IJavaScriptSearchScope scope) throws CoreException {
- search(element, limitTo, matchRule, scope, resultCollector);
- }
- protected void search(IJavaScriptElement element, int limitTo, int matchRule, IJavaScriptSearchScope scope, SearchRequestor requestor) throws CoreException {
- SearchPattern pattern = SearchPattern.createPattern(element, limitTo, matchRule);
- assertNotNull("Pattern should not be null", pattern);
- new SearchEngine(workingCopies).search(
- pattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- scope,
- requestor,
- null
- );
- }
- protected void search(SearchPattern searchPattern, IJavaScriptSearchScope scope, SearchRequestor requestor) throws CoreException {
- new SearchEngine().search(
- searchPattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- scope,
- requestor,
- null);
- }
- protected void search(String patternString, int searchFor, int limitTo, IJavaScriptSearchScope scope) throws CoreException {
- search(patternString, searchFor, limitTo, EXACT_RULE, scope, resultCollector);
- }
- protected void search(String patternString, int searchFor, int limitTo, int matchRule, IJavaScriptSearchScope scope) throws CoreException {
- search(patternString, searchFor, limitTo, matchRule, scope, resultCollector);
- }
- protected void search(String patternString, int searchFor, int limitTo, int matchRule, IJavaScriptSearchScope scope, SearchRequestor requestor) throws CoreException {
- if (patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1) {
- matchRule |= SearchPattern.R_PATTERN_MATCH;
- }
- SearchPattern pattern = SearchPattern.createPattern(
- patternString,
- searchFor,
- limitTo,
- matchRule);
- assertNotNull("Pattern should not be null", pattern);
- new SearchEngine(workingCopies).search(
- pattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- scope,
- requestor,
- null);
- }
- protected void searchDeclarationsOfAccessedFields(IJavaScriptElement enclosingElement, SearchRequestor requestor) throws JavaScriptModelException {
- new SearchEngine().searchDeclarationsOfAccessedFields(enclosingElement, requestor, null);
- }
- protected void searchDeclarationsOfReferencedTypes(IJavaScriptElement enclosingElement, SearchRequestor requestor) throws JavaScriptModelException {
- new SearchEngine().searchDeclarationsOfReferencedTypes(enclosingElement, requestor, null);
- }
- protected void searchDeclarationsOfSentMessages(IJavaScriptElement enclosingElement, SearchRequestor requestor) throws JavaScriptModelException {
- new SearchEngine().searchDeclarationsOfSentMessages(enclosingElement, requestor, null);
- }
- protected void setUp () throws Exception {
- super.setUp();
- this.resultCollector = new JavaSearchResultCollector();
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavadocCompletionModelTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavadocCompletionModelTest.java
deleted file mode 100644
index 2a9cabe..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavadocCompletionModelTest.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.parser.JavadocTagConstants;
-
-public abstract class AbstractJavadocCompletionModelTest extends AbstractJavaModelCompletionTests implements JavadocTagConstants {
-
- // Basic relevance values
- /** R_DEFAULT+R_INTERESTING+R_NON_RESTRICTED<br>= 8 */
- protected final static int JAVADOC_RELEVANCE = R_DEFAULT + R_INTERESTING+ R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING<br>+R_UNQUALIFIED+R_NON_RESTRICTED<br>= 11 */
- protected final static int R_DIUNR= R_DEFAULT+R_INTERESTING+R_UNQUALIFIED+R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_NON_RESTRICTED<br>= 18 */
- protected static final int R_DICNR = R_DEFAULT+R_INTERESTING+R_CASE+R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_QUALIFIED+R_NON_RESTRICTED<br>= 20 */
- protected static final int R_DICQNR = R_DEFAULT+R_INTERESTING+R_CASE+R_QUALIFIED+R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_UNQUALIFIED+R_NON_RESTRICTED<br>= 21 */
- protected static final int R_DICUNR = R_DEFAULT+R_INTERESTING+R_CASE+R_UNQUALIFIED+R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_NON_RESTRICTED<br>= 22 */
- protected static final int R_DICENNR = R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME+R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_QUALIFIED+R_NON_RESTRICTED<br>= 24 */
- protected static final int R_DICENQNR = R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME+R_QUALIFIED+R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_UNQUALIFIED+R_NON_RESTRICTED<br>= 25 */
- protected static final int R_DICENUNR = R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME+R_UNQUALIFIED+R_NON_RESTRICTED;
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_NON_RESTRICTED+R_NON_STATIC<br>= 29 */
- protected static final int R_DICNRNS = R_DEFAULT+R_INTERESTING+R_CASE+R_NON_RESTRICTED+R_NON_STATIC;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_NON_RESTRICTED+R_NON_STATIC<br>= 33 */
- protected static final int R_DICENNRNS = R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME+R_NON_RESTRICTED+R_NON_STATIC;
-
- // Exception relevance values
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_NON_RESTRICTED+R_EXCEPTION<br>= 38 */
- protected static final int R_DICNRE = R_DICNR+R_EXCEPTION;
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_UNQUALIFIED+R_NON_RESTRICTED+R_EXCEPTION<br>= 41 */
- protected static final int R_DICUNRE = R_DICUNR+R_EXCEPTION;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_NON_RESTRICTED+R_EXCEPTION<br>= 42 */
- protected static final int R_DICENNRE = R_DICENNR+R_EXCEPTION;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_UNQUALIFIED+R_NON_RESTRICTED+R_EXCEPTION<br>= 45 */
- protected static final int R_DICENUNRE = R_DICENUNR+R_EXCEPTION;
-
- // Exact Expected relevance values
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_NON_RESTRICTED+R_EXACT_EXPECTED_TYPE<br>= 48 */
- protected static final int R_DICNREET = R_DICNR+R_EXACT_EXPECTED_TYPE;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_UNQUALIFIED<br>+R_NON_RESTRICTED+R_EXACT_EXPECTED_TYPE<br>= 51 */
- protected static final int R_DICUNREET = R_DICUNR+R_EXACT_EXPECTED_TYPE;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_UNQUALIFIED<br>+R_NON_RESTRICTED+R_EXACT_EXPECTED_TYPE+R_EXCEPTION<br>= 71 */
- protected static final int R_DICUNREETE = R_DICUNR+R_EXACT_EXPECTED_TYPE+R_EXCEPTION;
-
- // Exact Expected Exception relevance values
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_NON_RESTRICTED<br>+R_EXCEPTION+R_EXACT_EXPECTED_TYPE<br>= 68 */
- protected static final int R_DICNREEET = R_DICNRE+R_EXACT_EXPECTED_TYPE;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_UNQUALIFIED<br>+R_NON_RESTRICTED+R_EXCEPTION<br>
- * +R_EXACT_EXPECTED_TYPE<br>= 71 */
- protected static final int R_DICUNREEET = R_DICUNRE+R_EXACT_EXPECTED_TYPE;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_NON_RESTRICTED+R_EXCEPTION<br>
- * +R_EXACT_EXPECTED_TYPE<br>= 72 */
- protected static final int R_DICENNREEET = R_DICENNRE+R_EXACT_EXPECTED_TYPE;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_UNQUALIFIED+R_NON_RESTRICTED+R_EXCEPTION<br>
- * +R_EXACT_EXPECTED_TYPE<br>= 75 */
- protected static final int R_DICENUNREEET = R_DICENUNRE+R_EXACT_EXPECTED_TYPE;
-
- // Inline tag relevance values
- /** R_DEFAULT+R_INTERESTING+R_NON_RESTRICTED<br>+R_INLINE_TAG<br>= 39 */
- protected static final int JAVADOC_RELEVANCE_IT = JAVADOC_RELEVANCE+R_INLINE_TAG;
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_NON_RESTRICTED+R_INLINE_TAG<br>= 49 */
- protected static final int R_DICNRIT = R_DICNR+R_INLINE_TAG;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_UNQUALIFIED<br>+R_NON_RESTRICTED+R_INLINE_TAG<br>= 52 */
- protected static final int R_DICUNRIT = R_DICUNR+R_INLINE_TAG;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_NON_RESTRICTED+R_INLINE_TAG<br>= 53 */
- protected static final int R_DICENNRIT = R_DICENNR+R_INLINE_TAG;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME<br>+R_UNQUALIFIED+R_NON_RESTRICTED+R_INLINE_TAG<br>= 56 */
- protected static final int R_DICENUNRIT = R_DICENUNR+R_INLINE_TAG;
- /** R_DEFAULT+R_INTERESTING+R_CASE<br>+R_NON_RESTRICTED+R_NON_STATIC+R_INLINE_TAG<br>= 60 */
- protected static final int R_DICNRNSIT = R_DICNRNS+R_INLINE_TAG;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_NON_RESTRICTED<br>+R_EXACT_EXPECTED_TYPE+R_INLINE_TAG<br>= 79 */
- protected static final int R_DICNREETIT = R_DICNREET+R_INLINE_TAG;
- /** R_DEFAULT+R_INTERESTING+R_CASE+R_UNQUALIFIED<br>+R_NON_RESTRICTED+R_EXACT_EXPECTED_TYPE<br>
- * +R_INLINE_TAG<br>= 82 */
- protected static final int R_DICUNREETIT = R_DICUNREET+R_INLINE_TAG;
-
- // Store all relevance values in array
- private static final int[] RELEVANCES = {
- JAVADOC_RELEVANCE,
- R_DIUNR,
- R_DICNR,
- R_DICQNR,
- R_DICUNR,
- R_DICENNR,
- R_DICENQNR,
- R_DICENUNR,
- R_DICNRNS,
- R_DICENNRNS,
- R_DICNRE,
- R_DICUNRE,
- R_DICENNRE,
- R_DICENUNRE,
- R_DICNREET,
- R_DICUNREET,
- R_DICNREEET,
- R_DICUNREEET,
- R_DICENNREEET,
- R_DICENUNREEET,
- JAVADOC_RELEVANCE_IT,
- R_DICNRIT,
- R_DICUNRIT,
- R_DICENNRIT,
- R_DICENUNRIT,
- R_DICNRNSIT,
- R_DICNREETIT,
- R_DICUNREETIT,
- };
- private static final String[] RELEVANCES_NAMES = {
- "JAVADOC_RELEVANCE",
- "R_DIUNR",
- "R_DICNR",
- "R_DICQNR",
- "R_DICUNR",
- "R_DICENNR",
- "R_DICENQNR",
- "R_DICENUNR",
- "R_DICNRNS",
- "R_DICENNRNS",
- "R_DICNRE",
- "R_DICUNRE",
- "R_DICENNRE",
- "R_DICENUNRE",
- "R_DICNREET",
- "R_DICUNREET",
- "R_DICNREEET",
- "R_DICUNREEET",
- "R_DICENNREEET",
- "R_DICENUNREEET",
- "JAVADOC_RELEVANCE_IT",
- "R_DICNRIT",
- "R_DICUNRIT",
- "R_DICENNRIT",
- "R_DICENUNRIT",
- "R_DICNRNSIT",
- "R_DICNREETIT",
- "R_DICUNREETIT",
- };
-
- // Write file contents
- protected static final String WRITE_DIR = System.getProperty("writeDir");
- protected static final File WRITE_DIR_FILE;
- protected static final Set PACKAGE_FILES = new HashSet();
- static {
- File writeDir = null;
- if (WRITE_DIR != null) {
- // Create write directory if necessay
- writeDir = new File(WRITE_DIR);
- if (writeDir.exists()) {
- // perhaps delete all files...
- } else if (!writeDir.mkdirs()) {
- System.err.println(WRITE_DIR+" does NOT exist and cannot be created!!!");
- writeDir = null;
- }
-
- }
- WRITE_DIR_FILE = writeDir;
- }
-
- CompletionTestsRequestor2 requestor;
- protected int cursorLocation;
- protected int completionStart;
- protected String replacedText;
- protected String positions;
-
- public AbstractJavadocCompletionModelTest(String name) {
- super(name);
- this.tabs = 2;
- this.displayName = true;
- this.endChar = "";
- }
-
- public static Test suite() {
- return buildModelTestSuite(AbstractJavadocCompletionModelTest.class);
- }
- protected void assertResults(String expected) throws JavaScriptModelException {
- int length = this.workingCopies.length;
- String[] sources = new String[length*2];
- for (int i=0; i<length; i++) {
- sources[i*2] = this.workingCopies[i].getPath().toString();
- sources[i*2+1] = this.workingCopies[i].getSource();
- }
- assertResults(sources, expected, this.requestor.getResultsWithoutSorting());
- }
- protected void assertSortedResults(String expected) throws JavaScriptModelException {
- int length = this.workingCopies.length;
- String[] sources = new String[length*2];
- for (int i=0; i<length; i++) {
- sources[i*2] = this.workingCopies[i].getPath().toString();
- sources[i*2+1] = this.workingCopies[i].getSource();
- }
- assertResults(sources, expected, this.requestor.getReversedResults());
- }
- private void assertResults(String[] sources, String expected, String actual) {
- int count = this.requestor.proposalsPtr+1;
- if (!expected.equals(actual)) {
- System.out.println("********************************************************************************");
- if (this.displayName) {
- System.out.print(getName());
- System.out.print(" got ");
- if (count==0)
- System.out.println("no result!");
- else {
- System.out.print(count);
- System.out.print(" result");
- if (count==1)
- System.out.println(":");
- else
- System.out.println("s:");
- }
- }
- if (!this.displayName || count>0) {
- System.out.println(displayString(actual, this.tabs));
- System.out.println(this.endChar);
- }
- System.out.println("--------------------------------------------------------------------------------");
- for (int i=0, length = sources.length; i<length; i+=2) {
- System.out.println(sources[i]);
- System.out.println(sources[i+1]);
- }
- }
- assertEquals(
- "Completion proposals are not correct!",
- expected,
- actual
- );
- }
- protected void assertNoProblem(String path) {
- String problem = this.requestor.getProblem();
- if (problem.length() > 0) {
- System.out.println("********************************************************************************");
- if (this.displayName) {
- System.out.print(getName());
- System.out.println(" contains an error although it should NOT:");
- }
- System.out.println(displayString(problem, this.tabs));
- System.out.println("--------------------------------------------------------------------------------");
- System.out.println(this.workingCopies[0].getPath().toString()+'\n');
- try {
- System.out.println(this.workingCopies[0].getSource());
- } catch (JavaScriptModelException e) {
- // forget it
- }
- assertEquals(
- path+" should have NO problem!",
- "",
- problem
- );
- }
- }
-
- protected void completeInJavadoc(String path, String source, boolean showPositions, String completeBehind) throws JavaScriptModelException {
- completeInJavadoc(path, source, showPositions, completeBehind, 1 /* first index */);
- }
-
- protected void completeInJavadoc(String path, String source, boolean showPositions, String completeBehind, boolean last) throws JavaScriptModelException {
- completeInJavadoc(path, source, showPositions, completeBehind, last ? -1 : 1);
- }
-
- protected void completeInJavadoc(String path, String source, boolean showPositions, String completeBehind, int occurencePosition) throws JavaScriptModelException {
- completeInJavadoc(new String[] { path, source }, showPositions, completeBehind, occurencePosition, null);
- }
-
- protected void completeInJavadoc(String path, String source, boolean showPositions, String completeBehind, int occurencePosition, int[] ignoreList) throws JavaScriptModelException {
- completeInJavadoc(new String[] { path, source }, showPositions, completeBehind, occurencePosition, ignoreList);
- }
- protected void completeInJavadoc(String[] sources, boolean showPositions, String completeBehind) throws JavaScriptModelException {
- completeInJavadoc(sources, showPositions, completeBehind, 1, null);
- }
-
- protected void completeInJavadoc(String[] sources, boolean showPositions, String completeBehind, int occurencePosition) throws JavaScriptModelException {
- completeInJavadoc(sources, showPositions, completeBehind, occurencePosition, null);
- }
-
- protected void completeInJavadoc(String[] sources, boolean showPositions, String completeBehind, int occurencePosition, int[] ignoreList) throws JavaScriptModelException {
- assertNotNull("We should have sources!!!", sources);
- assertTrue("Invalid number of sources!!!", sources.length%2==0);
-
- // Build working copy(ies)
- int length = sources.length / 2;
- this.workingCopies = new IJavaScriptUnit[length];
- for (int i=0; i<length; i++) {
- this.workingCopies[i] = getWorkingCopy(sources[i*2], sources[i*2+1]);
- if (WRITE_DIR != null) writeFiles(sources);
- }
-
- // Wait for indexes
- waitUntilIndexesReady();
-
- // Complete
- this.requestor = new CompletionTestsRequestor2(true, false, showPositions);
- if (ignoreList != null) {
- for (int i = 0; i < ignoreList.length; i++) {
- this.requestor.setIgnored(ignoreList[i], true);
- }
- }
- String source = this.workingCopies[0].getSource();
- this.replacedText = completeBehind;
- this.completionStart = -1;
- int cursorPos = this.replacedText.length();
- if (occurencePosition < -10) { // case where we want to specify directly the cursor location relatively to completion start
- this.completionStart = source.indexOf(this.replacedText);
- cursorPos = -occurencePosition - 10;
- } else if (occurencePosition < 0) {
- this.completionStart = source.lastIndexOf(this.replacedText);
- int max = -occurencePosition;
- for (int i=1; i<max; i++) {
- this.completionStart = source.lastIndexOf(this.replacedText, this.completionStart);
- }
- } else {
- this.completionStart = source.indexOf(this.replacedText);
- int shift = this.replacedText.length();
- for (int i=1; i<occurencePosition && this.completionStart>0; i++) {
- this.completionStart = source.indexOf(this.replacedText, this.completionStart+shift);
- }
- }
- assertTrue("We should have found "+occurencePosition+" occurence(s) of '"+this.replacedText+"' in:\n"+source, this.completionStart>0);
- this.cursorLocation = this.completionStart + cursorPos;
- this.workingCopies[0].codeComplete(this.cursorLocation, requestor, this.wcOwner);
- assertNoProblem(sources[0]);
-
- // Store replacement info
- if (occurencePosition == 0) { // special case for completion on empty token...
- this.completionStart = this.cursorLocation;
- }
- int endPosition = this.cursorLocation;
- char ch = source.charAt(endPosition);
- if (Character.isJavaIdentifierPart(ch) || ch == '>' || ch == '}' || ch == '(' || ch == ')') {
- do {
- ch = source.charAt(++endPosition);
- } while (Character.isJavaIdentifierPart(ch) || ch == '>' || ch == '}' || ch == '(' || ch == ')');
- }
- this.positions = "["+this.completionStart+", "+endPosition+"], ";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests#displayString(java.lang.String, int)
- */
- protected String displayString(String toPrint, int indent) {
- String toDisplay = super.displayString(toPrint, indent);
- int openBracket = toDisplay.indexOf(", [");
- if (openBracket > 0) {
- StringBuffer buffer = new StringBuffer();
- int closeBracket = 0;
- while (openBracket > 0) {
- buffer.append(toDisplay.substring(closeBracket, openBracket+2));
- closeBracket = toDisplay.indexOf("], ", openBracket+3);
- if (closeBracket < 0) break; // invalid
- closeBracket += 3;
- buffer.append("\"+this.positions+");
- int i=0;
- while (toDisplay.charAt(closeBracket+i) != '}') i++;
- try {
- int relevance = Integer.parseInt(toDisplay.substring(closeBracket, closeBracket+i));
- int length = RELEVANCES.length;
- boolean found = false;
- for (int r=0; !found && r<length; r++) {
- if (RELEVANCES[r] == relevance) {
- buffer.append(RELEVANCES_NAMES[r]);
- buffer.append("+\"");
- found = true;
- }
- }
- if (!found) {
- buffer.append('"');
- buffer.append(relevance);
- }
- closeBracket += i;
- }
- catch (NumberFormatException nfe) {
- System.err.println(nfe.getMessage()+" should not occur!");
- }
- openBracket = toDisplay.indexOf(", [", closeBracket);
- }
- if (closeBracket > 0) {
- buffer.append(toDisplay.substring(closeBracket, toDisplay.length()));
- toDisplay = buffer.toString();
- }
- }
- return toDisplay.replaceAll(", 8}", ", \"+JAVADOC_RELEVANCE+\"}");
- }
-
- protected void setUpProjectOptions(String compliance) throws JavaScriptModelException {
- try {
- setUpProjectCompliance(COMPLETION_PROJECT, compliance);
- } catch (IOException e) {
- assertTrue("Unexpected IOException: "+e.getMessage(), false);
- }
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- if (COMPLETION_PROJECT == null) {
- COMPLETION_PROJECT = setUpJavaProject("Completion");
- createFolder(new Path("/Completion/src/javadoc/tags"));
- } else {
- setUpProjectCompliance(COMPLETION_PROJECT, "1.4");
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests#tearDown()
- */
- protected void tearDown() throws Exception {
- this.requestor = null;
- super.tearDown();
- }
-
- public void tearDownSuite() throws Exception {
- deleteFolder(new Path("/Completion/src/javadoc/tags"));
- super.tearDownSuite();
- if (COMPLETION_SUITES == null) {
- COMPLETION_PROJECT = null;
- }
- }
-
- /*
- * Write files for self-hosting debug.
- */
- protected void writeFiles(String[] sources) {
-
- // Get write directory path
- if (WRITE_DIR_FILE == null) return;
-
- // Get test name
- String testName = getName();
- int idx = testName.indexOf(" - ");
- if (idx > 0) {
- testName = testName.substring(idx+3);
- }
-// testName = "Test"+testName.substring(4);
-
- // Write sources to dir
- int length = sources.length / 2;
- String[][] names = new String[length][3];
- for (int i=0; i<length; i++) {
-
- // Get pathes
- IPath filePath = new Path(sources[2*i]).removeFirstSegments(2); // remove project and source folder
- IPath dirPath = filePath.removeLastSegments(1);
- String fileDir = dirPath.toString();
- String typeName = filePath.removeFileExtension().lastSegment();
-
- // Create package dir or delete files if already exist
- File packageDir = new File(WRITE_DIR_FILE, fileDir);
- if (!PACKAGE_FILES.contains(packageDir)) {
- if (packageDir.exists()) {
- PACKAGE_FILES.add(packageDir);
- Util.delete(packageDir);
- } else if (packageDir.mkdirs()) {
- PACKAGE_FILES.add(packageDir);
- } else {
- System.err.println(packageDir+" does not exist and CANNOT be created!!!");
- continue;
- }
- }
-
- // Store names info
- names[i][0] = typeName;
- String fileName = (typeName.length() <= 3) ? typeName : typeName.substring(0, typeName.length()-3);
- fileName = fileName + testName.substring(4);
- names[i][1] = fileName;
- names[i][2] = packageDir.getAbsolutePath()+"\\"+fileName+".js";
- }
-
- // Write modified contents
- for (int i=0; i<length; i++) {
- String contents = sources[2*i+1];
- for (int j=0; j<length; j++) {
- contents = contents.replaceAll(names[j][0], names[j][1]);
- }
- String fullPathName = names[i][2];
- System.out.println("Write file "+fullPathName);
- Util.writeToFile(contents, fullPathName);
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AccessRestrictionsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AccessRestrictionsTests.java
deleted file mode 100644
index 00423a3..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AccessRestrictionsTests.java
+++ /dev/null
@@ -1,1023 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-
-public class AccessRestrictionsTests extends ModifyingResourceTests {
- static class ProblemRequestor extends AbstractJavaModelTests.ProblemRequestor {
- ProblemRequestor (String source) {
- if (source != null)
- unitSource = source.toCharArray();
- }
- ProblemRequestor() {
- }
- public void acceptProblem(IProblem problem) {
- super.acceptProblem(problem);
- }
- }
-
- protected ProblemRequestor problemRequestor;
-
- public AccessRestrictionsTests(String name) {
- super(name);
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
- // Names of tests to run, like "testXXX"
- //TESTS_NAMES = new String[] { "test004" };
- // Numbers of tests to run: "test<number>" will be run for each number of this array
- //TESTS_NUMBERS = new int[] { 1 };
- // Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
- //TESTS_RANGE = new int[] { 16, -1 };
- }
-
- public static Test suite() {
- return buildModelTestSuite(AccessRestrictionsTests.class);
- }
-
- protected void assertProblems(String message, String expected) {
- assertProblems(message, expected, this.problemRequestor);
- }
-
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76266
- * Ensures that a problem is created for a reference to a method of a type that is not
- * accessible in a prereq project, even though it is accessed through an intermediate
- * accessible class.
- */
-public void test001() throws CoreException {
- IJavaScriptUnit x1 = null, x2 = null, y = null, z = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1 {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- x2 = getWorkingCopy(
- "/P1/src/p/X2.js",
- "package p;\n" +
- "public class X2 extends X1 {\n" +
- " void bar() {\n" +
- " }\n" +
- "}", owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"},
- new String[] {"JCL_LIB"});
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X1");
- p2.setRawIncludepath(classpath, null);
- // check the most basic case
- String src =
- "package p;\n" +
- "public class Z extends X1 {\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- z = getWorkingCopy(
- "/P2/src/p/Z.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Z.java (at line 2)\n" +
- " public class Z extends X1 {\n" +
- " ^^\n" +
- "Access restriction: The type X1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- // check the specifics of this test case
- src =
- "package p;\n" +
- "public class Y extends X2 {\n" +
- " void foobar() {\n" +
- " foo(); // accesses X1.foo, should trigger an error\n" +
- " bar(); // accesses X2.bar, OK\n" +
- " }\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " foo(); // accesses X1.foo, should trigger an error\n" +
- " ^^^^^\n" +
- "Access restriction: The method foo() from the type X1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (x2 != null)
- x2.discardWorkingCopy();
- if (y != null)
- y.discardWorkingCopy();
- if (z != null)
- z.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76266
- * Ensures that a problem is created for a reference to a field of a type that is not
- * accessible in a prereq project, even though it is accessed through an intermediate
- * accessible class.
- */
-public void test002() throws CoreException {
- IJavaScriptUnit x1 = null, x2 = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1 {\n" +
- " int m1;\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- x2 = getWorkingCopy(
- "/P1/src/p/X2.js",
- "package p;\n" +
- "public class X2 extends X1 {\n" +
- " char m2;\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"},
- new String[] {"JCL_LIB"});
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X1");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Y extends X2 {\n" +
- " void foobar() {\n" +
- " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
- " char l2 = m2; // accesses X2.m2, OK\n" +
- " }\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
- " ^^\n" +
- "Access restriction: The field m1 from the type X1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (x2 != null)
- x2.discardWorkingCopy();
- if (y != null)
- y.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76266
- * Ensures that a problem is created for a reference to a member type of a type that is not
- * accessible in a prereq project, even though it is accessed through an intermediate
- * accessible class.
- */
-public void test003() throws CoreException {
- IJavaScriptUnit x1 = null, x2 = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1 {\n" +
- " class C1 {\n" +
- " protected C1 (int dummy) {}\n" +
- " protected void foo() {}\n" +
- " }\n" +
- " interface I1 {}\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- x2 = getWorkingCopy(
- "/P1/src/p/X2.js",
- "package p;\n" +
- "public class X2 extends X1 {\n" +
- " class C2 {}\n" +
- " interface I2 {}\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"},
- new String[] {"JCL_LIB"});
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X1");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Y extends X2 {\n" +
- " class C3a extends C1 { // error\n" +
- " C3a() {\n" +
- " super(0);\n" +
- " foo(); // error\n" +
- " }\n" +
- " }\n" +
- " class C3c extends C2 implements I2 {}\n" +
- " void foobar() {\n" +
- " C1 m1 = // error\n" +
- " new C1(0); // error\n" +
- " C2 m2 = new C2();\n" +
- " }\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " class C3a extends C1 { // error\n" +
- " ^^\n" +
- "Access restriction: The type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 5)\n" +
- " super(0);\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor X1.C1(int) is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
- " foo(); // error\n" +
- " ^^^^^\n" +
- "Access restriction: The method foo() from the type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
- " C1 m1 = // error\n" +
- " ^^\n" +
- "Access restriction: The type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor X1.C1(int) is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^\n" +
- "Access restriction: The type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (x2 != null)
- x2.discardWorkingCopy();
- if (y != null)
- y.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * Discouraged access message - type via discouraged rule.
- */
-public void test004() throws CoreException {
- IJavaScriptUnit x1 = null, z = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1 {\n" +
- " class C1 {}\n" +
- " interface I1 {}\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"},
- new String[] {"JCL_LIB"});
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "~p/X1");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Z extends X1 {\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- z = getWorkingCopy(
- "/P2/src/p/Z.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. WARNING in /P2/src/p/Z.java (at line 2)\n" +
- " public class Z extends X1 {\n" +
- " ^^\n" +
- "Discouraged access: The type X1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (z != null)
- z.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76266
- * Ensures that a problem is created for a reference to a method of a type that is not
- * accessible in a prereq project, even though it is accessed through an intermediate
- * class that implements an interface that defines the same method, both the second
- * class and the interface being accessible.
- * The point here is that the existence of the accessible interface may imply that the
- * foo method be accessible through X2. By design, the lookup returns X1#foo though,
- * like it does for a press upon F3 in the interface, and hence the access restriction
- * gets triggered. Rule of thumb: if pressing F3 on a method or field directs the
- * interface to a definition within a restricted type, then the use of the said method
- * or field is restricted.
- */
-public void test005() throws CoreException {
- IJavaScriptUnit x1 = null, i1 = null, x2 = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1 {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- i1 = getWorkingCopy(
- "/P1/src/q/I1.js",
- "package q;\n" +
- "interface I1 {\n" +
- " void foo();\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- x2 = getWorkingCopy(
- "/P1/src/q/X2.js",
- "package q;\n" +
- "public class X2 extends p.X1 {\n" +
- " public void bar() {\n" +
- " foo();\n" +
- " }\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0,
- classpath = new IIncludePathEntry[length + 1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X1");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package r;\n" +
- "public class Y {\n" +
- " void foobar() {\n" +
- " (new q.X2()).foo(); // accesses p.X1#foo, should trigger an error\n" +
- " (new q.X2()).bar(); // accesses q.X2#bar, OK\n" +
- " }\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/r/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/r/Y.java (at line 4)\n" +
- " (new q.X2()).foo(); // accesses p.X1#foo, should trigger an error\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "Access restriction: The method foo() from the type X1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (i1 != null)
- i1.discardWorkingCopy();
- if (x2 != null)
- x2.discardWorkingCopy();
- if (y != null)
- y.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * Missing access restriction violation error on generic type.
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=122995
- */
-public void test006() throws CoreException {
- IJavaScriptUnit x = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p1.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- this.problemRequestor = new ProblemRequestor();
- x = getWorkingCopy(
- "/P1/src/p/X.js",
- "package p;\n" +
- "public class X<T> {\n" +
- " T m;\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p2.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Y {\n" +
- " X x1;\n" +
- " X<String> x2 = new X<String>();\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " X x1;\n" +
- " ^\n" +
- "Access restriction: The type X<T> is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Access restriction: The type X<String> is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Access restriction: The constructor X<String>() is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>();\n" +
- " ^\n" +
- "Access restriction: The type X<String> is not accessible due to restriction on required project P1\n" +
- "----------\n");
- } finally {
- if (x != null) {
- x.discardWorkingCopy();
- }
- if (y != null) {
- y.discardWorkingCopy();
- }
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * Missing access restriction violation error on generic type.
- * More complex type parameter - stretch the erasure.
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=122995
- */
-public void test007() throws CoreException {
- IJavaScriptUnit x = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p1.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- this.problemRequestor = new ProblemRequestor();
- x = getWorkingCopy(
- "/P1/src/p/X.js",
- "package p;\n" +
- "public class X<T extends String> {\n" +
- " T m;\n" +
- " public X (T t) {\n" +
- " this.m = t;\n" +
- " }\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p2.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Y {\n" +
- " X x1;\n" +
- " X<String> x2 = new X<String>(\"\");\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " X x1;\n" +
- " ^\n" +
- "Access restriction: The type X<T> is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>(\"\");\n" +
- " ^\n" +
- "Access restriction: The type X<String> is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Access restriction: The constructor X<String>(String) is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " X<String> x2 = new X<String>(\"\");\n" +
- " ^\n" +
- "Access restriction: The type X<String> is not accessible due to restriction on required project P1\n" +
- "----------\n");
- } finally {
- if (x != null) {
- x.discardWorkingCopy();
- }
- if (y != null) {
- y.discardWorkingCopy();
- }
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * Missing access restriction violation error on generic type.
- * Method case.
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=122995
- */
-public void test008() throws CoreException {
- IJavaScriptUnit x1 = null, x2 = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p1.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1<T> {\n" +
- " void foo() {\n" +
- " }\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- x2 = getWorkingCopy(
- "/P1/src/p/X2.js",
- "package p;\n" +
- "public class X2 extends X1 {\n" +
- " void bar() {\n" +
- " }\n" +
- "}", owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"},
- new String[] {"JCL_LIB"});
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X1");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Y extends X2 {\n" +
- " void foobar() {\n" +
- " foo(); // accesses X1.foo, should trigger an error\n" +
- " bar(); // accesses X2.bar, OK\n" +
- " }\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " foo(); // accesses X1.foo, should trigger an error\n" +
- " ^^^^^\n" +
- "Access restriction: The method foo() from the type X1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (x2 != null)
- x2.discardWorkingCopy();
- if (y != null)
- y.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * Missing access restriction violation error on generic type.
- * Field case.
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=122995
- */
-public void test009() throws CoreException {
- IJavaScriptUnit x1 = null, x2 = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p1.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1<T> {\n" +
- " int m1;\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- x2 = getWorkingCopy(
- "/P1/src/p/X2.js",
- "package p;\n" +
- "public class X2 extends X1 {\n" +
- " char m2;\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"},
- new String[] {"JCL_LIB"});
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X1");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Y extends X2 {\n" +
- " void foobar() {\n" +
- " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
- " char l2 = m2; // accesses X2.m2, OK\n" +
- " }\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
- " int l1 = m1; // accesses X1.m1, should trigger an error\n" +
- " ^^\n" +
- "Access restriction: The field m1 from the type X1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (x2 != null)
- x2.discardWorkingCopy();
- if (y != null)
- y.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * Missing access restriction violation error on generic type.
- * Inner type case.
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=122995
- */
-public void test010() throws CoreException {
- IJavaScriptUnit x1 = null, x2 = null, y = null;
- try {
- WorkingCopyOwner owner = new WorkingCopyOwner(){};
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {"src"},
- new String[] {"JCL_LIB"});
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p1.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p1.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- this.problemRequestor = new ProblemRequestor();
- x1 = getWorkingCopy(
- "/P1/src/p/X1.js",
- "package p;\n" +
- "public class X1<T> {\n" +
- " class C1 {\n" +
- " protected C1 (int dummy) {}\n" +
- " protected void foo() {}\n" +
- " }\n" +
- " interface I1 {}\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- x2 = getWorkingCopy(
- "/P1/src/p/X2.js",
- "package p;\n" +
- "public class X2 extends X1 {\n" +
- " class C2 {}\n" +
- " interface I2 {}\n" +
- "}",
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"},
- new String[] {"JCL_LIB"});
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.compliance", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.source", "1.5");
- p2.setOption("org.eclipse.wst.jsdt.core.compiler.targetPlatform", "1.5");
- p2.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
- IIncludePathEntry[] classpath = p2.getRawIncludepath();
- int length = classpath.length;
- System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
- classpath[length] = createSourceEntry("P2", "/P1", "-p/X1");
- p2.setRawIncludepath(classpath, null);
- String src =
- "package p;\n" +
- "public class Y extends X2 {\n" +
- " class C3a extends C1 { // error\n" +
- " C3a() {\n" +
- " super(0);\n" +
- " foo(); // error\n" +
- " }\n" +
- " }\n" +
- " class C3c extends C2 implements I2 {}\n" +
- " void foobar() {\n" +
- " C1 m1 = // error\n" +
- " new C1(0); // error\n" +
- " C2 m2 = new C2();\n" +
- " }\n" +
- "}";
- this.problemRequestor = new ProblemRequestor(src);
- y = getWorkingCopy(
- "/P2/src/p/Y.js",
- src,
- owner,
- this.problemRequestor);
- assertProblems(
- "Unexpected problems value",
- "----------\n" +
- "1. ERROR in /P2/src/p/Y.java (at line 3)\n" +
- " class C3a extends C1 { // error\n" +
- " ^^\n" +
- "Access restriction: The type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "2. ERROR in /P2/src/p/Y.java (at line 5)\n" +
- " super(0);\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor X1.C1(int) is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
- " foo(); // error\n" +
- " ^^^^^\n" +
- "Access restriction: The method foo() from the type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
- " C1 m1 = // error\n" +
- " ^^\n" +
- "Access restriction: The type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor X1.C1(int) is not accessible due to restriction on required project P1\n" +
- "----------\n" +
- "6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
- " new C1(0); // error\n" +
- " ^^\n" +
- "Access restriction: The type X1.C1 is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- if (x1 != null)
- x1.discardWorkingCopy();
- if (x2 != null)
- x2.discardWorkingCopy();
- if (y != null)
- y.discardWorkingCopy();
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java
deleted file mode 100644
index dec120e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java
+++ /dev/null
@@ -1,1141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.ISourceRange;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTParser;
-
-/**
- * TO DO:
- * - source attachment on external jar.
- * - don't use assertTrue where assertEquals should be used
- * - don't hardcode positions
-*/
-public class AttachSourceTests extends ModifyingResourceTests {
- static {
-// TESTS_NAMES = new String[] { "testClassFileGetElementAt04" };
-// TESTS_NUMBERS = new int[] { 5 };
-// TESTS_RANGE = new int[] { 169, 180 };
- }
-
- public static Test suite() {
- return buildModelTestSuite(AttachSourceTests.class);
- }
-
- /** @deprecated using deprecated code */
- private static final int AST_INTERNAL_JLS2 = AST.JLS2;
-
- private IPackageFragmentRoot pkgFragmentRoot;
- private IType genericType;
- private IPackageFragment innerClasses;
-
-public AttachSourceTests(String name) {
- super(name);
-}
-public ASTNode runConversion(IClassFile classFile, boolean resolveBindings) {
- ASTParser parser = ASTParser.newParser(AST_INTERNAL_JLS2);
- parser.setSource(classFile);
- parser.setResolveBindings(resolveBindings);
- parser.setWorkingCopyOwner(null);
- return parser.createAST(null);
-}
-protected void setUp() throws Exception {
- super.setUp();
- this.attachSource(this.pkgFragmentRoot, "/AttachSourceTests/attachsrc.zip", "");
-}
-/**
- * Create project and set the jar placeholder.
- */
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- setUpJavaProject("AttachSourceTests");
- addLibraryEntry("/AttachSourceTests/b153133.jar", false);
- this.pkgFragmentRoot = this.currentProject.getPackageFragmentRoot(this.getFile("/AttachSourceTests/attach.jar"));
- setUpGenericJar();
- setUpInnerClassesJar();
-}
-private void setUpGenericJar() throws IOException, CoreException {
- String[] pathAndContents = new String[] {
- "generic/X.js",
- "package generic;\n" +
- "public class X<T> {\n" +
- " void foo(X<T> x) {\n" +
- " }\n" +
- " <K, V> V foo(K key, V value) {\n" +
- " return value;\n" +
- " }\n" +
- " void foo(int i, X<Object[]> x) {\n" +
- " }\n" +
- " void foo(boolean b, X<? extends X> x) {\n" +
- " }\n" +
- " void foo(float f, X<?> x) {\n" +
- " }\n" +
- " void foo(Y<? extends Integer, ? extends Object> y) {\n" +
- " }\n" +
- " void foo(Z.Inner<Object> inner) {\n" +
- " }\n" +
- " void foo(AType<Object> t) {\n" +
- " }\n" +
- "}\n" +
- "class Y<K, V> {\n" +
- "}\n" +
- "class Z {\n" +
- " class Inner<E> {\n" +
- " }\n" +
- "}\n" +
- "class AType<E> {\n" + // type name containing character 'T'
- "}"
- };
- addLibrary("generic.jar", "genericsrc.zip", pathAndContents, JavaScriptCore.VERSION_1_5);
- IFile jar = getFile("/AttachSourceTests/generic.jar");
- this.genericType = this.currentProject.getPackageFragmentRoot(jar).getPackageFragment("generic").getClassFile("X.class").getType();
-}
-private void setUpInnerClassesJar() throws IOException, CoreException {
- String[] pathAndContents = new String[] {
- "inner/X.js",
- "package inner;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " new X() {};\n" +
- " class Y {}\n" +
- " new Y() {\n" +
- " class Z {}\n" +
- " };\n" +
- " class W {\n" +
- " void bar() {\n" +
- " new W() {};\n" +
- " }\n" +
- " }\n" +
- " new Object() {\n" +
- " class U {\n" +
- " U(String s) {\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " class V {\n" +
- " V(String s) {\n" +
- " }\n" +
- " }\n" +
- "}"
- };
- addLibrary("innerClasses.jar", "innerClassessrc.zip", pathAndContents, JavaScriptCore.VERSION_1_4);
- IFile jar = getFile("/AttachSourceTests/innerClasses.jar");
- this.innerClasses = this.currentProject.getPackageFragmentRoot(jar).getPackageFragment("inner");
-}
-protected void tearDown() throws Exception {
- IPackageFragmentRoot[] roots = this.currentProject.getAllPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- IPackageFragmentRoot root = roots[i];
- if (this.genericType != null && root.equals(this.genericType.getPackageFragment().getParent())) continue;
- if (this.innerClasses != null && root.equals(this.innerClasses.getParent())) continue;
- if (root.getKind() == IPackageFragmentRoot.K_BINARY) {
- this.attachSource(root, null, null); // detach source
- }
- }
- super.tearDown();
-}
-
-/**
- * Reset the jar placeholder and delete project.
- */
-public void tearDownSuite() throws Exception {
- deleteProject(this.currentProject);
- super.tearDownSuite();
-}
-
-/**
- * Test AST.parseCompilationUnit(IClassFile, boolean).
- */
-public void testASTParsing() throws JavaScriptModelException {
- this.attachSource(this.pkgFragmentRoot, "/AttachSourceTests/attachsrc.zip", "");
- IClassFile classFile = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- ASTNode node = runConversion(classFile, true);
- assertNotNull("No node", node);
- this.attachSource(this.pkgFragmentRoot, null, null);
- IClassFile cf = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- assertTrue("source code should no longer exist for A", cf.getSource() == null);
- try {
- node = runConversion(classFile, true);
- assertTrue("Should not be here", false);
- } catch(IllegalStateException e) {
- assertTrue(true);
- }
-}
-/**
- * Test AST.parseCompilationUnit(IClassFile, boolean).
- * Test for http://bugs.eclipse.org/bugs/show_bug.cgi?id=30471
- */
-public void testASTParsing2() throws JavaScriptModelException {
- this.attachSource(this.pkgFragmentRoot, "/AttachSourceTests/attachsrc.zip", "");
- IClassFile classFile = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- ASTNode node = runConversion(classFile, false);
- assertNotNull("No node", node);
- this.attachSource(this.pkgFragmentRoot, null, null);
- IClassFile cf = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- assertTrue("source code should no longer exist for A", cf.getSource() == null);
- try {
- node = runConversion(classFile, false);
- assertTrue("Should not be here", false);
- } catch(IllegalStateException e) {
- assertTrue(true);
- }
-}
-/**
- * Changing the source attachment file should update the java model.
- * (regression test for bug 23292 Must restart Eclipse after debug of source in .zip is updated)
- */
-public void testChangeSourceAttachmentFile() throws CoreException {
- IClassFile cf = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- IFunction method = cf.getType().getFunction("foo", new String[] {});
-
- // check initial source
- assertSourceEquals(
- "unexpected initial source for foo()",
- "public void foo() {\n" +
- " }",
- method.getSource());
-
- // replace source attachment file
- this.swapFiles("AttachSourceTests/attachsrc.zip", "AttachSourceTests/attachsrc.new.zip");
- assertSourceEquals(
- "unexpected source for foo() after replacement",
- "public void foo() {\n" +
- " System.out.println(\"foo\");\n" +
- " }",
- method.getSource());
-
- // delete source attachment file
- this.deleteFile("AttachSourceTests/attachsrc.zip");
- assertSourceEquals(
- "unexpected source for foo() after deletion",
- null,
- method.getSource());
-
- // add source attachment file back
- this.moveFile("AttachSourceTests/attachsrc.new.zip", "AttachSourceTests/attachsrc.zip");
- assertSourceEquals(
- "unexpected source for foo() after addition",
- "public void foo() {\n" +
- " }",
- method.getSource());
-}
-/**
- * Ensure that a class file with an attached source can retrieve its children given a source index.
- */
-public void testClassFileGetElementAt01() throws JavaScriptModelException {
- IClassFile classFile = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- String source = classFile.getSource();
- IJavaScriptElement element = classFile.getElementAt(source.indexOf("class A"));
- assertElementEquals(
- "Unexpected element",
- "A [in A.class [in x.y [in attach.jar [in AttachSourceTests]]]]",
- element);
-}
-/**
- * Ensure that a class file with an attached source can retrieve its children given a source index.
- */
-public void testClassFileGetElementAt02() throws JavaScriptModelException {
- IClassFile classFile = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- String source = classFile.getSource();
- IJavaScriptElement element = classFile.getElementAt(source.indexOf("public A"));
- assertElementEquals(
- "Unexpected element",
- "A() [in A [in A.class [in x.y [in attach.jar [in AttachSourceTests]]]]]",
- element);
-}
-/**
- * Ensure that a class file with an attached source can retrieve its children given a source index.
- */
-public void testClassFileGetElementAt03() throws JavaScriptModelException {
- IClassFile classFile = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- String source = classFile.getSource();
- IJavaScriptElement element = classFile.getElementAt(source.indexOf("void foo"));
- assertElementEquals(
- "Unexpected element",
- "foo() [in A [in A.class [in x.y [in attach.jar [in AttachSourceTests]]]]]",
- element);
-}
-/*
- * Ensure that a constructor of a binary member type can be retrieved with its source position.
- * (regression test for bug 119249 codeResolve, search, etc. don't work on constructor of binary inner class)
- */
-public void testClassFileGetElementAt04() throws JavaScriptModelException {
- IClassFile classFile = this.innerClasses.getClassFile("X$V.class");
- String source = classFile.getSource();
- IJavaScriptElement element = classFile.getElementAt(source.indexOf("V(String s)"));
- assertElementEquals(
- "Unexpected element",
- "V(inner.X, java.lang.String) [in V [in X$V.class [in inner [in innerClasses.jar [in AttachSourceTests]]]]]",
- element);
-}/*
- * Ensures that the source of a .class file is implicetely attached when prj=src=bin
- * (regression test for bug 41444 [navigation] error dialog on opening class file)
- */
-public void testClassFileInOutput() throws CoreException {
- IClassFile classFile = getClassFile("AttachSourceTests/src/A.class");
- String source = classFile.getSource();
- assertSourceEquals(
- "Unexpected source",
- "public class A {\n" +
- "}",
- source);
-}
-/**
- * Retrieves the source code for "A.class", which is
- * the entire CU for "A.js".
- */
-public void testClassRetrieval() throws JavaScriptModelException {
- IClassFile objectCF = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- assertTrue("source code does not exist for the entire attached compilation unit", objectCF.getSource() != null);
-}
-/**
- * Removes the source attachment from the jar.
- */
-public void testDetachSource() throws JavaScriptModelException {
- this.attachSource(this.pkgFragmentRoot, null, null);
- IClassFile cf = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- assertTrue("source code should no longer exist for A", cf.getSource() == null);
- assertTrue("name range should no longer exist for A", cf.getType().getNameRange().getOffset() == -1);
- assertTrue("source range should no longer exist for A", cf.getType().getSourceRange().getOffset() == -1);
- assertTrue("Source attachment path should be null", null == this.pkgFragmentRoot.getSourceAttachmentPath());
- assertTrue("Source attachment root path should be null", null ==this.pkgFragmentRoot.getSourceAttachmentRootPath());
-}
-/*
- * Ensures that the source of a generic method can be retrieved.
- */
-public void testGeneric1() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"QX<QT;>;"});
- assertSourceEquals(
- "Unexpected source",
- "void foo(X<T> x) {\n" +
- " }",
- method.getSource());
-}
-/*
- * Ensures that the source of a generic method can be retrieved.
- */
-public void testGeneric2() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"QK;", "QV;"});
- assertSourceEquals(
- "Unexpected source",
- "<K, V> V foo(K key, V value) {\n" +
- " return value;\n" +
- " }",
- method.getSource());
-}
-/*
- * Ensures that the source of a generic method can be retrieved.
- * (regression test for bug 129317 Outline view inconsistent with code
- */
-public void testGeneric3() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"I", "Lgeneric.X<[Ljava.lang.Object;>;"});
- assertSourceEquals(
- "Unexpected source",
- "void foo(int i, X<Object[]> x) {\n" +
- " }",
- method.getSource());
-}
-public void testGeneric4() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"Z", "Lgeneric.X<+Lgeneric.X;>;"});
- assertSourceEquals(
- "Unexpected source",
- "void foo(boolean b, X<? extends X> x) {\n" +
- " }",
- method.getSource());
-}
-public void testGeneric5() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"F", "Lgeneric.X<*>;"});
- assertSourceEquals(
- "Unexpected source",
- "void foo(float f, X<?> x) {\n" +
- " }",
- method.getSource());
-}
-public void testGeneric6() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"Lgeneric.Y<+Ljava.lang.Integer;+Ljava.lang.Object;>;"});
- assertSourceEquals(
- "Unexpected source",
- "void foo(Y<? extends Integer, ? extends Object> y) {\n" +
- " }",
- method.getSource());
-}
-public void testGeneric7() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"Lgeneric.Z.Inner<Ljava.lang.Object;>;"});
- assertSourceEquals(
- "Unexpected source",
- "void foo(Z.Inner<Object> inner) {\n" +
- " }",
- method.getSource());
-}
-public void testGeneric8() throws JavaScriptModelException {
- IFunction method = this.genericType.getFunction("foo", new String[] {"Lgeneric.AType<Ljava.lang.Object;>;"});
- assertSourceEquals(
- "Unexpected source",
- "void foo(AType<Object> t) {\n" +
- " }",
- method.getSource());
-}
-/**
- * Ensures that name ranges exists for BinaryMembers that have
- * mapped source.
- */
-public void testGetNameRange01() throws JavaScriptModelException {
- IClassFile classFile = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- IFunction method = classFile.getType().getFunction("foo", null);
- assertSourceEquals("Unexpected name source", "foo", getNameSource(classFile.getSource(), method));
-}
-/**
- * Ensures that name ranges exists for BinaryMembers that have
- * mapped source.
- */
-public void testGetNameRange02() throws JavaScriptModelException {
- IClassFile classFile = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- assertSourceEquals("Unexpected name source", "A", getNameSource(classFile.getSource(), classFile.getType()));
-}
-/*
- * Ensure that the name range for a constructor of a binary member type is correct.
- * (regression test for bug 119249 codeResolve, search, etc. don't work on constructor of binary inner class)
- */
-public void testGetNameRange03() throws JavaScriptModelException {
- IClassFile classFile = this.innerClasses.getClassFile("X$V.class");
- IFunction constructor = classFile.getType().getFunction("V", new String[] {"Linner.X;", "Ljava.lang.String;"});
- assertSourceEquals("Unexpected name source", "V", getNameSource(classFile.getSource(), constructor));
-}
-/**
- * Retrieves the source attachment paths for jar root.
- */
-public void testGetSourceAttachmentPath() throws JavaScriptModelException {
- IPath saPath= this.pkgFragmentRoot.getSourceAttachmentPath();
- assertEquals("Source attachment path not correct for root " + this.pkgFragmentRoot, "/AttachSourceTests/attachsrc.zip", saPath.toString());
- assertEquals("Source attachment root path should be empty", new Path(""), this.pkgFragmentRoot.getSourceAttachmentRootPath());
-}
-/**
- * Ensures that a source range exists for the class file that has
- * mapped source.
- */
-public void testGetSourceRange() throws JavaScriptModelException {
- IClassFile cf = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- ISourceRange sourceRange = cf.getSourceRange();
- assertTrue("Class file should have associated source range", sourceRange != null);
- assertEquals("Unexpected offset", 0, sourceRange.getOffset());
- assertEquals("Unexpected length", 100, sourceRange.getLength());
-}
-/**
- * Ensures that a source range exists for the (inner) class file that has
- * mapped source.
- */
-public void testGetSourceRangeInnerClass() throws JavaScriptModelException {
- IClassFile cf = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A$Inner.class");
- ISourceRange sourceRange = cf.getSourceRange();
- assertTrue("Inner class file should have associated source range", sourceRange != null);
- assertEquals("Unexpected offset", 0, sourceRange.getOffset());
- assertEquals("Unexpected length", 100, sourceRange.getLength());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass1() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "public class X {\n" +
- " void foo() {\n" +
- " new X() {};\n" +
- " class Y {}\n" +
- " new Y() {\n" +
- " class Z {}\n" +
- " };\n" +
- " class W {\n" +
- " void bar() {\n" +
- " new W() {};\n" +
- " }\n" +
- " }\n" +
- " new Object() {\n" +
- " class U {\n" +
- " U(String s) {\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- " class V {\n" +
- " V(String s) {\n" +
- " }\n" +
- " }\n" +
- "}",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass2() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$1.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "X() {}",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass3() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$2.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "Y() {\n" +
- " class Z {}\n" +
- " }",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass4() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$3.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "W() {}",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass5() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$1$Y.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "class Y {}",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass6() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$1$W.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "class W {\n" +
- " void bar() {\n" +
- " new W() {};\n" +
- " }\n" +
- " }",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass7() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$2$Z.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "class Z {}",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- */
-public void testInnerClass8() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$V.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "class V {\n" +
- " V(String s) {\n" +
- " }\n" +
- " }",
- type.getSource());
-}
-/*
- * Ensures that the source of an inner class can be retrieved.
- * (regression test for bug 124611 IAE in Signature.createCharArrayTypeSignature)
- */
-public void testInnerClass9() throws JavaScriptModelException {
- IType type = this.innerClasses.getClassFile("X$4$U.class").getType();
- assertSourceEquals(
- "Unexpected source",
- "class U {\n" +
- " U(String s) {\n" +
- " }\n" +
- " }",
- type.getSource());
-}
-
-/**
- * Ensures that a source folder can be attached to a lib folder.
- */
-public void testLibFolder() throws JavaScriptModelException {
- IPackageFragmentRoot root = this.getPackageFragmentRoot("/AttachSourceTests/lib");
- this.attachSource(root, "/AttachSourceTests/srcLib", "");
-
- IClassFile cf = root.getPackageFragment("p").getClassFile("X.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}",
- cf.getSource());
-}
-/**
- * Retrieves the source code for methods of class A.
- */
-public void testMethodRetrieval() throws JavaScriptModelException {
- IClassFile cf = this.pkgFragmentRoot.getPackageFragment("x.y").getClassFile("A.class");
- IFunction[] methods = cf.getType().getFunctions();
- for (int i = 0; i < methods.length; i++) {
- IFunction method = methods[i];
- assertTrue("source code does not exist for the method " + method, method.getSource() != null);
- assertTrue("method name range not correct", method.getNameRange().getOffset() != -1 && method.getNameRange().getLength() != 0);
- }
-}
-/**
- * Closes the jar, to ensure when it is re-opened the source
- * attachment still exists.
- */
-public void testPersistence() throws JavaScriptModelException {
- this.pkgFragmentRoot.close();
- testClassRetrieval();
- testMethodRetrieval();
-}
-
-/*
- * Ensures that having a project as a class folder and attaching its sources finds the source
- * of a class in a non-default package.
- * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=65186)
- */
-public void testProjectAsClassFolder1() throws CoreException {
- try {
- createJavaProject("P1");
- createFolder("/P1/p");
- createFile(
- "/P1/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- "}"
- );
- IProject p1 = getProject("P1");
- p1.build(IncrementalProjectBuilder.FULL_BUILD, null);
- IJavaScriptProject javaProject = createJavaProject("P2", new String[]{""}, new String[]{"/P1"});
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(p1);
- attachSource(root, "/P1", null);
- IClassFile cf = root.getPackageFragment("p").getClassFile("X.class");
- assertSourceEquals(
- "Unexpected source for class file P1/p/X.class",
- "package p;\n" +
- "public class X {\n" +
- "}",
- cf.getSource());
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/*
- * Ensures that having a project as a class folder and attaching its sources finds the source
- * of a class in the default package.
- * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=65186)
- */
-public void testProjectAsClassFolder2() throws CoreException {
- try {
- createJavaProject("P1");
- createFile(
- "/P1/X.js",
- "public class X {\n" +
- "}"
- );
- IProject p1 = getProject("P1");
- p1.build(IncrementalProjectBuilder.FULL_BUILD, null);
- IJavaScriptProject javaProject = createJavaProject("P2", new String[]{""}, new String[]{"/P1"});
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(p1);
- attachSource(root, "/P1", null);
- IClassFile cf = root.getPackageFragment("").getClassFile("X.class");
- assertSourceEquals(
- "Unexpected source for class file P1/X.class",
- "public class X {\n" +
- "}",
- cf.getSource());
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/*
- * Ensures that having a project as source attachement finds the source
- * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=65186)
- */
-public void testProjectAsSourceAttachment() throws CoreException {
- try {
- IJavaScriptProject javaProject = createJavaProject("Test", new String[]{""}, new String[]{"/AttachSourceTests/test.jar"});
- createFolder("/Test/test1");
- createFile("/Test/test1/Test.js",
- "package test1;\n" +
- "\n" +
- "public class Test {}");
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(getFile("/AttachSourceTests/test.jar"));
- attachSource(root, "/Test", null);
- IClassFile cf = root.getPackageFragment("test1").getClassFile("Test.class");
- assertSourceEquals(
- "Unexpected source for class file test1/Test.class",
- "package test1;\n" +
- "\n" +
- "public class Test {}",
- cf.getSource());
- } finally {
- deleteProject("Test");
- }
-}
-
-///**
-// * Attaches a source zip to a jar. The source zip has
-// * a nested root structure and exists as a resource. Tests that
-// * the attachment is persisted as a server property for the jar.
-// */
-//public void testRootPath() throws JavaScriptModelException {
-// IJavaScriptProject project = getJavaProject("AttachSourceTests");
-// IFile jar = (IFile) project.getProject().findMember("attach2.jar");
-// IFile srcZip=(IFile) project.getProject().findMember("attach2src.zip");
-// JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar);
-// root.attachSource(srcZip.getFullPath(), new Path("src/nested"), null);
-//
-// IClassFile cf = root.getPackageFragment("x.y").getClassFile("B.class");
-// assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
-// root.close();
-// cf = root.getPackageFragment("x.y").getClassFile("B.class");
-// assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
-//
-// IPath rootSAPath= root.getSourceAttachmentRootPath();
-// assertEquals("Unexpected source attachment root path for " + root.getPath(), "src/nested", rootSAPath.toString());
-//
-// IPath saPath= root.getSourceAttachmentPath();
-// assertEquals("Unexpected source attachment path for " + root.getPath(), "/AttachSourceTests/attach2src.zip", saPath.toString());
-//
-// root.close();
-//}
-///**
-// * Attaches a source zip to a jar specifying an invalid root path.
-// * Ensures that the root path is just used as a hint, and that the source is still retrieved.
-// */
-//public void testRootPath2() throws JavaScriptModelException {
-// IJavaScriptProject project = getJavaProject("AttachSourceTests");
-// IFile jar = (IFile) project.getProject().findMember("attach2.jar");
-// IFile srcZip=(IFile) project.getProject().findMember("attach2src.zip");
-// JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar);
-// root.attachSource(srcZip.getFullPath(), new Path(""), null);
-//
-// IClassFile cf = root.getPackageFragment("x.y").getClassFile("B.class");
-// assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
-// root.close();
-//}
-///**
-// * Attaches a sa source folder can be attached to a lib folder specifying an invalid root path.
-// * Ensures that the root path is just used as a hint, and that the source is still retrieved.
-// */
-//public void testRootPath3() throws JavaScriptModelException {
-// IPackageFragmentRoot root = this.getPackageFragmentRoot("/AttachSourceTests/lib");
-// this.attachSource(root, "/AttachSourceTests/srcLib", "invalid");
-//
-// IClassFile cf = root.getPackageFragment("p").getClassFile("X.class");
-// assertSourceEquals(
-// "Unexpected source for class file",
-// "package p;\n" +
-// "public class X {\n" +
-// " public void foo() {\n" +
-// " }\n" +
-// "}",
-// cf.getSource());
-// root.close();
-//}
-/**
- * Attach a jar with a source attachement that doesn't contain the source folders
- */
-public void testRootPath4() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/test.jar"));
- this.attachSource(root, "/AttachSourceTests/src.zip", "invalid");
-
- IClassFile cf = root.getPackageFragment("test1").getClassFile("Test.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package test1;\n" +
- "\n" +
- "public class Test {}",
- cf.getSource());
- root.close();
-}
-/**
- * Attach a jar with a source attachement that doesn't contain the source folders
- */
-public void testRootPath5() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/update.jar"));
- this.attachSource(root, "/AttachSourceTests/src.zip", "invalid");
-
- IClassFile cf = root.getPackageFragment("p1.p2").getClassFile("A.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p1.p2;\n" +
- "\n" +
- "public class A {}",
- cf.getSource());
-
- cf = root.getPackageFragment("").getClassFile("B.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "public class B {}",
- cf.getSource());
-
- this.attachSource(root, null, null); // detach source
- root.close();
-}
-/**
- * Attach a jar with a source attachement that doesn't contain the source folders
- */
-public void testRootPath6() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/update.jar"));
- this.attachSource(root, "/AttachSourceTests/src.zip", null);
-
- IClassFile cf = root.getPackageFragment("p1.p2").getClassFile("A.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p1.p2;\n" +
- "\n" +
- "public class A {}",
- cf.getSource());
-
- cf = root.getPackageFragment("").getClassFile("B.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "public class B {}",
- cf.getSource());
-
- this.attachSource(root, null, null); // detach source
- root.close();
-}
-/**
- * Attach a jar with a source attachement that doesn't contain the source folders
- */
-public void testRootPath7() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/full.jar"));
- this.attachSource(root, "/AttachSourceTests/src.zip", null);
-
- IClassFile cf = root.getPackageFragment("p1.p2").getClassFile("A.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p1.p2;\n" +
- "\n" +
- "public class A {}",
- cf.getSource());
-
- cf = root.getPackageFragment("").getClassFile("B.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "public class B {}",
- cf.getSource());
-
- cf = root.getPackageFragment("test1").getClassFile("Test.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package test1;\n" +
- "\n" +
- "public class Test {}",
- cf.getSource());
-
- this.attachSource(root, null, null); // detach source
- root.close();
-}
-/**
- * Attach a jar with a source attachement that contains the source folders
- */
-public void testRootPath8() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/full.jar"));
- this.attachSource(root, "/AttachSourceTests/fullsrc.zip", null);
-
- IClassFile cf = root.getPackageFragment("p1.p2").getClassFile("A.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p1.p2;\n" +
- "\n" +
- "public class A {}",
- cf.getSource());
-
- cf = root.getPackageFragment("").getClassFile("B.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "public class B {}",
- cf.getSource());
-
- cf = root.getPackageFragment("test1").getClassFile("Test.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package test1;\n" +
- "\n" +
- "public class Test {}",
- cf.getSource());
-
- this.attachSource(root, null, null); // detach source
- root.close();
-}
-/**
- * Attach a jar with a source attachement that contains the source folders
- */
-public void testRootPath9() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/full.jar"));
- this.attachSource(root, "/AttachSourceTests/fullsrc.zip", "invalid");
-
- IClassFile cf = root.getPackageFragment("p1.p2").getClassFile("A.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p1.p2;\n" +
- "\n" +
- "public class A {}",
- cf.getSource());
-
- cf = root.getPackageFragment("").getClassFile("B.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "public class B {}",
- cf.getSource());
-
- cf = root.getPackageFragment("test1").getClassFile("Test.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package test1;\n" +
- "\n" +
- "public class Test {}",
- cf.getSource());
-
- this.attachSource(root, null, null); // detach source
- root.close();
-}
-/**
- * Attach a jar with a source attachement that is itself
- */
-public void testRootPath10() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/test2.jar"));
- this.attachSource(root, "/AttachSourceTests/test2.jar", null);
-
- IClassFile cf = root.getPackageFragment("p").getClassFile("X.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p;\n" +
- "\n" +
- "public class X {\n" +
- "\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}",
- cf.getSource());
- this.attachSource(root, null, null); // detach source
- root.close();
-}
-///**
-// * http://bugs.eclipse.org/bugs/show_bug.cgi?id=35965
-// */
-//public void testRootPath11() throws JavaScriptModelException {
-// IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
-// IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/test4.jar"));
-// this.attachSource(root, "/AttachSourceTests/test4_src.zip", null);
-//
-// IClassFile cf = root.getPackageFragment("P1").getClassFile("D.class");
-// assertSourceEquals(
-// "Unexpected source for class file P1.D",
-// "package P1;\n" +
-// "\n" +
-// "public class D {}",
-// cf.getSource());
-//
-// cf = root.getPackageFragment("P1.p2").getClassFile("A.class");
-// assertSourceEquals(
-// "Unexpected source for class file P1.p2.A",
-// "package P1.p2;\n" +
-// "\n" +
-// "public class A {}",
-// cf.getSource());
-//
-// assertTrue("Not a binary root", root.getKind() == IPackageFragmentRoot.K_BINARY);
-// assertEquals("wrong jdk level", ClassFileConstants.JDK1_2, Util.getJdkLevel(root.getResource()));
-// this.attachSource(root, null, null); // detach source
-// root.close();
-//}
-/**
- * Attach a jar with a source attachement that is itself. The jar contains 2 root paths for the same class file.
- * (regression test for bug 74014 prefix path for source attachements - automatic detection does not seem to work)
- */
-public void testRootPath12() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/test5.jar"));
- attachSource(root, "/AttachSourceTests/test5.jar", null);
-
- IClassFile cf = root.getPackageFragment("p1.p2").getClassFile("X.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p1.p2;\n" +
- "public class X {\n" +
- "}\n",
- cf.getSource());
- attachSource(root, null, null); // detach source
- root.close();
-}
-/**
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=110172"
- */
-public void testBug110172() throws JavaScriptModelException {
- IJavaScriptProject project = this.getJavaProject("/AttachSourceTests");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(this.getFile("/AttachSourceTests/test6.jar"));
- assertTrue("Root doesn't exist", root.exists());
- attachSource(root, "/AttachSourceTests/test6src.zip", null);
-
- try {
- // check the javadoc source range in a class file
- IClassFile cf = root.getPackageFragment("p1.p2").getClassFile("X.class");
- assertNotNull(cf);
- final String source = cf.getSource();
- assertNotNull("No source", source);
- IJavaScriptElement[] children = cf.getChildren();
- assertEquals("Wrong number of children", 1, children.length);
- IJavaScriptElement element = children[0];
- assertTrue("Not a type", element instanceof IType);
- IType type = (IType) element;
- IJavaScriptElement[] members = type.getChildren();
- final int length = members.length;
- assertEquals("Wrong number", 9, length);
- for (int i = 0; i < length; i++) {
- element = members[i];
- assertTrue(element instanceof IMember);
- final ISourceRange javadocRange = ((IMember) element).getJSdocRange();
- final String elementName = element.getElementName();
- if ("f".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("field f") != -1);
- } else if ("foo".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("method foo") != -1);
- } else if ("A".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("member type A") != -1);
- } else if ("X".equals(elementName)) {
- // need treatment for the two constructors
- assertTrue("Not an IFunction", element instanceof IFunction);
- IFunction method = (IFunction) element;
- switch(method.getNumberOfParameters()) {
- case 0 :
- assertNull("Has a javadoc source range", javadocRange);
- break;
- case 1:
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("constructor") != -1);
- }
- } else if ("f3".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("Real") != -1);
- } else if ("f2".equals(elementName)) {
- assertNull("Has a javadoc source range", javadocRange);
- } else if ("foo2".equals(elementName)) {
- assertNull("Has a javadoc source range", javadocRange);
- } else if ("B".equals(elementName)) {
- assertNull("Has a javadoc source range", javadocRange);
- }
- }
- } finally {
- attachSource(root, null, null); // detach source
- root.close();
- }
-}
-/**
- * @test bug 153133: [model] toggle breakpoint in constructor creates a class load breakpoint
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=153133"
- */
-public void testBug153133() throws JavaScriptModelException {
- IPackageFragmentRoot root = this.currentProject.getPackageFragmentRoot(this.getFile("/AttachSourceTests/b153133.jar"));
- assertTrue("Root doesn't exist", root.exists());
-
- try {
- // Get class file type from jar
- IClassFile cf = root.getPackageFragment("test").getClassFile("Test.class");
- assertNotNull(cf);
- final String source = cf.getSource();
- assertNotNull("No source", source);
- IJavaScriptElement[] children = cf.getChildren();
- assertEquals("Wrong number of children", 1, children.length);
- IJavaScriptElement element = children[0];
- assertTrue("Not a type", element instanceof IType);
- IType type = (IType) element;
- IJavaScriptElement[] members = type.getChildren();
- final int length = members.length;
- assertEquals("Wrong number", 7, length);
-
- // Need to get type members constructors
- for (int i = 0; i < length; i++) {
- assertTrue(members[i] instanceof IMember);
- if (((IMember)members[i]).getElementType() == IJavaScriptElement.TYPE) {
- IType typeMember = (IType) members[i];
- String typeName = typeMember.getElementName();
- IFunction[] methods = typeMember.getFunctions();
- assertEquals("Expected only one constructor defined in type "+typeName, 1, methods.length);
- // Verify that source range is valid
- assertTrue("Expected a constructor instead of a method in type "+typeName, methods[0].isConstructor());
- IFunction constructor = methods[0];
- ISourceRange sourceRange = constructor.getSourceRange();
- assertTrue("Constructor "+constructor.getElementName()+" has invalid offset: "+sourceRange, sourceRange.getOffset() >= 0);
- assertTrue("Constructor "+constructor.getElementName()+" has invalid length: "+sourceRange, sourceRange.getLength() > 0);
- }
- }
- } finally {
- removeLibraryEntry(new Path("/JavaSearchBugs/lib/b148215.jar"));
- root.close();
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachedJavadocTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachedJavadocTests.java
deleted file mode 100644
index 549f6ca..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachedJavadocTests.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-
-public class AttachedJavadocTests extends ModifyingResourceTests {
- static {
-// TESTS_NAMES = new String[] { "test010" };
-// TESTS_NUMBERS = new int[] { 20 };
-// TESTS_RANGE = new int[] { 169, 180 };
- }
-
- public static Test suite() {
- return buildModelTestSuite(AttachedJavadocTests.class);
- }
-
- private IJavaScriptProject project;
- private IPackageFragmentRoot root;
-
- public AttachedJavadocTests(String name) {
- super(name);
- }
-
- /**
- * Create project and set the jar placeholder.
- */
- public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- this.project = setUpJavaProject("AttachedJavadocProject", "1.5"); //$NON-NLS-1$
- Map options = this.project.getOptions(true);
- options.put(JavaScriptCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "2000"); //$NON-NLS-1$
- this.project.setOptions(options);
- IIncludePathEntry[] entries = this.project.getRawIncludepath();
- IResource resource = this.project.getProject().findMember("/doc/"); //$NON-NLS-1$
- assertNotNull("doc folder cannot be null", resource); //$NON-NLS-1$
- URI locationURI = resource.getLocationURI();
- assertNotNull("doc folder cannot be null", locationURI); //$NON-NLS-1$
- URL docUrl = null;
- try {
- docUrl = locationURI.toURL();
- } catch (MalformedURLException e) {
- assertTrue("Should not happen", false); //$NON-NLS-1$
- } catch(IllegalArgumentException e) {
- assertTrue("Should not happen", false); //$NON-NLS-1$
- }
- IIncludePathAttribute attribute = JavaScriptCore.newIncludepathAttribute(IIncludePathAttribute.JSDOC_LOCATION_ATTRIBUTE_NAME, docUrl.toExternalForm());
- for (int i = 0, max = entries.length; i < max; i++) {
- final IIncludePathEntry entry = entries[i];
- if (entry.getEntryKind() == IIncludePathEntry.CPE_LIBRARY
- && entry.getContentKind() == IPackageFragmentRoot.K_BINARY
- && "/AttachedJavadocProject/lib/test6.jar".equals(entry.getPath().toString())) { //$NON-NLS-1$
- entries[i] = JavaScriptCore.newLibraryEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), new IIncludePathAttribute[] { attribute}, entry.isExported());
- }
- }
- project.setRawIncludepath(entries, null);
-
- IPackageFragmentRoot[] roots = this.project.getAllPackageFragmentRoots();
- int count = 0;
- for (int i = 0, max = roots.length; i < max; i++) {
- final IPackageFragmentRoot packageFragmentRoot = roots[i];
- switch(packageFragmentRoot.getKind()) {
- case IPackageFragmentRoot.K_BINARY :
- if (!packageFragmentRoot.isExternal()) {
- count++;
- if (root == null) {
- root = packageFragmentRoot;
- }
- }
- }
- }
- assertEquals("Wrong value", 1, count); //$NON-NLS-1$
- assertNotNull("Should not be null", root); //$NON-NLS-1$
- }
-
- /**
- * Reset the jar placeholder and delete project.
- */
- public void tearDownSuite() throws Exception {
- this.deleteProject("AttachedJavadocProject"); //$NON-NLS-1$
- this.root = null;
- this.project = null;
- super.tearDownSuite();
- }
-
- // test javadoc for a package fragment
- public void test001() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- String javadoc = packageFragment.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- }
-
- // for a class file
- public void test002() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- String javadoc = classFile.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- }
-
- // for a field
- public void test003() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IField field = type.getField("f"); //$NON-NLS-1$
- assertNotNull(field);
- String javadoc = field.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- }
-
- // for a method
- public void test004() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction method = type.getFunction("foo", new String[] {"I", "J", "Ljava.lang.String;"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- assertTrue(method.exists());
- String javadoc = method.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- String[] paramNames = method.getParameterNames();
- assertNotNull(paramNames);
- assertEquals("Wrong size", 3, paramNames.length); //$NON-NLS-1$
- assertEquals("Wrong name for first param", "i", paramNames[0]); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong name for second param", "l", paramNames[1]); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Wrong name for third param", "s", paramNames[2]); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // for a constructor
- public void test005() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction method = type.getFunction("X", new String[] {"I"}); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue(method.exists());
- String javadoc = method.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- String[] paramNames = method.getParameterNames();
- assertNotNull(paramNames);
- assertEquals("Wrong size", 1, paramNames.length); //$NON-NLS-1$
- assertEquals("Wrong name for first param", "i", paramNames[0]); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // for a member type
- public void test006() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X$A.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- String javadoc = classFile.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- }
-
- // for a constructor
- public void test007() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X$A.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction method = type.getFunction("A", new String[] {"Lp1.p2.X;", "F"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- assertTrue(method.exists());
- String javadoc = method.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- String[] paramNames = method.getParameterNames();
- assertNotNull(paramNames);
- assertEquals("Wrong size", 1, paramNames.length); //$NON-NLS-1$
- assertEquals("Wrong name for first param", "f", paramNames[0]); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // for a method foo2
- public void test008() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction method = type.getFunction("foo2", new String[0]); //$NON-NLS-1$
- assertTrue(method.exists());
- String javadoc = method.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- String[] paramNames = method.getParameterNames();
- assertNotNull(paramNames);
- assertEquals("Wrong size", 0, paramNames.length); //$NON-NLS-1$
- }
-
- // for a field f2
- public void test009() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IField field = type.getField("f2"); //$NON-NLS-1$
- assertNotNull(field);
- String javadoc = field.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- }
-
- // test archive doc
- public void test010() throws JavaScriptModelException {
- IIncludePathEntry[] savedEntries = null;
- try {
- IIncludePathEntry[] entries = this.project.getRawIncludepath();
- savedEntries = (IIncludePathEntry[]) entries.clone();
- IResource resource = this.project.getProject().findMember("/doc.zip"); //$NON-NLS-1$
- assertNotNull("doc folder cannot be null", resource); //$NON-NLS-1$
- URI locationURI = resource.getLocationURI();
- assertNotNull("doc folder cannot be null", locationURI); //$NON-NLS-1$
- URL docUrl = null;
- try {
- docUrl = locationURI.toURL();
- } catch (MalformedURLException e) {
- assertTrue("Should not happen", false); //$NON-NLS-1$
- } catch(IllegalArgumentException e) {
- assertTrue("Should not happen", false); //$NON-NLS-1$
- }
- final String path = "jar:" + docUrl.toExternalForm() + "!/doc"; //$NON-NLS-1$ //$NON-NLS-2$
- //final String path = "jar:" + "platform:/resource/AttachedJavadocProject/doc.zip" + "!/doc";
- IIncludePathAttribute attribute = JavaScriptCore.newIncludepathAttribute(IIncludePathAttribute.JSDOC_LOCATION_ATTRIBUTE_NAME, path);
- for (int i = 0, max = entries.length; i < max; i++) {
- final IIncludePathEntry entry = entries[i];
- if (entry.getEntryKind() == IIncludePathEntry.CPE_LIBRARY
- && entry.getContentKind() == IPackageFragmentRoot.K_BINARY
- && "/AttachedJavadocProject/lib/test6.jar".equals(entry.getPath().toString())) { //$NON-NLS-1$
- entries[i] = JavaScriptCore.newLibraryEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), new IIncludePathAttribute[] { attribute }, entry.isExported());
- }
- }
- this.project.setRawIncludepath(entries, null);
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IField field = type.getField("f"); //$NON-NLS-1$
- assertNotNull(field);
- String javadoc = field.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- } finally {
- // restore classpath
- if (savedEntries != null) {
- this.project.setRawIncludepath(savedEntries, null);
- }
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=120597
- public void test011() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("Z.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IField field = type.getField("out"); //$NON-NLS-1$
- assertNotNull(field);
- String javadoc = field.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=120637
- public void test012() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("Z.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- String javadoc = classFile.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- assertTrue("Should not contain reference to out", javadoc.indexOf("out") == -1);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=120559
- public void test013() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("W.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- String javadoc = classFile.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNull("Should not have a javadoc", javadoc); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=120637
- public void test014() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("E.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- String javadoc = classFile.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- assertTrue("Should not contain reference to Constant C", javadoc.indexOf("Constant C") == -1);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=120637
- public void test015() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("Annot.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- String javadoc = classFile.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- assertTrue("Should not contain reference to name", javadoc.indexOf("name") == -1);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=120847
- public void test016() throws JavaScriptModelException {
- IIncludePathEntry[] savedEntries = null;
- try {
- IIncludePathEntry[] entries = this.project.getRawIncludepath();
- savedEntries = (IIncludePathEntry[]) entries.clone();
- IIncludePathAttribute attribute = JavaScriptCore.newIncludepathAttribute(IIncludePathAttribute.JSDOC_LOCATION_ATTRIBUTE_NAME, "invalid_path");
- for (int i = 0, max = entries.length; i < max; i++) {
- final IIncludePathEntry entry = entries[i];
- if (entry.getEntryKind() == IIncludePathEntry.CPE_LIBRARY
- && entry.getContentKind() == IPackageFragmentRoot.K_BINARY
- && "/AttachedJavadocProject/lib/test6.jar".equals(entry.getPath().toString())) { //$NON-NLS-1$
- entries[i] = JavaScriptCore.newLibraryEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), new IIncludePathAttribute[] { attribute }, entry.isExported());
- }
- }
- this.project.setRawIncludepath(entries, null);
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IField field = type.getField("f"); //$NON-NLS-1$
- assertNotNull(field);
- field.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertFalse("Should be unreachable", true);
- } catch(JavaScriptModelException e) {
- assertTrue("Must occur", true);
- assertEquals("Wrong error message", "Cannot retrieve the attached javadoc for invalid_path", e.getMessage());
- } finally {
- // restore classpath
- if (savedEntries != null) {
- this.project.setRawIncludepath(savedEntries, null);
- }
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=120875
- public void test017() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("Annot2.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- String javadoc = classFile.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- assertTrue("Should not contain reference to name2", javadoc.indexOf("name2") == -1);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=138167
- public void test018() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2/p3"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("C.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction[] methods = type.getFunctions();
- NullProgressMonitor monitor = new NullProgressMonitor();
- for (int i = 0, max = methods.length; i < max; i++) {
- IFunction method = methods[i];
- String javadoc = method.getAttachedJavadoc(monitor);
- assertNotNull("Should have a javadoc", javadoc);
- final String selector = method.getElementName();
- assertTrue("Wrong doc", javadoc.indexOf(selector) != -1);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=138167
- public void test019() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2/p3"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("C.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction method = type.getFunction("bar5", new String[] {"Ljava.util.Map<TK;TV;>;", "I", "Ljava.util.Map<TK;TV;>;"}); //$NON-NLS-1$
- assertTrue(method.exists());
- String javadoc = method.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- assertNotNull("Should have a javadoc", javadoc); //$NON-NLS-1$
- String[] names = method.getParameterNames();
- assertNotNull("No names", names);
- assertEquals("Wrong size", 3, names.length);
- assertEquals("Wrong parameter name", "m", names[0]);
- assertEquals("Wrong parameter name", "j", names[1]);
- assertEquals("Wrong parameter name", "m2", names[2]);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=139160
- public void test020() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("Z.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction method = type.getFunction("foo", new String[] {"I", "I"}); //$NON-NLS-1$
- assertTrue(method.exists());
- String javadoc = null;
- try {
- javadoc = method.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- } catch(JavaScriptModelException e) {
- assertTrue("Should not happen", false);
- }
- assertNull("Should not have a javadoc", javadoc); //$NON-NLS-1$
- String[] paramNames = method.getParameterNames();
- assertNotNull(paramNames);
- assertEquals("Wrong size", 2, paramNames.length); //$NON-NLS-1$
- assertEquals("Wrong name", "arg0", paramNames[0]); //$NON-NLS-1$
- assertEquals("Wrong name", "arg1", paramNames[1]); //$NON-NLS-1$
- }
-
- /*
- * Ensures that calling getAttachedJavadoc(...) on a binary method
- * has no side-effect on the underlying Java model cache.
- * (regression test for bug 140879 Spontaneous error "java.util.Set cannot be resolved...")
- */
- public void test021() throws CoreException, IOException {
- IJavaScriptUnit workingCopy = null;
- try {
- IPackageFragment p = this.root.getPackageFragment("p2");
- IType type = p.getClassFile("X.class").getType();
- IFunction method = type.getFunction("foo", new String[0]);
-
- // the following call should have no side-effect
- method.getAttachedJavadoc(null);
-
- // ensure no side-effect
- ProblemRequestor problemRequestor = new ProblemRequestor();
- workingCopy = getWorkingCopy(
- "/AttachedJavadocProject/src/Test.js",
- "import p2.Y;\n" +
- "public class Test extends Y { }",
- new WorkingCopyOwner() {},
- problemRequestor
- );
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n",
- problemRequestor);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- deleteProject("P");
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=149154
- public void test022() throws JavaScriptModelException {
- IPackageFragment packageFragment = this.root.getPackageFragment("p1/p2"); //$NON-NLS-1$
- assertNotNull("Should not be null", packageFragment); //$NON-NLS-1$
- IClassFile classFile = packageFragment.getClassFile("X.class"); //$NON-NLS-1$
- assertNotNull(classFile);
- IType type = classFile.getType();
- IFunction method = type.getFunction("access$1", new String[] {"Lp1.p2.X;", "I"}); //$NON-NLS-1$
- assertTrue(method.exists());
- String javadoc = null;
- try {
- javadoc = method.getAttachedJavadoc(new NullProgressMonitor()); //$NON-NLS-1$
- } catch(JavaScriptModelException e) {
- assertTrue("Should not happen", false);
- }
- assertNull("Should not have a javadoc", javadoc); //$NON-NLS-1$
- String[] paramNames = method.getParameterNames();
- assertNotNull(paramNames);
- assertEquals("Wrong size", 2, paramNames.length); //$NON-NLS-1$
- assertEquals("Wrong name", "arg0", paramNames[0]); //$NON-NLS-1$
- assertEquals("Wrong name", "arg1", paramNames[1]); //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BindingKeyTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BindingKeyTests.java
deleted file mode 100644
index 11a08b9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BindingKeyTests.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.wst.jsdt.core.BindingKey;
-
-import junit.framework.Test;
-
-public class BindingKeyTests extends AbstractJavaModelTests {
-
- static {
- }
-
- public BindingKeyTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(BindingKeyTests.class);
- }
-
- protected void assertBindingKeyEquals(String expected, String key) {
- if (!(expected.equals(key)))
- System.out.println(displayString(key, 3) + ",");
- assertEquals(expected, key);
- }
-
- protected void assertBindingKeySignatureEquals(String expected, String key) {
- BindingKey bindingKey = new BindingKey(key);
- String signature = bindingKey.toSignature();
- if (!(expected.equals(signature)))
- System.out.println(displayString(signature, 3) + ",");
- assertEquals(expected, signature);
- }
-
- /*
- * Package.
- */
- public void test001() {
- assertBindingKeySignatureEquals(
- "p",
- "p"
- );
- }
-
- /*
- * Top level type in non default package.
- */
- public void test002() {
- assertBindingKeySignatureEquals(
- "Lp.X;",
- "Lp/X;"
- );
- }
-
- /*
- * Top level type in default package.
- */
- public void test003() {
- assertBindingKeySignatureEquals(
- "LClazz;",
- "LClazz;"
- );
- }
-
- /*
- * Member type
- */
- public void test004() {
- assertBindingKeySignatureEquals(
- "Lp.X$Member;",
- "Lp/X$Member;"
- );
- }
-
- /*
- * Member type (2 levels deep)
- */
- public void test005() {
- assertBindingKeySignatureEquals(
- "Lp1.X$Member1$Member2;",
- "Lp1/X$Member1$Member2;"
- );
- }
-
- /*
- * Anonymous type
- */
- public void test006() {
- assertBindingKeySignatureEquals(
- "Lp1.X$1;",
- "Lp1/X$1;"
- );
- }
-
- /*
- * Local type
- */
- public void test007() {
- assertBindingKeySignatureEquals(
- "Lp1.X$1$Y;",
- "Lp1/X$1$Y;"
- );
- }
-
- /*
- * Array type
- */
- public void test008() {
- assertBindingKeySignatureEquals(
- "[Lp1.X;",
- "[Lp1/X;"
- );
- }
-
- /*
- * Secondary type
- */
- public void test012() {
- assertBindingKeySignatureEquals(
- "Lp1.Secondary;",
- "Lp1/X~Secondary;"
- );
- }
-
- /*
- * Anonymous in a secondary type
- */
- public void test013() {
- assertBindingKeySignatureEquals(
- "Lp1.Secondary$1;",
- "Lp1/X~Secondary$1;"
- );
- }
-
- /*
- * Method
- * (regression test for bug 85811 BindingKey.toSignature should return method signature for methods)
- */
- public void test014() {
- assertBindingKeySignatureEquals(
- "(Ljava.lang.String;I)Z",
- "Lp1/X;.foo(Ljava/lang/String;I)Z"
- );
- }
-
- /*
- * Create a type binding key from a fully qualified name
- */
- public void test015() {
- String key = BindingKey.createTypeBindingKey("java.lang.Object");
- assertBindingKeyEquals(
- "Ljava/lang/Object;",
- key);
- }
-
- /*
- * Create a type binding key from an array type name
- */
- public void test017() {
- String key = BindingKey.createTypeBindingKey("Boolean[]");
- assertBindingKeyEquals(
- "[LBoolean;",
- key);
- }
-
- /*
- * Create an array type binding key
- */
- public void test020() {
- String key = BindingKey.createArrayTypeBindingKey("Ljava/lang/Object;", 1);
- assertBindingKeyEquals(
- "[Ljava/lang/Object;",
- key);
- }
-
- /*
- * Create an array type binding key
- */
- public void test021() {
- String key = BindingKey.createArrayTypeBindingKey("I", 2);
- assertBindingKeyEquals(
- "[[I",
- key);
- }
-
- /*
- * Method starting with an upper case corresponding to a primitive type
- * (regression test for bug 94398 Error attempting to find References)
- */
- public void test034() {
- assertBindingKeySignatureEquals(
- "(Ljava.lang.String;I)Z",
- "Lp1/X;.Set(Ljava/lang/String;I)Z"
- );
- }
-
- /*
- * Field
- * (regression test for bug 87362 BindingKey#internalToSignature() should return the field's type signature)
- */
- public void test037() {
- assertBindingKeySignatureEquals(
- "Ljava.lang.String;",
- "Lp/X;.foo)Ljava/lang/String;"
- );
- }
-
- /*
- * Base type
- * (regression test for bug 97187 [rendering] Shows Single Char for primitve Types)
- */
- public void test039() {
- assertBindingKeySignatureEquals(
- "Z",
- "Z"
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BufferTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BufferTests.java
deleted file mode 100644
index 7d1cd0a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BufferTests.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.Test;
-
-public class BufferTests extends ModifyingResourceTests implements
- IBufferChangedListener {
- protected ArrayList events = null;
-
- public BufferTests(String name) {
- super(name);
- }
-
- /**
- * Cache the event
- */
- public void bufferChanged(BufferChangedEvent bufferChangedEvent) {
- this.events.add(bufferChangedEvent);
- }
-
- protected IBuffer createBuffer(String path, String content)
- throws CoreException {
- waitUntilIndexesReady(); // ensure that the indexer is not reading the
- // file
- this.createFile(path, content);
- IJavaScriptUnit cu = this.getCompilationUnit(path);
- IBuffer buffer = cu.getBuffer();
- buffer.addBufferChangedListener(this);
- this.events = new ArrayList();
- return buffer;
- }
-
- protected void deleteBuffer(IBuffer buffer) throws CoreException {
- buffer.removeBufferChangedListener(this);
- IResource resource = buffer.getUnderlyingResource();
- if (resource != null) {
- deleteResource(resource);
- }
- }
-
- /**
- * @see AbstractJavaModelTests#setUpSuite()
- */
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- try {
- this.createJavaProject("P", new String[] { "" });
- this.createFolder("P/x/y");
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @see AbstractJavaModelTests#tearDownSuite()
- */
- public void tearDownSuite() throws Exception {
- super.tearDownSuite();
- this.deleteProject("P");
- }
-
- public static Test suite() {
- return buildModelTestSuite(BufferTests.class);
- }
-
- /**
- * Tests appending to a buffer.
- */
- public void testAppend() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- int oldLength = buffer.getLength();
- buffer.append("\nvar a = new A();");
- assertBufferEvent(oldLength, 0, "\nvar a = new A();");
- assertSourceEquals("unexpected buffer contents", "function A() {\n};"
- + "\nvar a = new A();", buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests appending to a read-only buffer.
- */
- //TODO
- /*public void testAppendReadOnly() throws CoreException {
- IBuffer buffer = null;
- try {
- createJavaProject("P1", new String[] {}, "");
- // IClassFile classFile = getClassFile("P1",
- // getExternalJCLPathString(), "", "system.js");
- IJavaScriptUnit unit = getCompilationUnit("P1",
- getExternalJCLPathString(), "", "system.js");
- buffer = unit.getBuffer();
- buffer.addBufferChangedListener(this);
- this.events = new ArrayList();
- buffer.append("\nclass B {}");
- assertTrue("unexpected event", this.events.isEmpty());
- assertSourceEquals("unexpected buffer contents",
- "package java.lang;\n" + "\n" + "public class String {\n"
- + "}\n", buffer.getContents());
- assertTrue("should not have unsaved changes", !buffer
- .hasUnsavedChanges());
- } finally {
- if (buffer != null) {
- buffer.removeBufferChangedListener(this);
- }
- deleteProject("P1");
- }
- }*/
-
- public void testClose() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- buffer.close();
- assertBufferEvent(0, 0, null);
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests getting the underlying resource of a buffer.
- */
- public void testGetUnderlyingResource() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- IJavaScriptUnit copy = null;
- try {
- IFile file = this.getFile("P/x/y/A.js");
- assertEquals("Unexpected underlying resource", file, buffer
- .getUnderlyingResource());
-
- copy = this.getCompilationUnit("P/x/y/A.js").getWorkingCopy(null);
- assertEquals("Unexpected underlying resource 2", file, copy
- .getBuffer().getUnderlyingResource());
- } finally {
- this.deleteBuffer(buffer);
- if (copy != null) {
- copy.discardWorkingCopy();
- }
- }
- }
-
- /**
- * Tests deleting text at the beginning of a buffer.
- */
- public void testDeleteBeginning() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};\n" +
- "var a = new A();");
- try {
- buffer.replace(0, 18, "");
- assertBufferEvent(0, 18, null);
- assertSourceEquals("unexpected buffer contents",
- "var a = new A();", buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests deleting text in the middle of a buffer.
- */
- public void testDeleteMiddle() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};\n" +
- "var a = new A();\nvar a1 = new A();");
- try {
- // delete var a = new A();\n
- buffer.replace(18, 17, "");
- assertBufferEvent(18, 17, null);
- assertSourceEquals("unexpected buffer contents", "function A() {\n};\n" +
- "var a1 = new A();", buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests deleting text at the end of a buffer.
- */
- public void testDeleteEnd() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};\n" +
- "var a = new A();");
- try {
- // delete "public class A {\n}"
- buffer.replace(17, 17, "");
- assertBufferEvent(17, 17, null);
- assertSourceEquals("unexpected buffer contents", "function A() {\n};",
- buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests the buffer char retrieval via source position
- */
- public void testGetChar() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- assertEquals("Unexpected char at position 9", 'A', buffer
- .getChar(9));
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests the buffer char retrieval via source position doesn't throw an
- * exception if the buffer is closed.
- */
- public void testGetChar2() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- buffer.close();
- try {
- assertEquals("Unexpected char at position 9", Character.MIN_VALUE,
- buffer.getChar(9));
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests the buffer getLength()
- */
- public void testGetLength() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- assertEquals("Unexpected length", 17, buffer.getLength());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests the buffer text retrieval via source position
- */
- public void testGetText() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- assertSourceEquals("Unexpected text (1)", "f", buffer.getText(0, 1));
- assertSourceEquals("Unexpected text (2)", "A()", buffer.getText(
- 9, 3));
- assertSourceEquals("Unexpected text (3)", "", buffer.getText(12, 0));
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests inserting text at the beginning of a buffer.
- */
- public void testInsertBeginning() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- buffer.replace(0, 0, "/* copyright mycompany */\n");
- assertBufferEvent(0, 0, "/* copyright mycompany */\n");
- assertSourceEquals("unexpected buffer contents",
- "/* copyright mycompany */\n" + "function A() {\n};",
- buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests replacing text at the beginning of a buffer.
- */
- public void testReplaceBeginning() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- // replace function A() with function B()
- buffer.replace(0, 12, "function B()");
- assertBufferEvent(0, 12, "function B()");
- assertSourceEquals("unexpected buffer contents", "function B() {\n};",
- buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests replacing text in the middle of a buffer.
- */
- public void testReplaceMiddle() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- // replace "A()" after the \n of package statement
- buffer.replace(9, 3, "B( )");
- assertBufferEvent(9, 3, "B( )");
- assertSourceEquals("unexpected buffer contents", "function B( ) {\n};",
- buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests replacing text at the end of a buffer.
- */
- public void testReplaceEnd() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- // replace ";" at the end of cu with ";\n"
- int end = buffer.getLength();
- buffer.replace(end - 1, 1, ";\n");
- assertBufferEvent(end - 1, 1, ";\n");
- assertSourceEquals("unexpected buffer contents", "function A() {\n};\n",
- buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests inserting text in the middle of a buffer.
- */
- public void testInsertMiddle() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A() {\n};");
- try {
- // insert comment in the middle of the {\n}
- buffer.replace(15, 0, "// comment\n");
- assertBufferEvent(15, 0, "// comment\n");
- assertSourceEquals("unexpected buffer contents",
- "function A() {\n// comment\n};",
- buffer.getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Tests inserting text at the end of a buffer.
- */
- public void testInsertEnd() throws CoreException {
- IBuffer buffer = this.createBuffer("P/x/y/A.js", "function A(){\n};");
- try {
- // insert function B(){\n} at the end of the buffer
- int end = buffer.getLength();
- buffer.replace(end, 0, "\nfunction B(){\n};");
- assertBufferEvent(end, 0, "\nfunction B(){\n};");
- assertSourceEquals("unexpected buffer contents",
- "function A(){\n};\nfunction B(){\n};", buffer
- .getContents());
- assertTrue("should have unsaved changes", buffer
- .hasUnsavedChanges());
- } finally {
- this.deleteBuffer(buffer);
- }
- }
-
- /**
- * Verify the buffer changed event. The given text must contain '\n' line
- * separators.
- */
- protected void assertBufferEvent(int offset, int length, String text) {
- assertTrue("events should not be null", this.events != null);
- assertTrue("events should not be empty", !this.events.isEmpty());
- BufferChangedEvent event = (BufferChangedEvent) this.events.get(0);
- assertEquals("unexpected offset", offset, event.getOffset());
- assertEquals("unexpected length", length, event.getLength());
- if (text == null) {
- assertTrue("text should be null", event.getText() == null);
- } else {
- assertSourceEquals("unexpected text", text, event.getText());
- }
- }
-
- protected void assertBufferEvents(String expected) {
- StringBuffer buffer = new StringBuffer();
- if (this.events == null)
- buffer.append("<null>");
- else {
- for (int i = 0, length = this.events.size(); i < length; i++) {
- BufferChangedEvent event = (BufferChangedEvent) this.events
- .get(i);
- buffer.append('(');
- buffer.append(event.getOffset());
- buffer.append(", ");
- buffer.append(event.getLength());
- buffer.append(") ");
- buffer.append(event.getText());
- if (i < length - 1)
- buffer.append("\n");
- }
- }
- assertSourceEquals("Unexpected buffer events", expected, buffer
- .toString());
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CancelCounter.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CancelCounter.java
deleted file mode 100644
index 033b9b2..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CancelCounter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/*
- * Counts the number of time isCancelled() is called.
- */
-public class CancelCounter implements IProgressMonitor {
- public int count = 0;
- public void beginTask(String name, int totalWork) {}
- public void done() {}
- public void internalWorked(double work) {}
- public boolean isCanceled() {
- count++;
- return false;
- }
- public void setCanceled(boolean value) {}
- public void setTaskName(String name) {}
- public void subTask(String name) {}
- public void worked(int work) {}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/Canceler.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/Canceler.java
deleted file mode 100644
index 01bd795..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/Canceler.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/*
- * Cancels the operation on the count time isCanceled() is called.
- */
-public class Canceler implements IProgressMonitor {
- int count;
- public Canceler(int count) {
- this.count = count;
- }
- public void beginTask(String name, int totalWork) {}
- public void done() {}
- public void internalWorked(double work) {}
- public boolean isCanceled() {
- return --count < 0;
- }
- public void setCanceled(boolean value) {}
- public void setTaskName(String name) {}
- public void subTask(String name) {}
- public void worked(int work) {}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java
deleted file mode 100644
index 24815a6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java
+++ /dev/null
@@ -1,824 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-
-public class ClassFileTests extends ModifyingResourceTests {
-
- IPackageFragmentRoot jarRoot;
- IJavaScriptUnit workingCopy;
- IClassFile classFile;
-
-public ClassFileTests(String name) {
- super(name);
-}
-
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_PREFIX = "testGetCategories";
-// TESTS_NAMES = new String[] { "testWorkingCopy11"};
-// TESTS_NUMBERS = new int[] { 13 };
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-public static Test suite() {
- return buildModelTestSuite(ClassFileTests.class);
-}
-
-public void setUpSuite() throws Exception {
- super.setUpSuite();
- IJavaScriptProject javaProject = createJavaProject("P");
- String[] pathAndContents = new String[] {
- "nongeneric/A.js",
- "package nongeneric;\n" +
- "public class A {\n" +
- "}",
- "generic/X.js",
- "package generic;\n" +
- "public class X<T> {\n" +
- " <U extends Exception> X<T> foo(X<T> x) throws RuntimeException, U {\n" +
- " return null;\n" +
- " }\n" +
- " <K, V> V foo(K key, V value) throws Exception {\n" +
- " return value;\n" +
- " }\n" +
- "}",
- "generic/Y.js",
- "package generic;\n" +
- "public class Y<K, L> {\n" +
- "}",
- "generic/Z.js",
- "package generic;\n" +
- "public class Z<T extends Object & I<? super T>> {\n" +
- "}",
- "generic/I.js",
- "package generic;\n" +
- "public interface I<T> {\n" +
- "}",
- "generic/W.js",
- "package generic;\n" +
- "public class W<T extends X<T> , U extends T> {\n" +
- "}",
- "generic/V.js",
- "package generic;\n" +
- "public class V extends X<Thread> implements I<String> {\n" +
- "}",
- "varargs/X.js",
- "package varargs;\n" +
- "public class X {\n" +
- " void foo(String s, Object ... others) {\n" +
- " }\n" +
- "}",
- "workingcopy/X.js",
- "package workingcopy;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " System.out.println();\n" +
- " }\n" +
- "}",
- "workingcopy/Y.js",
- "package workingcopy;\n" +
- "public class Y<W> {\n" +
- " <T> T foo(T t, String... args) {\n" +
- " return t;\n" +
- " }\n" +
- "}",
- };
- addLibrary(javaProject, "lib.jar", "libsrc.zip", pathAndContents, JavaScriptCore.VERSION_1_5);
- this.jarRoot = javaProject.getPackageFragmentRoot(getFile("/P/lib.jar"));
-}
-
-public void tearDownSuite() throws Exception {
- super.tearDownSuite();
- deleteProject("P");
-}
-
-protected void tearDown() throws Exception {
- if (this.workingCopy != null)
- this.workingCopy.discardWorkingCopy();
- if (this.classFile != null) {
- removeLibrary(getJavaProject("P"), "lib2.jar", "src2.zip");
- this.classFile = null;
- }
- super.tearDown();
-}
-
-private IClassFile createClassFile(String contents) throws CoreException, IOException {
- IJavaScriptProject project = getJavaProject("P");
- addLibrary(project, "lib2.jar", "src2.zip", new String[] {"p/X.js", contents}, "1.5");
- this.classFile = project.getPackageFragmentRoot(getFile("/P/lib2.jar")).getPackageFragment("p").getClassFile("X.class");
- return this.classFile;
-}
-
-/*
- * Ensures that no exception is thrown for a .class file name with a dot
- * (regression test for bug 114140 assertion failed when opening a class file not not the classpath)
- */
-public void testDotName() throws JavaScriptModelException {
- IType type = getClassFile("/P/X.Y.class").getType();
- assertEquals("X.Y", type.getElementName());
-}
-
-/*
- * Ensure that the categories for a class are correct.
- */
-public void testGetCategories01() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "/**\n" +
- " * @category test\n" +
- " */\n" +
- "public class X {\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-public void testGetCategories02() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "/**\n" +
- " * @category test1 test2 test3 test4 test5 test6 test7 test8 test9 test10\n" +
- " */\n" +
- "public class X {\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7\ntest8\ntest9\ntest10\n",
- categories);
-}
-
-/*
- * Ensure that the categories for a field are correct.
- */
-public void testGetCategories03() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " int field;\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getField("field").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-public void testGetCategories04() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category test1 test2\n" +
- " */\n" +
- " int field;\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getField("field").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\ntest2\n",
- categories);
-}
-
-/*
- * Ensure that the categories for a method are correct.
- */
-public void testGetCategories05() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-public void testGetCategories06() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category test1 test2 test3 test4 test5\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\ntest2\ntest3\ntest4\ntest5\n",
- categories);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=125676
-public void testGetCategories07() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category " +
- " * test\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "",
- categories);
-}
-public void testGetCategories08() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category" +
- " * test\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "",
- categories);
-}
-public void testGetCategories09() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category test1" +
- " * test2\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\n",
- categories);
-}
-
-/*
- * Ensure that the categories for a member that has no categories when another member defines some are correct.
- */
-public void testGetCategories10() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " int field1;\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " int field2;\n" +
- "}"
- );
- String[] categories = this.classFile.getType().getField("field1").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "",
- categories);
-}
-
-/*
- * Ensures that the children of a type for a given category are correct.
- */
-public void testGetChildrenForCategory01() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " int field;\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " void foo2() {}\n" +
- " /**\n" +
- " * @category other\n" +
- " */\n" +
- " void foo3() {}\n" +
- "}"
- );
- IJavaScriptElement[] children = this.classFile.getType().getChildrenForCategory("test");
- assertElementsEqual(
- "Unexpected children",
- "field [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo1() [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo2() [in X [in X.class [in p [in lib2.jar [in P]]]]]",
- children);
-}
-public void testGetChildrenForCategory02() throws CoreException, IOException {
- createClassFile(
- "package p;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @category fields test all\n" +
- " */\n" +
- " int field;\n" +
- " /**\n" +
- " * @category methods test all\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**\n" +
- " * @category methods test all\n" +
- " */\n" +
- " void foo2() {}\n" +
- " /**\n" +
- " * @category methods other all\n" +
- " */\n" +
- " void foo3() {}\n" +
- "}"
- );
- IJavaScriptElement[] tests = this.classFile.getType().getChildrenForCategory("test");
- assertElementsEqual(
- "Unexpected children",
- "field [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo1() [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo2() [in X [in X.class [in p [in lib2.jar [in P]]]]]",
- tests);
- IJavaScriptElement[] methods = this.classFile.getType().getChildrenForCategory("methods");
- assertElementsEqual(
- "Unexpected children",
- "foo1() [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo2() [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo3() [in X [in X.class [in p [in lib2.jar [in P]]]]]",
- methods);
- IJavaScriptElement[] others = this.classFile.getType().getChildrenForCategory("other");
- assertElementsEqual(
- "Unexpected children",
- "foo3() [in X [in X.class [in p [in lib2.jar [in P]]]]]",
- others);
- IJavaScriptElement[] all = this.classFile.getType().getChildrenForCategory("all");
- assertElementsEqual(
- "Unexpected children",
- "field [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo1() [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo2() [in X [in X.class [in p [in lib2.jar [in P]]]]]\n" +
- "foo3() [in X [in X.class [in p [in lib2.jar [in P]]]]]",
- all);
-}
-
-/*
- * Ensures that IType#getSuperclassTypeSignature() is correct for a binary type.
- * (regression test for bug 78520 [model] IType#getSuperInterfaceTypeSignatures() doesn't include type arguments)
- */
-public void testGetSuperclassTypeSignature() throws JavaScriptModelException {
- IType type = this.jarRoot.getPackageFragment("generic").getClassFile("V.class").getType();
- assertEquals(
- "Unexpected signature",
- "Lgeneric.X<Ljava.lang.Thread;>;",
- type.getSuperclassTypeSignature());
-}
-
-/*
- * Ensures that the parameter names of a binary method with source attached are correct.
- */
-public void testParameterNames01() throws CoreException {
- IFunction method = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType().getFunction("foo", new String[] {"TK;", "TV;"});
- String[] parameterNames = method.getParameterNames();
- assertStringsEqual(
- "Unexpected parameter names",
- "key\n" +
- "value\n",
- parameterNames);
-}
-
-/*
- * Ensures that the parameter names of a binary method without source attached are correct.
- */
-public void testParameterNames02() throws CoreException {
- IPath sourceAttachmentPath = this.jarRoot.getSourceAttachmentPath();
- try {
- attachSource(this.jarRoot, null, null);
- IFunction method = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType().getFunction("foo", new String[] {"TK;", "TV;"});
- String[] parameterNames = method.getParameterNames();
- assertStringsEqual(
- "Unexpected parameter names",
- "arg0\n" +
- "arg1\n",
- parameterNames);
- } finally {
- attachSource(this.jarRoot, sourceAttachmentPath.toString(), null);
- }
-}
-
-/*
- * Ensures that the raw parameter names of a binary method with source attached are correct.
- */
-public void testRawParameterNames01() throws CoreException {
- IFunction method = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType().getFunction("foo", new String[] {"TK;", "TV;"});
- String[] parameterNames = method.getRawParameterNames();
- assertStringsEqual(
- "Unexpected parameter names",
- "arg0\n" +
- "arg1\n",
- parameterNames);
-}
-
-/*
- * Ensures that the raw parameter names of a binary method without source attached are correct.
- */
-public void testRawParameterNames02() throws CoreException {
- IPath sourceAttachmentPath = this.jarRoot.getSourceAttachmentPath();
- try {
- attachSource(this.jarRoot, null, null);
- IFunction method = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType().getFunction("foo", new String[] {"TK;", "TV;"});
- String[] parameterNames = method.getParameterNames();
- assertStringsEqual(
- "Unexpected parameter names",
- "arg0\n" +
- "arg1\n",
- parameterNames);
- } finally {
- attachSource(this.jarRoot, sourceAttachmentPath.toString(), null);
- }
-}
-
-/*
- * Ensure that the return type of a binary method is correct.
- */
-public void testReturnType1() throws JavaScriptModelException {
- IType type = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"TK;", "TV;"});
- assertEquals(
- "Unexpected return type",
- "TV;",
- method.getReturnType());
-}
-
-/*
- * Ensure that the return type of a binary method is correct.
- */
-public void testReturnType2() throws JavaScriptModelException {
- IType type = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"Lgeneric.X<TT;>;"});
- assertEquals(
- "Unexpected return type",
- "Lgeneric.X<TT;>;",
- method.getReturnType());
-}
-
-/*
- * Ensures that asking for the source range of a IClassFile in a non-Java project throws a JavaScriptModelException
- * (regression test for bug 132494 JavaScriptModelException opening up class file in non java project)
- */
-public void testSourceRangeNonJavaProject() throws CoreException {
- try {
- createProject("Simple");
- createFile("/Simple/X.class", "");
- IClassFile classX = getClassFile("/Simple/X.class");
- JavaScriptModelException exception = null;
- try {
- classX.getSourceRange();
- } catch (JavaScriptModelException e) {
- exception = e;
- }
- assertExceptionEquals("Unexpected exception", "Simple does not exist", exception);
- } finally {
- deleteProject("Simple");
- }
-}
-
-/*
- * Ensures that asking for the source range of a IClassFile not on the classpath of a Java project doesn't throw a JavaScriptModelException
- * (regression test for bug 138507 exception in .class file editor for classes imported via plug-in import)
- */
-public void testSourceRangeNotOnClasspath() throws CoreException {
- try {
- createJavaProject("P2", new String[] {"src"});
- createFile("/P2/bin/X.class", "");
- IClassFile classX = getClassFile("/P2/bin/X.class");
- assertNull("Unxepected source range", classX.getSourceRange());
- } finally {
- deleteProject("P2");
- }
-}
-
-/*
- * Ensure that a method with varargs has the AccVarargs flag set.
- */
-public void testVarargs() throws JavaScriptModelException {
- IType type = this.jarRoot.getPackageFragment("varargs").getClassFile("X.class").getType();
- IFunction method = type.getFunction("foo", new String[]{"Ljava.lang.String;", "[Ljava.lang.Object;"});
- assertTrue("Should have the AccVarargs flag set", Flags.isVarargs(method.getFlags()));
-}
-
-/*
- * Ensures that a class file can be turned into a working copy and that its children are correct.
- */
-public void testWorkingCopy01() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- this.workingCopy = clazz.getWorkingCopy(null, null);
- assertElementDescendants(
- "Unexpected children",
- "[Working copy] X.class\n" +
- " package workingcopy\n" +
- " class X\n" +
- " void foo()",
- this.workingCopy);
-}
-
-/*
- * Ensures that a class file without source attached can be turned into a working copy and that its children are correct.
- */
-public void testWorkingCopy02() throws CoreException {
- IPath sourceAttachmentPath = this.jarRoot.getSourceAttachmentPath();
- try {
- attachSource(this.jarRoot, null, null);
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- assertNull("Should not have source attached", clazz.getSource());
- this.workingCopy = clazz.getWorkingCopy(null, null);
- assertElementDescendants(
- "Unexpected children",
- "[Working copy] X.class\n" +
- " package workingcopy\n" +
- " class X\n" +
- " X()\n" +
- " void foo()",
- this.workingCopy);
- } finally {
- attachSource(this.jarRoot, sourceAttachmentPath.toString(), null);
- }
-}
-
-/*
- * Ensures that a class file can be turned into a working copy, modified and that its children are correct.
- */
-public void testWorkingCopy03() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- this.workingCopy = clazz.getWorkingCopy(null, null);
- this.workingCopy.getBuffer().setContents(
- "package workingcopy;\n" +
- "public class X {\n" +
- " void bar() {\n" +
- " }\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false/*don't force problems*/, null/*primary owner*/, null/*no progress*/);
- assertElementDescendants(
- "Unexpected children",
- "[Working copy] X.class\n" +
- " package workingcopy\n" +
- " class X\n" +
- " void bar()",
- this.workingCopy);
-}
-
-/*
- * Ensures that a class file working copy cannot be commited
- */
-public void testWorkingCopy04() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- this.workingCopy = clazz.getWorkingCopy(null, null);
- this.workingCopy.getBuffer().setContents(
- "package workingcopy;\n" +
- "public class X {\n" +
- " void bar() {\n" +
- " }\n" +
- "}"
- );
- JavaScriptModelException exception = null;
- try {
- this.workingCopy.commitWorkingCopy(false/*don't force*/, null);
- } catch (JavaScriptModelException e) {
- exception = e;
- }
- assertEquals(
- "Unxepected JavaScriptModelException",
- "JavaScript Model Exception: JavaScript Model Status [Operation not supported for specified element type(s):[Working copy] X.class [in workingcopy [in lib.jar [in P]]]]",
- exception.toString());
-}
-
-/*
- * Ensures that a type can be created in class file working copy.
- */
-public void testWorkingCopy05() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- this.workingCopy = clazz.getWorkingCopy(null, null);
- this.workingCopy.createType(
- "class Y {\n" +
- "}",
- null,
- false/*don't force*/,
- null);
- assertElementDescendants(
- "Unexpected children",
- "[Working copy] X.class\n" +
- " package workingcopy\n" +
- " class X\n" +
- " void foo()\n" +
- " class Y",
- this.workingCopy);
-}
-
-/*
- * Ensures that the primary compilation unit of class file working copy is correct.
- */
-public void testWorkingCopy06() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- this.workingCopy = clazz.getWorkingCopy(owner, null);
- IJavaScriptUnit primary = this.workingCopy.getPrimary();
- assertEquals("Unexpected owner of primary working copy", null, primary.getOwner());
-}
-
-/*
- * Ensures that a class file working copy can be restored from the original source.
- */
-public void testWorkingCopy07() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- this.workingCopy = clazz.getWorkingCopy(owner, null);
- this.workingCopy.getBuffer().setContents(
- "package workingcopy;\n" +
- "public class X {\n" +
- " void bar() {\n" +
- " }\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false/*don't force problems*/, null/*primary owner*/, null/*no progress*/);
- this.workingCopy.restore();
- assertElementDescendants(
- "Unexpected children",
- "[Working copy] X.class\n" +
- " package workingcopy\n" +
- " class X\n" +
- " void foo()",
- this.workingCopy);
-}
-
-/*
- * Ensures that a class file working copy can be reconciled against.
- */
-public void testWorkingCopy08() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- this.workingCopy = clazz.getWorkingCopy(owner, null);
- this.workingCopy.getBuffer().setContents(
- "package workingcopy;\n" +
- "public class X {\n" +
- " public void bar() {\n" +
- " }\n" +
- "}"
- );
- this.workingCopy.makeConsistent(null);
-
- IJavaScriptUnit cu = getCompilationUnit("/P/Y.js");
- IJavaScriptUnit copy = null;
- try {
- ProblemRequestor problemRequestor = new ProblemRequestor();
- copy = cu.getWorkingCopy(owner, null/*no prpgress*/);
- copy.getBuffer().setContents(
- "public class Y {\n" +
- " void foo(workingcopy.X x) {\n" +
- " x.bar();\n" +
- " }\n" +
- "}"
- );
- problemRequestor.problems = new StringBuffer();
- copy.reconcile(IJavaScriptUnit.NO_AST, false/*don't force problems*/, owner, null/*no progress*/);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n",
- problemRequestor);
- } finally {
- if (copy != null)
- copy.discardWorkingCopy();
- }
-}
-
-/*
- * Ensures that types in a class file are hidden when reconciling against if the class file working copy is empty.
- */
-public void testWorkingCopy09() throws CoreException {
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("X.class");
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- this.workingCopy = clazz.getWorkingCopy(owner, null);
- this.workingCopy.getBuffer().setContents( "");
- this.workingCopy.makeConsistent(null);
-
- IJavaScriptUnit cu = getCompilationUnit("/P/Y.js");
- IJavaScriptUnit copy = null;
- try {
- ProblemRequestor problemRequestor = new ProblemRequestor();
- copy = cu.getWorkingCopy(owner, null/*no prpgress*/);
- copy.getBuffer().setContents(
- "public class Y {\n" +
- " workingcopy.X x;\n" +
- "}"
- );
- problemRequestor.problems = new StringBuffer();
- copy.reconcile(IJavaScriptUnit.NO_AST, false/*don't force problems*/, owner, null/*no progress*/);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /P/Y.java\n" +
- "workingcopy.X cannot be resolved to a type\n" +
- "----------\n",
- problemRequestor);
- } finally {
- if (copy != null)
- copy.discardWorkingCopy();
- }
-}
-
-/*
- * Ensures that a 1.5 class file without source attached can be turned into a working copy and that its source is correct.
- */
-public void testWorkingCopy10() throws CoreException {
- IPath sourceAttachmentPath = this.jarRoot.getSourceAttachmentPath();
- try {
- attachSource(this.jarRoot, null, null);
- IClassFile clazz = this.jarRoot.getPackageFragment("workingcopy").getClassFile("Y.class");
- assertNull("Should not have source attached", clazz.getSource());
- this.workingCopy = clazz.getWorkingCopy(null, null);
- assertSourceEquals(
- "Unexpected source",
- "package workingcopy;\n" +
- "public class Y<W> {\n" +
- " \n" +
- " public Y() {\n" +
- " }\n" +
- " \n" +
- " <T> T foo(T t, java.lang.String... args) {\n" +
- " return null;\n" +
- " }\n" +
- "}",
- this.workingCopy.getSource());
- } finally {
- attachSource(this.jarRoot, sourceAttachmentPath.toString(), null);
- }
-}
-
-/*
- * Ensures that types in a class file are not found by a search if the class file working copy is empty.
- */
-public void testWorkingCopy11() throws CoreException {
- IPackageFragment pkg = this.jarRoot.getPackageFragment("workingcopy");
- IClassFile clazz = pkg.getClassFile("X.class");
- this.workingCopy = clazz.getWorkingCopy(null, null);
- this.workingCopy.getBuffer().setContents( "");
- this.workingCopy.makeConsistent(null);
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg});
- AbstractJavaSearchTests.JavaSearchResultCollector requestor = new AbstractJavaSearchTests.JavaSearchResultCollector();
- search("*", IJavaScriptSearchConstants.TYPE, IJavaScriptSearchConstants.DECLARATIONS, scope, requestor);
- assertSearchResults(
- "lib.jar workingcopy.Y",
- requestor);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassNameTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassNameTests.java
deleted file mode 100644
index 8c93245..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassNameTests.java
+++ /dev/null
@@ -1,1169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.internal.core.SourceType;
-
-/**
- * Test retrieving types by their name.
- */
-public class ClassNameTests extends ModifyingResourceTests {
-
- static IJavaScriptProject TEST_PROJECT;
- final static int SF_LENGTH = 5;
- static int TESTS_COUNT;
-
-public ClassNameTests(String name) {
- super(name);
-}
-
-static {
-// org.eclipse.wst.jsdt.internal.core.NameLookup.VERBOSE = true;
-// TESTS_NAMES = new String[] { "testFindSecondaryType_Bug72179" };
-// TESTS_PREFIX = "testReconcile";
-}
-public static Test suite() {
- Test suite = buildModelTestSuite(ClassNameTests.class);
- TESTS_COUNT = suite.countTestCases();
- return suite;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- if (TEST_PROJECT == null) {
- String[] sourceFolders = new String[SF_LENGTH];
- for (int i=0; i<SF_LENGTH; i++) {
- sourceFolders[i] = "src" + i;
- }
- TEST_PROJECT = createJavaProject("TestProject", sourceFolders, new String[] {"JCL_LIB"});
- createFolder("/TestProject/src0/org/eclipse/jdt/core/test0");
- createFile(
- "/TestProject/src0/org/eclipse/jdt/core/test0/Foo.js",
- "package org.eclipse.wst.jsdt.core.test0;\n" +
- "public class Foo {\n" +
- " class InFoo {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class InSecondary {}\n" +
- "}\n"
- );
- createFile(
- "/TestProject/src1/Foo.js",
- "public class Foo {\n" +
- " class InFoo {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class InSecondary {}\n" +
- "}\n"
- );
- int length = SF_LENGTH - 1;
- createFolder("/TestProject/src"+length+"/org/eclipse/jdt/core/test"+length);
- createFile(
- "/TestProject/src"+length+"/org/eclipse/jdt/core/test"+length+"/Foo.js",
- "package org.eclipse.wst.jsdt.core.test"+length+";\n" +
- "public class Foo {\n" +
- "}\n" +
- "class Secondary {\n" +
- "}\n"
- );
- createFile(
- "/TestProject/src"+length+"/org/eclipse/jdt/core/test"+length+"/Test.js",
- "package org.eclipse.wst.jsdt.core.test"+length+";\n" +
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " Secondary s = new Secondary();\n" +
- " }\n" +
- "}\n"
- );
- }
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelTests#tearDown()
- */
-protected void tearDown() throws Exception {
- TESTS_COUNT--;
- if (TEST_PROJECT != null && TESTS_COUNT == 0) {
- deleteResource(TEST_PROJECT.getProject());
- }
- super.tearDown();
-}
-
-protected void assertTypeFound(String typeName, String expectedResult) throws JavaScriptModelException {
- assertNotNull("TEST_PROJECT should not be null!!!", TEST_PROJECT);
- IType type = TEST_PROJECT.findType(typeName, new NullProgressMonitor());
- assertTrue("type "+typeName+" should exist!", type != null && type.exists());
- assertEquals("Expected type "+typeName+" NOT found!",
- expectedResult,
- ((SourceType)type).toStringWithAncestors()
- );
-}
-protected void assertTypeFound(String packageName, String typeName, String expectedResult) throws JavaScriptModelException {
- assertNotNull("TEST_PROJECT should not be null!!!", TEST_PROJECT);
- IType type = TEST_PROJECT.findType(packageName, typeName, new NullProgressMonitor());
- assertTrue("type "+typeName+" should exist!", type != null && type.exists());
- assertEquals("Expected type "+typeName+" NOT found!",
- expectedResult,
- ((SourceType)type).toStringWithAncestors()
- );
-}
-
-protected void assertTypeNotFound(String typeName) throws JavaScriptModelException {
- assertNotNull("TEST_PROJECT should not be null!!!", TEST_PROJECT);
- IType type = TEST_PROJECT.findType(typeName, new NullProgressMonitor());
- assertNotNull("type "+typeName+" should NOT be null!", type);
- assertFalse("type "+typeName+" should NOT exist!", type.exists());
-}
-protected void assertTypeNotFound(String packageName, String typeName) throws JavaScriptModelException {
- assertNotNull("TEST_PROJECT should not be null!!!", TEST_PROJECT);
- IType type = TEST_PROJECT.findType(packageName, typeName, new NullProgressMonitor());
- assertNotNull("type "+typeName+" should NOT be null!", type);
- assertFalse("type "+typeName+" should NOT exist!", type.exists());
-}
-
-protected void assertTypeUnknown(String typeName) throws JavaScriptModelException {
- assertNotNull("TEST_PROJECT should not be null!!!", TEST_PROJECT);
- IType type = TEST_PROJECT.findType(typeName, new NullProgressMonitor());
- assertNull("type "+typeName+" should NOT be found!", type);
-}
-protected void assertTypeUnknown(String packageName, String typeName) throws JavaScriptModelException {
- assertNotNull("TEST_PROJECT should not be null!!!", TEST_PROJECT);
- IType type = TEST_PROJECT.findType(packageName, typeName, new NullProgressMonitor());
- assertNull("type "+typeName+" should NOT be found!", type);
-}
-
-/**
- * Tests that a type in a jar with a name ending with $ can be retrieved.
- */
-public void testClassNameWithDollar() throws JavaScriptModelException, CoreException {
- try {
- byte[] tab = new byte[372];
- tab[0]=80;
- tab[1]=75;
- tab[2]=3;
- tab[3]=4;
- tab[4]=20;
- tab[5]=0;
- tab[6]=8;
- tab[7]=0;
- tab[8]=8;
- tab[9]=0;
- tab[10]=-63;
- tab[11]=88;
- tab[12]=-102;
- tab[13]=44;
- tab[14]=0;
- tab[15]=0;
- tab[16]=0;
- tab[17]=0;
- tab[18]=0;
- tab[19]=0;
- tab[20]=0;
- tab[21]=0;
- tab[22]=0;
- tab[23]=0;
- tab[24]=0;
- tab[25]=0;
- tab[26]=11;
- tab[27]=0;
- tab[28]=0;
- tab[29]=0;
- tab[30]=112;
- tab[31]=49;
- tab[32]=47;
- tab[33]=65;
- tab[34]=36;
- tab[35]=46;
- tab[36]=99;
- tab[37]=108;
- tab[38]=97;
- tab[39]=115;
- tab[40]=115;
- tab[41]=93;
- tab[42]=78;
- tab[43]=-63;
- tab[44]=74;
- tab[45]=-61;
- tab[46]=64;
- tab[47]=16;
- tab[48]=125;
- tab[49]=-45;
- tab[50]=77;
- tab[51]=-78;
- tab[52]=53;
- tab[53]=86;
- tab[54]=91;
- tab[55]=99;
- tab[56]=127;
- tab[57]=64;
- tab[58]=-24;
- tab[59]=-95;
- tab[60]=21;
- tab[61]=106;
- tab[62]=-16;
- tab[63]=-84;
- tab[64]=8;
- tab[65]=-91;
- tab[66]=-48;
- tab[67]=83;
- tab[68]=48;
- tab[69]=-121;
- tab[70]=74;
- tab[71]=-17;
- tab[72]=-101;
- tab[73]=-72;
- tab[74]=-42;
- tab[75]=45;
- tab[76]=49;
- tab[77]=43;
- tab[78]=49;
- tab[79]=-11;
- tab[80]=-69;
- tab[81]=-12;
- tab[82]=84;
- tab[83]=-16;
- tab[84]=-32;
- tab[85]=7;
- tab[86]=-8;
- tab[87]=81;
- tab[88]=-30;
- tab[89]=108;
- tab[90]=12;
- tab[91]=42;
- tab[92]=-50;
- tab[93]=-31;
- tab[94]=61;
- tab[95]=102;
- tab[96]=-26;
- tab[97]=-67;
- tab[98]=121;
- tab[99]=-13;
- tab[100]=-15;
- tab[101]=-7;
- tab[102]=-10;
- tab[103]=14;
- tab[104]=-127;
- tab[105]=41;
- tab[106]=-122;
- tab[107]=4;
- tab[108]=-1;
- tab[109]=-15;
- tab[110]=60;
- tab[111]=-98;
- tab[112]=-115;
- tab[113]=36;
- tab[114]=-120;
- tab[115]=48;
- tab[116]=-40;
- tab[117]=-88;
- tab[118]=103;
- tab[119]=21;
- tab[120]=23;
- tab[121]=-86;
- tab[122]=92;
- tab[123]=-57;
- tab[124]=105;
- tab[125]=-74;
- tab[126]=-47;
- tab[127]=121;
- tab[128]=45;
- tab[129]=33;
- tab[130]=8;
- tab[131]=-63;
- tab[132]=-91;
- tab[133]=41;
- tab[134]=77;
- tab[135]=125;
- tab[136]=69;
- tab[137]=16;
- tab[138]=-29;
- tab[139]=-55;
- tab[140]=-118;
- tab[141]=-32;
- tab[142]=-51;
- tab[143]=-19;
- tab[144]=-83;
- tab[145]=-18;
- tab[146]=-63;
- tab[147]=71;
- tab[148]=16;
- tab[149]=-62;
- tab[150]=67;
- tab[151]=-105;
- tab[152]=-48;
- tab[153]=79;
- tab[154]=76;
- tab[155]=-87;
- tab[156]=-81;
- tab[157]=-73;
- tab[158]=15;
- tab[159]=-103;
- tab[160]=-82;
- tab[161]=110;
- tab[162]=84;
- tab[163]=86;
- tab[164]=104;
- tab[165]=66;
- tab[166]=-108;
- tab[167]=-40;
- tab[168]=92;
- tab[169]=21;
- tab[170]=43;
- tab[171]=85;
- tab[172]=25;
- tab[173]=-41;
- tab[174]=-73;
- tab[175]=67;
- tab[176]=-81;
- tab[177]=-66;
- tab[178]=55;
- tab[179]=79;
- tab[180]=4;
- tab[181]=-103;
- tab[182]=52;
- tab[183]=121;
- tab[184]=23;
- tab[185]=124;
- tab[186]=-18;
- tab[187]=-50;
- tab[188]=90;
- tab[189]=-62;
- tab[190]=112;
- tab[191]=60;
- tab[192]=73;
- tab[193]=126;
- tab[194]=99;
- tab[195]=-105;
- tab[196]=117;
- tab[197]=101;
- tab[198]=-54;
- tab[199]=-75;
- tab[200]=91;
- tab[201]=46;
- tab[202]=-46;
- tab[203]=-76;
- tab[204]=-117;
- tab[205]=1;
- tab[206]=33;
- tab[207]=92;
- tab[208]=-38;
- tab[209]=109;
- tab[210]=-107;
- tab[211]=-21;
- tab[212]=-123;
- tab[213]=113;
- tab[214]=55;
- tab[215]=-28;
- tab[216]=108;
- tab[217]=116;
- tab[218]=-26;
- tab[219]=-60;
- tab[220]=56;
- tab[221]=65;
- tab[222]=-121;
- tab[223]=-61;
- tab[224]=93;
- tab[225]=117;
- tab[226]=64;
- tab[227]=-18;
- tab[228]=23;
- tab[229]=70;
- tab[230]=-55;
- tab[231]=93;
- tab[232]=-52;
- tab[233]=76;
- tab[234]=-52;
- tab[235]=-2;
- tab[236]=-23;
- tab[237]=14;
- tab[238]=123;
- tab[239]=-81;
- tab[240]=-51;
- tab[241]=58;
- tab[242]=100;
- tab[243]=12;
- tab[244]=-102;
- tab[245]=-95;
- tab[246]=-64;
- tab[247]=62;
- tab[248]=99;
- tab[249]=-17;
- tab[250]=91;
- tab[251]=-64;
- tab[252]=124;
- tab[253]=-64;
- tab[254]=76;
- tab[255]=56;
- tab[256]=68;
- tab[257]=-65;
- tab[258]=53;
- tab[259]=79;
- tab[260]=91;
- tab[261]=-77;
- tab[262]=-120;
- tab[263]=-114;
- tab[264]=94;
- tab[265]=-2;
- tab[266]=89;
- tab[267]=-125;
- tab[268]=63;
- tab[269]=86;
- tab[270]=-15;
- tab[271]=99;
- tab[272]=-115;
- tab[273]=26;
- tab[274]=-43;
- tab[275]=-15;
- tab[276]=23;
- tab[277]=80;
- tab[278]=75;
- tab[279]=7;
- tab[280]=8;
- tab[281]=122;
- tab[282]=-92;
- tab[283]=103;
- tab[284]=15;
- tab[285]=-20;
- tab[286]=0;
- tab[287]=0;
- tab[288]=0;
- tab[289]=78;
- tab[290]=1;
- tab[291]=0;
- tab[292]=0;
- tab[293]=80;
- tab[294]=75;
- tab[295]=1;
- tab[296]=2;
- tab[297]=20;
- tab[298]=0;
- tab[299]=20;
- tab[300]=0;
- tab[301]=8;
- tab[302]=0;
- tab[303]=8;
- tab[304]=0;
- tab[305]=-63;
- tab[306]=88;
- tab[307]=-102;
- tab[308]=44;
- tab[309]=122;
- tab[310]=-92;
- tab[311]=103;
- tab[312]=15;
- tab[313]=-20;
- tab[314]=0;
- tab[315]=0;
- tab[316]=0;
- tab[317]=78;
- tab[318]=1;
- tab[319]=0;
- tab[320]=0;
- tab[321]=11;
- tab[322]=0;
- tab[323]=0;
- tab[324]=0;
- tab[325]=0;
- tab[326]=0;
- tab[327]=0;
- tab[328]=0;
- tab[329]=0;
- tab[330]=0;
- tab[331]=0;
- tab[332]=0;
- tab[333]=0;
- tab[334]=0;
- tab[335]=0;
- tab[336]=0;
- tab[337]=0;
- tab[338]=0;
- tab[339]=112;
- tab[340]=49;
- tab[341]=47;
- tab[342]=65;
- tab[343]=36;
- tab[344]=46;
- tab[345]=99;
- tab[346]=108;
- tab[347]=97;
- tab[348]=115;
- tab[349]=115;
- tab[350]=80;
- tab[351]=75;
- tab[352]=5;
- tab[353]=6;
- tab[354]=0;
- tab[355]=0;
- tab[356]=0;
- tab[357]=0;
- tab[358]=1;
- tab[359]=0;
- tab[360]=1;
- tab[361]=0;
- tab[362]=57;
- tab[363]=0;
- tab[364]=0;
- tab[365]=0;
- tab[366]=37;
- tab[367]=1;
- tab[368]=0;
- tab[369]=0;
- tab[370]=0;
- tab[371]=0;
- IJavaScriptProject javaProject = createJavaProject("P", new String[] {"src"});
- IFile jarFile = createFile("P/lib.jar", tab);
- javaProject.setRawIncludepath(new IIncludePathEntry[] {JavaScriptCore.newLibraryEntry(jarFile.getFullPath(), null, null, false)}, new NullProgressMonitor());
- javaProject.findType("p1.A$");
- } catch (CoreException e) {
- e.printStackTrace();
- assertTrue(false);
- } finally {
- deleteProject("P");
- }
-}
-/**
- * Tests that a member type can be retrived using a dot qualified name.
- */
-public void testFindTypeWithDot() throws JavaScriptModelException, CoreException {
- try {
- IJavaScriptProject javaProject = createJavaProject("P", new String[] {""});
- this.createFolder("/P/p");
- this.createFile(
- "/P/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- " public class Y {\n" +
- " }\n" +
- "}"
- );
- IType type = javaProject.findType("p.X.Y");
- assertEquals(
- "Unexpected type found",
- "class Y [in X [in X.java [in p [in <project root> [in P]]]]]",
- type == null ? "null" : type.toString()
- );
- } finally {
- deleteProject("P");
- }
-}
-
-/**
- * Tests that a type in a jar with a name ending with $ can be retrieved.
- */
-public void testSearchTypeNameInJars() throws JavaScriptModelException, CoreException {
- try {
- byte[] tab = new byte[478];
- tab[0]=80;
- tab[1]=75;
- tab[2]=3;
- tab[3]=4;
- tab[4]=20;
- tab[5]=0;
- tab[6]=8;
- tab[7]=0;
- tab[8]=8;
- tab[9]=0;
- tab[10]=19;
- tab[11]=87;
- tab[12]=-95;
- tab[13]=44;
- tab[14]=0;
- tab[15]=0;
- tab[16]=0;
- tab[17]=0;
- tab[18]=0;
- tab[19]=0;
- tab[20]=0;
- tab[21]=0;
- tab[22]=0;
- tab[23]=0;
- tab[24]=0;
- tab[25]=0;
- tab[26]=9;
- tab[27]=0;
- tab[28]=0;
- tab[29]=0;
- tab[30]=112;
- tab[31]=49;
- tab[32]=47;
- tab[33]=112;
- tab[34]=50;
- tab[35]=47;
- tab[36]=112;
- tab[37]=51;
- tab[38]=47;
- tab[39]=3;
- tab[40]=0;
- tab[41]=80;
- tab[42]=75;
- tab[43]=7;
- tab[44]=8;
- tab[45]=0;
- tab[46]=0;
- tab[47]=0;
- tab[48]=0;
- tab[49]=2;
- tab[50]=0;
- tab[51]=0;
- tab[52]=0;
- tab[53]=0;
- tab[54]=0;
- tab[55]=0;
- tab[56]=0;
- tab[57]=80;
- tab[58]=75;
- tab[59]=3;
- tab[60]=4;
- tab[61]=20;
- tab[62]=0;
- tab[63]=8;
- tab[64]=0;
- tab[65]=8;
- tab[66]=0;
- tab[67]=19;
- tab[68]=87;
- tab[69]=-95;
- tab[70]=44;
- tab[71]=0;
- tab[72]=0;
- tab[73]=0;
- tab[74]=0;
- tab[75]=0;
- tab[76]=0;
- tab[77]=0;
- tab[78]=0;
- tab[79]=0;
- tab[80]=0;
- tab[81]=0;
- tab[82]=0;
- tab[83]=16;
- tab[84]=0;
- tab[85]=0;
- tab[86]=0;
- tab[87]=112;
- tab[88]=49;
- tab[89]=47;
- tab[90]=112;
- tab[91]=50;
- tab[92]=47;
- tab[93]=112;
- tab[94]=51;
- tab[95]=47;
- tab[96]=88;
- tab[97]=46;
- tab[98]=99;
- tab[99]=108;
- tab[100]=97;
- tab[101]=115;
- tab[102]=115;
- tab[103]=93;
- tab[104]=79;
- tab[105]=-53;
- tab[106]=78;
- tab[107]=-61;
- tab[108]=64;
- tab[109]=12;
- tab[110]=28;
- tab[111]=55;
- tab[112]=-81;
- tab[113]=-110;
- tab[114]=6;
- tab[115]=8;
- tab[116]=-3;
- tab[117]=3;
- tab[118]=110;
- tab[119]=60;
- tab[120]=-44;
- tab[121]=-82;
- tab[122]=10;
- tab[123]=71;
- tab[124]=16;
- tab[125]=23;
- tab[126]=36;
- tab[127]=78;
- tab[128]=81;
- tab[129]=57;
- tab[130]=20;
- tab[131]=69;
- tab[132]=-67;
- tab[133]=110;
- tab[134]=-62;
- tab[135]=-74;
- tab[136]=108;
- tab[137]=-107;
- tab[138]=102;
- tab[139]=-93;
- tab[140]=52;
- tab[141]=-27;
- tab[142]=-65;
- tab[143]=56;
- tab[144]=33;
- tab[145]=113;
- tab[146]=-32;
- tab[147]=3;
- tab[148]=-8;
- tab[149]=40;
- tab[150]=-124;
- tab[151]=55;
- tab[152]=-115;
- tab[153]=0;
- tab[154]=117;
- tab[155]=37;
- tab[156]=-49;
- tab[157]=-56;
- tab[158]=-10;
- tab[159]=-116;
- tab[160]=-19;
- tab[161]=-3;
- tab[162]=-6;
- tab[163]=-2;
- tab[164]=-8;
- tab[165]=-124;
- tab[166]=-125;
- tab[167]=17;
- tab[168]=78;
- tab[169]=8;
- tab[170]=97;
- tab[171]=53;
- tab[172]=17;
- tab[173]=-43;
- tab[174]=-107;
- tab[175]=-88;
- tab[176]=-82;
- tab[177]=-59;
- tab[178]=60;
- tab[179]=0;
- tab[180]=17;
- tab[181]=-30;
- tab[182]=-107;
- tab[183]=124;
- tab[184]=-107;
- tab[185]=-94;
- tab[186]=-112;
- tab[187]=-27;
- tab[188]=82;
- tab[189]=60;
- tab[190]=102;
- tab[191]=43;
- tab[192]=-107;
- tab[193]=55;
- tab[194]=1;
- tab[195]=28;
- tab[196]=-126;
- tab[197]=127;
- tab[198]=-85;
- tab[199]=75;
- tab[200]=-35;
- tab[201]=-36;
- tab[202]=17;
- tab[203]=-100;
- tab[204]=-77;
- tab[205]=-13;
- tab[206]=-108;
- tab[207]=-32;
- tab[208]=-34;
- tab[209]=-101;
- tab[210]=103;
- tab[211]=21;
- tab[212]=-63;
- tab[213]=-125;
- tab[214]=31;
- tab[215]=-62;
- tab[216]=69;
- tab[217]=-97;
- tab[218]=112;
- tab[219]=-100;
- tab[220]=-24;
- tab[221]=82;
- tab[222]=77;
- tab[223]=-73;
- tab[224]=-21;
- tab[225]=76;
- tab[226]=-43;
- tab[227]=79;
- tab[228]=50;
- tab[229]=43;
- tab[230]=20;
- tab[231]=97;
- tab[232]=-104;
- tab[233]=-104;
- tab[234]=92;
- tab[235]=22;
- tab[236]=-87;
- tab[237]=-84;
- tab[238]=-75;
- tab[239]=-51;
- tab[240]=-69;
- tab[241]=-94;
- tab[242]=-37;
- tab[243]=-68;
- tab[244]=-24;
- tab[245]=13;
- tab[246]=33;
- tab[247]=74;
- tab[248]=-2;
- tab[249]=-106;
- tab[250]=-34;
- tab[251]=-16;
- tab[252]=-52;
- tab[253]=-123;
- tab[254]=49;
- tab[255]=124;
- tab[256]=-56;
- tab[257]=-52;
- tab[258]=108;
- tab[259]=-21;
- tab[260]=92;
- tab[261]=61;
- tab[262]=104;
- tab[263]=43;
- tab[264]=-12;
- tab[265]=-25;
- tab[266]=99;
- tab[267]=123;
- tab[268]=7;
- tab[269]=78;
- tab[270]=-47;
- tab[271]=-29;
- tab[272]=5;
- tab[273]=-10;
- tab[274]=-11;
- tab[275]=64;
- tab[276]=118;
- tab[277]=31;
- tab[278]=99;
- tab[279]=-64;
- tab[280]=-103;
- tab[281]=96;
- tab[282]=38;
- tab[283]=102;
- tab[284]=-17;
- tab[285]=-30;
- tab[286]=29;
- tab[287]=7;
- tab[288]=111;
- tab[289]=109;
- tab[290]=59;
- tab[291]=100;
- tab[292]=-12;
- tab[293]=-37;
- tab[294]=-94;
- tab[295]=-125;
- tab[296]=1;
- tab[297]=99;
- tab[298]=-76;
- tab[299]=19;
- tab[300]=48;
- tab[301]=31;
- tab[302]=-74;
- tab[303]=3;
- tab[304]=-114;
- tab[305]=126;
- tab[306]=-51;
- tab[307]=-105;
- tab[308]=28;
- tab[309]=-74;
- tab[310]=71;
- tab[311]=-5;
- tab[312]=70;
- tab[313]=-9;
- tab[314]=-97;
- tab[315]=-111;
- tab[316]=58;
- tab[317]=35;
- tab[318]=-1;
- tab[319]=-83;
- tab[320]=85;
- tab[321]=-59;
- tab[322]=63;
- tab[323]=80;
- tab[324]=75;
- tab[325]=7;
- tab[326]=8;
- tab[327]=-99;
- tab[328]=105;
- tab[329]=77;
- tab[330]=-38;
- tab[331]=-36;
- tab[332]=0;
- tab[333]=0;
- tab[334]=0;
- tab[335]=53;
- tab[336]=1;
- tab[337]=0;
- tab[338]=0;
- tab[339]=80;
- tab[340]=75;
- tab[341]=1;
- tab[342]=2;
- tab[343]=20;
- tab[344]=0;
- tab[345]=20;
- tab[346]=0;
- tab[347]=8;
- tab[348]=0;
- tab[349]=8;
- tab[350]=0;
- tab[351]=19;
- tab[352]=87;
- tab[353]=-95;
- tab[354]=44;
- tab[355]=0;
- tab[356]=0;
- tab[357]=0;
- tab[358]=0;
- tab[359]=2;
- tab[360]=0;
- tab[361]=0;
- tab[362]=0;
- tab[363]=0;
- tab[364]=0;
- tab[365]=0;
- tab[366]=0;
- tab[367]=9;
- tab[368]=0;
- tab[369]=0;
- tab[370]=0;
- tab[371]=0;
- tab[372]=0;
- tab[373]=0;
- tab[374]=0;
- tab[375]=0;
- tab[376]=0;
- tab[377]=0;
- tab[378]=0;
- tab[379]=0;
- tab[380]=0;
- tab[381]=0;
- tab[382]=0;
- tab[383]=0;
- tab[384]=0;
- tab[385]=112;
- tab[386]=49;
- tab[387]=47;
- tab[388]=112;
- tab[389]=50;
- tab[390]=47;
- tab[391]=112;
- tab[392]=51;
- tab[393]=47;
- tab[394]=80;
- tab[395]=75;
- tab[396]=1;
- tab[397]=2;
- tab[398]=20;
- tab[399]=0;
- tab[400]=20;
- tab[401]=0;
- tab[402]=8;
- tab[403]=0;
- tab[404]=8;
- tab[405]=0;
- tab[406]=19;
- tab[407]=87;
- tab[408]=-95;
- tab[409]=44;
- tab[410]=-99;
- tab[411]=105;
- tab[412]=77;
- tab[413]=-38;
- tab[414]=-36;
- tab[415]=0;
- tab[416]=0;
- tab[417]=0;
- tab[418]=53;
- tab[419]=1;
- tab[420]=0;
- tab[421]=0;
- tab[422]=16;
- tab[423]=0;
- tab[424]=0;
- tab[425]=0;
- tab[426]=0;
- tab[427]=0;
- tab[428]=0;
- tab[429]=0;
- tab[430]=0;
- tab[431]=0;
- tab[432]=0;
- tab[433]=0;
- tab[434]=0;
- tab[435]=0;
- tab[436]=57;
- tab[437]=0;
- tab[438]=0;
- tab[439]=0;
- tab[440]=112;
- tab[441]=49;
- tab[442]=47;
- tab[443]=112;
- tab[444]=50;
- tab[445]=47;
- tab[446]=112;
- tab[447]=51;
- tab[448]=47;
- tab[449]=88;
- tab[450]=46;
- tab[451]=99;
- tab[452]=108;
- tab[453]=97;
- tab[454]=115;
- tab[455]=115;
- tab[456]=80;
- tab[457]=75;
- tab[458]=5;
- tab[459]=6;
- tab[460]=0;
- tab[461]=0;
- tab[462]=0;
- tab[463]=0;
- tab[464]=2;
- tab[465]=0;
- tab[466]=2;
- tab[467]=0;
- tab[468]=117;
- tab[469]=0;
- tab[470]=0;
- tab[471]=0;
- tab[472]=83;
- tab[473]=1;
- tab[474]=0;
- tab[475]=0;
- tab[476]=0;
- tab[477]=0;
- IJavaScriptProject javaProject = createJavaProject("P1", new String[] {"src"});
- IFile jarFile = createFile("P1/lib.jar", tab);
- javaProject.setRawIncludepath(new IIncludePathEntry[] {JavaScriptCore.newLibraryEntry(jarFile.getFullPath(), null, null, false)}, new NullProgressMonitor());
- assertNotNull(javaProject.findType("p1.p2.p3.X"));
- } catch(JavaScriptModelException e) {
- e.printStackTrace();
- assertTrue(false);
- } catch (CoreException e) {
- e.printStackTrace();
- assertTrue(false);
- } finally {
- deleteProject("P1");
- }
-}
-
-/**
- * Bug 36032: JavaProject.findType() fails to find second type in source file
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=36032"
- */
-public void testFindSecondaryType_Exist01() throws JavaScriptModelException, CoreException {
- int length = SF_LENGTH - 1;
- assertTypeFound(
- "org.eclipse.wst.jsdt.core.test"+length+".Foo",
- "Foo [in Foo.java [in org.eclipse.wst.jsdt.core.test"+length+" [in src"+length+" [in TestProject]]]]"
- );
-}
-public void testFindSecondaryType_Exist02() throws JavaScriptModelException, CoreException {
- int length = SF_LENGTH - 1;
- assertTypeFound(
- "org.eclipse.wst.jsdt.core.test"+length+".Secondary",
- "Secondary [in Foo.java [in org.eclipse.wst.jsdt.core.test"+length+" [in src"+length+" [in TestProject]]]]"
- );
-}
-public void testFindSecondaryType_Exist03() throws JavaScriptModelException, CoreException {
- assertTypeFound(
- "org.eclipse.wst.jsdt.core.test0.Foo.InFoo",
- "InFoo [in Foo [in Foo.java [in org.eclipse.wst.jsdt.core.test0 [in src0 [in TestProject]]]]]"
- );
-}
-public void testFindSecondaryType_Exist04() throws JavaScriptModelException, CoreException {
- assertTypeFound(
- "org.eclipse.wst.jsdt.core.test0.Secondary.InSecondary",
- "InSecondary [in Secondary [in Foo.java [in org.eclipse.wst.jsdt.core.test0 [in src0 [in TestProject]]]]]"
- );
-}
-public void testFindSecondaryType_Exist05() throws JavaScriptModelException, CoreException {
- assertTypeFound(
- "Foo",
- "Foo [in Foo.java [in <default> [in src1 [in TestProject]]]]"
- );
-}
-public void testFindSecondaryType_Exist06() throws JavaScriptModelException, CoreException {
- assertTypeFound(
- "Secondary",
- "Secondary [in Foo.java [in <default> [in src1 [in TestProject]]]]"
- );
-}
-// duplicate bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=72179
-public void testFindSecondaryType_Bug72179() throws JavaScriptModelException, CoreException {
- try {
- IJavaScriptProject javaProject = createJavaProject("P", new String[] {""});
- createFolder("/P/p1");
- createFile(
- "/P/p1/jc.js",
- "package p1;\n" +
- "class jc008{}\n" +
- "class jc009{}\n" +
- "class jc010 extends jc009 {\n" +
- " jc008 a;\n" +
- "}\n"
- );
- IType type = javaProject.findType("p1", "jc008", new NullProgressMonitor());
- assertTrue("type 'jc008' should exist!", type != null && type.exists());
- assertEquals("Expected type 'jc008' NOT found!",
- "class jc008 [in jc.java [in p1 [in <project root> [in P]]]]",
- type.toString()
- );
- type = javaProject.findType("p1", "jc009", new NullProgressMonitor());
- assertTrue("type 'jc009' should exist!", type != null && type.exists());
- assertEquals("Expected type 'jc009' NOT found!",
- "class jc009 [in jc.java [in p1 [in <project root> [in P]]]]",
- type.toString()
- );
- type = javaProject.findType("p1", "jc010", new NullProgressMonitor());
- assertTrue("type 'jc010' should exist!", type != null && type.exists());
- assertEquals("Expected type 'jc010' NOT found!",
- "class jc010 [in jc.java [in p1 [in <project root> [in P]]]]\n" +
- " jc008 a",
- type.toString()
- );
- } finally {
- deleteProject("P");
- }
-}
-public void testFindSecondaryType_NotFound01() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("test.Foo");
-}
-public void testFindSecondaryType_NotFound02() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("InFoo");
-}
-public void testFindSecondaryType_NotFound03() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("InSecondary");
-}
-public void testFindSecondaryType_NotFound04() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("Foo.inFoo");
-}
-public void testFindSecondaryType_NotFound05() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("Secondary.inBar");
-}
-public void testFindSecondaryType_Unknown01() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("Unknown");
-}
-public void testFindSecondaryType_Unknown02() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("Foo.Unknown");
-}
-public void testFindSecondaryType_Unknown03() throws JavaScriptModelException, CoreException {
- assertTypeUnknown("org.eclipse.wst.jsdt.core.test.Unknown");
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathInitializerTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathInitializerTests.java
deleted file mode 100644
index f9fe958..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathInitializerTests.java
+++ /dev/null
@@ -1,1306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.JavaModelStatus;
-import org.eclipse.wst.jsdt.internal.core.UserLibraryJsGlobalScopeContainer;
-import org.eclipse.wst.jsdt.internal.core.UserLibraryManager;
-
-import junit.framework.Test;
-
-public class ClasspathInitializerTests extends ModifyingResourceTests {
-
-public static class DefaultVariableInitializer implements VariablesInitializer.ITestInitializer {
- Map variableValues;
-
- /*
- * values is [<var name>, <var value>]*
- */
- public DefaultVariableInitializer(String[] values) {
- variableValues = new HashMap();
- for (int i = 0; i < values.length; i+=2) {
- variableValues.put(values[i], new Path(values[i+1]));
- }
- }
-
- public void initialize(String variable) throws JavaScriptModelException {
- if (variableValues == null) return;
- JavaScriptCore.setIncludepathVariable(
- variable,
- (IPath)variableValues.get(variable),
- null);
- }
-}
-
-public static class DefaultContainerInitializer implements ContainerInitializer.ITestInitializer {
-
- public static class DefaultContainer implements IJsGlobalScopeContainer {
- char[][] libPaths;
- public DefaultContainer(char[][] libPaths) {
- this.libPaths = libPaths;
- }
- /**
- * @deprecated Use {@link #getIncludepathEntries()} instead
- */
- public IIncludePathEntry[] getClasspathEntries() {
- return getIncludepathEntries();
- }
- public IIncludePathEntry[] getIncludepathEntries() {
- int length = this.libPaths.length;
- IIncludePathEntry[] entries = new IIncludePathEntry[length];
- for (int j = 0; j < length; j++) {
- IPath path = new Path(new String(this.libPaths[j]));
- if (path.segmentCount() == 1) {
- entries[j] = JavaScriptCore.newProjectEntry(path);
- } else {
- entries[j] = JavaScriptCore.newLibraryEntry(path, null, null);
- }
- }
- return entries;
- }
- public String getDescription() {
- return "Test container";
- }
- public int getKind() {
- return IJsGlobalScopeContainer.K_APPLICATION;
- }
- public IPath getPath() {
- return new Path("org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER");
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer#resolvedLibraryImport(java.lang.String)
- */
- public String[] resolvedLibraryImport(String a) {
- return new String[] {a};
- }
- }
-
- Map containerValues;
- CoreException exception;
-
- /*
- * values is [<project name>, <lib path>[,<lib path>]* ]*
- */
- public DefaultContainerInitializer(String[] values) {
- containerValues = new HashMap();
- for (int i = 0; i < values.length; i+=2) {
- final String projectName = values[i];
- final char[][] libPaths = CharOperation.splitOn(',', values[i+1].toCharArray());
- containerValues.put(
- projectName,
- newContainer(libPaths)
- );
- }
- }
- protected DefaultContainer newContainer(final char[][] libPaths) {
- return new DefaultContainer(libPaths);
- }
- public boolean allowFailureContainer() {
- return true;
- }
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- if (containerValues == null) return;
- try {
- JavaScriptCore.setJsGlobalScopeContainer(
- containerPath,
- new IJavaScriptProject[] {project},
- new IJsGlobalScopeContainer[] {(IJsGlobalScopeContainer)containerValues.get(project.getElementName())},
- null);
- } catch (CoreException e) {
- this.exception = e;
- throw e;
- }
- }
-}
-// Simple container initializer, which keeps setting container to null
-// (30920 - stackoverflow when setting container to null)
-public class NullContainerInitializer implements ContainerInitializer.ITestInitializer {
- public boolean hasRun = false;
- public boolean allowFailureContainer() {
- return false; // allow the initializer to run again
- }
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- hasRun = true;
- JavaScriptCore.setJsGlobalScopeContainer(
- containerPath,
- new IJavaScriptProject[] {project},
- new IJsGlobalScopeContainer[] { null },
- null);
- }
-}
-
-public ClasspathInitializerTests(String name) {
- super(name);
-}
-public static Test suite() {
- return buildModelTestSuite(ClasspathInitializerTests.class);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
- // Names of tests to run: can be "testBugXXXX" or "BugXXXX")
-// TESTS_NAMES = new String[] { "testContainerInitializer12" };
- // Numbers of tests to run: "test<number>" will be run for each number of this array
-// TESTS_NUMBERS = new int[] { 2, 12 };
- // Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-protected void tearDown() throws Exception {
- // Cleanup caches
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- manager.containers = new HashMap(5);
- manager.variables = new HashMap(5);
-
- super.tearDown();
-}
-public void testContainerInitializer01() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1/lib.jar"}));
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- IPackageFragmentRoot root = p2.getPackageFragmentRoot(getFile("/P1/lib.jar"));
- assertTrue("/P1/lib.jar should exist", root.exists());
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-public void testContainerInitializer02() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1/lib.jar"}));
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
-
- // simulate state on startup
- simulateExitRestart();
-
- startDeltas();
- p2.getResolvedIncludepath(true);
-
- assertDeltas(
- "Unexpected delta on startup",
- ""
- );
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-public void testContainerInitializer03() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1/lib.jar"}));
- createJavaProject(
- "P2",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
-
- // change value of TEST_CONTAINER
- createFile("/P1/lib2.jar", "");
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1/lib2.jar"}));
-
- // simulate state on startup
- simulateExitRestart();
-
- startDeltas();
- getJavaProject("P2").getResolvedIncludepath(true);
-
- assertDeltas(
- "Unexpected delta on startup",
- "P2[*]: {CHILDREN}\n" +
- " /P1/lib.jar[*]: {REMOVED FROM CLASSPATH}\n" +
- " /P1/lib2.jar[*]: {ADDED TO CLASSPATH}"
- );
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/* Ensure that initializer is not callled when resource tree is locked.
- * (regression test for bug 29585 Core Exception as resource tree is locked initializing classpath container)
- */
-public void testContainerInitializer04() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- DefaultContainerInitializer initializer = new DefaultContainerInitializer(new String[] {"P2", "/P1/lib.jar"});
- ContainerInitializer.setInitializer(initializer);
- createJavaProject(
- "P2",
- new String[] {""},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
-
- // simulate state on startup
- simulateExitRestart();
-
- startDeltas();
- createFile("/P2/X.js", "public class X {}");
-
- assertEquals("Should not get exception", null, initializer.exception);
-
- assertDeltas(
- "Unexpected delta on startup",
- "P2[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[+]: {}"
- );
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/*
- * 30920 - Stack overflow when container resolved to null
- */
-public void testContainerInitializer05() throws CoreException {
- try {
- NullContainerInitializer nullInitializer = new NullContainerInitializer();
- ContainerInitializer.setInitializer(nullInitializer);
- createJavaProject(
- "P1",
- new String[] {""},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
-
- // simulate state on startup
- simulateExitRestart();
-
- startDeltas();
-
- // will trigger classpath resolution (with null container value)
- createFile("/P1/X.js", "public class X {}");
- assertDeltas(
- "Unexpected delta on startup",
- "P1[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[+]: {}"
- );
- assertTrue("initializer did not run", nullInitializer.hasRun);
-
- // next cp resolution request will rerun the initializer
- waitForAutoBuild();
- nullInitializer.hasRun = false; // reset
- getJavaProject("P1").getResolvedIncludepath(true);
- assertTrue("initializer did not run", nullInitializer.hasRun); // initializer should have run again (since keep setting to null)
-
- // assigning new (non-null) value to container
- waitForAutoBuild();
- createFile("/P1/lib.jar", "");
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1/lib.jar"}));
- clearDeltas();
- getJavaProject("P1").getResolvedIncludepath(true);
- assertDeltas(
- "Unexpected delta after setting container",
- "P1[*]: {CHILDREN}\n" +
- " lib.jar[*]: {ADDED TO CLASSPATH}"
- );
-
- } catch (StackOverflowError e) {
- e.printStackTrace();
- assertTrue("stack overflow assigning container", false);
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-/*
- * Ensures that running the initializer during a reconcile operation just after workspace startup
- * doesn't throw a NPE
- * (regression test for bug 48818 NPE in delta processor)
- */
-public void testContainerInitializer06() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- createProject("P1");
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", ""}));
- createJavaProject(
- "P2",
- new String[] {"src"},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- createFile(
- "/P2/src/X,java",
- "public class X {\n" +
- "}"
- );
-
- // change value of TEST_CONTAINER
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P2", "/P1"}));
-
- // simulate state on startup
- simulateExitRestart();
-
- startDeltas();
- workingCopy = getCompilationUnit("/P2/src/X.js");
- workingCopy.becomeWorkingCopy(null);
-
- assertDeltas(
- "Unexpected delta on startup",
- "P2[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " [Working copy] X.java[+]: {PRIMARY WORKING COPY}"
- );
- } finally {
- stopDeltas();
- if (workingCopy != null) workingCopy.discardWorkingCopy();
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/*
- * Ensure that an OperationCanceledException goes through
- * (regression test for bug 59363 Should surface cancellation exceptions)
- */
-public void testContainerInitializer07() throws CoreException {
- try {
- boolean gotException = false;
- try {
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1/lib.jar"}) {
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- throw new OperationCanceledException("test");
- }});
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- p1.getResolvedIncludepath(true);
- } catch (OperationCanceledException e) {
- gotException = true;
- }
- assertTrue("Should get an OperationCanceledException", gotException);
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-/*
- * Ensure that the stack doesn't blow up if initializer is missbehaving
- * (regression test for bug 61052 Flatten cp container initialization)
- */
-public void testContainerInitializer08() throws CoreException {
- final int projectLength = 10;
- final String[] projects = new String[projectLength];
- for (int i = 0; i < projectLength; i++) {
- projects[i] = "P" + i;
- }
- try {
- String[] projectRefs = new String[(projectLength-1) * 2];
- for (int i = 0; i < projectLength-1; i++) {
- projectRefs[i*2] = "P" + i;
- projectRefs[(i*2)+1] = "/P" + i + "/test.jar";
- }
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(projectRefs) {
- void foo(int n) {
- if (n > 0) {
- foo(n-1);
- return;
- }
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- for (int i = 0; i < projectLength-1; i++) {
- try {
- JavaScriptCore.create(root.getProject(projects[i])).getResolvedIncludepath(true);
- } catch (JavaScriptModelException e) {
- // project doesn't exist: ignore
- }
- }
- }
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- foo(500);
- super.initialize(containerPath, project);
- }
- });
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- for (int i = 0; i < projectLength; i++) {
- createProject(projects[i]);
- editFile(
- "/" + projects[i] + "/.project",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<projectDescription>\n" +
- " <name>" + projects[i] + "</name>\n" +
- " <comment></comment>\n" +
- " <projects>\n" +
- (i == 0 ? "" : "<project>" + projects[i-1] + "</project>\n") +
- " </projects>\n" +
- " <buildSpec>\n" +
- " <buildCommand>\n" +
- " <name>org.eclipse.wst.jsdt.core.javabuilder</name>\n" +
- " <arguments>\n" +
- " </arguments>\n" +
- " </buildCommand>\n" +
- " </buildSpec>\n" +
- " <natures>\n" +
- " <nature>org.eclipse.wst.jsdt.core.javanature</nature>\n" +
- " </natures>\n" +
- "</projectDescription>"
- );
- createFile(
- "/" + projects[i] + "/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- (i == 0 ? "" : "<classpathentry kind=\"src\" path=\"/" + projects[i-1] + "\"/>\n") +
- " <classpathentry kind=\"con\" path=\"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>"
- );
- }
- }
- }, null);
- getJavaProject("P0").getResolvedIncludepath(true);
- } finally {
- stopDeltas();
- deleteProjects(projects);
- }
-}
-/*
- * Ensure that a StackOverFlowError is not thrown if the initializer asks for the resolved classpath
- * that is being resolved.
- * (regression test for bug 61040 Should add protect for reentrance to #getResolvedClasspath)
- */
-public void testContainerInitializer09() throws CoreException {
- try {
- ClasspathInitializerTests.DefaultContainerInitializer initializer = new ClasspathInitializerTests.DefaultContainerInitializer(new String[] {"P1", "/P1/lib.jar"}) {
- protected DefaultContainer newContainer(char[][] libPaths) {
- return new DefaultContainer(libPaths) {
- /**
- * @deprecated Use {@link #getIncludepathEntries()} instead
- */
- public IIncludePathEntry[] getClasspathEntries() {
- return getIncludepathEntries();
- }
-
- public IIncludePathEntry[] getIncludepathEntries() {
- try {
- getJavaProject("P1").getResolvedIncludepath(true);
- } catch (JavaScriptModelException e) {
- // project doesn't exist: ignore
- }
- return super.getIncludepathEntries();
- }
- };
- }
- };
- ContainerInitializer.setInitializer(initializer);
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- createProject("P1");
- editFile(
- "/P1/.project",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<projectDescription>\n" +
- " <name>P1</name>\n" +
- " <comment></comment>\n" +
- " <projects>\n" +
- " </projects>\n" +
- " <buildSpec>\n" +
- " <buildCommand>\n" +
- " <name>org.eclipse.wst.jsdt.core.javabuilder</name>\n" +
- " <arguments>\n" +
- " </arguments>\n" +
- " </buildCommand>\n" +
- " </buildSpec>\n" +
- " <natures>\n" +
- " <nature>org.eclipse.wst.jsdt.core.javanature</nature>\n" +
- " </natures>\n" +
- "</projectDescription>"
- );
- createFile(
- "/P1/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"con\" path=\"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>"
- );
- }
- }, null);
- getJavaProject("P1").getResolvedIncludepath(true);
- } finally {
- stopDeltas();
- ContainerInitializer.setInitializer(null);
- deleteProject("P1");
- }
-}
-/*
- * Ensure that creating a Java project initializes a container and refreshes the external jar at the same time
- * without throwing a ConcurrentModificationException
- * (regression test for bug 63534 ConcurrentModificationException after "catching up")
- */
-public void testContainerInitializer10() throws CoreException {
- class LogListener implements ILogListener {
- IStatus log;
- public void logging(IStatus status, String plugin) {
- this.log = status;
- }
- }
- LogListener listener = new LogListener();
- try {
- Platform.addLogListener(listener);
- final IJavaScriptProject p1 = createJavaProject("P1");
- final IJavaScriptProject p2 = createJavaProject("P2");
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P3", "/P1"}) {
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- super.initialize(containerPath, project);
- getJavaModel().refreshExternalArchives(new IJavaScriptElement[] {p1}, null);
- }
- });
- getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- p2.setRawIncludepath(new IIncludePathEntry[] {JavaScriptCore.newSourceEntry(new Path("/P2/src"))}, null);
- createProject("P3");
- editFile(
- "/P3/.project",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<projectDescription>\n" +
- " <name>P3</name>\n" +
- " <comment></comment>\n" +
- " <projects>\n" +
- " </projects>\n" +
- " <buildSpec>\n" +
- " <buildCommand>\n" +
- " <name>org.eclipse.wst.jsdt.core.javabuilder</name>\n" +
- " <arguments>\n" +
- " </arguments>\n" +
- " </buildCommand>\n" +
- " </buildSpec>\n" +
- " <natures>\n" +
- " <nature>org.eclipse.wst.jsdt.core.javanature</nature>\n" +
- " </natures>\n" +
- "</projectDescription>\n"
- );
- createFile(
- "/P3/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"var\" path=\"JCL_LIB\"/>\n" +
- " <classpathentry kind=\"con\" path=\"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>"
- );
- }
- }, null);
-
- assertEquals("Should not get any exception in log", null, listener.log);
- } finally {
- Platform.removeLogListener(listener);
- deleteProject("P1");
- deleteProject("P2");
- deleteProject("P3");
- }
-}
-/*
- * Ensure that a classpath initializer is not run on shutdown
- * (regression test for bug 93941 Classpath initialization on shutdown)
- */
-public void testContainerInitializer11() throws CoreException {
- boolean hasExited = false;
- try {
- ContainerInitializer.setInitializer(null);
- createJavaProject(
- "P",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- simulateExitRestart();
- ClasspathInitializerTests.DefaultContainerInitializer initializer = new ClasspathInitializerTests.DefaultContainerInitializer(new String[] {}) {
- public void initialize(IPath containerPath,IJavaScriptProject project) throws CoreException {
- assertTrue("Should not initialize container on shutdown", false);
- }
- };
- ContainerInitializer.setInitializer(initializer);
- simulateExit();
- hasExited = true;
- } finally {
- ContainerInitializer.setInitializer(null);
- if (hasExited)
- simulateRestart();
- deleteProject("P");
- }
-}
-
-/*
- * Ensure that the initializer is removed from the cache when the project is deleted
- * (regression test for bug 116072 cached classpath containers not removed when project deleted)
- */
-public void testContainerInitializer12() throws CoreException {
- try {
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1/lib.jar"}));
- IJavaScriptProject project = createJavaProject(
- "P1",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- createFile("/P1/lib.jar", "");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(getFile("/P1/lib.jar"));
- assertTrue("/P1/lib.jar should exist", root.exists());
- deleteProject("P1");
-
- class Initializer extends DefaultContainerInitializer {
- boolean initialized;
- public Initializer(String[] args) {
- super(args);
- }
- public void initialize(IPath containerPath, IJavaScriptProject p) throws CoreException {
- super.initialize(containerPath, p);
- this.initialized = true;
- }
- }
- Initializer initializer = new Initializer(new String[] {"P1", "/P1/lib.jar"});
- ContainerInitializer.setInitializer(initializer);
- createJavaProject(
- "P1",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- createFile("/P1/lib.jar", "");
- assertTrue("/P1/lib.jar should exist", root.exists());
- assertTrue("Should have been initialized", initializer.initialized);
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-
-/*
- * Ensures that no resource deta is reported if a container that was not initialized is initialized with null
- * (regression test for bug 149043 Unresolvable classpath container leads to lots of scheduled jobs)
- */
-public void testContainerInitializer13() throws CoreException {
- IResourceChangeListener listener = new IResourceChangeListener() {
- StringBuffer buffer = new StringBuffer();
- public void resourceChanged(IResourceChangeEvent event) {
- this.buffer.append(event.getDelta().findMember(new Path("/P1")));
- }
- public String toString() {
- return this.buffer.toString();
- }
- };
- try {
- NullContainerInitializer nullInitializer = new NullContainerInitializer();
- ContainerInitializer.setInitializer(nullInitializer);
- IJavaScriptProject project = createJavaProject(
- "P1",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
-
- // simulate state on startup
- simulateExitRestart();
-
- getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE);
-
- // force resolution of container
- project.findPackageFragmentRoots(project.getRawIncludepath()[0]);
-
- assertEquals(
- "Unexpected resource delta on startup",
- "",
- listener.toString()
- );
- } finally {
- getWorkspace().removeResourceChangeListener(listener);
- deleteProject("P1");
- }
-}
-
-/*
- * Ensures that a misbehaving container (that initializes another project than the one asked for) doesn't cause
- * the container to be initialized again
- * (regression test for bug 160005 Add protection about misbehaving container initializer)
- */
-public void testContainerInitializer14() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- class Container extends DefaultContainerInitializer {
- int initializeCount = 0;
- Container(String[] values) {
- super(values);
- }
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- this.initializeCount++;
- super.initialize(containerPath, getJavaProject("P1"));
- }
- }
- Container container = new Container(new String[] {"P2", "/P1/lib.jar"});
- ContainerInitializer.setInitializer(container);
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- p2.getResolvedIncludepath(true);
- assertEquals("Unexpected number of initalizations", 1, container.initializeCount);
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/*
- * Ensures that if a container is misbehaving (it doesn't initialize a project when asked for),
- * then the resulting container's classpath is not null
- * (regression test for bug 161846 Expanding a java project with invalid classpath container entries in Project Explorer causes CPU to stay at 100%)
- */
-public void testContainerInitializer15() throws CoreException {
- try {
- class Container extends DefaultContainerInitializer {
- Container(String[] values) {
- super(values);
- }
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- }
- }
- Container container = new Container(new String[] {"P1", "/P1/lib.jar"});
- ContainerInitializer.setInitializer(container);
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- IJsGlobalScopeContainer JsGlobalScopeContainer = JavaScriptCore.getJsGlobalScopeContainer(new Path("org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"), p1);
- assertClasspathEquals(JsGlobalScopeContainer.getIncludepathEntries(), "");
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-/*
- * Ensure that an initializer cannot return a project entry that points to the project of the container (cycle).
- */
-public void testContainerInitializer16() throws CoreException {
- try {
- ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1"}));
- JavaScriptModelException exception = null;
- try {
- IJavaScriptProject p1 = createJavaProject(
- "P1",
- new String[] {},
- new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- p1.getResolvedIncludepath(true);
- } catch (JavaScriptModelException e) {
- exception = e;
- }
- assertExceptionEquals(
- "Unexpected expection",
- "Project cannot reference itself: P1",
- exception);
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-public void testVariableInitializer01() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P1/lib.jar"}));
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {}, new String[] {"TEST_LIB"});
- IPackageFragmentRoot root = p2.getPackageFragmentRoot(getFile("/P1/lib.jar"));
- assertTrue("/P1/lib.jar should exist", root.exists());
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- VariablesInitializer.reset();
- }
-}
-public void testVariableInitializer02() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- createFile("/P1/src.zip", "");
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {
- "TEST_LIB", "/P1/lib.jar",
- "TEST_SRC", "/P1/src.zip",
- "TEST_ROOT", "src",
- }));
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {}, new String[] {"TEST_LIB,TEST_SRC,TEST_ROOT"});
- IPackageFragmentRoot root = p2.getPackageFragmentRoot(getFile("/P1/lib.jar"));
- assertEquals("Unexpected source attachment path", "/P1/src.zip", root.getSourceAttachmentPath().toString());
- assertEquals("Unexpected source attachment root path", "src", root.getSourceAttachmentRootPath().toString());
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- VariablesInitializer.reset();
- }
-}
-public void testVariableInitializer03() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- createFile("/P1/src.zip", "");
- String[] variableValues = new String[] {
- "TEST_LIB", "/P1/lib.jar",
- "TEST_SRC", "/P1/src.zip",
- "TEST_ROOT", "src",
- };
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(variableValues));
- createJavaProject("P2", new String[] {}, new String[] {"TEST_LIB,TEST_SRC,TEST_ROOT"});
-
- // simulate state on startup
- simulateExitRestart();
-
- startDeltas();
- //JavaModelManager.CP_RESOLVE_VERBOSE=true;
- getJavaProject("P2").getResolvedIncludepath(true);
-
- assertDeltas(
- "Unexpected delta on startup",
- ""
- );
- } finally {
- //JavaModelManager.CP_RESOLVE_VERBOSE=false;
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- VariablesInitializer.reset();
- }
-}
-public void testVariableInitializer04() throws CoreException {
- try {
- final StringBuffer buffer = new StringBuffer();
- VariablesInitializer.setInitializer(new VariablesInitializer.ITestInitializer() {
- public void initialize(String variable) throws JavaScriptModelException {
- buffer.append("Initializing " + variable + "\n");
- IPath path = new Path(variable.toLowerCase());
- buffer.append("Setting variable " + variable + " to " + path + "\n");
- JavaScriptCore.setIncludepathVariable(variable, path, null);
- }
- });
- createJavaProject("P", new String[] {}, new String[] {"TEST_LIB,TEST_SRC,TEST_ROOT"});
- assertEquals(
- "Initializing TEST_LIB\n" +
- "Setting variable TEST_LIB to test_lib\n",
- buffer.toString());
- } finally {
- deleteProject("P");
- VariablesInitializer.reset();
- }
-}
-public void testVariableInitializer05() throws CoreException {
- try {
- final StringBuffer buffer = new StringBuffer();
- VariablesInitializer.setInitializer(new VariablesInitializer.ITestInitializer() {
- public void initialize(String variable) throws JavaScriptModelException {
- buffer.append("Initializing " + variable + "\n");
- IPath path = new Path(variable.toLowerCase());
- JavaScriptCore.getIncludepathVariable("TEST_SRC");
- buffer.append("Setting variable " + variable + " to " + path + "\n");
- JavaScriptCore.setIncludepathVariable(variable, path, null);
- }
- });
- createJavaProject("P", new String[] {}, new String[] {"TEST_LIB,TEST_SRC,TEST_ROOT"});
- assertEquals(
- "Initializing TEST_LIB\n" +
- "Initializing TEST_SRC\n" +
- "Setting variable TEST_SRC to test_src\n" +
- "Setting variable TEST_LIB to test_lib\n",
- buffer.toString());
- } finally {
- deleteProject("P");
- VariablesInitializer.reset();
- }
-}
-/*
- * Ensures that if the initializer doesn't initialize a variable, it can be
- * initialized later on.
- */
-public void testVariableInitializer06() throws CoreException {
- try {
- final StringBuffer buffer = new StringBuffer();
- VariablesInitializer.setInitializer(new VariablesInitializer.ITestInitializer() {
- public void initialize(String variable) {
- // do nothing
- buffer.append("Ignoring request to initialize");
- }
- });
- IPath path = JavaScriptCore.getIncludepathVariable("TEST_SRC");
- assertEquals(
- "Unexpected value of TEST_SRC after initializer was called",
- null,
- path);
- IPath varValue = new Path("src.zip");
- JavaScriptCore.setIncludepathVariable("TEST_SRC", varValue, null);
- path = JavaScriptCore.getIncludepathVariable("TEST_SRC");
- assertEquals(
- "Unexpected value of TEST_SRC after setting it",
- varValue,
- path);
- } finally {
- VariablesInitializer.reset();
- }
-}
-public void testVariableInitializer07() throws CoreException {
- try {
- createProject("P1");
- createFile("/P1/lib.jar", "");
- createFile("/P1/src.zip", "");
- String[] variableValues = new String[] {
- "TEST_LIB", "/P1/lib.jar",
- "TEST_SRC", "/P1/src.zip",
- "TEST_ROOT", "src",
- };
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(variableValues));
- createJavaProject("P2", new String[] {}, new String[] {"TEST_LIB,TEST_SRC,TEST_ROOT"});
-
- // change value of TEST_LIB
- createFile("/P1/lib2.jar", "");
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {
- "TEST_LIB", "/P1/lib2.jar",
- "TEST_SRC", "/P1/src.zip",
- "TEST_ROOT", "src",
- }));
-
- // simulate state on startup
- simulateExitRestart();
-
- startDeltas();
- //JavaModelManager.CP_RESOLVE_VERBOSE=true;
- getJavaProject("P2").getResolvedIncludepath(true);
-
- assertDeltas(
- "Unexpected delta on startup",
- "P2[*]: {CHILDREN}\n" +
- " /P1/lib.jar[*]: {REMOVED FROM CLASSPATH}\n" +
- " /P1/lib2.jar[*]: {ADDED TO CLASSPATH}"
- );
- } finally {
- //JavaModelManager.CP_RESOLVE_VERBOSE=false;
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- VariablesInitializer.reset();
- }
-}
-/*
- * Ensure that an OperationCanceledException goes through
- * (regression test for bug 59363 Should surface cancellation exceptions)
- */
-
-public void testVariableInitializer08() throws CoreException {
- try {
- boolean gotException = false;
- try {
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P1/lib.jar"}) {
- public void initialize(String variable) throws JavaScriptModelException {
- throw new OperationCanceledException("test");
- }
- });
- IJavaScriptProject p1 = createJavaProject("P1", new String[] {}, new String[] {"TEST_LIB"});
- p1.getResolvedIncludepath(true);
- } catch (OperationCanceledException e) {
- gotException = true;
- }
- assertTrue("Should get an OperationCanceledException", gotException);
- } finally {
- deleteProject("P1");
- VariablesInitializer.reset();
- }
-}
-
-/*
- * Ensure that removing a classpath variable while initializing it doesn't throw a StackOverFlowError
- * (regression test for bug 112609 StackOverflow when initializing Java Core)
- */
-public void testVariableInitializer09() throws CoreException {
- try {
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P1/lib.jar"}) {
- public void initialize(String variable) throws JavaScriptModelException {
- JavaScriptCore.removeIncludepathVariable("TEST_LIB", null);
- }
- });
- IJavaScriptProject p1 = createJavaProject("P1", new String[] {}, new String[] {"TEST_LIB"});
- IIncludePathEntry[] resolvedClasspath = p1.getResolvedIncludepath(true);
- assertClasspathEquals(
- resolvedClasspath,
- ""
- );
- } finally {
- deleteProject("P1");
- VariablesInitializer.reset();
- }
-}
-/*
- * Ensures that not initializing a classpath variable and asking for its value returns null
- * (regression test for bug 113110 TestFailures in DebugSuite)
- */
-public void testVariableInitializer10() throws CoreException {
- try {
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P1/lib.jar"}) {
- public void initialize(String variable) throws JavaScriptModelException {
- // don't initialize
- }
- });
- // force resolution
- JavaScriptCore.getIncludepathVariable("TEST_LIB");
- // second call should still be null
- assertEquals("TEST_LIB should be null", null, JavaScriptCore.getIncludepathVariable("TEST_LIB"));
- } finally {
- deleteProject("P1");
- VariablesInitializer.reset();
- }
-}
-/**
- * Bug 125965: [prefs] "Export/Import preferences" should let user to choose wich preference to export/import
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125965"
- */
-public void testVariableInitializer11() throws CoreException {
- try {
- // Create initializer
- String varName = "TEST_LIB";
- String initialValue = "/P1/lib.jar";
- String newValue = "/tmp/file.jar";
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {varName, initialValue}));
- assertEquals("JavaScriptCore classpath value should have been initialized", JavaScriptCore.getIncludepathVariable(varName).toString(), initialValue);
-
- // Modify preference
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- IEclipsePreferences preferences = manager.getInstancePreferences();
- preferences.put(JavaModelManager.CP_VARIABLE_PREFERENCES_PREFIX+varName, newValue);
-
- // verify that JavaScriptCore preferences have been reset
- assertEquals("JavaScriptCore classpath value should be unchanged", JavaScriptCore.getIncludepathVariable(varName).toString(), initialValue);
- assertEquals("JavaScriptCore preferences value should be unchanged", preferences.get(varName, "X"), initialValue);
- } finally {
- VariablesInitializer.reset();
- }
-}
-
-/**
- * @bug 138599: [model][classpath] Need a way to mark a classpath variable as deprecated
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=138599"
- */
-public void testVariableInitializerDeprecated() throws CoreException {
- try {
- // Create initializer
- String varName = "TEST_DEPRECATED";
- String filePath = "/P1/lib.jar";
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {varName, filePath}));
- assertEquals("JavaScriptCore classpath value should have been initialized", JavaScriptCore.getIncludepathVariable(varName).toString(), filePath);
-
- // Verify that Classpath Variable is deprecated
- assertEquals("JavaScriptCore classpath variable should be deprecated", "Test deprecated flag", JavaScriptCore.getIncludepathVariableDeprecationMessage(varName));
-
- // Create project
- IJavaScriptProject project = createJavaProject("P1");
- createFile("/P1/lib.jar", "");
- IIncludePathEntry variable = JavaScriptCore.newVariableEntry(new Path("TEST_DEPRECATED"), null, null);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(project, variable, false);
- assertStatus("Classpath variable 'TEST_DEPRECATED' in project P1 is deprecated: 'Test deprecated flag'", status);
- assertFalse("Status should not be OK", status.isOK());
- assertEquals("Status should have WARNING severity", IStatus.WARNING, status.getSeverity());
- assertEquals("Status should have deprecated code", IJavaScriptModelStatusConstants.DEPRECATED_VARIABLE, status.getCode());
- } finally {
- VariablesInitializer.reset();
- deleteProject("P1");
- }
-}
-public void testVariableInitializerUnboundAndDeprecated() throws CoreException {
- try {
- // Create initializer
- String varName = "TEST_DEPRECATED";
- String filePath = "/P1/lib.jar";
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {varName, filePath}));
- assertEquals("JavaScriptCore classpath value should have been initialized", JavaScriptCore.getIncludepathVariable(varName).toString(), filePath);
-
- // Verify that Classpath Variable is deprecated
- assertEquals("JavaScriptCore classpath variable should be deprecated", "Test deprecated flag", JavaScriptCore.getIncludepathVariableDeprecationMessage(varName));
-
- // Create project
- IJavaScriptProject project = createJavaProject("P1");
- IIncludePathEntry variable = JavaScriptCore.newVariableEntry(new Path("TEST_DEPRECATED"), null, null);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(project, variable, false);
- assertStatus("Project P1 is missing required library: 'lib.jar'", status);
- assertFalse("Status should not be OK", status.isOK());
- assertEquals("Status should have WARNING severity", IStatus.ERROR, status.getSeverity());
- assertEquals("Status should have deprecated code", IJavaScriptModelStatusConstants.INVALID_INCLUDEPATH, status.getCode());
- } finally {
- VariablesInitializer.reset();
- deleteProject("P1");
- }
-}
-
-/**
- * @bug 156226: [model][classpath] Allow classpath variable to be marked as non modifiable
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156226"
- */
-public void testVariableInitializerReadOnly() throws CoreException {
- try {
- // Create initializer
- String varName = "TEST_READ_ONLY";
- String path = "/P1/lib.jar";
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] { varName, path }));
- assertEquals("JavaScriptCore classpath value should have been initialized", JavaScriptCore.getIncludepathVariable(varName).toString(), path);
-
- // verify that Classpath Variable is read-only
- assertTrue("JavaScriptCore classpath variable should be read-only", JavaScriptCore.isIncludepathVariableReadOnly(varName));
-
- // Create project
- IJavaScriptProject project = createJavaProject("P1");
- createFile("/P1/lib.jar", "");
- IIncludePathEntry variable = JavaScriptCore.newVariableEntry(new Path("TEST_READ_ONLY"), null, null);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(project, variable, false);
- assertStatus("OK", status);
- assertTrue("Status should be OK", status.isOK());
- assertEquals("Status should be VERIFIED_OK", JavaModelStatus.VERIFIED_OK, status);
- } finally {
- VariablesInitializer.reset();
- deleteProject("P1");
- }
-}
-public void testVariableInitializerDeprecatedAndReadOnly() throws CoreException {
- try {
- // Create initializer
- String varName = "TEST_DEPRECATED_READ_ONLY";
- String path = "/P1/lib.jar";
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] { varName, path }));
- assertEquals("JavaScriptCore classpath value should have been initialized", JavaScriptCore.getIncludepathVariable(varName).toString(), path);
-
- // verify that Classpath Variable is read-only
- assertEquals("JavaScriptCore classpath variable should be deprecated", "A deprecated and read-only initializer", JavaScriptCore.getIncludepathVariableDeprecationMessage(varName));
- assertTrue("JavaScriptCore classpath variable should be read-only", JavaScriptCore.isIncludepathVariableReadOnly(varName));
-
- // Create project
- IJavaScriptProject project = createJavaProject("P1");
- createFile("/P1/lib.jar", "");
- IIncludePathEntry variable = JavaScriptCore.newVariableEntry(new Path("TEST_DEPRECATED_READ_ONLY"), null, null);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(project, variable, false);
- assertStatus("Classpath variable 'TEST_DEPRECATED_READ_ONLY' in project P1 is deprecated: 'A deprecated and read-only initializer'", status);
- assertFalse("Status should not be OK", status.isOK());
- assertEquals("Status should have WARNING severity", IStatus.WARNING, status.getSeverity());
- assertEquals("Status should have deprecated code", IJavaScriptModelStatusConstants.DEPRECATED_VARIABLE, status.getCode());
- } finally {
- VariablesInitializer.reset();
- deleteProject("P1");
- }
-}
-
-/**
- * @bug 172207: [model] Marker for deprecated classpath variable should always have WARNING severity
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=172207"
- */
-public void testVariableInitializerBug172207() throws CoreException {
- try {
- // Create initializer
- String varName = "TEST_DEPRECATED_READ_ONLY";
- String path = "/P1/lib.jar";
- VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] { varName, path }));
- assertEquals("JavaScriptCore classpath value should have been initialized", JavaScriptCore.getIncludepathVariable(varName).toString(), path);
-
- // verify that Classpath Variable is read-only
- assertEquals("JavaScriptCore classpath variable should be deprecated", "A deprecated and read-only initializer", JavaScriptCore.getIncludepathVariableDeprecationMessage(varName));
- assertTrue("JavaScriptCore classpath variable should be read-only", JavaScriptCore.isIncludepathVariableReadOnly(varName));
-
- // Create project
- IJavaScriptProject project = createJavaProject("P1");
- createFile("/P1/lib.jar", "");
- IIncludePathEntry variable = JavaScriptCore.newVariableEntry(new Path("TEST_DEPRECATED_READ_ONLY"), null, null);
- IIncludePathEntry[] entries = project.getRawIncludepath();
- int length = entries.length;
- System.arraycopy(entries, 0, entries = new IIncludePathEntry[length+1], 0, length);
- entries[length] = variable;
- project.setRawIncludepath(entries, null);
-
- // verify markers
- waitForAutoBuild();
- IMarker[] markers = project.getProject().findMarkers(IJavaScriptModelMarker.BUILDPATH_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
- sortMarkers(markers);
- assertMarkers("Unexpected marker(s)",
- "Classpath variable 'TEST_DEPRECATED_READ_ONLY' in project P1 is deprecated: 'A deprecated and read-only initializer'",
- markers);
- assertEquals("Marker on deprecated variable should be a WARNING", IMarker.SEVERITY_WARNING, markers[0].getAttribute(IMarker.SEVERITY, -1));
- } finally {
- VariablesInitializer.reset();
- deleteProject("P1");
- }
-}
-
-/**
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=61872"
- */
-public void testUserLibraryInitializer1() throws CoreException {
- try {
- // Create new user library "SWT"
- JsGlobalScopeContainerInitializer initializer= JavaScriptCore.getJsGlobalScopeContainerInitializer(JavaScriptCore.USER_LIBRARY_CONTAINER_ID);
- String libraryName = "SWT";
- IPath containerPath = new Path(JavaScriptCore.USER_LIBRARY_CONTAINER_ID);
- UserLibraryJsGlobalScopeContainer containerSuggestion = new UserLibraryJsGlobalScopeContainer(libraryName);
- initializer.requestJsGlobalScopeContainerUpdate(containerPath.append(libraryName), null, containerSuggestion);
-
- // Create java project
- createJavaProject("p61872");
- IFile jarFile = createFile("/p61872/swt.jar", "");
- IFile srcFile = createFile("/p61872/swtsrc.zip", "");
-
- // Modify user library
- Preferences preferences = JavaScriptCore.getPlugin().getPluginPreferences();
- String propertyName = UserLibraryManager.CP_USERLIBRARY_PREFERENCES_PREFIX+"SWT";
- StringBuffer propertyValue = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<userlibrary systemlibrary=\"false\" version=\"1\">\r\n<archive");
- String jarFullPath = getWorkspaceRoot().getLocation().append(jarFile.getFullPath()).toString();
- propertyValue.append(" path=\""+jarFullPath);
- propertyValue.append("\"/>\r\n</userlibrary>\r\n");
- preferences.setValue(propertyName, propertyValue.toString());
- JavaScriptCore.getPlugin().savePluginPreferences();
-
- // Modify project classpath
- editFile(
- "/p61872/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"con\" path=\"org.eclipse.wst.jsdt.USER_LIBRARY/SWT\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>"
- );
-
- // Verify
- IIncludePathEntry[] entries = getJavaProject("p61872").getResolvedIncludepath(true);
- assertEquals("Invalid entries number in resolved classpath for project p61872!", 1, entries.length);
- assertEquals("Invalid path for project 61872 classpath entry!", jarFullPath.toLowerCase(), entries[0].getPath().toString().toLowerCase());
- assertNull("Project 61872 classpath entry should not have any source attached!", entries[0].getSourceAttachmentPath());
-
- // Modify user library
- propertyValue = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<userlibrary systemlibrary=\"false\" version=\"1\">\r\n<archive");
- String srcFullPath = getWorkspaceRoot().getLocation().append(srcFile.getFullPath()).toString();
- propertyValue.append(" sourceattachment=\""+srcFullPath);
- propertyValue.append("\" path=\""+jarFullPath);
- propertyValue.append("\"/>\r\n</userlibrary>\r\n");
- preferences.setValue(propertyName, propertyValue.toString());
- JavaScriptCore.getPlugin().savePluginPreferences();
-
- // Verify
- entries = getJavaProject("p61872").getResolvedIncludepath(true);
- assertEquals("Invalid entries number in resolved classpath for project p61872!", 1, entries.length);
- assertEquals("Invalid path for project 61872 classpath entry!", jarFullPath.toLowerCase(), entries[0].getPath().toString().toLowerCase());
- assertEquals("Invalid source attachement path for project 61872 classpath entry!", srcFullPath.toLowerCase(), entries[0].getSourceAttachmentPath().toString().toLowerCase());
- } finally {
- deleteProject("p61872");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathTests.java
deleted file mode 100644
index 7c936a0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathTests.java
+++ /dev/null
@@ -1,3032 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IAccessRule;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelMarker;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelStatus;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptConventions;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.core.ClasspathEntry;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.JavaProject;
-
-public class ClasspathTests extends ModifyingResourceTests {
-
- public class TestContainer implements IJsGlobalScopeContainer {
- IPath path;
- IIncludePathEntry[] entries;
- TestContainer(IPath path, IIncludePathEntry[] entries){
- this.path = path;
- this.entries = entries;
- }
- public IPath getPath() { return this.path; }
- /**
- * @deprecated Use {@link #getIncludepathEntries()} instead
- */
- public IIncludePathEntry[] getClasspathEntries() {
- return getIncludepathEntries();
- }
- public IIncludePathEntry[] getIncludepathEntries() { return this.entries; }
- public String getDescription() { return this.path.toString(); }
- public int getKind() { return 0; }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer#resolvedLibraryImport(java.lang.String)
- */
- public String[] resolvedLibraryImport(String a) {
- return new String[] {a};
- }
- }
-
-public ClasspathTests(String name) {
- super(name);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
- // Names of tests to run: can be "testBugXXXX" or "BugXXXX")
-// TESTS_PREFIX = "testClasspathDuplicateExtraAttribute";
-// TESTS_NAMES = new String[] {"testClasspathValidation42"};
-// TESTS_NUMBERS = new int[] { 23, 28, 38 };
-// TESTS_RANGE = new int[] { 21, 38 };
-}
-public static Test suite() {
- return buildModelTestSuite(ClasspathTests.class);
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- setupExternalJCL("jclMin");
-}
-protected void assertCycleMarkers(IJavaScriptProject project, IJavaScriptProject[] p, int[] expectedCycleParticipants) throws CoreException {
- waitForAutoBuild();
- StringBuffer expected = new StringBuffer("{");
- int expectedCount = 0;
- StringBuffer computed = new StringBuffer("{");
- int computedCount = 0;
- for (int j = 0; j < p.length; j++){
- int markerCount = this.numberOfCycleMarkers(p[j]);
- if (markerCount > 0){
- if (computedCount++ > 0) computed.append(", ");
- computed.append(p[j].getElementName());
- //computed.append(" (" + markerCount + ")");
- }
- markerCount = expectedCycleParticipants[j];
- if (markerCount > 0){
- if (expectedCount++ > 0) expected.append(", ");
- expected.append(p[j].getElementName());
- //expected.append(" (" + markerCount + ")");
- }
- }
- expected.append("}");
- computed.append("}");
- assertEquals("Invalid cycle detection after setting classpath for: "+project.getElementName(), expected.toString(), computed.toString());
-}
-private void assertEncodeDecodeEntry(String projectName, String expectedEncoded, IIncludePathEntry entry) {
- IJavaScriptProject project = getJavaProject(projectName);
- String encoded = project.encodeIncludepathEntry(entry);
- assertSourceEquals(
- "Unexpected encoded entry",
- expectedEncoded,
- encoded);
- IIncludePathEntry decoded = project.decodeIncludepathEntry(encoded);
- assertEquals(
- "Unexpected decoded entry",
- entry,
- decoded);
-}
-protected File createFile(File parent, String name, String content) throws IOException {
- File file = new File(parent, name);
- FileOutputStream out = new FileOutputStream(file);
- out.write(content.getBytes());
- out.close();
- /*
- * Need to change the time stamp to realize that the file has been modified
- */
- file.setLastModified(System.currentTimeMillis() + 2000);
- return file;
-}
-protected File createFolder(File parent, String name) {
- File file = new File(parent, name);
- file.mkdirs();
- return file;
-}
-protected int numberOfCycleMarkers(IJavaScriptProject javaProject) throws CoreException {
- IMarker[] markers = javaProject.getProject().findMarkers(IJavaScriptModelMarker.BUILDPATH_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
- int result = 0;
- for (int i = 0, length = markers.length; i < length; i++) {
- IMarker marker = markers[i];
- String cycleAttr = (String)marker.getAttribute(IJavaScriptModelMarker.CYCLE_DETECTED);
- if (cycleAttr != null && cycleAttr.equals("true")){ //$NON-NLS-1$
- result++;
- }
- }
- return result;
-}
-
-/**
- * Add an entry to the classpath for a non-existent root. Then create
- * the root and ensure that it comes alive.
- */
-public void testAddRoot1() throws CoreException {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP= project.getRawIncludepath();
-
- try {
- IIncludePathEntry newEntry= JavaScriptCore.newSourceEntry(project.getProject().getFullPath().append("extra"));
-
- IIncludePathEntry[] newCP= new IIncludePathEntry[originalCP.length + 1];
- System.arraycopy(originalCP, 0 , newCP, 0, originalCP.length);
- newCP[originalCP.length]= newEntry;
-
- project.setRawIncludepath(newCP, null);
-
- // now create the actual resource for the root and populate it
- project.getProject().getFolder("extra").create(false, true, null);
-
- IPackageFragmentRoot newRoot= getPackageFragmentRoot("P", "extra");
- assertTrue("New root should now be visible", newRoot != null);
- } finally {
- // cleanup
- this.deleteProject("P");
- }
-}
-
-/*
- * Adds an entry to the classpath for a non-existent root. Then creates
- * the root and ensures that the marker is removed.
- * (regression test for bug 161581 Adding a missing folder doesn't remove classpath marker)
- */
-public void testAddRoot2() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {});
- project.setRawIncludepath(createClasspath("P", new String[] {"/P/src", ""}), null);
- waitForAutoBuild();
-
- // now create the actual resource for the root
- project.getProject().getFolder("src").create(false, true, null);
- assertMarkers("Unexpected markers", "", project);
- } finally {
- // cleanup
- this.deleteProject("P");
- }
-}
-
-/**
- * Ensures that the reordering external resources in the classpath
- * generates the correct deltas.
- */
-public void testClasspathChangeExternalResources() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
-
- IIncludePathEntry[] newEntries = new IIncludePathEntry[2];
- newEntries[0] = JavaScriptCore.newLibraryEntry(getSystemJsPath(), null, null, false);
- newEntries[1] = JavaScriptCore.newLibraryEntry(getExternalJCLSourcePath(), null, null, false);
- setClasspath(proj, newEntries);
- startDeltas();
- IIncludePathEntry[] swappedEntries = new IIncludePathEntry[2];
- swappedEntries[0] = newEntries[1];
- swappedEntries[1] = newEntries[0];
- setClasspath(proj, swappedEntries);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " "+ getSystemJsPathString() +"[*]: {REORDERED}\n" +
- " "+ getExternalJCLSourcePathString() +"[*]: {REORDERED}\n" +
- " ResourceDelta(/P/.settings)[*]"
- );
- } finally {
- stopDeltas();
- this.deleteProject("P");
- }
-}
-
-/*
- * Test classpath corruption (23977)
- */
-public void testClasspathCorruption() throws CoreException {
- try {
- JavaProject p1 = (JavaProject)this.createJavaProject("P1", new String[]{""}, new String[]{}, new String[]{});
- this.createJavaProject("P2", new String[]{""}, new String[]{}, new String[]{});
- this.createFile("P2/foo.txt", "not a project");
- String newCPContent =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n"
- +"<classpath> \n"
- +" <classpathentry kind=\"src\" path=\"\"/> \n"
- +" <classpathentry kind=\"src\" path=\"/P2/foo.txt\"/> \n" // corruption here: target isn't a project
- +"</classpath> \n";
-
- IFile fileRsc = p1.getProject().getFile(JavaProject.SHARED_PROPERTIES_DIRECTORY + "/" + JavaProject.CLASSPATH_FILENAME);
- fileRsc.setContents(new ByteArrayInputStream(newCPContent.getBytes()), true, false, null);
-
- p1.close();
- JavaModelManager.PerProjectInfo perProjectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfo(p1.getProject(), true/*create if missing*/);
- perProjectInfo.setClasspath(null, null, null, null, null, null, null);
-
- // shouldn't fail
- p1.getExpandedClasspath();
-
- // if could reach that far, then all is fine
-
- } catch(ClassCastException e){
- assertTrue("internal ClassCastException on corrupted classpath file", false);
- } finally {
- // cleanup
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
-}
-
-/*
- * Test classpath read for non-javascript project or javascript project not opened yet (40658)
- */
-public void testClasspathFileRead() throws CoreException {
- try {
- final IProject proj = this.createProject("P1");
- String newCPContent =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n"
- +"<classpath> \n"
- +" <classpathentry kind=\"src\" path=\"src\"/> \n"
- +"</classpath> \n";
-
- this.createFolder("/P1/.settings/");
- this.createFile("/P1/.settings/"+JavaProject.CLASSPATH_FILENAME, newCPContent);
- final IJavaScriptProject jproj = JavaScriptCore.create(proj);
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) {
-
- IIncludePathEntry[] entries = jproj.readRawIncludepath(); // force to read classpath
- IIncludePathEntry entry = entries[0];
- assertEquals("first classpath entry should have been read", "/P1/src", entry.getPath().toString());
- }
- }, null);
- } finally {
- // cleanup
- this.deleteProject("P1");
- }
-}
-
-/*
- * Test classpath forced reload (20931) and new way to read classpath file (40658)
- */
-public void testClasspathForceReload() throws CoreException {
- try {
- final JavaProject p1 = (JavaProject)this.createJavaProject("P1", new String[]{""}, new String[]{}, new String[]{});
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
-
- p1.getRawIncludepath(); // force to read classpath
- createFolder("P1/src");
- String newCPContent =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n"
- +"<classpath> \n"
- +" <classpathentry kind=\"src\" path=\"src\"/> \n"
- +"</classpath> \n";
-
- IFile fileRsc = p1.getProject().getFile(JavaProject.SHARED_PROPERTIES_DIRECTORY + "/" + JavaProject.CLASSPATH_FILENAME);
- fileRsc.setContents(new ByteArrayInputStream(newCPContent.getBytes()), true, false, null);
-
- p1.close();
- IIncludePathEntry[] entries = p1.readRawIncludepath(); // force to read classpath
- assertEquals("source location should not have been refreshed", "/P1", entries[0].getPath().toString());
- }
- }, null);
- } finally {
- // cleanup
- this.deleteProject("P1");
- }
-}
-
-/**
- * Ensures that the setting the classpath with a library entry
- * changes the kind of the root from K_SOURCE to K_BINARY.
- */
-public void testClasspathCreateLibraryEntry() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- this.createFile("P/src/X.js", "function X() {}");
-
- IFolder rootFolder = proj.getProject().getFolder(new Path("src"));
- IPackageFragmentRoot root = proj.getPackageFragmentRoot(rootFolder);
-
- assertEquals(
- "Unexpected root kind 1",
- IPackageFragmentRoot.K_SOURCE,
- root.getKind());
- IPackageFragment pkg = root.getPackageFragment("");
- assertEquals(
- "Unexpected numbers of compilation units",
- 1,
- pkg.getJavaScriptUnits().length);
-
- this.setClasspath(
- proj,
- new IIncludePathEntry[] {
- JavaScriptCore.newLibraryEntry(rootFolder.getFullPath(), null, null, false)
- });
- assertEquals(
- "Unexpected root kind 2",
- IPackageFragmentRoot.K_BINARY,
- root.getKind());
- assertEquals(
- "Unexpected numbers of compilation units",
- 0,
- pkg.getJavaScriptUnits().length);
-
- //ensure that the new kind has been persisted in the classpath file
- proj.close();
- assertEquals(
- "Unexpected root kind 3",
- IPackageFragmentRoot.K_BINARY,
- root.getKind());
-
- } finally {
- this.deleteProject("P");
- }
-}
-
-/**
- * Tests the cross project classpath setting
- */
-public void testClasspathCrossProject() throws CoreException {
- IJavaScriptProject project = this.createJavaProject("P1", new String[] {""});
- this.createJavaProject("P2", new String[] {});
- try {
- startDeltas();
- IPackageFragmentRoot oldRoot= getPackageFragmentRoot("P1", "");
- IIncludePathEntry projectEntry= JavaScriptCore.newProjectEntry(new Path("/P2"), false);
- IIncludePathEntry[] newClasspath= new IIncludePathEntry[]{projectEntry};
- project.setRawIncludepath(newClasspath, null);
- project.getAllPackageFragmentRoots();
- IJavaScriptElementDelta removedDelta= getDeltaFor(oldRoot, true);
- assertDeltas(
- "Unexpected delta",
- "<project root>[*]: {REMOVED FROM CLASSPATH}",
- removedDelta);
- } finally {
- stopDeltas();
- this.deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/**
- * Delete a root and ensure the classpath is not updated (i.e. entry isn't removed).
- */
-public void testClasspathDeleteNestedRoot() throws CoreException {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"nested/src"}, new String[] {});
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "nested/src");
- IIncludePathEntry[] originalCP= project.getRawIncludepath();
-
- // delete the root
- deleteResource(root.getUnderlyingResource());
-
- IIncludePathEntry[] newCP= project.getRawIncludepath();
-
- try {
- // should still be an entry for the "src" folder
- assertTrue("classpath should not have been updated",
- newCP.length == 2 &&
- newCP[0].equals(originalCP[0]) &&
- newCP[1].equals(originalCP[1]));
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Test classpath diamond (23979)
- */
-public void testClasspathDiamond() throws CoreException {
- try {
- this.createJavaProject("P1", new String[]{""});
- this.createJavaProject("P2", new String[]{""}, new String[]{}, new String[]{"/P1"});
- this.createJavaProject("P3", new String[]{""}, new String[]{}, new String[]{"/P1", "/P2"});
- IJavaScriptProject p4 = this.createJavaProject("P4", new String[]{""}, new String[]{}, new String[]{"/P2", "/P3"});
-
- assertTrue("Should not detect cycle", !p4.hasIncludepathCycle(null));
-
- } finally {
- // cleanup
- this.deleteProjects(new String[] {"P1", "P2", "P3", "P4"});
- }
-}
-
-/**
- * Delete a nested root's parent folder and ensure the classpath is
- * not updated (i.e. entry isn't removed).
- */
-public void testClasspathDeleteNestedRootParent() throws CoreException {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"nested/src"}, new String[] {});
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "nested/src");
- IIncludePathEntry[] originalCP= project.getRawIncludepath();
-
- // delete the root's parent folder
- IFolder folder= (IFolder)root.getUnderlyingResource().getParent();
- deleteResource(folder);
-
- IIncludePathEntry[] newCP= project.getRawIncludepath();
-
- try {
-
- // should still be an entry for the "src" folder
- assertTrue("classpath should not have been updated",
- newCP.length == 2 &&
- newCP[0].equals(originalCP[0]) &&
- newCP[1].equals(originalCP[1]));
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Test that a classpath entry for an external jar is externalized
- * properly.
- */
-public void testClasspathExternalize() throws CoreException {
- try {
- IJavaScriptProject project= this.createJavaProject("P", new String[] {}, new String[] {getSystemJsPathString()});
- IIncludePathEntry[] classpath= project.getRawIncludepath();
- IIncludePathEntry jar= null;
- for (int i= 0; i < classpath.length; i++) {
- if (classpath[i].getEntryKind() == IIncludePathEntry.CPE_LIBRARY) {
- jar= classpath[i];
- break;
- }
- }
- project.close();
- project.open(null);
-
- classpath= project.getRawIncludepath();
- for (int i= 0; i < classpath.length; i++) {
- if (classpath[i].getEntryKind() == IIncludePathEntry.CPE_LIBRARY) {
- assertTrue("Paths must be the same", classpath[i].getPath().equals(jar.getPath()));
- break;
- }
- }
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Move a root and ensure the classpath is not updated (i.e. entry not renamed).
- */
-public void testClasspathMoveNestedRoot() throws CoreException {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"nested/src"}, new String[] {});
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "nested/src");
- IIncludePathEntry[] originalCP= project.getRawIncludepath();
-
- // delete the root
- IFolder folder= (IFolder)root.getUnderlyingResource();
- IPath originalPath= folder.getFullPath();
- IPath newPath= originalPath.removeLastSegments(1);
- newPath= newPath.append(new Path("newsrc"));
-
- startDeltas();
-
- folder.move(newPath, true, null);
-
- IIncludePathEntry[] newCP= project.getRawIncludepath();
-
- IPackageFragmentRoot newRoot= project.getPackageFragmentRoot(project.getProject().getFolder("nested").getFolder("newsrc"));
-
- try {
- // entry for the "src" folder wasn't replaced
- assertTrue("classpath not automatically updated", newCP.length == 2 &&
- newCP[1].equals(originalCP[1]) &&
- newCP[0].equals(originalCP[0]));
-
- IJavaScriptElementDelta rootDelta = getDeltaFor(root, true);
- IJavaScriptElementDelta projectDelta = getDeltaFor(newRoot.getParent(), true);
- assertTrue("should get delta for moved root", rootDelta != null &&
- rootDelta.getKind() == IJavaScriptElementDelta.REMOVED &&
- rootDelta.getFlags() == 0);
- assertTrue("should get delta indicating content changed for project", this.deltaContentChanged(projectDelta));
-
- } finally {
- stopDeltas();
- this.deleteProject("P");
- }
-}
-
-/**
- * Move a parent of a nested root and ensure the classpath is not updated (i.e. entry not renamed).
- */
-public void testClasspathMoveNestedRootParent() throws CoreException {
- try {
- IJavaScriptProject project =this.createJavaProject("P", new String[] {"nested/src"}, new String[] {});
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "nested/src");
- IIncludePathEntry[] originalCP= project.getRawIncludepath();
-
- // delete the root
- IFolder folder= (IFolder)root.getUnderlyingResource().getParent();
- IPath originalPath= folder.getFullPath();
- IPath newPath= originalPath.removeLastSegments(1);
- newPath= newPath.append(new Path("newsrc"));
- folder.move(newPath, true, null);
-
- IIncludePathEntry[] newCP= project.getRawIncludepath();
-
- // entry for the "src" folder wasn't replaced
- // entry for the "src" folder should not be replaced
- assertTrue("classpath should not automatically be updated", newCP.length == 2 &&
- newCP[1].equals(originalCP[1]) &&
- newCP[0].equals(originalCP[0]));
-
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Tests that nothing occurs when setting to the same classpath
- */
-public void testClasspathNoChanges() throws CoreException {
- try {
- IJavaScriptProject p = this.createJavaProject("P", new String[] {""});
- IIncludePathEntry[] oldClasspath= p.getRawIncludepath();
- startDeltas();
- p.setRawIncludepath(oldClasspath, null);
- assertDeltas("Unexpected delta", "");
- } finally {
- stopDeltas();
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that the setting the classpath with a reordered classpath generates
- * the correct deltas.
- */
-public void testClasspathReordering() throws CoreException {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"}, new String[] {getSystemJsPathString()});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
- IPackageFragmentRoot root = getPackageFragmentRoot("P", "src");
- try {
- IIncludePathEntry[] newEntries = new IIncludePathEntry[originalCP.length];
- int index = originalCP.length - 1;
- for (int i = 0; i < originalCP.length; i++) {
- newEntries[index] = originalCP[i];
- index--;
- }
- startDeltas();
- setClasspath(proj, newEntries);
- assertTrue("should be one delta - two roots reordered", this.deltaListener.deltas.length == 1);
- IJavaScriptElementDelta d = null;
- assertTrue("root should be reordered in the classpath", (d = getDeltaFor(root, true)) != null
- && (d.getFlags() & IJavaScriptElementDelta.F_REORDER) > 0);
- } finally {
- stopDeltas();
- this.deleteProject("P");
- }
-}
-
-/**
- * Should detect duplicate entries on the classpath
- */
-public void testClasspathValidation01() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = newCP[0];
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should have detected duplicate entries on the classpath",
- "Include path contains duplicate entry: \'src\' for project P",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-
-/**
- * Should detect nested source folders on the classpath
- */
-public void testClasspathValidation02() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"));
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should have detected nested source folders on the classpath",
- "Cannot nest \'P/src\' inside \'P\'. To enable the nesting exclude \'src/\' from \'P\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-
-/**
- * Should detect library folder nested inside source folder on the classpath
- */
-public void testClasspathValidation03() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newLibraryEntry(new Path("/P/src/lib"), null, null);
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should have detected library folder nested inside source folder on the classpath",
- "Cannot nest \'P/src/lib\' inside \'P/src\'. To enable the nesting exclude \'lib/\' from \'P/src\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-
-public void testClasspathValidation04() throws CoreException {
-
- IJavaScriptProject[] p = null;
- try {
-
- p = new IJavaScriptProject[]{
- this.createJavaProject("P0", new String[] {"src0"}),
- this.createJavaProject("P1", new String[] {"src1"}),
- };
-
- JavaScriptCore.setIncludepathVariable("var", new Path("/P1"), null);
-
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[]{
- JavaScriptCore.newSourceEntry(new Path("/P0/src0")),
- JavaScriptCore.newVariableEntry(new Path("var/src1"), null, null),
- };
-
- // validate classpath
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(p[0], newClasspath);
- assertStatus(
- "should not detect external source folder through a variable on the classpath",
- "OK",
- status);
-
- } finally {
- this.deleteProjects(new String[] {"P0", "P1"});
- }
-}
-
-public void testClasspathValidation05() throws CoreException {
-
- IJavaScriptProject[] p = null;
- try {
-
- p = new IJavaScriptProject[]{
- this.createJavaProject("P0", new String[] {"src0", "src1"}),
- this.createJavaProject("P1", new String[] {"src1"}),
- };
-
- JavaScriptCore.setJsGlobalScopeContainer(
- new Path("container/default"),
- new IJavaScriptProject[]{ p[0] },
- new IJsGlobalScopeContainer[] {
- new TestContainer(new Path("container/default"),
- new IIncludePathEntry[]{
- JavaScriptCore.newSourceEntry(new Path("/P0/src0")),
- JavaScriptCore.newVariableEntry(new Path("var/src1"), null, null) })
- },
- null);
-
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[]{
- JavaScriptCore.newSourceEntry(new Path("/P0/src1")),
- JavaScriptCore.newContainerEntry(new Path("container/default")),
- };
-
- // validate classpath
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(p[0], newClasspath);
- assertStatus(
- "should not have detected external source folder through a container on the classpath",
- "OK",
- status);
-
- // validate classpath entry
- status = JavaScriptConventions.validateClasspathEntry(p[0], newClasspath[1], true);
- assertStatus(
- "should have detected external source folder through a container on the classpath",
- "Invalid classpath container: \'container/default\' in project P0",
- status);
-
- } finally {
- this.deleteProjects(new String[] {"P0", "P1"});
- }
-}
-
-public void testClasspathValidation06() throws CoreException {
-
- IJavaScriptProject[] p = null;
- try {
-
- p = new IJavaScriptProject[]{
- this.createJavaProject("P0", new String[] {"src"}),
- };
-
- // validate classpath entry
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[]{
- JavaScriptCore.newSourceEntry(new Path("/P0")),
- JavaScriptCore.newSourceEntry(new Path("/P0/src")),
- };
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(p[0], newClasspath);
- assertStatus(
- "should have detected nested source folder",
- "Cannot nest \'P0/src\' inside \'P0\'. To enable the nesting exclude \'src/\' from \'P0\'",
- status);
- } finally {
- this.deleteProject("P0");
- }
-}
-/**
- * Should allow nested source folders on the classpath as long as the outer
- * folder excludes the inner one.
- */
-public void testClasspathValidation07() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[] {new Path("src/")});
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should have allowed nested source folders with exclusion on the classpath",
- "OK",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Should allow a nested binary folder in a source folder on the classpath as
- * long as the outer folder excludes the inner one.
- */
-public void testClasspathValidation08() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {}, new String[] {"lib"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[] {new Path("lib/")});
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should have allowed nested lib folders with exclusion on the classpath",
- "OK",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Should not allow nested source folders on the classpath if exclusion filter has no trailing slash.
- */
-public void testClasspathValidation15() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[] {new Path("**/src")});
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "End exclusion filter \'src\' with / to fully exclude \'P/src\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Should detect source folder nested inside library folder on the classpath
- */
-public void testClasspathValidation19() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {}, new String[] {"lib"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P/lib/src"));
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should have detected library folder nested inside source folder on the classpath",
- "Cannot nest \'P/lib/src\' inside library \'P/lib\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Should not allow exclusion patterns if project preference disallow them
- */
-public void testClasspathValidation21() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P/src"), new IPath[]{new Path("**/src")}, null);
-
- Map options = new Hashtable(5);
- options.put(JavaScriptCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS, JavaScriptCore.DISABLED);
- proj.setOptions(options);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "Inclusion or exclusion patterns are disabled in project P, cannot selectively include or exclude from entry: \'src\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * @bug 159325: Any idea why ClasspathEntry checks for string object reference instead of equals
- * @test Ensure that validation is correctly done even for other strings than JavaScriptCore constants...
- * Note that it's needed to change JavaScriptCore options as "ignore" is the default value and set option
- * to this value on java project will just remove it instead of putting another string object...
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=159325"
- */
-public void testClasspathValidation27_Bug159325_project() throws CoreException {
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- IJavaScriptProject proj1 = this.createJavaProject("P1", new String[] {});
- proj1.setOption(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_4);
-
- Hashtable options = JavaScriptCore.getOptions();
- options.put(JavaScriptCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaScriptCore.WARNING);
- JavaScriptCore.setOptions(options);
- IJavaScriptProject proj2 = this.createJavaProject("P2", new String[] {});
- proj2.setOption(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_1);
- proj2.setOption(JavaScriptCore.CORE_INCOMPATIBLE_JDK_LEVEL, new String("ignore".toCharArray()));
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(proj2, JavaScriptCore.newProjectEntry(new Path("/P1")), false);
- assertStatus("OK", status);
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- this.deleteProjects(new String[]{"P1", "P2"});
- }
-}
-public void testClasspathValidation27_Bug159325_lib() throws CoreException {
- Hashtable javaCoreOptions = JavaScriptCore.getOptions();
- try {
- IJavaScriptProject proj = this.createJavaProject("P1", new String[] {});
- proj.setOption(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_1);
-
- Hashtable options = JavaScriptCore.getOptions();
- options.put(JavaScriptCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaScriptCore.WARNING);
- JavaScriptCore.setOptions(options);
- proj.setOption(JavaScriptCore.CORE_INCOMPATIBLE_JDK_LEVEL, new String("ignore".toCharArray()));
-
- IIncludePathEntry library = JavaScriptCore.newLibraryEntry(new Path(getExternalJCLPathString(JavaScriptCore.VERSION_1_5)), null, null, ClasspathEntry.NO_ACCESS_RULES, null, false);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(proj, library, false);
- assertStatus("OK", status);
- } finally {
- JavaScriptCore.setOptions(javaCoreOptions);
- this.deleteProjects(new String[]{"P1", "P2"});
- }
-}
-/**
- * Should not allow nested source folders on the classpath if the outer
- * folder includes the inner one.
- */
-public void testClasspathValidation34() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[] {new Path("src/")}, new IPath[0], null);
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should not have allowed nested source folders with inclusion on the classpath",
- "Cannot nest \'P/src\' inside \'P\'. To enable the nesting exclude \'src/\' from \'P\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-
-/**
- * Should not allow a nested binary folder in a source folder on the classpath
- * if the outer folder includes the inner one.
- */
-public void testClasspathValidation35() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {}, new String[] {"lib"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[] {new Path("lib/")}, new Path[0], null);
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should not have allowed nested lib folders with inclusion on the classpath",
- "Cannot nest \'P/lib\' inside \'P\'. To enable the nesting exclude \'lib/\' from \'P\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-
-/**
- * Should allow nested source folders on the classpath if inclusion filter has no trailing slash.
- */
-public void testClasspathValidation36() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[] {new Path("**/src")}, new Path[0], null);
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "OK",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Should not allow inclusion patterns if project preference disallow them
- */
-public void testClasspathValidation37() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {});
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P/src"), new IPath[]{new Path("**/src")}, new Path[0], null);
-
- Map options = new Hashtable(5);
- options.put(JavaScriptCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS, JavaScriptCore.DISABLED);
- proj.setOptions(options);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "Inclusion or exclusion patterns are disabled in project P, cannot selectively include or exclude from entry: \'src\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Should detect nested source folders on the classpath and indicate the preference if disabled
- * (regression test for bug 122615 validate classpath propose to exlude a source folder even though exlusion patterns are disabled)
- */
-public void testClasspathValidation42() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {"src"});
- proj.setOption(JavaScriptCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS, JavaScriptCore.DISABLED);
- IIncludePathEntry[] originalCP = proj.getRawIncludepath();
-
- IIncludePathEntry[] newCP = new IIncludePathEntry[originalCP.length+1];
- System.arraycopy(originalCP, 0, newCP, 0, originalCP.length);
- newCP[originalCP.length] = JavaScriptCore.newSourceEntry(new Path("/P"));
-
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspath(proj, newCP);
-
- assertStatus(
- "should have detected nested source folders on the classpath",
- "Cannot nest \'P/src\' inside \'P\'. To allow the nesting enable use of exclusion patterns in the preferences of project \'P\' and exclude \'src/\' from \'P\'",
- status);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Setting the classpath with two entries specifying the same path
- * should fail.
- */
-public void testClasspathWithDuplicateEntries() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] cp= project.getRawIncludepath();
- IIncludePathEntry[] newCp= new IIncludePathEntry[cp.length *2];
- System.arraycopy(cp, 0, newCp, 0, cp.length);
- System.arraycopy(cp, 0, newCp, cp.length, cp.length);
- try {
- project.setRawIncludepath(newCp, null);
- } catch (JavaScriptModelException jme) {
- return;
- }
- assertTrue("Setting the classpath with two entries specifying the same path should fail", false);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Bug 94404: [model] Disallow classpath attributes with same key
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=94404"
- */
-public void testClasspathDuplicateExtraAttribute() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P1", new String[] {});
- IIncludePathAttribute[] extraAttributes = new IIncludePathAttribute[2];
- extraAttributes[0] = JavaScriptCore.newIncludepathAttribute("javadoc_location", "http://www.sample-url.org/doc/");
- extraAttributes[1] = JavaScriptCore.newIncludepathAttribute("javadoc_location", "d:/tmp");
-
- // Verify container entry validation
- IIncludePathEntry container = JavaScriptCore.newContainerEntry(new Path("JRE_CONTAINER"), ClasspathEntry.NO_ACCESS_RULES, extraAttributes, false);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(proj, container, false);
- assertStatus(
- "Duplicate extra attribute: \'javadoc_location\' in classpath entry \'JRE_CONTAINER\' for project 'P1'",
- status);
-
- // Verify library entry validation
- IIncludePathEntry library = JavaScriptCore.newLibraryEntry(new Path(getSystemJsPathString()), null, null, ClasspathEntry.NO_ACCESS_RULES, extraAttributes, false);
- status = JavaScriptConventions.validateClasspathEntry(proj, library, false);
- assertStatus(
- "Duplicate extra attribute: \'javadoc_location\' in classpath entry \'"+getExternalJCLPath("")+"\' for project 'P1'",
- status);
-
- // Verify project entry validation
- createJavaProject("P2");
- IIncludePathEntry projectEntry = JavaScriptCore.newProjectEntry(new Path("/P2"), ClasspathEntry.NO_ACCESS_RULES, false, extraAttributes, false);
- status = JavaScriptConventions.validateClasspathEntry(proj, projectEntry, false);
- assertStatus(
- "Duplicate extra attribute: \'javadoc_location\' in classpath entry \'/P2\' for project 'P1'",
- status);
-
- // Verify source entry validation
- createFolder("/P1/src");
- IIncludePathEntry sourceEntry = JavaScriptCore.newSourceEntry(new Path("/P1/src"), new IPath[0], new IPath[0], null, extraAttributes);
- status = JavaScriptConventions.validateClasspathEntry(proj, sourceEntry, false);
- assertStatus(
- "Duplicate extra attribute: \'javadoc_location\' in classpath entry \'src\' for project 'P1'",
- status);
-
- // Verify variable entry validation
- IIncludePathEntry variable = JavaScriptCore.newVariableEntry(new Path("JCL_LIB"), new Path("JCL_SRC"), null, ClasspathEntry.NO_ACCESS_RULES, extraAttributes, false);
- status = JavaScriptConventions.validateClasspathEntry(proj, variable, false);
- assertStatus(
- "Duplicate extra attribute: \'javadoc_location\' in classpath entry \'"+getExternalJCLPath("")+"\' for project 'P1'",
- status);
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
-}
-
-/**
- * Adding an entry to the classpath for a library that does not exist
- * should not break the model. The classpath should contain the
- * entry, but the root should not appear in the children.
- */
-public void testClasspathWithNonExistentLibraryEntry() throws CoreException {
- try {
- IJavaScriptProject project= this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalPath= project.getRawIncludepath();
- IPackageFragmentRoot[] originalRoots= project.getPackageFragmentRoots();
-
- IIncludePathEntry[] newPath= new IIncludePathEntry[originalPath.length + 1];
- System.arraycopy(originalPath, 0, newPath, 0, originalPath.length);
-
- IIncludePathEntry newEntry= JavaScriptCore.newLibraryEntry(new Path("c:/nothing/nozip.jar").makeAbsolute(), null, null, false);
- newPath[originalPath.length]= newEntry;
-
- project.setRawIncludepath(newPath, null);
-
- IIncludePathEntry[] getPath= project.getRawIncludepath();
- assertTrue("should be the same length", getPath.length == newPath.length);
- for (int i= 0; i < getPath.length; i++) {
- assertTrue("entries should be the same", getPath[i].equals(newPath[i]));
- }
-
- IPackageFragmentRoot[] newRoots= project.getPackageFragmentRoots();
- assertTrue("Should be the same number of roots", originalRoots.length == newRoots.length);
- for (int i= 0; i < newRoots.length; i++) {
- assertTrue("roots should be the same", originalRoots[i].equals(newRoots[i]));
- }
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Adding an entry to the classpath for a project that does not exist
- * should not break the model. The classpath should contain the
- * entry, but the root should not appear in the children.
- */
-public void testClasspathWithNonExistentProjectEntry() throws CoreException {
- try {
- IJavaScriptProject project= this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalPath= project.getRawIncludepath();
- IPackageFragmentRoot[] originalRoots= project.getPackageFragmentRoots();
-
- IIncludePathEntry[] newPath= new IIncludePathEntry[originalPath.length + 1];
- System.arraycopy(originalPath, 0, newPath, 0, originalPath.length);
-
- IIncludePathEntry newEntry= JavaScriptCore.newProjectEntry(new Path("/NoProject"), false);
- newPath[originalPath.length]= newEntry;
-
- project.setRawIncludepath(newPath, null);
-
- IIncludePathEntry[] getPath= project.getRawIncludepath();
- assertTrue("should be the same length", getPath.length == newPath.length);
- for (int i= 0; i < getPath.length; i++) {
- assertTrue("entries should be the same", getPath[i].equals(newPath[i]));
- }
-
- IPackageFragmentRoot[] newRoots= project.getPackageFragmentRoots();
- assertTrue("Should be the same number of roots", originalRoots.length == newRoots.length);
- for (int i= 0; i < newRoots.length; i++) {
- assertTrue("roots should be the same", originalRoots[i].equals(newRoots[i]));
- }
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Adding an entry to the classpath for a folder that does not exist
- * should not break the model. The classpath should contain the
- * entry, but the root should not appear in the children.
- */
-public void testClasspathWithNonExistentSourceEntry() throws CoreException {
- try {
- IJavaScriptProject project= this.createJavaProject("P", new String[] {"src"});
- IIncludePathEntry[] originalPath= project.getRawIncludepath();
- IPackageFragmentRoot[] originalRoots= project.getPackageFragmentRoots();
-
- IIncludePathEntry[] newPath= new IIncludePathEntry[originalPath.length + 1];
- System.arraycopy(originalPath, 0, newPath, 0, originalPath.length);
-
- IIncludePathEntry newEntry= JavaScriptCore.newSourceEntry(new Path("/P/moreSource"));
- newPath[originalPath.length]= newEntry;
-
- project.setRawIncludepath(newPath, null);
-
- IIncludePathEntry[] getPath= project.getRawIncludepath();
- assertTrue("should be the same length", getPath.length == newPath.length);
- for (int i= 0; i < getPath.length; i++) {
- assertTrue("entries should be the same", getPath[i].equals(newPath[i]));
- }
-
- IPackageFragmentRoot[] newRoots= project.getPackageFragmentRoots();
- assertTrue("Should be the same number of roots", originalRoots.length == newRoots.length);
- for (int i= 0; i < newRoots.length; i++) {
- assertTrue("roots should be the same", originalRoots[i].equals(newRoots[i]));
- }
- } finally {
- this.deleteProject("P");
- }
-}
-
-/**
- * Ensure that cycle are properly reported.
- */
-public void testCycleReport() throws CoreException {
-
- try {
- IJavaScriptProject p1 = this.createJavaProject("P1", new String[] {""});
- IJavaScriptProject p2 = this.createJavaProject("P2", new String[] {""});
- IJavaScriptProject p3 = this.createJavaProject("P3", new String[] {""}, new String[] {}, new String[] {"/P2"});
-
- // Ensure no cycle reported
- IJavaScriptProject[] projects = { p1, p2, p3 };
- int cycleMarkerCount = 0;
- for (int i = 0; i < projects.length; i++){
- cycleMarkerCount += this.numberOfCycleMarkers(projects[i]);
- }
- assertTrue("Should have no cycle markers", cycleMarkerCount == 0);
-
- // Add cycle
- IIncludePathEntry[] originalP1CP= p1.getRawIncludepath();
- IIncludePathEntry[] originalP2CP= p2.getRawIncludepath();
-
- // Add P1 as a prerequesite of P2
- int length = originalP2CP.length;
- IIncludePathEntry[] newCP= new IIncludePathEntry[length + 1];
- System.arraycopy(originalP2CP, 0 , newCP, 0, length);
- newCP[length]= JavaScriptCore.newProjectEntry(p1.getProject().getFullPath(), false);
- p2.setRawIncludepath(newCP, null);
-
- // Add P3 as a prerequesite of P1
- length = originalP1CP.length;
- newCP= new IIncludePathEntry[length + 1];
- System.arraycopy(originalP1CP, 0 , newCP, 0, length);
- newCP[length]= JavaScriptCore.newProjectEntry(p3.getProject().getFullPath(), false);
- p1.setRawIncludepath(newCP, null);
-
- waitForAutoBuild(); // wait for cycle markers to be created
- cycleMarkerCount = 0;
- for (int i = 0; i < projects.length; i++){
- cycleMarkerCount += numberOfCycleMarkers(projects[i]);
- }
- assertEquals("Unexpected number of projects involved in a classpath cycle", 3, cycleMarkerCount);
-
- } finally {
- // cleanup
- deleteProjects(new String[] {"P1", "P2", "P3"});
- }
-}
-/**
- * Ensures that the default classpath locations are correct.
- * The default classpath should be the root of the project.
- */
-public void testDefaultClasspathLocation() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
- IIncludePathEntry[] classpath = project.getRawIncludepath();
- assertTrue("Incorrect default classpath; to many entries", classpath.length == 2);
- assertTrue("Incorrect default classpath: " + classpath[0], classpath[0].getPath().equals(project.getUnderlyingResource().getFullPath()));
- } finally {
- this.deleteProject("P");
- }
-}
-
-/**
- * Setting the classpath to empty should result in no entries,
- * and a delta with removed roots.
- */
-public void testEmptyClasspath() throws CoreException {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
- try {
- startDeltas();
- setClasspath(project, new IIncludePathEntry[] {});
- IIncludePathEntry[] cp= project.getRawIncludepath();
- assertTrue("classpath should have no entries", cp.length == 0);
-
- // ensure the deltas are correct
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " <project root>[*]: {REMOVED FROM CLASSPATH}\n" +
- " D:\\WTPDevelopment\\junit-workspace\\.metadata\\.plugins\\org.eclipse.wst.jsdt.core\\libraries\\system.js[*]: {REORDERED}\n" +
- " ResourceDelta(/P/.settings)[*]"
- );
- } finally {
- stopDeltas();
- this.deleteProject("P");
- }
-}
-/*
- * Ensures that a source folder that contains character that must be encoded can be written.
- * (regression test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=70193)
- */
-public void testEncoding() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src\u3400"});
- IFile file = getFile("/P/.settings/.jsdtscope");
- String encodedContents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(file, "UTF-8"));
- encodedContents = Util.convertToIndependantLineDelimiter(encodedContents);
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src\u3400\"/>\n" +
- " <classpathentry kind=\"con\" path=\"org.eclipse.wst.jsdt.launching.JRE_CONTAINER\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n",
- encodedContents);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a source classpath entry can be encoded and decoded.
- */
-public void testEncodeDecodeEntry01() {
- assertEncodeDecodeEntry(
- "P",
- "<classpathentry kind=\"src\" path=\"src\"/>\n",
- JavaScriptCore.newSourceEntry(new Path("/P/src"))
- );
-}
-/*
- * Ensures that a source classpath entry with all possible attributes can be encoded and decoded.
- */
-public void testEncodeDecodeEntry02() {
- assertEncodeDecodeEntry(
- "P",
- "<classpathentry excluding=\"**/X.js\" including=\"**/Y.js\" kind=\"src\" output=\"bin\" path=\"src\">\n" +
- " <attributes>\n" +
- " <attribute name=\"attrName\" value=\"some value\"/>\n" +
- " </attributes>\n" +
- "</classpathentry>\n",
- JavaScriptCore.newSourceEntry(
- new Path("/P/src"),
- new IPath[] {new Path("**/Y.js")},
- new IPath[] {new Path("**/X.js")},
- new Path("/P/bin"),
- new IIncludePathAttribute[] {JavaScriptCore.newIncludepathAttribute("attrName", "some value")})
- );
-}
-/*
- * Ensures that a project classpath entry can be encoded and decoded.
- */
-public void testEncodeDecodeEntry03() {
- assertEncodeDecodeEntry(
- "P1",
- "<classpathentry kind=\"src\" path=\"/P2\"/>\n",
- JavaScriptCore.newProjectEntry(new Path("/P2"))
- );
-}
-/*
- * Ensures that a library classpath entry can be encoded and decoded.
- */
-public void testEncodeDecodeEntry04() {
- assertEncodeDecodeEntry(
- "P",
- "<classpathentry exported=\"true\" kind=\"lib\" path=\"lib.jar\" rootpath=\"root\" sourcepath=\"src.zip\">\n" +
- " <attributes>\n" +
- " <attribute name=\"attr1\" value=\"val1\"/>\n" +
- " </attributes>\n" +
- " <accessrules>\n" +
- " <accessrule kind=\"accessible\" pattern=\"**/A*.js\"/>\n" +
- " </accessrules>\n" +
- "</classpathentry>\n",
- JavaScriptCore.newLibraryEntry(
- new Path("/P/lib.jar"),
- new Path("/P/src.zip"),
- new Path("root"),
- new IAccessRule[] {JavaScriptCore.newAccessRule(new Path("**/A*.js"), IAccessRule.K_ACCESSIBLE)},
- new IIncludePathAttribute[] {JavaScriptCore.newIncludepathAttribute("attr1", "val1")},
- true)
- );
-}
-/*
- * Ensures that a library classpath entry can be encoded and decoded.
- */
-public void testEncodeDecodeEntry05() {
- assertEncodeDecodeEntry(
- "P",
- "<classpathentry exported=\"true\" kind=\"lib\" path=\"lib.jar\" rootpath=\"root\" sourcepath=\"src.zip\">\n" +
- " <attributes>\n" +
- " <attribute name=\"attr1\" value=\"val1\"/>\n" +
- " </attributes>\n" +
- " <accessrules>\n" +
- " <accessrule ignoreifbetter=\"true\" kind=\"accessible\" pattern=\"**/A*.js\"/>\n" +
- " </accessrules>\n" +
- "</classpathentry>\n",
- JavaScriptCore.newLibraryEntry(
- new Path("/P/lib.jar"),
- new Path("/P/src.zip"),
- new Path("root"),
- new IAccessRule[] {JavaScriptCore.newAccessRule(new Path("**/A*.js"), IAccessRule.K_ACCESSIBLE | IAccessRule.IGNORE_IF_BETTER)},
- new IIncludePathAttribute[] {JavaScriptCore.newIncludepathAttribute("attr1", "val1")},
- true)
- );
-}
-/**
- * Ensures that adding an empty classpath container
- * generates the correct deltas.
- */
-public void testEmptyContainer() throws CoreException {
- try {
- IJavaScriptProject proj = createJavaProject("P", new String[] {});
-
- startDeltas();
-
- // create container
- JavaScriptCore.setJsGlobalScopeContainer(
- new Path("container/default"),
- new IJavaScriptProject[]{ proj },
- new IJsGlobalScopeContainer[] {
- new TestContainer(
- new Path("container/default"),
- new IIncludePathEntry[] {})
- },
- null);
-
- // set P's classpath with this container
- IIncludePathEntry container = JavaScriptCore.newContainerEntry(new Path("container/default"), true);
- proj.setRawIncludepath(new IIncludePathEntry[] {container}, null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CONTENT | CLASSPATH CHANGED}\n" +
- " D:\\WTPDevelopment\\junit-workspace\\.metadata\\.plugins\\org.eclipse.wst.jsdt.core\\libraries\\system.js[*]: {REORDERED}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
- } finally {
- stopDeltas();
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a .classpath with an empty inclusion pattern is correctly handled
- * (regression test for bug 105581 Creating a Java project from existing source fails because of "Unhandled event loop exception":)
- */
-public void testEmptyInclusionPattern() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {""});
- project.open(null);
- editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry including=\"X.java|\" kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>"
- );
- project.getProject().close(null);
- project.getProject().open(null);
- project.getPackageFragmentRoot(project.getProject()).open(null);
- IIncludePathEntry[] classpath = project.getRawIncludepath();
- assertClasspathEquals(
- classpath,
- "/P[CPE_SOURCE][K_SOURCE][isExported:false][including:X.java]"
- );
- } finally {
- deleteProject("P");
- }
-}
-/**
- * Exporting a container should make it visible to its dependent project.
- * (regression test for bug 21749 Exported libraries and source folders)
- */
-public void testExportContainer() throws CoreException {
- try {
- IJavaScriptProject p1 = this.createJavaProject("P1", new String[] {""});
-
- // create container
- JavaScriptCore.setJsGlobalScopeContainer(
- new Path("container/default"),
- new IJavaScriptProject[]{ p1 },
- new IJsGlobalScopeContainer[] {
- new TestContainer(
- new Path("container/default"),
- new IIncludePathEntry[] {
- JavaScriptCore.newLibraryEntry(getExternalJCLPath(""), null, null)
- })
- },
- null);
-
- // set P1's classpath with this container
- IIncludePathEntry container = JavaScriptCore.newContainerEntry(new Path("container/default"), true);
- p1.setRawIncludepath(new IIncludePathEntry[] {container}, null);
-
- // create dependent project P2
- IJavaScriptProject p2 = this.createJavaProject("P2", new String[] {}, new String[] {}, new String[] {"/P1"});
- IIncludePathEntry[] classpath = ((JavaProject)p2).getExpandedClasspath();
-
- // ensure container is exported to P2
- assertEquals("Unexpected number of classpath entries", 2, classpath.length);
- assertEquals("Unexpected first entry", "/P1", classpath[0].getPath().toString());
- assertEquals("Unexpected second entry", getSystemJsPathString(), classpath[1].getPath().toOSString());
- } finally {
- this.deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/*
- * Ensures that setting 0 extra classpath attributes generates the correct .classpath file.
- */
-public void testExtraAttributes1() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IIncludePathEntry entry = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[0], new IPath[0], null, new IIncludePathAttribute[] {});
- project.setRawIncludepath(new IIncludePathEntry[] {entry}, null);
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that setting 1 extra classpath attributes generates the correct .classpath file.
- */
-public void testExtraAttributes2() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IIncludePathAttribute attribute = JavaScriptCore.newIncludepathAttribute("foo", "some value");
- IIncludePathEntry entry = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[0], new IPath[0], null, new IIncludePathAttribute[] {attribute});
- project.setRawIncludepath(new IIncludePathEntry[] {entry}, null);
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\">\n" +
- " <attributes>\n" +
- " <attribute name=\"foo\" value=\"some value\"/>\n" +
- " </attributes>\n" +
- " </classpathentry>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that setting 2 extra classpath attributes generates the correct .classpath file.
- */
-public void testExtraAttributes3() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IIncludePathAttribute attribute1 = JavaScriptCore.newIncludepathAttribute("foo", "some value");
- IIncludePathAttribute attribute2 = JavaScriptCore.newIncludepathAttribute("bar", "other value");
- IIncludePathEntry entry = JavaScriptCore.newSourceEntry(new Path("/P"), new IPath[0], new IPath[0], null, new IIncludePathAttribute[] {attribute1, attribute2});
- project.setRawIncludepath(new IIncludePathEntry[] {entry}, null);
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\">\n" +
- " <attributes>\n" +
- " <attribute name=\"foo\" value=\"some value\"/>\n" +
- " <attribute name=\"bar\" value=\"other value\"/>\n" +
- " </attributes>\n" +
- " </classpathentry>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that extra classpath attributes in a .classpath file are correctly read.
- */
-public void testExtraAttributes4() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\">\n" +
- " <attributes>\n" +
- " <attribute value=\"some value\" name=\"foo\"/>\n" +
- " </attributes>\n" +
- " </classpathentry>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n"
- );
- assertClasspathEquals(
- project.getRawIncludepath(),
- "/P[CPE_SOURCE][K_SOURCE][isExported:false][attributes:foo=some value]"
- );
- } finally {
- deleteProject("P");
- }
-}
-/**
- * Test IJavaScriptProject.hasClasspathCycle(IIncludePathEntry[]).
- */
-public void testHasClasspathCycle() throws CoreException {
- try {
- IJavaScriptProject p1 = this.createJavaProject("P1", new String[] {""});
- IJavaScriptProject p2 = this.createJavaProject("P2", new String[] {""});
- this.createJavaProject("P3", new String[] {""}, new String[] {}, new String[] {"/P1"});
-
- IIncludePathEntry[] originalP1CP= p1.getRawIncludepath();
- IIncludePathEntry[] originalP2CP= p2.getRawIncludepath();
-
- // Ensure no cycle reported
- assertTrue("P1 should not have a cycle", !p1.hasIncludepathCycle(originalP1CP));
-
- // Ensure that adding NervousTest as a prerequesite of P2 doesn't report a cycle
- int length = originalP2CP.length;
- IIncludePathEntry[] newCP= new IIncludePathEntry[length + 1];
- System.arraycopy(originalP2CP, 0 , newCP, 0, length);
- newCP[length]= JavaScriptCore.newProjectEntry(p1.getProject().getFullPath(), false);
- assertTrue("P2 should not have a cycle", !p2.hasIncludepathCycle(newCP));
- p2.setRawIncludepath(newCP, null);
-
- // Ensure that adding P3 as a prerequesite of P1 reports a cycle
- length = originalP1CP.length;
- newCP= new IIncludePathEntry[length + 1];
- System.arraycopy(originalP1CP, 0 , newCP, 0, length);
- newCP[length]= JavaScriptCore.newProjectEntry(p2.getProject().getFullPath(), false);
- assertTrue("P3 should have a cycle", p2.hasIncludepathCycle(newCP));
-
- // Ensure a cycle is not reported through markers
- IWorkspace workspace = getJavaModel().getWorkspace();
- IMarker[] markers = workspace.getRoot().findMarkers(IJavaScriptModelMarker.TRANSIENT_PROBLEM, true, 1);
- boolean hasCycleMarker = false;
- for (int i = 0; i < markers.length; i++){
- if (markers[i].getAttribute(IJavaScriptModelMarker.CYCLE_DETECTED) != null) {
- hasCycleMarker = true;
- break;
- }
- }
- assertTrue("Should have no cycle markers", !hasCycleMarker);
-
- } finally {
- // cleanup
- this.deleteProjects(new String[] {"P1", "P2", "P3"});
- }
-}
-/**
- * Ensures that a marker is created if editing the .classpath results in an invalid classpath.
- */
-public void testInvalidClasspath1() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"src"});
- this.editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src\"/\n" + // missing closing >
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>"
- );
- assertMarkers(
- "Unexpected markers",
- "XML format error in \'.classpath\' file of project P: Bad format",
- project);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that a marker is created if editing the .classpath results in an invalid classpath.
- */
-public void testInvalidClasspath2() throws CoreException {
- try {
- IJavaScriptProject javaProject = this.createJavaProject("P", new String[] {"src"});
- this.editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src1\" path=\"src\"/>\n" + // invalid kind: src1
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>"
- );
- assertMarkers(
- "Unexpected markers",
- "Illegal entry in \'.classpath\' of project P file: Unknown kind: \'src1\'",
- javaProject);
-
- // Verify that error marker is not removed after build
- // (regression test for bug 42366: Classpath validation error message removed while rebuilding a project.)
- IProject project = javaProject.getProject();
- project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- waitForAutoBuild();
- assertMarkers(
- "Unexpected markers",
- "Illegal entry in \'.classpath\' of project P file: Unknown kind: \'src1\'",
- javaProject);
- } finally {
- this.deleteProject("P");
- }
-}
-
-/*
- * Ensures that a non existing source folder cannot be put on the classpath.
- * (regression test for bug 66512 Invalid classpath entry not rejected)
- */
-public void testInvalidSourceFolder() throws CoreException {
- try {
- createJavaProject("P1");
- IJavaScriptProject proj = createJavaProject("P2", new String[] {}, new String[] {}, new String[] {"/P1/src1/src2"});
- assertMarkers(
- "Unexpected markers",
- "Project P2 is missing required source folder: \'/P1/src1/src2\'",
- proj);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Ensures that only one marker is created if building a project that is
- * missing its .classpath file multiple times.
- * (regression test for bug 39877 Rebuild All generates extra "Unable to read classpath" entry.)
- */
-public void testMissingClasspath() throws CoreException {
- try {
- IJavaScriptProject javaProject = createJavaProject("P");
- IProject project = javaProject.getProject();
- project.close(null);
- deleteFile(new File(project.getLocation().toOSString(), ".settings/.jsdtscope"));
- waitForAutoBuild();
- project.open(null);
- waitForAutoBuild();
- project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- waitForAutoBuild();
- project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- waitForAutoBuild();
- assertMarkers(
- "Unexpected markers",
- "Unable to read \'.jsdtscope\' file of project P",
- javaProject);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Test that a marker is added when a project as a missing project in its classpath.
- */
-public void testMissingPrereq1() throws CoreException {
- try {
- IJavaScriptProject javaProject = this.createJavaProject("A", new String[] {});
- IIncludePathEntry[] classpath =
- new IIncludePathEntry[] {
- JavaScriptCore.newProjectEntry(new Path("/B"))
- };
- javaProject.setRawIncludepath(classpath, null);
- this.assertMarkers(
- "Unexpected markers",
- "Project A is missing required Java project: \'B\'",
- javaProject);
- } finally {
- this.deleteProject("A");
- }
-}
-/**
- * Test that a marker is added when a project as a missing project in its classpath.
- */
-public void testMissingPrereq2() throws CoreException {
- try {
- IJavaScriptProject javaProject =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {"/B"});
- this.assertMarkers(
- "Unexpected markers",
- "Project A is missing required Java project: \'B\'",
- javaProject);
- } finally {
- this.deleteProject("A");
- }
-}
-/**
- * Test that a marker indicating a missing project is removed when the project is added.
- */
-public void testMissingPrereq3() throws CoreException {
- try {
- IJavaScriptProject javaProject =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {"/B"});
- this.createJavaProject("B", new String[] {});
- this.assertMarkers("Unexpected markers", "", javaProject);
- } finally {
- this.deleteProjects(new String[] {"A", "B"});
- }
-}
-/**
- * Test that a marker indicating a cycle is removed when a project in the cycle is deleted
- * and replaced with a missing prereq marker.
- * (regression test for bug 15168 circular errors not reported)
- */
-public void testMissingPrereq4() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {"/B"});
- IJavaScriptProject projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {"/A"});
- this.assertMarkers(
- "Unexpected markers for project A",
- "A cycle was detected in the include path of project: A",
- projectA);
- this.assertMarkers(
- "Unexpected markers for project B",
- "A cycle was detected in the include path of project: B",
- projectB);
-
- // delete project B
- this.deleteProject("B");
- this.assertMarkers(
- "Unexpected markers for project A after deleting of project B",
- "Project A is missing required Java project: \'B\'",
- projectA);
-
- // add project B back
- projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {"/A"});
- this.assertMarkers(
- "Unexpected markers for project A after adding project B back",
- "A cycle was detected in the build path of project: A",
- projectA);
- this.assertMarkers(
- "Unexpected markers for project B after adding project B back",
- "A cycle was detected in the build path of project: B",
- projectB);
-
- } finally {
- this.deleteProjects(new String[] {"A", "B"});
- }
-}
-/**
- * Setting the classpath to null should be the same as using the
- * default classpath.
- */
-public void testNullClasspath() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
- setClasspath(project, null);
- IIncludePathEntry[] cp= project.getRawIncludepath();
- assertTrue("classpath should have one root entry", cp.length == 1 && cp[0].getPath().equals(project.getUnderlyingResource().getFullPath()));
- } finally {
- this.deleteProject("P");
- }
-}
-
-/*
- * Ensures that setting the 'combineAccessRules' flag to false on a project entry generates the correct .classpath file.
- */
-public void testCombineAccessRules1() throws CoreException {
- try {
- createJavaProject("P1");
- IJavaScriptProject project = createJavaProject("P2");
- IIncludePathEntry entry = JavaScriptCore.newProjectEntry(new Path("/P1"), (IAccessRule[]) null, false/*don't combine*/, new IIncludePathAttribute[] {}, false);
- project.setRawIncludepath(new IIncludePathEntry[] {entry}, null);
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P2/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry combineaccessrules=\"false\" kind=\"src\" path=\"/P1\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/*
- * Ensures that setting the 'combineAccessRules' flag to true on a project entry generates the correct .classpath file.
- */
-public void testCombineAccessRules2() throws CoreException {
- try {
- createJavaProject("P1");
- IJavaScriptProject project = createJavaProject("P2");
- IIncludePathEntry entry = JavaScriptCore.newProjectEntry(new Path("/P1"), (IAccessRule[]) null, true/*combine*/, new IIncludePathAttribute[] {}, false);
- project.setRawIncludepath(new IIncludePathEntry[] {entry}, null);
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P2/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"/P1\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/*
- * Ensures that 'combineAccessRules' flag in a .classpath file is correctly read.
- */
-public void testCombineAccessRules3() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P2");
- editFile(
- "/P2/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" combineaccessrules=\"false\" path=\"/P1\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n"
- );
- assertClasspathEquals(
- project.getRawIncludepath(),
- "/P1[CPE_PROJECT][K_SOURCE][isExported:false][combine access rules:false]"
- );
- } finally {
- deleteProject("P2");
- }
-}
-
-/*
- * Ensures that the absence of 'combineAccessRules' flag in a .classpath file is correctly handled.
- */
-public void testCombineAccessRules4() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P2");
- editFile(
- "/P2/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"/P1\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n"
- );
- assertClasspathEquals(
- project.getRawIncludepath(),
- "/P1[CPE_PROJECT][K_SOURCE][isExported:false][combine access rules:true]"
- );
- } finally {
- deleteProject("P2");
- }
-}
-
-/*
- * Ensures that the absence of 'combineAccessRules' flag in a .classpath file is correctly handled.
- */
-public void testCombineAccessRules5() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P2");
- editFile(
- "/P2/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>\n"
- );
- assertClasspathEquals(
- project.getRawIncludepath(),
- "/P2/src[CPE_SOURCE][K_SOURCE][isExported:false]"
- );
- } finally {
- deleteProject("P2");
- }
-}
-
-public void testCycleDetection() throws CoreException {
-
- int max = 5;
- IJavaScriptProject[] p = new IJavaScriptProject[max];
- String[] projectNames = new String[max];
- try {
- for (int i = 0; i < max; i++) {
- projectNames[i] = "P"+i;
- p[i] = this.createJavaProject(projectNames[i], new String[] {""});
- }
-
- IIncludePathEntry[][] extraEntries = new IIncludePathEntry[][]{
- { JavaScriptCore.newProjectEntry(p[1].getPath()), JavaScriptCore.newProjectEntry(p[3].getPath()) },
- { JavaScriptCore.newProjectEntry(p[2].getPath()), JavaScriptCore.newProjectEntry(p[3].getPath()) },
- { JavaScriptCore.newProjectEntry(p[1].getPath()) },
- { JavaScriptCore.newProjectEntry(p[4].getPath())},
- { JavaScriptCore.newProjectEntry(p[3].getPath()), JavaScriptCore.newProjectEntry(p[0].getPath()) }
- };
-
- int[][] expectedCycleParticipants = new int[][] {
- { 0, 0, 0, 0, 0 }, // after setting CP p[0]
- { 0, 0, 0, 0, 0 }, // after setting CP p[1]
- { 0, 1, 1, 0, 0 }, // after setting CP p[2]
- { 0, 1, 1, 0, 0 }, // after setting CP p[3]
- { 1, 1, 1, 1, 1 }, // after setting CP p[4]
- };
-
- for (int i = 0; i < p.length; i++){
-
- // append project references
- IIncludePathEntry[] oldClasspath = p[i].getRawIncludepath();
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldClasspath.length+extraEntries[i].length];
- System.arraycopy(oldClasspath, 0 , newClasspath, 0, oldClasspath.length);
- for (int j = 0; j < extraEntries[i].length; j++){
- newClasspath[oldClasspath.length+j] = extraEntries[i][j];
- }
- // set classpath
- p[i].setRawIncludepath(newClasspath, null);
-
- // check cycle markers
- this.assertCycleMarkers(p[i], p, expectedCycleParticipants[i]);
- }
- //this.startDeltas();
-
- } finally {
- this.deleteProjects(projectNames);
- }
-}
-
-public void testCycleDetectionThroughContainers() throws CoreException {
-
- int max = 5;
- IJavaScriptProject[] p = new IJavaScriptProject[max];
- String[] projectNames = new String[max];
- try {
- for (int i = 0; i < max; i++) {
- projectNames[i] = "P"+i;
- p[i] = this.createJavaProject(projectNames[i], new String[] {""});
- }
-
- IJsGlobalScopeContainer[] containers = new IJsGlobalScopeContainer[]{
- new TestContainer(
- new Path("container0/default"),
- new IIncludePathEntry[]{ JavaScriptCore.newProjectEntry(p[3].getPath()) }),
- new TestContainer(
- new Path("container1/default"),
- new IIncludePathEntry[]{ JavaScriptCore.newProjectEntry(p[1].getPath()) }),
- new TestContainer(
- new Path("container2/default"),
- new IIncludePathEntry[]{ JavaScriptCore.newProjectEntry(p[4].getPath()) }),
- };
-
- IIncludePathEntry[][] extraEntries = new IIncludePathEntry[][]{
- { JavaScriptCore.newProjectEntry(p[1].getPath()), JavaScriptCore.newContainerEntry(containers[0].getPath()) },
- { JavaScriptCore.newProjectEntry(p[2].getPath()), JavaScriptCore.newProjectEntry(p[3].getPath()) },
- { JavaScriptCore.newContainerEntry(containers[1].getPath()) },
- { JavaScriptCore.newContainerEntry(containers[2].getPath())},
- { JavaScriptCore.newProjectEntry(p[3].getPath()), JavaScriptCore.newProjectEntry(p[0].getPath()) }
- };
-
- int[][] expectedCycleParticipants = new int[][] {
- { 0, 0, 0, 0, 0 }, // after setting CP p[0]
- { 0, 0, 0, 0, 0 }, // after setting CP p[1]
- { 0, 0, 0, 0, 0 }, // after setting CP p[2]
- { 0, 0, 0, 0, 0 }, // after setting CP p[3]
- { 1, 1, 1, 1, 1 }, // after setting CP p[4]
- };
-
- for (int i = 0; i < p.length; i++){
-
- // append project references
- IIncludePathEntry[] oldClasspath = p[i].getRawIncludepath();
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldClasspath.length+extraEntries[i].length];
- System.arraycopy(oldClasspath, 0 , newClasspath, 0, oldClasspath.length);
- for (int j = 0; j < extraEntries[i].length; j++){
- newClasspath[oldClasspath.length+j] = extraEntries[i][j];
- }
- // set classpath
- p[i].setRawIncludepath(newClasspath, null);
-
- // update container paths
- if (i == p.length - 1){
- JavaScriptCore.setJsGlobalScopeContainer(
- containers[0].getPath(),
- new IJavaScriptProject[]{ p[0] },
- new IJsGlobalScopeContainer[] { containers[0] },
- null);
-
- JavaScriptCore.setJsGlobalScopeContainer(
- containers[1].getPath(),
- new IJavaScriptProject[]{ p[2] },
- new IJsGlobalScopeContainer[] { containers[1] },
- null);
-
- JavaScriptCore.setJsGlobalScopeContainer(
- containers[2].getPath(),
- new IJavaScriptProject[]{ p[3] },
- new IJsGlobalScopeContainer[] { containers[2] },
- null);
- }
-
- // check cycle markers
- this.assertCycleMarkers(p[i], p, expectedCycleParticipants[i]);
- }
- //this.startDeltas();
-
- } finally {
- //this.stopDeltas();
- this.deleteProjects(projectNames);
- }
-}
-public void testCycleDetectionThroughContainerVariants() throws CoreException {
-
- int max = 5;
- IJavaScriptProject[] p = new IJavaScriptProject[max];
- String[] projectNames = new String[max];
- try {
- for (int i = 0; i < max; i++) {
- projectNames[i] = "P"+i;
- p[i] = this.createJavaProject(projectNames[i], new String[] {""});
- }
-
- class LocalTestContainer implements IJsGlobalScopeContainer {
- IPath path;
- IIncludePathEntry[] entries;
- LocalTestContainer(IPath path, IIncludePathEntry[] entries){
- this.path = path;
- this.entries = entries;
- }
- public IPath getPath() { return this.path; }
- /**
- * @deprecated Use {@link #getIncludepathEntries()} instead
- */
- public IIncludePathEntry[] getClasspathEntries() {
- return getIncludepathEntries();
- }
- public IIncludePathEntry[] getIncludepathEntries() { return this.entries; }
- public String getDescription() { return null; }
- public int getKind() { return 0; }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer#resolvedLibraryImport(java.lang.String)
- */
- public String[] resolvedLibraryImport(String a) {
- return new String[] {a};
- }
- }
-
- IJsGlobalScopeContainer[] containers = new IJsGlobalScopeContainer[]{
- new LocalTestContainer(
- new Path("container0/default"),
- new IIncludePathEntry[]{ JavaScriptCore.newProjectEntry(p[3].getPath()) }),
- new LocalTestContainer(
- new Path("container0/default"),
- new IIncludePathEntry[]{ JavaScriptCore.newProjectEntry(p[1].getPath()) }),
- new LocalTestContainer(
- new Path("container0/default"),
- new IIncludePathEntry[]{ JavaScriptCore.newProjectEntry(p[4].getPath()) }),
- };
-
- IIncludePathEntry[][] extraEntries = new IIncludePathEntry[][]{
- { JavaScriptCore.newProjectEntry(p[1].getPath()), JavaScriptCore.newContainerEntry(containers[0].getPath()) },
- { JavaScriptCore.newProjectEntry(p[2].getPath()), JavaScriptCore.newProjectEntry(p[3].getPath()) },
- { JavaScriptCore.newContainerEntry(containers[1].getPath()) },
- { JavaScriptCore.newContainerEntry(containers[2].getPath())},
- { JavaScriptCore.newProjectEntry(p[3].getPath()), JavaScriptCore.newProjectEntry(p[0].getPath()) }
- };
-
- int[][] expectedCycleParticipants = new int[][] {
- { 0, 0, 0, 0, 0 }, // after setting CP p[0]
- { 0, 0, 0, 0, 0 }, // after setting CP p[1]
- { 0, 0, 0, 0, 0 }, // after setting CP p[2]
- { 0, 0, 0, 0, 0 }, // after setting CP p[3]
- { 1, 1, 1, 1, 1 }, // after setting CP p[4]
- };
-
- for (int i = 0; i < p.length; i++){
-
- // append project references
- IIncludePathEntry[] oldClasspath = p[i].getRawIncludepath();
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldClasspath.length+extraEntries[i].length];
- System.arraycopy(oldClasspath, 0 , newClasspath, 0, oldClasspath.length);
- for (int j = 0; j < extraEntries[i].length; j++){
- newClasspath[oldClasspath.length+j] = extraEntries[i][j];
- }
- // set classpath
- p[i].setRawIncludepath(newClasspath, null);
-
- // update same container path for multiple projects
- if (i == p.length - 1){
- JavaScriptCore.setJsGlobalScopeContainer(
- containers[0].getPath(),
- new IJavaScriptProject[]{ p[0], p[2], p[3] },
- new IJsGlobalScopeContainer[] { containers[0], containers[1], containers[2] },
- null);
- }
-
- // check cycle markers
- this.assertCycleMarkers(p[i], p, expectedCycleParticipants[i]);
- }
- //this.startDeltas();
-
- } finally {
- //this.stopDeltas();
- this.deleteProjects(projectNames);
- }
-}
-public void testCycleDetection2() throws CoreException {
-
- int max = 5;
- IJavaScriptProject[] p = new IJavaScriptProject[max];
- String[] projectNames = new String[max];
- try {
- for (int i = 0; i < max; i++) {
- projectNames[i] = "P"+i;
- p[i] = this.createJavaProject(projectNames[i], new String[] {""});
- }
-
- IIncludePathEntry[][] extraEntries = new IIncludePathEntry[][]{
- { JavaScriptCore.newProjectEntry(p[1].getPath()), JavaScriptCore.newProjectEntry(p[3].getPath()) },
- { JavaScriptCore.newProjectEntry(p[2].getPath()) },
- { JavaScriptCore.newProjectEntry(p[0].getPath()) },
- { JavaScriptCore.newProjectEntry(p[4].getPath())},
- { JavaScriptCore.newProjectEntry(p[0].getPath()) }
- };
-
- int[][] expectedCycleParticipants = new int[][] {
- { 0, 0, 0, 0, 0 }, // after setting CP p[0]
- { 0, 0, 0, 0, 0 }, // after setting CP p[1]
- { 1, 1, 1, 0, 0 }, // after setting CP p[2]
- { 1, 1, 1, 0, 0 }, // after setting CP p[3]
- { 1, 1, 1, 1, 1 }, // after setting CP p[4]
- };
-
- for (int i = 0; i < p.length; i++){
-
- // append project references
- IIncludePathEntry[] oldClasspath = p[i].getRawIncludepath();
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldClasspath.length+extraEntries[i].length];
- System.arraycopy(oldClasspath, 0 , newClasspath, 0, oldClasspath.length);
- for (int j = 0; j < extraEntries[i].length; j++){
- newClasspath[oldClasspath.length+j] = extraEntries[i][j];
- }
- // set classpath
- p[i].setRawIncludepath(newClasspath, null);
-
- // check cycle markers
- this.assertCycleMarkers(p[i], p, expectedCycleParticipants[i]);
- }
- //this.startDeltas();
-
- } finally {
- //this.stopDeltas();
- this.deleteProjects(projectNames);
- }
-}
-
-public void testCycleDetection3() throws CoreException {
-
- int max = 6;
- IJavaScriptProject[] p = new IJavaScriptProject[max];
- String[] projectNames = new String[max];
- try {
- for (int i = 0; i < max; i++) {
- projectNames[i] = "P"+i;
- p[i] = this.createJavaProject(projectNames[i], new String[] {""});
- }
-
- IIncludePathEntry[][] extraEntries = new IIncludePathEntry[][]{
- { JavaScriptCore.newProjectEntry(p[2].getPath()), JavaScriptCore.newProjectEntry(p[4].getPath()) },
- { JavaScriptCore.newProjectEntry(p[0].getPath()) },
- { JavaScriptCore.newProjectEntry(p[3].getPath()) },
- { JavaScriptCore.newProjectEntry(p[1].getPath())},
- { JavaScriptCore.newProjectEntry(p[5].getPath()) },
- { JavaScriptCore.newProjectEntry(p[1].getPath()) }
- };
-
- int[][] expectedCycleParticipants = new int[][] {
- { 0, 0, 0, 0, 0, 0 }, // after setting CP p[0]
- { 0, 0, 0, 0, 0, 0 }, // after setting CP p[1]
- { 0, 0, 0, 0, 0, 0 }, // after setting CP p[2]
- { 1, 1, 1, 1, 0, 0 }, // after setting CP p[3]
- { 1, 1, 1, 1, 0, 0 }, // after setting CP p[4]
- { 1, 1, 1, 1, 1 , 1}, // after setting CP p[5]
- };
-
- for (int i = 0; i < p.length; i++){
-
- // append project references
- IIncludePathEntry[] oldClasspath = p[i].getRawIncludepath();
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldClasspath.length+extraEntries[i].length];
- System.arraycopy(oldClasspath, 0 , newClasspath, 0, oldClasspath.length);
- for (int j = 0; j < extraEntries[i].length; j++){
- newClasspath[oldClasspath.length+j] = extraEntries[i][j];
- }
- // set classpath
- p[i].setRawIncludepath(newClasspath, null);
-
- // check cycle markers
- this.assertCycleMarkers(p[i], p, expectedCycleParticipants[i]);
- }
- //this.startDeltas();
-
- } finally {
- //this.stopDeltas();
- this.deleteProjects(projectNames);
- }
-}
-/*
- * Ensures that a cycle is detected if introduced during a post-change event.
- * (regression test for bug 113051 No classpath marker produced when cycle through PDE container)
- */
-public void testCycleDetection4() throws CoreException {
- IResourceChangeListener listener = new IResourceChangeListener() {
- boolean containerNeedUpdate = true;
- public void resourceChanged(IResourceChangeEvent event) {
- if (containerNeedUpdate) {
- TestContainer container = new TestContainer(
- new Path("org.eclipse.wst.jsdt.core.tests.model.container/default"),
- new IIncludePathEntry[] { JavaScriptCore.newProjectEntry(new Path("/P1")) });
- try {
- JavaScriptCore.setJsGlobalScopeContainer(container.getPath(), new IJavaScriptProject[] {getJavaProject("P2")}, new IJsGlobalScopeContainer[] {container}, null);
- } catch (JavaScriptModelException e) {
- e.printStackTrace();
- }
- containerNeedUpdate = false;
- }
- }
- };
- try {
- IJavaScriptProject p1 = createJavaProject("P1", new String[] {}, new String[] {}, new String[] {"/P2"});
- TestContainer container = new TestContainer(
- new Path("org.eclipse.wst.jsdt.core.tests.model.container/default"),
- new IIncludePathEntry[] {});
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {}, new String[] {container.getPath().toString()});
- JavaScriptCore.setJsGlobalScopeContainer(container.getPath(), new IJavaScriptProject[] {p2}, new IJsGlobalScopeContainer[] {container}, null);
- waitForAutoBuild();
- getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE);
- createFile("/P1/test.txt", "");
- assertCycleMarkers(p1, new IJavaScriptProject[] {p1, p2}, new int[] {1, 1});
- } finally {
- getWorkspace().removeResourceChangeListener(listener);
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-public void testPerfDenseCycleDetection1() throws CoreException {
- // each project prereqs all other projects
- denseCycleDetection(5);
-}
-public void testPerfDenseCycleDetection2() throws CoreException {
- // each project prereqs all other projects
- denseCycleDetection(10);
-}
-public void testPerfDenseCycleDetection3() throws CoreException {
- // each project prereqs all other projects
- denseCycleDetection(20);
-}
-/*
- * Create projects and set classpaths in one batch
- */
-public void testNoCycleDetection1() throws CoreException {
-
- // each project prereqs all the previous ones
- noCycleDetection(5, false, false);
- noCycleDetection(10, false, false);
- noCycleDetection(20, false, false);
-
- // each project prereqs all the next ones
- noCycleDetection(5, true, false);
- noCycleDetection(10, true, false);
- noCycleDetection(20, true, false);
-}
-/*
- * Create projects first, then set classpaths
- */
-public void testNoCycleDetection2() throws CoreException {
-
- // each project prereqs all the previous ones
- noCycleDetection(5, false, true);
- noCycleDetection(10, false, true);
- noCycleDetection(20, false, true);
-
- // each project prereqs all the next ones
- noCycleDetection(5, true, true);
- noCycleDetection(10, true, true);
- noCycleDetection(20, true, true);
-}
-/*
- * Ensures that the .classpath file is not written to disk when setting the raw classpath with no resource change.
- */
-public void testNoResourceChange01() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src1"});
- IIncludePathEntry[] newClasspath = createClasspath("P", new String[] {"/P/src2", ""});
- project.setRawIncludepath(newClasspath, false/*cannot modify resources*/, null/*no progress*/);
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src1\"/>\n" +
- " <classpathentry kind=\"con\" path=\"org.eclipse.wst.jsdt.launching.JRE_CONTAINER\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that the in-memory classpath is correct when setting the raw classpath with no resource change.
- */
-public void testNoResourceChange02() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src1"});
- IIncludePathEntry[] newClasspath = createClasspath("P", new String[] {"/P/src2", ""});
- project.setRawIncludepath(newClasspath, false/*cannot modify resources*/, null/*no progress*/);
- assertClasspathEquals(
- project.getRawIncludepath(),
- "/P/src2[CPE_SOURCE][K_SOURCE][isExported:false]"
- );
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit on the old classpath doesn't exist after setting a new raw classpath with no resource change.
- */
-public void testNoResourceChange03() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src1"});
- createFile(
- "/P/src1/X.js",
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/src1/X.js");
- cu.open(null);
- IIncludePathEntry[] newClasspath = createClasspath("P", new String[] {"/P/src2", ""});
- project.setRawIncludepath(newClasspath, false/*cannot modify resources*/, null/*no progress*/);
- assertFalse("Compilation unit should not exist", cu.exists());
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that the delta is correct when setting a new raw classpath with no resource change.
- */
-public void testNoResourceChange04() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src1"});
- createFolder("/P/src2");
- IIncludePathEntry[] newClasspath = createClasspath("P", new String[] {"/P/src2", ""});
- startDeltas();
- project.setRawIncludepath(newClasspath, false/*cannot modify resources*/, null/*no progress*/);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CLASSPATH CHANGED}\n" +
- " src1[*]: {REMOVED FROM CLASSPATH}\n" +
- " src2[*]: {ADDED TO CLASSPATH}"
- );
- } finally {
- stopDeltas();
- deleteProject("P");
- }
-}
-/*
- * Ensures that the in-memory output is correct when setting the output with no resource change.
- */
-public void testNoResourceChange05() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src1"});
- project.setRawIncludepath(project.getRawIncludepath(), false/*cannot modify resources*/, null/*no progress*/);
- IIncludePathEntry[] entries = project.readRawIncludepath(); // force to read classpath
- assertEquals(
- "/P/src2",
- entries[0].getPath().toString());
- } finally {
- deleteProject("P");
- }
-}
-/**
- * Ensures that a duplicate entry created by editing the .classpath is detected.
- * (regression test for bug 24498 Duplicate entries on classpath cause CP marker to no longer refresh)
- */
-public void testDuplicateEntries() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"src"});
- this.editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src\"/>\n" +
- " <classpathentry kind=\"src\" path=\"src\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>"
- );
- assertMarkers(
- "Unexpected markers",
- "Build path contains duplicate entry: \'src\' for project P",
- project);
- } finally {
- this.deleteProject("P");
- }
-}
-private void denseCycleDetection(final int numberOfParticipants) throws CoreException {
-
- final IJavaScriptProject[] projects = new IJavaScriptProject[numberOfParticipants];
- final String[] projectNames = new String[numberOfParticipants];
- final int[] allProjectsInCycle = new int[numberOfParticipants];
-
- try {
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- for (int i = 0; i < numberOfParticipants; i++){
- projectNames[i] = "P"+i;
- projects[i] = createJavaProject(projectNames[i], new String[]{""});
- allProjectsInCycle[i] = 1;
- }
- for (int i = 0; i < numberOfParticipants; i++){
- IIncludePathEntry[] extraEntries = new IIncludePathEntry[numberOfParticipants-1];
- int index = 0;
- for (int j = 0; j < numberOfParticipants; j++){
- if (i == j) continue;
- extraEntries[index++] = JavaScriptCore.newProjectEntry(projects[j].getPath());
- }
- // append project references
- IIncludePathEntry[] oldClasspath = projects[i].getRawIncludepath();
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldClasspath.length+extraEntries.length];
- System.arraycopy(oldClasspath, 0 , newClasspath, 0, oldClasspath.length);
- for (int j = 0; j < extraEntries.length; j++){
- newClasspath[oldClasspath.length+j] = extraEntries[j];
- }
- // set classpath
- projects[i].setRawIncludepath(newClasspath, null);
- }
- }
- },
- null);
-
- for (int i = 0; i < numberOfParticipants; i++){
- // check cycle markers
- this.assertCycleMarkers(projects[i], projects, allProjectsInCycle);
- }
-
- } finally {
- this.deleteProjects(projectNames);
- }
-}
-/*
- * When using forward references, all projects prereq all of the ones which have a greater index,
- * e.g. P0, P1, P2: P0 prereqs {P1, P2}, P1 prereqs {P2}, P2 prereqs {}
- * When no using forward references (i.e. backward refs), all projects prereq projects with smaller index
- * e.g. P0, P1, P2: P0 prereqs {}, P1 prereqs {P0}, P2 prereqs {P0, P1}
- */
-private void noCycleDetection(final int numberOfParticipants, final boolean useForwardReferences, final boolean createProjectsFirst) throws CoreException {
-
- final IJavaScriptProject[] projects = new IJavaScriptProject[numberOfParticipants];
- final String[] projectNames = new String[numberOfParticipants];
- final int[] allProjectsInCycle = new int[numberOfParticipants];
-
- final long[] start = new long[1];
- final long[] time = new long[1];
-
- try {
- if (createProjectsFirst) {
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- for (int i = 0; i < numberOfParticipants; i++){
- projectNames[i] = "P"+i;
- projects[i] = createJavaProject(projectNames[i], new String[]{""});
- allProjectsInCycle[i] = 0;
- }
- }
- },
- null);
- }
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- if (!createProjectsFirst) {
- for (int i = 0; i < numberOfParticipants; i++){
- projectNames[i] = "P"+i;
- projects[i] = createJavaProject(projectNames[i], new String[]{""});
- allProjectsInCycle[i] = 0;
- }
- }
- for (int i = 0; i < numberOfParticipants; i++){
- IIncludePathEntry[] extraEntries = new IIncludePathEntry[useForwardReferences ? numberOfParticipants - i -1 : i];
- int index = 0;
- for (int j = useForwardReferences ? i+1 : 0;
- useForwardReferences ? (j < numberOfParticipants) : (j < i);
- j++){
- extraEntries[index++] = JavaScriptCore.newProjectEntry(projects[j].getPath());
- }
- // append project references
- IIncludePathEntry[] oldClasspath = projects[i].getRawIncludepath();
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldClasspath.length+extraEntries.length];
- System.arraycopy(oldClasspath, 0 , newClasspath, 0, oldClasspath.length);
- for (int j = 0; j < extraEntries.length; j++){
- newClasspath[oldClasspath.length+j] = extraEntries[j];
- }
- // set classpath
- long innerStart = System.currentTimeMillis(); // time spent in individual CP setting
- projects[i].setRawIncludepath(newClasspath, null);
- time[0] += System.currentTimeMillis() - innerStart;
- }
- start[0] = System.currentTimeMillis(); // time spent in delta refresh
- }
- },
- null);
- time[0] += System.currentTimeMillis()-start[0];
- //System.out.println("No cycle check ("+numberOfParticipants+" participants) : "+ time[0]+" ms, "+ (useForwardReferences ? "forward references" : "backward references") + ", " + (createProjectsFirst ? "two steps (projects created first, then classpaths are set)" : "one step (projects created and classpaths set in one batch)"));
-
- for (int i = 0; i < numberOfParticipants; i++){
- // check cycle markers
- this.assertCycleMarkers(projects[i], projects, allProjectsInCycle);
- }
-
- } finally {
- this.deleteProjects(projectNames);
- }
-}
-
-/*
- * test for bug 32690
- * simulate checkout of project with invalid classpath
- */
-public void testNestedSourceFolders() throws CoreException, IOException {
- try {
- // create project using Platform/Resources API
- final IProject project = getProject("P");
- IWorkspaceRunnable create = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- project.create(null, null);
- project.open(null);
- }
- };
- getWorkspace().run(create, null);
-
- // create folders src and src/src2 using java.io API
- File pro = project.getLocation().toFile();
- File src = createFolder(pro, "src");
- createFolder(src, "src2");
-
- // create .project using java.io API
- createFile(pro, ".project",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<projectDescription>\n" +
- " <name>org.eclipse.wst.jsdt.core</name>\n" +
- " <comment></comment>\n" +
- " <projects>\n" +
- " </projects>\n" +
- " <buildSpec>\n" +
- " <buildCommand>\n" +
- " <name>org.eclipse.wst.jsdt.core.javabuilder</name>\n" +
- " <arguments>\n" +
- " </arguments>\n" +
- " </buildCommand>\n" +
- " </buildSpec>\n" +
- " <natures>\n" +
- " <nature>org.eclipse.wst.jsdt.core.javanature</nature>\n" +
- " </natures>\n" +
- "</projectDescription>");
-
- // create .classpath using java.io API
- createFile(pro, ".classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src\"/>\n" +
- " <classpathentry kind=\"src\" path=\"src/src2\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>"
- );
-
- // refresh
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
-
- assertMarkers(
- "Unexpected markers",
- "Cannot nest \'P/src/src2\' inside \'P/src\'. To enable the nesting exclude \'src2/\' from \'P/src\'",
- JavaScriptCore.create(project));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that no problems are reported for an optional source entry with no corresponding folder.
- */
-public void testOptionalEntry1() throws CoreException {
- try {
- IJavaScriptProject javaProject = this.createJavaProject("A", new String[] {});
- IIncludePathAttribute attribute = JavaScriptCore.newIncludepathAttribute(IIncludePathAttribute.OPTIONAL, "true");
- IIncludePathEntry[] classpath =
- new IIncludePathEntry[] {
- JavaScriptCore.newSourceEntry(new Path("/A/src"), new IPath[0], new IPath[0], new Path("/A/bin"), new IIncludePathAttribute[] {attribute})
- };
- javaProject.setRawIncludepath(classpath, null);
- assertMarkers(
- "Unexpected markers",
- "",
- javaProject);
- } finally {
- this.deleteProject("A");
- }
-}
-/*
- * Ensures that no problems are reported for an optional libary entry with no corresponding folder.
- */
-public void testOptionalEntry2() throws CoreException {
- try {
- IJavaScriptProject javaProject = this.createJavaProject("A", new String[] {});
- IIncludePathAttribute attribute = JavaScriptCore.newIncludepathAttribute(IIncludePathAttribute.OPTIONAL, "true");
- IIncludePathEntry[] classpath =
- new IIncludePathEntry[] {
- JavaScriptCore.newLibraryEntry(new Path("/A/lib"), null, null, null, new IIncludePathAttribute[] {attribute}, false)
- };
- javaProject.setRawIncludepath(classpath, null);
- assertMarkers(
- "Unexpected markers",
- "",
- javaProject);
- } finally {
- this.deleteProject("A");
- }
-}
-/*
- * Ensures that no problems are reported for an optional project entry with no corresponding project.
- */
-public void testOptionalEntry3() throws CoreException {
- try {
- IJavaScriptProject javaProject = this.createJavaProject("A", new String[] {});
- IIncludePathAttribute attribute = JavaScriptCore.newIncludepathAttribute(IIncludePathAttribute.OPTIONAL, "true");
- IIncludePathEntry[] classpath =
- new IIncludePathEntry[] {
- JavaScriptCore.newProjectEntry(new Path("/B"), null/*no access rules*/, false/*don't combine access rule*/, new IIncludePathAttribute[] {attribute}, false/*not exported*/)
- };
- javaProject.setRawIncludepath(classpath, null);
- assertMarkers(
- "Unexpected markers",
- "",
- javaProject);
- } finally {
- this.deleteProject("A");
- }
-}
-
-/**
- * Ensure classpath is refreshed when project is replaced (43670)
- */
-public void testReplaceProject() throws CoreException {
- try {
- final IJavaScriptProject javaProject = createJavaProject("P", new String[] {"src"});
-
- ResourcesPlugin.getWorkspace().run(
- new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IProjectDescription descr = javaProject.getProject().getDescription();
- descr.setComment("dummy"); // ensure it is changed
- javaProject.getProject().setDescription(descr, monitor);
- editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src2\"/>\n" +
- "</classpath>"
- );
- }
- },
- null);
- IIncludePathEntry[] classpath = javaProject.getRawIncludepath();
- assertEquals("classpath should have been refreshed", new Path("/P/src2"), classpath[0].getPath());
- } finally {
- deleteProject("P");
- }
-}
-
-/*
- * Ensures that unknown classpath attributes in a .classpath file are not lost when read and rewritten.
- * (regression test for bug 101425 Classpath persistence should be resilient with unknown attributes)
- */
-public void testUnknownAttributes() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry unknown=\"test\" kind=\"src\" path=\"src1\"/>\n" +
- " <classpathentry kind=\"src\" path=\"src2\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>\n"
- );
- IIncludePathEntry[] classpath = project.getRawIncludepath();
-
- // swap 2 entries
- IIncludePathEntry src1 = classpath[0];
- classpath[0] = classpath[1];
- classpath[1] = src1;
- project.setRawIncludepath(classpath, null);
-
- // check that .classpath has correct content
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src2\"/>\n" +
- " <classpathentry kind=\"src\" path=\"src1\" unknown=\"test\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P");
- }
-}
-
-/*
- * Ensures that unknown classpath elements in a .classpath file are not lost when read and rewritten.
- * (regression test for bug 101425 Classpath persistence should be resilient with unknown attributes)
- */
-public void testUnknownElements1() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src1\">\n" +
- " <unknown>\n" +
- " <test kind=\"\"/>\n" +
- " </unknown>\n" +
- " </classpathentry>\n" +
- " <classpathentry kind=\"src\" path=\"src2\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>\n"
- );
- IIncludePathEntry[] classpath = project.getRawIncludepath();
-
- // swap 2 entries
- IIncludePathEntry src1 = classpath[0];
- classpath[0] = classpath[1];
- classpath[1] = src1;
- project.setRawIncludepath(classpath, null);
-
- // check that .classpath has correct content
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src2\"/>\n" +
- " <classpathentry kind=\"src\" path=\"src1\">\n" +
- " <unknown>\n" +
- " <test kind=\"\"/>\n" +
- " </unknown>\n" +
- " </classpathentry>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P");
- }
-}
-
-/*
- * Ensures that unknown classpath elements in a .classpath file are not lost when read and rewritten.
- * (regression test for bug 101425 Classpath persistence should be resilient with unknown attributes)
- */
-public void testUnknownElements2() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- editFile(
- "/P/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" unknownattribute=\"abcde\" path=\"src1\">\n" +
- " <unknown1>\n" +
- " <test kind=\"1\"/>\n" +
- " <test kind=\"2\"/>\n" +
- " </unknown1>\n" +
- " <unknown2 attribute2=\"\">\n" +
- " <test>\n" +
- " <other a=\"b\"/>\n" +
- " </test>\n" +
- " </unknown2>\n" +
- " </classpathentry>\n" +
- " <classpathentry kind=\"src\" path=\"src2\"/>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>\n"
- );
- IIncludePathEntry[] classpath = project.getRawIncludepath();
-
- // swap 2 entries
- IIncludePathEntry src1 = classpath[0];
- classpath[0] = classpath[1];
- classpath[1] = src1;
- project.setRawIncludepath(classpath, null);
-
- // check that .classpath has correct content
- String contents = new String (org.eclipse.wst.jsdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.settings/.jsdtscope")));
- assertSourceEquals(
- "Unexpected content",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"src2\"/>\n" +
- " <classpathentry kind=\"src\" path=\"src1\" unknownattribute=\"abcde\">\n" +
- " <unknown1>\n" +
- " <test kind=\"1\"/>\n" +
- " <test kind=\"2\"/>\n" +
- " </unknown1>\n" +
- " <unknown2 attribute2=\"\">\n" +
- " <test>\n" +
- " <other a=\"b\"/>\n" +
- " </test>\n" +
- " </unknown2>\n" +
- " </classpathentry>\n" +
- " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
- "</classpath>\n",
- contents);
- } finally {
- deleteProject("P");
- }
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55992
- * Check that Assert.AssertionFailedException exception is well catched
- * a) when verifying a classpath entry
- * b) when verifying whole classpath
- */
-public void testBug55992a() throws CoreException {
- try {
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {});
-
- IPath path = getExternalJCLPath("");
- IPath sourceAttachmentPath = new Path("jclMin.zip");
- JavaScriptCore.setIncludepathVariables(
- new String[] {"TEST_LIB", "TEST_SRC"},
- new IPath[] {path, sourceAttachmentPath},
- null);
-
- ClasspathEntry cp = new ClasspathEntry(
- IPackageFragmentRoot.K_SOURCE,
- IIncludePathEntry.CPE_VARIABLE,
- new Path("TEST_LIB"),
- ClasspathEntry.INCLUDE_ALL,
- ClasspathEntry.EXCLUDE_NONE,
- new Path("TEST_SRC"),
- null,
- null, // specific output folder
- false,
- (IAccessRule[]) null,
- false,
- ClasspathEntry.NO_EXTRA_ATTRIBUTES);
- IJavaScriptModelStatus status = JavaScriptConventions.validateClasspathEntry(proj, cp, false);
- assertEquals(
- "assertion failed: Source attachment path \'jclMin.zip\' for IIncludePathEntry must be absolute",
- status.getMessage());
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61214
- */
-public void testRemoveDuplicates() throws CoreException {
- try {
- IJavaScriptProject p1 = this.createJavaProject("P1", new String[] {""});
- IIncludePathEntry[] p1ClasspathEntries = new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(getExternalJCLPath(""), null, null, true)};
- setClasspath(p1, p1ClasspathEntries);
- IJavaScriptProject p2 = this.createJavaProject("P2", new String[] {""});
- IIncludePathEntry[] p2ClasspathEntries = new IIncludePathEntry[]{
- JavaScriptCore.newProjectEntry(new Path("/P1")),
- JavaScriptCore.newLibraryEntry(getExternalJCLPath(""), null, null, false)
- };
- setClasspath(p2, p2ClasspathEntries);
-
- IIncludePathEntry[] classpath = ((JavaProject)p2).getExpandedClasspath();
- assertEquals("Unexpected number of classpath entries", 2, classpath.length);
- assertEquals("Unexpected first entry", "/P1", classpath[0].getPath().toString());
- assertEquals("Unexpected second entry", getSystemJsPathString(), classpath[1].getPath().toOSString());
- } finally {
- this.deleteProjects(new String[] {"P1", "P2"});
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java
deleted file mode 100644
index 23577a3..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java
+++ /dev/null
@@ -1,731 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.CorrectionEngine;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelMarker;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.core.search.TypeNameRequestor;
-
-public class CodeCorrectionTests extends AbstractJavaModelTests {
- public static boolean fgDebug = false;
- public static boolean fgSpecific = false;
-
- public CodeCorrectionTests(String name) {
- super(name);
- }
-
- private IMarker[] getMarkers(IJavaScriptUnit unit) {
- try {
- IResource resource = unit.getCorrespondingResource();
- return resource.findMarkers(
- IJavaScriptModelMarker.JAVASCRIPT_MODEL_PROBLEM_MARKER,
- true, IResource.DEPTH_INFINITE);
- } catch (CoreException e) {
- }
- return new IMarker[0];
- }
-
- private IMarker getMarker(IJavaScriptUnit unit, String message)
- throws CoreException {
- IMarker[] markers = getMarkers(unit);
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- if (message.equals(marker.getAttribute(IMarker.MESSAGE))) {
- return marker;
- }
- }
- return null;
- }
-
- /**
- * Return the project names to load in the solution when an independent test
- * suite is being run.
- */
- public static String[] getProjectNames() {
- return new String[] { "Compiler", "CodeCorrection" };
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- IJavaScriptProject project = setUpJavaProject("CodeCorrection");
-
- // dummy query for waiting until the indexes are ready
- SearchEngine engine = new SearchEngine();
- IJavaScriptSearchScope scope = SearchEngine
- .createJavaSearchScope(new IJavaScriptElement[] { project });
- try {
- engine.searchAllTypeNames(null, SearchPattern.R_EXACT_MATCH,
- "!@$#!@".toCharArray(), SearchPattern.R_PATTERN_MATCH
- | SearchPattern.R_CASE_SENSITIVE,
- IJavaScriptSearchConstants.CLASS, scope,
- new TypeNameRequestor() {
- public void acceptType(int modifiers,
- char[] packageName, char[] simpleTypeName,
- char[][] enclosingTypeNames, String path) {
- }
- }, IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- } catch (CoreException e) {
- }
- // do a full build to create markers
- JavaScriptCore.setOptions(JavaScriptCore.getDefaultOptions());
- try {
- getWorkspace().getRoot().getProject("CodeCorrection").build(
- IncrementalProjectBuilder.FULL_BUILD, null);
- waitForAutoBuild();
- } catch (CoreException e) {
- assertTrue("building failed", false);
- }
- }
-
- public void tearDownSuite() throws Exception {
- deleteProject("CodeCorrection");
-
- super.tearDownSuite();
- }
-
- public static Test suite() {
- return buildModelTestSuite(CodeCorrectionTests.class);
- /*
- * Suite suite = new Suite(CodeCorrectionTests.class.getName()); if
- * (fgSpecific) { suite.addTest(new
- * CodeCorrectionTests("testCorrectMethod1"));
- *
- * return suite; } suite.addTest(new
- * CodeCorrectionTests("testCorrectFieldType1")); suite.addTest(new
- * CodeCorrectionTests("testCorrectFieldType2")); suite.addTest(new
- * CodeCorrectionTests("testCorrectFieldType3")); suite.addTest(new
- * CodeCorrectionTests("testCorrectLocalVariableType1"));
- * suite.addTest(new
- * CodeCorrectionTests("testCorrectLocalVariableType2"));
- * suite.addTest(new CodeCorrectionTests("testCorrectImport1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectImport2"));
- * suite.addTest(new CodeCorrectionTests("testCorrectImport3"));
- * suite.addTest(new CodeCorrectionTests("testCorrectSuperClass1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectSuperClass2"));
- * suite.addTest(new CodeCorrectionTests("testCorrectSuperInterface1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectSuperInterface2"));
- * suite.addTest(new CodeCorrectionTests("testCorrectException1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectException2"));
- * suite.addTest(new CodeCorrectionTests("testCorrectMethod1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectMethod2"));
- * suite.addTest(new CodeCorrectionTests("testCorrectField1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectField2"));
- * suite.addTest(new CodeCorrectionTests("testCorrectLocalVariable1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectArgument1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectReturnType1"));
- * suite.addTest(new CodeCorrectionTests("testCorrectReturnType2"));
- * suite.addTest(new CodeCorrectionTests("testWarningTokens"));
- *
- * return suite;
- */
- }
-
- public void testCorrectFieldType1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectFieldType1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "dddz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "ddd\n" + "ddd.eee",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectFieldType2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectFieldType2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "AClassz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AClass\n" + "AClass2",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectFieldType3() throws CoreException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectFieldType3.js");
- IMarker marker = getMarker(cu, "AClassz cannot be resolved to a type");
- assertTrue("Marker not found", marker != null);
- try {
- engine.computeCorrections(marker, null, 0, requestor);
- } catch (CoreException e) {
- }
-
- String src = cu.getSource();
- String error = "AClassz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AClass\n" + "AClass2",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectLocalVariableType1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectLocalVariableType1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "dddz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "ddd\n" + "ddd.eee",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectLocalVariableType2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectLocalVariableType2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "AClassz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AClass\n" + "AClass2",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectImport1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectImport1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "dddz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "ddd\n" + "ddd.eee",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectImport2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectImport2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "dddz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "ddd\n" + "ddd.eee",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectImport3() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectImport3.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "AClassz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AClass\n" + "AClass2",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectSuperClass1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectSuperClass1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "dddz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "ddd\n" + "ddd.eee",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectSuperClass2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectSuperClass2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "AClassz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AClass\n" + "AClass2",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectSuperInterface1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectSuperInterface1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "cccz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "ccc\n" + "cccInterface",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectSuperInterface2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectSuperInterface2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "AListenerz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AListener", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectException1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectException1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "bbbz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "bbb\n" + "bbb.ccc",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectException2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectException2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "AnExceptionz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AnException", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectMethod1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectMethod1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "bar";
- int start = src.lastIndexOf(error);
- int end = start + error.length();
-
- assertEquals("should have one suggestion", "bar0", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectMethod2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectMethod2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "bar";
- int start = src.lastIndexOf(error);
- int end = start + error.length();
-
- assertEquals("should have one suggestion", "bar0", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectField1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectField1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "bar";
- int start = src.lastIndexOf(error);
- int end = start + error.length();
-
- assertEquals("should have one suggestion", "bar0", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectField2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectField2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "bar";
- int start = src.lastIndexOf(error);
- int end = start + error.length();
-
- assertEquals("should have one suggestion", "bar0", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectLocalVariable1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectLocalVariable1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "bar";
- int start = src.lastIndexOf(error);
- int end = start + error.length();
-
- assertEquals("should have one suggestion", "bar0", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectArgument1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectArgument1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "bar";
- int start = src.lastIndexOf(error);
- int end = start + error.length();
-
- assertEquals("should have one suggestion", "bar0", requestor
- .getSuggestions());
- assertEquals("a start of a suggestion is not correct", "" + start,
- requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", "" + end,
- requestor.getEnds());
- }
-
- public void testCorrectReturnType1() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectReturnType1.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "dddz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "ddd\n" + "ddd.eee",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testCorrectReturnType2() throws JavaScriptModelException {
- CorrectionEngine engine = new CorrectionEngine(JavaScriptCore
- .getOptions());
- CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("CodeCorrection", "src", "",
- "CorrectReturnType2.js");
- IMarker[] markers = getMarkers(cu);
- assertTrue("should have one problem", markers.length == 1);
- engine.computeCorrections(markers[0], null, 0, requestor);
-
- String src = cu.getSource();
- String error = "AClassz";
- int start = src.indexOf(error);
- int end = start + error.length();
-
- assertEquals("should have two suggestions", "AClass\n" + "AClass2",
- requestor.getSuggestions());
- assertEquals("a start of a suggestion is not correct", start + "\n"
- + start, requestor.getStarts());
- assertEquals("a end of a suggestion is not correct", end + "\n" + end,
- requestor.getEnds());
- }
-
- public void testWarningTokens() {
- assertNull("assertIdentifier is a valid token for @SuppressWarnings",
- CorrectionEngine
- .getWarningToken(IProblem.UseAssertAsAnIdentifier));
- assertEquals("wrong token", "deprecation", CorrectionEngine
- .getWarningToken(IProblem.UsingDeprecatedConstructor));
- assertEquals("wrong token", "deprecation", CorrectionEngine
- .getWarningToken(IProblem.OverridingDeprecatedMethod));
- assertEquals("wrong token", "deprecation", CorrectionEngine
- .getWarningToken(IProblem.UsingDeprecatedType));
- assertEquals("wrong token", "deprecation", CorrectionEngine
- .getWarningToken(IProblem.UsingDeprecatedMethod));
- assertEquals("wrong token", "deprecation", CorrectionEngine
- .getWarningToken(IProblem.UsingDeprecatedField));
- assertEquals("wrong token", "finally", CorrectionEngine
- .getWarningToken(IProblem.FinallyMustCompleteNormally));
- assertEquals("wrong token", "hiding", CorrectionEngine
- .getWarningToken(IProblem.FieldHidingLocalVariable));
- assertEquals("wrong token", "hiding", CorrectionEngine
- .getWarningToken(IProblem.FieldHidingField));
- assertEquals("wrong token", "hiding", CorrectionEngine
- .getWarningToken(IProblem.LocalVariableHidingLocalVariable));
- assertEquals("wrong token", "hiding", CorrectionEngine
- .getWarningToken(IProblem.LocalVariableHidingField));
- assertEquals("wrong token", "hiding", CorrectionEngine
- .getWarningToken(IProblem.ArgumentHidingLocalVariable));
- assertEquals("wrong token", "hiding", CorrectionEngine
- .getWarningToken(IProblem.ArgumentHidingField));
- assertEquals("wrong token", "hiding", CorrectionEngine
- .getWarningToken(IProblem.MaskedCatch));
- assertEquals("wrong token", "nls", CorrectionEngine
- .getWarningToken(IProblem.NonExternalizedStringLiteral));
- assertEquals("wrong token", "unused", CorrectionEngine
- .getWarningToken(IProblem.LocalVariableIsNeverUsed));
- assertEquals("wrong token", "unused", CorrectionEngine
- .getWarningToken(IProblem.ArgumentIsNeverUsed));
- assertEquals("wrong token", "unused", CorrectionEngine
- .getWarningToken(IProblem.UnusedPrivateConstructor));
- assertEquals("wrong token", "unused", CorrectionEngine
- .getWarningToken(IProblem.UnusedPrivateMethod));
- assertEquals("wrong token", "unused", CorrectionEngine
- .getWarningToken(IProblem.UnusedPrivateField));
- assertEquals("wrong token", "unused", CorrectionEngine
- .getWarningToken(IProblem.UnusedPrivateType));
- assertEquals("wrong token", "unused", CorrectionEngine
- .getWarningToken(IProblem.UnusedMethodDeclaredThrownException));
- assertEquals(
- "wrong token",
- "unused",
- CorrectionEngine
- .getWarningToken(IProblem.UnusedConstructorDeclaredThrownException));
- assertEquals("wrong token", "static-access", CorrectionEngine
- .getWarningToken(IProblem.IndirectAccessToStaticMethod));
- assertEquals("wrong token", "static-access", CorrectionEngine
- .getWarningToken(IProblem.IndirectAccessToStaticField));
- assertEquals("wrong token", "static-access", CorrectionEngine
- .getWarningToken(IProblem.IndirectAccessToStaticType));
- assertEquals("wrong token", "static-access", CorrectionEngine
- .getWarningToken(IProblem.NonStaticAccessToStaticMethod));
- assertEquals("wrong token", "static-access", CorrectionEngine
- .getWarningToken(IProblem.NonStaticAccessToStaticField));
- assertEquals("wrong token", "synthetic-access", CorrectionEngine
- .getWarningToken(IProblem.NeedToEmulateFieldReadAccess));
- assertEquals("wrong token", "synthetic-access", CorrectionEngine
- .getWarningToken(IProblem.NeedToEmulateFieldWriteAccess));
- assertEquals("wrong token", "synthetic-access", CorrectionEngine
- .getWarningToken(IProblem.NeedToEmulateMethodAccess));
- assertEquals("wrong token", "synthetic-access", CorrectionEngine
- .getWarningToken(IProblem.NeedToEmulateConstructorAccess));
- assertEquals("wrong token", "unqualified-field-access",
- CorrectionEngine
- .getWarningToken(IProblem.UnqualifiedFieldAccess));
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTestsRequestor.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTestsRequestor.java
deleted file mode 100644
index 3174482..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTestsRequestor.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.*;
-
-import org.eclipse.wst.jsdt.core.ICorrectionRequestor;
-
-public class CodeCorrectionTestsRequestor implements ICorrectionRequestor {
- private class Suggestion {
- public String text;
- public int start;
- public int end;
- public Suggestion(char[] text, int start, int end){
- this.text = new String(text);
- this.start = start;
- this.end = end;
- }
- }
-
- class SuggestionComparator implements Comparator {
- public int compare(Object o1,Object o2) {
- Suggestion s1 = (Suggestion)o1;
- Suggestion s2 = (Suggestion)o2;
-
- int result = s1.text.compareTo(s2.text);
- if(result == 0) {
- result = s1.start - s2.start;
- if(result == 0) {
- result = s1.end - s2.end;
- }
- }
- return result;
- }
- }
-
-
- private Vector fSuggestions = new Vector(5);
-
- public void acceptClass(char[] packageName,char[] className,char[] correctionName,int modifiers,int correctionStart,int correctionEnd){
- fSuggestions.addElement(new Suggestion(correctionName, correctionStart, correctionEnd));
- }
-
- public void acceptField(char[] declaringTypePackageName,char[] declaringTypeName,char[] name,char[] typePackageName,char[] typeName,char[] correctionName,int modifiers,int correctionStart,int correctionEnd){
- fSuggestions.addElement(new Suggestion(correctionName, correctionStart, correctionEnd));
- }
-
- public void acceptInterface(char[] packageName,char[] interfaceName,char[] correctionName,int modifiers,int correctionStart,int correctionEnd){
- fSuggestions.addElement(new Suggestion(correctionName, correctionStart, correctionEnd));
- }
-
- public void acceptLocalVariable(char[] name,char[] typePackageName,char[] typeName,int modifiers,int correctionStart,int correctionEnd){
- fSuggestions.addElement(new Suggestion(name, correctionStart, correctionEnd));
- }
-
- public void acceptMethod(char[] declaringTypePackageName,char[] declaringTypeName,char[] selector,char[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] returnTypePackageName,char[] returnTypeName,char[] correctionName,int modifiers,int correctionStart,int correctionEnd){
- fSuggestions.addElement(new Suggestion(correctionName, correctionStart, correctionEnd));
- }
-
- public void acceptPackage(char[] packageName,char[] correctionName,int correctionStart,int correctionEnd){
- fSuggestions.addElement(new Suggestion(correctionName, correctionStart, correctionEnd));
- }
-
- public String getSuggestions(){
- Suggestion[] suggestions = getSortedSuggestions();
-
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < suggestions.length; i++) {
- if(i != 0)
- result.append('\n');
-
- result.append(suggestions[i].text);
- }
- return result.toString();
- }
-
- public String getStarts(){
- Suggestion[] suggestions = getSortedSuggestions();
-
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < suggestions.length; i++) {
- if(i != 0)
- result.append('\n');
-
- result.append(suggestions[i].start);
- }
- return result.toString();
- }
-
- public String getEnds(){
- Suggestion[] suggestions = getSortedSuggestions();
-
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < suggestions.length; i++) {
- if(i != 0)
- result.append('\n');
-
- result.append(suggestions[i].end);
- }
- return result.toString();
- }
-
- private Suggestion[] getSortedSuggestions(){
- Object[] unsorted = fSuggestions.toArray();
- Suggestion[] sorted = new Suggestion[unsorted.length];
- System.arraycopy(unsorted, 0, sorted, 0, unsorted.length);
- Arrays.sort(sorted, new SuggestionComparator());
- return sorted;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeSnippetParsingUtilTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeSnippetParsingUtilTests.java
deleted file mode 100644
index bd185b6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeSnippetParsingUtilTests.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.IProblemRequestor;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.LibrarySuperType;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.internal.core.JavaProject;
-import org.eclipse.wst.jsdt.launching.JavaRuntime;
-
-public class CodeSnippetParsingUtilTests extends TestCase {
- public static Test suite() {
- return new TestSuite(CodeSnippetParsingUtilTests.class);
- }
-
- /**
- *
- */
- public CodeSnippetParsingUtilTests() {
- }
-
- /**
- * @param name
- */
- public CodeSnippetParsingUtilTests(String name) {
- super(name);
- }
-
- public void testErrorDetection() throws JavaScriptModelException, CoreException {
- String projectName = ".jsValidation";
- String fileName = "snippet.js";
- String contents = "var params = \"someBadString\".substring(1,2,3,4);\nparahnas.shift();";
-
- // Create the JavaScript project
- IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(projectName);
- description.setNatureIds(new String[]{JavaScriptCore.NATURE_ID});
- IProject iProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- iProject.create(description, new NullProgressMonitor());
- iProject.open(null);
-
- // Setup the JavaScript project
- IJavaScriptProject project = JavaScriptCore.create(iProject);
- project.setRawIncludepath(null, new NullProgressMonitor());
- LibrarySuperType superType = new LibrarySuperType(new Path(JavaRuntime.DEFAULT_SUPER_TYPE_LIBRARY), project, JavaRuntime.DEFAULT_SUPER_TYPE);
- ((JavaProject) project).setCommonSuperType(superType);
-
- // Now create the IJavascriptUnit, and fill in its contents
- IPackageFragmentRoot root = project.getPackageFragmentRoot(iProject);
- IPackageFragment packageFragment = root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME);
- IJavaScriptUnit javaScriptUnit = packageFragment.getJavaScriptUnit(fileName);
-
- final List problems = new ArrayList();
- final IProblemRequestor requestor = new IProblemRequestor() {
- public void acceptProblem(IProblem problem) {
-// System.err.println(problem.getMessage());
- problems.add(problem);
- }
-
- public boolean isActive() {
- return true;
- }
-
- public void beginReporting() {
- problems.clear();
- }
-
- public void endReporting() {
- }
- };
- WorkingCopyOwner owner = new WorkingCopyOwner() {
- public IProblemRequestor getProblemRequestor(IJavaScriptUnit workingCopy) {
- return requestor;
- }
- };
-
- /*
- * Using a "working copy" allows us to not have to create the file on
- * disk
- */
- IJavaScriptUnit workingCopy = javaScriptUnit.getWorkingCopy(owner, null);
- workingCopy.getBuffer().setContents(contents);
-
- /*
- * Reconcile the working copy. Any problems found will be reported to
- * the IProblemRequestor from the given WorkingCopyOwner.
- */
- workingCopy.reconcile(AST.JLS3, true, true, owner, new NullProgressMonitor());
-
- // Clean up
- workingCopy.discardWorkingCopy();
-
- assertFalse("no problems found", problems.isEmpty());
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java
deleted file mode 100644
index 880e784..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java
+++ /dev/null
@@ -1,1422 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.internal.core.*;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.Test;
-
-public class CompilationUnitTests extends ModifyingResourceTests {
- IJavaScriptUnit cu;
- IJavaScriptUnit workingCopy;
- IJavaScriptProject testProject;
-
-public CompilationUnitTests(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- this.testProject = createJavaProject("P", new String[] {"src"}, new String[] {getSystemJsPathString()}, "bin", "1.5");
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/X.js",
- "\n\n" + // package now includes comment (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=93880)
- // => need some empty line at beginning to be able to have cu without any other element (see testGetElementAt())
- "/* some comment */" +
- " var f1=1;\n" +
- " /** @deprecated\n */" +
- " var f2;\n" +
- " var f3;\n" +
- " var f4;\n" +
- " var f5, f6, f7;\n" +
- " // @Deprecated\n" +
- " var f8;\n" +
- " function foo( y) {\n" +
- " }\n" +
- " function bar() {\n" +
- " }\n" +
- " /** @deprecated\n */" +
- " function fred() {\n" +
- " }\n" +
- " // @Deprecated\n" +
- " function fred2() {\n" +
- " }\n" +
- ""
- );
- this.cu = getCompilationUnit("/P/src/p/X.js");
-}
-
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_PREFIX = "testGetChildren";
-// TESTS_NAMES = new String[] { "testDefaultFlag1" };
-// TESTS_NUMBERS = new int[] { 13 };
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-public static Test suite() {
- return buildModelTestSuite(CompilationUnitTests.class);
-}
-protected void tearDown() throws Exception {
- if (this.workingCopy != null)
- this.workingCopy.discardWorkingCopy();
- super.tearDown();
-}
-public void tearDownSuite() throws Exception {
- this.deleteProject("P");
- super.tearDownSuite();
-}
-/**
- * Create working copy and compute problems.
- *
- * Note that in this case, a complete parse of javadoc comment is performed
- * (ie. done with checkDocComment = true) instead of a "light" parse when
- * problems are not computed.
- *
- * See JavaScriptUnit#buildStructure() line with comment: // disable javadoc parsing if not computing problems, not resolving and not creating ast
- * and org.eclipse.wst.jsdt.internal.compiler.parser.JavadocParser#checkDeprecation(int)
- */
-private IJavaScriptUnit createWorkingCopyComputingProblems(String source) throws JavaScriptModelException {
- this.workingCopy = getWorkingCopy("/P/src/p/Y.js", source, true);
- return this.workingCopy;
-}
-
-
-public void test00Class() throws CoreException {
- try {
-
- String source =
- "MyClass.prototype.someMethod = MyClass_someMethod;\n" +
- "function MyClass()\n" +
- "{\n" +
- "this.field1=0;\n" +
- "}\n" +
- "function MyClass_someMethod()\n" +
- "{\n" +
- "}";
- createFile("/P/src/X.js", source);
- final IJavaScriptUnit compilationUnit = getCompilationUnit("/P/src/X.js");
- IType type = compilationUnit.getType("MyClass");
- assertTrue("Type not defined", type.exists());
-
- IField[] fields= type.getFields();
- assertEquals("Wrong number of fields returned", 1, fields.length);
- assertEquals("Incorrect name for the field", "field1", fields[0].getElementName());
- assertTrue("Field should exist " , fields[0].exists());
-
- IFunction[] methods= type.getFunctions();
- assertEquals("Wrong number of methods returned", 2, methods.length);
- assertEquals("Incorrect name for the method", "someMethod", methods[0].getElementName());
- assertTrue("Field should exist " ,methods[0].exists());
-
-
- } finally {
- deleteFile("/P/src/X.js");
- }
-}
-
-
-
-
-
-/**
- * Calls methods that do nothing to ensure code coverage
- */
-public void testCodeCoverage() throws JavaScriptModelException {
- this.cu.discardWorkingCopy();
- this.cu.restore();
-}
-/**
- * Ensures <code>commitWorkingCopy(boolean, IProgressMonitor)</code> throws the correct
- * <code>JavaScriptModelException</code> for a <code>JavaScriptUnit</code>.
- */
-public void testCommitWorkingCopy() {
- try {
- this.cu.commitWorkingCopy(false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Incorrect status for committing a JavaScriptUnit", jme.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_ELEMENT_TYPES);
- return;
- }
- assertTrue("A compilation unit should throw an exception is a commit is attempted", false);
-}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 23207 Flags.isDeprecated(IFunction.getFlags()) doesn't work)
- */
-//public void testDeprecatedFlag01() throws JavaScriptModelException {
-// IType type = this.cu.getType("X");
-// assertTrue("Type X should not be deprecated", !Flags.isDeprecated(type.getFlags()));
-//}
-//
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 23207 Flags.isDeprecated(IFunction.getFlags()) doesn't work)
- */
-//public void testDeprecatedFlag02() throws JavaScriptModelException {
-// IType type = this.cu.getType("I");
-// assertTrue("Type I should be deprecated", Flags.isDeprecated(type.getFlags()));
-//}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 23207 Flags.isDeprecated(IFunction.getFlags()) doesn't work)
- */
-public void testDeprecatedFlag03() throws JavaScriptModelException {
- IField field = this.cu.getField("f1");
- assertTrue("Field f1 should not be deprecated", !Flags.isDeprecated(field.getFlags()));
-}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 23207 Flags.isDeprecated(IFunction.getFlags()) doesn't work)
- */
-public void testDeprecatedFlag04() throws JavaScriptModelException {
- IField field = this.cu.getField("f2");
- assertTrue("Field f2 should be deprecated", Flags.isDeprecated(field.getFlags()));
-}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 23207 Flags.isDeprecated(IFunction.getFlags()) doesn't work)
- */
-public void testDeprecatedFlag05() throws JavaScriptModelException {
- IFunction method = this.cu.getFunction("bar", new String[]{});
- assertTrue("Method bar should not be deprecated", !Flags.isDeprecated(method.getFlags()));
-}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 23207 Flags.isDeprecated(IFunction.getFlags()) doesn't work)
- */
-public void testDeprecatedFlag06() throws JavaScriptModelException {
- IFunction method = this.cu.getFunction("fred", new String[]{});
- assertTrue("Method fred should be deprecated", Flags.isDeprecated(method.getFlags()));
-}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 89807 Outliner should recognize @Deprecated annotation)
- */
-public void testDeprecatedFlag07() throws JavaScriptModelException {
- IType type = this.cu.getType("I3");
- assertTrue("Type I3 should be deprecated", Flags.isDeprecated(type.getFlags()));
-}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 89807 Outliner should recognize @Deprecated annotation)
- */
-public void testDeprecatedFlag08() throws JavaScriptModelException {
- IField field = this.cu.getType("X").getField("f8");
- assertTrue("Field f8 should be deprecated", Flags.isDeprecated(field.getFlags()));
-}
-
-/*
- * Ensure that the deprecated flag is correctly reported
- * (regression test fo bug 89807 Outliner should recognize @Deprecated annotation)
- */
-public void testDeprecatedFlag09() throws JavaScriptModelException {
- IFunction method = this.cu.getType("X").getFunction("fred2", new String[0]);
- assertTrue("Method fred2 should be deprecated", Flags.isDeprecated(method.getFlags()));
-}
-
-/*
- * Ensures that the categories for a class are correct.
- */
-public void testGetCategories01() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "/**\n" +
- " * @category test\n" +
- " */\n" +
- "public class Y {\n" +
- "}"
- );
- String[] categories = this.workingCopy.getType("Y").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for an interface are correct.
- */
-public void testGetCategories02() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "/**\n" +
- " * @category test\n" +
- " */\n" +
- "public interface Y {\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for an enumeration type are correct.
- */
-public void testGetCategories03() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "/**\n" +
- " * @category test\n" +
- " */\n" +
- "public enum Y {\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for an annotation type type are correct.
- */
-public void testGetCategories04() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "/**\n" +
- " * @category test\n" +
- " */\n" +
- "public @interface Y {\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for a method are correct.
- */
-public void testGetCategories05() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for a constructor are correct.
- */
-public void testGetCategories06() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " public Y() {}\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getFunction("Y", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for a field are correct.
- */
-public void testGetCategories07() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " int field;\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getField("field").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for a member type are correct.
- */
-public void testGetCategories08() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " class Member {}\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getType("Member").getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test\n",
- categories);
-}
-
-/*
- * Ensures that the categories for an element that has no categories is empty.
- */
-public void testGetCategories09() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "",
- categories);
-}
-
-/*
- * Ensures that the categories for an element that has multiple category tags is correct.
- */
-public void testGetCategories10() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test1\n" +
- " * @category test2\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\n" +
- "test2\n",
- categories);
-}
-
-/*
- * Ensures that the categories for an element that has multiple categories for one category tag is correct.
- */
-public void testGetCategories11() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test1 test2\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\n" +
- "test2\n",
- categories);
-}
-public void testGetCategories12() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test1 test2\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\n" +
- "test2\n",
- categories);
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=125676
-public void testGetCategories13() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category " +
- " * test\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "",
- categories);
-}
-public void testGetCategories14() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category" +
- " * test\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "",
- categories);
-}
-public void testGetCategories15() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test1" +
- " * test2\n" +
- " */\n" +
- " void foo() {}\n" +
- "}"
- );
- String[] categories = this.workingCopy.getType("Y").getFunction("foo", new String[0]).getCategories();
- assertStringsEqual(
- "Unexpected categories",
- "test1\n",
- categories);
-}
-
-/*
- * Ensures that the children of a type for a given category are correct.
- */
-public void testGetChildrenForCategory01() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " int field;\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**\n" +
- " * @category test\n" +
- " */\n" +
- " void foo2() {}\n" +
- " /**\n" +
- " * @category other\n" +
- " */\n" +
- " void foo3() {}\n" +
- "}"
- );
- IJavaScriptElement[] children = workingCopy.getType("Y").getChildrenForCategory("test");
- assertElementsEqual(
- "Unexpected children",
- "field [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo1() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo2() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]",
- children);
-}
-
-/*
- * Ensures that the children of a type for a given category are correct.
- */
-public void testGetChildrenForCategory02() throws CoreException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category test1 test2\n" +
- " */\n" +
- " class Member {}\n" +
- " /**\n" +
- " * @category test1\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**\n" +
- " * @category test2\n" +
- " */\n" +
- " void foo2() {}\n" +
- "}"
- );
- IJavaScriptElement[] children = workingCopy.getType("Y").getChildrenForCategory("test1");
- assertElementsEqual(
- "Unexpected children",
- "Member [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo1() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]",
- children);
-}
-public void testGetChildrenForCategory03() throws CoreException, IOException {
- createWorkingCopyComputingProblems(
- "package p;\n" +
- "public class Y {\n" +
- " /**\n" +
- " * @category fields test all\n" +
- " */\n" +
- " int field;\n" +
- " /**\n" +
- " * @category methods test all\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**\n" +
- " * @category methods test all\n" +
- " */\n" +
- " void foo2() {}\n" +
- " /**\n" +
- " * @category methods other all\n" +
- " */\n" +
- " void foo3() {}\n" +
- "}"
- );
- IJavaScriptElement[] tests = this.workingCopy.getType("Y").getChildrenForCategory("test");
- assertElementsEqual(
- "Unexpected children",
- "field [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo1() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo2() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]",
- tests);
- IJavaScriptElement[] methods = this.workingCopy.getType("Y").getChildrenForCategory("methods");
- assertElementsEqual(
- "Unexpected children",
- "foo1() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo2() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo3() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]",
- methods);
- IJavaScriptElement[] others = this.workingCopy.getType("Y").getChildrenForCategory("other");
- assertElementsEqual(
- "Unexpected children",
- "foo3() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]",
- others);
- IJavaScriptElement[] all = this.workingCopy.getType("Y").getChildrenForCategory("all");
- assertElementsEqual(
- "Unexpected children",
- "field [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo1() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo2() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]\n" +
- "foo3() [in Y [in [Working copy] Y.js [in p [in src [in P]]]]]",
- all);
-}
-
-/**
- * Ensures <code>getContents()</code> returns the correct value
- * for a <code>JavaScriptUnit</code> that is not present
- */
-public void testGetContentsForNotPresent() {
- CompilationUnit compilationUnit = (CompilationUnit)getCompilationUnit("/P/src/p/Absent.js");
-
- assertSourceEquals("Unexpected contents for non present cu", "", new String(compilationUnit.getContents()));
-}
-/**
- * Tests Java element retrieval via source position
- */
-public void testGetElementAt() throws JavaScriptModelException {
- IField field = this.cu.getField( "f2");
- ISourceRange sourceRange= field.getSourceRange();
- //ensure that we are into the body of the type
- IJavaScriptElement element=
- this.cu.getElementAt(sourceRange.getOffset() + field.getElementName().length() + 1);
- assertTrue("Should have found a type", element instanceof IField);
- assertEquals(
- "Should have found f2",
- "f2",
- element.getElementName());
- //ensure that null is returned if there is no element other than the compilation
- //unit itself at the given position
- element= this.cu.getElementAt(this.cu.getSourceRange().getOffset() + 1);
- assertEquals("Should have not found any element", null, element);
-}
-///**
-// * Tests import declararion retrieval via source position.
-// * (regression test for bug 14331 IJavaScriptUnit.getElementAt dos not find import decl)
-// */
-//public void testGetElementAt2() throws JavaScriptModelException {
-// IImportContainer container = this.cu.getImportContainer();
-// ISourceRange sourceRange= container.getSourceRange();
-// //ensure that we are inside the import container
-// IJavaScriptElement element= this.cu.getElementAt(sourceRange.getOffset() + 1);
-// assertTrue("Should have found an import", element instanceof IImportDeclaration);
-// assertEquals(
-// "Import not found",
-// "p2.*",
-// element.getElementName());
-//}
-/*
- * Ensures that the right field is returnd in a muti-declaration field.
- */
-public void testGetElementAt3() throws JavaScriptModelException {
- int fieldPos = this.cu.getSource().indexOf("f5");
- IJavaScriptElement element= this.cu.getElementAt(fieldPos);
- assertEquals(
- "Unexpected field found",
- this.cu.getField("f5"),
- element);
-}
-/*
- * Ensures that the right field is returnd in a muti-declaration field.
- */
-public void testGetElementAt4() throws JavaScriptModelException {
- int fieldPos = this.cu.getSource().indexOf("f6");
- IJavaScriptElement element= this.cu.getElementAt(fieldPos);
- assertEquals(
- "Unexpected field found",
- this.cu.getField("f6"),
- element);
-}
-/*
- * Ensures that the right field is returnd in a muti-declaration field.
- */
-public void testGetElementAt5() throws JavaScriptModelException {
- int fieldPos = this.cu.getSource().indexOf("f7");
- IJavaScriptElement element= this.cu.getElementAt(fieldPos);
- assertEquals(
- "Unexpected field found",
- this.cu.getField("f7"),
- element);
-}
-/*
- * Ensures that the right field is returned in a muti-declaration field.
- */
-public void testGetElementAt6() throws JavaScriptModelException {
- int fieldPos = this.cu.getSource().indexOf("var f5");
- IJavaScriptElement element= this.cu.getElementAt(fieldPos);
- assertEquals(
- "Unexpected field found",
- this.cu.getField("f5"),
- element);
-}
-///*
-// * Ensures that the right type is returnd if an annotation type as a comment in its header.
-// */
-//public void testGetElementAt7() throws JavaScriptModelException {
-// int fieldPos = this.cu.getSource().indexOf("Annot");
-// IJavaScriptElement element= this.cu.getElementAt(fieldPos);
-// assertEquals(
-// "Unexpected type found",
-// this.cu.getType("Annot"),
-// element);
-//}
-/**
- * Ensures that correct number of fields with the correct names, modifiers, signatures
- * and declaring types exist in a type.
- */
-public void testGetFields() throws JavaScriptModelException {
-// IType type = this.cu.getType("X");
- IField[] fields= this.cu.getFields();
- String[] fieldNames = new String[] {"f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8"};
- String[] flags = new String[] {"public", "protected", "private", "", "", "", "", ""};
- String[] signatures = new String[] {"I", "QObject;", "QX;", "Qjava.lang.String;", "I", "I", "I", "I"};
- assertEquals("Wrong number of fields returned", fieldNames.length, fields.length);
- for (int i = 0; i < fields.length; i++) {
- assertEquals("Incorrect name for the " + i + " field", fieldNames[i], fields[i].getElementName());
-// String mod= Flags.toString(fields[i].getFlags());
-// assertEquals("Unexpected modifier for " + fields[i].getElementName(), flags[i], mod);
-// assertEquals("Unexpected type signature for " + fields[i].getElementName(), signatures[i], fields[i].getTypeSignature());
-// assertEquals("Unexpected declaring type for " + fields[i].getElementName(), type, fields[i].getDeclaringType());
- assertTrue("Field should exist " + fields[i], fields[i].exists());
- }
-}
-///**
-// * Ensure that import declaration handles are returned from the
-// * compilation unit.
-// * Checks non-existant handle, on demand and not.
-// */
-//public void testGetImport() {
-// IImportDeclaration imprt = this.cu.getImport("java.lang");
-// assertTrue("Import should not exist " + imprt, !imprt.exists());
-//
-// imprt = this.cu.getImport("p2.*");
-// assertTrue("Import should exist " + imprt, imprt.exists());
-//
-// imprt = this.cu.getImport("p3.Z");
-// assertTrue("Import should exist " + imprt, imprt.exists());
-//}
-///**
-// * Ensures that correct number of imports with the correct names
-// * exist in "GraphicsTest" compilation unit.
-// */
-//public void testGetImports() throws JavaScriptModelException {
-// IImportDeclaration[] imprts = this.cu.getImports();
-// IImportContainer container= this.cu.getImportContainer();
-// String[] importNames = new String[] {"p2.*", "p3.Z"};
-//
-// assertEquals("Wrong number of imports returned", importNames.length, imprts.length);
-// for (int i = 0; i < imprts.length; i++) {
-// assertTrue("Incorrect name for the type in this position: " + imprts[i].getElementName(), imprts[i].getElementName().equals(importNames[i]));
-// assertTrue("Import does not exist " + imprts[i], imprts[i].exists());
-// if (i == 0) {
-// assertTrue("Import is not on demand " + imprts[i], imprts[i].isOnDemand());
-// assertTrue("Import should be non-static " + imprts[i], imprts[i].getFlags() == Flags.AccDefault);
-// } else {
-// assertTrue("Import is on demand " + imprts[i], !imprts[i].isOnDemand());
-// assertTrue("Import should be non-static " + imprts[i], imprts[i].getFlags() == Flags.AccDefault);
-// }
-// assertTrue("Container import does not equal import", container.getImport(imprts[i].getElementName()).equals(imprts[i]));
-// }
-//
-// assertTrue("Import container must exist and have children", container.exists() && container.hasChildren());
-// ISourceRange containerRange= container.getSourceRange();
-// assertEquals(
-// "Offset container range not correct",
-// imprts[0].getSourceRange().getOffset(),
-// containerRange.getOffset());
-// assertEquals(
-// "Length container range not correct",
-// imprts[imprts.length-1].getSourceRange().getOffset() + imprts[imprts.length-1].getSourceRange().getLength(),
-// containerRange.getOffset() + containerRange.getLength());
-// assertSourceEquals("Source not correct",
-// "import p2.*;\n" +
-// "import p3.Z;",
-// container.getSource());
-//
-//}
-/**
- * Ensure that type handles are returned from the
- * compilation unit for an inner type.
- */
-//public void testGetInnerTypes() throws JavaScriptModelException {
-// IType type1 = cu.getType("X");
-// assertTrue("X type should have children", type1.hasChildren());
-// assertTrue("X type superclass name should be null", type1.getSuperclassName() == null);
-// String[] superinterfaceNames= type1.getSuperInterfaceNames();
-// assertEquals("X type should have one superinterface", 1, superinterfaceNames.length);
-// assertEquals("Unexpected super interface name", "Runnable", superinterfaceNames[0]);
-// assertEquals("Fully qualified name of the type is incorrect", "p.X", type1.getFullyQualifiedName());
-// IType type2 = type1.getType("Inner");
-// superinterfaceNames = type2.getSuperInterfaceNames();
-// assertEquals("X$Inner type should not have a superinterface", 0, superinterfaceNames.length);
-// assertEquals("Fully qualified name of the inner type is incorrect", "p.X$Inner", type2.getFullyQualifiedName());
-// assertEquals("Declaring type of the inner type is incorrect", type1, type2.getDeclaringType());
-// IType type3 = type2.getType("InnerInner");
-// assertTrue("InnerInner type should not have children", !type3.hasChildren());
-//}
-/*
- * Ensures that the key for a top level type is correct
- */
-public void testGetKey1() {
-// IType type = this.cu.getType("X");
-// assertEquals("Lp/X;", type.getKey());
- IField type = this.cu.getField("f2");
- assertEquals("Up/X.js;.f2", type.getKey());
-}
-/*
- * Ensures that the key for a member type is correct
- */
-public void testGetKey2() {
- IType type = this.cu.getType("X").getType("Inner");
- assertEquals("Lp/X$Inner;", type.getKey());
-}
-/*
- * Ensures that the key for a secondary type is correct
- */
-public void testGetKey3() {
- IType type = this.cu.getType("I");
- assertEquals("Lp/X~I;", type.getKey());
-}
-/*
- * Ensures that the key for an anonymous type is correct
- */
-public void testGetKey4() {
- IType type = this.cu.getType("X").getFunction("foo", new String[0]).getType("", 1);
- assertEquals("Lp/X$1;", type.getKey());
-}
-/**
- * Ensures that a method has the correct return type, parameters and exceptions.
- */
-public void testGetMethod1() throws JavaScriptModelException {
-// IType type = this.cu.getType("X");
- IFunction foo = this.cu.getFunction("foo", new String[]{null});
-// String[] exceptionTypes= foo.getExceptionTypes();
-// assertEquals("Wrong number of exception types", 1, exceptionTypes.length);
-// assertEquals("Unxepected exception type", "QIOException;", exceptionTypes[0]);
-// assertEquals("Wrong return type", "V", foo.getReturnType());
- String[] parameterNames = foo.getParameterNames();
- assertEquals("Wrong number of parameter names", 1, parameterNames.length);
- assertEquals("Unexpected parameter name", "y", parameterNames[0]);
-}
-///**
-// * Ensures that a method has the correct AccVarargs flag set.
-// */
-//public void testGetMethod2() throws JavaScriptModelException {
-// IType type = this.cu.getType("X");
-// IFunction method = type.getMethod("testIsVarArgs", new String[]{"QString;", "[QObject;"});
-// assertTrue("Should have the AccVarargs flag set", Flags.isVarargs(method.getFlags()));
-//}
-///**
-// * Ensures that a constructor has the correct AccVarargs flag set.
-// * (regression test for bug 77422 [1.5] ArrayIndexOutOfBoundsException with vararg constructor of generic superclass)
-// */
-//public void testGetMethod3() throws JavaScriptModelException {
-// IType type = this.cu.getType("X");
-// IFunction method = type.getMethod("X", new String[]{"[QString;"});
-// assertTrue("Should have the AccVarargs flag set", Flags.isVarargs(method.getFlags()));
-//}
-/**
- * Ensures that correct number of methods with the correct names and modifiers
- * exist in a type.
- */
-public void testGetMethods() throws JavaScriptModelException {
-// IType type = this.cu.getType("X");
- IFunction[] methods= this.cu.getFunctions();
- String[] methodNames = new String[] {"foo", "bar", "fred", "fred2"};
- String[] flags = new String[] {"public", "protected static", "private", "private"};
- assertEquals("Wrong number of methods returned", methodNames.length, methods.length);
- for (int i = 0; i < methods.length; i++) {
- assertEquals("Incorrect name for the " + i + " method", methodNames[i], methods[i].getElementName());
- int modifiers = methods[i].getFlags() & ~Flags.AccVarargs;
-// String mod= Flags.toString(modifiers);
-// assertEquals("Unexpected modifier for " + methods[i].getElementName(), flags[i], mod);
- assertTrue("Method does not exist " + methods[i], methods[i].exists());
- }
-}
-///**
-// * Ensures that correct modifiers are reported for a method in an interface.
-// */
-//public void testCheckInterfaceMethodModifiers() throws JavaScriptModelException {
-// IType type = this.cu.getType("I");
-// IFunction method = type.getMethod("run", new String[0]);
-// String expectedModifiers = "";
-// String modifiers = Flags.toString(method.getFlags() & ~Flags.AccVarargs);
-// assertEquals("Expected modifier for " + method.getElementName(), expectedModifiers, modifiers);
-//}
-///*
-// * Ensures that IType#getSuperInterfaceTypeSignatures() is correct for a source type.
-// */
-//public void testGetSuperInterfaceTypeSignatures() throws JavaScriptModelException {
-// IType type = this.cu.getType("Y");
-// assertStringsEqual(
-// "Unexpected signatures",
-// "QI2<QE;>;\n",
-// type.getSuperInterfaceTypeSignatures());
-//}
-/**
- * Ensure that the same element is returned for the primary element of a
- * compilation unit.
- */
-public void testGetPrimary() {
- IJavaScriptElement primary = this.cu.getPrimaryElement();
- assertEquals("Primary element for a compilation unit should be the same", this.cu, primary);
- primary = this.cu.getPrimary();
- assertEquals("Primary for a compilation unit should be the same", this.cu, primary);
-
-}
-///////*
-////// * Ensures that the occurrence count for an initializer is correct
-////// */
-//////public void testGetOccurrenceCount01() {
-////// IInitializer initializer = this.cu.getType("X").getInitializer(2);
-////// assertEquals("Unexpected occurrence count", 2, initializer.getOccurrenceCount());
-//////}
-/////*
-//// * Ensures that the occurrence count for an anonymous type is correct
-//// */
-////public void testGetOccurrenceCount02() {
-//// IType type = this.cu.getType("X").getMethod("foo", new String[]{"QY;"}).getType("", 3);
-//// assertEquals("Unexpected occurrence count", 3, type.getOccurrenceCount());
-////}
-///**
-// * Ensures that correct number of package declarations with the correct names
-// * exist a compilation unit.
-// */
-//public void testGetPackages() throws JavaScriptModelException {
-// IPackageDeclaration[] packages = this.cu.getPackageDeclarations();
-// String packageName = "p";
-// assertEquals("Wrong number of packages returned", 1, packages.length);
-// assertEquals("Wrong package declaration returned: ", packageName, packages[0].getElementName());
-//}
-/**
- * Ensure that type handles are returned from the
- * compilation unit.
- * Checks non-existant handle and existing handles.
- */
-public void testGetType() {
- IField type = this.cu.getField("someType");
- assertTrue("Type should not exist " + type, !type.exists());
-
- type = this.cu.getField("f2");
- assertTrue("Type should exist " + type, type.exists());
-
-// type = this.cu.getType("I"); // secondary type
-// assertTrue("Type should exist " + type, type.exists());
-}
-///**
-// * Ensures that correct number of types with the correct names and modifiers
-// * exist in a compilation unit.
-// */
-//public void testGetTypes() throws JavaScriptModelException {
-// IType[] types = this.cu.getTypes();
-// String[] typeNames = new String[] {"X", "I", "I2", "I3", "Y", "Colors", "Annot"};
-// String[] flags = new String[] {"public", "", "", "", "", "", ""};
-// boolean[] isClass = new boolean[] {true, false, false, false, true, false, false};
-// boolean[] isInterface = new boolean[] {false, true, true, true, false, false, true};
-// boolean[] isAnnotation = new boolean[] {false, false, false, false, false, false, true};
-// boolean[] isEnum = new boolean[] {false, false, false, false, false, true, false};
-// String[] superclassName = new String[] {null, null, null, null, null, null, null};
-// String[] superclassType = new String[] {null, null, null, null, null, null, null};
-// String[][] superInterfaceNames = new String[][] {
-// new String[] {"Runnable"}, new String[0], new String[0], new String[0], new String[] {"I2<E>"}, new String[0], new String[0]
-// };
-// String[][] superInterfaceTypes = new String[][] {
-// new String[] {"QRunnable;"}, new String[0], new String[0], new String[0], new String[] {"QI2<QE;>;"}, new String[0], new String[0]
-// };
-// String[][] formalTypeParameters = new String[][] {
-// new String[0], new String[0], new String[] {"E"}, new String[0], new String[] {"E"}, new String[0], new String[0]
-// };
-//
-// assertEquals("Wrong number of types returned", typeNames.length, types.length);
-// for (int i = 0; i < types.length; i++) {
-// assertEquals("Incorrect name for the " + i + " type", typeNames[i], types[i].getElementName());
-// String mod= Flags.toString(types[i].getFlags());
-// assertEquals("Unexpected modifier for " + types[i].getElementName(), flags[i], mod);
-// assertTrue("Type does not exist " + types[i], types[i].exists());
-// assertEquals("Incorrect isClass for the " + i + " type", isClass[i], types[i].isClass());
-// assertEquals("Incorrect isInterface for the " + i + " type", isInterface[i], types[i].isInterface());
-// assertEquals("Incorrect isAnnotation for the " + i + " type", isAnnotation[i], types[i].isAnnotation());
-// assertEquals("Incorrect isEnum for the " + i + " type", isEnum[i], types[i].isEnum());
-// assertEquals("Incorrect superclassName for the " + i + " type", superclassName[i], types[i].getSuperclassName());
-// assertEquals("Incorrect superclassType for the " + i + " type", superclassType[i], types[i].getSuperclassTypeSignature());
-// assertEquals("Incorrect superInterfaceNames for the " + i + " type", superInterfaceNames[i].length, types[i].getSuperInterfaceNames().length);
-// assertEquals("Incorrect superInterfaceTypes for the " + i + " type", superInterfaceTypes[i].length, types[i].getSuperInterfaceTypeSignatures().length);
-// assertEquals("Incorrect formalTypeParameters for the " + i + " type", formalTypeParameters[i].length, types[i].getTypeParameters().length);
-// }
-//}
-/**
- * Ensures that a compilation unit has children.
- */
-public void testHasChildren() throws JavaScriptModelException {
- this.cu.close();
- assertTrue("A closed compilation unit should have children", this.cu.hasChildren());
- this.cu.getChildren();
- assertTrue("The compilation unit should have children", this.cu.hasChildren());
-}
-/**
- * Ensures that a compilation unit's resource has not changed.
- */
-public void testHasResourceChanged() {
- assertTrue(
- "A compilation unit's resource should not have changed",
- !this.cu.hasResourceChanged());
-}
-///*
-// * Ensures that hasChildren doesn't return true for an import container that doesn't exist
-// * (regression test for bug 76761 [model] ImportContainer.hasChildren() should not return true
-// */
-//public void testImportContainerHasChildren() throws JavaScriptModelException {
-// IImportContainer importContainer = getCompilationUnit("/Test/DoesNotExist.js").getImportContainer();
-// boolean gotException = false;
-// try {
-// importContainer.hasChildren();
-// } catch (JavaScriptModelException e) {
-// gotException = e.isDoesNotExist();
-// }
-// assertTrue("Should get a not present exception", gotException);
-//}
-///*
-// * Ensures that isEnumConstant returns true for a field representing an enum constant.
-// */
-//public void testIsEnumConstant1() throws JavaScriptModelException {
-// IField field = this.cu.getType("Colors").getField("BLUE");
-// assertTrue("Colors#BLUE should be an enum constant", field.isEnumConstant());
-//}
-///*
-// * Ensures that isEnumConstant returns false for a field that is not representing an enum constant.
-// */
-//public void testIsEnumConstant2() throws JavaScriptModelException {
-// IField field = this.cu.getType("X").getField("f1");
-// assertTrue("X#f1 should not be an enum constant", !field.isEnumConstant());
-//}
-/*
- * Ensure that the utility method Util.#getNameWithoutJavaLikeExtension(String) works as expected
- * (regression test for bug 107735 StringIndexOutOfBoundsException in Util.getNameWithoutJavaLikeExtension())
- */
-public void testNameWithoutJavaLikeExtension() {
- String name = Util.getNameWithoutJavaLikeExtension("Test.aj");
- assertEquals("Unepected name without extension", "Test.aj", name);
-}
-/**
- * Ensures that a compilation unit that does not exist responds
- * false to #exists() and #isOpen()
- */
-public void testNotPresent1() {
- IJavaScriptUnit compilationUnit = ((IPackageFragment)this.cu.getParent()).getJavaScriptUnit("DoesNotExist.js");
- assertTrue("CU should not be open", !compilationUnit.isOpen());
- assertTrue("CU should not exist", !compilationUnit.exists());
- assertTrue("CU should still not be open", !compilationUnit.isOpen());
-}
-///**
-// * Ensures that a compilation unit that does not exist
-// * (because it is a child of a jar package fragment)
-// * responds false to #exists() and #isOpen()
-// * (regression test for PR #1G2RKD2)
-// */
-//public void testNotPresent2() throws CoreException {
-// IJavaScriptUnit compilationUnit = getPackageFragment("P", getExternalJCLPathString(), "java.lang").getCompilationUnit("DoesNotExist.js");
-// assertTrue("CU should not be open", !compilationUnit.isOpen());
-// assertTrue("CU should not exist", !compilationUnit.exists());
-// assertTrue("CU should still not be open", !compilationUnit.isOpen());
-//}
-
-/*
- * Ensure that the absence of visibility flags is correctly reported as package default
- * (regression test fo bug 127213 Flags class missing methods)
- */
-public void testPackageDefaultFlag1() throws JavaScriptModelException {
- IField field = this.cu.getField("f4");
- assertTrue("X#f4 should be package default", Flags.isPackageDefault(field.getFlags()));
-}
-
-///*
-// * Ensure that the presence of a visibility flags is correctly reported as non package default
-// * (regression test fo bug 127213 Flags class missing methods)
-// */
-//public void testPackageDefaultFlag2() throws JavaScriptModelException {
-// IType type = this.cu.getType("X");
-// assertTrue("X should not be package default", !Flags.isPackageDefault(type.getFlags()));
-//}
-
-/*
- * Ensure that the presence of a visibility flags as well as the deprecated flag is correctly reported as non package default
- * (regression test fo bug 127213 Flags class missing methods)
- */
-public void testPackageDefaultFlag3() throws JavaScriptModelException {
- IField field = this.cu.getType("X").getField("f2");
- assertTrue("X#f2 should not be package default", !Flags.isPackageDefault(field.getFlags()));
-}
-
-/*
- * Ensure that the absence of a visibility flags and the presence of the deprecated flag is correctly reported as package default
- * (regression test fo bug 127213 Flags class missing methods)
- */
-public void testPackageDefaultFlag4() throws JavaScriptModelException {
- IType type = this.cu.getType("I");
- assertTrue("X should be package default", Flags.isPackageDefault(type.getFlags()));
-}
-
-/**
- * Ensures that the "structure is known" flag is set for a valid compilation unit.
- */
-public void testStructureKnownForCU() throws JavaScriptModelException {
- assertTrue("Structure is unknown for valid CU", this.cu.isStructureKnown());
-}
-/**
- * Ensures that the "structure is unknown" flag is set for a non valid compilation unit.
- */
-public void testStructureUnknownForCU() throws CoreException {
- try {
- this.createFile(
- "/P/src/p/Invalid.js",
- "@#D(03");
- IJavaScriptUnit badCU = getCompilationUnit("/P/src/p/Invalid.js");
- assertTrue("Structure is known for an invalid CU", !badCU.isStructureKnown());
- } finally {
- this.deleteFile("/P/src/p/Invalid.js");
- }
-}
-
-///*
-// * Ensure that the super flags is correctly reported
-// * (regression test fo bug 127213 Flags class missing methods)
-// */
-//public void testSuperFlag1() throws JavaScriptModelException {
-// assertTrue("Should contain super flag", Flags.isSuper(Flags.AccSuper));
-//}
-//
-///*
-// * Ensure that the super flags is correctly reported
-// * (regression test fo bug 127213 Flags class missing methods)
-// */
-//public void testSuperFlag2() throws JavaScriptModelException {
-// assertTrue("Should not contain super flag", !Flags.isSuper(Flags.AccDefault));
-//}
-
-///*
-// * Verify fix for bug 73884: [1.5] Unexpected error for class implementing generic interface
-// * (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=73884)
-// */
-//public void testBug73884() throws CoreException {
-// try {
-// String cuSource =
-// "package p;\n" +
-// "public interface I<T> {\n" +
-// "}";
-// createFile("/P/src/p/I.js", cuSource);
-// ITypeParameter[] typeParameters = getCompilationUnit("/P/src/p/I.js").getType("I").getTypeParameters();
-// assertTypeParametersEqual(
-// "T\n",
-// typeParameters);
-// } finally {
-// deleteFile("/P/src/p/I.js");
-// }
-//}
-
-///*
-// * Ensure that the type parameters for a type are correct.
-// */
-//public void testTypeParameter1() throws CoreException {
-// createWorkingCopy(
-// "package p;\n" +
-// "public class Y<T> {\n" +
-// "}"
-// );
-// ITypeParameter[] typeParameters = workingCopy.getType("Y").getTypeParameters();
-// assertTypeParametersEqual(
-// "T\n",
-// typeParameters);
-//}
-//
-///*
-// * Ensure that the type parameters for a type are correct.
-// */
-//public void testTypeParameter2() throws CoreException {
-// createWorkingCopy(
-// "package p;\n" +
-// "public class Y<T, U> {\n" +
-// "}"
-// );
-// ITypeParameter[] typeParameters = workingCopy.getType("Y").getTypeParameters();
-// assertTypeParametersEqual(
-// "T\n" +
-// "U\n",
-// typeParameters);
-//}
-//
-///*
-// * Ensure that the type parameters for a type are correct.
-// */
-//public void testTypeParameter3() throws CoreException {
-// createWorkingCopy(
-// "package p;\n" +
-// "public class Y<T extends List> {\n" +
-// "}"
-// );
-// ITypeParameter[] typeParameters = workingCopy.getType("Y").getTypeParameters();
-// assertTypeParametersEqual(
-// "T extends List\n",
-// typeParameters);
-//}
-//
-///*
-// * Ensure that the type parameters for a type are correct.
-// */
-//public void testTypeParameter4() throws CoreException {
-// createWorkingCopy(
-// "package p;\n" +
-// "public class Y<T extends List & Runnable & Comparable> {\n" +
-// "}"
-// );
-// ITypeParameter[] typeParameters = workingCopy.getType("Y").getTypeParameters();
-// assertTypeParametersEqual(
-// "T extends List & Runnable & Comparable\n",
-// typeParameters);
-//}
-//
-///*
-// * Ensure that the type parameters for a method are correct.
-// * (regression test for bug 75658 [1.5] SourceElementParser do not compute correctly bounds of type parameter)
-// */
-//public void testTypeParameter5() throws CoreException {
-// createWorkingCopy(
-// "package p;\n" +
-// "public class Y {\n" +
-// " <T extends List, U extends X & Runnable> void foo() {\n" +
-// " }\n" +
-// "}"
-// );
-// ITypeParameter[] typeParameters = workingCopy.getType("Y").getMethod("foo", new String[]{}).getTypeParameters();
-// assertTypeParametersEqual(
-// "T extends List\n" +
-// "U extends X & Runnable\n",
-// typeParameters);
-//}
-//
-///*
-// * Verify fix for bug 78275: [recovery] NPE in GoToNextPreviousMemberAction with syntax error
-// * (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=78275)
-// */
-//public void testBug78275() throws CoreException {
-// try {
-// String cuSource =
-// " function a() {\n" +
-// " }\n" +
-// " }\n" +
-// " function m() {}\n" +
-// "";
-// createFile("/P/src/X.js", cuSource);
-// IType type = getCompilationUnit("/P/src/X.js").getType("X");
-// IInitializer[] initializers = type.getInitializers();
-// assertEquals("Invalid number of initializers", 1, initializers.length);
-// assertTrue("Invalid length for initializer", initializers[0].getSourceRange().getLength() > 0);
-// } finally {
-// deleteFile("/P/src/X.js");
-// }
-//}
-public void test110172() throws CoreException {
- try {
- String source =
- " /**\n" +
- " * Javadoc for field f \n" +
- " */\n" +
- " var f;\n" +
- " \n" +
- " /**\n" +
- " * Javadoc for method foo\n" +
- " */\n" +
- " function foo( i, l, s) {\n" +
- " }\n" +
- " \n" +
- " /**\n" +
- " * Javadoc for member type A\n" +
- " */\n" +
- " \n" +
- " /**\n" +
- " * Javadoc for f3\n" +
- " */\n" +
- " /*\n" +
- " * Not a javadoc comment\n" +
- " */\n" +
- " /**\n" +
- " * Real javadoc for f3\n" +
- " */\n" +
- " var f3;\n" +
- " \n" +
- " var f2;\n" +
- " \n" +
- " function foo2() {\n" +
- " }\n" +
- " \n" +
- "\n" +
- "";
- createFile("/P/src/X.js", source);
-// IType type = getCompilationUnit("/P/src/X.js").getType("X");
- IJavaScriptElement[] members = getCompilationUnit("/P/src/X.js").getChildren();
- final int length = members.length;
- assertEquals("Wrong number", 5, length);
- for (int i = 0; i < length; i++) {
- final IJavaScriptElement element = members[i];
- assertTrue(element instanceof IMember);
- final ISourceRange javadocRange = ((IMember) element).getJSdocRange();
- final String elementName = element.getElementName();
- if ("f".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("field f") != -1);
- } else if ("foo".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("method foo") != -1);
- } else if ("A".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("member type A") != -1);
- } else if ("X".equals(elementName)) {
- // need treatment for the two constructors
- assertTrue("Not an IFunction", element instanceof IFunction);
- IFunction method = (IFunction) element;
- switch(method.getNumberOfParameters()) {
- case 0 :
- assertNull("Has a javadoc source range", javadocRange);
- break;
- case 1:
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("constructor") != -1);
- }
- } else if ("f3".equals(elementName)) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("Real") != -1);
- } else if ("f2".equals(elementName)) {
- assertNull("Has a javadoc source range", javadocRange);
- } else if ("foo2".equals(elementName)) {
- assertNull("Has a javadoc source range", javadocRange);
- } else if ("B".equals(elementName)) {
- assertNull("Has a javadoc source range", javadocRange);
- } else if (element instanceof IInitializer) {
- IInitializer initializer = (IInitializer) element;
- if (Flags.isStatic(initializer.getFlags())) {
- assertNotNull("No javadoc source range", javadocRange);
- final int start = javadocRange.getOffset();
- final int end = javadocRange.getLength() + start - 1;
- String javadocSource = source.substring(start, end);
- assertTrue("Wrong javadoc", javadocSource.indexOf("initializer") != -1);
- } else {
- assertNull("Has a javadoc source range", javadocRange);
- }
- }
- }
- } finally {
- deleteFile("/P/src/X.js");
- }
-}
-public void test120902() throws CoreException {
- try {
- String source =
- "/**\r\n" +
- " * Toy\r\n" +
- " */\r\n" +
- "function foo() {\r\n" +
- "}";
- createFile("/P/src/X.js", source);
- final IJavaScriptUnit compilationUnit = getCompilationUnit("/P/src/X.js");
- IFunction type = compilationUnit.getFunction("foo",null);
- ISourceRange javadocRange = type.getJSdocRange();
- assertNotNull("No source range", javadocRange);
- compilationUnit.getBuffer().setContents("");
- try {
- javadocRange = type.getJSdocRange();
- assertNull("Got a source range", javadocRange);
- } catch (ArrayIndexOutOfBoundsException e) {
- assertFalse("Should not happen", true);
- }
- } finally {
- deleteFile("/P/src/X.js");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionContextTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionContextTests.java
deleted file mode 100644
index e76d77b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionContextTests.java
+++ /dev/null
@@ -1,3385 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.*;
-
-public class CompletionContextTests extends AbstractJavaModelCompletionTests implements RelevanceConstants {
-
-public CompletionContextTests(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- if (COMPLETION_PROJECT == null) {
- COMPLETION_PROJECT = setUpJavaProject("Completion", "1.4");
- } else {
- setUpProjectCompliance(COMPLETION_PROJECT, "1.4");
- }
- super.setUpSuite();
-}
-
-public static Test suite() {
- return buildModelTestSuite(CompletionContextTests.class);
-}
-public void test0001() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0001/X.js",
- "function X(){\n" +
- " ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0002() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0002/X.js",
- "function X() {\n" +
- " ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0003() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0003/X.js",
- "function X() {\n" +
- " ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0004() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0004/X.js",
- "function X() {\n" +
- " /**/\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("/**/") + "/**/".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("/**/") + "/**/".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-//public void test0005() throws JavaScriptModelException {
-// this.workingCopies = new IJavaScriptUnit[1];
-// this.workingCopies[0] = getWorkingCopy(
-// "/Completion/src3/test0005/X.js",
-// "package test0005;\n" +
-// "public class X {\n" +
-// " ZZZZ foo()\n" +
-// "}");
-//
-// String str = this.workingCopies[0].getSource();
-// int tokenStart = str.lastIndexOf("ZZZZ");
-// int tokenEnd = tokenStart + "ZZZZ".length() - 1;
-// int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-//
-// CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-//
-// assertResults(
-// "completion offset="+(cursorLocation)+"\n" +
-// "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
-// "completion token=\"ZZZZ\"\n" +
-// "completion token kind=TOKEN_KIND_NAME\n" +
-// "expectedTypesSignatures=null\n" +
-// "expectedTypesKeys=null",
-// result.context);
-//}
-//public void test0006() throws JavaScriptModelException {
-// this.workingCopies = new IJavaScriptUnit[1];
-// this.workingCopies[0] = getWorkingCopy(
-// "/Completion/src3/test0006/X.js",
-// "package test0006;\n" +
-// "public class X {\n" +
-// " ZZZZ foo()\n" +
-// "}");
-//
-// String str = this.workingCopies[0].getSource();
-// int tokenStart = str.lastIndexOf("ZZZZ");
-// int tokenEnd = tokenStart + "ZZZZ".length() - 1;
-// int cursorLocation = str.lastIndexOf("ZZZZ");
-//
-// CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-//
-// assertResults(
-// "completion offset="+(cursorLocation)+"\n" +
-// "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
-// "completion token=\"\"\n" +
-// "completion token kind=TOKEN_KIND_NAME\n" +
-// "expectedTypesSignatures=null\n" +
-// "expectedTypesKeys=null",
-// result.context);
-//}
-//public void test0007() throws JavaScriptModelException {
-// this.workingCopies = new IJavaScriptUnit[1];
-// this.workingCopies[0] = getWorkingCopy(
-// "/Completion/src3/test0007/X.js",
-// "package test0007;\n" +
-// "public class X {\n" +
-// " ZZZZ foo()\n" +
-// "}");
-//
-// String str = this.workingCopies[0].getSource();
-// int tokenStart = str.lastIndexOf("ZZZZ");
-// int tokenEnd = tokenStart + "ZZZZ".length() - 1;
-// int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-//
-// CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-//
-// assertResults(
-// "completion offset="+(cursorLocation)+"\n" +
-// "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
-// "completion token=\"ZZ\"\n" +
-// "completion token kind=TOKEN_KIND_NAME\n" +
-// "expectedTypesSignatures=null\n" +
-// "expectedTypesKeys=null",
-// result.context);
-//}
-public void test0008() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0008/X.js",
- " /**/ function foo()\n" +
- "");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("/**/") + "/**/".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("/**/") + "/**/".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-//public void test0009() throws JavaScriptModelException {
-// this.workingCopies = new IJavaScriptUnit[1];
-// this.workingCopies[0] = getWorkingCopy(
-// "/Completion/src3/test0009/X.js",
-// "package test0009;\n" +
-// "public class X {\n" +
-// " void foo() {\n" +
-// " ZZZZ\n" +
-// " }\n" +
-// "}");
-//
-// String str = this.workingCopies[0].getSource();
-// int tokenStart = str.lastIndexOf("ZZZZ");
-// int tokenEnd = tokenStart + "ZZZZ".length() - 1;
-// int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-//
-// CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-//
-// assertResults(
-// "completion offset="+(cursorLocation)+"\n" +
-// "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
-// "completion token=\"ZZZZ\"\n" +
-// "completion token kind=TOKEN_KIND_NAME\n" +
-// "expectedTypesSignatures=null\n" +
-// "expectedTypesKeys=null",
-// result.context);
-//}
-public void test0010() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0010/X.js",
- "package test0010;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0011() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0011/X.js",
- "package test0011;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0012() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0012/X.js",
- "package test0012;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " /**/\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("/**/") + "/**/".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("/**/") + "/**/".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0013() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0013/X.js",
- "package test0013;\n" +
- "public class X extends ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0014() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0014/X.js",
- "package test0014;\n" +
- "public class X extends ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0015() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0015/X.js",
- "package test0015;\n" +
- "public class X extends ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0016() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0016/X.js",
- "package test0016;\n" +
- "public class X extends /**/ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("/**/") + "/**/".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("/**/") + "/**/".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0017() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0017/YYYY.js",
- "package test0017;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0017/X.js",
- "package test0017;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " YYYY.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0018() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0018/YYYY.js",
- "package test0018;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0018/X.js",
- "package test0018;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " YYYY.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0019() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0019/YYYY.js",
- "package test0019;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0019/X.js",
- "package test0019;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " YYYY.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0020() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0020/YYYY.js",
- "package test0020;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0020/X.js",
- "package test0020;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " YYYY.\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("YYYY.") + "YYYY.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("YYYY.") + "YYYY.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0021() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0021/X.js",
- "package test0021;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " test0021.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0022() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0022/X.js",
- "package test0022;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " test0022.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0023() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0023/X.js",
- "package test0023;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " test0023.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0024() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0024/X.js",
- "package test0024;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " test0024.\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("test0024.") + "test0024.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("test0024.") + "test0024.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0025() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0025/X.js",
- "package test0025;\n" +
- "public class X {\n" +
- " Object var;\n" +
- " void foo() {\n" +
- " var.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0026() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0026/X.js",
- "package test0026;\n" +
- "public class X {\n" +
- " Object var;\n" +
- " void foo() {\n" +
- " var.ZZZZ\n" +
- " }\n" +
- "}");
-
-
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0027() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0027/X.js",
- "package test0027;\n" +
- "public class X {\n" +
- " Object var;\n" +
- " void foo() {\n" +
- " var.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0028() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0028/X.js",
- "package test0028;\n" +
- "public class X {\n" +
- " Object var;\n" +
- " void foo() {\n" +
- " var.\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("var.") + "var.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("var.") + "var.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0029() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0029/YYYY.js",
- "package test0029;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0029/X.js",
- "package test0029;\n" +
- "public class X extends YYYY.ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0030() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0030/YYYY.js",
- "package test0030;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0030/X.js",
- "package test0030;\n" +
- "public class X extends YYYY.ZZZZ {\n" +
- "}");
-
-
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0031() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0031/YYYY.js",
- "package test0031;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0031/X.js",
- "package test0031;\n" +
- "public class X extends YYYY.ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0032() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test0032/YYYY.js",
- "package test0032;\n" +
- "public class YYYY {\n" +
- " public class ZZZZ {\n" +
- " }\n" +
- "}");
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0032/X.js",
- "package test0032;\n" +
- "public class X extends YYYY. {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("YYYY.") + "YYYY.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("YYYY.") + "YYYY.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0033() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0033/X.js",
- "package test0033;\n" +
- "public class X extends test0033.ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0034() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0034/X.js",
- "package test0034;\n" +
- "public class X extends test0034.ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0035() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0035/X.js",
- "package test0035;\n" +
- "public class X extends test0035.ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0036() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0036/X.js",
- "package test0036;\n" +
- "public class X extends test0036. {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("test0036.") + "test0036.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("test0036.") + "test0036.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0037() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0037/X.js",
- "package test0037;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " foo().ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0038() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0038/X.js",
- "package test0038;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " foo().ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0039() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0039/X.js",
- "package test0039;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " foo().ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0040() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0040/X.js",
- "package test0040;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " foo().\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("foo().") + "foo().".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("foo().") + "foo().".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0041() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0041/X.js",
- "package test0041;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " int.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0042() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0042/X.js",
- "package test0042;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " int.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0043() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0043/X.js",
- "package test0043;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " int.ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0044() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0044/X.js",
- "package test0044;\n" +
- "public class X {\n" +
- " X ZZZZ;\n" +
- " X foo(){\n" +
- " int.\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("int.") + "int.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("int.") + "int.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0045() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0045/X.js",
- "package test0045;\n" +
- "public class X {\n" +
- " void ZZZZ(){\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0046() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0046/X.js",
- "package test0046;\n" +
- "public class X {\n" +
- " void ZZZZ(){\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0047() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0047/X.js",
- "package test0047;\n" +
- "public class X {\n" +
- " void ZZZZ(){\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0048() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0048/X.js",
- "package test0048;\n" +
- "public class X {\n" +
- " void (){\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("void ") + "void ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("void ") + "void ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0049() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0049/X.js",
- "package test0049;\n" +
- "public class X {\n" +
- " int ZZZZ;\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0050() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0050/X.js",
- "package test0050;\n" +
- "public class X {\n" +
- " int ZZZZ;\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0051() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0051/X.js",
- "package test0051;\n" +
- "public class X {\n" +
- " int ZZZZ;\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0052() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0052/X.js",
- "package test0052;\n" +
- "public class X {\n" +
- " int ;\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("int ") + "int ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("int ") + "int ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0053() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0053/X.js",
- "package test0053;\n" +
- "public class X {\n" +
- " {int ZZZZ;}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0054() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0054/X.js",
- "package test0054;\n" +
- "public class X {\n" +
- " {int ZZZZ;}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0055() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0055/X.js",
- "package test0055;\n" +
- "public class X {\n" +
- " {int ZZZZ;}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0056() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0056/X.js",
- "package test0056;\n" +
- "public class X {\n" +
- " {int ;}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("int ") + "int ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("int ") + "int ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0057() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0057/X.js",
- "package test0057;\n" +
- "public class X {\n" +
- " void foo(int ZZZZ){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0058() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0058/X.js",
- "package test0058;\n" +
- "public class X {\n" +
- " void foo(int ZZZZ){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0059() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0059/X.js",
- "package test0059;\n" +
- "public class X {\n" +
- " void foo(int ZZZZ){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0060() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0060/X.js",
- "package test0060;\n" +
- "public class X {\n" +
- " void foo(int ){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("int ") + "int ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("int ") + "int ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0061() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0061/X.js",
- "package test0061;\n" +
- "public class X ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0062() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0062/X.js",
- "package test0062;\n" +
- "public class X ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0063() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0063/X.js",
- "package test0063;\n" +
- "public class X ZZZZ {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0064() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0064/X.js",
- "package test0064;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("X ") + "X ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("X ") + "X ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0065() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0065/X.js",
- "package test0065;\n" +
- "ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0066() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0066/X.js",
- "package test0066;\n" +
- "ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0067() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0067/X.js",
- "package test0067;\n" +
- "ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0068() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0068/X.js",
- "package test0068;\n" +
- "/**/\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("/**/") + "/**/".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("/**/") + "/**/".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0069() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0069/X.js",
- "package test0069;\n" +
- "public class X {\n" +
- " {\n" +
- " do{\n" +
- " } ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0070() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0070/X.js",
- "package test0070;\n" +
- "public class X {\n" +
- " {\n" +
- " do{\n" +
- " } ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0071() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0071/X.js",
- "package test0071;\n" +
- "public class X {\n" +
- " {\n" +
- " do{\n" +
- " } ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0072() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0072/X.js",
- "package test0072;\n" +
- "public class X {\n" +
- " {\n" +
- " do{\n" +
- " }/**/ \n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("/**/ ") + "/**/ ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("/**/ ") + "/**/ ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0073() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0073/X.js",
- "package ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0074() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0074/X.js",
- "package ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0075() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0075/X.js",
- "package ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0076() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0076/X.js",
- "package \n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("package ") + "package ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("package ") + "package ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0077() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0077/test/X.js",
- "package test0077.ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0078() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0078/test/X.js",
- "package test0078.ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0079() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0079/test/X.js",
- "package test0079.ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0080() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0080/test/X.js",
- "package test0080.\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("test0080.") + "test0080.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("test0080.") + "test0080.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0081() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0081/X.js",
- "package test0081;\n" +
- "import ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0082() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0082/X.js",
- "package test0082;\n" +
- "import ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0083() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0083/X.js",
- "package test0083;\n" +
- "import ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0084() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0084/X.js",
- "package test0084;\n" +
- "import \n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("import ") + "import ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("import ") + "import ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0085() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0085/test/X.js",
- "package test0085;\n" +
- "import test0085.ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0086() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0086/test/X.js",
- "package test0086;\n" +
- "import test0086.ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0087() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0087/test/X.js",
- "package test0087;\n" +
- "import test0087.ZZZZ;\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0088() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0084/test/X.js",
- "package test0088;\n" +
- "import test0085.\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("test0085.") + "test0085.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("test0085.") + "test0085.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0089() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0089/X.js",
- "package test0089;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0090() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0090/X.js",
- "package test0090;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0091() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0091/X.js",
- "package test0091;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0092() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0092/X.js",
- "package test0092;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("this.foo(") + "this.foo(".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("this.foo(") + "this.foo(".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0093() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0093/X.js",
- "package test0093;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(0,ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0094() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0094/X.js",
- "package test0094;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(0,ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0095() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0095/X.js",
- "package test0095;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(0,ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0096() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0096/X.js",
- "package test0096;\n" +
- "public class X {\n" +
- " void foo(int a, int b) {\n" +
- " this.foo(0,\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("this.foo(0,") + "this.foo(0,".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("this.foo(0,") + "this.foo(0,".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0097() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0097/X.js",
- "package test0097;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0098() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0098/X.js",
- "package test0098;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0099() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0099/X.js",
- "package test0099;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0100() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0100/X.js",
- "package test0100;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("new X(") + "new X(".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("new X(") + "new X(".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0101() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0101/X.js",
- "package test0101;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(0,ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0102() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0102/X.js",
- "package test0102;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(0,ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0103() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0103/X.js",
- "package test0103;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(0,ZZZZ\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={I}\n" +
- "expectedTypesKeys={I}",
- result.context);
-}
-public void test0104() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0104/X.js",
- "package test0104;\n" +
- "public class X {\n" +
- " X(int a, int b) {}\n" +
- " void foo(int a, int b) {\n" +
- " new X(0,\n" +
- " }\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("new X(0,") + "new X(0,".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("new X(0,") + "new X(0,".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0105() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0105/X.js",
- "package test0105;\n" +
- "public class X {\n" +
- " Object o = ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0106() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0106/X.js",
- "package test0106;\n" +
- "public class X {\n" +
- " Object o = ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0107() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0107/X.js",
- "package test0107;\n" +
- "public class X {\n" +
- " Object o = ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0108() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0108/X.js",
- "package test0108;\n" +
- "public class X {\n" +
- " Object o = \n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("Object o = ") + "Object o = ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("Object o = ") + "Object o = ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0109() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0109/X.js",
- "package test0109;\n" +
- "public class X {\n" +
- " Object o = new ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0110() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0110/X.js",
- "package test0110;\n" +
- "public class X {\n" +
- " Object o = new ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0111() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0111/X.js",
- "package test0111;\n" +
- "public class X {\n" +
- " Object o = new ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0112() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0112/X.js",
- "package test0112;\n" +
- "public class X {\n" +
- " Object o = new \n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("Object o = new ") + "Object o = new ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("Object o = new ") + "Object o = new ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.Object;}\n" +
- "expectedTypesKeys={Ljava/lang/Object;}",
- result.context);
-}
-public void test0113() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0113/X.js",
- "package test0113;\n" +
- "public class X {\n" +
- " Object o = new Object() {\n" +
- " ZZZZ\n" +
- " };\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0114() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0114/X.js",
- "package test0114;\n" +
- "public class X {\n" +
- " Object o = new Object() {\n" +
- " ZZZZ\n" +
- " };\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0115() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0115/X.js",
- "package test0115;\n" +
- "public class X {\n" +
- " Object o = new Object() {\n" +
- " ZZZZ\n" +
- " };\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0116() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0116/X.js",
- "package test0116;\n" +
- "public class X {\n" +
- " Object o = new Object() {\n" +
- " /**/\n" +
- " };\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("/**/") + "/**/".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("/**/") + "/**/".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0117() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0117/X.js",
- "package test0117;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\";\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ\"");
- int tokenEnd = tokenStart + "\"ZZZZ\"".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0118() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0118/X.js",
- "package test0118;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\";\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ\"");
- int tokenEnd = tokenStart + "\"ZZZZ\"".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0119() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0119/X.js",
- "package test0119;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\";\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ\"");
- int tokenEnd = tokenStart + "\"ZZZZ\"".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0120() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0120/X.js",
- "package test0120;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\";\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ\"");
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("\"ZZZZ") + "".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0121() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0121/X.js",
- "package test0121;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\";\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int cursorLocation = str.lastIndexOf("\"ZZZZ\"") + "\"ZZZZ\"".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=[-1, -1]\n" +
- "completion token=null\n" +
- "completion token kind=TOKEN_KIND_UNKNOWN\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0122() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0122/X.js",
- "package test0122;\n" +
- "public class X {\n" +
- " String s = \"\";\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"\"");
- int tokenEnd = tokenStart + "\"\"".length() - 1;
- int cursorLocation = str.lastIndexOf("\"\"") + "\"".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0123() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0123/X.js",
- "package test0123;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ");
- int tokenEnd = tokenStart + "\"ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0124() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0124/X.js",
- "package test0124;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ");
- int tokenEnd = tokenStart + "\"ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0125() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0125/X.js",
- "package test0125;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ");
- int tokenEnd = tokenStart + "\"ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0126() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0126/X.js",
- "package test0126;\n" +
- "public class X {\n" +
- " String s = \"ZZZZ\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ");
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("\"ZZZZ") + "".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0127() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0127/X.js",
- "package test0127;\n" +
- "public class X {\n" +
- " String s = \"\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"");
- int tokenEnd = tokenStart + "\"".length() - 1;
- int cursorLocation = str.lastIndexOf("\"") + "\"".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-public void test0128() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0127/X.js",
- "package test0127;\n" +
- "public class X {\n" +
- " String s0 = \"\n" +
- " String s = \"ZZZZ\"\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("\"ZZZZ\"");
- int tokenEnd = tokenStart + "\"ZZZZ\"".length() - 1;
- int cursorLocation = str.lastIndexOf("\"ZZZZ\"") + "\"ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_STRING_LITERAL\n" +
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests.java
deleted file mode 100644
index 0f4da53..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests.java
+++ /dev/null
@@ -1,13665 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.eval.IEvaluationContext;
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-
-import junit.framework.*;
-
-public class CompletionTests extends AbstractJavaModelCompletionTests implements RelevanceConstants {
-
-static {
-// TESTS_NAMES = new String[] { "testDeprecationCheck17"};
-}
-public static Test suite() {
- return buildModelTestSuite(CompletionTests.class);
-}
-public CompletionTests(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- if (COMPLETION_PROJECT == null) {
- COMPLETION_PROJECT = setUpJavaProject("Completion");
- } else {
- setUpProjectCompliance(COMPLETION_PROJECT, "1.4");
- }
- super.setUpSuite();
-}
-public void tearDownSuite() throws Exception {
- super.tearDownSuite();
-}
-
-public void test00() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "MyClass.prototype.someMethod = MyClass_someMethod;"+
- "function MyClass(){}"+
- "function MyClass_someMethod(){}"+
- "var myClassObj = new MyClass();\n"+
- "myClassObj.someMethod();\n"+
- "");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "someMethod";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "someMethod[FUNCTION_REF]{, Ltest.MyClass;, ()V, someMethod, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311
-public void testBug164311() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public int zzzzzz;\n" +
- " public void method1() {\n" +
- " label : if (0> (10));\n" +
- " zzz\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "zzz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "zzzzzz[FIELD_REF]{zzzzzz, Ltest.Test;, I, zzzzzz, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167750
-public void testBug164311_2() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class X {\n"+
- " public void zork() { \n"+
- " } \n"+
- " public void foo() { \n"+
- " this.foo(new Object(){\n"+
- " public void bar() {\n"+
- " if (zzz>(Integer)vvv.foo(i)) {\n"+
- " return;\n"+
- " }\n"+
- " if (true) {\n"+
- " return;\n"+
- " }\n"+
- " zor\n"+
- " } \n"+
- " });\n"+
- " }\n"+
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "zor";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "zork[FUNCTION_REF]{zork(), Ltest.X;, ()V, zork, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=96213
-public void testBug96213() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/Test.js",
- " function toto( o) {\n"+
- " return null;\n"+
- " }\n"+
- " function titi( removed) {\n"+
- " }\n"+
- " function foo() {\n"+
- " var removed = 0;\n"+
- " toto(Test.vv).titi(removed);\n"+
- " }\n"+
- "");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "removed";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "removed[LOCAL_VARIABLE_REF]{removed, null, Lsystem.js.Number;, removed, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=99811
-public void testBug99811() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/test/A.js",
- "public abstract class A implements I {}");
-
- aType = getWorkingCopy(
- "/Completion/src/test/I.js",
- "public interface I {\n"+
- " public class M extends A {}\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "A";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults("", requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseField1() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " int oneTwoThree;\n"+
- " int oTTField;\n"+
- " void foo() {\n"+
- " oTT\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "oTT";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "oneTwoThree[FIELD_REF]{oneTwoThree, Lcamelcase.Test;, I, oneTwoThree, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "oTTField[FIELD_REF]{oTTField, Lcamelcase.Test;, I, oTTField, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseLocalVariable1() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " void foo() {\n"+
- " int oneTwoThree;\n"+
- " int oTTLocal;\n"+
- " oTT\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "oTT";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "oneTwoThree[LOCAL_VARIABLE_REF]{oneTwoThree, null, I, oneTwoThree, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "oTTLocal[LOCAL_VARIABLE_REF]{oTTLocal, null, I, oTTLocal, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseMethod1() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " void oneTwoThree(){}\n"+
- " void oTTMethod(){}\n"+
- " void foo() {\n"+
- " oTT\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "oTT";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "oneTwoThree[FUNCTION_REF]{oneTwoThree(), Lcamelcase.Test;, ()V, oneTwoThree, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "oTTMethod[FUNCTION_REF]{oTTMethod(), Lcamelcase.Test;, ()V, oTTMethod, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseMethodDeclaration1() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test extends SuperClass {\n"+
- " oTT\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/camelcase/SuperClass.js",
- "package camelcase;"+
- "public class SuperClass {\n"+
- " public void oneTwoThree(){}\n"+
- " public void oTTMethod(){}\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "oTT";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "oTT[POTENTIAL_METHOD_DECLARATION]{oTT, Lcamelcase.Test;, ()V, oTT, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "oneTwoThree[FUNCTION_DECLARATION]{public void oneTwoThree(), Lcamelcase.SuperClass;, ()V, oneTwoThree, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "oTTMethod[FUNCTION_DECLARATION]{public void oTTMethod(), Lcamelcase.SuperClass;, ()V, oTTMethod, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseType1() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " FF\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/camelcase/FoFoFo.js",
- "package camelcase;"+
- "public class FoFoFo {\n"+
- "}");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/camelcase/FFFTest.js",
- "package camelcase;"+
- "public class FFFTest {\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "FF";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "FF[POTENTIAL_METHOD_DECLARATION]{FF, Lcamelcase.Test;, ()V, FF, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "FoFoFo[TYPE_REF]{FoFoFo, camelcase, Lcamelcase.FoFoFo;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "FFFTest[TYPE_REF]{FFFTest, camelcase, Lcamelcase.FFFTest;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseType2() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " camelcase.FF\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/camelcase/FoFoFo.js",
- "package camelcase;"+
- "public class FoFoFo {\n"+
- "}");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/camelcase/FFFTest.js",
- "package camelcase;"+
- "public class FFFTest {\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "FF";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "FoFoFo[TYPE_REF]{FoFoFo, camelcase, Lcamelcase.FoFoFo;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_NON_RESTRICTED) + "}\n" +
- "FFFTest[TYPE_REF]{FFFTest, camelcase, Lcamelcase.FFFTest;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseType3() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " /**/FF\n"+
- "}\n"+
- "class FoFoFo {\n"+
- "}\n"+
- "class FFFTest {\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/**/FF";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "FF[POTENTIAL_METHOD_DECLARATION]{FF, Lcamelcase.Test;, ()V, FF, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "FoFoFo[TYPE_REF]{FoFoFo, camelcase, Lcamelcase.FoFoFo;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "FFFTest[TYPE_REF]{FFFTest, camelcase, Lcamelcase.FFFTest;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseType4() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " FF\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/camelcase/Member1.js",
- "package camelcase;"+
- "public class Member1 {\n"+
- " public class FoFoFo {\n"+
- " }\n"+
- "}");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/camelcase/Member2.js",
- "package camelcase;"+
- "public class Member2 {\n"+
- " public class FFFTest {\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "FF";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "FF[POTENTIAL_METHOD_DECLARATION]{FF, Lcamelcase.Test;, ()V, FF, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Member1.FoFoFo[TYPE_REF]{camelcase.Member1.FoFoFo, camelcase, Lcamelcase.Member1$FoFoFo;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_NON_RESTRICTED) + "}\n" +
- "Member2.FFFTest[TYPE_REF]{camelcase.Member2.FFFTest, camelcase, Lcamelcase.Member2$FFFTest;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102572
-public void testCamelCaseType5() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/camelcase/Test.js",
- "package camelcase;"+
- "public class Test {\n"+
- " public class FoFoFo {\n"+
- " public class FFFTest {\n"+
- " FF\n"+
- " }\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "FF";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "FF[POTENTIAL_METHOD_DECLARATION]{FF, Lcamelcase.Test$FoFoFo$FFFTest;, ()V, FF, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Test.FoFoFo[TYPE_REF]{FoFoFo, camelcase, Lcamelcase.Test$FoFoFo;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "Test.FoFoFo.FFFTest[TYPE_REF]{FFFTest, camelcase, Lcamelcase.Test$FoFoFo$FFFTest;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef01() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef02() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing()\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZAException[TYPE_REF]{IZZAException, test, Ltest.IZZAException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef03() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " #\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZAException[TYPE_REF]{IZZAException, test, Ltest.IZZAException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef04() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws test.p.IZZAException, test.p.IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (test.p.IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/p/IZZAException.js",
- "package test.p;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/p/IZZBException.js",
- "package test.p;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/p/IZZException.js",
- "package test.p;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{test.p.IZZBException, test.p, Ltest.p.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{test.p.IZZException, test.p, Ltest.p.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef05() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public class IZZAException extends Exception {}\n" +
- " public class IZZBException extends Exception {}\n" +
- " public class IZZException extends Exception {}\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Test.IZZBException[TYPE_REF]{IZZBException, test, Ltest.Test$IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "Test.IZZException[TYPE_REF]{IZZException, test, Ltest.Test$IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef06() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public class Inner {\n" +
- " public class IZZAException extends Exception {}\n" +
- " public class IZZBException extends Exception {}\n" +
- " public class IZZException extends Exception {}\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- " }" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Test.Inner.IZZBException[TYPE_REF]{IZZBException, test, Ltest.Test$Inner$IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "Test.Inner.IZZException[TYPE_REF]{IZZException, test, Ltest.Test$Inner$IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef07() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void zork() {\n" +
- " class IZZAException extends Exception {}\n" +
- " class IZZBException extends Exception {}\n" +
- " class IZZException extends Exception {}\n" +
- " class Local {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- " }" +
- " }" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{IZZBException, test, LIZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, LIZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef08() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (/**/) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/**/";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "Exception[TYPE_REF]{Exception, java.lang, Ljava.lang.Exception;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXPECTED_TYPE + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef09() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[5];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZCException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZCException e) {\n" +
- " bar();\n" +
- " }\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZCException.js",
- "package test;"+
- "public class IZZCException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[4] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZCException[TYPE_REF]{IZZCException, test, Ltest.IZZCException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef10() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends IZZBException {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXPECTED_TYPE + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-//IZZBException should not be proposed but to filter this proposal
-//we would need to know subclasses of IZZAException and it's currenlty too costly to compute
-public void testCatchClauseExceptionRef11() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " bar();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends IZZAException {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef12() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZAException, IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" +
- "IZZAException[TYPE_REF]{IZZAException, test, Ltest.IZZAException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}\n" +
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
-public void testCatchClauseExceptionRef13() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZBException.js",
- "package test;"+
- "public class IZZBException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends IZZAException {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCatchClauseExceptionRef14() throws JavaScriptModelException {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " throwing();\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}" +
- "class IZZAException extends Exception {\n" +
- "}" +
- "class IZZException extends Exception {\n" +
- "}\n");
-
- IJavaScriptProject project = this.workingCopies[0].getJavaScriptProject();
- String visibilityCheck = project.getOption(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, true);
-
- try {
- project.setOption(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.ENABLED);
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "(IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- project.setOption(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, visibilityCheck);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=173907
-public void testCatchClauseExceptionRef15() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public void throwing() throws IZZException, IZZAException {}\n" +
- " public void foo() {\n" +
- " try {\n" +
- " try {\n" +
- " throwing();\n" +
- " } finally {}\n" +
- " }\n" +
- " catch (IZZAException e) {\n" +
- " }\n" +
- " catch (IZZ) {\n" +
- " }\n" +
- " }" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/IZZAException.js",
- "package test;"+
- "public class IZZAException extends Exception {\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/IZZException.js",
- "package test;"+
- "public class IZZException extends Exception {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "IZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=65737
- */
-public void testCompletion2InterfacesWithSameMethod() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "Completion2InterfacesWithSameMethod.js");
-
- String str = cu.getSource();
- String completeBehind = "var.meth";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:method completion:method() relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAbstractMethod1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAbstractMethod1.js",
- "public class CompletionAbstractMethod1 {\n" +
- " abstract class A {\n" +
- " abstract void foo();\n" +
- " }\n" +
- " class B extends A {\n" +
- " void foo{} {}\n" +
- " void bar() {\n" +
- " super.fo\n" +
- " }\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-public void testCompletionAbstractMethod2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAbstractMethod2.js",
- "public class CompletionAbstractMethod2 {\n" +
- " abstract class A {\n" +
- " abstract void foo();\n" +
- " }\n" +
- " class B extends A {\n" +
- " void foo{} {}\n" +
- " void bar() {\n" +
- " this.fo\n" +
- " }\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[FUNCTION_REF]{foo(), LCompletionAbstractMethod2$A;, ()V, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionAbstractMethod3() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAbstractMethod3.js",
- "public class CompletionAbstractMethod3 {\n" +
- " abstract class A {\n" +
- " abstract void foo();\n" +
- " }\n" +
- " class B extends A {\n" +
- " void bar() {\n" +
- " this.fo\n" +
- " }\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[FUNCTION_REF]{foo(), LCompletionAbstractMethod3$A;, ()V, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionAbstractMethod4() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAbstractMethod4.js",
- "public class CompletionAbstractMethod1 {\n" +
- " class A {\n" +
- " void foo(){}\n" +
- " }\n" +
- " abstract class B extends A {\n" +
- " abstract void foo();\n" +
- " }\n" +
- " class C extends B {\n" +
- " void foo{} {}\n" +
- " void bar() {\n" +
- " super.fo\n" +
- " }\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25578
-*/
-public void testCompletionAbstractMethodRelevance1() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionAbstractSuperClass.js",
- "public abstract class CompletionAbstractSuperClass {\n"+
- " public void foo1(){}\n"+
- " public abstract void foo2();\n"+
- " public void foo3(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAbstractMethodRelevance1.js",
- "public class CompletionAbstractMethodRelevance1 extends CompletionAbstractSuperClass {\n"+
- " foo\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[POTENTIAL_METHOD_DECLARATION]{foo, LCompletionAbstractMethodRelevance1;, ()V, foo, null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "foo1[FUNCTION_DECLARATION]{public void foo1(), LCompletionAbstractSuperClass;, ()V, foo1, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n" +
- "foo3[FUNCTION_DECLARATION]{public void foo3(), LCompletionAbstractSuperClass;, ()V, foo3, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n" +
- "foo2[FUNCTION_DECLARATION]{public void foo2(), LCompletionAbstractSuperClass;, ()V, foo2, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_ABSTRACT_METHOD + R_METHOD_OVERIDE+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- }
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25578
-*/
-public void testCompletionAbstractMethodRelevance2() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionSuperInterface.js",
- "public interface CompletionSuperInterface{\n"+
- " public int eqFoo(int a,Object b);\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAbstractMethodRelevance2.js",
- "public class CompletionAbstractMethodRelevance2 implements CompletionSuperInterface {\n"+
- " eq\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "eq";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "eq[POTENTIAL_METHOD_DECLARATION]{eq, LCompletionAbstractMethodRelevance2;, ()V, eq, null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "equals[FUNCTION_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n" +
- "eqFoo[FUNCTION_DECLARATION]{public int eqFoo(int a, Object b), LCompletionSuperInterface;, (ILjava.lang.Object;)I, eqFoo, (a, b), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_ABSTRACT_METHOD + R_METHOD_OVERIDE+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- }
-}
-public void testCompletionAfterCase1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAfterCase1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzz completion:zzz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAfterCase2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAfterCase2.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzz completion:zzz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAfterSupercall1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionAfterSupercall1.js",
- "public class CompletionAfterSupercall1 extends CompletionAfterSupercall1_1 {\n" +
- " public void foo(){\n" +
- " super.foo\n" +
- " }\n" +
- "}\n" +
- "abstract class CompletionAfterSupercall1_1 extends CompletionAfterSupercall1_2 implements CompletionAfterSupercall1_3 {\n" +
- " \n" +
- "}\n" +
- "class CompletionAfterSupercall1_2 implements CompletionAfterSupercall1_3 {\n" +
- " public void foo(){}\n" +
- "}\n" +
- "interface CompletionAfterSupercall1_3 {\n" +
- " public void foo();\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "super.foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[FUNCTION_REF]{foo(), LCompletionAfterSupercall1_2;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC+ R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionAfterSwitch() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAfterSwitch.js");
-
- String str = cu.getSource();
- String completeBehind = "bar";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:bar completion:bar() relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_NAME+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAllMemberTypes() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionAllMemberTypes.js",
- "package test;\n" +
- "public class CompletionAllMemberTypes {\n" +
- " class Member1 {\n" +
- " class Member2 {\n" +
- " class Member3 {\n" +
- " }\n" +
- " }\n" +
- " void foo(){\n" +
- " Member\n" +
- " }\n" +
- " \n}" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Member";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionAllMemberTypes.Member1.Member2.Member3[TYPE_REF]{test.CompletionAllMemberTypes.Member1.Member2.Member3, test, Ltest.CompletionAllMemberTypes$Member1$Member2$Member3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes.Member1[TYPE_REF]{Member1, test, Ltest.CompletionAllMemberTypes$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes.Member1.Member2[TYPE_REF]{Member2, test, Ltest.CompletionAllMemberTypes$Member1$Member2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionAllMemberTypes2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionAllMemberTypes2.js",
- "package test;\n" +
- "public class CompletionAllMemberTypes2 {\n" +
- " class Member1 {\n" +
- " class Member5 {\n" +
- " class Member6 {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " class Member3 {\n" +
- " class Member4 {\n" +
- " }\n" +
- " }\n" +
- " void foo(){\n" +
- " Member\n" +
- " }\n" +
- " }\n" +
- " \n}" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Member";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionAllMemberTypes2.Member1.Member2.Member3.Member4[TYPE_REF]{test.CompletionAllMemberTypes2.Member1.Member2.Member3.Member4, test, Ltest.CompletionAllMemberTypes2$Member1$Member2$Member3$Member4;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member5.Member6[TYPE_REF]{test.CompletionAllMemberTypes2.Member1.Member5.Member6, test, Ltest.CompletionAllMemberTypes2$Member1$Member5$Member6;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1[TYPE_REF]{Member1, test, Ltest.CompletionAllMemberTypes2$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2[TYPE_REF]{Member2, test, Ltest.CompletionAllMemberTypes2$Member1$Member2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2.Member3[TYPE_REF]{Member3, test, Ltest.CompletionAllMemberTypes2$Member1$Member2$Member3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member5[TYPE_REF]{Member5, test, Ltest.CompletionAllMemberTypes2$Member1$Member5;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionAllMemberTypes3() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionAllMemberTypes2.js",
- "package test;\n" +
- "public interface CompletionAllMemberTypes2 {\n" +
- " interface Member1 {\n" +
- " interface Member5 {\n" +
- " interface Member6 {\n" +
- " }\n" +
- " }\n" +
- " interface Member2 {\n" +
- " interface Member3 {\n" +
- " interface Member4 {\n" +
- " }\n" +
- " }\n" +
- " Member\n" +
- " }\n" +
- " \n}" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Member";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Member[POTENTIAL_METHOD_DECLARATION]{Member, Ltest.CompletionAllMemberTypes2$Member1$Member2;, ()V, Member, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2.Member3.Member4[TYPE_REF]{test.CompletionAllMemberTypes2.Member1.Member2.Member3.Member4, test, Ltest.CompletionAllMemberTypes2$Member1$Member2$Member3$Member4;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member5.Member6[TYPE_REF]{test.CompletionAllMemberTypes2.Member1.Member5.Member6, test, Ltest.CompletionAllMemberTypes2$Member1$Member5$Member6;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1[TYPE_REF]{Member1, test, Ltest.CompletionAllMemberTypes2$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2[TYPE_REF]{Member2, test, Ltest.CompletionAllMemberTypes2$Member1$Member2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2.Member3[TYPE_REF]{Member3, test, Ltest.CompletionAllMemberTypes2$Member1$Member2$Member3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member5[TYPE_REF]{Member5, test, Ltest.CompletionAllMemberTypes2$Member1$Member5;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionAllMemberTypes4() throws JavaScriptModelException {
- IJavaScriptUnit anInterface = null;
- try {
- anInterface = getWorkingCopy(
- "/Completion/src/test/AnInterface.js",
- "package test;\n" +
- "public interface AnInterface {\n" +
- " public interface Member1 {\n" +
- " public interface Member5 {\n" +
- " public interface Member6 {\n" +
- " }\n" +
- " }\n" +
- " public interface Member2 {\n" +
- " public interface Member3 {\n" +
- " interface Member4 {\n" +
- " }\n" +
- " }\n" +
- " Member\n" +
- " }\n" +
- " \n}" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionAllMemberTypes2.js",
- "package test;\n" +
- "public class CompletionAllMemberTypes2 {\n" +
- " class Member1 {\n" +
- " class Member5 {\n" +
- " class Member6 {\n" +
- " }\n" +
- " }\n" +
- " class Member2 implements AnInterface {\n" +
- " class Member3 {\n" +
- " class Member4 {\n" +
- " }\n" +
- " }\n" +
- " void foo(){\n" +
- " Member\n" +
- " }\n" +
- " }\n" +
- " \n}" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Member";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "AnInterface.Member1.Member2[TYPE_REF]{test.AnInterface.Member1.Member2, test, Ltest.AnInterface$Member1$Member2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AnInterface.Member1.Member2.Member3[TYPE_REF]{test.AnInterface.Member1.Member2.Member3, test, Ltest.AnInterface$Member1$Member2$Member3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AnInterface.Member1.Member2.Member3.Member4[TYPE_REF]{test.AnInterface.Member1.Member2.Member3.Member4, test, Ltest.AnInterface$Member1$Member2$Member3$Member4;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AnInterface.Member1.Member5[TYPE_REF]{test.AnInterface.Member1.Member5, test, Ltest.AnInterface$Member1$Member5;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AnInterface.Member1.Member5.Member6[TYPE_REF]{test.AnInterface.Member1.Member5.Member6, test, Ltest.AnInterface$Member1$Member5$Member6;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2.Member3.Member4[TYPE_REF]{test.CompletionAllMemberTypes2.Member1.Member2.Member3.Member4, test, Ltest.CompletionAllMemberTypes2$Member1$Member2$Member3$Member4;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member5.Member6[TYPE_REF]{test.CompletionAllMemberTypes2.Member1.Member5.Member6, test, Ltest.CompletionAllMemberTypes2$Member1$Member5$Member6;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AnInterface.Member1[TYPE_REF]{Member1, test, Ltest.AnInterface$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1[TYPE_REF]{Member1, test, Ltest.CompletionAllMemberTypes2$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2[TYPE_REF]{Member2, test, Ltest.CompletionAllMemberTypes2$Member1$Member2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member2.Member3[TYPE_REF]{Member3, test, Ltest.CompletionAllMemberTypes2$Member1$Member2$Member3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionAllMemberTypes2.Member1.Member5[TYPE_REF]{Member5, test, Ltest.CompletionAllMemberTypes2$Member1$Member5;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(anInterface != null) {
- anInterface.discardWorkingCopy();
- }
- }
-}
-
-public void testCompletionAllMemberTypes5() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- Hashtable oldCurrentOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldCurrentOptions);
- options.put(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- aType = getWorkingCopy(
- "/Completion/src/test/AType.js",
- "package test;\n" +
- "public class AType {\n" +
- " public class Member1 {\n" +
- " private class Member2 {\n" +
- " public class Member3 {\n" +
- " public class Member4 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " \n}" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionAllMemberTypes5.js",
- "package test;\n" +
- "public class CompletionAllMemberTypes5 {\n" +
- " void foo(){\n" +
- " Member\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Member";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- // AType.Member1.Member2.Member3 and AType.Member1.Member2.Member3.Member4 should not be proposed because they are not visible.
- // But visibility need modifiers of enclosing types to be computed.
- assertResults(
- "AType.Member1[TYPE_REF]{test.AType.Member1, test, Ltest.AType$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AType.Member1.Member2.Member3[TYPE_REF]{test.AType.Member1.Member2.Member3, test, Ltest.AType$Member1$Member2$Member3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AType.Member1.Member2.Member3.Member4[TYPE_REF]{test.AType.Member1.Member2.Member3.Member4, test, Ltest.AType$Member1$Member2$Member3$Member4;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- JavaScriptCore.setOptions(oldCurrentOptions);
- }
-}
-
-public void testCompletionAllMemberTypes6() throws JavaScriptModelException {
- Hashtable oldCurrentOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldCurrentOptions);
- options.put(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionAllMemberTypes6.js",
- "package test;\n" +
- "class AType {\n" +
- " public class Member1 {\n" +
- " private class Member2 {\n" +
- " public class Member3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class CompletionAllMemberTypes6 {\n" +
- " void foo(){\n" +
- " Member\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Member";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "AType.Member1[TYPE_REF]{test.AType.Member1, test, Ltest.AType$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldCurrentOptions);
- }
-}
-
-public void testCompletionAllMemberTypes7() throws JavaScriptModelException {
- Hashtable oldCurrentOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldCurrentOptions);
- options.put(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/AType.js",
- "package test;\n" +
- "class AType {\n" +
- " public class Member1 {\n" +
- " private class Member2 {\n" +
- " public class Member3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " void foo(){\n" +
- " Member\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Member";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "AType.Member1.Member2[TYPE_REF]{test.AType.Member1.Member2, test, Ltest.AType$Member1$Member2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AType.Member1.Member2.Member3[TYPE_REF]{test.AType.Member1.Member2.Member3, test, Ltest.AType$Member1$Member2$Member3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "AType.Member1[TYPE_REF]{Member1, test, Ltest.AType$Member1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldCurrentOptions);
- }
-}
-
-public void testCompletionAllocationExpressionIsParent1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAllocationExpressionIsParent1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAllocationExpressionIsParent2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAllocationExpressionIsParent2.js",
- "public class CompletionAllocationExpressionIsParent2 {\n" +
- " public class Inner {\n" +
- " public Inner(long i, long j){super();}\n" +
- " public Inner(Object i, Object j){super();}\n" +
- " \n" +
- " }\n" +
- " \n" +
- " long zzlong;\n" +
- " int zzint;\n" +
- " double zzdouble;\n" +
- " boolean zzboolean;\n" +
- " Object zzObject;\n" +
- " \n" +
- " void foo() {\n" +
- " this.new Inner(1, zz\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "zzObject[FIELD_REF]{zzObject, LCompletionAllocationExpressionIsParent2;, Ljava.lang.Object;, zzObject, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzboolean[FIELD_REF]{zzboolean, LCompletionAllocationExpressionIsParent2;, Z, zzboolean, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzdouble[FIELD_REF]{zzdouble, LCompletionAllocationExpressionIsParent2;, D, zzdouble, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzint[FIELD_REF]{zzint, LCompletionAllocationExpressionIsParent2;, I, zzint, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzlong[FIELD_REF]{zzlong, LCompletionAllocationExpressionIsParent2;, J, zzlong, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-public void testCompletionAllocationExpressionIsParent3() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAllocationExpressionIsParent3.js",
- "public class CompletionAllocationExpressionIsParent3 {\n" +
- " public class Inner {\n" +
- " public Inner(long i, long j){super();}\n" +
- " public Inner(Object i, Object j){super();}\n" +
- " \n" +
- " }\n" +
- " \n" +
- " long zzlong;\n" +
- " int zzint;\n" +
- " double zzdouble;\n" +
- " boolean zzboolean;\n" +
- " Object zzObject;\n" +
- " \n" +
- " void foo() {\n" +
- " new CompletionAllocationExpressionIsParent3().new Inner(1, zz\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "zzObject[FIELD_REF]{zzObject, LCompletionAllocationExpressionIsParent3;, Ljava.lang.Object;, zzObject, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzboolean[FIELD_REF]{zzboolean, LCompletionAllocationExpressionIsParent3;, Z, zzboolean, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzdouble[FIELD_REF]{zzdouble, LCompletionAllocationExpressionIsParent3;, D, zzdouble, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzint[FIELD_REF]{zzint, LCompletionAllocationExpressionIsParent3;, I, zzint, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzlong[FIELD_REF]{zzlong, LCompletionAllocationExpressionIsParent3;, J, zzlong, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-public void testCompletionAllocationExpressionIsParent4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAllocationExpressionIsParent4.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionAllocationExpressionIsParent5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAllocationExpressionIsParent5.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionAllocationExpressionIsParent6() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAllocationExpressionIsParent6.js",
- "public class CompletionAllocationExpressionIsParent6 {\n" +
- " \n" +
- " long zzlong;\n" +
- " int zzint;\n" +
- " double zzdouble;\n" +
- " boolean zzboolean;\n" +
- " Object zzObject;\n" +
- " \n" +
- " void foo() {\n" +
- " new CompletionAllocation_ERROR_ExpressionIsParent6Plus().new Inner(1, zz\n" +
- " }\n" +
- "}\n" +
- "class CompletionAllocationExpressionIsParent6Plus {\n" +
- " public class Inner {\n" +
- " public Inner(long i, long j){\n" +
- " \n" +
- " } \n" +
- " } \n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "zzObject[FIELD_REF]{zzObject, LCompletionAllocationExpressionIsParent6;, Ljava.lang.Object;, zzObject, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzboolean[FIELD_REF]{zzboolean, LCompletionAllocationExpressionIsParent6;, Z, zzboolean, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzdouble[FIELD_REF]{zzdouble, LCompletionAllocationExpressionIsParent6;, D, zzdouble, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzint[FIELD_REF]{zzint, LCompletionAllocationExpressionIsParent6;, I, zzint, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "zzlong[FIELD_REF]{zzlong, LCompletionAllocationExpressionIsParent6;, J, zzlong, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-public void testCompletionAmbiguousFieldName() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAmbiguousFieldName.js");
-
- String str = cu.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:xBar completion:this.xBar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:xBar completion:xBar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionAmbiguousFieldName2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionAmbiguousFieldName2.js",
- "public class CompletionAmbiguousFieldName2 {\n"+
- " int xBar;\n"+
- " class classFoo {\n"+
- " public void foo(int xBar){\n"+
- " xBa\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "xBar[FIELD_REF]{CompletionAmbiguousFieldName2.this.xBar, LCompletionAmbiguousFieldName2;, I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "xBar[LOCAL_VARIABLE_REF]{xBar, null, I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-public void testCompletionAmbiguousFieldName3() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAmbiguousFieldName3.js");
-
- String str = cu.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:xBar completion:ClassFoo.this.xBar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:xBar completion:xBar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAmbiguousFieldName4() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAmbiguousFieldName4.js");
-
- String str = cu.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one completion",
- "element:xBar completion:xBar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAmbiguousType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAmbiguousType.js");
-
- String str = cu.getSource();
- String completeBehind = "ABC";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:ABC completion:p1.ABC relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"\n" +
- "element:ABC completion:p2.ABC relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionAmbiguousType2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAmbiguousType2.js");
-
- String str = cu.getSource();
- String completeBehind = "ABC";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:ABC completion:ABC relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:ABC completion:p2.ABC relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionArgumentName() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionArgumentName.js");
-
- String str = cu.getSource();
- String completeBehind = "ClassWithComplexName ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:classWithComplexName completion:classWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:complexName2 completion:complexName2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:name completion:name relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:withComplexName completion:withComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionArrayAccess1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionArrayAccess1.js");
-
- String str = cu.getSource();
- String completeBehind = "zzz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzz1 completion:zzz1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:zzz2 completion:zzz2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE +R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84690
-public void testCompletionArrayClone() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionArrayClone.js",
- "package test;\n" +
- "public class CompletionArrayClone {\n" +
- " public void foo() {\n" +
- " long[] var;\n" +
- " var.clon\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "clon";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "clone[FUNCTION_REF]{clone(), [J, ()Ljava.lang.Object;, clone, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84690
-public void testCompletionArrayLength() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionArrayLength.js",
- "package test;\n" +
- "public class CompletionArrayLength {\n" +
- " public void foo() {\n" +
- " long[] var;\n" +
- " var.leng\n" +
- " }" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "leng";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "length[FIELD_REF]{length, [J, I, length, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionArraysCloneMethod() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionArraysCloneMethod.js");
-
- String str = cu.getSource();
- String completeBehind = ".cl";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:clone completion:clone() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionAssignmentInMethod1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAssignmentInMethod1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionAssignmentInMethod2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAssignmentInMethod2.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionAssignmentInMethod3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAssignmentInMethod3.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionAssignmentInMethod4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionAssignmentInMethod4.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionBasicAnonymousDeclaration1() throws JavaScriptModelException {
- CompletionResult result = complete(
- "/Completion/src3/test0000/CompletionBasicCompletionContext.js",
- "public class CompletionBasicAnonymousDeclaration1 {\n"+
- " void foo() {\n"+
- " new Object(\n"+
- " }\n"+
- "}",
- "new Object(");
-
- assertResults(
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-
- assertResults(
- "Object[ANONYMOUS_CLASS_DECLARATION]{, Ljava.lang.Object;, ()V, null, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Object[FUNCTION_REF<CONSTRUCTOR>]{, Ljava.lang.Object;, ()V, Object, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- result.proposals);
-}
-
-public void testCompletionBasicCompletionContext() throws JavaScriptModelException {
- CompletionResult result = complete(
- "/Completion/src3/test0000/CompletionBasicCompletionContext.js",
- "package test0000;\n" +
- "public class CompletionBasicCompletionContext {\n" +
- " void bar(String o) {\n" +
- " String zzz = null; \n" +
- " o = zzz\n" +
- " }\n" +
- "}",
- "zzz");
-
- assertResults(
- "expectedTypesSignatures={Ljava.lang.String;}\n" +
- "expectedTypesKeys={Ljava/lang/String;}",
- result.context);
-
- assertResults(
- "zzz[LOCAL_VARIABLE_REF]{zzz, null, Ljava.lang.String;, zzz, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + + R_EXACT_NAME + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- result.proposals);
-}
-
-public void testCompletionBasicField1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicField1.js");
-
- String str = cu.getSource();
- String completeBehind = "zzvar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "zzvarzz[FIELD_REF]{zzvarzz, LCompletionBasicField1;, I, zzvarzz, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionBasicKeyword1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicKeyword1.js");
-
- String str = cu.getSource();
- String completeBehind = "whil";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "while[KEYWORD]{while, null, null, while, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionBasicLocalVariable1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicLocalVariable1.js");
-
- String str = cu.getSource();
- String completeBehind = "zzvar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "zzvarzz[LOCAL_VARIABLE_REF]{zzvarzz, null, I, zzvarzz, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionBasicMethod1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicMethod1.js");
-
- String str = cu.getSource();
- String completeBehind = "zzfo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "zzfoo[FUNCTION_REF]{zzfoo(), LCompletionBasicMethod1;, ()V, zzfoo, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionBasicMethodDeclaration1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicMethodDeclaration1.js");
-
- String str = cu.getSource();
- String completeBehind = "equals";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "equals[POTENTIAL_METHOD_DECLARATION]{equals, LCompletionBasicMethodDeclaration1;, ()V, equals, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "equals[FUNCTION_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_EXACT_NAME + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionBasicPackage1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicPackage1.js");
-
- String str = cu.getSource();
- String completeBehind = "java.lan";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_QUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-
-public void testCompletionBasicPotentialMethodDeclaration1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicPotentialMethodDeclaration1.js");
-
- String str = cu.getSource();
- String completeBehind = "zzpot";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "zzpot[POTENTIAL_METHOD_DECLARATION]{zzpot, LCompletionBasicPotentialMethodDeclaration1;, ()V, zzpot, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-
-public void testCompletionBasicType1() throws JavaScriptModelException {
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicType1.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionBasicVariableDeclaration1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionBasicVariableDeclaration1.js",
- "public class CompletionBasicVariableDeclaration1 {\n"+
- " public Object obj;\n"+
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "obj";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, " + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionBinaryOperator1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBinaryOperator1.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var4 completion:var4 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionBinaryOperator2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBinaryOperator2.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionBinaryOperator3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBinaryOperator3.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-/**
- * Ensures that completion is not case sensitive
- */
-public void testCompletionCaseInsensitive() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("Completion", "src", "", "CompletionCaseInsensitive.js");
-
- String str = cu.getSource();
- String completeBehind = "Fiel";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals("should have one class",
- "element:field completion:field relevance:"+(R_DEFAULT + R_INTERESTING + R_NON_STATIC + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-/**
- * Complete a package in a case insensitive way
- */
-public void testCompletionCaseInsensitivePackage() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionCaseInsensitivePackage.js");
-
- String str = cu.getSource();
- String completeBehind = "Ja";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
-
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have package completions",
- "element:jarpack1 completion:jarpack1 relevance:"+(R_DEFAULT + R_INTERESTING+ R_NON_RESTRICTED)+"\n" +
- "element:jarpack2 completion:jarpack2 relevance:"+(R_DEFAULT + R_INTERESTING+ R_NON_RESTRICTED)+"\n" +
- "element:java completion:java relevance:"+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"\n" +
- "element:java.io completion:java.io relevance:"+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"\n" +
- "element:java.lang completion:java.lang relevance:"+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionCastIsParent1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionCastIsParent1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zz00 completion:zz00 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz00M completion:zz00M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz01 completion:zz01 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz01M completion:zz01M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz02 completion:zz02 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz02M completion:zz02M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz10 completion:zz10 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz10M completion:zz10M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz11 completion:zz11 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz11M completion:zz11M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz12 completion:zz12 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz12M completion:zz12M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz20 completion:zz20 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz20M completion:zz20M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz21 completion:zz21 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz21M completion:zz21M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz22 completion:zz22 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz22M completion:zz22M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzOb completion:zzOb relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzObM completion:zzObM() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionCastIsParent2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionCastIsParent2.js");
-
- String str = cu.getSource();
- String completeBehind = "xx";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:XX00 completion:XX00 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX01 completion:XX01 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX02 completion:XX02 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX10 completion:XX10 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX11 completion:XX11 relevance:"+(R_DEFAULT + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX12 completion:XX12 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX20 completion:XX20 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX21 completion:XX21 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX22 completion:XX22 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionCatchArgumentName() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionCatchArgumentName.js",
- "public class CompletionCatchArgumentName {\n"+
- " public void foo(){\n"+
- " try{\n"+
- " \n"+
- " } catch (Exception ex)\n"+
- " }\n"+
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ex";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "exception[VARIABLE_DECLARATION]{exception, null, Ljava.lang.Exception;, exception, null, " + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionCatchArgumentName2() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
-
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES,"arg"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"loc"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionCatchArgumentName2.js");
-
- String str = cu.getSource();
- String completeBehind = "Exception ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:exception completion:exception relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:locException completion:locException relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX+ R_NON_RESTRICTED),
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-
-public void testCompletionClassLiteralAfterAnonymousType1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionClassLiteralAfterAnonymousType1.js");
-
- String str = cu.getSource();
- String completeBehind = "double.";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionConditionalExpression1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionConditionalExpression1.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var4 completion:var4 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionConditionalExpression2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionConditionalExpression2.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var4 completion:var4 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionConditionalExpression3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionConditionalExpression3.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var4 completion:var4 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=24939
-*/
-public void testCompletionConstructorForAnonymousType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionConstructorForAnonymousType.js");
-
- String str = cu.getSource();
- String completeBehind = "TypeWithConstructor(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:TypeWithConstructor completion: relevance:"+(R_DEFAULT + R_INTERESTING+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionEmptyToken1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionEmptyToken1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- // completion is just at start of 'zz'
- int cursorLocation = str.lastIndexOf(completeBehind);
- int start = cursorLocation;
- int end = start + 4;
- cu.codeComplete(cursorLocation, requestor);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertEquals(
- "element:clone completion:clone() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:equals completion:equals() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:finalize() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:foo completion:foo() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:getClass completion:getClass() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:hashCode completion:hashCode() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:notify completion:notify() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:notifyAll completion:notifyAll() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:toString completion:toString() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:wait completion:wait() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:wait completion:wait() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:wait completion:wait() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:zzyy completion:zzyy position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResultsWithPosition());
- } else {
- assertEquals(
- "element:CompletionEmptyToken1 completion:CompletionEmptyToken1 position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:clone completion:clone() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:equals completion:equals() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:finalize() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:foo completion:foo() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:getClass completion:getClass() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:hashCode completion:hashCode() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:notify completion:notify() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:notifyAll completion:notifyAll() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:toString completion:toString() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:wait completion:wait() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:wait completion:wait() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:wait completion:wait() position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:zzyy completion:zzyy position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResultsWithPosition());
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100808
-public void testCompletionEmptyToken2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/testCompletionEmptyToken2/Test.js",
- "package testCompletionEmptyToken2.");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true);
-
- String str = this.wc.getSource();
- String completeBehind = "testCompletionEmptyToken2.";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int start = str.lastIndexOf(completeBehind);
- int end = start + completeBehind.length();
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertResults(
- "testCompletionEmptyToken2[PACKAGE_REF]{testCompletionEmptyToken2, testCompletionEmptyToken2, null, null, null, ["+start+", "+end+"], " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25221
-*/
-public void testCompletionEmptyTypeName1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionEmptyTypeName1.js",
- "public class CompletionEmptyTypeName1 {\n"+
- " void foo() {\n"+
- " A a = new \n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "new ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "A[TYPE_REF]{A, , LA;, null, null, " +(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionEmptyTypeName1[TYPE_REF]{CompletionEmptyTypeName1, , LCompletionEmptyTypeName1;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED)+"}\n"+
- "A[TYPE_REF]{A, , LA;, null, null, " +(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- }
-}
-
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25221
-*/
-public void testCompletionEmptyTypeName2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionEmptyTypeName2.js");
-
- String str = cu.getSource();
- String completeBehind = " = ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertEquals(
- "element:a completion:a relevance:"+(R_DEFAULT + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:clone completion:clone() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:equals completion:equals() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:finalize completion:finalize() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:getClass completion:getClass() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:hashCode completion:hashCode() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notify completion:notify() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notifyAll completion:notifyAll() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:toString completion:toString() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
- } else {
- assertEquals(
- "element:A completion:A relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:CompletionEmptyTypeName2 completion:CompletionEmptyTypeName2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:a completion:a relevance:"+(R_DEFAULT + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:clone completion:clone() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:equals completion:equals() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:finalize completion:finalize() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:getClass completion:getClass() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:hashCode completion:hashCode() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notify completion:notify() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notifyAll completion:notifyAll() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:toString completion:toString() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
- }
-}
-
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=41643
-*/
-public void testCompletionEmptyTypeName3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionEmptyTypeName3.js");
-
- String str = cu.getSource();
- String completeBehind = " = ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertEquals(
- "element:clone completion:clone() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:equals completion:equals() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:finalize completion:finalize() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:getClass completion:getClass() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:hashCode completion:hashCode() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notify completion:notify() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notifyAll completion:notifyAll() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:toString completion:toString() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:x completion:x relevance:"+(R_DEFAULT + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE+ R_NON_RESTRICTED),
- requestor.getResults());
- } else {
- assertEquals(
- "element:CompletionEmptyTypeName2 completion:CompletionEmptyTypeName2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:CompletionEmptyTypeName3 completion:CompletionEmptyTypeName3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:CompletionEmptyTypeName3.CompletionEmptyTypeName3_1 completion:CompletionEmptyTypeName3_1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:CompletionEmptyTypeName3_2 completion:CompletionEmptyTypeName3_2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:clone completion:clone() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:equals completion:equals() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:finalize completion:finalize() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:getClass completion:getClass() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:hashCode completion:hashCode() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notify completion:notify() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:notifyAll completion:notifyAll() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:toString completion:toString() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:wait completion:wait() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:x completion:x relevance:"+(R_DEFAULT + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE+ R_NON_RESTRICTED),
- requestor.getResults());
- }
-}
-
-/**
- * Complete at end of file.
- */
-public void testCompletionEndOfCompilationUnit() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu = getCompilationUnit("Completion", "src", "", "CompletionEndOfCompilationUnit.js");
- cu.codeComplete(cu.getSourceRange().getOffset() + cu.getSourceRange().getLength(), requestor);
- assertEquals(
- "should have two methods of 'foo'",
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=66570
- */
-public void testCompletionExactNameCaseInsensitive() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionExactNameCaseInsensitive.js");
-
- String str = cu.getSource();
- String completeBehind = "(compleTionexactnamecaseInsensitive";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:CompletionExactNameCaseInsensitive completion:CompletionExactNameCaseInsensitive relevance:"+(R_DEFAULT + R_INTERESTING + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+ "\n" +
- "element:CompletionExactNameCaseInsensitivePlus completion:CompletionExactNameCaseInsensitivePlus relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25820
-*/
-public void testCompletionExpectedTypeIsNotValid() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionExpectedTypeIsNotValid.js");
-
- String str = cu.getSource();
- String completeBehind = "new U";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=95505
-public void testCompletionExpectedTypeOnEmptyToken1() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
-
- aType = getWorkingCopy(
- "/Completion/src/test/AType.js",
- "package test;\n" +
- "public class AType{\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n" +
- "public class Test{\n"+
- " void foo() {\n"+
- " AType a = new \n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "AType a = new ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures={Ltest.AType;}\n"+
- "expectedTypesKeys={Ltest/AType;}",
- requestor.getContext());
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "AType[TYPE_REF]{AType, test, Ltest.AType;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } else {
- assertResults(
- "Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "AType[TYPE_REF]{AType, test, Ltest.AType;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=95505
-public void testCompletionExpectedTypeOnEmptyToken3() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/test/AType.js",
- "package test;\n" +
- "public class AType{\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n" +
- "public class Test{\n"+
- " void foo() {\n"+
- " AType a = \n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- requestor.setIgnored(CompletionProposal.METHOD_REF, true);
- requestor.setIgnored(CompletionProposal.FIELD_REF, true);
- requestor.setIgnored(CompletionProposal.LOCAL_VARIABLE_REF, true);
-
- String str = this.wc.getSource();
- String completeBehind = "AType a = ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures={Ltest.AType;}\n"+
- "expectedTypesKeys={Ltest/AType;}",
- requestor.getContext());
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "AType[TYPE_REF]{AType, test, Ltest.AType;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=95505
-public void testCompletionExpectedTypeOnEmptyToken4() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/test/AInterface.js",
- "package test;\n" +
- "public interface AInterface{\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n" +
- "public class Test{\n"+
- " void foo() {\n"+
- " AInterface a = new \n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "AInterface a = new ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures={Ltest.AInterface;}\n"+
- "expectedTypesKeys={Ltest/AInterface;}",
- requestor.getContext());
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "AInterface[TYPE_REF]{AInterface, test, Ltest.AInterface;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } else {
- assertResults(
- "Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "AInterface[TYPE_REF]{AInterface, test, Ltest.AInterface;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-
-
-public void testCompletionFieldInitializer1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFieldInitializer1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionFieldInitializer2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFieldInitializer2.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionFieldInitializer3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFieldInitializer3.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionFieldInitializer4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFieldInitializer4.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-public void testCompletionFieldName() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFieldName.js");
-
- String str = cu.getSource();
- String completeBehind = "ClassWithComplexName ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:classWithComplexName completion:classWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:complexName2 completion:complexName2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:name completion:name relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:withComplexName completion:withComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-/**
- * Complete the type "A" from "new A".
- */
-public void testCompletionFindClass() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindClass.js",
- "public class CompletionFindClass {\n" +
- " private A[] a;\n" +
- " public CompletionFindClass () {\n" +
- " this.a = new A\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "A";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ABC[TYPE_REF]{p1.ABC, p1, Lp1.ABC;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
- "ABC[TYPE_REF]{p2.ABC, p2, Lp2.ABC;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
- "A3[TYPE_REF]{A3, , LA3;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "A[TYPE_REF]{A, , LA;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-
-/**
- * The same type must be find only once
- */
-public void testCompletionFindClass2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindClass2.js");
-
- String str = cu.getSource();
- String completeBehind = "PX";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one classe",
- "element:PX completion:pack1.PX relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_QUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-/**
- * Complete the type "Default" in the default package example.
- */
-public void testCompletionFindClassDefaultPackage() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionDefaultPackage.js");
-
- String str = cu.getSource();
- String completeBehind = "Def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one class",
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-
-/**
- * Complete the constructor "CompletionFindConstructor" from "new CompletionFindConstructor(".
- */
-public void testCompletionFindConstructor() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindConstructor.js",
- "public class CompletionFindConstructor {\n"+
- " public CompletionFindConstructor (int i) {\n"+
- " }\n"+
- " publuc void foo(){\n"+
- " int x = 45;\n"+
- " new CompletionFindConstructor(i);\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "CompletionFindConstructor(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertResults(
- "CompletionFindConstructor[ANONYMOUS_CLASS_DECLARATION]{, LCompletionFindConstructor;, (I)V, null, (i), "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "CompletionFindConstructor[FUNCTION_REF<CONSTRUCTOR>]{, LCompletionFindConstructor;, (I)V, CompletionFindConstructor, (i), "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78801
- */
-public void testCompletionFindConstructor2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindConstructor2.js",
- "import zconstructors.*;\n"+
- "public class CompletionFindConstructor2 {\n"+
- " Constructor2 c = new Constructor2();\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "Constructor2(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertEquals(
- "Constructor2[ANONYMOUS_CLASS_DECLARATION]{, Lzconstructors.Constructor2;, ()V, null, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Constructor2[FUNCTION_REF<CONSTRUCTOR>]{, Lzconstructors.Constructor2;, ()V, Constructor2, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78801
- */
-public void testCompletionFindConstructor3() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindConstructor3.js",
- "import zconstructors.*;\n"+
- "public class CompletionFindConstructor3 {\n"+
- " Constructor3 c = new Constructor3();\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "Constructor3(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertEquals(
- "Constructor3[ANONYMOUS_CLASS_DECLARATION]{, Lzconstructors.Constructor3;, ()V, null, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Constructor3[FUNCTION_REF<CONSTRUCTOR>]{, Lzconstructors.Constructor3;, ()V, Constructor3, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78801
- */
-public void testCompletionFindConstructor4() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindConstructor4.js",
- "import zconstructors.*;\n"+
- "public class CompletionFindConstructor4 {\n"+
- " Constructor4 c = new Constructor4();\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "Constructor4(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertEquals(
- "Constructor4[ANONYMOUS_CLASS_DECLARATION]{, Lzconstructors.Constructor4;, (I)V, null, (i), " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Constructor4[FUNCTION_REF<CONSTRUCTOR>]{, Lzconstructors.Constructor4;, (I)V, Constructor4, (i), " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-/**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78801
- */
-public void testCompletionFindConstructor5() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindConstructor5.js",
- "import zconstructors.*;\n"+
- "public class CompletionFindConstructor5 {\n"+
- " Constructor5 c = new Constructor5();\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "Constructor5(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertEquals(
- "Constructor5[ANONYMOUS_CLASS_DECLARATION]{, Lzconstructors.Constructor5;, (I)V, null, (arg0), " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Constructor5[FUNCTION_REF<CONSTRUCTOR>]{, Lzconstructors.Constructor5;, (I)V, Constructor5, (arg0), " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-/**
- * Complete the exception "Exception" in a catch clause.
- */
-public void testCompletionFindExceptions1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindException1.js");
-
- String str = cu.getSource();
- String completeBehind = "Ex";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one class",
- "element:Exception completion:Exception relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-/**
- * Complete the exception "Exception" in a throws clause.
- */
-public void testCompletionFindExceptions2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindException2.js");
-
- String str = cu.getSource();
- String completeBehind = "Ex";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one class",
- "element:Exception completion:Exception relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-/**
- * Complete the field "var" from "va";
- */
-public void testCompletionFindField1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindField1.js");
-
- String str = cu.getSource();
- String completeBehind = "va";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one field: 'var' and one variable: 'var'",
- "element:var completion:this.var relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n"+
- "element:var completion:var relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-/**
- * Complete the field "var" from "this.va";
- */
-public void testCompletionFindField2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindField2.js");
-
- String str = cu.getSource();
- String completeBehind = "va";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have 1 field of starting with 'va'",
- "element:var completion:var relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionFindField3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindField3.js");
-
- String str = cu.getSource();
- String completeBehind = "b.ba";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:bar completion:bar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-/**
- * Complete the import, "import pac"
- */
-public void testCompletionFindImport1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindImport1.js",
- "import pac\n"+
- "\n"+
- "public class CompletionFindImport1 {\n"+
- "\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "pack[PACKAGE_REF]{pack.*;, pack, null, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "pack1[PACKAGE_REF]{pack1.*;, pack1, null, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "pack1.pack3[PACKAGE_REF]{pack1.pack3.*;, pack1.pack3, null, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "pack2[PACKAGE_REF]{pack2.*;, pack2, null, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) +"}",
- requestor.getResults());
-}
-
-public void testCompletionFindImport2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindImport2.js",
- "import pack1.P\n"+
- "\n"+
- "public class CompletionFindImport2 {\n"+
- "\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "pack1.P";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "pack1.pack3[PACKAGE_REF]{pack1.pack3.*;, pack1.pack3, null, null, null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n"+
- "PX[TYPE_REF]{pack1.PX;, pack1, Lpack1.PX;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-/**
- * Complete the local variable "var";
- */
-public void testCompletionFindLocalVariable() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindLocalVariable.js");
-
- String str = cu.getSource();
- String completeBehind = "va";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have one local variable of 'var'",
- "element:var completion:var relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionFindMemberType1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionFindMemberType1.js",
- "interface A1 {\n"+
- " class Inner1 {\n"+
- " }\n"+
- "}\n"+
- "interface B1 extends A1 {\n"+
- " class Inner1 {\n"+
- " }\n"+
- "}\n"+
- "public class CompletionFindMemberType1 {\n"+
- " public void foo() {\n"+
- " B1.Inner\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "Inner";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "B1.Inner1[TYPE_REF]{Inner1, , LB1$Inner1;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) +"}",
- requestor.getResults());
-}
-
-public void testCompletionFindMemberType2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionPrefixMethodName2.js",
- "interface A2 {\n"+
- " class ZInner2{\n"+
- " }\n"+
- "}\n"+
- "interface B2 extends A2 {\n"+
- " class ZInner2 {\n"+
- " }\n"+
- "}\n"+
- "public class CompletionFindMemberType2 implements B2{\n"+
- " public void foo() {\n"+
- " ZInner\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "ZInner";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "B2.ZInner2[TYPE_REF]{ZInner2, , LB2$ZInner2;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE+ R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-/**
- * Complete the method call "a.foobar" from "a.fooba";
- */
-public void testCompletionFindMethod1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindMethod1.js");
-
- String str = cu.getSource();
- String completeBehind = "fooba";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have two methods of 'foobar'",
- "element:foobar completion:foobar() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"\n" +
- "element:foobar completion:foobar() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED),
- requestor.getResults());
-}
-/**
- * Too much Completion match on interface
- */
-public void testCompletionFindMethod2() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindMethod2.js");
-
- String str = cu.getSource();
- String completeBehind = "fooba";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:foobar completion:foobar() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"\n" +
- "element:foobar completion:foobar() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED),
- requestor.getResults());
-}
-/**
- * Complete the method call "foobar" from "fooba";
- */
-public void testCompletionFindMethodInThis() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindMethodInThis.js");
-
- String str = cu.getSource();
- String completeBehind = "fooba";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have one method of 'foobar'",
- "element:foobar completion:foobar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-/**
- * Complete the method call "foobar" from "fooba". The compilation
- * unit simulates typing in process; ie it has incomplete structure/syntax errors.
- */
-public void testCompletionFindMethodWhenInProcess() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindMethodInProcess.js");
-
- String str = cu.getSource();
- String completeBehind = "fooba";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have a method of 'foobar'",
- "element:foobar completion:foobar() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
- cu.close();
-}
-
-public void testCompletionFindSecondaryType1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindSecondaryType1.js");
-
- String str = cu.getSource();
- String completeBehind = "/**/Secondary";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SecondaryType1 completion:SecondaryType1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:SecondaryType2 completion:SecondaryType2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-/**
- * Complete the field "bar" from "this.ba"
- */
-public void testCompletionFindThisDotField() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindThisDotField.js");
-
- String str = cu.getSource();
- String completeBehind = "this.ba";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have one result of 'bar'",
- "element:bar completion:bar relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED),
- requestor.getResults());
-}
-
-public void testCompletionImportedType1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/imported/ZZZZ.js",
- "package test.imported;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/CompletionImportedType1.js",
- "package test;"+
- "public class CompletionImportedType1 {"+
- " ZZZ\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[1].getSource();
- String completeBehind = "ZZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[1].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZ[POTENTIAL_METHOD_DECLARATION]{ZZZ, Ltest.CompletionImportedType1;, ()V, ZZZ, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported.ZZZZ, test.imported, Ltest.imported.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionImportedType2() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/imported1/ZZZZ.js",
- "package test.imported1;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/imported2/ZZZZ.js",
- "package test.imported2;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/imported3/ZZZZ.js",
- "package test.imported3;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/CompletionImportedType2.js",
- "package test;"+
- "import test.imported1.*;"+
- "import test.imported2.*;"+
- "import test.imported3.*;"+
- "public class CompletionImportedType2 {"+
- " ZZZ\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[3].getSource();
- String completeBehind = "ZZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[3].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZ[POTENTIAL_METHOD_DECLARATION]{ZZZ, Ltest.CompletionImportedType2;, ()V, ZZZ, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported1.ZZZZ, test.imported1, Ltest.imported1.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported2.ZZZZ, test.imported2, Ltest.imported2.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported3.ZZZZ, test.imported3, Ltest.imported3.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionImportedType3() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[4];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/imported1/ZZZZ.js",
- "package test.imported1;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/imported2/ZZZZ.js",
- "package test.imported2;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/imported3/ZZZZ.js",
- "package test.imported3;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/test/CompletionImportedType3.js",
- "package test;"+
- "import test.imported2.*;"+
- "public class CompletionImportedType3 {"+
- " ZZZ\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[3].getSource();
- String completeBehind = "ZZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[3].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZ[POTENTIAL_METHOD_DECLARATION]{ZZZ, Ltest.CompletionImportedType3;, ()V, ZZZ, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported1.ZZZZ, test.imported1, Ltest.imported1.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported3.ZZZZ, test.imported3, Ltest.imported3.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{ZZZZ, test.imported2, Ltest.imported2.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionImportedType4() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/imported1/ZZZZ.js",
- "package test.imported1;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/imported2/ZZZZ.js",
- "package test.imported2;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/CompletionImportedType4.js",
- "package test;"+
- "import test.imported1.*;"+
- "public class CompletionImportedType4 {"+
- " ZZZ\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[2].getSource();
- String completeBehind = "ZZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZ[POTENTIAL_METHOD_DECLARATION]{ZZZ, Ltest.CompletionImportedType4;, ()V, ZZZ, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported2.ZZZZ, test.imported2, Ltest.imported2.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{ZZZZ, test.imported1, Ltest.imported1.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionImportedType5() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/imported1/ZZZZ.js",
- "package test.imported1;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/imported2/ZZZZ.js",
- "package test.imported2;"+
- "public class ZZZZ {\n"+
- " \n"+
- "}");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/CompletionImportedType5.js",
- "package test;"+
- "import test.imported2.*;"+
- "public class CompletionImportedType5 {"+
- " ZZZ\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[2].getSource();
- String completeBehind = "ZZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZ[POTENTIAL_METHOD_DECLARATION]{ZZZ, Ltest.CompletionImportedType5;, ()V, ZZZ, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{test.imported1.ZZZZ, test.imported1, Ltest.imported1.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "ZZZZ[TYPE_REF]{ZZZZ, test.imported2, Ltest.imported2.ZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends1.js",
- "package test;\n" +
- "public class CompletionInsideExtends1 extends {\n" +
- " public class CompletionInsideExtends1Inner {}\n" +
- "}\n" +
- "class CompletionInsideExtends1TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionInsideExtends1TopLevel[TYPE_REF]{CompletionInsideExtends1TopLevel, test, Ltest.CompletionInsideExtends1TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
-
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends10() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends10.js",
- "package test;\n" +
- "public interface CompletionInsideExtends10 {\n" +
- " public interface CompletionInsideExtends10Inner extends CompletionInsideExtends{\n" +
- " public interface CompletionInsideExtends10InnerInner {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "interface CompletionInsideExtends10TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends CompletionInsideExtends";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionInsideExtends10[TYPE_REF]{CompletionInsideExtends10, test, Ltest.CompletionInsideExtends10;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionInsideExtends10TopLevel[TYPE_REF]{CompletionInsideExtends10TopLevel, test, Ltest.CompletionInsideExtends10TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends11() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends11.js",
- "package test;\n" +
- "public class CompletionInsideExtends11 implements {\n" +
- " public class CompletionInsideExtends11Inner {\n" +
- " }\n" +
- "}\n" +
- "class CompletionInsideExtends11TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "implements ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "",
- requestor.getResults());
- }
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends12() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends12.js",
- "package test;\n" +
- "public class CompletionInsideExtends12 implements CompletionInsideExtends {\n" +
- " public class CompletionInsideExtends12Inner {\n" +
- " }\n" +
- "}\n" +
- "class CompletionInsideExtends12TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "implements CompletionInsideExtends";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends2.js",
- "package test;\n" +
- "public class CompletionInsideExtends2 extends CompletionInsideExtends {\n" +
- " public class CompletionInsideExtends2Inner {}\n" +
- "}\n" +
- "class CompletionInsideExtends2TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends CompletionInsideExtends";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionInsideExtends2TopLevel[TYPE_REF]{CompletionInsideExtends2TopLevel, test, Ltest.CompletionInsideExtends2TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends3() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends3.js",
- "package test;\n" +
- "public class CompletionInsideExtends3 {\n" +
- " public class CompletionInsideExtends3Inner extends {\n" +
- " public class CompletionInsideExtends3InnerInner {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class CompletionInsideExtends3TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionInsideExtends3[TYPE_REF]{CompletionInsideExtends3, test, Ltest.CompletionInsideExtends3;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionInsideExtends3TopLevel[TYPE_REF]{CompletionInsideExtends3TopLevel, test, Ltest.CompletionInsideExtends3TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends4() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends4.js",
- "package test;\n" +
- "public class CompletionInsideExtends4 {\n" +
- " public class CompletionInsideExtends4Inner extends CompletionInsideExtends{\n" +
- " public class CompletionInsideExtends4InnerInner {\n" +
- " }\n" +
- " }\n" +
- "\n}" +
- "class CompletionInsideExtends4TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends CompletionInsideExtends";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionInsideExtends4[TYPE_REF]{CompletionInsideExtends4, test, Ltest.CompletionInsideExtends4;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionInsideExtends4TopLevel[TYPE_REF]{CompletionInsideExtends4TopLevel, test, Ltest.CompletionInsideExtends4TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends5() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends5.js",
- "package test;\n" +
- "public class CompletionInsideExtends5 {\n" +
- " void foo() {\n" +
- " public class CompletionInsideExtends5Inner extends {\n" +
- " public class CompletionInsideExtends5InnerInner {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class CompletionInsideExtends5TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionInsideExtends5[TYPE_REF]{CompletionInsideExtends5, test, Ltest.CompletionInsideExtends5;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionInsideExtends5TopLevel[TYPE_REF]{CompletionInsideExtends5TopLevel, test, Ltest.CompletionInsideExtends5TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends6() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends6.js",
- "package test;\n" +
- "public class CompletionInsideExtends6 {\n" +
- " void foo() {\n" +
- " public class CompletionInsideExtends6Inner extends CompletionInsideExtends {\n" +
- " public class CompletionInsideExtends6InnerInner {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "class CompletionInsideExtends6TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends CompletionInsideExtends";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionInsideExtends6[TYPE_REF]{CompletionInsideExtends6, test, Ltest.CompletionInsideExtends6;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionInsideExtends6TopLevel[TYPE_REF]{CompletionInsideExtends6TopLevel, test, Ltest.CompletionInsideExtends6TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends7() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends7.js",
- "package test;\n" +
- "public interface CompletionInsideExtends7 extends {\n" +
- " public interface CompletionInsideExtends7Inner {}\n" +
- "}\n" +
- "interface CompletionInsideExtends7TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionInsideExtends7TopLevel[TYPE_REF]{CompletionInsideExtends7TopLevel, test, Ltest.CompletionInsideExtends7TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends8() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends8.js",
- "package test;\n" +
- "public interface CompletionInsideExtends8 extends CompletionInsideExtends {\n" +
- " public interface CompletionInsideExtends8Inner {}\n" +
- "}\n" +
- "interface CompletionInsideExtends8TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends CompletionInsideExtends";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionInsideExtends8TopLevel[TYPE_REF]{CompletionInsideExtends8TopLevel, test, Ltest.CompletionInsideExtends8TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
-public void testCompletionInsideExtends9() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideExtends9.js",
- "package test;\n" +
- "public interface CompletionInsideExtends9 {\n" +
- " public interface CompletionInsideExtends9Inner extends {\n" +
- " public interface CompletionInsideExtends9InnerInner {\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "interface CompletionInsideExtends9TopLevel {\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "extends ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionInsideExtends9[TYPE_REF]{CompletionInsideExtends9, test, Ltest.CompletionInsideExtends9;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "CompletionInsideExtends9TopLevel[TYPE_REF]{CompletionInsideExtends9TopLevel, test, Ltest.CompletionInsideExtends9TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82740
-public void testCompletionInsideGenericClass() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionInsideGenericClass.js",
- "package test;\n" +
- "public class CompletionInsideGenericClass <CompletionInsideGenericClassParameter> {\n" +
- " CompletionInsideGenericClas\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "CompletionInsideGenericClas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionInsideGenericClas[POTENTIAL_METHOD_DECLARATION]{CompletionInsideGenericClas, Ltest.CompletionInsideGenericClass;, ()V, CompletionInsideGenericClas, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "CompletionInsideGenericClass[TYPE_REF]{CompletionInsideGenericClass, test, Ltest.CompletionInsideGenericClass;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-
-public void testCompletionInsideStaticMethod() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionInsideStaticMethod.js");
-
- String str = cu.getSource();
- String completeBehind = "doT";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:doTheThing completion:doTheThing() relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionInstanceofOperator1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionInstanceofOperator1.js");
-
- String str = cu.getSource();
- String completeBehind = "x instanceof WWWCompletionInstanceof";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:WWWCompletionInstanceof1 completion:WWWCompletionInstanceof1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:WWWCompletionInstanceof2 completion:WWWCompletionInstanceof2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:WWWCompletionInstanceof3 completion:WWWCompletionInstanceof3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:WWWCompletionInstanceof4 completion:WWWCompletionInstanceof4 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordAssert1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordAssert1.js");
-
- String str = cu.getSource();
- String completeBehind = "as";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:assert completion:assert relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordAssert2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordAssert2.js");
-
- String str = cu.getSource();
- String completeBehind = "as";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordAssert3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordAssert3.js");
-
- String str = cu.getSource();
- String completeBehind = "as";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordAssert4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordAssert4.js");
-
- String str = cu.getSource();
- String completeBehind = "as";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:assert completion:assert relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordAssert5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordAssert5.js");
-
- String str = cu.getSource();
- String completeBehind = "as";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordAssert6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordAssert6.js");
-
- String str = cu.getSource();
- String completeBehind = "as";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordBreak1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordBreak1.js");
-
- String str = cu.getSource();
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:break completion:break relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordBreak2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordBreak2.js");
-
- String str = cu.getSource();
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordBreak3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordBreak3.js");
-
- String str = cu.getSource();
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:break completion:break relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordBreak4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordBreak4.js");
-
- String str = cu.getSource();
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:break completion:break relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordBreak5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordBreak5.js");
-
- String str = cu.getSource();
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordBreak6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordBreak6.js");
-
- String str = cu.getSource();
- String completeBehind = "bre";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:break completion:break relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase1.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase10.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordCase2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase2.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase3.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase4.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase5.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordCase6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase6.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase7.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase8.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCase9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCase9.js");
-
- String str = cu.getSource();
- String completeBehind = "cas";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:case completion:case relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCatch1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch1.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:catch completion:catch relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCatch10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch10.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:catch completion:catch relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:catchz completion:catchz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCatch2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch2.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordCatch3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch3.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordCatch4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch4.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordCatch5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch5.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:catch completion:catch relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:catchz completion:catchz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCatch6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch6.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:catch completion:catch relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordCatch7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch7.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordCatch8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch8.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordCatch9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordCatch9.js");
-
- String str = cu.getSource();
- String completeBehind = "cat";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordClass1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass1.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass10.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass11() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass11.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass12() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass12.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass13() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass13.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass14() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass14.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass15() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass15.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass16() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass16.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass17() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass17.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass18() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass18.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass19() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass19.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass2.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass20() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass20.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass21() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass21.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass22() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass22.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass23() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass23.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass24() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass24.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass3.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass4.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass5.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass6.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass7.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass8.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordClass9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordClass9.js");
-
- String str = cu.getSource();
- String completeBehind = "cla";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Class completion:Class relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:ClassWithComplexName completion:ClassWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:class completion:class relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordContinue1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordContinue1.js");
-
- String str = cu.getSource();
- String completeBehind = "cont";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:continue completion:continue relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordContinue2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordContinue2.js");
-
- String str = cu.getSource();
- String completeBehind = "cont";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordContinue3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordContinue3.js");
-
- String str = cu.getSource();
- String completeBehind = "cont";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:continue completion:continue relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordContinue4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordContinue4.js");
-
- String str = cu.getSource();
- String completeBehind = "cont";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordDefault1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault1.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:default completion:default relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault10.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault2.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:default completion:default relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault3.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:default completion:default relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault4.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault5.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault6.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:default completion:default relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault7.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:default completion:default relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault8.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:default completion:default relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDefault9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDefault9.js");
-
- String str = cu.getSource();
- String completeBehind = "def";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Default completion:Default relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDo1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDo1.js");
-
- String str = cu.getSource();
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:do completion:do relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"\n"+
- "element:double completion:double relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDo2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDo2.js");
-
- String str = cu.getSource();
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:double completion:double relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDo3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDo3.js");
-
- String str = cu.getSource();
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:double completion:double relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDo4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDo4.js");
-
- String str = cu.getSource();
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:do completion:do relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"\n"+
- "element:double completion:double relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDo5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDo5.js");
-
- String str = cu.getSource();
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:double completion:double relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordDo6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordDo6.js");
-
- String str = cu.getSource();
- String completeBehind = "do";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:double completion:double relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordElse1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse1.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:else completion:else relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordElse2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse2.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordElse3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse3.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordElse4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse4.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordElse5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse5.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:else completion:else relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordElse6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse6.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordElse7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse7.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordElse8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordElse8.js");
-
- String str = cu.getSource();
- String completeBehind = "els";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFalse1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFalse1.js");
-
- String str = cu.getSource();
- String completeBehind = "fal";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFalse2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFalse2.js");
-
- String str = cu.getSource();
- String completeBehind = "fal";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:false completion:false relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFalse3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFalse3.js");
-
- String str = cu.getSource();
- String completeBehind = "fal";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFalse4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFalse4.js");
-
- String str = cu.getSource();
- String completeBehind = "fal";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:false completion:false relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=95008
-public void testCompletionKeywordFalse5() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " boolean test = ;\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "boolean test = ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Test[TYPE_REF]{Test, test, Ltest.Test;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "test[FIELD_REF]{test, Ltest.Test;, Z, test, null, " + (R_DEFAULT + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}\n" +
- "equals[FUNCTION_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}\n" +
- "false[KEYWORD]{false, null, null, false, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_TRUE_OR_FALSE + R_NON_RESTRICTED) + "}\n" +
- "true[KEYWORD]{true, null, null, true, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_TRUE_OR_FALSE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionKeywordFinal1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal1.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal10.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal11() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal11.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinal12() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal12.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal13() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal13.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal14() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal14.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:protected void finalize() throws Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal15() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal15.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinal16() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal16.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:protected void finalize() throws Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal17() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal17.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal18() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal18.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:finalize() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal2.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinal3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal3.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal4.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal5.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:protected void finalize() throws Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal6.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinal7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal7.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:protected void finalize() throws Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal8.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinal9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinal9.js");
-
- String str = cu.getSource();
- String completeBehind = "fin";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:final completion:final relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finalize completion:finalize() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE +R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally1.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finally completion:finally relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally10.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinally11() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally11.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinally12() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally12.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finally completion:finally relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally13() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally13.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finally completion:finally relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finallyz completion:finallyz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally14() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally14.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finallyz completion:finallyz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally2.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinally3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally3.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinally4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally4.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFinally5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally5.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finally completion:finally relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally6.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finally completion:finally relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:finallyz completion:finallyz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally7.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finallyz completion:finallyz relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally8.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:finally completion:finally relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFinally9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFinally9.js");
-
- String str = cu.getSource();
- String completeBehind = "finall";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFor1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFor1.js");
-
- String str = cu.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:for completion:for relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFor2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFor2.js");
-
- String str = cu.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFor3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFor3.js");
-
- String str = cu.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordFor4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFor4.js");
-
- String str = cu.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:for completion:for relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFor5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFor5.js");
-
- String str = cu.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordFor6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordFor6.js");
-
- String str = cu.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordIf1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordIf1.js");
-
- String str = cu.getSource();
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:if completion:if relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordIf2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordIf2.js");
-
- String str = cu.getSource();
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordIf3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordIf3.js");
-
- String str = cu.getSource();
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordIf4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordIf4.js");
-
- String str = cu.getSource();
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:if completion:if relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordIf5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordIf5.js");
-
- String str = cu.getSource();
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordIf6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordIf6.js");
-
- String str = cu.getSource();
- String completeBehind = "if";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordImport1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordImport1.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:import completion:import relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordImport2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "p", "CompletionKeywordImport2.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:import completion:import relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordImport3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordImport3.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:import completion:import relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordImport4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordImport4.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordImport5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordImport5.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:import completion:import relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordImport6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordImport6.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordImport7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordImport7.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:import completion:import relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordImport8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "p", "CompletionKeywordImport8.js");
-
- String str = cu.getSource();
- String completeBehind = "imp";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:import completion:import relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordInstanceof1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordInstanceof1.js");
-
- String str = cu.getSource();
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:instanceof completion:instanceof relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordInstanceof2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordInstanceof2.js");
-
- String str = cu.getSource();
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordInstanceof3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordInstanceof3.js");
-
- String str = cu.getSource();
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordInstanceof4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordInstanceof4.js");
-
- String str = cu.getSource();
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:instanceof completion:instanceof relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordInstanceof5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordInstanceof5.js");
-
- String str = cu.getSource();
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordInstanceof6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordInstanceof6.js");
-
- String str = cu.getSource();
- String completeBehind = "ins";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordNew1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew1.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew10.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew11() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew11.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew12() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew12.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew13() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew13.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew14() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew14.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew15() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew15.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew16() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew16.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew2.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew3.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew4.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew5.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew6.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew7.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew8.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNew9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNew9.js");
-
- String str = cu.getSource();
- String completeBehind = "ne";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:new completion:new relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNull1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNull1.js");
-
- String str = cu.getSource();
- String completeBehind = "nul";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordNull2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNull2.js");
-
- String str = cu.getSource();
- String completeBehind = "nul";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:null completion:null relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordNull3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNull3.js");
-
- String str = cu.getSource();
- String completeBehind = "nul";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordNull4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordNull4.js");
-
- String str = cu.getSource();
- String completeBehind = "nul";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:null completion:null relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPackage1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPackage1.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:package completion:package relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPackage2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "p", "CompletionKeywordPackage2.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-
-public void testCompletionKeywordPackage3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPackage3.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPackage4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPackage4.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPackage5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPackage5.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPackage6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPackage6.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPackage7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPackage7.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPackage8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "p", "CompletionKeywordPackage8.js");
-
- String str = cu.getSource();
- String completeBehind = "pac";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate1.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:private completion:private relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate10.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate2.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:private completion:private relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate3.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:private completion:private relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate4.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate5.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate6.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:private completion:private relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate7.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:private completion:private relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate8.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:private completion:private relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPrivate9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPrivate9.js");
-
- String str = cu.getSource();
- String completeBehind = "pri";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordProtected1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected1.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:protected completion:protected relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordProtected10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected10.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordProtected2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected2.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:protected completion:protected relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordProtected3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected3.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:protected completion:protected relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordProtected4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected4.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordProtected5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected5.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordProtected6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected6.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:protected completion:protected relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordProtected7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected7.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:protected completion:protected relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordProtected8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected8.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:protected completion:protected relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordProtected9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordProtected9.js");
-
- String str = cu.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic1.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic10.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic11() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic11.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic12() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic12.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic13() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic13.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic14() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic14.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic15() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic15.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic16() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic16.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic17() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic17.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic18() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic18.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic19() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic19.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic2.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic20() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic10.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic3.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic4.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic5.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordPublic6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic6.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic7.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic8.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:public completion:public relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordPublic9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordPublic9.js");
-
- String str = cu.getSource();
- String completeBehind = "pub";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordReturn1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordReturn1.js");
-
- String str = cu.getSource();
- String completeBehind = "re";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:return completion:return relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordReturn2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordReturn2.js");
-
- String str = cu.getSource();
- String completeBehind = "re";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordReturn3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordReturn3.js");
-
- String str = cu.getSource();
- String completeBehind = "re";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordReturn4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordReturn4.js");
-
- String str = cu.getSource();
- String completeBehind = "re";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:return completion:return relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordReturn5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordReturn5.js");
-
- String str = cu.getSource();
- String completeBehind = "re";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordReturn6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordReturn6.js");
-
- String str = cu.getSource();
- String completeBehind = "re";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordStatic1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic1.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic10.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic2.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic3.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic4.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordStatic5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic5.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic6.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic7.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic8.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:static completion:static relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStatic9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStatic9.js");
-
- String str = cu.getSource();
- String completeBehind = "sta";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp1.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:strictfp completion:strictfp relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp2.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp3.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:strictfp completion:strictfp relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp4.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp5.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:strictfp completion:strictfp relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp6.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp7.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:strictfp completion:strictfp relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordStrictfp8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordStrictfp8.js");
-
- String str = cu.getSource();
- String completeBehind = "stric";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordSuper1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper1.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:super completion:super relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper10.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:super completion:super relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper11() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper11.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper12() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src2/CompletionKeywordSuper12.js",
- "public class CompletionKeywordSuper12 {\n"+
- " public CompletionKeywordSuper12() {\n"+
- " #\n"+
- " sup\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertResults(
- "SuperClass[TYPE_REF]{SuperClass, , LSuperClass;, null, null, " + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "SuperInterface[TYPE_REF]{SuperInterface, , LSuperInterface;, null, null, " + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "super[KEYWORD]{super, null, null, super, null, "+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED)+"}\n" +
- "super[FUNCTION_REF<CONSTRUCTOR>]{super(), Ljava.lang.Object;, ()V, super, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionKeywordSuper2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper2.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:super completion:super relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper3.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper4.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:super completion:super relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper5.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper6() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src2/CompletionKeywordSuper6.js",
- "public class CompletionKeywordSuper6 {\n"+
- " public CompletionKeywordSuper6() {\n"+
- " sup\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
-
- String str = this.wc.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertResults(
- "SuperClass[TYPE_REF]{SuperClass, , LSuperClass;, null, null, " + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "SuperInterface[TYPE_REF]{SuperInterface, , LSuperInterface;, null, null, " + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "super[KEYWORD]{super, null, null, super, null, "+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED)+"}\n" +
- "super[FUNCTION_REF<CONSTRUCTOR>]{super(), Ljava.lang.Object;, ()V, super, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionKeywordSuper7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper7.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:super completion:super relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper8.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:super completion:super relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSuper9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSuper9.js");
-
- String str = cu.getSource();
- String completeBehind = "sup";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:SuperClass completion:SuperClass relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:SuperInterface completion:SuperInterface relevance:" + (R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSwitch1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSwitch1.js");
-
- String str = cu.getSource();
- String completeBehind = "sw";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:switch completion:switch relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSwitch2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSwitch2.js");
-
- String str = cu.getSource();
- String completeBehind = "sw";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordSwitch3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSwitch3.js");
-
- String str = cu.getSource();
- String completeBehind = "sw";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordSwitch4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSwitch4.js");
-
- String str = cu.getSource();
- String completeBehind = "sw";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:switch completion:switch relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordSwitch5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSwitch5.js");
-
- String str = cu.getSource();
- String completeBehind = "sw";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordSwitch6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordSwitch6.js");
-
- String str = cu.getSource();
- String completeBehind = "sw";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThis1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis1.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThis10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis10.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThis11() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis11.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThis12() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis12.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThis13() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis13.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThis14() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis14.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-/*
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=42402
- */
-public void testCompletionKeywordThis15() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src2/CompletionKeywordThis15.js",
- "public class CompletionKeywordThis15 {\n" +
- " public class InnerClass {\n" +
- " public InnerClass() {\n" +
- " CompletionKeywordThis15 a = CompletionKeywordThis15.this;\n" +
- " }\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "CompletionKeywordThis15.";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionKeywordThis15.InnerClass[TYPE_REF]{InnerClass, , LCompletionKeywordThis15$InnerClass;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "class[FIELD_REF]{class, null, Ljava.lang.Class;, class, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n"+
- "this[KEYWORD]{this, null, null, this, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionKeywordThis2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis2.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThis3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis3.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThis4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis4.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThis5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis5.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThis6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis6.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThis7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis7.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThis8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis8.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThis9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThis9.js");
-
- String str = cu.getSource();
- String completeBehind = "thi";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:this completion:this relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrow1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrow1.js");
-
- String str = cu.getSource();
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Throwable completion:Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:throw completion:throw relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrow2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrow2.js");
-
- String str = cu.getSource();
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Throwable completion:Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrow3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrow3.js");
-
- String str = cu.getSource();
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Throwable completion:Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrow4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrow4.js");
-
- String str = cu.getSource();
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Throwable completion:Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:throw completion:throw relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrow5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrow5.js");
-
- String str = cu.getSource();
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Throwable completion:Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrow6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrow6.js");
-
- String str = cu.getSource();
- String completeBehind = "thr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Throwable completion:Throwable relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrows1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows1.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:throws completion:throws relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrows2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows2.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThrows3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows3.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:throws completion:throws relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrows4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows4.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:throws completion:throws relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrows5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows5.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:throws completion:throws relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrows6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows6.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordThrows7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows7.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:throws completion:throws relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordThrows8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordThrows8.js");
-
- String str = cu.getSource();
- String completeBehind = "thro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:throws completion:throws relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordTrue1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTrue1.js");
-
- String str = cu.getSource();
- String completeBehind = "tru";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordTrue2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTrue2.js");
-
- String str = cu.getSource();
- String completeBehind = "tru";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:true completion:true relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordTrue3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTrue3.js");
-
- String str = cu.getSource();
- String completeBehind = "tru";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordTrue4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTrue4.js");
-
- String str = cu.getSource();
- String completeBehind = "tru";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:true completion:true relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90615
-public void testCompletionKeywordTrue5() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionKeywordTrue5.js",
- "package test;\n" +
- "public class CompletionKeywordTrue5 {\n" +
- " public void foo() {\n" +
- " boolean var;\n" +
- " var = tr\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "tr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "true[KEYWORD]{true, null, null, true, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90615
-public void testCompletionKeywordTrue6() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionKeywordTrue6.js",
- "package test;\n" +
- "public class CompletionKeywordTrue6 {\n" +
- " public void foo() {\n" +
- " boolean var;\n" +
- " var = \n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "var = ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "foo[FUNCTION_REF]{foo(), Ltest.CompletionKeywordTrue6;, ()V, foo, null, " +(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "equals[FUNCTION_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n"+
- "var[LOCAL_VARIABLE_REF]{var, null, Z, var, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n"+
- "false[KEYWORD]{false, null, null, false, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_TRUE_OR_FALSE + R_NON_RESTRICTED)+"}\n"+
- "true[KEYWORD]{true, null, null, true, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_TRUE_OR_FALSE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionKeywordTrue6[TYPE_REF]{CompletionKeywordTrue6, test, Ltest.CompletionKeywordTrue6;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "foo[FUNCTION_REF]{foo(), Ltest.CompletionKeywordTrue6;, ()V, foo, null, " +(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "equals[FUNCTION_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n"+
- "var[LOCAL_VARIABLE_REF]{var, null, Z, var, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"}\n"+
- "false[KEYWORD]{false, null, null, false, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_TRUE_OR_FALSE + R_NON_RESTRICTED)+"}\n"+
- "true[KEYWORD]{true, null, null, true, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_TRUE_OR_FALSE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- }
-}
-public void testCompletionKeywordTry1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTry1.js");
-
- String str = cu.getSource();
- String completeBehind = "tr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:try completion:try relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordTry2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTry2.js");
-
- String str = cu.getSource();
- String completeBehind = "tr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:true completion:true relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordTry3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTry3.js");
-
- String str = cu.getSource();
- String completeBehind = "try";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordTry4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTry4.js");
-
- String str = cu.getSource();
- String completeBehind = "tr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:try completion:try relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordTry5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTry5.js");
-
- String str = cu.getSource();
- String completeBehind = "tr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:true completion:true relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordTry6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordTry6.js");
-
- String str = cu.getSource();
- String completeBehind = "try";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordWhile1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile1.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:while completion:while relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordWhile10() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile10.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:while completion:while relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordWhile2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile2.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordWhile3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile3.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordWhile4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile4.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:while completion:while relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordWhile5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile5.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:while completion:while relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordWhile6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile6.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:while completion:while relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionKeywordWhile7() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile7.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordWhile8() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile8.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "",
- requestor.getResults());
-}
-public void testCompletionKeywordWhile9() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src2", "", "CompletionKeywordWhile9.js");
-
- String str = cu.getSource();
- String completeBehind = "wh";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:while completion:while relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionLocalName() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionLocalName.js");
-
- String str = cu.getSource();
- String completeBehind = "ClassWithComplexName ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:classWithComplexName completion:classWithComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:complexName2 completion:complexName2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:name completion:name relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:withComplexName completion:withComplexName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionLocalType1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionLocalType1.js",
- "public class CompletionLocalType1 {\n" +
- " void foo() {\n" +
- " class ZZZZ {\n" +
- " ZZZ\n" +
- " }\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZ[POTENTIAL_METHOD_DECLARATION]{ZZZ, LZZZZ;, ()V, ZZZ, null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n"+
- "ZZZZ[TYPE_REF]{ZZZZ, , LZZZZ;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25815
-*/
-public void testCompletionMemberType() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionMemberType.js",
- "public class CompletionMemberType {\n"+
- " public class Y {\n"+
- " public void foo(){\n"+
- " Y var = new Y\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "new Y";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionMemberType.Y[TYPE_REF]{Y, , LCompletionMemberType$Y;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_EXACT_NAME+ R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionMemberType2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionMemberType2.js",
- "public class CompletionMemberType2 {\n"+
- " public class MemberException extends Exception {\n"+
- " }\n"+
- " void foo() {\n"+
- " throw new \n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "new ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionMemberType2[TYPE_REF]{CompletionMemberType2, test, Ltest.CompletionMemberType2;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "CompletionMemberType2.MemberException[TYPE_REF]{MemberException, test, Ltest.CompletionMemberType2$MemberException;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
- }
-}
-public void testCompletionMemberType3() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionArrayClone.js",
- "public class CompletionMemberType3 {\n"+
- " public class MemberException extends Exception {\n"+
- " }\n"+
- " void foo() {\n"+
- " throw new MemberE\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "new MemberE";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionMemberType3.MemberException[TYPE_REF]{MemberException, test, Ltest.CompletionMemberType3$MemberException;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION+ R_UNQUALIFIED + R_NON_RESTRICTED) +"}",
- requestor.getResults());
-}
-public void testCompletionMessageSendIsParent1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMessageSendIsParent1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMessageSendIsParent2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMessageSendIsParent2.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMessageSendIsParent3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMessageSendIsParent3.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMessageSendIsParent4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMessageSendIsParent4.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMessageSendIsParent5() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMessageSendIsParent5.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMessageSendIsParent6() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMessageSendIsParent6.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMethodDeclaration() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodDeclaration.js");
-
- String str = cu.getSource();
- String completeBehind = "eq";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:eqFoo completion:public int eqFoo(int a, Object b) relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"\n" +
- "element:equals completion:public boolean equals(Object obj) relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMethodDeclaration10() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodDeclaration10.js");
-
- String str = cu.getSource();
- String completeBehind = "clon";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one completion",
- "element:CloneNotSupportedException completion:CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:clone completion:protected Object clone() throws CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=80063
-public void testCompletionMethodDeclaration11() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionMethodDeclaration11.js",
- "package test;\n" +
- "public class CompletionMethodDeclaration11 {\n" +
- " private void foo() {\n" +
- " }\n" +
- "}\n" +
- "class CompletionMethodDeclaration11_2 extends CompletionMethodDeclaration11 {\n" +
- " fo\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "fo[POTENTIAL_METHOD_DECLARATION]{fo, Ltest.CompletionMethodDeclaration11_2;, ()V, fo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionMethodDeclaration12() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionMethodDeclaration12.js",
- "package test;\n" +
- "public class CompletionMethodDeclaration12 {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n" +
- "class CompletionMethodDeclaration12_2 extends CompletionMethodDeclaration12{\n" +
- " public final void foo() {\n" +
- " }\n" +
- "}\n" +
- "class CompletionMethodDeclaration12_3 extends CompletionMethodDeclaration12_2 {\n" +
- " fo\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "fo[POTENTIAL_METHOD_DECLARATION]{fo, Ltest.CompletionMethodDeclaration12_3;, ()V, fo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionMethodDeclaration2() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionSuperClass.js",
- "public class CompletionSuperClass{\n" +
- " public class Inner {}\n" +
- " public int eqFoo(int a,Object b){\n" +
- " return 1;\n" +
- " }\n" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionMethodDeclaration2.js",
- "public class CompletionMethodDeclaration2 extends CompletionSuperClass {\n" +
- " eq\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "eq";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "eq[POTENTIAL_METHOD_DECLARATION]{eq, LCompletionMethodDeclaration2;, ()V, eq, null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "eqFoo[FUNCTION_DECLARATION]{public int eqFoo(int a, Object b), LCompletionSuperClass;, (ILjava.lang.Object;)I, eqFoo, (a, b), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n" +
- "equals[FUNCTION_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- }
-}
-/**
- * Completion should not propose declarations of method already locally implemented
- */
-public void testCompletionMethodDeclaration3() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionSuperClass.js",
- "public class CompletionSuperClass{\n" +
- " public class Inner {}\n" +
- " public int eqFoo(int a,Object b){\n" +
- " return 1;\n" +
- " }\n" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionMethodDeclaration3.js",
- "public class CompletionMethodDeclaration3 extends CompletionSuperClass {\n" +
- " eq\n" +
- " \n" +
- " public int eqFoo(int a,Object b){\n" +
- " return 1;\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "eq";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "eq[POTENTIAL_METHOD_DECLARATION]{eq, LCompletionMethodDeclaration3;, ()V, eq, null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "equals[FUNCTION_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- }
-}
-public void testCompletionMethodDeclaration4() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionSuperInterface.js",
- "public interface CompletionSuperInterface{\n"+
- " public int eqFoo(int a,Object b);\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionMethodDeclaration4.js",
- "public abstract class CompletionMethodDeclaration4 implements CompletionSuperInterface {\n"+
- " eq\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "eq";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "eq[POTENTIAL_METHOD_DECLARATION]{eq, LCompletionMethodDeclaration4;, ()V, eq, null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "equals[FUNCTION_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "eqFoo[FUNCTION_DECLARATION]{public int eqFoo(int a, Object b), LCompletionSuperInterface;, (ILjava.lang.Object;)I, eqFoo, (a, b), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_ABSTRACT_METHOD + R_METHOD_OVERIDE+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- }
-}
-public void testCompletionMethodDeclaration5() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionSuperClass.js",
- "public class CompletionSuperClass{\n" +
- " public class Inner {}\n" +
- " public int eqFoo(int a,Object b){\n" +
- " return 1;\n" +
- " }\n" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionMethodDeclaration5.js",
- "public class CompletionMethodDeclaration5 {\n" +
- " public static void main(String[] args) {\n" +
- " new CompletionSuperClass() {\n" +
- " }\n" +
- "\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "new CompletionSuperClass() {";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "[POTENTIAL_METHOD_DECLARATION]{, LCompletionSuperClass;, ()V, , null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "clone[FUNCTION_DECLARATION]{protected Object clone() throws CloneNotSupportedException, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "eqFoo[FUNCTION_DECLARATION]{public int eqFoo(int a, Object b), LCompletionSuperClass;, (ILjava.lang.Object;)I, eqFoo, (a, b), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "equals[FUNCTION_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "finalize[FUNCTION_DECLARATION]{protected void finalize() throws Throwable, Ljava.lang.Object;, ()V, finalize, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "hashCode[FUNCTION_DECLARATION]{public int hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "toString[FUNCTION_DECLARATION]{public String toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED)+ "}",
- requestor.getResults());
- } else {
- assertResults(
- "[POTENTIAL_METHOD_DECLARATION]{, LCompletionSuperClass;, ()V, , null, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED)+"}\n" +
- "CompletionMethodDeclaration5[TYPE_REF]{CompletionMethodDeclaration5, , LCompletionMethodDeclaration5;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "clone[FUNCTION_DECLARATION]{protected Object clone() throws CloneNotSupportedException, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "eqFoo[FUNCTION_DECLARATION]{public int eqFoo(int a, Object b), LCompletionSuperClass;, (ILjava.lang.Object;)I, eqFoo, (a, b), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "equals[FUNCTION_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "finalize[FUNCTION_DECLARATION]{protected void finalize() throws Throwable, Ljava.lang.Object;, ()V, finalize, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "hashCode[FUNCTION_DECLARATION]{public int hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED)+"}\n"+
- "toString[FUNCTION_DECLARATION]{public String toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED)+ "}",
- requestor.getResults());
- }
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- }
-}
-public void testCompletionMethodDeclaration6() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodDeclaration6.js");
-
- String str = cu.getSource();
- String completeBehind = "clon";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one completion",
- "element:CloneNotSupportedException completion:CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMethodDeclaration7() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodDeclaration7.js");
-
- String str = cu.getSource();
- String completeBehind = "clon";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one completion",
- "element:CloneNotSupportedException completion:CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:clone completion:protected Object clone() throws CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMethodDeclaration8() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodDeclaration8.js");
-
- String str = cu.getSource();
- String completeBehind = "clon";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one completion",
- "element:CloneNotSupportedException completion:CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:clone completion:protected Object clone() throws CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMethodDeclaration9() throws JavaScriptModelException {
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodDeclaration9.js");
-
- String str = cu.getSource();
- String completeBehind = "clon";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have one completion",
- "element:CloneNotSupportedException completion:CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:clone completion:protected Object clone() throws CloneNotSupportedException relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMethodThrowsClause() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodThrowsClause.js");
-
- String str = cu.getSource();
- String completeBehind = "Ex";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Exception completion:Exception relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionMethodThrowsClause2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionMethodThrowsClause2.js");
-
- String str = cu.getSource();
- String completeBehind = "Ex";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Exception completion:Exception relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionNonEmptyToken1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionNonEmptyToken1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- int start = cursorLocation - 2;
- int end = start + 4;
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzyy completion:zzyy position:["+start+","+end+"] relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResultsWithPosition());
-}
-public void testCompletionNonStaticFieldRelevance() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionNonStaticFieldRelevance.js");
-
- String str = cu.getSource();
- String completeBehind = "var.Ii";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Ii0 completion:Ii0 relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "\n" +
- "element:ii1 completion:ii1 relevance:" + (R_DEFAULT + R_INTERESTING + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/**
- * Attempt to do completion with a null requestor
- */
-public void testCompletionNullRequestor() throws JavaScriptModelException {
- try {
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionFindThisDotField.js");
- cu.codeComplete(5, (CompletionRequestor)null);
- } catch (IllegalArgumentException iae) {
- return;
- }
- assertTrue("Should not be able to do completion with a null requestor", false);
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=24565
-*/
-public void testCompletionObjectsMethodWithInterfaceReceiver() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionObjectsMethodWithInterfaceReceiver.js");
-
- String str = cu.getSource();
- String completeBehind = "hash";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:hashCode completion:hashCode() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_EXACT_EXPECTED_TYPE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/**
- * Ensures that the code assist features works on class files with associated source.
- */
-public void testCompletionOnClassFile() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IClassFile cu = getClassFile("Completion", "zzz.jar", "jarpack1", "X.class");
-
- String str = cu.getSource();
- String completeBehind = "Obj";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have one class",
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25890
-*/
-public void testCompletionOnStaticMember1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionOnStaticMember1.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25890
-*/
-public void testCompletionOnStaticMember2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionOnStaticMember2.js");
-
- String str = cu.getSource();
- String completeBehind = "method";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:method1 completion:method1() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:method2 completion:method2() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/**
- * Test that an out of bounds index causes an exception.
- */
-public void testCompletionOutOfBounds() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionOutOfBounds.js");
- try {
- cu.codeComplete(cu.getSource().length() + 1, requestor);
- } catch (JavaScriptModelException e) {
- return;
- }
- assertTrue("should have failed", false);
-}
-public void testCompletionPackageAndClass1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "z1.z2.qla0", "Qla3.js");
-
- String str = cu.getSource();
- String completeBehind = "z1.z2.ql";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Qla1 completion:z1.z2.Qla1 relevance:" + (R_DEFAULT + R_INTERESTING + R_QUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:qla2 completion:z1.z2.qla2 relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_QUALIFIED + R_NON_RESTRICTED) + "\n" +
- "element:z1.z2.qla0 completion:z1.z2.qla0 relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_QUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionPackageAndClass2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "z1.z2.qla0", "Wla.js");
-
- String str = cu.getSource();
- String completeBehind = "z1.z2.qla0.";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Qla3 completion:Qla3 relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "\n" +
- "element:Qla4 completion:Qla4 relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "\n" +
- "element:Wla completion:Wla relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionPrefixFieldName1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionPrefixFieldName1.js",
- "public class CompletionPrefixFieldName1 {\n"+
- " int xBar;\n"+
- " \n"+
- " class classFoo {\n"+
- " int xBar;\n"+
- " \n"+
- " public void foo(){\n"+
- " xBa\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "xBar[FIELD_REF]{CompletionPrefixFieldName1.this.xBar, LCompletionPrefixFieldName1;, I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
- "xBar[FIELD_REF]{xBar, LCompletionPrefixFieldName1$classFoo;, I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionPrefixFieldName2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionPrefixFieldName2.js",
- "public class CompletionPrefixFieldName2 {\n"+
- " int xBar;\n"+
- " \n"+
- " class classFoo {\n"+
- " int xBar;\n"+
- " \n"+
- " public void foo(){\n"+
- " new CompletionPrefixFieldName2().xBa\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "xBar[FIELD_REF]{xBar, LCompletionPrefixFieldName2;, I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionPrefixMethodName1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionPrefixMethodName1.js",
- "public class CompletionPrefixMethodName1 {\n"+
- " int xBar(){}\n"+
- " \n"+
- " class classFoo {\n"+
- " int xBar(){}\n"+
- " \n"+
- " public void foo(){\n"+
- " xBa\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "xBar[FUNCTION_REF]{CompletionPrefixMethodName1.this.xBar(), LCompletionPrefixMethodName1;, ()I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
- "xBar[FUNCTION_REF]{xBar(), LCompletionPrefixMethodName1$classFoo;, ()I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionPrefixMethodName2() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionPrefixMethodName2.js",
- "public class CompletionPrefixMethodName2 {\n"+
- " int xBar(){}\n"+
- " \n"+
- " class classFoo {\n"+
- " int xBar(){}\n"+
- " \n"+
- " public void foo(){\n"+
- " new CompletionPrefixMethodName2().xBa\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "xBa";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "xBar[FUNCTION_REF]{xBar(), LCompletionPrefixMethodName2;, ()I, xBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionPrefixMethodName3() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionPrefixMethodName2.js",
- "public class CompletionPrefixMethodName3 {\n"+
- " int xBar(int a, int b){}\n"+
- " \n"+
- " class classFoo {\n"+
- " int xBar(int a, int b){}\n"+
- " \n"+
- " public void foo(){\n"+
- " xBar(1,\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "xBar(1,";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "xBar[FUNCTION_REF]{CompletionPrefixMethodName3.this.xBar(1,, LCompletionPrefixMethodName3;, (II)I, xBar, (a, b), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED)+"}\n"+
- "xBar[FUNCTION_REF]{, LCompletionPrefixMethodName3$classFoo;, (II)I, xBar, (a, b), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionQualifiedAllocationType1() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionQualifiedAllocationType1.js",
- "public class CompletionQualifiedAllocationType1 {\n"+
- " public class YYY {\n"+
- " }\n"+
- " void foo(){\n"+
- " this.new YYY\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "YYY";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionQualifiedAllocationType1.YYY[TYPE_REF]{YYY, , LCompletionQualifiedAllocationType1$YYY;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=26677
-*/
-public void testCompletionQualifiedExpectedType() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/test/CompletionQualifiedExpectedType.js",
- "import pack1.PX;\n"+
- "\n"+
- "public class CompletionQualifiedExpectedType {\n"+
- " void foo() {\n"+
- " pack2.PX var = new \n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "new ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "PX[TYPE_REF]{pack2.PX, pack2, Lpack2.PX;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE+ R_NON_RESTRICTED)+ "}",
- requestor.getResults());
- } else {
- assertResults(
- "CompletionQualifiedExpectedType[TYPE_REF]{CompletionQualifiedExpectedType, test, Ltest.CompletionQualifiedExpectedType;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "PX[TYPE_REF]{pack2.PX, pack2, Lpack2.PX;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE+ R_NON_RESTRICTED)+ "}",
- requestor.getResults());
- }
-}
-/**
- * Complete the type "Repeated", "RepeatedOtherType from "Repeated".
- */
-public void testCompletionRepeatedType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionRepeatedType.js");
-
- String str = cu.getSource();
- String completeBehind = "/**/CompletionRepeated";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "should have two types",
- "element:CompletionRepeatedOtherType completion:CompletionRepeatedOtherType relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:CompletionRepeatedType completion:CompletionRepeatedType relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25591
-*/
-public void testCompletionReturnInInitializer() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionReturnInInitializer.js");
-
- String str = cu.getSource();
- String completeBehind = "eq";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:equals completion:equals() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionReturnStatementIsParent1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionReturnStatementIsParent1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zz00 completion:zz00 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz00M completion:zz00M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz01 completion:zz01 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz01M completion:zz01M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz02 completion:zz02 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz02M completion:zz02M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz10 completion:zz10 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz10M completion:zz10M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz11 completion:zz11 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz11M completion:zz11M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz12 completion:zz12 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz12M completion:zz12M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz20 completion:zz20 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz20M completion:zz20M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz21 completion:zz21 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz21M completion:zz21M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz22 completion:zz22 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zz22M completion:zz22M() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzOb completion:zzOb relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzObM completion:zzObM() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionReturnStatementIsParent2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionReturnStatementIsParent2.js");
-
- String str = cu.getSource();
- String completeBehind = "xx";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:XX00 completion:XX00 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX01 completion:XX01 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX02 completion:XX02 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX10 completion:XX10 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX11 completion:XX11 relevance:"+(R_DEFAULT + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX12 completion:XX12 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX20 completion:XX20 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX21 completion:XX21 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:XX22 completion:XX22 relevance:"+(R_DEFAULT + R_INTERESTING + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=66908
- */
-public void testCompletionSameClass() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionSameClass.js");
-
- String str = cu.getSource();
- String completeBehind = "(CompletionSameClas";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:CompletionSameClass completion:CompletionSameClass relevance:" + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionSameSuperClass() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionSameSuperClass.js",
- "public class CompletionSameSuperClass extends A {\n" +
- " class Inner extends A {\n" +
- " void foo(int bar){\n" +
- " bar\n" +
- " }\n" +
- " } \n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar[FIELD_REF]{CompletionSameSuperClass.this.bar, LA;, I, bar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}\n"+
- "bar[FIELD_REF]{this.bar, LA;, I, bar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}\n"+
- "bar[FUNCTION_REF]{CompletionSameSuperClass.this.bar(), LA;, ()V, bar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}\n"+
- "bar[LOCAL_VARIABLE_REF]{bar, null, I, bar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+
- "bar[FUNCTION_REF]{bar(), LA;, ()V, bar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionStaticMethod1() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/TypeWithAMethodAndAStaticMethod .js",
- "public class TypeWithAMethodAndAStaticMethod {\n"+
- " public static void foo(){}\n"+
- " public void foo0(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionStaticMethod1.js",
- "public class CompletionStaticMethod1 extends TypeWithAMethodAndAStaticMethod {\n"+
- " void bar(){\n"+
- " new TypeWithAMethodAndAStaticMethod(){\n"+
- " class Inner1 extends TypeWithAMethodAndAStaticMethod {\n"+
- " void bar(){\n"+
- " foo\n"+
- " }\n"+
- " }\n"+
- " };\n"+
- " }\n"+
- " \n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo0[FUNCTION_REF]{CompletionStaticMethod1.this.foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "foo0[FUNCTION_REF]{foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED) + "}\n" +
- "foo[FUNCTION_REF]{CompletionStaticMethod1.foo(), LTypeWithAMethodAndAStaticMethod;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[FUNCTION_REF]{foo(), LTypeWithAMethodAndAStaticMethod;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_NAME + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-public void testCompletionStaticMethodDeclaration1() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/TypeWithAMethodAndAStaticMethod .js",
- "public class TypeWithAMethodAndAStaticMethod {\n"+
- " public static void foo(){}\n"+
- " public void foo0(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionStaticMethodDeclaration1.js",
- "public class CompletionStaticMethodDeclaration1 extends TypeWithAMethodAndAStaticMethod {\n"+
- " foo\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[POTENTIAL_METHOD_DECLARATION]{foo, LCompletionStaticMethodDeclaration1;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "foo0[FUNCTION_DECLARATION]{public void foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-public void testCompletionStaticMethodDeclaration2() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/TypeWithAMethodAndAStaticMethod .js",
- "public class TypeWithAMethodAndAStaticMethod {\n"+
- " public static void foo(){}\n"+
- " public void foo0(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionStaticMethodDeclaration2.js",
- "public class CompletionStaticMethodDeclaration2 {\n" +
- " class Inner1 extends TypeWithAMethodAndAStaticMethod {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[POTENTIAL_METHOD_DECLARATION]{foo, LCompletionStaticMethodDeclaration2$Inner1;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "foo0[FUNCTION_DECLARATION]{public void foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-public void testCompletionStaticMethodDeclaration3() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/TypeWithAMethodAndAStaticMethod .js",
- "public class TypeWithAMethodAndAStaticMethod {\n"+
- " public static void foo(){}\n"+
- " public void foo0(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionStaticMethodDeclaration3.js",
- "public class CompletionStaticMethodDeclaration3 {\n" +
- " static class Inner1 extends TypeWithAMethodAndAStaticMethod {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[POTENTIAL_METHOD_DECLARATION]{foo, LCompletionStaticMethodDeclaration3$Inner1;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "foo0[FUNCTION_DECLARATION]{public void foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-public void testCompletionStaticMethodDeclaration4() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/TypeWithAMethodAndAStaticMethod .js",
- "public class TypeWithAMethodAndAStaticMethod {\n"+
- " public static void foo(){}\n"+
- " public void foo0(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionStaticMethodDeclaration4.js",
- "public class CompletionStaticMethodDeclaration4 {\n" +
- " void bar() {\n" +
- " class Local1 extends TypeWithAMethodAndAStaticMethod {\n" +
- " foo\n" +
- " }\n" +
- " }\n" +
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[POTENTIAL_METHOD_DECLARATION]{foo, LLocal1;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "foo0[FUNCTION_DECLARATION]{public void foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-public void testCompletionStaticMethodDeclaration5() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/TypeWithAMethodAndAStaticMethod .js",
- "public class TypeWithAMethodAndAStaticMethod {\n"+
- " public static void foo(){}\n"+
- " public void foo0(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionStaticMethodDeclaration5.js",
- "public class CompletionStaticMethodDeclaration5 {\n"+
- " void bar() {\n"+
- " static class Local1 extends TypeWithAMethodAndAStaticMethod {\n"+
- " foo\n"+
- " }\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[POTENTIAL_METHOD_DECLARATION]{foo, LLocal1;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "foo0[FUNCTION_DECLARATION]{public void foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-public void testCompletionStaticMethodDeclaration6() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/TypeWithAMethodAndAStaticMethod .js",
- "public class TypeWithAMethodAndAStaticMethod {\n"+
- " public static void foo(){}\n"+
- " public void foo0(){}\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionStaticMethodDeclaration6.js",
- "public class CompletionStaticMethodDeclaration6 {\n"+
- " void bar() {\n"+
- " new TypeWithAMethodAndAStaticMethod() {\n"+
- " foo\n"+
- " };\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[POTENTIAL_METHOD_DECLARATION]{foo, LTypeWithAMethodAndAStaticMethod;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "foo0[FUNCTION_DECLARATION]{public void foo0(), LTypeWithAMethodAndAStaticMethod;, ()V, foo0, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-public void testCompletionSuperType() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionSuperClass.js",
- "public class CompletionSuperClass{\n" +
- " public class Inner {}\n" +
- " public int eqFoo(int a,Object b){\n" +
- " return 1;\n" +
- " }\n" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionSuperType.js",
- "public class CompletionSuperType extends CompletionSuperClass.");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "CompletionSuperClass.";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionSuperClass.Inner[TYPE_REF]{Inner, , LCompletionSuperClass$Inner;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_CLASS+ R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- }
-}
-public void testCompletionSuperType2() throws JavaScriptModelException {
- IJavaScriptUnit superClass = null;
- IJavaScriptUnit superClass2 = null;
- IJavaScriptUnit superInterface = null;
- IJavaScriptUnit superInterface2 = null;
- try {
- superClass = getWorkingCopy(
- "/Completion/src/CompletionSuperClass.js",
- "public class CompletionSuperClass{\n" +
- " public class Inner {}\n" +
- " public int eqFoo(int a,Object b){\n" +
- " return 1;\n" +
- " }\n" +
- "}");
-
- superClass2 = getWorkingCopy(
- "/Completion/src/CompletionSuperClass2.js",
- "public class CompletionSuperClass2 {\n" +
- " public class InnerClass {}\n" +
- " public interface InnerInterface {}\n" +
- "}");
-
- superInterface = getWorkingCopy(
- "/Completion/src/CompletionSuperInterface.js",
- "public interface CompletionSuperInterface{\n" +
- " public int eqFoo(int a,Object b);\n" +
- "}");
-
- superInterface2 = getWorkingCopy(
- "/Completion/src/CompletionSuperInterface2.js",
- "public interface CompletionSuperInterface2 {\n" +
- " public class InnerClass {}\n" +
- " public interface InnerInterface {}\n" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionSuperType2.js",
- "public class CompletionSuperType2 extends CompletionSuper");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "CompletionSuper";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionSuperClass[TYPE_REF]{CompletionSuperClass, , LCompletionSuperClass;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_CLASS + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
- "CompletionSuperClass2[TYPE_REF]{CompletionSuperClass2, , LCompletionSuperClass2;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_CLASS + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass != null) {
- superClass.discardWorkingCopy();
- }
- if(superClass2 != null) {
- superClass2.discardWorkingCopy();
- }
- if(superInterface != null) {
- superInterface.discardWorkingCopy();
- }
- if(superInterface2 != null) {
- superInterface2.discardWorkingCopy();
- }
- }
-}
-public void testCompletionSuperType4() throws JavaScriptModelException {
- IJavaScriptUnit superClass2 = null;
- try {
- superClass2 = getWorkingCopy(
- "/Completion/src/CompletionSuperClass2.js",
- "public class CompletionSuperClass2 {\n" +
- " public class InnerClass {}\n" +
- " public interface InnerInterface {}\n" +
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionSuperType4.js",
- "public class CompletionSuperType4 extends CompletionSuperClass2.Inner");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "CompletionSuperClass2.Inner";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "CompletionSuperClass2.InnerInterface[TYPE_REF]{InnerInterface, , LCompletionSuperClass2$InnerInterface;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED)+ "}\n"+
- "CompletionSuperClass2.InnerClass[TYPE_REF]{InnerClass, , LCompletionSuperClass2$InnerClass;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_CLASS + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- if(superClass2 != null) {
- superClass2.discardWorkingCopy();
- }
- }
-}
-public void testCompletionThrowStatement() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionThrowStatement.js");
-
- String str = cu.getSource();
- String completeBehind = "Ex";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Exception completion:Exception relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXCEPTION + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionToplevelType1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "p3", "CompletionToplevelType1.js");
-
- String str = cu.getSource();
- String completeBehind = "CompletionToplevelType1";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:CompletionToplevelType1 completion:CompletionToplevelType1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionType1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionType1.js");
-
- String str = cu.getSource();
- String completeBehind = "CT1";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:CT1 completion:CT1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n"+
- "element:CT1 completion:q2.CT1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionUnaryOperator1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionUnaryOperator1.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionUnaryOperator2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionUnaryOperator2.js");
-
- String str = cu.getSource();
- String completeBehind = "var";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:var1 completion:var1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:var2 completion:var2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED)+"\n" +
- "element:var3 completion:var3 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
- * bug : http://dev.eclipse.org/bugs/show_bug.cgi?id=24440
- */
-public void testCompletionUnresolvedEnclosingType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionUnresolvedEnclosingType.js");
-
- String str = cu.getSource();
- String completeBehind = "new ZZZ(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertTrue(
- requestor.getResults().length() == 0);
-}
-public void testCompletionUnresolvedFieldType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionUnresolvedFieldType.js");
-
- String str = cu.getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:barPlus completion:barPlus() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionUnresolvedParameterType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionUnresolvedParameterType.js");
-
- String str = cu.getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:barPlus completion:barPlus() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionUnresolvedReturnType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionUnresolvedReturnType.js");
-
- String str = cu.getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:barPlus completion:barPlus() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInInitializer1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInInitializer1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInInitializer2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInInitializer2.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInInitializer3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInInitializer3.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInInitializer4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInInitializer4.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInMethod1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInMethod1.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInMethod2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInMethod2.js");
-
- String str = cu.getSource();
- String completeBehind = "zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:zzObject completion:zzObject relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzboolean completion:zzboolean relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzdouble completion:zzdouble relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzint completion:zzint relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:zzlong completion:zzlong relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInMethod3() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInMethod3.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableInitializerInMethod4() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableInitializerInMethod4.js");
-
- String str = cu.getSource();
- String completeBehind = "Objec";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:Object completion:Object relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25811
-*/
-public void testCompletionVariableName1() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableName1.js");
-
- String str = cu.getSource();
- String completeBehind = "TEST_FOO_MyClass ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:class1 completion:class1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:myClass completion:myClass relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVariableName10() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName10.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName10 {\n"+
- " void foo(){\n"+
- " FooBar fo\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foBar[VARIABLE_DECLARATION]{foBar, null, LFooBar;, foBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foBarsuf[VARIABLE_DECLARATION]{foBarsuf, null, LFooBar;, foBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}\n"+
- "fooBar[VARIABLE_DECLARATION]{fooBar, null, LFooBar;, fooBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}\n"+
- "fooBarsuf[VARIABLE_DECLARATION]{fooBarsuf, null, LFooBar;, fooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_LESS_NEW_CHARACTERS + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-public void testCompletionVariableName11() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName11.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName11 {\n"+
- " void foo(){\n"+
- " FooBar pr\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "pr";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "preBar[VARIABLE_DECLARATION]{preBar, null, LFooBar;, preBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"}\n"+
- "preFooBar[VARIABLE_DECLARATION]{preFooBar, null, LFooBar;, preFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"}\n"+
- "preBarsuf[VARIABLE_DECLARATION]{preBarsuf, null, LFooBar;, preBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX+ R_NON_RESTRICTED)+"}\n"+
- "preFooBarsuf[VARIABLE_DECLARATION]{preFooBarsuf, null, LFooBar;, preFooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-public void testCompletionVariableName12() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName12.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName12 {\n"+
- " void foo(){\n"+
- " FooBar prethe\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "prethe";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "preTheBar[VARIABLE_DECLARATION]{preTheBar, null, LFooBar;, preTheBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"}\n"+
- "preTheFooBar[VARIABLE_DECLARATION]{preTheFooBar, null, LFooBar;, preTheFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"}\n"+
- "preTheBarsuf[VARIABLE_DECLARATION]{preTheBarsuf, null, LFooBar;, preTheBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}\n"+
- "preTheFooBarsuf[VARIABLE_DECLARATION]{preTheFooBarsuf, null, LFooBar;, preTheFooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-public void testCompletionVariableName13() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName13.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName13 {\n"+
- " void foo(){\n"+
- " FooBar prefo\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "prefo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "preFoBar[VARIABLE_DECLARATION]{preFoBar, null, LFooBar;, preFoBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"}\n"+
- "preFoBarsuf[VARIABLE_DECLARATION]{preFoBarsuf, null, LFooBar;, preFoBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}\n"+
- "preFooBar[VARIABLE_DECLARATION]{preFooBar, null, LFooBar;, preFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}\n"+
- "preFooBarsuf[VARIABLE_DECLARATION]{preFooBarsuf, null, LFooBar;, preFooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-public void testCompletionVariableName14() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName14.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName14 {\n"+
- " void foo(){\n"+
- " FooBar prethefo\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "prethefo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "preThefoBar[VARIABLE_DECLARATION]{preThefoBar, null, LFooBar;, preThefoBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"}\n"+
- "preThefoBarsuf[VARIABLE_DECLARATION]{preThefoBarsuf, null, LFooBar;, preThefoBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}\n"+
- "preTheFooBar[VARIABLE_DECLARATION]{preTheFooBar, null, LFooBar;, preTheFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}\n"+
- "preTheFooBarsuf[VARIABLE_DECLARATION]{preTheFooBarsuf, null, LFooBar;, preTheFooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128045
-public void testCompletionVariableName15() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName15.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName15 {\n"+
- " void foo(){\n"+
- " FooBar pro\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "pro";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "proBar[VARIABLE_DECLARATION]{proBar, null, LFooBar;, proBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "proFooBar[VARIABLE_DECLARATION]{proFooBar, null, LFooBar;, proFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "proBarsuf[VARIABLE_DECLARATION]{proBarsuf, null, LFooBar;, proBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "proFooBarsuf[VARIABLE_DECLARATION]{proFooBarsuf, null, LFooBar;, proFooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName16() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " Object ;\n"+
- " foo = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo[VARIABLE_DECLARATION]{foo, null, Ljava.lang.Object;, foo, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName17() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " Object foo1;\n"+
- " /*here*/Object ;\n"+
- " Object foo3;\n"+
- " foo1 = null;\n"+
- " foo2 = null;\n"+
- " foo3 = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo2[VARIABLE_DECLARATION]{foo2, null, Ljava.lang.Object;, foo2, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName18() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " Object ;\n"+
- " foo = Test.class;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo[VARIABLE_DECLARATION]{foo, null, Ljava.lang.Object;, foo, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName19() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " Object ;\n"+
- " object = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25811
-*/
-public void testCompletionVariableName2() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableName2.js");
-
- String str = cu.getSource();
- String completeBehind = "Test_Bar_MyClass ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:bar_MyClass completion:bar_MyClass relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:class1 completion:class1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:myClass completion:myClass relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n" +
- "element:test_Bar_MyClass completion:test_Bar_MyClass relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName20() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " class X {\n"+
- " Object foo1 = foo2;\n"+
- " void bar() {\n"+
- " foo1 = null;\n"+
- " Object foo3 = foo4;\n"+
- " foo3 = null;\n"+
- " }\n"+
- " }\n"+
- " foo5 = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo2[VARIABLE_DECLARATION]{foo2, null, Ljava.lang.Object;, foo2, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo4[VARIABLE_DECLARATION]{foo4, null, Ljava.lang.Object;, foo4, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo5[VARIABLE_DECLARATION]{foo5, null, Ljava.lang.Object;, foo5, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName21() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " {\n"+
- " /*here*/Object ;\n"+
- " foo1 = null;\n"+
- " }\n"+
- " foo2 = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo1[VARIABLE_DECLARATION]{foo1, null, Ljava.lang.Object;, foo1, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName22() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " Object foo1;\n"+
- " /*here*/Object ;\n"+
- " {\n"+
- " Object foo3;\n"+
- " foo1 = null;\n"+
- " foo2 = null;\n"+
- " foo3 = null;\n"+
- " }\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo2[VARIABLE_DECLARATION]{foo2, null, Ljava.lang.Object;, foo2, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName23() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " foo1 = null;\n"+
- " #\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo1[VARIABLE_DECLARATION]{foo1, null, Ljava.lang.Object;, foo1, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName24() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " #\n"+
- " foo1 = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo1[VARIABLE_DECLARATION]{foo1, null, Ljava.lang.Object;, foo1, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName25() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " #\n"+
- " foo1 = null;\n"+
- " #\n"+
- " foo2 = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo1[VARIABLE_DECLARATION]{foo1, null, Ljava.lang.Object;, foo1, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo2[VARIABLE_DECLARATION]{foo2, null, Ljava.lang.Object;, foo2, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName26() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " #\n"+
- " foo1 = null;\n"+
- " #\n"+
- " foo2 = null;\n"+
- " #\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo1[VARIABLE_DECLARATION]{foo1, null, Ljava.lang.Object;, foo1, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo2[VARIABLE_DECLARATION]{foo2, null, Ljava.lang.Object;, foo2, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName27() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " Object foo0 = null;\n"+
- " foo0 = null;\n"+
- " #\n"+
- " class X {\n"+
- " Object foo1 = foo2;\n"+
- " void bar() {\n"+
- " foo1 = null;\n"+
- " Object foo3 = foo4;\n"+
- " foo3 = null;\n"+
- " }\n"+
- " }\n"+
- " foo5 = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo2[VARIABLE_DECLARATION]{foo2, null, Ljava.lang.Object;, foo2, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo4[VARIABLE_DECLARATION]{foo4, null, Ljava.lang.Object;, foo4, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo5[VARIABLE_DECLARATION]{foo5, null, Ljava.lang.Object;, foo5, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName28() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " Object foo1 = null;\n"+
- " foo1.foo2 = null;\n"+
- " foo3.foo4 = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo3[VARIABLE_DECLARATION]{foo3, null, Ljava.lang.Object;, foo3, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName29() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo(){\n"+
- " /*here*/Object ;\n"+
- " class X {\n"+
- " void bar1() {\n"+
- " var1 = null;\n"+
- " }\n"+
- " void bar2() {\n"+
- " Object var2 = null;\n"+
- " var2 = null;\n"+
- " }\n"+
- " void bar3() {\n"+
- " Object var3 = null;\n"+
- " {\n"+
- " var3 = null;\n"+
- " Object var4 = null;\n"+
- " }\n"+
- " var4 = null;\n"+
- " }\n"+
- " }\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/*here*/Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "var1[VARIABLE_DECLARATION]{var1, null, Ljava.lang.Object;, var1, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "var4[VARIABLE_DECLARATION]{var4, null, Ljava.lang.Object;, var4, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionVariableName3() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"p1,p2"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"s1,s2"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableName3.js");
-
- String str = cu.getSource();
- String completeBehind = "OneName ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:name completion:name relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:names1 completion:names1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:names2 completion:names2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:oneName completion:oneName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"\n"+
- "element:oneNames1 completion:oneNames1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:oneNames2 completion:oneNames2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p1Name completion:p1Name relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"\n"+
- "element:p1Names1 completion:p1Names1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p1Names2 completion:p1Names2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NAME_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p1OneName completion:p1OneName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NON_RESTRICTED)+"\n"+
- "element:p1OneNames1 completion:p1OneNames1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p1OneNames2 completion:p1OneNames2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_PREFIX + R_NAME_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p2Name completion:p2Name relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_PREFIX + R_NON_RESTRICTED)+"\n"+
- "element:p2Names1 completion:p2Names1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p2Names2 completion:p2Names2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_PREFIX + R_NAME_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p2OneName completion:p2OneName relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_PREFIX + R_NON_RESTRICTED)+"\n"+
- "element:p2OneNames1 completion:p2OneNames1 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_PREFIX + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"\n"+
- "element:p2OneNames2 completion:p2OneNames2 relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_PREFIX + R_NAME_SUFFIX+ R_NON_RESTRICTED),
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName30() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " public Test(){\n"+
- " Object ;\n"+
- " foo = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo[VARIABLE_DECLARATION]{foo, null, Ljava.lang.Object;, foo, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName31() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " {\n"+
- " Object ;\n"+
- " foo = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo[VARIABLE_DECLARATION]{foo, null, Ljava.lang.Object;, foo, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150228
-public void testCompletionVariableName32() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void bar(Object ) {\n"+
- " foo = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Object ";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "foo[VARIABLE_DECLARATION]{foo, null, Ljava.lang.Object;, foo, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=162743
-public void testCompletionVariableName33() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void bar() {\n"+
- " /**/int v\n"+
- " variable = null;\n"+
- " variable = null;\n"+
- " variable = null;\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/**/int v";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "vI[VARIABLE_DECLARATION]{vI, null, I, vI, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "variable[VARIABLE_DECLARATION]{variable, null, I, variable, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=162968
-public void testCompletionVariableName34() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " int vDefined;\n"+
- " void bar() {\n"+
- " /**/int v\n"+
- " System.out.println(vUnknown);\n"+
- " System.out.println(vUnknown);\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "/**/int v";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "vI[VARIABLE_DECLARATION]{vI, null, I, vI, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "vUnknown[VARIABLE_DECLARATION]{vUnknown, null, I, vUnknown, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_NAME_FIRST_PREFIX + R_NAME_LESS_NEW_CHARACTERS + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=166570
-public void testCompletionVariableName35() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void bar() {\n"+
- " Test2 zzz\n"+
- " int zzzzz = 0;\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/Test2.js",
- "package test;\n"+
- "public class Test2 {\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Test2 zzz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "zzzTest2[VARIABLE_DECLARATION]{zzzTest2, null, Ltest.Test2;, zzzTest2, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionVariableName4() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName4.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName4 {\n"+
- " void foo(){\n"+
- " FooBar the\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "the";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "theBar[VARIABLE_DECLARATION]{theBar, null, LFooBar;, theBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "theFooBar[VARIABLE_DECLARATION]{theFooBar, null, LFooBar;, theFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionVariableName5() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName5.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName5 {\n"+
- " void foo(){\n"+
- " FooBar thefo\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "thefo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "thefoBar[VARIABLE_DECLARATION]{thefoBar, null, LFooBar;, thefoBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "theFooBar[VARIABLE_DECLARATION]{theFooBar, null, LFooBar;, theFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionVariableName6() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName6.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName6 {\n"+
- " void foo(){\n"+
- " FooBar theba\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "theba";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "thebaFooBar[VARIABLE_DECLARATION]{thebaFooBar, null, LFooBar;, thebaFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "theBar[VARIABLE_DECLARATION]{theBar, null, LFooBar;, theBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-public void testCompletionVariableName7() throws JavaScriptModelException {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName7.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName7 {\n"+
- " void foo(){\n"+
- " FooBar fo\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foBar[VARIABLE_DECLARATION]{foBar, null, LFooBar;, foBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "fooBar[VARIABLE_DECLARATION]{fooBar, null, LFooBar;, fooBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-
-public void testCompletionVariableName8() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName8.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName8 {\n"+
- " void foo(){\n"+
- " FooBar the\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "the";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "theBar[VARIABLE_DECLARATION]{theBar, null, LFooBar;, theBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "theFooBar[VARIABLE_DECLARATION]{theFooBar, null, LFooBar;, theFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "theBarsuf[VARIABLE_DECLARATION]{theBarsuf, null, LFooBar;, theBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}\n"+
- "theFooBarsuf[VARIABLE_DECLARATION]{theFooBarsuf, null, LFooBar;, theFooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_FIRST_SUFFIX + R_CASE + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-public void testCompletionVariableName9() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object argumentPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pre"); //$NON-NLS-1$
- Object localPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"suf"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.wc = getWorkingCopy(
- "/Completion/src/CompletionVariableName9.js",
- "class FooBar {\n"+
- "}\n"+
- "public class CompletionVariableName9 {\n"+
- " void foo(){\n"+
- " FooBar thefo\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "thefo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "thefoBar[VARIABLE_DECLARATION]{thefoBar, null, LFooBar;, thefoBar, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n"+
- "thefoBarsuf[VARIABLE_DECLARATION]{thefoBarsuf, null, LFooBar;, thefoBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}\n"+
- "theFooBar[VARIABLE_DECLARATION]{theFooBar, null, LFooBar;, theFooBar, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED)+"}\n"+
- "theFooBarsuf[VARIABLE_DECLARATION]{theFooBarsuf, null, LFooBar;, theFooBarsuf, null, "+(R_DEFAULT + R_INTERESTING + R_NAME_LESS_NEW_CHARACTERS + R_NAME_FIRST_SUFFIX + R_NON_RESTRICTED)+"}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,argumentPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,localPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- }
-}
-public void testCompletionVariableNameOfArray1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionVariableNameOfArray1.js",
- "public class CompletionVariableNameOfArray1 {\n"+
- " Object[] ob\n"+
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ob";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "objects[VARIABLE_DECLARATION]{objects, null, [Ljava.lang.Object;, objects, null, " + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionVariableNameOfArray2() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionVariableNameOfArray2.js",
- "public class CompletionVariableNameOfArray2 {\n"+
- " Class[] cl\n"+
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "cl";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "classes[VARIABLE_DECLARATION]{classes, null, [Ljava.lang.Class;, classes, null, " + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionVariableNameOfArray3() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionVariableNameOfArray3.js",
- "public class CompletionVariableNameOfArray3 {\n"+
- " Object[][] ob\n"+
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ob";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "objects[VARIABLE_DECLARATION]{objects, null, [[Ljava.lang.Object;, objects, null, " + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testCompletionVariableNameOfArray4() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/CompletionVariableNameOfArray4.js",
- "public class CompletionVariableNameOfArray4 {\n"+
- " Objectz[] ob\n"+
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ob";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-public void testCompletionVariableNameUnresolvedType() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVariableNameUnresolvedType.js");
-
- String str = cu.getSource();
- String completeBehind = "ob";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have no completion",
- "",
- requestor.getResults());
-}
-public void testCompletionVisibilityCheckDisabled() throws JavaScriptModelException {
- String visibilityCheckID = "org.eclipse.wst.jsdt.core.codeComplete.visibilityCheck";
- Hashtable options = JavaScriptCore.getOptions();
- Object visibilityCheckPreviousValue = options.get(visibilityCheckID);
- options.put(visibilityCheckID,"disabled");
- JavaScriptCore.setOptions(options);
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVisibilityCheck.js");
-
- String str = cu.getSource();
- String completeBehind = "x.p";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- options.put(visibilityCheckID,visibilityCheckPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "should have three methods",
- "element:privateFoo completion:privateFoo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"\n" +
- "element:protectedFoo completion:protectedFoo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"\n" +
- "element:publicFoo completion:publicFoo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionVisibilityCheckEnabled() throws JavaScriptModelException {
- String visibilityCheckID = "org.eclipse.wst.jsdt.core.codeComplete.visibilityCheck";
- Hashtable options = JavaScriptCore.getOptions();
- Object visibilityCheckPreviousValue = options.get(visibilityCheckID);
- options.put(visibilityCheckID,"enabled");
- JavaScriptCore.setOptions(options);
-
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVisibilityCheck.js");
-
- String str = cu.getSource();
- String completeBehind = "x.p";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- options.put(visibilityCheckID,visibilityCheckPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "should have two methods",
- "element:protectedFoo completion:protectedFoo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"\n" +
- "element:publicFoo completion:publicFoo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-/*
-* http://dev.eclipse.org/bugs/show_bug.cgi?id=25815
-*/
-public void testCompletionVoidMethod() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionVoidMethod.js");
-
- String str = cu.getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:foo completion:foo() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:foo1 completion:foo1() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:foo3 completion:foo3() relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-public void testCompletionWithBinaryFolder() throws JavaScriptModelException {
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionWithBinaryFolder.js");
-
- String str = cu.getSource();
- String completeBehind = "My";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "should have two completions",
- "element:MyClass completion:MyClass relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"\n" +
- "element:mypackage completion:mypackage relevance:"+(R_DEFAULT + R_INTERESTING+ R_NON_RESTRICTED),
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=95167
-public void testCompletionWithProblem1() throws JavaScriptModelException {
- IJavaScriptUnit aType = null;
- try {
- aType = getWorkingCopy(
- "/Completion/src/test/AType.js",
- "package test;\n" +
- "public class AType{\n"+
- " void foo(Unknown var) {\n"+
- " }\n"+
- "}");
-
- this.wc = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n" +
- "public class Test{\n"+
- " void foo() {\n"+
- " AType a = null;\n"+
- " a.zz\n"+
- " }\n"+
- "}");
-
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.wc.getSource();
- String completeBehind = "a.zz";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
-
- // no completion must be found
- assertResults(
- "",
- requestor.getResults());
-
- // no error must be found
- assertResults(
- "",
- requestor.getProblem());
- } finally {
- if(aType != null) {
- aType.discardWorkingCopy();
- }
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck1() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " ZZZTy\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- "}");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType2.js",
- "package deprecation;"+
- "/** @deprecated */\n"+
- "public class ZZZType2 {\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZTy";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZTy[POTENTIAL_METHOD_DECLARATION]{ZZZTy, Ldeprecation.Test;, ()V, ZZZTy, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "ZZZType1[TYPE_REF]{ZZZType1, deprecation, Ldeprecation.ZZZType1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "ZZZType2[TYPE_REF]{ZZZType2, deprecation, Ldeprecation.ZZZType2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck10() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " public void bar1(){}\n"+
- " /** @deprecated */\n"+
- " public void bar2(){}\n"+
- " void foo() {"+
- " bar\n"+
- " }"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar1[FUNCTION_REF]{bar1(), Ldeprecation.Test;, ()V, bar1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "bar2[FUNCTION_REF]{bar2(), Ldeprecation.Test;, ()V, bar2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck11() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " public int bar1;\n"+
- " /** @deprecated */\n"+
- " public int bar2;\n"+
- " void foo() {"+
- " bar\n"+
- " }"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar1[FIELD_REF]{bar1, Ldeprecation.Test;, I, bar1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "bar2[FIELD_REF]{bar2, Ldeprecation.Test;, I, bar2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck12() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " public int bar1;\n"+
- " /** @deprecated */\n"+
- " public int bar2;\n"+
- " void foo() {"+
- " bar\n"+
- " }"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar1[FIELD_REF]{bar1, Ldeprecation.Test;, I, bar1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "bar2[FIELD_REF]{bar2, Ldeprecation.Test;, I, bar2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck13() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " class Inner1 {}\n"+
- " /** @deprecated */\n"+
- " class Inner2 {}\n"+
- " void foo() {"+
- " Inn\n"+
- " }"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Inn";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Test.Inner1[TYPE_REF]{Inner1, deprecation, Ldeprecation.Test$Inner1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "Test.Inner2[TYPE_REF]{Inner2, deprecation, Ldeprecation.Test$Inner2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck14() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " class Inner1 {}\n"+
- " /** @deprecated */\n"+
- " class Inner2 {}\n"+
- " void foo() {"+
- " Inn\n"+
- " }"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Inn";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Test.Inner1[TYPE_REF]{Inner1, deprecation, Ldeprecation.Test$Inner1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "Test.Inner2[TYPE_REF]{Inner2, deprecation, Ldeprecation.Test$Inner2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck15() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " void foo() {"+
- " ZZZType1.foo\n"+
- " }"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "/** @deprecated */\n"+
- "public class ZZZType1 {\n"+
- " public static int foo1;\n"+
- " public static int foo2;\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZType1.foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck16() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "/** @deprecated */\n"+
- "public class ZZZType1 {\n"+
- "}"+
- "public class Test {\n"+
- " void foo() {"+
- " ZZZTy\n"+
- " }"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZTy";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZType1[TYPE_REF]{ZZZType1, deprecation, Ldeprecation.ZZZType1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127628
-public void testDeprecationCheck17() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " Bug127628Ty\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "Bug127628Ty";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "Bug127628Ty[POTENTIAL_METHOD_DECLARATION]{Bug127628Ty, Ldeprecation.Test;, ()V, Bug127628Ty, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "Bug127628Type1.Bug127628TypeInner1[TYPE_REF]{deprecation.Bug127628Type1.Bug127628TypeInner1, deprecation, Ldeprecation.Bug127628Type1$Bug127628TypeInner1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "Bug127628Type2.Bug127628TypeInner2[TYPE_REF]{deprecation.Bug127628Type2.Bug127628TypeInner2, deprecation, Ldeprecation.Bug127628Type2$Bug127628TypeInner2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "Bug127628Type1[TYPE_REF]{Bug127628Type1, deprecation, Ldeprecation.Bug127628Type1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck2() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " ZZZTy\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- "}");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType2.js",
- "package deprecation;"+
- "/** @deprecated */\n"+
- "public class ZZZType2 {\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZTy";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZTy[POTENTIAL_METHOD_DECLARATION]{ZZZTy, Ldeprecation.Test;, ()V, ZZZTy, null, " + (R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}\n" +
- "ZZZType1[TYPE_REF]{ZZZType1, deprecation, Ldeprecation.ZZZType1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck3() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " void foo() {"+
- " ZZZType1.fo\n"+
- " }"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- " public static void foo1(){}\n"+
- " /** @deprecated */\n"+
- " public static void foo2(){}\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZType1.fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo1[FUNCTION_REF]{foo1(), Ldeprecation.ZZZType1;, ()V, foo1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "foo2[FUNCTION_REF]{foo2(), Ldeprecation.ZZZType1;, ()V, foo2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck4() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " void foo() {"+
- " ZZZType1.fo\n"+
- " }"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- " public static void foo1(){}\n"+
- " /** @deprecated */\n"+
- " public static void foo2(){}\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZType1.fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo1[FUNCTION_REF]{foo1(), Ldeprecation.ZZZType1;, ()V, foo1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck5() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " ZZZType1.Inn\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- " public class Inner1 {}\n"+
- " /** @deprecated */\n"+
- " public class Inner2 {}\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZType1.Inn";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZType1.Inner1[TYPE_REF]{Inner1, deprecation, Ldeprecation.ZZZType1$Inner1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "ZZZType1.Inner2[TYPE_REF]{Inner2, deprecation, Ldeprecation.ZZZType1$Inner2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck6() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " ZZZType1.Inn\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- " public class Inner1 {}\n"+
- " /** @deprecated */\n"+
- " public class Inner2 {}\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZType1.Inn";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "ZZZType1.Inner1[TYPE_REF]{Inner1, deprecation, Ldeprecation.ZZZType1$Inner1;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck7() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " void foo() {"+
- " ZZZType1.fo\n"+
- " }"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- " public static int foo1;\n"+
- " /** @deprecated */\n"+
- " public static int foo2;\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZType1.fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo1[FIELD_REF]{foo1, Ldeprecation.ZZZType1;, I, foo1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "foo2[FIELD_REF]{foo2, Ldeprecation.ZZZType1;, I, foo2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck8() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " void foo() {"+
- " ZZZType1.fo\n"+
- " }"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/deprecation/ZZZType1.js",
- "package deprecation;"+
- "public class ZZZType1 {\n"+
- " public static int foo1;\n"+
- " /** @deprecated */\n"+
- " public static int foo2;\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "ZZZType1.fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo1[FIELD_REF]{foo1, Ldeprecation.ZZZType1;, I, foo1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=127296
-public void testDeprecationCheck9() throws JavaScriptModelException {
- Hashtable options = JavaScriptCore.getOptions();
- Object optionValue = options.get(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
-
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/deprecation/Test.js",
- "package deprecation;"+
- "public class Test {\n"+
- " public void bar1(){}\n"+
- " /** @deprecated */\n"+
- " public void bar2(){}\n"+
- " void foo() {"+
- " bar\n"+
- " }"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar1[FUNCTION_REF]{bar1(), Ldeprecation.Test;, ()V, bar1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "bar2[FUNCTION_REF]{bar2(), Ldeprecation.Test;, ()V, bar2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, optionValue);
- JavaScriptCore.setOptions(options);
- }
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858
-public void testDuplicateLocals1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " int x = 0;\n" +
- " TestString x = null;\n" +
- " x.bar;\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/TestString.js",
- "package test;"+
- "public class TestString {\n" +
- " public void bar() {\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar[FUNCTION_REF]{bar(), Ltest.TestString;, ()V, bar, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858
-public void testDuplicateLocals2() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " int x = 2;\n" +
- " try {\n" +
- " \n" +
- " } catch(TestException x) {\n" +
- " x.bar\n" +
- " } catch(Exception e) {\n" +
- " }\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/TestException.js",
- "package test;"+
- "public class TestException extends Exception {\n" +
- " public void bar() {\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar[FUNCTION_REF]{bar(), Ltest.TestException;, ()V, bar, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858
-public void testDuplicateLocals3() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " int x = x = 0;\n" +
- " if (true) {\n" +
- " TestString x = x.bar\n" +
- " }\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/TestString.js",
- "package test;"+
- "public class TestString {\n" +
- " public void bar() {\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar[FUNCTION_REF]{bar(), Ltest.TestString;, ()V, bar, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858
-public void testDuplicateLocals4() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " for (int i = 0; i < 10; i++) {\n" +
- " for (TestString i = null; i.bar < 5;) {\n" +
- " // do something\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/TestString.js",
- "package test;"+
- "public class TestString {\n" +
- " public void bar() {\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar[FUNCTION_REF]{bar(), Ltest.TestString;, ()V, bar, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=144858
-public void testDuplicateLocals5() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " public static void main(String[] args) {\n" +
- " for (int i = 0; i < 10; i++) {\n" +
- " for (TestString i = null; ;) {\n" +
- " i.bar // do something\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/TestString.js",
- "package test;"+
- "public class TestString {\n" +
- " public void bar() {\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar[FUNCTION_REF]{bar(), Ltest.TestString;, ()V, bar, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165662
-public void testDuplicateLocalsType1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " void foo() {}\n" +
- " }\n" +
- " {\n" +
- " class Local {\n" +
- " Local(int i) {\n" +
- " this.init(i);\n" +
- " }\n" +
- " void init(int i) {}\n" +
- " public void bar() {}\n" +
- " }\n" +
- " Local l = new Local(0);\n" +
- " l.bar\n" +
- " }\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "bar";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "bar[FUNCTION_REF]{bar(), LLocal;, ()V, bar, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165662
-public void testDuplicateLocalsType2() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " class Local {\n" +
- " Local(int i) {\n" +
- " this.init(i);\n" +
- " this.bar();\n" +
- " }\n" +
- " void init(int i) {}\n" +
- " void bar() {\n" +
- " }\n" +
- " }\n" +
- " Local l = new Local(0);\n" +
- " }\n" +
- " Local l = new Local();\n" +
- " l.foo\n" +
- " }\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[FUNCTION_REF]{foo(), LLocal;, ()V, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=139937
-public void testEvaluationContextCompletion() throws JavaScriptModelException {
- class EvaluationContextCompletionRequestor extends CompletionRequestor {
- public boolean acceptContext;
- public void accept(CompletionProposal proposal) {
- // Do nothing
- }
- public void acceptContext(CompletionContext context) {
- this.acceptContext = context != null;
- }
- }
- String start = "";
- IJavaScriptProject javaProject = getJavaProject("Completion");
- IEvaluationContext context = javaProject.newEvaluationContext();
- EvaluationContextCompletionRequestor rc = new EvaluationContextCompletionRequestor();
- context.codeComplete(start, start.length(), rc);
-
- assertTrue("acceptContext() method isn't call", rc.acceptContext);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140123
-public void testEvaluationContextCompletion2() throws JavaScriptModelException {
- class EvaluationContextCompletionRequestor extends CompletionRequestor {
- public boolean acceptContext;
- public boolean beginReporting;
- public boolean endReporting;
-
- public void accept(CompletionProposal proposal) {
- // Do nothing
- }
- public void acceptContext(CompletionContext context) {
- this.acceptContext = context != null;
- }
-
- public void beginReporting() {
- this.beginReporting = true;
- super.beginReporting();
- }
-
- public void endReporting() {
- this.endReporting = true;
- super.endReporting();
- }
- }
- String start = "";
- IJavaScriptProject javaProject = getJavaProject("Completion");
- IEvaluationContext context = javaProject.newEvaluationContext();
- EvaluationContextCompletionRequestor rc = new EvaluationContextCompletionRequestor();
- context.codeComplete(start, start.length(), rc);
-
- assertTrue("acceptContext() method isn't call", rc.acceptContext);
- assertTrue("beginReporting() method isn't call", rc.beginReporting);
- assertTrue("endReporting() method isn't call", rc.endReporting);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140123
-public void testEvaluationContextCompletion3() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/TestEvaluationContextCompletion3.js",
- "package test;"+
- "public class TestEvaluationContextCompletion3 {\n"+
- "}");
-
- String start = "TestEvaluationContextCompletion3";
- IJavaScriptProject javaProject = getJavaProject("Completion");
- IEvaluationContext context = javaProject.newEvaluationContext();
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false);
- context.codeComplete(start, start.length(), requestor, this.wcOwner);
-
- int startOffset = 0;
- int endOffset = start.length();
-
- assertResults(
- "completion offset="+endOffset+"\n"+
- "completion range=["+startOffset+", "+(endOffset-1)+"]\n"+
- "completion token=\"TestEvaluationContextCompletion3\"\n"+
- "completion token kind=TOKEN_KIND_NAME\n"+
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertResults(
- "TestEvaluationContextCompletion3[TYPE_REF]{test.TestEvaluationContextCompletion3, test, Ltest.TestEvaluationContextCompletion3;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=140123
-public void testEvaluationContextCompletion4() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/TestEvaluationContextCompletion4.js",
- "package test;"+
- "public class TestEvaluationContextCompletion4 {\n"+
- "}");
-
- String start = "TestEvaluationContextCompletion4";
- IJavaScriptProject javaProject = getJavaProject("Completion");
- IEvaluationContext context = javaProject.newEvaluationContext();
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false);
- requestor.setIgnored(CompletionProposal.TYPE_REF, true);
- context.codeComplete(start, start.length(), requestor, this.wcOwner);
-
- int startOffset = 0;
- int endOffset = start.length();
-
- assertResults(
- "completion offset="+endOffset+"\n"+
- "completion range=["+startOffset+", "+(endOffset-1)+"]\n"+
- "completion token=\"TestEvaluationContextCompletion4\"\n"+
- "completion token kind=TOKEN_KIND_NAME\n"+
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=141518
-public void testEvaluationContextCompletion5() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/TestEvaluationContextCompletion5.js",
- "package test;"+
- "public class TestEvaluationContextCompletion5 {\n"+
- "}");
-
- String start = "someVariable.to";
- IJavaScriptProject javaProject = getJavaProject("Completion");
- IEvaluationContext context = javaProject.newEvaluationContext();
-
- context.newVariable( "Object", "someVariable", null );
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false);
- context.codeComplete(start, start.length(), requestor, this.wcOwner);
-
- int startOffset = start.length() - 2;
- int endOffset = startOffset + 2 ;
-
- assertResults(
- "completion offset="+endOffset+"\n"+
- "completion range=["+startOffset+", "+(endOffset-1)+"]\n"+
- "completion token=\"to\"\n"+
- "completion token kind=TOKEN_KIND_NAME\n"+
- "expectedTypesSignatures=null\n"+
- "expectedTypesKeys=null",
- requestor.getContext());
-
- assertResults(
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports001() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo;\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FIELD_REF]{ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports002() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports003() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo;\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports004() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports005() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo;\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FIELD_REF]{ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports006() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports007() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "import test.p.ZZZ.*;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports009() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "import test.p.ZZZ.*;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports011() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "import test.p.ZZZ.foo;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports013() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "import test.p.ZZZ.foo;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports016() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public class foo {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class Test");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
- "Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports017() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void foo() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ltest.Test;, ()V, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports018() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public int foo;\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class Test");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
- "foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports019() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " int foo = 0;\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class Test");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
- "foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports020() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- " public static int foo(int i){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class Test");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, (I)I, foo, (i), ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports022() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo();\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo(";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports023() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "/** */\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo;\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("/** */");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FIELD_REF]{ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports024() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public int foo;\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports025() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public int foo;\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports026() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public int foo(){return 0;};\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports027() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public int foo(){return 0;};\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports028() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "import test.p.ZZZ;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){return 0;};\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports030() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_SUGGEST_STATIC_IMPORTS, JavaScriptCore.DISABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
-public void testFavoriteImports031() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_SUGGEST_STATIC_IMPORTS, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public void method() {\n" +
- " foo\n" +
- " }\n" +
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src3/test/p/ZZZ.js",
- "package test.p;\n" +
- "public class ZZZ {\n" +
- " public static int foo(){}\n" +
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
-
- String str = this.workingCopies[0].getSource();
- String completeBehind = "foo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("foo") + "".length();
- int end1 = start1 + "foo".length();
- int start2 = str.lastIndexOf("public class");
- int end2 = start2 + "".length();
- assertResults(
- "foo[FUNCTION_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
- " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-public void testInconsistentHierarchy1() throws CoreException, IOException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/p/Test.js",
- "package p;"+
- "public class Test extends Unknown {\n" +
- " void foo() {\n" +
- " this.has\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "this.has";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
-public void testLabel1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/label/Test.js",
- "package label;"+
- "public class Test {\n"+
- " void foo() {\n"+
- " label1 : for(;;) foo();\n"+
- " label2 : for(;;)\n"+
- " label3 : for(;;) {\n"+
- " label4 : for(;;) {\n"+
- " break lab\n"+
- " }\n"+
- " }\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "label2[LABEL_REF]{label2, null, null, label2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label3[LABEL_REF]{label3, null, null, label3, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label4[LABEL_REF]{label4, null, null, label4, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
-public void testLabel2() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/label/Test.js",
- "package label;"+
- "public class Test {\n"+
- " void foo() {\n"+
- " #\n"+
- " label1 : for(;;) foo();\n"+
- " label2 : for(;;)\n"+
- " label3 : for(;;) {\n"+
- " label4 : for(;;) {\n"+
- " break lab\n"+
- " }\n"+
- " }\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "label2[LABEL_REF]{label2, null, null, label2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label3[LABEL_REF]{label3, null, null, label3, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label4[LABEL_REF]{label4, null, null, label4, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
-public void testLabel3() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/label/Test.js",
- "package label;"+
- "public class Test {\n"+
- " void foo() {\n"+
- " label1 : for(;;) foo();\n"+
- " label2 : for(;;)\n"+
- " label3 : for(;;) {\n"+
- " label4 : for(;;) {\n"+
- " break lab\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "label2[LABEL_REF]{label2, null, null, label2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label3[LABEL_REF]{label3, null, null, label3, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label4[LABEL_REF]{label4, null, null, label4, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
-public void testLabel4() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/label/Test.js",
- "package label;"+
- "public class Test {\n"+
- " void foo() {\n"+
- " #\n"+
- " label1 : for(;;) foo();\n"+
- " label2 : for(;;)\n"+
- " label3 : for(;;) {\n"+
- " label4 : for(;;) {\n"+
- " break lab\n"+
- " }\n"+
- "}");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "label2[LABEL_REF]{label2, null, null, label2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label3[LABEL_REF]{label3, null, null, label3, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "label4[LABEL_REF]{label4, null, null, label4, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
-public void testLabel5() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/label/Test.js",
- "package label;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " #\n" +
- " label1 : for(;;) {\n" +
- " class X {\n" +
- " void foo() {\n" +
- " label2 : for(;;) foo();\n" +
- " }\n" +
- " }\n" +
- " continue lab\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "label1[LABEL_REF]{label1, null, null, label1, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
-public void testLabel6() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/label/Test.js",
- "package label;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " #\n" +
- " label1 : for(;;) {\n" +
- " class X {\n" +
- " void foo() {\n" +
- " label2 : for(;;) {\n" +
- " continue lab\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "lab";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "label2[LABEL_REF]{label2, null, null, label2, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-public void testParameterNames1() throws CoreException, IOException {
- Hashtable options = JavaScriptCore.getOptions();
- Object timeout = options.get(JavaScriptCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC);
- options.put(JavaScriptCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC,"2000"); //$NON-NLS-1$
-
- JavaScriptCore.setOptions(options);
-
- try {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/p/Test.js",
- "package p;"+
- "public class Test {\n" +
- " void foo(doctest.X x) {\n" +
- " x.fo\n" +
- " }\n" +
- "}\n");
-
- addLibrary(
- "Completion",
- "tmpDoc.jar",
- null,
- "tmpDocDoc.zip",
- false);
-
- CompletionTestsRequestor2 requestor;
- try {
- requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "x.fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ldoctest.X;, (Ljava.lang.Object;)V, foo, (param), " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- removeLibrary("Completion", "tmpDoc.jar");
- }
- } finally {
- options.put(JavaScriptCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, timeout);
- JavaScriptCore.setOptions(options);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
-public void testStaticMembers1() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " StaticMembers.\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/StaticMembers.js",
- "package test;"+
- "public class StaticMembers extends SuperStaticMembers {\n" +
- " public static int staticField;\n" +
- " public static int staticMethod() {}\n" +
- " public class Clazz {}\n" +
- " public static class StaticClazz {}\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/SuperStaticMembers.js",
- "package test;"+
- "public class SuperStaticMembers {\n" +
- " public static int superStaticField;\n" +
- " public static int supeStaticMethod() {}\n" +
- " public class SuperClazz {}\n" +
- " public static class SuperStaticClazz {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
- String str = this.workingCopies[0].getSource();
- String completeBehind = "StaticMembers.";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "supeStaticMethod[FUNCTION_REF]{supeStaticMethod(), Ltest.SuperStaticMembers;, ()I, supeStaticMethod, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "superStaticField[FIELD_REF]{superStaticField, Ltest.SuperStaticMembers;, I, superStaticField, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "StaticMembers.Clazz[TYPE_REF]{Clazz, test, Ltest.StaticMembers$Clazz;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "StaticMembers.StaticClazz[TYPE_REF]{StaticClazz, test, Ltest.StaticMembers$StaticClazz;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "class[FIELD_REF]{class, null, Ljava.lang.Class;, class, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "staticField[FIELD_REF]{staticField, Ltest.StaticMembers;, I, staticField, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "staticMethod[FUNCTION_REF]{staticMethod(), Ltest.StaticMembers;, ()I, staticMethod, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}\n" +
- "this[KEYWORD]{this, null, null, this, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
- requestor.getResults());
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java
deleted file mode 100644
index 73f8982..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java
+++ /dev/null
@@ -1,2416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import junit.framework.ComparisonFailure;
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IAccessRule;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-
-public class CompletionTests2 extends ModifyingResourceTests implements RelevanceConstants {
-
- public static final String DEFUALT_JSDTSCOPE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"con\" path=\"org.eclipse.wst.jsdt.launching.JRE_CONTAINER\"/>\n"+
- " <classpathentry kind=\"output\" path=\"\"/>\n"+
- "</classpath>";
- /*
- .project = DEFAULT_PROJECT_LEFT + project name + DEFAULT_PROJECT_RIGHT;
- */
- public static final String DEFAULT_PROJECT_LEFT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<projectDescription>\n" +
- " <name>";
-
-
- public static final String DEFAULT_PROJECT_RIGHT ="</name>\n" +
- " <comment></comment>\n" +
- " <projects>\n" +
- " </projects>\n"+
- " <buildSpec>\n"+
- " <buildCommand>\n"+
- " <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>\n"+
- " <arguments>\n"+
- " </arguments>\n"+
- " </buildCommand>\n"+
- " </buildSpec>\n"+
- " <natures>\n"+
- " <nature>org.eclipse.wst.jsdt.core.jsNature</nature>\n"+
- " </natures>\n" +
- "</projectDescription>";
-
-
-
-
-
- public static class CompletionContainerInitializer implements ContainerInitializer.ITestInitializer {
-
- public static class DefaultContainer implements IJsGlobalScopeContainer {
- char[][] libPaths;
- boolean[] areExported;
- String[] forbiddenReferences;
- public DefaultContainer(char[][] libPaths, boolean[] areExported, String[] forbiddenReferences) {
- this.libPaths = libPaths;
- this.areExported = areExported;
- this.forbiddenReferences = forbiddenReferences;
- }
- /**
- * @deprecated Use {@link #getIncludepathEntries()} instead
- */
- public IIncludePathEntry[] getClasspathEntries() {
- return getIncludepathEntries();
- }
- public IIncludePathEntry[] getIncludepathEntries() {
- int length = this.libPaths.length;
- IIncludePathEntry[] entries = new IIncludePathEntry[length];
- for (int j = 0; j < length; j++) {
- IPath path = new Path(new String(this.libPaths[j]));
- boolean isExported = this.areExported[j];
-
- IAccessRule[] accessRules;
- if(forbiddenReferences != null && forbiddenReferences[j]!= null && forbiddenReferences[j].length() != 0) {
- StringTokenizer tokenizer = new StringTokenizer(forbiddenReferences[j], ";");
- int count = tokenizer.countTokens();
- accessRules = new IAccessRule[count];
- String token = null;
- for (int i = 0; i < count; i++) {
- token = tokenizer.nextToken();
- accessRules[i] = JavaScriptCore.newAccessRule(new Path(token), IAccessRule.K_NON_ACCESSIBLE);
- }
- } else {
- accessRules = new IAccessRule[0];
- }
- if (path.segmentCount() == 1) {
- entries[j] = JavaScriptCore.newProjectEntry(path, accessRules, true, new IIncludePathAttribute[0], isExported);
- } else {
- entries[j] = JavaScriptCore.newLibraryEntry(path, null, null, accessRules, new IIncludePathAttribute[0], isExported);
- }
- }
- return entries;
- }
- public String getDescription() {
- return "Test container";
- }
- public int getKind() {
- return IJsGlobalScopeContainer.K_APPLICATION;
- }
- public IPath getPath() {
- return new Path("org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER");
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer#resolvedLibraryImport(java.lang.String)
- */
- public String[] resolvedLibraryImport(String a) {
- return new String[] {a};
- }
- }
-
- Map containerValues;
- CoreException exception;
-
- public CompletionContainerInitializer(String projectName, String[] libPaths, boolean[] areExported) {
- this(projectName, libPaths, areExported, null);
- }
- public CompletionContainerInitializer(String projectName, String[] libPaths, boolean[] areExported, String[] forbiddenRefrences) {
- containerValues = new HashMap();
-
- int libPathsLength = libPaths.length;
- char[][] charLibPaths = new char[libPathsLength][];
- for (int i = 0; i < libPathsLength; i++) {
- charLibPaths[i] = libPaths[i].toCharArray();
- }
- containerValues.put(
- projectName,
- newContainer(charLibPaths, areExported, forbiddenRefrences)
- );
- }
- protected DefaultContainer newContainer(final char[][] libPaths, final boolean[] areExperted, final String[] forbiddenRefrences) {
- return new DefaultContainer(libPaths, areExperted, forbiddenRefrences);
- }
- public boolean allowFailureContainer() {
- return true;
- }
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- if (containerValues == null) return;
- try {
- JavaScriptCore.setJsGlobalScopeContainer(
- containerPath,
- new IJavaScriptProject[] {project},
- new IJsGlobalScopeContainer[] {(IJsGlobalScopeContainer)containerValues.get(project.getElementName())},
- null);
- } catch (CoreException e) {
- this.exception = e;
- throw e;
- }
- }
- }
-public CompletionTests2(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- setUpJavaProject("Completion");
-}
-public void tearDownSuite() throws Exception {
- deleteProject("Completion");
-
- super.tearDownSuite();
-}
-
-protected static void assertResults(String expected, String actual) {
- try {
- assertEquals(expected, actual);
- } catch(ComparisonFailure c) {
- System.out.println(actual);
- System.out.println();
- throw c;
- }
-}
-static {
-// TESTS_NAMES = new String[] { "testBug96950" };
-}
-public static Test suite() {
- return buildModelTestSuite(CompletionTests2.class);
-}
-
-File createFile(File parent, String name, String content) throws IOException {
- File file = new File(parent, name);
- FileOutputStream out = new FileOutputStream(file);
- out.write(content.getBytes());
- out.close();
- return file;
-}
-File createDirectory(File parent, String name) {
- File dir = new File(parent, name);
- dir.mkdirs();
- return dir;
-}
-/**
- * Test for bug 29832
- */
-public void testBug29832() throws Exception {
- try {
- // create variable
-// JavaScriptCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- // IFile f = getFile("/Completion/lib.jar");
- IFile f = getFile("/Completion/ZZZ.js");
-
-
- IJavaScriptProject p = this.createJavaProject(
- "P1",
- new String[]{"/"},
- new String[]{});
- IFile libFile = this.createFile("/P1/ZZZ.js", f.getContents());
- this.addLibraryEntry(p, libFile.getLocation().toString(), true);
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"/"},
- new String[]{},
- new String[]{"/P1"});
- this.createFile(
- "/P2/X.js",
- "function testZZZClass {\n"+
- " var z = new ZZZ();\n"+
- " z;\n" +
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("P2", "", "", "X.js");
-
- String str = cu.getSource();
- String completeBehind = "z";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
-// assertEquals(
-// "element:ZZZ completion:pz.ZZZ relevance:"+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED),
-// requestor.getResults());
- assertEquals(
- "element:ZZZ completion:ZZZ relevance:" +(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_NON_RESTRICTED) + "\n"+
- "element:ZZZ completion:ZZZ() relevance:" + (R_DEFAULT+R_INTERESTING+R_UNQUALIFIED+R_NON_RESTRICTED) + "\n"+
- "element:ZZZ completion:ZZZ() relevance:" + (R_DEFAULT+R_INTERESTING+R_UNQUALIFIED+R_NON_RESTRICTED) + "\n"+
- "element:z completion:z relevance:"+ (R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_NAME+R_UNQUALIFIED+R_NON_RESTRICTED),
- requestor.getResults());
-
- // delete P1
- p.getProject().delete(true, false, null);
-
- // create P1
- File dest = getWorkspaceRoot().getLocation().toFile();
- File pro = this.createDirectory(dest, "P1");
- File proSet = this.createDirectory(pro,".settings");
-
- this.createFile(proSet, ".jsdtscope", DEFUALT_JSDTSCOPE);
-
-
-// "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-// "<classpath>\n" +
-// " <classpathentry kind=\"src\" path=\"\"/>\n" +
-// " <classpathentry kind=\"var\" path=\"JCL_LIB\" sourcepath=\"JCL_SRC\" rootpath=\"JCL_SRCROOT\"/>\n" +
-// " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
-// "</classpath>");
-
- this.createFile(pro, ".project", DEFAULT_PROJECT_LEFT + "org.eclipse.wst.jsdt.core" + DEFAULT_PROJECT_RIGHT);
-// "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-// "<projectDescription>\n" +
-// " <name>org.eclipse.wst.jsdt.core</name>\n" +
-// " <comment></comment>\n" +
-// " <projects>\n" +
-// " </projects>\n" +
-// " <buildSpec>\n" +
-// " <buildCommand>\n" +
-// " <name>org.eclipse.wst.jsdt.core.javabuilder</name>\n" +
-// " <arguments>\n" +
-// " </arguments>\n" +
-// " </buildCommand>\n" +
-// " </buildSpec>\n" +
-// " <natures>\n" +
-// " <nature>org.eclipse.wst.jsdt.core.javanature</nature>\n" +
-// " </natures>\n" +
-// "</projectDescription>");
-
- //File src = this.createDirectory(pro, "src");
-
- //File pz = this.createDirectory(src, "pz");
-
- this.createFile(pro,"ZZZ.js","function testZZZClass {\n"+
- " var z = new ZZZ();\n"+
- " z;\n" +
- "}");
-
- final IProject project = getWorkspaceRoot().getProject("P1");
- IWorkspaceRunnable populate = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- project.create(null);
- project.open(null);
- }
- };
- getWorkspace().run(populate, null);
- JavaScriptCore.create(project);
-
- waitUntilIndexesReady();
-
- // do completion
- requestor = new CompletionTestsRequestor();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:z completion:z relevance:"+ (R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME+R_UNQUALIFIED+R_NON_RESTRICTED) + "\n" +
- "element:z completion:z relevance:"+(R_DEFAULT+R_RESOLVED+R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
-}
-/**
- * Test for bug 33560
- */
-public void testBug33560() throws Exception {
- try {
- // create variable
-// JavaScriptCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- //IFile f = getFile("/Completion/lib.jar");
- IFile f = getFile("/Completion/ZZZ.js");
- IJavaScriptProject p = this.createJavaProject(
- "P1",
- new String[]{"/"},
- new String[]{});;
- IFile libFile = this.createFile("/P1/ZZZ.js", f.getContents());
- this.addLibraryEntry(p, libFile.getLocation().toString(), true);
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"/"},
- new String[]{},
- new String[]{"/P1"});
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"/"},
- new String[]{},
- new String[]{"/P1"});
- this.createFile(
- "/P3/X.js",
- "function testZZZClass {\n"+
- " var z = new ZZZ();\n"+
- " z;\n" +
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor requestor = new CompletionTestsRequestor();
- IJavaScriptUnit cu= getCompilationUnit("P3", "", "", "X.js");
-
- String str = cu.getSource();
- String completeBehind = "z";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
- assertEquals(
- "element:ZZZ completion:ZZZ relevance:" +(R_DEFAULT+R_RESOLVED+R_INTERESTING+R_NON_RESTRICTED ) + "\n"+
- "element:ZZZ completion:ZZZ() relevance:" + (R_DEFAULT+R_INTERESTING+R_UNQUALIFIED+R_NON_RESTRICTED) + "\n"+
- "element:ZZZ completion:ZZZ() relevance:" + (R_DEFAULT+R_INTERESTING+R_UNQUALIFIED+R_NON_RESTRICTED) + "\n"+
- "element:z completion:z relevance:"+ (R_DEFAULT+R_RESOLVED+R_INTERESTING+R_CASE+R_EXACT_NAME+R_UNQUALIFIED+R_NON_RESTRICTED),
- requestor.getResults());
-
-
- // delete P1
- p.getProject().delete(true, false, null);
-
- // create P1
- File dest = getWorkspaceRoot().getLocation().toFile();
- File pro = this.createDirectory(dest, "P1");
- File proSet = this.createDirectory(pro,".settings");
-
- this.createFile(proSet, ".jsdtscope", DEFUALT_JSDTSCOPE);
-// this.createFile(pro, ".classpath", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-// "<classpath>\n" +
-// " <classpathentry kind=\"src\" path=\"src\"/>\n" +
-// " <classpathentry kind=\"var\" path=\"JCL_LIB\" sourcepath=\"JCL_SRC\" rootpath=\"JCL_SRCROOT\"/>\n" +
-// " <classpathentry kind=\"output\" path=\"bin\"/>\n" +
-// "</classpath>");
- this.createFile(pro, ".project", DEFAULT_PROJECT_LEFT + "org.eclipse.wst.jsdt.core" + DEFAULT_PROJECT_RIGHT);
-// this.createFile(pro, ".project",
-// "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-// "<projectDescription>\n" +
-// " <name>org.eclipse.wst.jsdt.core</name>\n" +
-// " <comment></comment>\n" +
-// " <projects>\n" +
-// " </projects>\n" +
-// " <buildSpec>\n" +
-// " <buildCommand>\n" +
-// " <name>org.eclipse.wst.jsdt.core.javabuilder</name>\n" +
-// " <arguments>\n" +
-// " </arguments>\n" +
-// " </buildCommand>\n" +
-// " </buildSpec>\n" +
-// " <natures>\n" +
-// " <nature>org.eclipse.wst.jsdt.core.javanature</nature>\n" +
-// " </natures>\n" +
-// "</projectDescription>");
-//
- File src = this.createDirectory(pro, "src");
-
- File pz = this.createDirectory(src, "pz");
-
- this.createFile(pro,"ZZZ.js","function testZZZClass {\n"+
- " var z = new ZZZ();\n"+
- " z;\n" +
- "}");
-
- final IProject project = getWorkspaceRoot().getProject("P1");
- IWorkspaceRunnable populate = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- project.create(null);
- project.open(null);
- }
- };
- getWorkspace().run(populate, null);
- JavaScriptCore.create(project);
-
- waitUntilIndexesReady();
-
- // do completion
- requestor = new CompletionTestsRequestor();
- cu.codeComplete(cursorLocation, requestor);
-
- assertEquals(
- "element:z completion:z relevance:"+ (R_DEFAULT+R_INTERESTING+R_CASE+R_EXACT_NAME+R_UNQUALIFIED+R_NON_RESTRICTED) + "\n" +
- "element:z completion:z relevance:"+(R_DEFAULT+R_RESOLVED+R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED),
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- }
-}
-/*
- *
- * This tests a project which includes functions and methods marked as "not exported" from another project. This is N/A for JS.
- */
-
-//public void testBug79288() throws Exception {
-// try {
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// new String[]{"/P1"},
-// "bin");
-//
-// this.createFolder("/P2/src/b");
-// this.createFile(
-// "/P2/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// new String[]{"/P2"},
-// "bin");
-//
-// this.createFile(
-// "/P3/src/YY.js",
-// "public class YY {\n"+
-// " vois foo(){\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// }
-//}
-
-
-
-
-//public void testBug91772() throws Exception {
-// try {
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// // create P2
-// ContainerInitializer.setInitializer(new CompletionContainerInitializer("P2", new String[] {"/P1"}, new boolean[] {true}));
-// String[] classLib = new String[]{"JCL_LIB"};
-// int classLibLength = classLib.length;
-// String[] lib = new String[classLibLength + 1];
-// System.arraycopy(classLib, 0, lib, 0, classLibLength);
-// lib[classLibLength] = "org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER";
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// lib,
-// "bin");
-//
-// this.createFolder("/P2/src/b");
-// this.createFile(
-// "/P2/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// new String[]{"/P2"},
-// "bin");
-//
-// this.createFile(
-// "/P3/src/YY.js",
-// "public class YY {\n"+
-// " vois foo(){\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-//
-//
-// // TODO the following code is not the correct way to remove the container
-// // Cleanup caches
-// JavaModelManager manager = JavaModelManager.getJavaModelManager();
-// manager.containers = new HashMap(5);
-// manager.variables = new HashMap(5);
-// }
-//}
-//public void testBug93891() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// ContainerInitializer.setInitializer(new CompletionContainerInitializer("P2", new String[] {"/P1"}, new boolean[] {true}, new String[]{"a/*"}));
-// String[] classLib = new String[]{"JCL_LIB"};
-// int classLibLength = classLib.length;
-// String[] lib = new String[classLibLength + 1];
-// System.arraycopy(classLib, 0, lib, 0, classLibLength);
-// lib[classLibLength] = "org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER";
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// lib,
-// "bin");
-//
-// this.createFolder("/P2/src/b");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-//
-// // TODO the following code is not the correct way to remove the container
-// // Cleanup caches
-// JavaModelManager manager = JavaModelManager.getJavaModelManager();
-// manager.containers = new HashMap(5);
-// manager.variables = new HashMap(5);
-//
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction1() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.IGNORE);
-// options.put(JavaScriptCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaScriptCore.IGNORE);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// new String[]{"/P1"},
-// "bin");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//
-//public void testAccessRestriction2() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.IGNORE);
-// options.put(JavaScriptCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaScriptCore.IGNORE);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction3() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction4() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.IGNORE);
-// options.put(JavaScriptCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaScriptCore.IGNORE);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction5() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction6() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/c");
-// this.createFile(
-// "/P1/src/c/XX3.js",
-// "package c;\n"+
-// "public class XX3 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P2"},
-// new String[][]{{}},
-// new String[][]{{"b/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFile(
-// "/P3/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX3[TYPE_REF]{c.XX3, c, Lc.XX3;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction7() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1", "/P3"},
-// new String[][]{{}, {}},
-// new String[][]{{"a/*"}, {}},
-// new boolean[]{false, false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{}},
-// new boolean[]{true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction8() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P3", "/P1"},
-// new String[][]{{}, {}},
-// new String[][]{{}, {"a/*"}},
-// new boolean[]{false, false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{}},
-// new boolean[]{true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction9() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/p11");
-// this.createFile(
-// "/P1/src/p11/XX11.js",
-// "package p11;\n"+
-// "public class XX11 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/p12");
-// this.createFile(
-// "/P1/src/p12/XX12.js",
-// "package p12;\n"+
-// "public class XX12 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1", "/P3"},
-// new String[][]{{}, {}},
-// new String[][]{{"p11/*"}, {"p31/*"}},
-// new boolean[]{true, true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P2/src/p21");
-// this.createFile(
-// "/P2/src/p21/XX21.js",
-// "package p21;\n"+
-// "public class XX21 {\n"+
-// "}");
-//
-// this.createFolder("/P2/src/p22");
-// this.createFile(
-// "/P2/src/p22/XX22.js",
-// "package p22;\n"+
-// "public class XX22 {\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"p12/*"}},
-// new boolean[]{true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P3/src/p31");
-// this.createFile(
-// "/P3/src/p31/XX31.js",
-// "package p31;\n"+
-// "public class XX31 {\n"+
-// "}");
-//
-// this.createFolder("/P3/src/p32");
-// this.createFile(
-// "/P3/src/p32/XX32.js",
-// "package p32;\n"+
-// "public class XX32 {\n"+
-// "}");
-//
-// // create PX
-// this.createJavaProject(
-// "PX",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P2"},
-// null,
-// null,
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFile(
-// "/PX/src/X.js",
-// "public class X {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// this.deleteProject("PX");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction10() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/p11");
-// this.createFile(
-// "/P1/src/p11/XX11.js",
-// "package p11;\n"+
-// "public class XX11 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/p12");
-// this.createFile(
-// "/P1/src/p12/XX12.js",
-// "package p12;\n"+
-// "public class XX12 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1", "/P3"},
-// new String[][]{{}, {}},
-// new String[][]{{"p11/*"}, {"p31/*"}},
-// new boolean[]{true, true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P2/src/p21");
-// this.createFile(
-// "/P2/src/p21/XX21.js",
-// "package p21;\n"+
-// "public class XX21 {\n"+
-// "}");
-//
-// this.createFolder("/P2/src/p22");
-// this.createFile(
-// "/P2/src/p22/XX22.js",
-// "package p22;\n"+
-// "public class XX22 {\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"p12/*"}},
-// new boolean[]{true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P3/src/p31");
-// this.createFile(
-// "/P3/src/p31/XX31.js",
-// "package p31;\n"+
-// "public class XX31 {\n"+
-// "}");
-//
-// this.createFolder("/P3/src/p32");
-// this.createFile(
-// "/P3/src/p32/XX32.js",
-// "package p32;\n"+
-// "public class XX32 {\n"+
-// "}");
-//
-// // create PX
-// this.createJavaProject(
-// "PX",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P2"},
-// null,
-// null,
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFile(
-// "/PX/src/X.js",
-// "public class X {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX11[TYPE_REF]{p11.XX11, p11, Lp11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
-// "XX31[TYPE_REF]{p31.XX31, p31, Lp31.XX31;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
-// "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// this.deleteProject("PX");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction11() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/x/y/z/p11");
-// this.createFile(
-// "/P1/src/x/y/z/p11/XX11.js",
-// "package x.y.z.p11;\n"+
-// "public class XX11 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/x/y/z/p12");
-// this.createFile(
-// "/P1/src/x/y/z/p12/XX12.js",
-// "package x.y.z.p12;\n"+
-// "public class XX12 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P3", "/P1"},
-// new String[][]{{}, {}},
-// new String[][]{{"x/y/z/p31/*"}, {"x/y/z/p11/*"}},
-// new boolean[]{true, true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P2/src/x/y/z/p21");
-// this.createFile(
-// "/P2/src/x/y/z/p21/XX21.js",
-// "package x.y.z.p21;\n"+
-// "public class XX21 {\n"+
-// "}");
-//
-// this.createFolder("/P2/src/x/y/z/p22");
-// this.createFile(
-// "/P2/src/x/y/z/p22/XX22.js",
-// "package x.y.z.p22;\n"+
-// "public class XX22 {\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"x/y/z/p12/*"}},
-// new boolean[]{true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P3/src/x/y/z/p31");
-// this.createFile(
-// "/P3/src/x/y/z/p31/XX31.js",
-// "package x.y.z.p31;\n"+
-// "public class XX31 {\n"+
-// "}");
-//
-// this.createFolder("/P3/src/x/y/z/p32");
-// this.createFile(
-// "/P3/src/x/y/z/p32/XX32.js",
-// "package x.y.z.p32;\n"+
-// "public class XX32 {\n"+
-// "}");
-//
-// // create PX
-// this.createJavaProject(
-// "PX",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P2"},
-// null,
-// null,
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFile(
-// "/PX/src/X.js",
-// "public class X {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX11[TYPE_REF]{x.y.z.p11.XX11, x.y.z.p11, Lx.y.z.p11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX21[TYPE_REF]{x.y.z.p21.XX21, x.y.z.p21, Lx.y.z.p21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX22[TYPE_REF]{x.y.z.p22.XX22, x.y.z.p22, Lx.y.z.p22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX32[TYPE_REF]{x.y.z.p32.XX32, x.y.z.p32, Lx.y.z.p32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// this.deleteProject("PX");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction12() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/p11");
-// this.createFile(
-// "/P1/src/p11/XX11.js",
-// "package p11;\n"+
-// "public class XX11 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/p12");
-// this.createFile(
-// "/P1/src/p12/XX12.js",
-// "package p12;\n"+
-// "public class XX12 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P3", "/P1"},
-// new String[][]{{}, {}},
-// new String[][]{{"p31/*"}, {"p11/*"}},
-// new boolean[]{true, true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P2/src/p21");
-// this.createFile(
-// "/P2/src/p21/XX21.js",
-// "package p21;\n"+
-// "public class XX21 {\n"+
-// "}");
-//
-// this.createFolder("/P2/src/p22");
-// this.createFile(
-// "/P2/src/p22/XX22.js",
-// "package p22;\n"+
-// "public class XX22 {\n"+
-// "}");
-//
-// // create P3
-// this.createJavaProject(
-// "P3",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"p12/*"}},
-// new boolean[]{true},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFolder("/P3/src/p31");
-// this.createFile(
-// "/P3/src/p31/XX31.js",
-// "package p31;\n"+
-// "public class XX31 {\n"+
-// "}");
-//
-// this.createFolder("/P3/src/p32");
-// this.createFile(
-// "/P3/src/p32/XX32.js",
-// "package p32;\n"+
-// "public class XX32 {\n"+
-// "}");
-//
-// // create PX
-// this.createJavaProject(
-// "PX",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P2"},
-// null,
-// null,
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-//
-// this.createFile(
-// "/PX/src/X.js",
-// "public class X {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
-// "XX31[TYPE_REF]{p31.XX31, p31, Lp31.XX31;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
-// "XX11[TYPE_REF]{p11.XX11, p11, Lp11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
-// "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// this.deleteProject("P3");
-// this.deleteProject("PX");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction13() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.WARNING);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestriction14() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.WARNING);
-// options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.ENABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// "}");
-//
-// this.createFolder("/P1/src/b");
-// this.createFile(
-// "/P1/src/b/XX2.js",
-// "package b;\n"+
-// "public class XX2 {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " XX\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "XX";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testAccessRestrictionX() throws Exception {
-// Hashtable oldOptions = JavaScriptCore.getOptions();
-// try {
-// Hashtable options = new Hashtable(oldOptions);
-// options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
-// options.put(JavaScriptCore.CODEASSIST_RESTRICTIONS_CHECK, JavaScriptCore.DISABLED);
-// JavaScriptCore.setOptions(options);
-//
-// // create variable
-// JavaScriptCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-//
-// this.createFolder("/P1/src/a");
-// this.createFile(
-// "/P1/src/a/XX1.js",
-// "package a;\n"+
-// "public class XX1 {\n"+
-// " public void foo() {\n"+
-// " }\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"a/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/YY.js",
-// "public class YY {\n"+
-// " void foo() {\n"+
-// " a.XX1 x;\n"+
-// " x.fo\n"+
-// " }\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "x.fo";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "foo[FUNCTION_REF]{foo(), La.XX1;, ()V, foo, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// JavaScriptCore.setOptions(oldOptions);
-// }
-//}
-//public void testBug96950() throws Exception {
-// try {
-// // create variable
-//// JavaScriptCore.setClasspathVariables(
-//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-//// null);
-//
-// // create P1
-// this.createJavaProject(
-// "P1",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// "bin");
-// this.createFile(
-// "/P1/src/Taratata.js",
-// "public class Taratata {\n"+
-// "}");
-//
-// // create P2
-// this.createJavaProject(
-// "P2",
-// new String[]{"src"},
-// new String[]{"JCL_LIB"},
-// null,
-// null,
-// new String[]{"/P1"},
-// new String[][]{{}},
-// new String[][]{{"**/*"}},
-// new boolean[]{false},
-// "bin",
-// null,
-// null,
-// null,
-// "1.4");
-// this.createFile(
-// "/P2/src/BreakRules.js",
-// "public class BreakRules {\n"+
-// " Tara\n"+
-// "}");
-//
-// waitUntilIndexesReady();
-//
-// // do completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "BreakRules.js");
-//
-// String str = cu.getSource();
-// String completeBehind = "Tara";
-// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-// cu.codeComplete(cursorLocation, requestor);
-//
-// assertResults(
-// "Tara[POTENTIAL_METHOD_DECLARATION]{Tara, LBreakRules;, ()V, Tara, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
-// requestor.getResults());
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// }
-//}
-/**
- * @bug 162621: [model][delta] Validation errors do not clear after replacing jar file
- * @test Ensures that changing an internal jar and refreshing takes the change into account
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=162621"
- */
-//public void testChangeInternalJar() throws CoreException, IOException {
-//
-//
-// IJavaScriptProject p = this.createJavaProject(
-// "P1",
-// new String[]{"/"},
-// new String[]{},
-// "");
-//
-//
-//
-//
-// try {
-// // Create jar file with a class with 2 methods doXXX
-// String[] pathAndContents = new String[] {
-// "pack/Util.js",
-// "package pack;\n" +
-// "public class Util {\n" +
-// " public void doit2A(int x, int y) { }\n" +
-// " public void doit2B(int x) { }\n" +
-// "}\n"
-// };
-// addLibrary(jarName, "b162621_src.zip", pathAndContents, JavaScriptCore.VERSION_1_4);
-//
-// // Wait a little bit to be sure file system is aware of zip file creation
-// try {
-// Thread.sleep(1000);
-// }
-// catch (InterruptedException ie) {
-// // skip
-// }
-//
-// // Create compilation unit in which completion occurs
-// String path = "/Completion/src/test/Test.js";
-// String source = "package test;\n" +
-// "import pack.*;\n" +
-// "public class Test {\n" +
-// " public void foo() {\n" +
-// " Util test = new Util();\n" +
-// " test.doit2A(1, 2);\n" +
-// " }\n" +
-// "}\n";
-// createFolder("/Completion/src/test");
-// createFile(path, source);
-//
-// // first completion
-// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
-// IJavaScriptUnit unit = getCompilationUnit(path);
-// String completeBehind = "test.do";
-// int cursorLocation = source.lastIndexOf(completeBehind) + completeBehind.length();
-// unit.codeComplete(cursorLocation, requestor);
-// assertResults(
-// "doit2A[FUNCTION_REF]{doit2A, Lpack.Util;, (II)V, doit2A, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
-// "doit2B[FUNCTION_REF]{doit2B, Lpack.Util;, (I)V, doit2B, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}",
-// requestor.getResults());
-//
-// // change class file to add a third doXXX method and refresh
-// String projectLocation = this.currentProject.getProject().getLocation().toOSString();
-// String jarPath = projectLocation + File.separator + jarName;
-// org.eclipse.wst.jsdt.core.tests.util.Util.createJar(new String[] {
-// "pack/Util.js",
-// "package pack;\n" +
-// "public class Util {\n" +
-// " public void doit2A(int x, int y) { }\n" +
-// " public void doit2B(int x) { }\n" +
-// " public void doit2C(int x) { }\n" +
-// "}\n"
-// }, jarPath, "1.4");
-// this.currentProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
-//
-// try {
-// Thread.sleep(1000);
-// }
-// catch (InterruptedException ie) {
-// // skip
-// }
-//
-// // second completion
-// requestor = new CompletionTestsRequestor2();
-// unit.codeComplete(cursorLocation, requestor);
-// assertResults(
-// "doit2A[FUNCTION_REF]{doit2A, Lpack.Util;, (II)V, doit2A, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
-// "doit2B[FUNCTION_REF]{doit2B, Lpack.Util;, (I)V, doit2B, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
-// "doit2C[FUNCTION_REF]{doit2C, Lpack.Util;, (I)V, doit2C, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}",
-// requestor.getResults());
-// } finally {
-// removeLibraryEntry(this.currentProject, new Path(jarName));
-// deleteFile(new File(jarName));
-// }
-//}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTestsRequestor.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTestsRequestor.java
deleted file mode 100644
index 17ec125..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTestsRequestor.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Vector;
-
-import org.eclipse.wst.jsdt.core.CompletionProposal;
-import org.eclipse.wst.jsdt.core.CompletionRequestor;
-import org.eclipse.wst.jsdt.core.Signature;
-
-public class CompletionTestsRequestor extends CompletionRequestor {
- private Vector fElements = new Vector();
- private Vector fCompletions = new Vector();
- private Vector fRelevances = new Vector();
- private Vector fCompletionStart = new Vector();
- private Vector fCompletionEnd = new Vector();
-
- public boolean fDebug = false;
-
- private void acceptCommon(CompletionProposal proposal) {
- fCompletions.addElement(new String(proposal.getCompletion()));
- fRelevances.addElement(String.valueOf(proposal.getRelevance()));
- fCompletionStart.addElement(String.valueOf(proposal.getReplaceStart()));
- fCompletionEnd.addElement(String.valueOf(proposal.getReplaceEnd()));
- }
- public void accept(CompletionProposal proposal) {
- char[] typeName = null;
- switch(proposal.getKind()) {
- case CompletionProposal.ANONYMOUS_CLASS_DECLARATION :
- typeName = Signature.getSignatureSimpleName(proposal.getDeclarationSignature());
- fElements.addElement(new String(typeName));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("anonymous type " + new String(typeName));
- break;
-
- case CompletionProposal.TYPE_REF :
- typeName = Signature.getSignatureSimpleName(proposal.getSignature());
- fElements.addElement(new String(typeName));
- this.acceptCommon(proposal);
- if (fDebug) {
- System.out.println("Class " + new String(typeName));
- }
- break;
-
- case CompletionProposal.FIELD_REF :
- fElements.addElement(new String(proposal.getName()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("Field " + new String(proposal.getName()));
- break;
-
- case CompletionProposal.KEYWORD:
- fElements.addElement(new String(proposal.getName()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("Keyword " + new String(proposal.getName()));
- break;
-
- case CompletionProposal.LABEL_REF:
- fElements.addElement(new String(proposal.getName()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("Label " + new String(proposal.getName()));
- break;
-
- case CompletionProposal.LOCAL_VARIABLE_REF:
- fElements.addElement(new String(proposal.getName()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("Local variable " + new String(proposal.getName()));
- break;
-
- case CompletionProposal.METHOD_REF:
- fElements.addElement(new String(proposal.getName()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("method " + new String(proposal.getName()));
- break;
-
- case CompletionProposal.METHOD_DECLARATION:
- fElements.addElement(new String(proposal.getName()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("method declaration " + new String(proposal.getName()));
- break;
-
- case CompletionProposal.PACKAGE_REF:
- fElements.addElement(new String(proposal.getDeclarationSignature()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("package " + new String(proposal.getDeclarationSignature()));
- break;
-
- case CompletionProposal.VARIABLE_DECLARATION:
- fElements.addElement(new String(proposal.getName()));
- this.acceptCommon(proposal);
- if (fDebug)
- System.out.println("variable name " + new String(proposal.getName()));
- break;
- }
-
- }
-
- public String getResults() {
- return getResults(true, false);
- }
-
- public String getResultsWithPosition(){
- return getResults(true, true);
- }
-
- public String getResults(boolean relevance, boolean position) {
- StringBuffer result = new StringBuffer();
- int size = fElements.size();
-
- if (size == 1) {
- result.append(getResult(0, relevance, position));
- } else if (size > 1) {
- String[] sortedBucket = new String[size];
- for (int i = 0; i < size; i++) {
- sortedBucket[i] = getResult(i, relevance, position);
- }
- quickSort(sortedBucket, 0, size - 1);
- for (int j = 0; j < sortedBucket.length; j++) {
- if (result.length() > 0) result.append("\n");
- result.append(sortedBucket[j]);
- }
- }
-
- return result.toString();
- }
-
- private String getResult(int i, boolean relevance, boolean position) {
- if(i < 0 || i >= fElements.size())
- return "";
-
- StringBuffer buffer = new StringBuffer();
- buffer.append("element:");
- buffer.append(fElements.elementAt(i));
- buffer.append(" completion:");
- buffer.append(fCompletions.elementAt(i));
- if(position) {
- buffer.append(" position:[");
- buffer.append(fCompletionStart.elementAt(i));
- buffer.append(",");
- buffer.append(fCompletionEnd.elementAt(i));
- buffer.append("]");
- }
- if(relevance) {
- buffer.append(" relevance:");
- buffer.append(fRelevances.elementAt(i));
- }
- return buffer.toString();
- }
-
- protected String[] quickSort(String[] collection, int left, int right) {
- int original_left = left;
- int original_right = right;
- String mid = collection[ (left + right) / 2];
- do {
- while (mid.compareTo(collection[left]) > 0)
- // s[left] >= mid
- left++;
- while (mid.compareTo(collection[right]) < 0)
- // s[right] <= mid
- right--;
- if (left <= right) {
- String tmp = collection[left];
- collection[left] = collection[right];
- collection[right] = tmp;
- left++;
- right--;
- }
- } while (left <= right);
- if (original_left < right)
- collection = quickSort(collection, original_left, right);
- if (left < original_right)
- collection = quickSort(collection, left, original_right);
- return collection;
- }
- public String toString() {
- return getResults();
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTestsRequestor2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTestsRequestor2.java
deleted file mode 100644
index 158c21d..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTestsRequestor2.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.eclipse.wst.jsdt.core.CompletionContext;
-import org.eclipse.wst.jsdt.core.CompletionProposal;
-import org.eclipse.wst.jsdt.core.CompletionRequestor;
-import org.eclipse.wst.jsdt.core.Signature;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-
-public class CompletionTestsRequestor2 extends CompletionRequestor {
- private final char[] NULL_LITERAL = "null".toCharArray();//$NON-NLS-1$
-
- private CompletionContext context;
- public int proposalsPtr = -1;
- private final static int PROPOSALS_INCREMENT = 10;
- private CompletionProposal[] proposals = new CompletionProposal[PROPOSALS_INCREMENT];
- private IProblem problem;
-
- private boolean showParameterNames;
- private boolean showUniqueKeys;
- private boolean showPositions;
- private boolean shortContext;
- private boolean showMissingTypes;
-
- public boolean fDebug = false;
-
- public CompletionTestsRequestor2() {
- this(false, false);
- }
- public CompletionTestsRequestor2(boolean showParamNames) {
- this(showParamNames, false, false);
- }
- public CompletionTestsRequestor2(boolean showParamNames, boolean showUniqueKeys) {
- this(showParamNames, showUniqueKeys, false);
- }
- public CompletionTestsRequestor2(boolean showParamNames, boolean showUniqueKeys, boolean showPositions) {
- this(showParamNames, showUniqueKeys, showPositions, true, false);
- }
-
- public CompletionTestsRequestor2(boolean showParamNames, boolean showUniqueKeys, boolean showPositions, boolean shortContext) {
- this(showParamNames, showUniqueKeys, showPositions, shortContext, false);
- }
- public CompletionTestsRequestor2(boolean showParamNames, boolean showUniqueKeys, boolean showPositions, boolean shortContext, boolean showMissingTypes) {
- this.showParameterNames = showParamNames;
- this.showUniqueKeys = showUniqueKeys;
- this.showPositions = showPositions;
- this.shortContext = shortContext;
- this.showMissingTypes = showMissingTypes;
- }
- public void acceptContext(CompletionContext cc) {
- this.context = cc;
- }
- public void accept(CompletionProposal proposal) {
- int length = this.proposals.length;
- if (++this.proposalsPtr== length) {
- System.arraycopy(this.proposals, 0, this.proposals = new CompletionProposal[length+PROPOSALS_INCREMENT], 0, length);
- }
- this.proposals[this.proposalsPtr] = proposal;
- }
-
- public void allowAllRequiredProposals() {
- for (int i = CompletionProposal.ANONYMOUS_CLASS_DECLARATION; i <= CompletionProposal.TYPE_IMPORT; i++) {
- for (int j = CompletionProposal.ANONYMOUS_CLASS_DECLARATION; j <= CompletionProposal.TYPE_IMPORT; j++) {
- this.setAllowsRequiredProposals(i, j, true);
- }
- }
- }
-
- public void completionFailure(IProblem p) {
- this.problem = p;
- }
-
- public String getContext() {
- if(this.context == null) return "";
-
- StringBuffer buffer = new StringBuffer();
-
- if(!this.shortContext) {
- buffer.append("completion offset=");
- buffer.append(context.getOffset());
- buffer.append('\n');
-
- buffer.append("completion range=[");
- buffer.append(context.getTokenStart());
- buffer.append(", ");
- buffer.append(context.getTokenEnd());
- buffer.append("]\n");
-
- char[] token = context.getToken();
- buffer.append("completion token=");
- if(token == null) {
- buffer.append("null");
- } else {
- buffer.append('\"');
- buffer.append(token);
- buffer.append('\"');
- }
- buffer.append('\n');
-
- buffer.append("completion token kind=");
- int tokenKind = context.getTokenKind();
- if(tokenKind == CompletionContext.TOKEN_KIND_STRING_LITERAL) {
- buffer.append("TOKEN_KIND_STRING_LITERAL");
- } else if(tokenKind == CompletionContext.TOKEN_KIND_NAME) {
- buffer.append("TOKEN_KIND_NAME");
- } else {
- buffer.append("TOKEN_KIND_UNKNOWN");
- }
- buffer.append('\n');
- }
- char[][] expectedTypesSignatures = this.context.getExpectedTypesSignatures();
- buffer.append("expectedTypesSignatures=");
- if(expectedTypesSignatures == null) {
- buffer.append(NULL_LITERAL);
- } else {
- buffer.append('{');
- for (int i = 0; i < expectedTypesSignatures.length; i++) {
- if(i > 0) buffer.append(',');
- buffer.append(expectedTypesSignatures[i]);
-
- }
- buffer.append('}');
- }
- buffer.append('\n');
-
- char[][] expectedTypesKeys = this.context.getExpectedTypesKeys();
- buffer.append("expectedTypesKeys=");
- if(expectedTypesSignatures == null) {
- buffer.append(NULL_LITERAL);
- } else {
- buffer.append('{');
- for (int i = 0; i < expectedTypesKeys.length; i++) {
- if(i > 0) buffer.append(',');
- buffer.append(expectedTypesKeys[i]);
-
- }
- buffer.append('}');
- }
- //buffer.append('\n');
-
-
- return buffer.toString();
- }
- public String getProblem() {
- return this.problem == null ? "" : this.problem.getMessage();
- }
-
- /*
- * Get sorted results in ascending order
- */
- public String getResults() {
- if(this.proposalsPtr < 0) return "";
- quickSort(this.proposals, 0, this.proposalsPtr);
- return getResultsWithoutSorting();
- }
-
- /*
- * Get sorted results in ascending order
- */
- public String getReversedResults() {
- if(this.proposalsPtr < 0) return "";
- Arrays.sort(this.proposals, new Comparator() {
- public int compare(Object o1, Object o2) {
- if (o1 instanceof CompletionProposal && o2 instanceof CompletionProposal) {
- CompletionProposal p1 = (CompletionProposal) o1;
- CompletionProposal p2 = (CompletionProposal) o2;
- int relDif = p2.getRelevance() - p1.getRelevance();
- if(relDif != 0) return relDif;
- String name1 = getElementName(p1);
- String name2 = getElementName(p2);
- return name1.compareTo(name2);
- }
- return -1;
- }
- });
- return getResultsWithoutSorting();
- }
-
- /*
- * Get unsorted results (ie. same order as they were accepted by requestor)
- */
- public String getResultsWithoutSorting() {
- if(this.proposalsPtr < 0) return "";
- StringBuffer buffer = printProposal(this.proposals[0]);
- for(int i = 1; i <=this.proposalsPtr; i++) {
- if(i > 0) buffer.append('\n');
- buffer.append(printProposal(this.proposals[i]));
- }
- return buffer.toString();
- }
- public String[] getStringsResult() {
- if(this.proposalsPtr < 0) {
- return new String[0];
- }
- String[] strings = new String[this.proposalsPtr+1];
- for (int i=0; i<=this.proposalsPtr; i++) {
- strings[i] = printProposal(this.proposals[i]).toString();
- }
- return strings;
- }
-
- protected StringBuffer printProposal(CompletionProposal proposal) {
- StringBuffer buffer = new StringBuffer();
- return printProposal(proposal, 0, buffer);
- }
-
- protected StringBuffer printProposal(CompletionProposal proposal, int tab, StringBuffer buffer) {
- for (int i = 0; i < tab; i++) {
- buffer.append(" "); //$NON-NLS-1$
- }
- buffer.append(getElementName(proposal));
- buffer.append('[');
- switch(proposal.getKind()) {
- case CompletionProposal.ANONYMOUS_CLASS_DECLARATION :
- buffer.append("ANONYMOUS_CLASS_DECLARATION"); //$NON-NLS-1$
- break;
- case CompletionProposal.FIELD_REF :
- buffer.append("FIELD_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.KEYWORD :
- buffer.append("KEYWORD"); //$NON-NLS-1$
- break;
- case CompletionProposal.LABEL_REF :
- buffer.append("LABEL_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.LOCAL_VARIABLE_REF :
- buffer.append("LOCAL_VARIABLE_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.METHOD_DECLARATION :
- buffer.append("FUNCTION_DECLARATION"); //$NON-NLS-1$
- if(proposal.isConstructor()) {
- buffer.append("<CONSTRUCTOR>"); //$NON-NLS-1$
- }
- break;
- case CompletionProposal.METHOD_REF :
- buffer.append("FUNCTION_REF"); //$NON-NLS-1$
- if(proposal.isConstructor()) {
- buffer.append("<CONSTRUCTOR>"); //$NON-NLS-1$
- }
- break;
- case CompletionProposal.PACKAGE_REF :
- buffer.append("PACKAGE_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.TYPE_REF :
- buffer.append("TYPE_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.VARIABLE_DECLARATION :
- buffer.append("VARIABLE_DECLARATION"); //$NON-NLS-1$
- break;
- case CompletionProposal.POTENTIAL_METHOD_DECLARATION :
- buffer.append("POTENTIAL_METHOD_DECLARATION"); //$NON-NLS-1$
- break;
- case CompletionProposal.METHOD_NAME_REFERENCE :
- buffer.append("METHOD_IMPORT"); //$NON-NLS-1$
- break;
- case CompletionProposal.JSDOC_BLOCK_TAG :
- buffer.append("JSDOC_BLOCK_TAG"); //$NON-NLS-1$
- break;
- case CompletionProposal.JSDOC_INLINE_TAG :
- buffer.append("JSDOC_INLINE_TAG"); //$NON-NLS-1$
- break;
- case CompletionProposal.JSDOC_FIELD_REF:
- buffer.append("JSDOC_FIELD_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.JSDOC_METHOD_REF :
- buffer.append("JSDOC_METHOD_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.JSDOC_TYPE_REF :
- buffer.append("JSDOC_TYPE_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.JSDOC_PARAM_REF :
- buffer.append("JSDOC_PARAM_REF"); //$NON-NLS-1$
- break;
- case CompletionProposal.FIELD_IMPORT :
- buffer.append("FIELD_IMPORT"); //$NON-NLS-1$
- break;
- case CompletionProposal.METHOD_IMPORT :
- buffer.append("METHOD_IMPORT"); //$NON-NLS-1$
- break;
- case CompletionProposal.TYPE_IMPORT :
- buffer.append("TYPE_IMPORT"); //$NON-NLS-1$
- break;
- default :
- buffer.append("PROPOSAL"); //$NON-NLS-1$
- break;
-
- }
- buffer.append("]{");
- buffer.append(proposal.getCompletion() == null ? NULL_LITERAL : proposal.getCompletion());
- buffer.append(", ");
- buffer.append(proposal.getDeclarationSignature() == null ? NULL_LITERAL : proposal.getDeclarationSignature());
- buffer.append(", ");
- buffer.append(proposal.getSignature() == null ? NULL_LITERAL : proposal.getSignature());
- if(this.showUniqueKeys) {
- buffer.append(", ");
- buffer.append(proposal.getDeclarationKey() == null ? NULL_LITERAL : proposal.getDeclarationKey());
- buffer.append(", ");
- buffer.append(proposal.getKey() == null ? NULL_LITERAL : proposal.getKey());
- }
- buffer.append(", ");
- buffer.append(proposal.getName() == null ? NULL_LITERAL : proposal.getName());
- if(this.showParameterNames) {
- char[][] parameterNames = proposal.findParameterNames(null);
- buffer.append(", ");
- if(parameterNames == null || parameterNames.length <= 0) {
- buffer.append(NULL_LITERAL);
- } else {
- buffer.append("(");
- for (int i = 0; i < parameterNames.length; i++) {
- if(i > 0) buffer.append(", ");
- buffer.append(parameterNames[i]);
- }
- buffer.append(")");
- }
- }
- if(this.showPositions) {
- buffer.append(", [");
- buffer.append(proposal.getReplaceStart());
- buffer.append(", ");
- buffer.append(proposal.getReplaceEnd());
- buffer.append("]");
- }
- buffer.append(", ");
- buffer.append(proposal.getRelevance());
- buffer.append('}');
- if(this.showMissingTypes) {
- CompletionProposal[] requiredProposals = proposal.getRequiredProposals();
- if (requiredProposals != null) {
- int length = requiredProposals.length;
- System.arraycopy(requiredProposals, 0, requiredProposals = new CompletionProposal[length], 0, length);
- quickSort(requiredProposals, 0, length - 1);
- for (int i = 0; i < length; i++) {
- buffer.append('\n');
- printProposal(requiredProposals[i], tab + 1, buffer);
- }
- }
- }
- return buffer;
- }
-
- protected CompletionProposal[] quickSort(CompletionProposal[] collection, int left, int right) {
- int original_left = left;
- int original_right = right;
- CompletionProposal mid = collection[ (left + right) / 2];
- do {
- while (compare(mid, collection[left]) > 0)
- // s[left] >= mid
- left++;
- while (compare(mid, collection[right]) < 0)
- // s[right] <= mid
- right--;
- if (left <= right) {
- CompletionProposal tmp = collection[left];
- collection[left] = collection[right];
- collection[right] = tmp;
- left++;
- right--;
- }
- } while (left <= right);
- if (original_left < right)
- collection = quickSort(collection, original_left, right);
- if (left < original_right)
- collection = quickSort(collection, left, original_right);
- return collection;
- }
-
- protected int compare(CompletionProposal proposal1, CompletionProposal proposal2) {
- int relDif = proposal1.getRelevance() - proposal2.getRelevance();
- if(relDif != 0) return relDif;
- String name1 = getElementName(proposal1);
- String name2 = getElementName(proposal2);
- int nameDif = name1.compareTo(name2);
- if(nameDif != 0) return nameDif;
- int kindDif = proposal1.getKind() - proposal2.getKind();
- if(kindDif != 0) return kindDif;
- String completion1 = new String(proposal1.getCompletion());
- String completion2 = new String(proposal2.getCompletion());
- int completionDif = completion1.compareTo(completion2);
- if(completionDif != 0) return completionDif;
- char[] temp = proposal1.getSignature();
- String signature1 = temp == null ? null: new String(temp);
- temp = proposal2.getSignature();
- String signature2 = temp == null ? null: new String(temp);
- int signatureDif = 0;
- if(signature1 != null && signature2 != null) {
- signatureDif = signature1.compareTo(signature2);
- }
- if(signatureDif != 0) return signatureDif;
- temp = proposal1.getDeclarationSignature();
- String declarationSignature1 = temp == null ? null: new String(temp);
- temp = proposal2.getDeclarationSignature();
- String declarationSignature2 = temp == null ? null: new String(temp);
- int declarationSignatureDif = 0;
- if(declarationSignature1 != null && declarationSignature2 != null) {
- declarationSignatureDif = declarationSignature1.compareTo(declarationSignature2);
- }
- if(declarationSignatureDif != 0) return declarationSignatureDif;
- return 0;
- }
-
- protected String getElementName(CompletionProposal proposal) {
- switch(proposal.getKind()) {
- case CompletionProposal.ANONYMOUS_CLASS_DECLARATION :
- return new String(Signature.getSignatureSimpleName(proposal.getDeclarationSignature()));
- case CompletionProposal.TYPE_REF :
- case CompletionProposal.TYPE_IMPORT :
- case CompletionProposal.JSDOC_TYPE_REF :
- return new String(Signature.getSignatureSimpleName(proposal.getSignature()));
- case CompletionProposal.FIELD_REF :
- case CompletionProposal.KEYWORD:
- case CompletionProposal.LABEL_REF:
- case CompletionProposal.LOCAL_VARIABLE_REF:
- case CompletionProposal.METHOD_REF:
- case CompletionProposal.METHOD_DECLARATION:
- case CompletionProposal.VARIABLE_DECLARATION:
- case CompletionProposal.POTENTIAL_METHOD_DECLARATION:
- case CompletionProposal.METHOD_NAME_REFERENCE:
- case CompletionProposal.JSDOC_BLOCK_TAG :
- case CompletionProposal.JSDOC_INLINE_TAG :
- case CompletionProposal.JSDOC_FIELD_REF:
- case CompletionProposal.JSDOC_METHOD_REF :
- case CompletionProposal.JSDOC_PARAM_REF :
- case CompletionProposal.FIELD_IMPORT :
- case CompletionProposal.METHOD_IMPORT :
- return new String(proposal.getName());
- case CompletionProposal.PACKAGE_REF:
- return new String(proposal.getDeclarationSignature());
- }
- return "";
- }
- public String toString() {
- return getResults();
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests.java
deleted file mode 100644
index 28c5df6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests.java
+++ /dev/null
@@ -1,1415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-
-import junit.framework.*;
-
-public class CompletionWithMissingTypesTests extends AbstractJavaModelCompletionTests implements RelevanceConstants {
-
-public CompletionWithMissingTypesTests(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- if (COMPLETION_PROJECT == null) {
- COMPLETION_PROJECT = setUpJavaProject("Completion");
- } else {
- setUpProjectCompliance(COMPLETION_PROJECT, "1.4");
- }
- super.setUpSuite();
-}
-public void tearDownSuite() throws Exception {
- super.tearDownSuite();
-}
-static {
-// TESTS_NAMES = new String[] { "testZZZ"};
-}
-public static Test suite() {
- return buildModelTestSuite(CompletionWithMissingTypesTests.class);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0001() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0002() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public int bar;\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FIELD_REF]{bar, Lmissing.MissingType;, I, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0003() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType extends SuperType {\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/SuperType.js",
- "package missing;"+
- "public class SuperType {\n" +
- " public int bar;\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FIELD_REF]{bar, Lmissing.SuperType;, I, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0004() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType[] m = null;\n" +
- " m.\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {};\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int relevance2 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.") + "m.".length();
- int end1 = start1;
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "length[FIELD_REF]{length, [Lmissing.MissingType;, I, length, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- "clone[FUNCTION_REF]{clone(), [Lmissing.MissingType;, ()Ljava.lang.Object;, clone, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "equals[FUNCTION_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (J)V, wait, (millis), ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0005() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m;\n" +
- " void foo() {\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0006() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m;\n" +
- " public class Test1 {\n" +
- " void foo() {\n" +
- " m.b\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0007() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m;\n" +
- " public class Test1 extends test.SuperType {\n" +
- " void foo() {\n" +
- " m.e\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/SuperType.js",
- "package test;"+
- "public class SuperType {\n" +
- " public Object m;\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.e";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("m.e") + "m.".length();
- int end1 = start1 + "e".length();
- assertResults(
- "equals[FUNCTION_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), ["+start1+", "+end1+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0008() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m;\n" +
- " public class Test1 extends test.SuperType {\n" +
- " void foo() {\n" +
- " m.b\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/SuperType.js",
- "package test;"+
- "public class SuperType {\n" +
- " public Object m;\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0009() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/missing2/MissingType.js",
- "package missing2;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing2.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing2.MissingType, missing2, Lmissing2.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0010() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingMemberType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingMemberType");
- int end2 = start2 + "MissingMemberType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType$MissingMemberType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType.MissingMemberType[TYPE_REF]{missing.MissingType.MissingMemberType, missing, Lmissing.MissingType$MissingMemberType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0011() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m() {return null;}\n" +
- " void foo() {\n" +
- " m().b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m().b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m().b") + "m().".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0012() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m(int i) {return null;}\n" +
- " void foo() {\n" +
- " m(0).b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = ".b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m(0).b") + "m(0).".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0013() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m() {return null;}\n" +
- " public class Inner extends missing.SuperType{\n" +
- " void foo() {\n" +
- " m().e\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/SuperType.js",
- "package missing;"+
- "public class SuperType {\n" +
- " public Object m() {return null;}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m().e";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED;
- int start1 = str.lastIndexOf("m().e") + "m().".length();
- int end1 = start1 + "e".length();
- assertResults(
- "equals[FUNCTION_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), ["+start1+", "+end1+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0014() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m() {return null;}\n" +
- " public class Inner extends missing.SuperType{\n" +
- " void foo() {\n" +
- " m().b\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/SuperType.js",
- "package missing;"+
- "public class SuperType {\n" +
- " public Object m() {return null;}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m().b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0015() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m() {return null;}\n" +
- " public class Inner extends missing.SuperType{\n" +
- " void foo() {\n" +
- " m().b\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/SuperType.js",
- "package missing;"+
- "public class SuperType {\n" +
- " public Object m(int i) {return null;}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m().b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m().b") + "m().".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0016() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType.MissingMemberType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType$MissingMemberType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0017() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " missing2.MissingType.MissingMemberType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing1/missing2/MissingType.js",
- "package missing1.missing2;"+
- "public class MissingType {\n" +
- " public class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0018() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " missing2.missing3.MissingType.MissingMemberType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing1/missing2/missing3/MissingType.js",
- "package missing1.missing2.missing3;"+
- "public class MissingType {\n" +
- " public class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0019() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType.MissingMemberType[] m = null;\n" +
- " m.e\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.e";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.e") + "m.".length();
- int end1 = start1 + "e".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "equals[FUNCTION_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0020() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " /** @deprecated */\n" +
- " public class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingMemberType");
- int end2 = start2 + "MissingMemberType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType$MissingMemberType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType.MissingMemberType[TYPE_REF]{missing.MissingType.MissingMemberType, missing, Lmissing.MissingType$MissingMemberType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0021() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " /** @deprecated */\n" +
- " public class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0022() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.DISABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " /** @deprecated */\n" +
- " public class MissingMemberType {\n" +
- " public class MissingMemberMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingMemberMemberType");
- int end2 = start2 + "MissingMemberMemberType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType$MissingMemberType$MissingMemberMemberType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType.MissingMemberType.MissingMemberMemberType[TYPE_REF]{missing.MissingType.MissingMemberType.MissingMemberMemberType, missing, Lmissing.MissingType$MissingMemberType$MissingMemberMemberType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0023() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_DEPRECATION_CHECK, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " /** @deprecated */\n" +
- " public class MissingMemberType {\n" +
- " public class MissingMemberMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void _test0024() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.DISABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " private class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingMemberType");
- int end2 = start2 + "MissingMemberType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType$MissingMemberType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType.MissingMemberType[TYPE_REF]{missing.MissingType.MissingMemberType, missing, Lmissing.MissingType$MissingMemberType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0025() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " private class MissingMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void _test0026() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.DISABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " private class MissingMemberType {\n" +
- " public class MissingMemberMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingMemberMemberType");
- int end2 = start2 + "MissingMemberMemberType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType$MissingMemberType$MissingMemberMemberType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType.MissingMemberType.MissingMemberMemberType[TYPE_REF]{missing.MissingType.MissingMemberType.MissingMemberMemberType, missing, Lmissing.MissingType$MissingMemberType$MissingMemberMemberType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0027() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
-
- try {
- Hashtable options = new Hashtable(this.oldOptions);
- options.put(JavaScriptCore.CODEASSIST_VISIBILITY_CHECK, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;\n"+
- "public class Test {\n"+
- " void foo() {\n"+
- " MissingMemberMemberType m = null;\n"+
- " m.b\n"+
- " }\n"+
- "}");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " private class MissingMemberType {\n" +
- " public class MissingMemberMemberType {\n" +
- " public void bar() {}\n" +
- " }\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0028() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "import known.KnownType;\n"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType m = null;\n" +
- " m.field.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public known.KnownType field\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/known/KnownType.js",
- "package known;"+
- "public class KnownType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.field.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0029() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "import known.KnownType;\n"+
- "public class Test {\n" +
- " MissingType m = null;\n" +
- " void foo() {\n" +
- " m.field.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public known.KnownType field\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/known/KnownType.js",
- "package known;"+
- "public class KnownType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.field.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0030() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "import known.KnownType;\n"+
- "public class Test {\n" +
- " MissingType m(){return null;}\n" +
- " void foo() {\n" +
- " m().field.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public known.KnownType field\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/known/KnownType.js",
- "package known;"+
- "public class KnownType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m().field.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test031() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "import known.KnownType;\n"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType m = null;\n" +
- " m.method().b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public known.KnownType method() {return null;}\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/known/KnownType.js",
- "package known;"+
- "public class KnownType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.method().b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0032() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "import known.KnownType;\n"+
- "public class Test {\n" +
- " MissingType m(){return null;}\n" +
- " void foo() {\n" +
- " m().method().b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public known.KnownType method() {return null;}\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/test/known/KnownType.js",
- "package known;"+
- "public class KnownType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m().method().b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0033() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " /** @see MissingType#b */\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar()\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "MissingType#b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests2.java
deleted file mode 100644
index 2e5980b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests2.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Hashtable;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-
-import junit.framework.*;
-
-public class CompletionWithMissingTypesTests2 extends ModifyingResourceTests implements RelevanceConstants {
-
-public CompletionWithMissingTypesTests2(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- setUpJavaProject("Completion");
-}
-public void tearDownSuite() throws Exception {
- deleteProject("Completion");
-
- super.tearDownSuite();
-}
-
-protected static void assertResults(String expected, String actual) {
- try {
- assertEquals(expected, actual);
- } catch(ComparisonFailure c) {
- System.out.println(actual);
- System.out.println();
- throw c;
- }
-}
-static {
-// TESTS_NAMES = new String[] { "testBug96950" };
-}
-public static Test suite() {
- return buildModelTestSuite(CompletionWithMissingTypesTests2.class);
-}
-
-File createFile(File parent, String name, String content) throws IOException {
- File file = new File(parent, name);
- FileOutputStream out = new FileOutputStream(file);
- out.write(content.getBytes());
- out.close();
- return file;
-}
-File createDirectory(File parent, String name) {
- File dir = new File(parent, name);
- dir.mkdirs();
- return dir;
-}
-
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0001() throws Exception {
- Hashtable oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
- options.put(JavaScriptCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaScriptCore.WARNING);
- options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.DISABLED);
- options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
- JavaScriptCore.setOptions(options);
-
- // create variable
-// JavaScriptCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"});
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX.js",
- "package a;\n"+
- "public class XX {\n"+
- " void foo() {}\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX.js",
- "package b;\n"+
- "public class XX {\n"+
- " void foo() {}\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX x = null;\n"+
- " x.fo\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "x.fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("x.fo") + "x.".length();
- int end1 = start1 + "fo".length();
- int start2 = str.lastIndexOf("XX");
- int end2 = start2 + "XX".length();
- assertResults(
- "foo[FUNCTION_REF]{foo(), La.XX;, ()V, foo, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " XX[TYPE_REF]{a.XX, a, La.XX;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- "foo[FUNCTION_REF]{foo(), Lb.XX;, ()V, foo, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " XX[TYPE_REF]{b.XX, b, Lb.XX;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0002() throws Exception {
- Hashtable oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
- options.put(JavaScriptCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaScriptCore.WARNING);
- options.put(JavaScriptCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaScriptCore.ENABLED);
- options.put(JavaScriptCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaScriptCore.DISABLED);
- JavaScriptCore.setOptions(options);
-
- // create variable
-// JavaScriptCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"});
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX.js",
- "package a;\n"+
- "public class XX {\n"+
- " void foo() {}\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX.js",
- "package b;\n"+
- "public class XX {\n"+
- " void foo() {}\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX x = null;\n"+
- " x.fo\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- IJavaScriptUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "x.fo";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("x.fo") + "x.".length();
- int end1 = start1 + "fo".length();
- int start2 = str.lastIndexOf("XX");
- int end2 = start2 + "XX".length();
- assertResults(
- "foo[FUNCTION_REF]{foo(), Lb.XX;, ()V, foo, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " XX[TYPE_REF]{b.XX, b, Lb.XX;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests_1_5.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests_1_5.java
deleted file mode 100644
index aefc2b3..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests_1_5.java
+++ /dev/null
@@ -1,569 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-
-import junit.framework.*;
-
-public class CompletionWithMissingTypesTests_1_5 extends AbstractJavaModelCompletionTests implements RelevanceConstants {
- static {
-// TESTS_NAMES = new String[]{"test0040"};
- }
-public CompletionWithMissingTypesTests_1_5(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- if (COMPLETION_PROJECT == null) {
- COMPLETION_PROJECT = setUpJavaProject("Completion", "1.5");
- } else {
- setUpProjectCompliance(COMPLETION_PROJECT, "1.5");
- }
- super.setUpSuite();
-}
-
-public void tearDownSuite() throws Exception {
- super.tearDownSuite();
-}
-public static Test suite() {
- return buildModelTestSuite(CompletionWithMissingTypesTests_1_5.class);
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0001() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType<Object> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType<T> {\n" +
- " public void bar() {};\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Ljava.lang.Object;>;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType<T>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;>;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0002() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType<MissingType2> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType<T> {\n" +
- " public void bar() {};\n" +
- " public void bar(T t) {};\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/missing/MissingType2.js",
- "package missing;"+
- "public class MissingType2 {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType2");
- int end2 = start2 + "MissingType2".length();
- int start3 = str.lastIndexOf("MissingType<");
- int end3 = start3 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType2;>;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing.MissingType2, missing, Lmissing.MissingType2;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- " MissingType<T>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;>;, null, null, ["+start3+", "+end3+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType2;>;, (Lmissing.MissingType2;)V, bar, (t), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing.MissingType2, missing, Lmissing.MissingType2;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- " MissingType<T>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;>;, null, null, ["+start3+", "+end3+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0003() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "import missing.MissingType;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType<MissingType2> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType<T> {\n" +
- " public void bar() {};\n" +
- " public void bar(T t) {};\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/missing/MissingType2.js",
- "package missing;"+
- "public class MissingType2 {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType2");
- int end2 = start2 + "MissingType2".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType2;>;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing.MissingType2, missing, Lmissing.MissingType2;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType2;>;, (Lmissing.MissingType2;)V, bar, (t), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing.MissingType2, missing, Lmissing.MissingType2;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0004() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "import missing.MissingType2;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType<MissingType2> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType<T> {\n" +
- " public void bar() {};\n" +
- " public void bar(T t) {};\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/missing/MissingType2.js",
- "package missing;"+
- "public class MissingType2 {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType<");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType2;>;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType<T>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;>;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType2;>;, (Lmissing.MissingType2;)V, bar, (t), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType<T>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;>;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0005() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[6];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType<MissingType1, MissingType2> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType<T, U> {\n" +
- " public void bar(T t, U u) {};\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/missing/MissingType1.js",
- "package missing;"+
- "public class MissingType1 {\n" +
- "}\n");
-
- this.workingCopies[3] = getWorkingCopy(
- "/Completion/src/missing/MissingType2.js",
- "package missing;"+
- "public class MissingType2 {\n" +
- "}\n");
-
- this.workingCopies[4] = getWorkingCopy(
- "/Completion/src/missing2/MissingType1.js",
- "package missing2;"+
- "public class MissingType1 {\n" +
- "}\n");
-
- this.workingCopies[5] = getWorkingCopy(
- "/Completion/src/missing2/MissingType2.js",
- "package missing2;"+
- "public class MissingType2 {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType1");
- int end2 = start2 + "MissingType1".length();
- int start3 = str.lastIndexOf("MissingType2");
- int end3 = start3 + "MissingType2".length();
- int start4 = str.lastIndexOf("MissingType<");
- int end4 = start4 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType1;Lmissing.MissingType2;>;, (Lmissing.MissingType1;Lmissing.MissingType2;)V, bar, (t, u), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType1[TYPE_REF]{missing.MissingType1, missing, Lmissing.MissingType1;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing.MissingType2, missing, Lmissing.MissingType2;, null, null, ["+start3+", "+end3+"], " + (relevance1) + "}\n" +
- " MissingType<T,U>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;TU;>;, null, null, ["+start4+", "+end4+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing.MissingType1;Lmissing2.MissingType2;>;, (Lmissing.MissingType1;Lmissing2.MissingType2;)V, bar, (t, u), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType1[TYPE_REF]{missing.MissingType1, missing, Lmissing.MissingType1;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing2.MissingType2, missing2, Lmissing2.MissingType2;, null, null, ["+start3+", "+end3+"], " + (relevance1) + "}\n" +
- " MissingType<T,U>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;TU;>;, null, null, ["+start4+", "+end4+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing2.MissingType1;Lmissing.MissingType2;>;, (Lmissing2.MissingType1;Lmissing.MissingType2;)V, bar, (t, u), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType1[TYPE_REF]{missing2.MissingType1, missing2, Lmissing2.MissingType1;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing.MissingType2, missing, Lmissing.MissingType2;, null, null, ["+start3+", "+end3+"], " + (relevance1) + "}\n" +
- " MissingType<T,U>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;TU;>;, null, null, ["+start4+", "+end4+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Lmissing2.MissingType1;Lmissing2.MissingType2;>;, (Lmissing2.MissingType1;Lmissing2.MissingType2;)V, bar, (t, u), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType1[TYPE_REF]{missing2.MissingType1, missing2, Lmissing2.MissingType1;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- " MissingType2[TYPE_REF]{missing2.MissingType2, missing2, Lmissing2.MissingType2;, null, null, ["+start3+", "+end3+"], " + (relevance1) + "}\n" +
- " MissingType<T,U>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;TU;>;, null, null, ["+start4+", "+end4+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0006() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " MissingType m(int ... i) {return null;}\n" +
- " void foo() {\n" +
- " m(0, 0).b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public void bar() {}\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = ".b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m(0, 0).b") + "m(0, 0).".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0007() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " AType<? extends MissingType> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/test/AType.js",
- "package tezt;"+
- "public class AType<T> {\n" +
- " public void bar(T t) {};\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Ltest.AType<!+Lmissing.MissingType;>;, (!+Lmissing.MissingType;)V, bar, (t), ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0008() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType.MissingMemberType<Object> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType {\n" +
- " public class MissingMemberType<T> {\n" +
- " public void bar() {};\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType$MissingMemberType<Ljava.lang.Object;>;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0009() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " missing2.MissingType<Object> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing1/missing2/MissingType.js",
- "package missing1.missing2;"+
- "public class MissingType<T> {\n" +
- " public void bar() {};\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0010() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType<Object>.MissingMemberType<Object> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType<T> {\n" +
- " public class MissingMemberType<T> {\n" +
- " public void bar() {};\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing.MissingType<Ljava.lang.Object;>.MissingMemberType<Ljava.lang.Object;>;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType<T>[TYPE_REF]{missing.MissingType, missing, Lmissing.MissingType<TT;>;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44984
-public void test0011() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[2];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingMemberType<Object> m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing/MissingType.js",
- "package missing;"+
- "public class MissingType<T> {\n" +
- " public class MissingMemberType<T> {\n" +
- " public void bar() {};\n" +
- " }\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "",
- requestor.getResults());
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=161204
-public void test0012() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[3];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src/test/Test.js",
- "package test;"+
- "public class Test {\n" +
- " void foo() {\n" +
- " MissingType m = null;\n" +
- " m.b\n" +
- " }\n" +
- "}\n");
-
- this.workingCopies[1] = getWorkingCopy(
- "/Completion/src/missing1/MissingType.js",
- "package missing1;"+
- "public class MissingType<T> {\n" +
- " public void bar() {};\n" +
- "}\n");
-
- this.workingCopies[2] = getWorkingCopy(
- "/Completion/src/missing2/MissingType.js",
- "package missing2;"+
- "public class MissingType {\n" +
- " public void bar() {};\n" +
- "}\n");
-
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
- requestor.allowAllRequiredProposals();
- String str = this.workingCopies[0].getSource();
- String completeBehind = "m.b";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED;
- int relevance2 = R_DEFAULT + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED + R_NO_PROBLEMS;
- int start1 = str.lastIndexOf("m.b") + "m.".length();
- int end1 = start1 + "b".length();
- int start2 = str.lastIndexOf("MissingType");
- int end2 = start2 + "MissingType".length();
- assertResults(
- "bar[FUNCTION_REF]{bar(), Lmissing1.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
- " MissingType<T>[TYPE_REF]{missing1.MissingType, missing1, Lmissing1.MissingType<TT;>;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
- "bar[FUNCTION_REF]{bar(), Lmissing2.MissingType;, ()V, bar, null, ["+start1+", "+end1+"], " + (relevance2) + "}\n" +
- " MissingType[TYPE_REF]{missing2.MissingType, missing2, Lmissing2.MissingType;, null, null, ["+start2+", "+end2+"], " + (relevance2) + "}",
- requestor.getResults());
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ContainerInitializer.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ContainerInitializer.java
deleted file mode 100644
index 038c4a6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ContainerInitializer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
-import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation;
-
-public class ContainerInitializer extends JsGlobalScopeContainerInitializer {
- public static ITestInitializer initializer;
-
- public static interface ITestInitializer {
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException;
- public boolean allowFailureContainer();
- }
-
- public static void setInitializer(ITestInitializer initializer) {
- ContainerInitializer.initializer = initializer;
- }
-
- public IJsGlobalScopeContainer getFailureContainer(IPath containerPath, IJavaScriptProject project) {
- if (initializer == null || !initializer.allowFailureContainer()) return null;
- return super.getFailureContainer(containerPath, project);
- }
-
- public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
- if (initializer == null) return;
- initializer.initialize(containerPath, project);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.IJsGlobalScopeContainerInitialzer#getLibraryLocation()
- */
- public LibraryLocation getLibraryLocation() {
- return null;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveElementsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveElementsTests.java
deleted file mode 100644
index 042c329..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveElementsTests.java
+++ /dev/null
@@ -1,2743 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.wst.jsdt.core.*;
-
-public class CopyMoveElementsTests extends CopyMoveTests {
-public CopyMoveElementsTests(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- IJavaScriptProject project = this.createJavaProject("BinaryProject", new String[] {"src"}, new String[] {"JCL_LIB"});
- this.createFile(
- "/BinaryProject/src/X.js",
- "public class X {\n" +
- " int bar;\n" +
- " public void foo() {\n" +
- " }\n" +
- "}"
- );
- project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
- waitForAutoBuild();
-}
-/**
- * Setup for the next test.
- */
-public void setUp() throws Exception {
- super.setUp();
-
- this.createJavaProject("P", new String[] {"src"}, new String[] {"/BinaryProject/bin"});
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
- // Names of tests to run: can be "testBugXXXX" or "BugXXXX")
-// TESTS_PREFIX = "testCombineAccessRestrictions";
-// TESTS_NAMES = new String[] {"testCopyFieldWithPositioning"};
-// TESTS_NUMBERS = new int[] { 5, 6 };
-// TESTS_RANGE = new int[] { 21, 38 };
-}
-public static Test suite() {
- return buildModelTestSuite(CopyMoveElementsTests.class);
-}
-/**
- * Cleanup after the previous test.
- */
-public void tearDown() throws Exception {
- this.deleteProject("P");
-
- super.tearDown();
-}
-public void tearDownSuite() throws Exception {
- this.deleteProject("BinaryProject");
- super.tearDownSuite();
-}
-/**
- * Ensures that a binary field cannot be renamed.
- */
-//public void testCopyBinaryField() throws JavaScriptModelException {
-// IClassFile cf = getClassFile("P", "/BinaryProject/bin", "", "X.class");
-// IField binaryField = cf.getType().getField("bar");
-// copyNegative(binaryField, cf, null, "bar2", false, IJavaScriptModelStatusConstants.READ_ONLY);
-//}
-///**
-// * Ensures that a binary method cannot be renamed.
-// */
-//public void testCopyBinaryMethod() throws JavaScriptModelException {
-// IClassFile cf = getClassFile("P", "/BinaryProject/bin", "", "X.class");
-// IFunction binaryMethod = cf.getType().getMethod("foo", new String[] {});
-// copyNegative(binaryMethod, cf, null, "foo2", false, IJavaScriptModelStatusConstants.READ_ONLY);
-//}
-///**
-// * Ensures that a binary type cannot be copied.
-// */
-//public void testCopyBinaryType() throws JavaScriptModelException {
-// IClassFile cf = getClassFile("P", "/BinaryProject/bin", "", "X.class");
-// IType binaryType = cf.getType();
-// copyNegative(binaryType, cf, null, "Y", false, IJavaScriptModelStatusConstants.READ_ONLY);
-//}
-/**
- * Ensures that a constructor can be copied to a different type. The constructor
- * should be automatically renamed to that of the destination type.
- */
-//public void testCopyConstructor() throws CoreException {
-// this.createFile(
-// "/P/src/X.js",
-// "public class X {\n" +
-// " X(String s) {\n" +
-// " }\n" +
-// "}"
-// );
-// IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-// IFunction methodSource = typeSource.getMethod("X", new String[] {"QString;"});
-//
-// this.createFile(
-// "/P/src/Y.js",
-// "public class Y {\n" +
-// "}"
-// );
-// IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-//
-// copyPositive(methodSource, typeDest, null, null, false);
-//}
-///**
-// * Ensures that a constructor can be copied to a different type across projects.
-// * The constructor should be automatically renamed to that of the destination type.
-// */
-//public void testCopyConstructorInDifferentProject() throws CoreException {
-// try {
-// this.createFile(
-// "/P/src/X.js",
-// "public class X {\n" +
-// " X(String s) {\n" +
-// " }\n" +
-// "}"
-// );
-// IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-// IFunction methodSource = typeSource.getMethod("X", new String[] {"QString;"});
-//
-// this.createJavaProject("P2", new String[] {"src"}, "bin");
-// this.createFile(
-// "/P2/src/Y.js",
-// "public class Y {\n" +
-// "}"
-// );
-// IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-//
-// copyPositive(methodSource, typeDest, null, null, false);
-//
-// } finally {
-// this.deleteProject("P2");
-// }
-//}
-/**
- * Ensures that a field can be copied to a different type.
- */
-public void testCopyField() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a field can be copied to a different type replacing an existing field.
- */
-public void testCopyFieldForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " boolean foo;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, null, true);
-}
-/**
- * Ensures that a field can be copied to a different type across projects
- * replacing an existing field.
- */
-public void testCopyFieldForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("bar");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, null, true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be copied to a different type in a different project.
- */
-public void testCopyFieldInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("bar");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be copied to a different type,
- * and renamed.
- */
-public void testCopyFieldRename() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, "bar", false);
-}
-/**
- * Ensures that a field can be copied to a different type,
- * and renamed, overwriting an existing field.
- */
-public void testCopyFieldRenameForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, "bar", true);
-}
-/**
- * Ensures that a field can be copied to a different type across two different
- * projects, and renamed, overwriting an existing field.
- */
-public void testCopyFieldRenameForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, "bar", true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be copied to a different type across two different
- * projects, and renamed.
- */
-public void testCopyFieldRenameInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, null, "bar", false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be duplicated in the same type.
- */
-public void testCopyFieldSameParent() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- copyPositive(fieldSource, typeSource, null, "bar", false);
-}
-/**
- * Ensures that a multi status exception is generated when copying fields.
- */
-public void testCopyFieldsMultiStatus() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " Object bar;\n" +
- " char[] fred;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- IField[] fieldsSource = typeSource.getFields();
- IJavaScriptElement[] dests = new IJavaScriptElement[fieldsSource.length];
- for (int i = 0; i < dests.length; i++) {
- dests[i] = typeDest;
- }
- dests[1] = fieldsSource[0]; //invalid destination
- dests[2]= fieldsSource[0];
-
- try {
- startDeltas();
- boolean e= false;
- try {
- typeDest.getJavaScriptModel().copy(fieldsSource, dests, null, null, false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Should be multistatus", jme.getStatus().isMultiStatus());
- assertTrue("Should be an invalid destination", ((IJavaScriptModelStatus)jme.getStatus().getChildren()[0]).getCode()== IJavaScriptModelStatusConstants.INVALID_DESTINATION);
- e = true;
- }
- assertTrue("Should have been an exception", e);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " Y.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " Y[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo[+]: {}"
- );
-
- IJavaScriptElement copy= generateHandle(fieldsSource[0], null, typeDest);
- assertTrue("Copy should exist", copy.exists());
- } finally {
- stopDeltas();
- }
-}
-/**
- * Ensures that a multi status exception is generated when copying fields.
- */
-public void testCopyFieldsMultiStatusInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " Object bar;\n" +
- " char[] fred;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- IField[] fieldsSource = typeSource.getFields();
- IJavaScriptElement[] dests = new IJavaScriptElement[fieldsSource.length];
- for (int i = 0; i < dests.length; i++) {
- dests[i] = typeDest;
- }
- dests[1] = fieldsSource[0]; //invalid destination
- dests[2]= fieldsSource[0];
-
- startDeltas();
- boolean e= false;
- try {
- typeDest.getJavaScriptModel().copy(fieldsSource, dests, null, null, false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Should be multistatus", jme.getStatus().isMultiStatus());
- assertTrue("Should be an invalid destination", ((IJavaScriptModelStatus)jme.getStatus().getChildren()[0]).getCode()== IJavaScriptModelStatusConstants.INVALID_DESTINATION);
- e = true;
- }
- assertTrue("Should have been an exception", e);
-
- assertDeltas(
- "Unexpected delta",
- "P2[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " Y.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " Y[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo[+]: {}"
- );
-
- IJavaScriptElement copy= generateHandle(fieldsSource[0], null, typeDest);
- assertTrue("Copy should exist", copy.exists());
- } finally {
- stopDeltas();
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field cannot be copied to a different type replacing an existing field if
- * no force.
- */
-public void testCopyFieldWithCollision() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " boolean foo;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyNegative(fieldSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
-}
-/**
- * Ensures that a field cannot be copied to a different type across different projects
- * replacing an existing field if no force.
- */
-public void testCopyFieldWithCollisionInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("bar");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyNegative(fieldSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field cannot be copied to an invalid destination.
- */
-public void testCopyFieldWithInvalidDestination() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- IClassFile cf = getClassFile("P", "/BinaryProject/bin", "", "X.class");
-
- copyNegative(fieldSource, cf.getType(), null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
-}
-/**
- * Ensures that a field cannot be copied to an invalid destination.
- */
-public void testCopyFieldWithInvalidDestinationInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"}, new String[] {"/BinaryProject/bin"});
- IClassFile cf = getClassFile("P2", "/BinaryProject/bin", "", "X.class");
-
- copyNegative(fieldSource, cf.getType(), null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field cannot be copied to a different type with an invalid sibling
- * used for positioning.
- */
-public void testCopyFieldWithInvalidPositioning() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyNegative(
- fieldSource,
- typeDest,
- typeDest.getField("invalid"),
- null,
- false,
- IJavaScriptModelStatusConstants.INVALID_SIBLING);
-}
-/**
- * Ensures that a field cannot be copied to a different type with an invalid sibling
- * used for positioning.
- */
-public void testCopyFieldWithInvalidPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyNegative(
- fieldSource,
- typeDest,
- typeDest.getField("invalid"),
- null,
- false,
- IJavaScriptModelStatusConstants.INVALID_SIBLING);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be copied to a different type with positioning.
- */
-public void testCopyFieldWithPositioning() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, typeDest.getField("bar"), null, false);
-}
-/**
- * Ensures that a field can be copied to a different type across different projects
- * with positioning.
- */
-public void testCopyFieldWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(fieldSource, typeDest, typeDest.getField("bar"), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-
-/*
- * Ensures that an import can be copied to a different cu.
- */
-public void testCopyImport() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "import java.util.*;\n" +
- "public class X {\n" +
- "}"
- );
- IImportDeclaration importSource = getCompilationUnit("/P/src/X.js").getImport("java.util.*");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P/src/Y.js");
-
- copyPositive(importSource, cuDest, null, null, false);
-}
-/*
- * Ensures that a static import can be copied to a different cu.
- */
-public void testCopyImportStatic() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "import static java.lang.Math;\n" +
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IImportDeclaration importSource = getCompilationUnit("/P/src/X.js").getImport("java.lang.Math");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P/src/Y.js");
-
- copyPositive(importSource, cuDest, null, null, false);
- assertEquals("Copied import should be static", Flags.AccStatic, cuDest.getImport("java.lang.Math").getFlags());
-}
-
-/**
- * Ensures that a initializer can be copied to a different type.
- */
-public void testCopyInitializer() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(initializerSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a initializer can be copied to a different type across two different
- * projects.
- */
-public void testCopyInitializerInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(initializerSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a initializer cannot be copied and renamed.
- */
-public void testCopyInitializerRename() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyNegative(initializerSource, typeDest, null, "newName", false, IJavaScriptModelStatusConstants.INVALID_NAME);
-}
-/**
- * Ensures that a initializer cannot be copied and renamed.
- */
-public void testCopyInitializerRenameInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyNegative(initializerSource, typeDest, null, "newName", false, IJavaScriptModelStatusConstants.INVALID_NAME);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a initializer can be copied to a different type across two different
- * projects with positioning.
- */
-public void testCopyInitializerWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(initializerSource, typeDest, typeDest.getField("bar"), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that an inner type can be copied with positioning.
- */
-public void testCopyInnerTypeWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " class Inner {\n" +
- " }" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X").getType("Inner");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
- IType typeDest = cuDest.getType("Y");
-
- copyPositive(typeSource, typeDest, typeDest.getFunction("foo", new String[] {}), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a local type can be copied.
- */
-public void testCopyLocalType() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X").getFunction("foo", new String[0]).getType("Z", 1);
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P/src/Y.js");
-
- copyPositive(typeSource, cuDest, null, null, false);
-}
-/**
- * Ensures that a main type can be copied.
- */
-public void testCopyMainType() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P/src/Y.js");
-
- copyPositive(typeSource, cuDest, null, null, false);
-}
-/**
- * Ensures that a main type can be copied across two different projects.
- */
-public void testCopyMainTypeInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
-
- copyPositive(typeSource, cuDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be copied to a different type.
- */
-public void testCopyMethod() throws CoreException{
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a method can be copied to a different type, forcing
- * an overwrite when there is a name collision
- */
-public void testCopyMethodForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " int foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, null, true);
-}
-/**
- * Ensures that a method can be copied to a different type across different projects,
- * forcing an overwrite when there is a name collision
- */
-public void testCopyMethodForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " int foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, null, true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be copied to a different type across different projects.
- */
-public void testCopyMethodInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be copied to a different type, renamed
- * simaltaneously.
- */
-public void testCopyMethodRename() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, "bar", false);
-}
-/**
- * Ensures that a method can be copied to a different type, renamed
- * simaltaneously, overwriting an existing method.
- */
-public void testCopyMethodRenameForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " void bar(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, "bar", true);
-}
-/**
- * Ensures that a method can be copied to a different type across different projects,
- * renamed simaltaneously, overwriting an existing method.
- */
-public void testCopyMethodRenameForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void bar(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, "bar", true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be copied to a different type across different projects,
- * renamed simaltaneously.
- */
-public void testCopyMethodRenameInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, "bar", false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be copied to the same type, renamed
- * simaltaneously.
- */
-public void testCopyMethodSameParent() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- copyPositive(methodSource, typeSource, null, "bar", false);
-}
-/**
- * Ensures that a method cannot be copied to a different type, when not forcing
- * an overwrite when there is a name collision
- */
-public void testCopyMethodWithCollision() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyNegative(methodSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
-}
-/**
- * Ensures that a method cannot be copied to a different type across different projects,
- * when not forcing an overwrite when there is a name collision
- */
-public void testCopyMethodWithCollisionInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyNegative(methodSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method cannot be copied to an invalid destination.
- */
-public void testCopyMethodWithInvalidDestination() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- copyNegative(methodSource, methodSource, null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
-}
-/**
- * Ensures that a method cannot be copied to an invalid destination.
- */
-public void testCopyMethodWithInvalidDestinationInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource = typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void bar() {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
- IFunction methodDest = typeDest.getFunction("bar", new String[] {});
-
- copyNegative(methodSource, methodDest, null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be copied to a different type with positioning.
- */
-public void testCopyMethodWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource = typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar() {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, typeDest.getFunction("bar", new String[] {}), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that attempting to rename with an incorrect number of renamings fails
- */
-public void testCopyMoveWithInvalidRenamings() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource = typeSource.getFunction("foo", new String[]{});
- copyNegative(
- new IJavaScriptElement[] {methodSource},
- new IJavaScriptElement[] {typeSource},
- null,
- new String[] {"bar", "fred"},
- false,
- IJavaScriptModelStatusConstants.INDEX_OUT_OF_BOUNDS);
-}
-/**
- * Ensures that a method with syntax errors can be copied to a different type.
- */
-public void testCopySyntaxErrorMethod() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s\n" + // syntax error
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a method with syntax errors can be copied to a different type across different
- * projects.
- */
-public void testCopySyntaxErrorMethodInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s\n" + // syntax error
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- copyPositive(methodSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a type can be copied.
- */
-public void testCopyType() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}\n" +
- "class Z {\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("Z");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P/src/Y.js");
-
- copyPositive(typeSource, cuDest, null, null, false);
-}
-/**
- * Ensures that a type can be copied.
- */
-public void testCopyTypeInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}\n" +
- "class Z {\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("Z");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
-
- copyPositive(typeSource, cuDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a type can be copied with positioning.
- */
-public void testCopyTypeWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}\n" +
- "class Z {\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("Z");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
-
- copyPositive(typeSource, cuDest, cuDest.getType("Y"), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a constructor can be moved to a different type. The constructor
- * should be automatically renamed to that of the destination type.
- */
-public void testMoveConstructor() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " X(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("X", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, false);
-
- // test that the constructor has been renamed
- assertTrue(
- "Constructor was not renamed",
- typeDest.getFunction("Y", new String[] {"QString;"}).exists());
-}
-/**
- * Ensures that a constructor can be moved to a different type across different projects.
- * The constructor should be automatically renamed to that of the destination type.
- */
-public void testMoveConstructorInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " X(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("X", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, false);
-
- // test that the constructor has been renamed
- assertTrue(
- "Constructor was not renamed",
- typeDest.getFunction("Y", new String[] {"QString;"}).exists());
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be moved to a different type.
- */
-public void testMoveField() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a field can be moved to a different type replacing an existing field.
- */
-public void testMoveFieldForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " boolean foo;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, null, true);
-}
-/**
- * Ensures that a field can be moved to a different type across differnt projects
- * replacing an existing field.
- */
-public void testMoveFieldForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("bar");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, null, true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be moved to a different type across differnt projects.
- */
-public void testMoveFieldInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("bar");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be moved to a different type,
- * and renamed.
- */
-public void testMoveFieldRename() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, "fred", false);
-}
-/**
- * Ensures that a field can be moved to a different type,
- * and renamed, overwriting an existing field.
- */
-public void testMoveFieldRenameForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, "bar", true);
-}
-/**
- * Ensures that a field can be moved to a different type across differnt projects,
- * and renamed, overwriting an existing field.
- */
-public void testMoveFieldRenameForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, "bar", true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be moved to a different type across different projects,
- * and renamed.
- */
-public void testMoveFieldRenameInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, null, "bar", false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be copied to a different type across different projects
- * with positioning.
- */
-public void testMoveFieldRenameForceWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- " char fred;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, typeDest.getField("bar"), "fred", true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be moved in the same type.
- */
-public void testMoveFieldSameParent() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- movePositive(fieldSource, typeSource, null, "bar", false);
-}
-/**
- * Ensures that a field cannot be moved to a different type replacing an existing field if
- * not forced.
- */
-public void testMoveFieldWithCollision() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " boolean foo;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- moveNegative(fieldSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
-}
-/**
- * Ensures that a field cannot be moved to a different type across differnt projects
- * replacing an existing field if not forced.
- */
-public void testMoveFieldWithCollisionInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("bar");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- moveNegative(fieldSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field cannot be moved to an invalid destination
- */
-public void testMoveFieldWithInvalidDestination() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- IClassFile cf = getClassFile("P", "/BinaryProject/bin", "", "X.class");
-
- moveNegative(fieldSource, cf.getType(), null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
-}
-/**
- * Ensures that a field cannot be moved to an invalid destination.
- */
-public void testMoveFieldWithInvalidDestinationInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"}, new String[] {"/BinaryProject/bin"});
- IClassFile cf = getClassFile("P2", "/BinaryProject/bin", "", "X.class");
-
- moveNegative(fieldSource, cf.getType(), null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a field can be copied to a different type across different projects
- * with positioning.
- */
-public void testMoveFieldWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IField fieldSource= typeSource.getField("foo");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(fieldSource, typeDest, typeDest.getField("bar"), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a initializer can be moved to a different type.
- */
-public void testMoveInitializer() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(initializerSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a initializer can be copied to a different type that is in a different
- * projects=.
- */
-public void testMoveInitializerInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(initializerSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a initializer cannot be moved and renamed.
- */
-public void testMoveInitializerRename() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- moveNegative(initializerSource, typeDest, null, "newName", false, IJavaScriptModelStatusConstants.INVALID_NAME);
-}
-/**
- * Ensures that a initializer cannot be moved and renamed.
- */
-public void testMoveInitializerRenameInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- moveNegative(initializerSource, typeDest, null, "newName", false, IJavaScriptModelStatusConstants.INVALID_NAME);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a initializer can be moved to a different type in a different project
- * with positioning.
- */
-public void testMoveInitializerWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo;\n" +
- " {\n" +
- " foo = 10;\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IInitializer initializerSource= typeSource.getInitializer(1);
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " int bar;\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(initializerSource, typeDest, typeDest.getField("bar"), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that an inner type can be moved and renamed to a type that is in different project
- * with positioning.
- */
-public void testMoveInnerTypeRenameWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " class Inner {\n" +
- " }" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X").getType("Inner");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
- IType typeDest = cuDest.getType("Y");
-
- movePositive(typeSource, typeDest, typeDest.getFunction("foo", new String[] {}), "T", false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that an inner type can be moved to a type that is in different project
- * with positioning.
- */
-public void testMoveInnerTypeWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " class Inner {\n" +
- " }" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X").getType("Inner");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
- IType typeDest = cuDest.getType("Y");
-
- movePositive(typeSource, typeDest, typeDest.getFunction("foo", new String[] {}), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that main types can be moved and renamed (within the same parent).
- */
-public void testMoveMainTypes() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkg = getPackage("/P/src");
- IJavaScriptUnit cu = pkg.getJavaScriptUnit("X.js");
- IType typeSource = cu.getType("X");
-
- movePositive(
- new IJavaScriptElement[] {typeSource},
- new IJavaScriptElement[]{cu},
- null,
- new String[] {"Y"},
- false);
-
- // test that both the compilation unit and the main type have been renamed.
- IJavaScriptUnit renamedCU = pkg.getJavaScriptUnit("Y.js");
- assertTrue("Renamed element should be present", renamedCU.getType("Y").exists());
-}
-/**
- * Ensures that a method can be moved to a different type.
- */
-public void testMoveMethod() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a method can be moved to a different type, forcing
- * an overwrite when there is a name collision
- */
-public void testMoveMethodForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " int foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, true);
-}
-/**
- * Ensures that a method can be moved to a different type across different projects,
- * forcing an overwrite when there is a name collision
- */
-public void testMoveMethodForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " int foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be moved to a different type in a different project.
- */
-public void testMoveMethodInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be moved to a different type, renamed
- * simaltaneously.
- */
-public void testMoveMethodRename() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, "bar", false);
-}
-/**
- * Ensures that a method can be moved to a different type, renamed
- * simaltaneously, overwriting an existing method.
- */
-public void testMoveMethodRenameForce() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " void bar(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, "bar", true);
-}
-/**
- * Ensures that a method can be moved to a different type across different projects,
- * renamed simaltaneously, overwriting an existing method.
- */
-public void testMoveMethodRenameForceInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void bar(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, "bar", true);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be moved to a different type across different projects,
- * renamed simaltaneously.
- */
-public void testMoveMethodRenameInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, "bar", false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be moved and renamed to a different type across two different projects
- * with positioning.
- */
-public void testMoveMethodRenameWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource = typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar() {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, typeDest.getFunction("bar", new String[] {}), "fred", false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be moved to the same type.
- */
-public void testMoveMethodSameParent() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- movePositive(methodSource, typeSource, null, "bar", false);
-}
-/**
- * Ensures that a method moves can be cancelled.
- */
-public void testMoveMethodsWithCancel() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}"
- );
- final IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- boolean isCanceled = false;
- try {
- TestProgressMonitor monitor = TestProgressMonitor.getInstance();
- monitor.setCancelledCounter(1);
- movePositive(typeSource.getFunctions(), new IJavaScriptElement[] {typeDest}, null, null, false, monitor);
- } catch (OperationCanceledException e) {
- isCanceled = true;
- }
- assertTrue("Operation should have thrown an operation canceled exception", isCanceled);
-}
-/**
- * Ensures that a method moves across differnt projects can be cancelled.
- */
-public void testMoveMethodsWithCancelInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}"
- );
- final IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- boolean isCanceled = false;
- try {
- TestProgressMonitor monitor = TestProgressMonitor.getInstance();
- monitor.setCancelledCounter(1);
- movePositive(typeSource.getFunctions(), new IJavaScriptElement[] {typeDest}, null, null, false, monitor);
- } catch (OperationCanceledException e) {
- isCanceled = true;
- }
- assertTrue("Operation should have thrown an operation canceled exception", isCanceled);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method cannot be moved to a different type, when not forcing
- * an overwrite when there is a name collision
- */
-public void testMoveMethodWithCollision() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- moveNegative(methodSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
-}
-/**
- * Ensures that a method cannot be moved to a different type, when not forcing
- * an overwrite when there is a name collision
- */
-public void testMoveMethodWithCollisionInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- moveNegative(methodSource, typeDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method cannot be moved to an invalid destination.
- */
-public void testMoveMethodWithInvalidDestination() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- moveNegative(methodSource, methodSource, null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
-}
-/**
- * Ensures that a method cannot be moved to an invalid destination.
- */
-public void testMoveMethodWithInvalidDestinationInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource = typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " void bar() {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
- IFunction methodDest = typeDest.getFunction("bar", new String[] {});
-
- moveNegative(methodSource, methodDest, null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method can be moved to a different type that is in a different project
- * with positioning.
- */
-public void testMoveMethodWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " int foo(String s) {\n" +
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource = typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- " boolean bar() {\n" +
- " }\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, typeDest.getFunction("bar", new String[] {}), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a method with syntax errors can be moved to a different type.
- */
-public void testMoveSyntaxErrorMethod() throws CoreException {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s\n" + // syntax error
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createFile(
- "/P/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, false);
-}
-/**
- * Ensures that a method with syntax errors can be moved to a different type
- * that is in a different project.
- */
-public void testMoveSyntaxErrorMethodInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- " void foo(String s\n" + // syntax error
- " }\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("X");
- IFunction methodSource= typeSource.getFunction("foo", new String[] {"QString;"});
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IType typeDest = getCompilationUnit("/P2/src/Y.js").getType("Y");
-
- movePositive(methodSource, typeDest, null, null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a type can be moved and renamed across projects to a specified position.
- */
-public void testMoveTypeRenameWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}\n" +
- "class Z {\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("Z");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
-
- movePositive(typeSource, cuDest, cuDest.getType("Y"), "T", false);
- } finally {
- this.deleteProject("P2");
- }
-}
-/**
- * Ensures that a type that is in a different project can be moved to a specified position.
- */
-public void testMoveTypeWithPositioningInDifferentProject() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public class X {\n" +
- "}\n" +
- "class Z {\n" +
- "}"
- );
- IType typeSource = getCompilationUnit("/P/src/X.js").getType("Z");
-
- this.createJavaProject("P2", new String[] {"src"});
- this.createFile(
- "/P2/src/Y.js",
- "public class Y {\n" +
- "}"
- );
- IJavaScriptUnit cuDest = getCompilationUnit("/P2/src/Y.js");
-
- movePositive(typeSource, cuDest, cuDest.getType("Y"), null, false);
- } finally {
- this.deleteProject("P2");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveResourcesTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveResourcesTests.java
deleted file mode 100644
index 3bd5801..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveResourcesTests.java
+++ /dev/null
@@ -1,933 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-
-public class CopyMoveResourcesTests extends CopyMoveTests {
-/**
- */
-public CopyMoveResourcesTests(String name) {
- super(name);
-}
-/**
- * Copies the element to the container with optional rename
- * and forcing. The operation should succeed, so any exceptions
- * encountered are thrown.
- */
-public IJavaScriptElement copyPositive(IJavaScriptElement element, IJavaScriptElement container, IJavaScriptElement sibling, String rename, boolean force) throws JavaScriptModelException {
- try {
- startDeltas();
-
- // if forcing, ensure that a name collision exists
- if (force) {
- IJavaScriptElement collision = generateHandle(element, rename, container);
- assertTrue("Collision does not exist", collision.exists());
- }
-
- // copy
- ((ISourceManipulation) element).copy(container, sibling, rename, force, null);
-
- // ensure the original element still exists
- assertTrue("The original element must still exist", element.exists());
-
- // generate the new element handle
- IJavaScriptElement copy = generateHandle(element, rename, container);
- assertTrue("Copy should exist", copy.exists());
- //ensure correct position
- if (element.getElementType() > IJavaScriptElement.JAVASCRIPT_UNIT) {
- ensureCorrectPositioning((IParent) container, sibling, copy);
- }
- IJavaScriptElementDelta destDelta = getDeltaFor(container, true);
- assertTrue("Destination container not changed", destDelta != null && destDelta.getKind() == IJavaScriptElementDelta.CHANGED);
- IJavaScriptElementDelta[] deltas = destDelta.getAddedChildren();
- // FIXME: not strong enough
- boolean found = false;
- for (int i = 0; i < deltas.length; i++) {
- if (deltas[i].getElement().equals(copy))
- found = true;
- }
- assertTrue("Added children not correct for element copy", found);
- return copy;
- } finally {
- stopDeltas();
- }
-}
-
-/**
- * Moves the elements to the containers with optional renaming
- * and forcing. The operation should succeed, so any exceptions
- * encountered are thrown.
- */
-public void movePositive(IJavaScriptElement[] elements, IJavaScriptElement[] destinations, IJavaScriptElement[] siblings, String[] names, boolean force, IProgressMonitor monitor) throws JavaScriptModelException {
- try {
- startDeltas();
-
- // if forcing, ensure that a name collision exists
- int i;
- if (force) {
- for (i = 0; i < elements.length; i++) {
- IJavaScriptElement e = elements[i];
- IJavaScriptElement collision = null;
- if (names == null) {
- collision = generateHandle(e, null, destinations[i]);
- } else {
- collision = generateHandle(e, names[i], destinations[i]);
- }
- assertTrue("Collision does not exist", collision.exists());
- }
- }
-
- // move
- getJavaModel().move(elements, destinations, siblings, names, force, monitor);
-
- for (i = 0; i < elements.length; i++) {
- IJavaScriptElement element = elements[i];
- IJavaScriptElement moved = null;
- if (names == null) {
- moved = generateHandle(element, null, destinations[i]);
- } else {
- moved = generateHandle(element, names[i], destinations[i]);
- }
- // ensure the original element no longer exists, unless moving within the same container, or moving a primary working copy
- if (!destinations[i].equals(element.getParent())) {
- if (element.getElementType() != IJavaScriptElement.JAVASCRIPT_UNIT || !((IJavaScriptUnit) element).isWorkingCopy())
- assertTrue("The original element must not exist", !element.exists());
- }
- assertTrue("Moved element should exist", moved.exists());
-
- IJavaScriptElementDelta destDelta = null;
- if (isMainType(element, destinations[i]) && names != null && names[i] != null) { //moved/renamed main type to same cu
- destDelta = getDeltaFor(moved.getParent());
- assertTrue("Renamed compilation unit as result of main type not added", destDelta != null && destDelta.getKind() == IJavaScriptElementDelta.ADDED);
- IJavaScriptElementDelta[] deltas = destDelta.getAddedChildren();
- assertTrue("Added children not correct for element copy", deltas[0].getElement().equals(moved));
- assertTrue("flag should be F_MOVED_FROM", (deltas[0].getFlags() & IJavaScriptElementDelta.F_MOVED_FROM) > 0);
- assertTrue("moved from handle should be original", deltas[0].getMovedFromElement().equals(element));
- } else {
- destDelta = getDeltaFor(destinations[i], true);
- assertTrue("Destination container not changed", destDelta != null && destDelta.getKind() == IJavaScriptElementDelta.CHANGED);
- IJavaScriptElementDelta[] deltas = destDelta.getAddedChildren();
- for (int j = 0; j < deltas.length - 1; j++) {
- // side effect packages added
- IJavaScriptElement pkg = deltas[j].getElement();
- assertTrue("Side effect child should be a package fragment", pkg.getElementType() == IJavaScriptElement.PACKAGE_FRAGMENT);
- assertTrue("Side effect child should be an enclosing package", element.getElementName().startsWith(pkg.getElementName()));
- }
- IJavaScriptElementDelta pkgDelta = deltas[deltas.length - 1];
- assertTrue("Added children not correct for element copy", pkgDelta.getElement().equals(moved));
- assertTrue("flag should be F_MOVED_FROM", (pkgDelta.getFlags() & IJavaScriptElementDelta.F_MOVED_FROM) > 0);
- assertTrue("moved from handle shoud be original", pkgDelta.getMovedFromElement().equals(element));
- IJavaScriptElementDelta sourceDelta = getDeltaFor(element, true);
- assertTrue("moved to handle should be original", sourceDelta.getMovedToElement().equals(moved));
- }
- }
- } finally {
- stopDeltas();
- }
-}
-/**
- * Setup for the next test.
- */
-public void setUp() throws Exception {
- super.setUp();
-
- this.createJavaProject("P", new String[] {"src", "src2"});
-}
-static {
-// TESTS_NAMES = new String[] { "testCopyWorkingCopyDestination"};
-}
-public static Test suite() {
- return buildModelTestSuite(CopyMoveResourcesTests.class);
-}
-/**
- * Cleanup after the previous test.
- */
-public void tearDown() throws Exception {
- this.deleteProject("P");
-
- super.tearDown();
-}
-/**
- * This operation should fail as copying a CU and a CU member at the
- * same time is not supported.
- */
-public void testCopyCUAndType() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- copyNegative(
- new IJavaScriptElement[]{cuSource, cuSource.getType("X")},
- new IJavaScriptElement[]{cuSource.getParent(), cuSource},
- null,
- new String[]{"Y.js", "Y"},
- false,
- IJavaScriptModelStatusConstants.INVALID_ELEMENT_TYPES);
-}
-/**
- * Ensures that a CU can be copied to a different package, replacing an existing CU.
- */
-public void testCopyCUForce() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/X.js",
- "package p2;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(cuSource, pkgDest, null, null, true);
-}
-/**
- * Ensures that a CU can be copied to a different package,
- * and be renamed.
- */
-public void testCopyCURename() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(cuSource, pkgDest, null, "Y.js", false);
-}
-/**
- * Ensures that a read-only CU can be copied to a different package.
- */
-public void testCopyCUReadOnly() throws CoreException {
- if (!Util.isReadOnlySupported()) {
- // Do not test if file system does not support read-only attribute
- return;
- }
- IFile file = null;
- IFile file2 = null;
- try {
- this.createFolder("/P/src/p1");
- file = this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- Util.setReadOnly(file, true);
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(cuSource, pkgDest, null, null, false);
-
- file2 = getFile("/P/src/p2/X.js");
- assertTrue("Destination cu should be read-only", file2.isReadOnly());
- } finally {
- if (file != null) {
- Util.setReadOnly(file, false);
- }
- if (file2 != null) {
- Util.setReadOnly(file2, false);
- }
- deleteFolder("/P/src/p1");
- deleteFolder("/P/src/p2");
- }
-}
-/**
- * Ensures that a CU can be copied to a different package,
- * and be renamed, overwriting an existing CU
- */
-public void testCopyCURenameForce() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/Y.js",
- "package p2;\n" +
- "public class Y {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(cuSource, pkgDest, null, "Y.js", true);
-}
-/**
- * Ensures that a CU cannot be copied to a different package,over an existing CU when no force.
- */
-public void testCopyCUWithCollision() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/X.js",
- "package p2;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyNegative(cuSource, pkgDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
-}
-/**
- * Ensures that a CU cannot be copied to an invalid destination
- */
-public void testCopyCUWithInvalidDestination() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- copyNegative(cuSource, cuSource, null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
-}
-/**
- * Ensures that a CU can be copied to a null container
- */
-public void testCopyCUWithNullContainer() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- try {
- cuSource.copy(null, null, null, false, null);
- } catch (IllegalArgumentException iae) {
- return;
- }
- assertTrue("Should not be able to move a cu to a null container", false);
-}
-/**
- * Ensures that a CU can be copied to along with its server properties.
- * (Regression test for PR #1G56QT9)
- */
-public void testCopyCUWithServerProperties() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- QualifiedName qualifiedName = new QualifiedName("x.y.z", "a property");
- cuSource.getUnderlyingResource().setPersistentProperty(
- qualifiedName,
- "some value");
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(cuSource, pkgDest, null, null, false);
- IJavaScriptUnit cu= pkgDest.getJavaScriptUnit("X.js");
- String propertyValue = cu.getUnderlyingResource().getPersistentProperty(qualifiedName);
- assertEquals(
- "Server property should be copied with cu",
- "some value",
- propertyValue
- );
-}
-/**
- * Ensures that a package fragment can be copied to a different package fragment root.
- */
-public void testCopyPackageFragment() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgSource = getPackage("/P/src/p1");
-
- IPackageFragmentRoot rootDest= getPackageFragmentRoot("P", "src2");
-
- copyPositive(pkgSource, rootDest, null, null, false);
-}
-/**
- * Ensures that a package fragment can be copied to a different package fragment root.
- */
-public void testCopyReadOnlyPackageFragment() throws CoreException {
- if (!Util.isReadOnlySupported()) {
- // Do not test if file system does not support read-only attribute
- return;
- }
- IPackageFragment pkgSource = null;
- IPackageFragment pkg2 = null;
- try {
- this.createFolder("/P/src/p1/p2/p3");
- this.createFile(
- "/P/src/p1/p2/p3/X.js",
- "package p1.p2.p3;\n" +
- "public class X {\n" +
- "}"
- );
- Util.setReadOnly(getFile("/P/src/p1/p2/p3/X.js"), true);
- pkgSource = getPackage("/P/src/p1");
- Util.setReadOnly(pkgSource.getResource(), true);
- pkg2 = getPackage("/P/src/p1/p2/p3");
- Util.setReadOnly(pkg2.getResource(), true);
-
- IPackageFragmentRoot rootDest= getPackageFragmentRoot("P", "src2");
-
- copyPositive(pkg2, rootDest, null, null, false);
-
- assertTrue("Not readOnly", Util.isReadOnly(getPackage("/P/src2/p1").getResource()));
- assertTrue("Is readOnly", !Util.isReadOnly(getPackage("/P/src2/p1/p2").getResource()));
- assertTrue("Not readOnly", Util.isReadOnly(getPackage("/P/src2/p1/p2/p3").getResource()));
- assertTrue("Is readOnly", Util.isReadOnly(getFile("/P/src2/p1/p2/p3/X.js")));
- } finally {
- IFile xSrcFile = getFile("/P/src/p1/p2/p3/X.js");
- if (xSrcFile != null) {
- Util.setReadOnly(xSrcFile, false);
- }
- if (pkg2 != null) {
- Util.setReadOnly(pkg2.getResource(), false);
- }
- if (pkgSource != null) {
- Util.setReadOnly(pkgSource.getResource(), false);
- }
- IPackageFragment p1Fragment = getPackage("/P/src2/p1");
- if (p1Fragment != null) {
- Util.setReadOnly(p1Fragment.getResource(), false);
- }
- IPackageFragment p3Fragment = getPackage("/P/src2/p1/p2/p3");
- if (p3Fragment != null) {
- Util.setReadOnly(p3Fragment.getResource(), false);
- }
- IFile xFile = getFile("/P/src2/p1/p2/p3/X.js");
- if (xFile != null) {
- Util.setReadOnly(xFile, false);
- }
- deleteFolder("/P/src/p1");
- }
-}
-/**
- * Ensures that a WorkingCopy can be copied to a different package.
- */
-public void testCopyWorkingCopy() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
- copy = cuSource.getWorkingCopy(null);
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(copy, pkgDest, null, null, false);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-/*
- * Ensures that a CU can be copied over an existing primary working copy in a different package.
- * (regression test for bug 117282 Package declaration inserted on wrong CU while copying class if names collide and editor opened)
- */
-public void testCopyWorkingCopyDestination() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- createFolder("/P/src/p1");
- createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {}\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
- createFile(
- "/P/src/p2/X.js",
- "\n" +
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- copy = getCompilationUnit("/P/src/p2/X.js");
- copy.becomeWorkingCopy(null);
-
- copyPositive(cuSource, pkgDest, null, null, true/*force*/);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-/**
- * Ensures that a WorkingCopy can be copied to a different package, replacing an existing WorkingCopy.
- */
-public void testCopyWorkingCopyForce() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
- copy = cuSource.getWorkingCopy(null);
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/X.js",
- "package p2;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(copy, pkgDest, null, null, true);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-/**
- * Ensures that a WorkingCopy can be copied to a different package,
- * and be renamed.
- */
-public void testCopyWorkingCopyRename() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
- copy = cuSource.getWorkingCopy(null);
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(copy, pkgDest, null, "Y.js", false);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-/**
- * Ensures that a WorkingCopy can be copied to a different package,
- * and be renamed, overwriting an existing WorkingCopy
- */
-public void testCopyWorkingCopyRenameForce() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
- copy = cuSource.getWorkingCopy(null);
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/Y.js",
- "package p2;\n" +
- "public class Y {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyPositive(copy, pkgDest, null, "Y.js", true);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-/**
- * Ensures that a WorkingCopy cannot be copied to a different package,over an existing WorkingCopy when no force.
- */
-public void testCopyWorkingCopyWithCollision() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
- copy = cuSource.getWorkingCopy(null);
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/X.js",
- "package p2;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- copyNegative(copy, pkgDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-/**
- * Ensures that a WorkingCopy cannot be copied to an invalid destination
- */
-public void testCopyWorkingCopyWithInvalidDestination() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
- copy = cuSource.getWorkingCopy(null);
-
- copyNegative(copy, cuSource, null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-/**
- * This operation should fail as moving a CU and a CU member at the
- * same time is not supported.
- */
-public void testMoveCUAndType() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- moveNegative(
- new IJavaScriptElement[]{cuSource, cuSource.getType("X")},
- new IJavaScriptElement[]{cuSource.getParent(), cuSource},
- null,
- new String[]{"Y.js", "Y"},
- false,
- IJavaScriptModelStatusConstants.INVALID_ELEMENT_TYPES);
-}
-/**
- * Ensures that a CU can be moved to a different package, replacing an
- * existing CU.
- */
-public void testMoveCUForce() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/X.js",
- "package p2;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- movePositive(cuSource, pkgDest, null, null, true);
-}
-/**
- * Ensures that a CU can be moved to a different package,
- * be renamed
- */
-public void testMoveCURename() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- movePositive(cuSource, pkgDest, null, "Y.js", false);
-}
-/**
- * Ensures that a CU can be moved to a different package,
- * be renamed, overwriting an existing resource.
- */
-public void testMoveCURenameForce() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/Y.js",
- "package p2;\n" +
- "public class Y {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- movePositive(cuSource, pkgDest, null, "Y.js", true);
-}
-/**
- * Ensures that a CU cannot be moved to a different package, replacing an
- * existing CU when not forced.
- */
-public void testMoveCUWithCollision() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- this.createFolder("/P/src/p2");
- this.createFile(
- "/P/src/p2/X.js",
- "package p2;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- moveNegative(cuSource, pkgDest, null, null, false, IJavaScriptModelStatusConstants.NAME_COLLISION);
-}
-/**
- * Ensures that a CU cannot be moved to an invalid destination.
- */
-public void testMoveCUWithInvalidDestination() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- moveNegative(cuSource, cuSource, null, null, false, IJavaScriptModelStatusConstants.INVALID_DESTINATION);
-}
-/**
- * Ensures that a CU cannot be moved to a null container
- */
-public void testMoveCUWithNullContainer() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
-
- try {
- cuSource.move(null, null, null, false, null);
- } catch (IllegalArgumentException iae) {
- return;
- }
- assertTrue("Should not be able to move a cu to a null container", false);
-}
-/**
- * Ensures that a package fragment can be moved to a different package fragment root.
- */
-public void testMovePackageFragment() throws CoreException {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkgSource = getPackage("/P/src/p1");
-
- IPackageFragmentRoot rootDest= getPackageFragmentRoot("P", "src2");
-
- movePositive(pkgSource, rootDest, null, null, false);
-}
-/**
- * Ensures that a package fragment can be copied to a different package fragment root.
- */
-public void testMoveReadOnlyPackageFragment() throws CoreException {
- if (!Util.isReadOnlySupported()) {
- // Do not test if file system does not support read-only attribute
- return;
- }
- IPackageFragment pkgSource = null;
- IPackageFragment pkg2 = null;
- try {
- this.createFolder("/P/src/p1/p2/p3");
- this.createFile(
- "/P/src/p1/p2/p3/X.js",
- "package p1.p2.p3;\n" +
- "public class X {\n" +
- "}"
- );
- Util.setReadOnly(getFile("/P/src/p1/p2/p3/X.js"), true);
- pkgSource = getPackage("/P/src/p1");
- Util.setReadOnly(pkgSource.getResource(), true);
- pkg2 = getPackage("/P/src/p1/p2/p3");
- Util.setReadOnly(pkg2.getResource(), true);
-
- IPackageFragmentRoot rootDest= getPackageFragmentRoot("P", "src2");
-
- movePositive(pkg2, rootDest, null, null, false);
-
- assertTrue("Not readOnly", Util.isReadOnly(getPackage("/P/src2/p1").getResource()));
- assertTrue("Is readOnly", !Util.isReadOnly(getPackage("/P/src2/p1/p2").getResource()));
- assertTrue("Not readOnly", Util.isReadOnly(getPackage("/P/src2/p1/p2/p3").getResource()));
- assertTrue("Is readOnly", Util.isReadOnly(getFile("/P/src2/p1/p2/p3/X.js")));
- } finally {
- IFile xSrcFile = getFile("/P/src/p1/p2/p3/X.js");
- if (xSrcFile != null) {
- Util.setReadOnly(xSrcFile, false);
- }
- if (pkg2 != null) {
- Util.setReadOnly(pkg2.getResource(), false);
- }
- if (pkgSource != null) {
- Util.setReadOnly(pkgSource.getResource(), false);
- }
- IPackageFragment p1Fragment = getPackage("/P/src2/p1");
- if (p1Fragment != null) {
- Util.setReadOnly(p1Fragment.getResource(), false);
- }
- IPackageFragment p3Fragment = getPackage("/P/src2/p1/p2/p3");
- if (p3Fragment != null) {
- Util.setReadOnly(p3Fragment.getResource(), false);
- }
- IFile xFile = getFile("/P/src2/p1/p2/p3/X.js");
- if (xFile != null) {
- Util.setReadOnly(xFile, false);
- }
- deleteFolder("/P/src/p1");
- }
-}
-/**
- * Ensures that a WorkingCopy cannot be moved to a different package.
- */
-public void testMoveWorkingCopy() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cuSource = getCompilationUnit("/P/src/p1/X.js");
- copy = cuSource.getWorkingCopy(null);
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- moveNegative(copy, pkgDest, null, null, false, IJavaScriptModelStatusConstants.INVALID_ELEMENT_TYPES);
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-
-/*
- * Ensures that a primary working copy can be moved to a different package
- * and that its buffer doesn't contain unsaved changed after the move.
- * (regression test for bug 83599 CU dirty after move refactoring)
- */
-public void testMoveWorkingCopy2() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- this.createFolder("/P/src/p1");
- this.createFile(
- "/P/src/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- "}"
- );
- copy = getCompilationUnit("/P/src/p1/X.js");
- copy.becomeWorkingCopy(null);
-
- this.createFolder("/P/src/p2");
- IPackageFragment pkgDest = getPackage("/P/src/p2");
-
- movePositive(copy, pkgDest, null, null, false);
- assertTrue("Should not have unsaved changes", !copy.getBuffer().hasUnsavedChanges());
- } finally {
- if (copy != null) copy.discardWorkingCopy();
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveTests.java
deleted file mode 100644
index 7fcce84..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CopyMoveTests.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.jsdt.core.*;
-
-abstract public class CopyMoveTests extends ModifyingResourceTests {
-public CopyMoveTests(String name) {
- super(name);
-}
-/**
- * Attempts to copy the element with optional
- * forcing. The operation should fail with the failure code.
- */
-public void copyNegative(IJavaScriptElement element, IJavaScriptElement destination, IJavaScriptElement sibling, String rename, boolean force, int failureCode) {
- try {
- ((ISourceManipulation)element).copy(destination, sibling, rename, force, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Code not correct for JavaScriptModelException: " + jme, jme.getStatus().getCode() == failureCode);
- return;
- }
- assertTrue("The copy should have failed for: " + element, false);
- return;
-}
-/**
- * Attempts to copy the elements with optional
- * forcing. The operation should fail with the failure code.
- */
-public void copyNegative(IJavaScriptElement[] elements, IJavaScriptElement[] destinations, IJavaScriptElement[] siblings, String[] renames, boolean force, int failureCode) {
- try {
- getJavaModel().copy(elements, destinations, siblings, renames, force, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Code not correct for JavaScriptModelException: " + jme, jme.getStatus().getCode() == failureCode);
- return;
- }
- assertTrue("The move should have failed for for multiple elements: ", false);
- return;
-}
-/**
- * Copies the element to the container with optional rename
- * and forcing. The operation should succeed, so any exceptions
- * encountered are thrown.
- */
-public IJavaScriptElement copyPositive(IJavaScriptElement element, IJavaScriptElement container, IJavaScriptElement sibling, String rename, boolean force) throws JavaScriptModelException {
- // if forcing, ensure that a name collision exists
- if (force) {
- IJavaScriptElement collision = generateHandle(element, rename, container);
- assertTrue("Collision does not exist", collision.exists());
- }
-
- IJavaScriptElement copy;
- try {
- startDeltas();
-
- // copy
- ((ISourceManipulation) element).copy(container, sibling, rename, force, null);
-
- // ensure the original element still exists
- assertTrue("The original element must still exist", element.exists());
-
- // generate the new element handle
- copy = generateHandle(element, rename, container);
- assertTrue("Copy should exist", copy.exists());
-
- //ensure correct position
- if (element.getElementType() > IJavaScriptElement.JAVASCRIPT_UNIT) {
- ensureCorrectPositioning((IParent) container, sibling, copy);
- }
- if (copy.getElementType() == IJavaScriptElement.IMPORT_DECLARATION)
- container = ((IJavaScriptUnit) container).getImportContainer();
- IJavaScriptElementDelta destDelta = getDeltaFor(container, true);
- assertTrue("Destination container not changed", destDelta != null && destDelta.getKind() == IJavaScriptElementDelta.CHANGED);
- IJavaScriptElementDelta[] deltas = destDelta.getAddedChildren();
- assertTrue("Added children not correct for element copy", deltas[0].getElement().equals(copy));
- } finally {
- stopDeltas();
- }
- return copy;
-}
-/**
- * Generates a new handle to the original element in
- * its new container.
- */
-public IJavaScriptElement generateHandle(IJavaScriptElement original, String rename, IJavaScriptElement container) {
- String name = original.getElementName();
- if (rename != null) {
- name = rename;
- }
- switch (container.getElementType()) {
- case IJavaScriptElement.PACKAGE_FRAGMENT_ROOT :
- switch (original.getElementType()) {
- case IJavaScriptElement.PACKAGE_FRAGMENT :
- return ((IPackageFragmentRoot) container).getPackageFragment(name);
- default :
- assertTrue("illegal child type", false);
- break;
- }
- break;
- case IJavaScriptElement.PACKAGE_FRAGMENT :
- switch (original.getElementType()) {
- case IJavaScriptElement.JAVASCRIPT_UNIT :
- return ((IPackageFragment) container).getJavaScriptUnit(name);
- default :
- assertTrue("illegal child type", false);
- break;
- }
- break;
- case IJavaScriptElement.JAVASCRIPT_UNIT :
- switch (original.getElementType()) {
- case IJavaScriptElement.IMPORT_DECLARATION :
- return ((IJavaScriptUnit) container).getImport(name);
- case IJavaScriptElement.TYPE :
- if (isMainType(original, container)) {
- //the cu has been renamed as well
- container = ((IPackageFragment) container.getParent()).getJavaScriptUnit(name + ".js");
- }
- return ((IJavaScriptUnit) container).getType(name);
- default :
- assertTrue("illegal child type", false);
- break;
- }
- break;
- case IJavaScriptElement.TYPE :
- switch (original.getElementType()) {
- case IJavaScriptElement.METHOD :
- if (name.equals(original.getParent().getElementName())) {
- //method is a constructor
- return ((IType) container).getFunction(container.getElementName(), ((IFunction) original).getParameterTypes());
- }
- return ((IType) container).getFunction(name, ((IFunction) original).getParameterTypes());
- case IJavaScriptElement.FIELD :
- return ((IType) container).getField(name);
- case IJavaScriptElement.TYPE :
- return ((IType) container).getType(name);
- case IJavaScriptElement.INITIALIZER :
- //hack to return the first initializer
- return ((IType) container).getInitializer(1);
- default :
- assertTrue("illegal child type", false);
- break;
- }
- break;
- default :
- assertTrue("unsupported container type", false);
- break;
- }
- assertTrue("should not get here", false);
- return null;
-}
-/**
- * Returns true if this element is the main type of its compilation unit.
- */
-protected boolean isMainType(IJavaScriptElement element, IJavaScriptElement parent) {
- if (parent instanceof IJavaScriptUnit) {
- if (element instanceof IType) {
- IJavaScriptUnit cu= (IJavaScriptUnit)parent;
- String typeName = cu.getElementName();
- typeName = typeName.substring(0, typeName.length() - 5);
- return element.getElementName().equals(typeName) && element.getParent().equals(cu);
- }
- }
- return false;
-}
-/**
- * Attempts to move the element with optional
- * forcing. The operation should fail with the failure code.
- */
-public void moveNegative(IJavaScriptElement element, IJavaScriptElement destination, IJavaScriptElement sibling, String rename, boolean force, int failureCode) {
- try {
- ((ISourceManipulation)element).move(destination, sibling, rename, force, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Code not correct for JavaScriptModelException: " + jme, jme.getStatus().getCode() == failureCode);
- return;
- }
- assertTrue("The move should have failed for: " + element, false);
- return;
-}
-/**
- * Attempts to move the element with optional
- * forcing. The operation should fail with the failure code.
- */
-public void moveNegative(IJavaScriptElement[] elements, IJavaScriptElement[] destinations, IJavaScriptElement[] siblings, String[] renames, boolean force, int failureCode) {
- try {
- getJavaModel().move(elements, destinations, siblings, renames, force, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Code not correct for JavaScriptModelException: " + jme, jme.getStatus().getCode() == failureCode);
- return;
- }
- assertTrue("The move should have failed for for multiple elements: ", false);
- return;
-}
-/**
- * Moves the element to the container with optional rename
- * and forcing. The operation should succeed, so any exceptions
- * encountered are thrown.
- */
-public void movePositive(IJavaScriptElement element, IJavaScriptElement container, IJavaScriptElement sibling, String rename, boolean force) throws JavaScriptModelException {
- IJavaScriptElement[] siblings = new IJavaScriptElement[] {sibling};
- String[] renamings = new String[] {rename};
- if (sibling == null) {
- siblings = null;
- }
- if (rename == null) {
- renamings = null;
- }
- movePositive(new IJavaScriptElement[] {element}, new IJavaScriptElement[] {container}, siblings, renamings, force);
-}
-/**
- * Moves the elements to the containers with optional renaming
- * and forcing. The operation should succeed, so any exceptions
- * encountered are thrown.
- */
-public void movePositive(IJavaScriptElement[] elements, IJavaScriptElement[] destinations, IJavaScriptElement[] siblings, String[] names, boolean force) throws JavaScriptModelException {
- movePositive(elements, destinations, siblings, names, force, null);
-}
-/**
- * Moves the elements to the containers with optional renaming
- * and forcing. The operation should succeed, so any exceptions
- * encountered are thrown.
- */
-public void movePositive(IJavaScriptElement[] elements, IJavaScriptElement[] destinations, IJavaScriptElement[] siblings, String[] names, boolean force, IProgressMonitor monitor) throws JavaScriptModelException {
- // if forcing, ensure that a name collision exists
- int i;
- if (force) {
- for (i = 0; i < elements.length; i++) {
- IJavaScriptElement e = elements[i];
- IJavaScriptElement collision = null;
- if (names == null) {
- collision = generateHandle(e, null, destinations[i]);
- } else {
- collision = generateHandle(e, names[i], destinations[i]);
- }
- assertTrue("Collision does not exist", collision.exists());
- }
- }
-
- try {
- startDeltas();
-
- // move
- getJavaModel().move(elements, destinations, siblings, names, force, monitor);
- for (i = 0; i < elements.length; i++) {
- IJavaScriptElement element = elements[i];
- IJavaScriptElement moved = null;
- if (names == null) {
- moved = generateHandle(element, null, destinations[i]);
- } else {
- moved = generateHandle(element, names[i], destinations[i]);
- }
- // ensure the original element no longer exists, unless moving within the same container
- if (!destinations[i].equals(element.getParent())) {
- if (element.getElementType() == IJavaScriptElement.PACKAGE_FRAGMENT) {
- //moving a package fragment does not necessary mean that it no longer exists
- //it could have members that are not part of the Java Model
- try {
- IResource[] members = ((IContainer) element.getUnderlyingResource()).members();
- if (members.length == 0) {
- assertTrue("The original element must not exist", !element.exists());
- }
- } catch (CoreException ce) {
- throw new JavaScriptModelException(ce);
- }
- } else {
- assertTrue("The original element must not exist", !element.exists());
- }
- }
- assertTrue("Moved element should exist", moved.exists());
-
- //ensure correct position
- if (element.getElementType() > IJavaScriptElement.JAVASCRIPT_UNIT) {
- if (siblings != null && siblings.length > 0) {
- ensureCorrectPositioning((IParent) moved.getParent(), siblings[i], moved);
- }
- }
- IJavaScriptElementDelta destDelta = null;
- if (isMainType(element, destinations[i]) && names != null && names[i] != null) { //moved/renamed main type to same cu
- destDelta = getDeltaFor(moved.getParent());
- assertTrue("Renamed compilation unit as result of main type not added", destDelta != null && destDelta.getKind() == IJavaScriptElementDelta.ADDED);
- assertTrue("flag should be F_MOVED_FROM", (destDelta.getFlags() & IJavaScriptElementDelta.F_MOVED_FROM) > 0);
- assertTrue("moved from handle should be original", destDelta.getMovedFromElement().equals(element.getParent()));
- } else {
- destDelta = getDeltaFor(destinations[i], true);
- assertTrue("Destination container not changed", destDelta != null && destDelta.getKind() == IJavaScriptElementDelta.CHANGED);
- IJavaScriptElementDelta[] deltas = destDelta.getAddedChildren();
- assertTrue("Added children not correct for element copy", deltas[i].getElement().equals(moved));
- assertTrue("should be K_ADDED", deltas[i].getKind() == IJavaScriptElementDelta.ADDED);
- IJavaScriptElementDelta sourceDelta= getDeltaFor(element, false);
- assertTrue("should be K_REMOVED", sourceDelta.getKind() == IJavaScriptElementDelta.REMOVED);
- }
- }
- } finally {
- stopDeltas();
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreateCompilationUnitTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreateCompilationUnitTests.java
deleted file mode 100644
index 0895d12..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreateCompilationUnitTests.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.jsdt.core.IImportDeclaration;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-
-public class CreateCompilationUnitTests extends ModifyingResourceTests {
-public CreateCompilationUnitTests(String name) {
- super(name);
-}
-public static Test suite() {
- return buildModelTestSuite(CreateCompilationUnitTests.class);
-}
-public void setUp() throws Exception {
- super.setUp();
- createJavaProject("P");
- createFolder("/P/p");
- startDeltas();
-}
-public void tearDown() throws Exception {
- stopDeltas();
- deleteProject("P");
- super.tearDown();
-}
-/**
- * Ensures that a compilation unit can be created with specified source
- * in a package.
- * Verifies that the proper change deltas are generated as a side effect
- * of running the operation.
- * Ensure that the import container has been created correctly.
- */
-//no imports in JS
-public void _testCUAndImportContainer() throws JavaScriptModelException {
- IPackageFragment pkg = getPackage("/P/p");
- IJavaScriptUnit cu= pkg.createCompilationUnit("HelloImports.js",
- ("package p;\n" +
- "\n" +
- "import java.util.Enumeration;\n" +
- "import java.util.Vector;\n" +
- "\n" +
- "public class HelloImports {\n" +
- "\n" +
- " public static main(String[] args) {\n" +
- " System.out.println(\"HelloWorld\");\n" +
- " }\n" +
- "}\n"), false,null);
- assertCreation(cu);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " HelloImports.js[+]: {}"
- );
- IImportDeclaration[] imprts= cu.getImports();
- assertTrue("Import does not exist", imprts.length == 2 && imprts[0].exists());
- cu.close();
- imprts= cu.getImports();
- assertTrue("Import does not exist", imprts.length == 2 && imprts[0].exists());
-}
-/**
- * Ensures that a default compilation unit is created for a type if
- * it does not yet exist.
- */
-public void testDefaultCU() throws CoreException {
- IPackageFragment pkg = getPackage("/P/p");
- IJavaScriptUnit cu= pkg.getJavaScriptUnit("Default.js");
- IType type= cu.createType("function Default (){this.foo = \"\";}", null, false, null);
- assertCreation(cu);
- assertCreation(type);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " Default.js[+]: {}\n" +
- "\n" +
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " Default.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " Default[+]: {}"
- );
- // CU should have a package statement and type
- assertElementDescendants(
- "Unexpected children",
- "Default.js\n" +
- " function Default()\n" +
- " class Default\n" +
- " var foo\n" +
- " Default()",
- cu);
-
- // should fail if we try again
- try {
- pkg.createCompilationUnit("Default.js", "", false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Exception status not correct for creating a cu that already exists", jme.getStatus().getCode() == IJavaScriptModelStatusConstants.NAME_COLLISION);
- }
- // should fail if we try again
- try {
- pkg.createCompilationUnit("Default.js", "public class Default {}", true, null);
- return;
- } catch (JavaScriptModelException jme) {
- }
- assertTrue("Creation should not fail if the compilation unit already exists", false);
-}
-/**
- * Ensures that a default compilation unit is created for a type if
- * it does not yet exist.
- */
-public void testEmptyCU() {
- IPackageFragment pkg = getPackage("/P/p");
- // should fail if we try again
- try {
- pkg.createCompilationUnit("Empty.js", "", true, null);
- } catch (JavaScriptModelException jme) {
- }
- IJavaScriptUnit cu= pkg.getJavaScriptUnit("Empty.js");
- assertCreation(cu);
-}
-/*
- * Ensures that a compilation unit can be created even if a file already exists on the file system.
- * (regression test for bug 41611 CreateCompilationUnitOperation.executeOperation() should probably force creation more agressively)
- */
-public void testForce() throws JavaScriptModelException, IOException {
- IPackageFragment pkg = getPackage("/P/p");
- File folder = pkg.getResource().getLocation().toFile();
- new File(folder, "X.js").createNewFile();
- IJavaScriptUnit cu = pkg.createCompilationUnit(
- "X.js",
- "function X() {\n" +
- " \"\".toLowerCase();\n" +
- "}",
- true, // force,
- null);
- assertCreation(cu);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " X.js[+]: {}"
- );
-}
-/**
- * Ensures that a compilation unit cannot be created with an invalid name
- * in a package.
- */
-public void testInvalidName() {
- IPackageFragment pkg = getPackage("/P/p");
- try {
- pkg.createCompilationUnit("HelloWorld.j", null, false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Incorrect JavaScriptModelException thrown for creating a cu with invalid name", jme.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_NAME);
- try {
- pkg.createCompilationUnit(null, null, false,null);
- } catch (JavaScriptModelException jme2) {
- assertTrue("Incorrect JavaScriptModelException thrown for creating a cu with invalid name", jme2.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_NAME);
- return;
- }
- }
- assertTrue("No JavaScriptModelException thrown for creating a cu with an invalid name", false);
-}
-/**
- * Ensures that a compilation unit cannot be created with <code>null</code> source
- * in a package.
- */
-public void testNullContents() {
- IPackageFragment pkg = getPackage("/P/p");
- try {
- pkg.createCompilationUnit("HelloWorld.js", null, false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Incorrect JavaScriptModelException thrown for creating a cu with null contents: " + jme, jme.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_CONTENTS);
- return;
- }
- assertTrue("No JavaScriptModelException thrown for creating a cu with null contents", false);
-}
-/**
- * Ensures that a compilation unit can be created with specified source
- * in a package.
- * Verifies that the proper change deltas are generated as a side effect
- * of running the operation.
- */
-public void testSimpleCreation() throws JavaScriptModelException {
- IPackageFragment pkg = getPackage("/P/p");
- IJavaScriptUnit cu= pkg.createCompilationUnit("HelloWorld.js",
- ("function HelloWorld() {\n" +
- "\n" +
- " this.main = function(String[] args) {\n" +
- " \"HelloWorld\".toLowerCase();\n" +
- " }\n" +
- "}\n"), false, null);
- assertCreation(cu);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " HelloWorld.js[+]: {}"
- );
-}
-/**
- * Ensures that a default compilation unit is created for a type if
- * it does not yet exist.
- */
-public void testDefaultCUNewFolder() throws CoreException {
- createFolder("/P/z");
- IPackageFragment pkg = getPackage("/P/z");
- IJavaScriptUnit cu= pkg.getJavaScriptUnit("Default.js");
- IType type= cu.createType("function Default2 (){this.foo = \"\";}", null, false, null);
- assertCreation(cu);
- assertCreation(type);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " z[+]: {}\n"+
- "\n"+
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " z[*]: {CHILDREN}\n" +
- " Default.js[+]: {}\n" +
- "\n" +
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " z[*]: {CHILDREN}\n" +
- " Default.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " Default2[+]: {}"
- );
- // CU should have a package statement and type
- assertElementDescendants(
- "Unexpected children",
- "Default.js\n" +
- " function Default2()\n" +
- " class Default2\n" +
- " var foo\n" +
- " Default2()",
- cu);
-
- // should fail if we try again
- try {
- pkg.createCompilationUnit("Default.js", "", false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Exception status not correct for creating a cu that already exists", jme.getStatus().getCode() == IJavaScriptModelStatusConstants.NAME_COLLISION);
- }
- // should fail if we try again
- try {
- pkg.createCompilationUnit("Default.js", "public class Default {}", true, null);
- return;
- } catch (JavaScriptModelException jme) {
- }
- assertTrue("Creation should not fail if the compilation unit already exists", false);
-}
-
-/**
- * Ensures that creating a folder, compilation unit, and types results in
- * minimized deltas if in a workspace runnable, but that element info is
- * still made available.
- */
-public void testDefaultCUNewFolderOperation() throws CoreException {
- IWorkspaceRunnable testRun = new IWorkspaceRunnable(){
- public void run(IProgressMonitor monitor) throws CoreException {
- createFolder("/P/z");
- IPackageFragment pkg = getPackage("/P/z");
- IJavaScriptUnit cu= pkg.getJavaScriptUnit("Default.js");
- IType type= cu.createType("function Default2 (){this.foo = \"\";}", null, false, null);
- assertCreation(cu);
- assertCreation(type);
- }
- };
- ResourcesPlugin.getWorkspace().run(testRun, null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " z[+]: {}"//\n"+
-// "\n"+
-// "P[*]: {CHILDREN}\n" +
-// " <project root>[*]: {CHILDREN}\n" +
-// " z[*]: {CHILDREN}\n" +
-// " Default.js[+]: {}\n" +
-// "\n" +
-// "P[*]: {CHILDREN}\n" +
-// " <project root>[*]: {CHILDREN}\n" +
-// " z[*]: {CHILDREN}\n" +
-// " Default.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
-// " Default2[+]: {}"
- );
-
- IPackageFragment pkg = getPackage("/P/z");
- IJavaScriptUnit cu= pkg.getJavaScriptUnit("Default.js");
-
- // CU should have a package statement and type
- assertElementDescendants(
- "Unexpected children",
- "Default.js\n" +
- " function Default2()\n" +
- " class Default2\n" +
- " var foo\n" +
- " Default2()",
- cu);
-
- // should fail if we try again
- try {
- pkg.createCompilationUnit("Default.js", "", false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Exception status not correct for creating a cu that already exists", jme.getStatus().getCode() == IJavaScriptModelStatusConstants.NAME_COLLISION);
- }
- // should fail if we try again
- try {
- pkg.createCompilationUnit("Default.js", "public class Default {}", true, null);
- return;
- } catch (JavaScriptModelException jme) {
- }
- assertTrue("Creation should not fail if the compilation unit already exists", false);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreateMembersTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreateMembersTests.java
deleted file mode 100644
index 160ddc1..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreateMembersTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-
-public class CreateMembersTests extends AbstractJavaModelTests {
-
- public CreateMembersTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(CreateMembersTests.class, 1/*sort ascending order*/);
- }
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- setUpJavaProject("CreateMembers", "1.5");
- }
- public void tearDownSuite() throws Exception {
- deleteProject("CreateMembers");
-
- super.tearDownSuite();
- }
-
- public void test001() throws JavaScriptModelException {
- IJavaScriptUnit compilationUnit = getCompilationUnit("CreateMembers", "src", "", "A.js");
- assertNotNull("No compilation unit", compilationUnit);
-// IType[] types = compilationUnit.getTypes();
-// assertNotNull("No types", types);
-// assertEquals("Wrong size", 1, types.length);
-// IType type = types[0];
- compilationUnit.createMethod("\tfunction foo() {\n\t\tSystem.out.println(\"Hello World\");\n\t}\n", null, true, new NullProgressMonitor());
- String expectedSource =
- "var aVar;\n" +
- "\n" +
- "function foo() {\n" +
- "\tSystem.out.println(\"Hello World\");\n" +
- "}" +
- "";
- assertSourceEquals("Unexpected source", expectedSource, compilationUnit.getSource());
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86906
- public void test002() throws JavaScriptModelException {
- IJavaScriptUnit compilationUnit = getCompilationUnit("CreateMembers", "src", "", "A2.js");
- assertNotNull("No compilation unit", compilationUnit);
-// IType[] types = compilationUnit.getTypes();
-// assertNotNull("No types", types);
-// assertEquals("Wrong size", 1, types.length);
-// IType type = types[0];
- IField sibling = compilationUnit.getField("aVar");
- compilationUnit.createField("var i;", sibling, true, null);
- String expectedSource =
- "var i;\n" +
- "\n" +
- "var aVar;" +
- "";
- assertSourceEquals("Unexpected source", expectedSource, compilationUnit.getSource());
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86906
- public void test003() throws JavaScriptModelException {
- IJavaScriptUnit compilationUnit = getCompilationUnit("CreateMembers", "src", "", "Annot.js");
- assertNotNull("No compilation unit", compilationUnit);
- IType[] types = compilationUnit.getTypes();
- assertNotNull("No types", types);
- assertEquals("Wrong size", 1, types.length);
- IType type = types[0];
- IFunction sibling = type.getFunction("foo", new String[]{});
- type.createMethod("String bar();", sibling, true, null);
- String expectedSource =
- "public @interface Annot {\n" +
- " String bar();\n" +
- "\n" +
- " String foo();\n" +
- "}";
- assertSourceEquals("Unexpected source", expectedSource, type.getSource());
- }
-
- /*
- * Ensures that the handle for a created method that has varargs type arguments is correct.
- * (regression test for bug 93487 IType#findMethods fails on vararg methods)
- */
- public void test004() throws JavaScriptModelException {
- IType type = getCompilationUnit("/CreateMembers/src/A.js").getType("A");
- IFunction method = type.createMethod(
- "void bar(String... args) {}",
- null, // no siblings
- false, // don't force
- null // no progress monitor
- );
- assertTrue("Method should exist", method.exists());
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=95580
- public void test005() throws JavaScriptModelException {
- IJavaScriptUnit compilationUnit = getCompilationUnit("CreateMembers", "src", "", "E2.js");
- assertNotNull("No compilation unit", compilationUnit);
- IType[] types = compilationUnit.getTypes();
- assertNotNull("No types", types);
- assertEquals("Wrong size", 1, types.length);
- IType type = types[0];
- type.createField("int i;", null, true, null);
- String expectedSource =
- "public enum E2 {\n" +
- " A, B, C;\n\n" +
- " int i;\n" +
- "}";
- assertSourceEquals("Unexpected source", expectedSource, type.getSource());
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=95580
- public void test006() throws JavaScriptModelException {
- IJavaScriptUnit compilationUnit = getCompilationUnit("CreateMembers", "src", "", "E3.js");
- assertNotNull("No compilation unit", compilationUnit);
- IType[] types = compilationUnit.getTypes();
- assertNotNull("No types", types);
- assertEquals("Wrong size", 1, types.length);
- IType type = types[0];
- type.createType("class DD {}", null, true, null);
- String expectedSource =
- "public enum E3 {\n" +
- " A, B, C;\n\n" +
- " class DD {}\n" +
- "}";
- assertSourceEquals("Unexpected source", expectedSource, type.getSource());
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreatePackageTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreatePackageTests.java
deleted file mode 100644
index 98427ee..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CreatePackageTests.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.Test;
-
-public class CreatePackageTests extends ModifyingResourceTests {
-public CreatePackageTests(String name) {
- super(name);
-}
-public static Test suite() {
- return buildModelTestSuite(CreatePackageTests.class);
-}
-public void setUp() throws Exception {
- super.setUp();
- createJavaProject("P");
- createFolder("/P/p");
- startDeltas();
-}
-public void tearDown() throws Exception {
- stopDeltas();
- deleteProject("P");
- super.tearDown();
-}
-/**
- * Ensures that a package fragment can be created in a package
- * fragment root.
- * Verifies that the proper change deltas are generated as a side effect
- * of running the operation.
- */
-public void testCreatePackageFragment1() throws JavaScriptModelException {
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "");
- IPackageFragment frag= root.createPackageFragment("one.two.three", false, null);
- assertCreation(frag);
- assertTrue("Fragment return not correct", frag.getElementName().equals("one.two.three"));
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " one[+]: {}\n" +
- " one.two[+]: {}\n" +
- " one.two.three[+]: {}"
- );
-}
-/**
- * Ensures that a package fragment that shares a prefix path with
- * an existing package fragment can be created in a package
- * fragment root.
- * Verifies that the proper change deltas are generated as a side effect
- * of running the operation.
- */
-public void testCreatePackageFragment2() throws JavaScriptModelException {
- IPackageFragmentRoot root = getPackageFragmentRoot("P", "");
- IPackageFragment frag= root.createPackageFragment("one.two.three.four", false, null);
- assertCreation(frag);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " one[+]: {}\n" +
- " one.two[+]: {}\n" +
- " one.two.three[+]: {}\n" +
- " one.two.three.four[+]: {}"
- );
-}
-/**
- * Ensures that a package fragment can be created for the default package
- */
-public void testCreatePackageFragment3() throws JavaScriptModelException {
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "");
- IPackageFragment frag= root.createPackageFragment("", false, null);
- assertCreation(frag);
- assertTrue("Fragment return not correct", frag.getElementName().equals(""));
-}
-/**
- * Ensures that a package fragment can be created even if its name is unconventional.
- * (regression test for 9479 exception on package creation (discouraged name))
- */
-public void testCreatePackageFragment4() throws JavaScriptModelException {
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "");
- IPackageFragment frag= root.createPackageFragment("A", false, null);
- assertCreation(frag);
- assertTrue("Fragment return not correct", frag.getElementName().equals("A"));
-}
-/**
- * Ensures that a package fragment that already exists is not duplicated in the package
- * fragment root.
- */
-public void testDuplicatePackageFragment() throws JavaScriptModelException {
- IPackageFragmentRoot root= getPackageFragmentRoot("P", "");
- IPackageFragment frag= root.createPackageFragment("p", false, null);
- assertCreation(frag);
- assertDeltas(
- "Unexpected delta",
- ""
- );
-}
-/**
- * Ensures that a package fragment cannot be created with an invalid parameters.
- */
-public void testInvalidPackageFragment() throws CoreException {
- createFile("/P/p/other", "");
- IPackageFragmentRoot root = getPackageFragmentRoot("P", "");
- try {
- root.createPackageFragment(null, false, null);
- } catch (JavaScriptModelException jme) {
- assertTrue("Incorrect JavaScriptModelException thrown for creating an package fragment with invalid name", jme.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_NAME);
- try {
- root.createPackageFragment("java.jfg.", false, null);
- } catch (JavaScriptModelException jme2) {
- assertTrue("Incorrect JavaScriptModelException thrown for creating a package fragment with invalid name", jme2.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_NAME);
- try {
- root.createPackageFragment("p.other", false, null);
- } catch (JavaScriptModelException jme3) {
- assertTrue("Incorrect JavaScriptModelException thrown for creating a package fragment that collides with a file", jme3.getStatus().getCode() == IJavaScriptModelStatusConstants.NAME_COLLISION);
- return;
- }
- }
- }
- assertTrue("No JavaScriptModelException thrown for creating a package fragment with an invalid parameters", false);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/DefaultJavaElementComparator.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/DefaultJavaElementComparator.java
deleted file mode 100644
index 385264b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/DefaultJavaElementComparator.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.util.JavaScriptUnitSorter;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * The class <code>DefaultJavaElementComparator</code> is a standard
- * implementation of a comparator.
- * <p>
- * <ul>
- * <li>static fields, arranged alphabetically by name and access modifier
- * (public, protected, private, default)</li>
- * <li>static initializers in order of appearance</li>
- * <li>instance fields, arranged alphabetically by name and access modifier
- * (public, protected, private, default)</li>
- * <li>instance initializers in order of appearance</li>
- * <li>type declarations, arranged alphabetically by name and access modifier
- * (public, protected, private, default)</li>
- * <li>constructors, arranged by parameter order and access modifier
- * (public, protected, private, default)</li>
- * <li>methods, arranged by alphabetically by name and parameter order and
- * access modifier (public, protected, private, default)</li>
- * </p>
- */
-class DefaultJavaElementComparator implements Comparator {
-
- private static final int STATIC_TYPE_CATEGORY = 0;
- private static final int STATIC_FIELD_CATEGORY = 1;
- private static final int STATIC_INITIALIZER_CATEGORY = 2;
- private static final int STATIC_METHOD_CATEGORY = 3;
- private static final int TYPE_CATEGORY = 4;
- private static final int FIELD_CATEGORY = 5;
- private static final int INITIALIZER_CATEGORY = 6;
- private static final int CONSTRUCTOR_CATEGORY = 7;
- private static final int METHOD_CATEGORY = 8;
-
- private Collator collator;
-
- private int[] categories;
-
- /**
- * Creates an instance that sorts the various categories of body
- * declarations in the following order:
- * <ol>
- * <li>static types</li>
- * <li>static fields </li>
- * <li>static initializers</li>
- * <li>non-static fields</li>
- * <li>instance initializers</li>
- * <li>types</li>
- * <li>static methods</li>
- * <li>constructors</li>
- * <li>non-static methods</li>
- * </ol>
- */
- public DefaultJavaElementComparator() {
- // initialize default categories
- this.categories = new int[] {
- 1, // static type
- 2, // static field
- 3, // static initializer
- 7, // static method
- 6, // type
- 4, // field
- 5, // initializer
- 8, // constructor
- 9 // method
- };
- this.collator = Collator.getInstance();
- }
-
- /**
- * Creates an instance that arranges the various categories of body
- * declarations.
- * This constructor is used to specify customized values for the different categories.
- * They are a convinient way to distinguish AST nodes.
- * The lower a value is, the higher the node will appear in the sorted
- * compilation unit.
- * <p>
- * There are nine categories with theirs default values:
- * <ol>
- * <li>static types (1)</li>
- * <li>static fields (2)</li>
- * <li>static initializers (3)</li>
- * <li>fields (4) </li>
- * <li>initializers (5)</li>
- * <li>types (6)</li>
- * <li>static methods (7)</li>
- * <li>constructors (8)</li>
- * <li>methods (9)</li>
- * </ol>
- * </p>
- *
- * @param staticTypeCategory the given value for the static type category
- * @param staticFieldCategory the given value for the static field category
- * @param staticInitializerCategory the given value for the static initializer category
- * @param staticMethodCategory the given value for static the method category
- * @param typeCategory the given value for the type category
- * @param fieldCategory the given value for field category
- * @param initializerCategory the given value for initializer category
- * @param constructorCategory the given value for constructor category
- * @param methodCategory the given value for method category
- */
- public DefaultJavaElementComparator(
- int staticTypeCategory,
- int staticFieldCategory,
- int staticInitializerCategory,
- int staticMethodCategory,
- int typeCategory,
- int fieldCategory,
- int initializerCategory,
- int constructorCategory,
- int methodCategory) {
- this.categories = new int[] {
- staticTypeCategory,
- staticFieldCategory,
- staticInitializerCategory,
- staticMethodCategory,
- typeCategory,
- fieldCategory,
- initializerCategory,
- constructorCategory,
- methodCategory
- };
- this.collator = Collator.getInstance();
- }
-
- /**
- * This method is used to retrieve the category for a body declaration node according to the
- * preferences passed at the creation of the comparator.
- *
- * @param node the given node
- * @return the category corresponding to the given node
- *
- * @since 2.1
- */
- private int getCategory(BodyDeclaration node) {
- switch(node.getNodeType()) {
- case ASTNode.FUNCTION_DECLARATION :
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- if (methodDeclaration.isConstructor()) {
- return this.categories[CONSTRUCTOR_CATEGORY];
- }
- if (Flags.isStatic(methodDeclaration.getModifiers())) {
- return this.categories[STATIC_METHOD_CATEGORY];
- }
- return this.categories[METHOD_CATEGORY];
- case ASTNode.FIELD_DECLARATION :
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- if (Flags.isStatic(fieldDeclaration.getModifiers())) {
- return this.categories[STATIC_FIELD_CATEGORY];
- }
- return this.categories[FIELD_CATEGORY];
- case ASTNode.TYPE_DECLARATION :
- AbstractTypeDeclaration abstractTypeDeclaration = (AbstractTypeDeclaration) node;
- if (Flags.isStatic(abstractTypeDeclaration.getModifiers())) {
- return this.categories[STATIC_TYPE_CATEGORY];
- }
- return this.categories[TYPE_CATEGORY];
- case ASTNode.INITIALIZER :
- Initializer initializer = (Initializer) node;
- if (Flags.isStatic(initializer.getModifiers())) {
- return this.categories[STATIC_INITIALIZER_CATEGORY];
- }
- return this.categories[INITIALIZER_CATEGORY];
- }
- return 0;
- }
-
- /**
- * The <code>DefaultJavaElementComparator</code> implementation of this
- * <code>java.util.Comparator</code> method can only be used to compare
- * instances of <code>org.eclipse.wst.jsdt.core.dom.BodyDeclaration</code>.
- * <p>
- * The categories of each body declaration are compared. If they are
- * in different categories, they are ordered based on their category.
- * Body declarations within the same category are ordered by signature
- * string. Body declarations with the same signature string are ordered
- * by their original relative positions.
- * </p>
- */
- public int compare(Object o1, Object o2) {
- if (!(o1 instanceof BodyDeclaration) && !(o2 instanceof BodyDeclaration)) {
- throw new ClassCastException();
- }
- BodyDeclaration node1 = (BodyDeclaration) o1;
- BodyDeclaration node2 = (BodyDeclaration) o2;
- int category1 = getCategory(node1);
- int category2 = getCategory(node2);
-
- if (category1 != category2) {
- return category1 - category2;
- }
- if (o1 == o2) {
- return 0;
- }
- String node1Signature = buildSignature(node1);
- String node2Signature = buildSignature(node2);
- if (node1Signature.length() != 0 && node2Signature.length() != 0) {
- int compare = this.collator.compare(node1Signature, node2Signature);
- if (compare != 0) {
- return compare;
- }
- }
- int sourceStart1 = ((Integer) node1.getProperty(JavaScriptUnitSorter.RELATIVE_ORDER)).intValue();
- int sourceStart2 = ((Integer) node2.getProperty(JavaScriptUnitSorter.RELATIVE_ORDER)).intValue();
- return sourceStart1 - sourceStart2;
- }
-
- private String buildSignature(BodyDeclaration node) {
- switch(node.getNodeType()) {
- case ASTNode.FUNCTION_DECLARATION :
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- StringBuffer buffer = new StringBuffer();
- buffer.append(methodDeclaration.getName().getIdentifier());
- final List parameters = methodDeclaration.parameters();
- int length1 = parameters.size();
- for (int i = 0; i < length1; i++) {
- SingleVariableDeclaration parameter = (SingleVariableDeclaration) parameters.get(i);
- buffer.append(parameter.getName().getIdentifier());
- Type type = parameter.getType();
- buffer.append(buildSignature(type));
- }
- return String.valueOf(buffer);
- case ASTNode.FIELD_DECLARATION :
- FieldDeclaration fieldDeclaration = (FieldDeclaration) node;
- return ((VariableDeclarationFragment) fieldDeclaration.fragments().get(0)).getName().getIdentifier();
- case ASTNode.INITIALIZER :
- return ((Integer) node.getProperty(JavaScriptUnitSorter.RELATIVE_ORDER)).toString();
- case ASTNode.TYPE_DECLARATION :
- AbstractTypeDeclaration abstractTypeDeclaration = (AbstractTypeDeclaration) node;
- return abstractTypeDeclaration.getName().getIdentifier();
- }
- return null;
- }
-
- private String buildSignature(Type type) {
- switch(type.getNodeType()) {
- case ASTNode.PRIMITIVE_TYPE :
- PrimitiveType.Code code = ((PrimitiveType) type).getPrimitiveTypeCode();
- return code.toString();
- case ASTNode.ARRAY_TYPE :
- ArrayType arrayType = (ArrayType) type;
- StringBuffer buffer = new StringBuffer();
- buffer.append(buildSignature(arrayType.getElementType()));
- int dimensions = arrayType.getDimensions();
- for (int j = 0; j < dimensions; j++) {
- buffer.append("[]"); //$NON-NLS-1$
- }
- return buffer.toString();
- case ASTNode.SIMPLE_TYPE :
- SimpleType simpleType = (SimpleType) type;
- return buildSignature(simpleType.getName());
- }
- return null; // should never happen
- }
-
- private String buildSignature(Name name) {
- if (name.isSimpleName()) {
- return ((SimpleName) name).getIdentifier();
- }
- QualifiedName qualifiedName = (QualifiedName) name;
- return buildSignature(qualifiedName.getQualifier()) + "." + buildSignature(qualifiedName.getName()); //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/DeleteTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/DeleteTests.java
deleted file mode 100644
index 78a571a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/DeleteTests.java
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IImportDeclaration;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-
-/*
- * Tests for ISourceManipulation.delete(...)
- */
-public class DeleteTests extends ModifyingResourceTests {
-
-public DeleteTests(String name) {
- super(name);
-}
-protected void setUp() throws Exception {
- super.setUp();
- // ensure that indexing is not going to interfer with deletion
- waitUntilIndexesReady();
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
- createJavaProject("P");
-}
-public static Test suite() {
- return buildModelTestSuite(DeleteTests.class);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "testDeleteField5" };
-// TESTS_NUMBERS = new int[] { 2, 12 };
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-public void tearDownSuite() throws Exception {
- deleteProject("P");
- super.tearDownSuite();
-}
-/**
- * Ensures that all import declarations can be deleted, and the container
- * is reported as removed.
- */
-public void testDeleteAllImports() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "import java.util.*;\n" +
- "import q.Y;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IImportDeclaration[] children= cu.getImports();
-
- startDeltas();
- assertDeletion(children);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " <import container>[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that a binary method cannot be deleted.
- */
-public void testDeleteBinaryMethod() throws CoreException {
- try {
- createJavaProject("P1", new String[] {}, new String[] {"lib"});
-
- /* Evaluate the following in a scrapbook:
- org.eclipse.wst.jsdt.core.tests.model.ModifyingResourceTests.generateClassFile(
- "X",
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}")
- */
- byte[] bytes = new byte[] {
- -54, -2, -70, -66, 0, 3, 0, 45, 0, 14, 1, 0, 1, 88, 7, 0, 1, 1, 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 7, 0, 3, 1, 0, 6, 60, 105, 110, 105, 116, 62, 1, 0, 3, 40, 41, 86, 1, 0, 4, 67, 111, 100, 101, 12, 0, 5, 0, 6, 10, 0, 4, 0, 8, 1, 0, 15, 76, 105, 110, 101, 78, 117,
- 109, 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 3, 102, 111, 111, 1, 0, 10, 83, 111, 117, 114, 99, 101, 70, 105, 108, 101, 1, 0, 6, 88, 46, 106, 97, 118, 97, 0, 33, 0, 2, 0, 4, 0, 0, 0, 0, 0, 2, 0, 1, 0, 5, 0, 6, 0, 1, 0, 7, 0, 0, 0, 29, 0, 1, 0, 1, 0, 0, 0, 5, 42, -73, 0, 9, -79, 0, 0, 0, 1,
- 0, 10, 0, 0, 0, 6, 0, 1, 0, 0, 0, 1, 0, 1, 0, 11, 0, 6, 0, 1, 0, 7, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, -79, 0, 0, 0, 1, 0, 10, 0, 0, 0, 6, 0, 1, 0, 0, 0, 3, 0, 1, 0, 12, 0, 0, 0, 2, 0, 13,
- };
- this.createFile("P1/lib/X.class", bytes);
-
- IClassFile cf = getClassFile("P1/lib/X.class");
- IFunction method = cf.getType().getFunction("foo", new String[] {});
-
- try {
- method.delete(false, null);
- } catch (JavaScriptModelException e) {
- assertTrue("Should be read-only", e.getStatus().getCode() == IJavaScriptModelStatusConstants.READ_ONLY);
- return;
- }
- assertTrue("Should not be able to delete a binary method", false);
- } finally {
- deleteProject("P1");
- }
-}
-/**
- * Ensures that a binary type cannot be deleted.
- */
-public void testDeleteBinaryType() throws CoreException {
- try {
- createJavaProject("P1", new String[] {}, new String[] {"lib"});
-
- /* Evaluate the following in a scrapbook:
- org.eclipse.wst.jsdt.core.tests.model.ModifyingResourceTests.generateClassFile(
- "X",
- "public class X {\n" +
- "}")
- */
- byte[] bytes = new byte[] {
- -54, -2, -70, -66, 0, 3, 0, 45, 0, 13, 1, 0, 1, 88, 7, 0, 1, 1, 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 7, 0, 3, 1, 0, 6, 60, 105, 110, 105, 116, 62, 1, 0, 3, 40, 41, 86, 1, 0, 4, 67, 111, 100, 101, 12, 0, 5, 0, 6, 10, 0, 4, 0, 8, 1, 0, 15, 76, 105, 110, 101, 78, 117,
- 109, 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 10, 83, 111, 117, 114, 99, 101, 70, 105, 108, 101, 1, 0, 6, 88, 46, 106, 97, 118, 97, 0, 33, 0, 2, 0, 4, 0, 0, 0, 0, 0, 1, 0, 1, 0, 5, 0, 6, 0, 1, 0, 7, 0, 0, 0, 29, 0, 1, 0, 1, 0, 0, 0, 5, 42, -73, 0, 9, -79, 0, 0, 0, 1, 0, 10, 0, 0, 0, 6,
- 0, 1, 0, 0, 0, 1, 0, 1, 0, 11, 0, 0, 0, 2, 0, 12,
- };
- this.createFile("P1/lib/X.class", bytes);
-
- IClassFile cf = getClassFile("P1/lib/X.class");
- IType binaryType = cf.getType();
-
- try {
- cf.getJavaScriptModel().delete(new IJavaScriptElement[] {binaryType}, false, null);
- } catch (JavaScriptModelException e) {
- assertTrue("Should be read-only", e.getStatus().getCode() == IJavaScriptModelStatusConstants.READ_ONLY);
- return;
- }
- assertTrue("Should not be able to delete a class file", false);
- } finally {
- deleteProject("P1");
- }
-}
-/**
- * Should be able to delete a CU.
- */
-public void testDeleteCompilationUnit1() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
-
- startDeltas();
- cu.delete(false, null);
- assertTrue("Should be able to delete a CU", !cu.exists());
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-
-/**
- * Ensure that if a CU is deleted from underneath us in the default
- * package of a nested root, it disappears from existence.
- */
-public void testDeleteCompilationUnit2() throws CoreException {
- try {
- IFile file = createFile(
- "P/X.js",
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
-
- startDeltas();
- Util.delete(file);
- assertTrue("Should be able to delete a CU", !cu.exists());
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * After deleting a CU in an IWorkspaceRunnable, it should not exist.
- * (regression test for bug 9232 IJavaScriptUnit.delete() fails)
- */
-public void testDeleteCompilationUnit3() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- "}"
- );
- final IJavaScriptUnit cu = getCompilationUnit("P/X.js");
-
- // force the cu to be opened
- cu.open(null);
-
- startDeltas();
- ResourcesPlugin.getWorkspace().run(
- new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- cu.delete(true, null);
- assertTrue("Should be able to delete a CU", !cu.exists());
- }
- },
- null
- );
- assertTrue("Should be able to delete a CU", !cu.exists());
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Should be able to delete a CU in a non-default package.
- */
-public void testDeleteCompilationUnit4() throws CoreException {
- try {
- createFolder("P/p");
- IFile file = createFile(
- "P/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/p/X.js");
-
- startDeltas();
- cu.delete(false, null);
- assertTrue("CU should not exist", !cu.exists());
- assertTrue("Corresponding file should not exist", !file.exists());
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " X.java[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFolder("P/p");
- }
-}
-/**
- * Ensures that a constructor can be deleted.
- * Verify that the correct change deltas are generated.
- */
-public void testDeleteConstructor() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " public X(String s) {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IFunction constructor = cu.getType("X").getFunction("X", new String[] {"QString;"});
-
- startDeltas();
- assertDeletion(constructor);
- assertTrue("Should be able to delete a constructor", !constructor.exists());
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " X(String)[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensure that deleting an empty package fragment that has a sub-package is not possible.
- */
-public void testDeleteEmptyPackageFragment() throws CoreException {
- try {
- createFolder("P/p1/p2");
- IPackageFragment pkg = getPackage("P/p1");
- IFolder folder = getFolder("P/p1");
-
- startDeltas();
- pkg.delete(false, null);
- assertTrue("Folder should exist", folder.exists());
- assertTrue("Fragment should exist", pkg.exists());
- assertDeltas(
- "Unexpected delta",
- ""
- );
- } finally {
- stopDeltas();
- deleteFolder("P/p1");
- }
-}
-/**
- * Ensures that a field can be deleted.
- */
-public void testDeleteField1() throws CoreException { // was testDeleteField
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " int field;\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IField field = cu.getType("X").getField("field");
-
- startDeltas();
- assertDeletion(field);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " field[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that deletion can be canceled.
- */
-public void testDeleteField2() throws CoreException { // was testDeleteFieldWithCancel
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " int field;\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IField field = cu.getType("X").getField("field");
-
- boolean isCanceled = false;
- try {
- TestProgressMonitor monitor = TestProgressMonitor.getInstance();
- monitor.setCancelledCounter(1);
- getJavaModel().delete(new IJavaScriptElement[] {field}, false, monitor);
- } catch (OperationCanceledException e) {
- isCanceled = true;
- }
- assertTrue("Operation should have thrown an operation canceled exception", isCanceled);
- } finally {
- deleteFile("P/X.js");
- }
-}
-/*
- * Ensures that a field can be deleted inside a scheduling rule that include the resource only.
- * (regression test for bug 73078 ISourceManipulation.delete() tries to run in WorkspaceRoot scheduling rule)
- */
-public void testDeleteField3() throws CoreException {
- try {
- IFile file = createFile(
- "P/X.js",
- "public class X {\n" +
- " int field;\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- final IField field = cu.getType("X").getField("field");
-
- startDeltas();
- getWorkspace().run(
- new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- assertDeletion(field);
- }
- },
- file,
- IWorkspace.AVOID_UPDATE,
- null);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " field[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/*
- * Ensures that a field with initializer can be deleted.
- * (regression test for bug 112935 IField.delete is not deleting the value of the variable.)
- */
-public void testDeleteField4() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " private String t = \"sample test\";\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IField field = cu.getType("X").getField("t");
- field.delete(false, null);
- assertSourceEquals(
- "Unexpected source",
- "public class X {\n" +
- "}",
- cu.getSource());
- } finally {
- deleteFile("P/X.js");
- }
-}
-/**
- * Delete enum
- */
-public void testDeleteField5() throws CoreException {
- try {
- this.createJavaProject("P1", new String[] {""}, new String[] {"JCL15_LIB"}, null, "", "1.5");
- createFile(
- "P1/X.js",
- "public enum X {\n" +
- " A, B, C\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P1/X.js");
- IField field = cu.getType("X").getField("A");
- field.delete(false, null);
- assertSourceEquals(
- "Unexpected source",
- "public enum X {\n" +
- " B, C\n" +
- "}",
- cu.getSource());
- } finally {
- deleteProject("P1");
- }
-}
-/**
- * Ensures that an import declaration can be deleted.
- */
-public void testDeleteImportDeclaration() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "import java.util.*;\n" +
- "import q.Y;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IImportDeclaration imp= cu.getImport("q.Y");
-
- startDeltas();
- assertDeletion(imp);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " <import container>[*]: {CHILDREN | FINE GRAINED}\n" +
- " import q.Y[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that a method can be deleted.
- */
-public void testDeleteMethod() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IFunction method = cu.getType("X").getFunction("foo", new String[] {});
-
- startDeltas();
- assertDeletion(method);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that multiple member Java elements contained within different
- * compilation units can be deleted.
- * Verifies that the correct changed deltas are generated.
- */
-public void testDeleteMultipleMembersFromVariousCUs() throws CoreException {
- try {
- createFolder("P/a/b/c");
- createFile(
- "P/a/b/c/X.js",
- "package a.b.c;\n" +
- "import java.util.Vector;\n" +
- "import java.util.Enumeration;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello World\");\n" +
- " }\n" +
- " static class Bar {\n" +
- " private final java.lang.String test = \"testminor\";\n" +
- " public Bar() {\n" +
- " super();\n" +
- " }\n" +
- " private void test() {\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- createFile(
- "P/a/b/Y.js",
- "package a.b;\n" +
- "public class Y {\n" +
- " int foo;\n" +
- " public static void main(String[] args) {\n" +
- " System.out.println(\"Hello World\");\n" +
- " }\n" +
- "}"
- );
-
- // elements to be deleted:
- // from a/b/c/X.java:
- // java.util.Vector
- // main
- // Bar (inner type)
- // Bar (constructor)
- // test
- // Bar (inner type, same as above)
-
- // from a/b/Y.java
- // foo
- // main
-
- IJavaScriptUnit cuX = getCompilationUnit("P/a/b/c/X.js");
- IType typeX = cuX.getType("X");
- IType typeBar = typeX.getType("Bar");
-
- IJavaScriptElement[] toBeDeleted = new IJavaScriptElement[8];
- toBeDeleted[0] = cuX.getImport("java.util.Vector");
- toBeDeleted[1] = typeX.getFunction("main", new String[] {"[QString;"});
- toBeDeleted[2] = typeBar;
- toBeDeleted[3] = typeBar.getFunction("Bar", new String[] {});
- toBeDeleted[4] = typeBar.getFunction("test", new String[] {});
- toBeDeleted[5] = typeBar;
-
- IJavaScriptUnit cuY = getCompilationUnit("P/a/b/Y.js");
- IType typeY = cuY.getType("Y");
-
- toBeDeleted[6] = typeY.getField("foo");
- toBeDeleted[7] = typeY.getFunction("main", new String[] {"[QString;"});
-
- startDeltas();
- assertDeletion(toBeDeleted);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " a.b[*]: {CHILDREN}\n" +
- " Y.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " Y[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo[-]: {}\n" +
- " main(String[])[-]: {}\n" +
- " a.b.c[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " <import container>[*]: {CHILDREN | FINE GRAINED}\n" +
- " import java.util.Vector[-]: {}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " Bar[-]: {}\n" +
- " main(String[])[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFolder("P/a");
- }
-}
-public void testDeletePackageFragment1() throws CoreException {
- try {
- createFolder("P/a/b/c");
- createFile(
- "P/a/b/c/X.js",
- "package a.b.c;\n" +
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkg = getPackage("P/a/b/c");
- IFolder folder = getFolder("P/a/b/c");
-
- startDeltas();
- pkg.delete(false, null);
- assertTrue("Folder should not exist", !folder.exists());
- assertTrue("Fragment should not exist", !pkg.exists());
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " a.b.c[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFolder("P/p1");
- }
-}
-/*
- * Ensures that deleting a default package doesn't remove the source folder.
- * (regression test for bug 38450 Delete: Removing default package removes source folder)
- */
-public void testDeletePackageFragment2() throws CoreException {
- try {
- createJavaProject("P1", new String[] {"src"});
- IFile file = createFile(
- "P1/src/X.js",
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkg = getPackage("P1/src");
- IFolder folder = getFolder("P1/src");
- IJavaScriptUnit cu = getCompilationUnit("P1/src/X.js");
-
- startDeltas();
- pkg.delete(false, null);
- assertTrue("Folder should still exist", folder.exists());
- assertTrue("Fragment should still exist", pkg.exists());
- assertTrue("File should no longer exist", !file.exists());
- assertTrue("Compilation unit should no longer exist", !cu.exists());
- assertDeltas(
- "Unexpected delta",
- "P1[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-/*
- * Ensures that deleting a default package where prj=src removes its compilation units is successful.
- * (regression test for bug 39926 deleting default package (not in source folder) does nothing)
- */
-public void testDeletePackageFragment3() throws CoreException {
- try {
- createJavaProject("P1");
- IFile file = createFile(
- "P1/X.js",
- "public class X {\n" +
- "}"
- );
- IPackageFragment pkg = getPackage("P1");
- IProject project = getProject("P1");
- IJavaScriptUnit cu = getCompilationUnit("P1/X.js");
-
- startDeltas();
- pkg.delete(false, null);
- assertTrue("Project should still exist", project.exists());
- assertTrue("Fragment should still exist", pkg.exists());
- assertTrue("File should no longer exist", !file.exists());
- assertTrue("Compilation unit should no longer exist", !cu.exists());
- assertDeltas(
- "Unexpected delta",
- "P1[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-/*
- * Ensures that deleting a package that only contains a .class file is successful.
- * (regression test for bug 40606 Unable to discard empty package if containing .class files)
- */
-public void testDeletePackageFragment4() throws CoreException {
- try {
- createJavaProject("P1");
- IFolder folder = createFolder("P1/p");
- IFile file = createFile("P1/p/X.class", "");
- IPackageFragment pkg = getPackage("P1/p");
-
- startDeltas();
- pkg.delete(false, null);
- assertTrue("Folder should no longer exist", !folder.exists());
- assertTrue("Fragment should no longer exist", !pkg.exists());
- assertTrue("File should no longer exist", !file.exists());
- assertDeltas(
- "Unexpected delta",
- "P1[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " p[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-
-/**
- * Ensures that a field can be deleted if it contains syntax errors
- */
-public void testDeleteSyntaxErrorField() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " int field\n" + // missing semi-colon
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IField field = cu.getType("X").getField("field");
-
- startDeltas();
- assertDeletion(field);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " field[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that a method can be deleted if it contains syntax errors
- */
-public void testDeleteSyntaxErrorInMethod1() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " public void foo() {\n" +
- " String s = ;\n" +
- " System.out.println(s);\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IFunction method = cu.getType("X").getFunction("foo", new String[] {});
-
- startDeltas();
- assertDeletion(method);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that a method can be deleted if it contains syntax errors
- */
-public void testDeleteSyntaxErrorInMethod2() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " public void foo() \n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IFunction method = cu.getType("X").getFunction("foo", new String[] {});
-
- startDeltas();
- assertDeletion(method);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that a method can be deleted if it contains syntax errors
- */
-public void testDeleteSyntaxErrorInMethod3() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " public void foo( \n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IFunction method = cu.getType("X").getFunction("foo", new String[] {});
-
- startDeltas();
- assertDeletion(method);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that a type can be deleted if it contains syntax errors
- */
-public void testDeleteSyntaxErrorType() throws CoreException {
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- " method() {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IType type = cu.getType("X");
-
- startDeltas();
- assertDeletion(type);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Ensures that a type can be deleted from a compilation unit.
- */
-public void testDeleteType1() throws CoreException{
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IType type = cu.getType("X");
-
- startDeltas();
- assertDeletion(type);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteFile("P/X.js");
- }
-}
-/**
- * Delete a type in a default package that is nested
- * in a root folder that is not the project folder.
- */
-public void testDeleteType2() throws CoreException {
- try {
- createJavaProject("P1", new String[] {"src"});
- createFile(
- "P1/src/X.js",
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P1/src/X.js");
- IType type = cu.getType("X");
-
- startDeltas();
- assertDeletion(type);
- assertDeltas(
- "Unexpected delta",
- "P1[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " X.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
- " X[-]: {}"
- );
- } finally {
- stopDeltas();
- deleteProject("P1");
- }
-}
-/**
- * Ensure that the correct exception is thrown for invalid input to the <code>DeleteOperation</code>
- */
-public void testDeleteWithInvalidInput() throws CoreException {
- IType type = null;
- try {
- createFile(
- "P/X.js",
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- type = cu.getType("X");
-
- getJavaModel().delete(null, false, null);
- } catch (JavaScriptModelException e) {
- assertTrue("Should be an no elements to process: null supplied", e.getStatus().getCode() == IJavaScriptModelStatusConstants.NO_ELEMENTS_TO_PROCESS);
- try {
- getJavaModel().delete(new IJavaScriptElement[] {type}, false, null);
- } catch (JavaScriptModelException e2) {
- assertTrue("Should be an no elements to process: null in the array supplied", e2.getStatus().getCode() == IJavaScriptModelStatusConstants.NO_ELEMENTS_TO_PROCESS);
- }
- return;
- } finally {
- deleteFile("P/X.js");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/EncodingTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/EncodingTests.java
deleted file mode 100644
index 4c31ac7..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/EncodingTests.java
+++ /dev/null
@@ -1,918 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IOpenable;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.ISourceReference;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.tests.model.AbstractJavaSearchTests.JavaSearchResultCollector;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-
-public class EncodingTests extends ModifyingResourceTests {
- IProject encodingProject;
- IJavaScriptProject encodingJavaProject;
- IFile utf8File;
- ISourceReference utf8Source;
- static String vmEncoding = System.getProperty("file.encoding");
- static String wkspEncoding = vmEncoding;
-
- public EncodingTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(EncodingTests.class);
- }
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] { "testBug110576" };
-// TESTS_NUMBERS = new int[] { 2, 12 };
-// TESTS_RANGE = new int[] { 16, -1 };
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- wkspEncoding = getWorkspaceRoot().getDefaultCharset();
- System.out.println("Encoding tests using Workspace charset: "+wkspEncoding+" and VM charset: "+vmEncoding);
- this.encodingJavaProject = setUpJavaProject("Encoding");
- this.encodingProject = (IProject) this.encodingJavaProject.getResource();
- this.utf8File = (IFile) this.encodingProject.findMember("src/testUTF8/Test.js");
- }
-
- public void tearDownSuite() throws Exception {
- super.tearDownSuite();
- getWorkspaceRoot().setDefaultCharset(null, null);
- deleteProject("Encoding");
- }
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /*
- * (non-Javadoc)
- * Reset UTF-8 file and project charset to default.
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- this.encodingProject.setDefaultCharset(null, null);
- if (this.utf8File.exists()) this.utf8File.setCharset(null, null);
- if (this.utf8Source != null) ((IOpenable) this.utf8Source).close();
- this.encodingJavaProject.close();
- super.tearDown();
- }
-
- void compareContents(IJavaScriptUnit cu, String encoding) throws JavaScriptModelException {
- compareContents(cu, encoding, false);
- }
-
- void compareContents(IJavaScriptUnit cu, String encoding, boolean bom) throws JavaScriptModelException {
- // Compare source strings
- String source = cu.getSource();
- String systemSourceRenamed = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(source);
- IFile file = (IFile) cu.getUnderlyingResource();
- String renamedContents = new String (Util.getResourceContentsAsCharArray(file));
- renamedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(renamedContents);
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", renamedContents, systemSourceRenamed);
- // Compare bytes array
- byte[] renamedSourceBytes = null;
- try {
- renamedSourceBytes = source.getBytes(encoding);
- }
- catch (UnsupportedEncodingException uue) {
- }
- assertNotNull("Unsupported encoding: "+encoding, renamedSourceBytes);
- byte[] renamedEncodedBytes = Util.getResourceContentsAsByteArray(file);
- int start = bom ? IContentDescription.BOM_UTF_8.length : 0;
- assertEquals("Wrong size of encoded string", renamedEncodedBytes.length-start, renamedSourceBytes.length);
- for (int i = 0, max = renamedSourceBytes.length; i < max; i++) {
- assertTrue("Wrong size of encoded character at " + i, renamedSourceBytes[i] == renamedEncodedBytes[i+start]);
- }
- }
-
- public boolean convertToIndependantLineDelimiter(File file) {
- return false; // don't convert to independant line delimiter as this make tests fail on linux
- }
- /**
- * Check that the compilation unit is saved with the proper encoding.
- */
- public void testCreateCompilationUnitAndImportContainer() throws JavaScriptModelException, CoreException {
- String savedEncoding = null;
- try {
- Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences();
-
- savedEncoding = preferences.getString(ResourcesPlugin.PREF_ENCODING);
- String encoding = "UTF-8";
- preferences.setValue(ResourcesPlugin.PREF_ENCODING, encoding);
-
- ResourcesPlugin.getPlugin().savePluginPreferences();
-
- IJavaScriptProject newProject = createJavaProject("P", new String[] { "" });
- IPackageFragment pkg = getPackageFragment("P", "", "");
- String source = "public class A {\r\n" +
- " public static main(String[] args) {\r\n" +
- " System.out.println(\"\u00e9\");\r\n" +
- " }\r\n" +
- "}";
- IJavaScriptUnit cu= pkg.createCompilationUnit("A.js", source, false, new NullProgressMonitor());
- assertCreation(cu);
- cu.rename("B.js", true, new NullProgressMonitor());
- cu = pkg.getJavaScriptUnit("B.js");
- cu.rename("A.js", true, new NullProgressMonitor());
- cu = pkg.getJavaScriptUnit("A.js");
- byte[] tab = null;
- try {
- tab = cu.getSource().getBytes(encoding);
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
- byte[] encodedContents = Util.getResourceContentsAsByteArray(newProject.getProject().getWorkspace().getRoot().getFile(cu.getPath()));
- assertEquals("wrong size of encoded string", tab.length, encodedContents.length);
- for (int i = 0, max = tab.length; i < max; i++) {
- assertTrue("wrong size of encoded character at" + i, tab[i] == encodedContents[i]);
- }
- } finally {
- deleteProject("P");
- Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences();
- preferences.setValue(ResourcesPlugin.PREF_ENCODING, savedEncoding);
- ResourcesPlugin.getPlugin().savePluginPreferences();
- }
- }
-
- /*
- ##################
- # Test with compilation units
- ##################
- /*
- * Get compilation unit source on a file written in UTF-8 charset using specific UTF-8 encoding for file.
- * Verify first that source is the same than file contents read using UTF-8 encoding...
- * Also verify that bytes array converted back to UTF-8 is the same than the file bytes array.
- */
- public void test001() throws JavaScriptModelException, CoreException, UnsupportedEncodingException {
-
- // Set file encoding
- String encoding = "UTF-8";
- this.utf8File.setCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getCompilationUnit(this.utf8File.getFullPath().toString());
- String source = this.utf8Source.getSource();
- String systemSource = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, systemSource);
-
- // Now compare bytes array
- byte[] sourceBytes = source.getBytes(encoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(this.utf8File);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- for (int i = 0, max = sourceBytes.length; i < max; i++) {
- assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
- }
- }
-
- /*
- * Get compilation unit source on a file written in UTF-8 charset using UTF-8 encoding for project.
- * Verify first that source is the same than file contents read using UTF-8 encoding...
- * Also verify that bytes array converted back to UTF-8 is the same than the file bytes array.
- */
- public void test002() throws JavaScriptModelException, CoreException, UnsupportedEncodingException {
-
- // Set project encoding
- String encoding = "UTF-8";
- this.encodingProject.setDefaultCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getCompilationUnit(this.utf8File.getFullPath().toString());
- String source = this.utf8Source.getSource();
- String systemSource = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, systemSource);
-
- // Now compare bytes array
- byte[] sourceBytes = source.getBytes(encoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(this.utf8File);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- for (int i = 0, max = sourceBytes.length; i < max; i++) {
- assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
- }
- }
-
- /*
- * Get compilation unit source on a file written in UTF-8 charset using workspace default encoding.
- * Verify that source is the same than file contents read using workspace default encoding...
- * Also verify that bytes array converted back to wokrspace default encoding is the same than the file bytes array.
- * Do not compare array contents in case of VM default encoding equals to "ASCII" as meaningful bit 7 is lost
- * during first conversion...
- */
- public void test003() throws JavaScriptModelException, CoreException, UnsupportedEncodingException {
-
- // Get source and compare with file contents
- this.utf8Source = getCompilationUnit(this.utf8File.getFullPath().toString());
- String source = this.utf8Source.getSource();
- String systemSource = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, systemSource);
-
- // Now compare bytes array
- byte[] sourceBytes = source.getBytes(wkspEncoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(this.utf8File);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- // Do not compare arrays contents as system encoding may have lost meaningful bit 7 during convertion...)
-// if (!"ASCII".equals(vmEncoding)) {
-// for (int i = 0, max = sourceBytes.length; i < max; i++) {
-// assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
-// }
-// }
- }
-
- /*
- * Get compilation unit source on a file written in UTF-8 charset using an encoding
- * for file different than VM default one.
- * Verify that source is different than file contents read using VM default encoding...
- */
- public void test004() throws JavaScriptModelException, CoreException {
-
- // Set file encoding
- String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- this.utf8File.setCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getCompilationUnit(this.utf8File.getFullPath().toString());
- String source = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(this.utf8Source.getSource());
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, vmEncoding));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
- }
-
- /*
- * Get compilation unit source on a file written in UTF-8 charset using an encoding
- * for project different than VM default one.
- * Verify that source is different than file contents read using VM default encoding...
- */
- public void test005() throws JavaScriptModelException, CoreException {
-
- // Set project encoding
- String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- this.encodingProject.setDefaultCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getCompilationUnit(this.utf8File.getFullPath().toString());
- String source = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(this.utf8Source.getSource());
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, vmEncoding));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
- }
-
- /*
- * Get compilation unit source on a file written in UTF-8 charset using workspace default encoding.
- * Verify that source is different than file contents read using VM default encoding or another one
- * if VM and Workspace default encodings are identical...
- */
- public void test006() throws JavaScriptModelException, CoreException {
-
- // Set encoding different than workspace default one
- String encoding = wkspEncoding.equals(vmEncoding) ? ("UTF-8".equals(wkspEncoding) ? "Cp1252" : "UTF-8") : vmEncoding;
-
- // Get source and compare with file contents
- this.utf8Source = getCompilationUnit(this.utf8File.getFullPath().toString());
- String source = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(this.utf8Source.getSource());
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, encoding));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
- }
-
- /*
- ##############
- # Tests with class file
- ##############
- /* Same config than test001 */
- public void test011() throws JavaScriptModelException, CoreException, UnsupportedEncodingException {
-
- // Set file encoding
- String encoding = "UTF-8";
- this.utf8File.setCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getClassFile("Encoding" , "bins", "testUTF8", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String source = this.utf8Source.getSource();
- String systemSource = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, systemSource);
-
- // Now compare bytes array
- byte[] sourceBytes = source.getBytes(encoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(this.utf8File);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- for (int i = 0, max = sourceBytes.length; i < max; i++) {
- assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
- }
- }
-
- /* Same config than test002 */
- public void test012() throws JavaScriptModelException, CoreException, UnsupportedEncodingException {
-
- // Set project encoding
- String encoding = "UTF-8";
- this.encodingProject.setDefaultCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getClassFile("Encoding" , "bins", "testUTF8", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String source = this.utf8Source.getSource();
- String systemSource = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, systemSource);
-
- // Now compare bytes array
- byte[] sourceBytes = source.getBytes(encoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(this.utf8File);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- for (int i = 0, max = sourceBytes.length; i < max; i++) {
- assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
- }
- }
-
- /* Same config than test003 */
- public void test013() throws JavaScriptModelException, CoreException, UnsupportedEncodingException {
-
- // Get source and compare with file contents
- this.utf8Source = getClassFile("Encoding" , "bins", "testUTF8", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String source = this.utf8Source.getSource();
- String systemSource = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, systemSource);
-
- // Now compare bytes array
- byte[] sourceBytes = source.getBytes(wkspEncoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(this.utf8File);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- // Do not compare arrays contents as system encoding may have lost meaningful bit 7 during convertion...)
-// if (!"ASCII".equals(vmEncoding)) {
-// for (int i = 0, max = sourceBytes.length; i < max; i++) {
-// assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
-// }
-// }
- }
-
- /* Same config than test004 */
- public void test014() throws JavaScriptModelException, CoreException {
-
- // Set file encoding
- String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- this.utf8File.setCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getClassFile("Encoding" , "bins", "testUTF8", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String source = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(this.utf8Source.getSource());
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, vmEncoding));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
- }
-
- /* Same config than test005 */
- public void test015() throws JavaScriptModelException, CoreException {
-
- // Set project encoding
- String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- this.encodingProject.setDefaultCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getClassFile("Encoding" , "bins", "testUTF8", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String source = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(this.utf8Source.getSource());
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, vmEncoding));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
- }
-
- /* Same config than test006 */
- public void test016() throws JavaScriptModelException, CoreException {
-
- // Set encoding different than workspace default one
- String encoding = wkspEncoding.equals(vmEncoding) ? ("UTF-8".equals(wkspEncoding) ? "Cp1252" : "UTF-8") : vmEncoding;
-
- // Get source and compare with file contents
- this.utf8Source = getClassFile("Encoding" , "bins", "testUTF8", "Test.class"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- String source = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(this.utf8Source.getSource());
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, encoding));
- encodedContents = org.eclipse.wst.jsdt.core.tests.util.Util.convertToIndependantLineDelimiter(encodedContents);
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
- }
-
- /*
- ###############################
- # Tests with jar file and source attached in zip file
- ###############################
- /**
- * Get class file from jar file with an associated source written in UTF-8 charset using no specific encoding for file.
- * Verification is done by comparing source with file contents read directly with VM encoding...
- */
- public void test021() throws JavaScriptModelException, CoreException {
-
- // Get class file and compare source
- IPackageFragmentRoot root = getPackageFragmentRoot("Encoding", "testUTF8.jar");
- this.utf8Source = root.getPackageFragment("testUTF8").getClassFile("Test.class");
- assertNotNull(this.utf8Source);
- String source = this.utf8Source.getSource();
- assertNotNull(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, vmEncoding));
- assertSourceEquals("Encoded UTF-8 source should have been decoded the same way!", source, encodedContents);
-
- // Cannot compare bytes array without encoding as we're dependent of linux/windows os for new lines delimiter
- }
-
- /*
- * Get class file from jar file with an associated source written in UTF-8 charset using specific UTF-8 encoding for project.
- * Verification is done by comparing source with file contents read directly with UTF-8 encoding...
- */
- public void test022() throws JavaScriptModelException, CoreException {
-
- // Set project encoding
- String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- this.encodingProject.setDefaultCharset(encoding, null);
-
- // Get class file and compare source (should not be the same as modify charset on zip file has no effect...)
- IPackageFragmentRoot root = getPackageFragmentRoot("Encoding", "testUTF8.jar");
- this.utf8Source = root.getPackageFragment("testUTF8").getClassFile("Test.class");
- assertNotNull(this.utf8Source);
- String source = this.utf8Source.getSource();
- assertNotNull(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, encoding));
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
- }
-
- /*
- * Get class file from jar file with an associated source written in UTF-8 charset using specific UTF-8 encoding for file.
- * Verification is done by comparing source with file contents read directly with UTF-8 encoding...
- */
- public void test023() throws JavaScriptModelException, CoreException {
-
- // Set file encoding
- String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- IFile zipFile = (IFile) this.encodingProject.findMember("testUTF8.zip"); //$NON-NLS-1$
- assertNotNull("Cannot find class file!", zipFile);
- zipFile.setCharset(encoding, null);
-
- // Get class file and compare source (should not be the same as modify charset on zip file has no effect...)
- IPackageFragmentRoot root = getPackageFragmentRoot("Encoding", "testUTF8.jar");
- this.utf8Source = root.getPackageFragment("testUTF8").getClassFile("Test.class");
- assertNotNull(this.utf8Source);
- String source = this.utf8Source.getSource();
- assertNotNull(source);
- String encodedContents = new String (Util.getResourceContentsAsCharArray(this.utf8File, encoding));
- assertFalse("Sources should not be the same as they were decoded with different encoding!", encodedContents.equals(source));
-
- // Reset zip file encoding
- zipFile.setCharset(null, null);
- }
-
- /**
- * Test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=55930.
- * Verify Buffer.save(IProgressMonitor, boolean) method.
- */
- public void test030() throws JavaScriptModelException, CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- String encoding = "UTF-8";
- this.createJavaProject("P", new String[] {""});
- String initialContent = "/**\n"+
- " */\n"+
- "public class Test {}";
- IFile file = this.createFile("P/Test.js", initialContent);
- file.setCharset(encoding, null);
- IJavaScriptUnit cu = this.getCompilationUnit("P/Test.js");
-
- // Modif direct the buffer
- String firstModif = "/**\n"+
- " * Caract?res exotiques:\n"+
- " * ?|#|?|?|?|?|?|?|?|?|??\n"+
- " */\n"+
- "public class Test {}";
- cu.getBuffer().setContents(firstModif);
- cu.getBuffer().save(null, true);
- String source = cu.getBuffer().getContents();
-
- // Compare strings and bytes arrays
- String encodedContents = new String (Util.getResourceContentsAsCharArray(file, encoding));
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, source);
- byte[] sourceBytes = source.getBytes(encoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(file);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- for (int i = 0, max = sourceBytes.length; i < max; i++) {
- assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
- }
- } catch (UnsupportedEncodingException e) {
- } finally {
- this.stopDeltas();
- if (workingCopy != null) {
- workingCopy.discardWorkingCopy();
- }
- this.deleteProject("P");
- }
-
- }
-
- /**
- * Test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=55930.
- * Verify CommitWorkingCopyOperation.executeOperation() method.
- */
- public void test031() throws JavaScriptModelException, CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- String encoding = "UTF-8";
- this.createJavaProject("P", new String[] {""});
- String initialContent = "/**\n"+
- " */\n"+
- "public class Test {}";
- IFile file = this.createFile("P/Test.js", initialContent);
- file.setCharset(encoding, null);
- IJavaScriptUnit cu = this.getCompilationUnit("P/Test.js");
-
- // Modif using working copy
- workingCopy = cu.getWorkingCopy(null);
- String secondModif = "/**\n"+
- " * Caract?res exotiques:\n"+
- " * ?|#|?|?|?|?|?|?|?|?|??\n"+
- " * Autres caract?res exotiques:\n"+
- " * ?|?|?|?|?|?\n"+
- " */\n"+
- "public class Test {}";
- workingCopy.getBuffer().setContents(secondModif);
- workingCopy.commitWorkingCopy(true, null);
- String source = workingCopy.getBuffer().getContents();
-
- // Compare strings and bytes arrays
- String encodedContents = new String (Util.getResourceContentsAsCharArray(file));
- assertEquals("Encoded UTF-8 source should have been decoded the same way!", encodedContents, source);
- byte[] sourceBytes = source.getBytes(encoding);
- byte[] encodedBytes = Util.getResourceContentsAsByteArray(file);
- assertEquals("Wrong size of encoded string", encodedBytes.length, sourceBytes.length);
- for (int i = 0, max = sourceBytes.length; i < max; i++) {
- assertTrue("Wrong size of encoded character at " + i, sourceBytes[i] == encodedBytes[i]);
- }
- } catch (UnsupportedEncodingException e) {
- } finally {
- this.stopDeltas();
- if (workingCopy != null) {
- workingCopy.discardWorkingCopy();
- }
- this.deleteProject("P");
- }
- }
-
- /*
- * Get compilation unit source on a file written in UTF-8 BOM charset using default charset.
- * Verify first that source is the same than UTF-8 file contents read using UTF-8 encoding...
- */
- public void test032() throws JavaScriptModelException, CoreException {
-
- // Set file encoding
- String encoding = "UTF-8";
- this.utf8File.setCharset(encoding, null);
-
- // Get source and compare with file contents
- this.utf8Source = getCompilationUnit(this.utf8File.getFullPath().toString());
- String source = this.utf8Source.getSource();
-
- // Get source and compare with file contents
- IFile bomFile = (IFile) this.encodingProject.findMember("src/testUTF8BOM/Test.js");
- ISourceReference bomSourceRef = getCompilationUnit(bomFile.getFullPath().toString());
- String bomSource = bomSourceRef.getSource();
- assertEquals("BOM UTF-8 source should be idtentical than UTF-8!", source, bomSource);
- }
-
- /*
- * Ensures that a file is reindexed when the encoding changes.
- * (regression test for bug 68585 index is out of date after encoding change)
- */
- public void test033() throws CoreException {
- try {
- createFolder("/Encoding/src/test68585");
- final String encoding = "UTF-8".equals(wkspEncoding) ? "Cp1252" : "UTF-8";
- getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- // use a different encoding to make the file unreadable
- IFile file = null;
- try {
- file = createFile(
- "/Encoding/src/test68585/X.js",
- "package test68585;\n" +
- "public class X {\n" +
- "}\n" +
- "class Y\u00F4 {}",
- encoding);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- return;
- }
- file.setCharset(wkspEncoding, null);
- }
- },
- null);
-
- IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope();
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- search(
- "Y\u00F4",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults("Should not get any result", "", resultCollector);
-
- // change encoding so that file is readable
- getFile("/Encoding/src/test68585/X.js").setCharset(encoding, null);
- search(
- "Y\u00F4",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults(
- "Should have been reindexed",
- "src/test68585/X.java test68585.Y\u00F4 [Y\u00F4]",
- resultCollector);
- } finally {
- deleteFolder("/Encoding/src/test68585");
- }
- }
-
- /*
- * Ensures that an encoding that a file using an encoding producing more charaters than the file size can
- * be correctly read.
- * (regression test for bug 149028 Limiting number of characters to read with the file size is invalid.)
- */
- public void test034() throws CoreException, IOException {
- try {
- // Create file
- IFile file = createFile("/Encoding/Test34.txt", "acegikm");
-
- // Read file using a transformation where a character is read and the next alphabetical character is
- // automaticaly added
- final InputStream fileStream = file.getContents();
- try {
- InputStream in = new InputStream() {
- int current = -1;
- public int read() throws IOException {
- int result;
- if (current != -1) {
- result = current;
- current = -1;
- } else {
- result = fileStream.read();
- if (result == -1)
- return -1;
- current = result + 1;
- }
- return result;
- }
- };
- char[] result = org.eclipse.wst.jsdt.internal.compiler.util.Util.getInputStreamAsCharArray(in, (int) file.getLocation().toFile().length(), "UTF-8");
- assertSourceEquals(
- "Unexpected source",
- "abcdefghijklmn",
- new String(result)
- );
- } finally {
- fileStream.close();
- }
- } finally {
- deleteFile("Encoding/Test34.txt");
- }
- }
-
- /**
- * Bug 66898: refactor-rename: encoding is not preserved
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=66898"
- */
- public void testBug66898() throws JavaScriptModelException, CoreException {
-
- // Set file encoding
- String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- IFile file = (IFile) this.encodingProject.findMember("src/testBug66898/Test.js");
- file.setCharset(encoding, null);
- String fileName = file.getName();
- IJavaScriptUnit cu = getCompilationUnit(file.getFullPath().toString());
- createFolder("/Encoding/src/tmp");
- IPackageFragment packFrag = getPackageFragment("Encoding", "src", "tmp");
-
- try {
- // Move file
- cu.move(packFrag, null, null, false, null);
- IJavaScriptUnit destSource = packFrag.getJavaScriptUnit(fileName);
- IFile destFile = (IFile) destSource.getUnderlyingResource();
- assertEquals("Moved file should keep encoding", encoding, destFile.getCharset());
-
- // Get source and compare with file contents
- compareContents(destSource, encoding);
-
- // Rename file
- destSource.rename("TestUTF8.js", false, null);
- IJavaScriptUnit renamedSource = packFrag.getJavaScriptUnit("TestUTF8.js");
- IFile renamedFile = (IFile) renamedSource.getUnderlyingResource();
- assertEquals("Moved file should keep encoding", encoding, renamedFile.getCharset());
-
- // Compare contents again
- compareContents(renamedSource, encoding);
- }
- finally {
- // Delete temporary folder
- //renamedFile.move(this.utf8File.getFullPath(), false, null);
- //assertEquals("Moved file should keep encoding", encoding, this.utf8File.getCharset());
- deleteFolder("/Encoding/src/tmp");
- }
- }
- public void testBug66898b() throws JavaScriptModelException, CoreException {
-
- // Set file encoding
- final String encoding = "UTF-8".equals(vmEncoding) ? "Cp1252" : "UTF-8";
- final IFile file = (IFile) this.encodingProject.findMember("src/testBug66898b/Test.js");
- file.setCharset(encoding, null);
- final String fileName = file.getName();
- final IPackageFragment srcFolder = getPackageFragment("Encoding", "src", "testBug66898b");
- createFolder("/Encoding/src/tmp");
- final IPackageFragment tmpFolder = getPackageFragment("Encoding", "src", "tmp");
-
- try {
- // Copy file
- IWorkspaceRunnable copy = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptUnit cu = getCompilationUnit(file.getFullPath().toString());
- cu.copy(tmpFolder, null, null, true, null);
- cu.close(); // purge buffer contents from cache
- IJavaScriptUnit dest = tmpFolder.getJavaScriptUnit(fileName);
- IFile destFile = (IFile) dest.getUnderlyingResource();
- assertEquals("Copied file should keep encoding", encoding, destFile.getCharset());
-
- // Get source and compare with file contents
- compareContents(dest, encoding);
- }
- };
- JavaScriptCore.run(copy, null);
-
- // Rename file
- IWorkspaceRunnable rename = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptUnit cu = tmpFolder.getJavaScriptUnit(fileName);
- cu.rename("Renamed.js", true, null);
- cu.close(); // purge buffer contents from cache
- IJavaScriptUnit ren = tmpFolder.getJavaScriptUnit("Renamed.js");
- IFile renFile = (IFile) ren.getUnderlyingResource();
- assertEquals("Renamed file should keep encoding", encoding, renFile.getCharset());
-
- // Get source and compare with file contents
- compareContents(ren, encoding);
- }
- };
- JavaScriptCore.run(rename, null);
-
- // Move file
- IWorkspaceRunnable move = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptUnit cu = tmpFolder.getJavaScriptUnit("Renamed.js");
- cu.move(srcFolder, null, null, true, null);
- cu.close(); // purge buffer contents from cache
- IJavaScriptUnit moved = srcFolder.getJavaScriptUnit("Renamed.js");
- IFile movedFile = (IFile) moved.getUnderlyingResource();
- assertEquals("Renamed file should keep encoding", encoding, movedFile.getCharset());
-
- // Get source and compare with file contents
- compareContents(moved, encoding);
- }
- };
- JavaScriptCore.run(move, null);
- }
- finally {
- // Delete temporary file and folder
- IJavaScriptUnit cu = srcFolder.getJavaScriptUnit("Renamed.js");
- if (cu.exists()) cu.delete(true, null);
- deleteFolder("/Encoding/src/tmp");
- }
- }
-
- /**
- * Bug 70598: [Encoding] ArrayIndexOutOfBoundsException while testing BOM on *.txt files
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=70598"
- */
- public void testBug70598() throws JavaScriptModelException, CoreException, IOException {
-
- // Create empty file
- IFile emptyFile = createFile("/Encoding/src/testUTF8BOM/Empty.js", new byte[0]);
-
- // Test read empty content using io file
- File file = new File(this.encodingProject.getLocation().toString(), emptyFile.getProjectRelativePath().toString());
- char[] fileContents = org.eclipse.wst.jsdt.internal.compiler.util.Util.getFileCharContent(file, "UTF-8");
- assertEquals("We should not get any character!", "", new String(fileContents));
-
- // Test read empty content using io file
- char[] ifileContents =Util.getResourceContentsAsCharArray(emptyFile, "UTF-8");
- assertEquals("We should not get any character!", "", new String(ifileContents));
-
- // Delete empty file
- deleteFile(file);
- }
-
- /**
- * Bug 110576: [encoding] Rename CU looses encoding for file which charset is determined by contents
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=110576"
- */
- public void testBug110576() throws JavaScriptModelException, CoreException {
-
- String os = System.getProperty("osgi.os");
- if (!"win32".equals(os)) {
- System.out.println("Bug 110576 is not tested under "+os+" os...");
- return;
- }
-
- // Verify file UTF-8 BOM encoding
- IFile file = (IFile) this.encodingProject.findMember("src/testBug110576/Test.js");
- verifyUtf8BOM(file);
-
- String fileName = file.getName();
- IJavaScriptUnit testCU = getCompilationUnit(file.getFullPath().toString());
- createFolder("/Encoding/src/tmp");
- IPackageFragment tmpPackage = getPackageFragment("Encoding", "src", "tmp");
-
- try {
- // Copy file
- testCU.copy(tmpPackage, null, null, false, null);
- IJavaScriptUnit copiedCU = tmpPackage.getJavaScriptUnit(fileName);
- IFile copiedFile = (IFile) copiedCU.getUnderlyingResource();
- verifyUtf8BOM(copiedFile);
-
- // Get source and compare with file contents
- compareContents(copiedCU, "UTF-8", true/*BOM*/);
-
- // Rename file
- copiedCU.rename("TestUTF8.js", false, null);
- IJavaScriptUnit renamedCU = tmpPackage.getJavaScriptUnit("TestUTF8.js");
- IFile renamedFile = (IFile) renamedCU.getUnderlyingResource();
- verifyUtf8BOM(renamedFile);
- fileName = renamedFile.getName();
-
- // Compare contents again
- compareContents(renamedCU, "UTF-8", true/*BOM*/);
-
- // Move file
- createFolder("/Encoding/src/tmp/sub");
- IPackageFragment subPackage = getPackageFragment("Encoding", "src", "tmp.sub");
- renamedCU.move(subPackage, null, null, false, null);
- IJavaScriptUnit movedCU = subPackage.getJavaScriptUnit(fileName);
- IFile movedFile = (IFile) movedCU.getUnderlyingResource();
- verifyUtf8BOM(movedFile);
-
- // Get source and compare with file contents
- compareContents(movedCU, "UTF-8", true/*BOM*/);
- }
- finally {
- // Delete temporary folder
- //renamedFile.move(this.utf8File.getFullPath(), false, null);
- //assertEquals("Moved file should keep encoding", encoding, this.utf8File.getCharset());
- deleteFolder("/Encoding/src/tmp");
- }
- }
-
- private void verifyUtf8BOM(IFile file) throws CoreException {
- assertNull("File should not have any explicit charset", file.getCharset(false));
- IContentDescription contentDescription = file.getContentDescription();
- assertNotNull("File should have a content description", contentDescription);
- assertEquals("Content description charset should be UTF-8", "UTF-8", contentDescription.getCharset());
- assertNotNull("File should be UTF-8 BOM!", contentDescription.getProperty(IContentDescription.BYTE_ORDER_MARK));
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExclusionPatternsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExclusionPatternsTests.java
deleted file mode 100644
index ab65567..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExclusionPatternsTests.java
+++ /dev/null
@@ -1,895 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-
-import junit.framework.Test;
-
-public class ExclusionPatternsTests extends ModifyingResourceTests {
- IJavaScriptProject project;
-public ExclusionPatternsTests(String name) {
- super(name);
-}
-protected void setClasspath(String[] sourceFoldersAndExclusionPatterns) throws JavaScriptModelException {
- this.project.setRawIncludepath(createClasspath(sourceFoldersAndExclusionPatterns, false/*no inclusion*/, true/*exclusion*/), null);
-}
-protected void setUp() throws Exception {
- super.setUp();
- this.project = createJavaProject("P", new String[] {"src"});
- startDeltas();
-}
-
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "testCreateExcludedPackage2" };
-// TESTS_NUMBERS = new int[] { 2, 12 };
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-public static Test suite() {
- return buildModelTestSuite(ExclusionPatternsTests.class);
-}
-
-protected void tearDown() throws Exception {
- stopDeltas();
- deleteProject("P");
- super.tearDown();
-}
-/*
- * Ensure that adding an exclusion on a compilation unit
- * makes it disappear from the children of its package and it is added to the non-java resources.
- */
-public void testAddExclusionOnCompilationUnit() throws CoreException {
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", "**/A.js"});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "A.js",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that adding an exclusion on a folder directly under a project (and prj=src)
- * makes it appear as a non-java resources.
- * (regression test for bug 29374 Excluded folder on project not returned by Java Model)
- */
-public void testAddExclusionOnFolderUnderProject() throws CoreException {
- try {
- IJavaScriptProject javaProject = createJavaProject("P1", new String[] {""});
- createFolder("/P1/doc");
-
- clearDeltas();
- javaProject.setRawIncludepath(createClasspath(new String[] {"/P1", "doc/"}, false/*no inclusion*/, true/*exclusion*/), null);
-
- assertDeltas(
- "Unexpected deltas",
- "P1[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " <project root>[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P1/.classpath)[*]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P1");
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in <project root> [in P1]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources of project",
- ".classpath\n" +
- ".project\n" +
- "doc",
- javaProject.getNonJavaScriptResources());
- } finally {
- deleteProject("P1");
- }
-}
-/*
- * Ensure that adding an exclusion on a package
- * makes it disappear from the children of its package fragment root
- * and it is added to the non-java resources.
- */
-public void testAddExclusionOnPackage() throws CoreException {
- createFolder("/P/src/p");
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", "p/"});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "p",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that adding an exclusion on a primary working copy
- * makes it disappear from the children of its package and it is added to the non-java resources.
- */
-public void testAddExclusionOnPrimaryWorkingCopy() throws CoreException {
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- IJavaScriptUnit workingCopy = null;
- try {
- workingCopy = getCompilationUnit("/P/src/p/A.js");
- workingCopy.becomeWorkingCopy(null);
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", "**/A.js"});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "A.js",
- pkg.getNonJavaScriptResources());
- } finally {
- if (workingCopy != null) {
- workingCopy.discardWorkingCopy();
- }
- }
-}
-/*
- * Ensure that adding a file to a folder that is excluded reports the correct delta.
- * (regression test for bug 29621 Wrong Delta When Adding to Filtered Folder)
- */
-public void testAddToExcludedFolder() throws CoreException {
- createFolder("/P/src/icons");
-
- // exclude folder and its contents
- setClasspath(new String[] {"/P/src", "icons/"});
-
- clearDeltas();
- createFile("/P/src/icons/my.txt", "");
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/icons)[*]"
- );
-
- clearDeltas();
- deleteFile("/P/src/icons/my.txt");
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/icons)[*]"
- );
-}
-/*
- * Ensure that creating an excluded compilation unit
- * doesn't make it appear as a child of its package but it is a non-java resource.
- */
-public void testCreateExcludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IPackageFragment pkg = getPackage("/P/src/p");
-
- clearDeltas();
- pkg.createCompilationUnit(
- "A.js",
- "package p;\n" +
- "public class A {\n" +
- "}",
- false,
- null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/p/A.java)[+]"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "A.js",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that crearing an excluded package
- * doesn't make it appear as a child of its package fragment root but it is a non-java resource.
- */
-public void testCreateExcludedPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
-
- clearDeltas();
- root.createPackageFragment("p", false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/p)[+]"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "p",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that crearing an excluded package doesn't make it appear as a child of its package fragment root but it is a non-java resource.
- * (regression test for bug 65637 [model] Excluded package still in Java model)
- */
-public void testCreateExcludedPackage2() throws CoreException {
- setClasspath(new String[] {"/P/src", "org/*|org/eclipse/*"});
-
- clearDeltas();
- createFolder("/P/src/org/eclipse/mypack");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/org)[+]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]\n" +
- "org.eclipse.mypack [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "org",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that creating a folder that represents an excluded and included package
- * have the correct delta, Java elements and non-Java resources.
- * (regression test for 67789 Java element delta from refresh contains excluded package)
- */
-public void testCreateExcludedAndIncludedPackages() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/"});
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
-
- clearDeltas();
- createFolder("/P/src/p1/p2");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p1[+]: {}"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]\n" +
- "p1 [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "p2",
- root.getPackageFragment("p1").getNonJavaScriptResources());
-}
-/*
- * Ensure that creating a file that corresponds to an excluded compilation unit
- * doesn't make it appear as a child of its package but it is a non-java resource.
- */
-public void testCreateResourceExcludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
-
- clearDeltas();
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/p/A.java)[+]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "A.js",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that creating a folder that corresponds to an excluded package
- * doesn't make it appear as a child of its package fragment root but it is a non-java resource.
- */
-public void testCreateResourceExcludedPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
-
- clearDeltas();
- createFolder("/P/src/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/p)[+]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "p",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensures that a cu that is not excluded is on the classpath of the project.
- */
-public void testIsOnClasspath1() throws CoreException {
- setClasspath(new String[] {"/P/src", ""});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
- assertTrue("Resource should be on classpath", project.isOnIncludepath(file));
-
- IJavaScriptUnit cu = getCompilationUnit("/P/src/p/A.js");
- assertTrue("CU should be on classpath", project.isOnIncludepath(cu));
-}
-/*
- * Ensures that a cu that is excluded is not on the classpath of the project.
- */
-public void testIsOnClasspath2() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
- assertTrue("Resource should not be on classpath", !project.isOnIncludepath(file));
-
- IJavaScriptUnit cu = getCompilationUnit("/P/src/p/A.js");
- assertTrue("CU should not be on classpath", !project.isOnIncludepath(cu));
-}
-/*
- * Ensures that a non-java resource that is not excluded is on the classpath of the project.
- */
-public void testIsOnClasspath3() throws CoreException {
- setClasspath(new String[] {"/P/src", ""});
- createFolder("/P/src/p");
- IFile file = createFile("/P/src/p/readme.txt", "");
- assertTrue("Resource should be on classpath", project.isOnIncludepath(file));
-}
-/*
- * Ensures that a non-java resource that is excluded is not on the classpath of the project.
- */
-public void testIsOnClasspath4() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/**"});
- createFolder("/P/src/p");
- IFile file = createFile("/P/src/p/readme.txt", "");
- assertTrue("Resource should not be on classpath", !project.isOnIncludepath(file));
-}
-/*
- * Ensures that an excluded nested source folder doesn't appear as a non-java resource of the outer folder.
- * (regression test for bug 28115 Ubiquitous resource in the JavaModel)
- *
- */
-public void testNestedSourceFolder1() throws CoreException {
- setClasspath(new String[] {"/P/src1", "src2/**", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
- IPackageFragmentRoot root1 = getPackageFragmentRoot("/P/src1");
- assertResourceNamesEqual(
- "Unexpected non-java resources for /P/src1",
- "",
- root1.getNonJavaScriptResources());
-}
-/*
- * Ensures that adding a .java file in a nested source folder reports
- * a delta on the nested source folder and not on the outer one.
- */
-public void testNestedSourceFolder2() throws CoreException {
- setClasspath(new String[] {"/P/src1", "src2/**", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFile(
- "/P/src1/src2/A.js",
- "public class A {\n" +
- "}"
- );
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1/src2[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " A.java[+]: {}"
- );
-}
-/*
- * Ensures that adding a .txt file in a nested source folder reports
- * a resource delta on the nested source folder and not on the outer one.
- */
-public void testNestedSourceFolder3() throws CoreException {
- setClasspath(new String[] {"/P/src1", "src2/**", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFile("/P/src1/src2/readme.txt", "");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1/src2[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src1/src2/readme.txt)[+]"
- );
-}
-/*
- * Ensures that adding a folder in a nested source folder reports
- * a delta on the nested source folder and not on the outer one.
- */
-public void testNestedSourceFolder4() throws CoreException {
- setClasspath(new String[] {"/P/src1", "src2/**", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFolder("/P/src1/src2/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1/src2[*]: {CHILDREN}\n" +
- " p[+]: {}"
- );
-}
-/*
- * Ensures that adding a folder in a outer source folder reports
- * a delta on the outer source folder and not on the nested one.
- */
-public void testNestedSourceFolder5() throws CoreException {
- setClasspath(new String[] {"/P/src1", "src2/**", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFolder("/P/src1/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1[*]: {CHILDREN}\n" +
- " p[+]: {}"
- );
-}
-/*
- * Ensures that moving a package from an outer source folder to a nested
- * source folder reports a move delta.
- */
-public void testNestedSourceFolder6() throws CoreException {
- setClasspath(new String[] {"/P/src1", "src2/**", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
- createFolder("/P/src1/p");
-
- clearDeltas();
- moveFolder("/P/src1/p", "/P/src1/src2/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1[*]: {CHILDREN}\n" +
- " p[-]: {MOVED_TO(p [in src1/src2 [in P]])}\n" +
- " src1/src2[*]: {CHILDREN}\n" +
- " p[+]: {MOVED_FROM(p [in src1 [in P]])}"
- );
-}
-/*
- * Ensure that renaming an excluded compilation unit so that it is not excluded any longer
- * makes it appears as a child of its package and it is removed from the non-java resources.
- */
-public void testRenameExcludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- file.move(new Path("/P/src/p/B.js"), false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN | CONTENT}\n" +
- " B.java[+]: {}\n" +
- " ResourceDelta(/P/src/p/A.java)[-]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "B.java [in p [in src [in P]]]",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that renaming an excluded package so that it is not excluded any longer
- * makes it appears as a child of its package fragment root
- * and it is removed from the non-java resources.
- */
-public void testRenameExcludedPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- IPackageFragment pkg = root.createPackageFragment("p", false, null);
-
- clearDeltas();
- pkg.getResource().move(new Path("/P/src/q"), false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " q[+]: {}\n" +
- " ResourceDelta(/P/src/p)[-]"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]\n" +
- "q [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that renaming a file that corresponds to an excluded compilation unit so that it is not excluded any longer
- * makes it appears as a child of its package and it is removed from the non-java resources.
- */
-public void testRenameResourceExcludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- file.move(new Path("/P/src/p/B.js"), false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN | CONTENT}\n" +
- " B.java[+]: {}\n" +
- " ResourceDelta(/P/src/p/A.java)[-]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "B.java [in p [in src [in P]]]",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure search doesn't find matches in an excluded compilation unit.
- */
-public void testSearchWithExcludedCompilationUnit1() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- search(
- "A",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("P")}),
- resultCollector);
- assertEquals(
- "Unexpected matches found",
- "",
- resultCollector.toString());
-}
-/*
- * Ensure search find matches in a compilation unit that was excluded but that is not any longer.
- */
-public void testSearchWithExcludedCompilationUnit2() throws CoreException {
- setClasspath(new String[] {"/P/src", "A.js"});
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- setClasspath(new String[] {"/P/src", ""});
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- search(
- "A",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("P")}),
- resultCollector);
- assertEquals(
- "Unexpected matches found",
- "src/p/A.java p.A [A]",
- resultCollector.toString());
-}
-/*
- * Ensure that removing a folder that represents an excluded and included package
- * have the correct delta, Java elements and non-Java resources.
- * (regression test for 67789 Java element delta from refresh contains excluded package)
- */
-public void testRemoveExcludedAndIncludedPackages() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/"});
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- createFolder("/P/src/p1/p2");
-
- clearDeltas();
- deleteFolder("/P/src/p1");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p1[-]: {}"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- root.getNonJavaScriptResources());
-}
-
-/*
- * Ensure that renaming a folder that corresponds to an excluded package
- * so that it is not excluded any longer
- * makes it appears as a child of its package fragment root
- * and it is removed from the non-java resources.
- */
-public void testRenameResourceExcludedPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- IFolder folder = createFolder("/P/src/p");
-
- clearDeltas();
- folder.move(new Path("/P/src/q"), false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " q[+]: {}\n" +
- " ResourceDelta(/P/src/p)[-]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]\n" +
- "q [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that a potential match in the output folder is not indexed.
- * (regression test for bug 32041 Multiple output folders fooling Java Model)
- */
-public void testSearchPotentialMatchInOutput() throws CoreException {
- try {
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptProject javaProject = createJavaProject("P2", new String[] {});
- javaProject.setRawIncludepath(createClasspath(new String[] {"/P2", "src/", "/P2/src", ""}, false/*no inclusion*/, true/*exclusion*/), null);
- createFile(
- "/P2/bin/X.js",
- "public class X {\n" +
- "}"
- );
- }
- }, null);
-
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {getJavaProject("P")});
- search(
- "X",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- scope,
- resultCollector);
- assertEquals("", resultCollector.toString());
- } finally {
- deleteProject("P2");
- }
-}
-/*
- * Ensure that removing the exclusion on a compilation unit
- * makes it appears as a child of its package and it is removed from the non-java resources.
- */
-public void testRemoveExclusionOnCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "A.js"});
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", ""});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "A.java [in p [in src [in P]]]",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that removing the exclusion on a package
- * makes it appears as a child of its package fragment root
- * and it is removed from the non-java resources.
- */
-public void testRemoveExclusionOnPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p"});
- createFolder("/P/src/p");
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", ""});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]\n" +
- "p [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- root.getNonJavaScriptResources());
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExistenceTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExistenceTests.java
deleted file mode 100644
index 1d68e98..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExistenceTests.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-public class ExistenceTests extends ModifyingResourceTests {
-public ExistenceTests(String name) {
- super(name);
-}
-
-public static Test suite() {
- return buildModelTestSuite(ExistenceTests.class);
-}
-protected void assertCorrespondingResourceFails(IJavaScriptElement element) {
- boolean gotException = false;
- try {
- element.getCorrespondingResource();
- } catch (JavaScriptModelException e) {
- if (e.isDoesNotExist()) {
- gotException = true;
- }
- }
- assertTrue("Should not be able to get corresponding resource", gotException);
-}
-protected void assertOpenFails(String expectedMessage, IOpenable openable) {
- String message = "";
- try {
- openable.open(null);
- } catch (JavaScriptModelException e) {
- message = e.getMessage();
- }
- if (!expectedMessage.equals(message)) {
- System.out.print(Util.displayString(message, 3));
- System.out.println(",");
- }
- assertEquals(expectedMessage, message);
-}
-protected void assertUnderlyingResourceFails(IJavaScriptElement element) {
- boolean gotException = false;
- try {
- element.getUnderlyingResource();
- } catch (JavaScriptModelException e) {
- if (e.isDoesNotExist()) {
- gotException = true;
- }
- }
- assertTrue("Should not be able to get underlying resource", gotException);
-}
-public void testBinaryMethodAfterNonExistingMember() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {}, new String[] {});
- IClassFile classFile = project.getPackageFragmentRoot(getSystemJsPathString()).getPackageFragment("").getClassFile("system.js");
- classFile.open(null);
- IType type = classFile.getType();
- type.getFunction("foo", new String[0]).exists();
- assertTrue("Object.toString() should exist", type.getFunction("toString", new String[0]).exists());
- } finally {
- deleteProject("P");
- }
-}
-public void testClassFileInBinary() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- this.createFile("P/bin/X.class", "");
- IJavaScriptElement classFile = this.getClassFile("P/bin/X.class");
- assertTrue(!classFile.exists());
- } finally {
- this.deleteProject("P");
- }
-}
-public void testClassFileInLibrary() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {}, new String[] {"lib"});
- this.createFile("P/lib/X.class", "");
- IJavaScriptElement classFile = this.getClassFile("P/lib/X.class");
- assertTrue(classFile.exists());
- } finally {
- this.deleteProject("P");
- }
-}
-public void testClassFileInLibraryInOtherProject() throws CoreException {
- try {
- this.createJavaProject("P2", new String[] {});
- this.createFolder("P2/lib");
- String path = "P2/lib/X.class";
- IFile file = this.createFile(path, "");
- IJavaScriptProject p1 = createJavaProject("P1", new String[] {}, new String[] {"/P2/lib"});
- IJavaScriptElement nonExistingFile = getClassFile(path);
- assertFalse("File '"+path+"' should not exist in P2!", nonExistingFile.exists());
- IJavaScriptElement element = JavaScriptCore.create(getFolder("/P2/lib"));
- assertTrue("folder '/P2/lib' should be found in P1!", element.exists());
- IClassFile existingFile = (IClassFile)JavaScriptCore.create(file, p1);
- assertTrue("File '"+path+"' should exist in P1!", existingFile.exists());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
-}
-public void testJarFile() throws Exception {
- try {
- IJavaScriptProject p2 = createJavaProject("P2");
- String[] pathsAndContents = new String[] {
- "test/X.js",
- "package test;\n" +
- "public class X {\n" +
- "}",
- };
- addLibrary(p2, "lib.jar", "libsrc.zip", pathsAndContents, JavaScriptCore.VERSION_1_5);
- IJavaScriptProject p1 = createJavaProject("P1", new String[] {}, new String[] {"/P2/lib.jar"});
- IPackageFragmentRoot root2 = getPackageFragmentRoot("/P2/lib.jar");
- assertTrue(root2.exists());
- assertEquals(p1.getPackageFragmentRoots()[0], root2);
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
-}
-/*
- * Ensure that an IClassFile handle created on a .class file in a source folder
- * doesn't not exist.
- * (regression test for bug 36499 exists() returns true for a source file inside a classfolder)
- */
-public void testClassFileInSource1() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- this.createFile("P/src/X.class", "");
- IJavaScriptElement classFile = this.getClassFile("P/src/X.class");
- assertTrue("Class file should not exist", !classFile.exists());
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that an IClassFile handle created on a .class file in a source folder
- * cannot be opened.
- * (regression test for bug 36499 exists() returns true for a source file inside a classfolder)
- */
- public void testClassFileInSource2() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- this.createFile("P/src/X.class", "");
- IClassFile classFile = this.getClassFile("P/src/X.class");
- assertOpenFails(
- "Operation not supported for specified element type(s):src [in P]",
- classFile);
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that an IJavaScriptUnit handle created on a .java file in a library folder
- * doesn't not exist.
- * (regression test for bug 36499 exists() returns true for a source file inside a classfolder)
- */
-public void testCompilationUnitInLibrary1() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {}, new String[] {"lib"});
- this.createFile(
- "P/lib/X.js",
- "public class X {}"
- );
- IJavaScriptUnit cu = this.getCompilationUnit("P/lib/X.js");
- assertTrue("Ccompilation unit should not exist", !cu.exists());
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that an IJavaScriptUnit handle created on a .java file in a library folder
- *cannot be opened.
- * (regression test for bug 36499 exists() returns true for a source file inside a classfolder)
- */
-public void testCompilationUnitInLibrary2() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {}, new String[] {"lib"});
- this.createFile(
- "P/lib/X.js",
- "public class X {}"
- );
- IJavaScriptUnit cu = this.getCompilationUnit("P/lib/X.js");
- assertOpenFails(
- "Operation not supported for specified element type(s):lib [in P]",
- cu);
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a method with invalid parameters returns false to exists().
- * (regression test for bug 80338 getReturnType() throws a NullArgumentException)
- */
-public void testMethodWithInvalidParameter() throws CoreException {
- try {
- createJavaProject("P");
- createFile(
- "P/X.js",
- "public class X {}"
- );
- IFunction method = getCompilationUnit("P/X.js").getType("X").getFunction("foo", new String[] {"~12345@"});
- assertTrue("Methodr should not exist", !method.exists());
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensure that a non-existing class file cannot be opened.
- */
-public void testNonExistingClassFile1() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"}, new String[] {"lib"});
- IClassFile classFile = getClassFile("/P/lib/X.class");
- assertOpenFails(
- "X.class [in <default> [in lib [in P]]] does not exist",
- classFile);
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a non-existing class file cannot be opened.
- * (regression test for 52379 JavaElement.getElementInfo no longer works)
- */
-public void testNonExistingClassFile2() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"}, new String[] {});
- IClassFile classFile = getClassFile("/P/lib/X.class");
- assertOpenFails(
- "lib [in P] is not on its project\'s build path",
- classFile);
- } finally {
- this.deleteProject("P");
- }
-}
-
-/*
- * Ensure that a non-existing compilation unit cannot be opened.
- */
-public void testNonExistingCompilationUnit() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- IJavaScriptUnit cu = getCompilationUnit("/P/src/X.js");
- assertOpenFails(
- "X.java [in <default> [in src [in P]]] does not exist",
- cu);
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a non-existing package fragment cannot be opened.
- */
-public void testNonExistingPackageFragment1() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- IPackageFragment pkg = this.getPackage("/P/src/x");
- assertOpenFails(
- "x [in src [in P]] does not exist",
- pkg);
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a non-existing package fragment cannot be opened.
- */
-public void testNonExistingPackageFragment2() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {});
- IFolder folder = createFolder("/P/src/x");
- IPackageFragment pkg = project.getPackageFragmentRoot(folder).getPackageFragment("x");
- assertOpenFails(
- "src/x [in P] is not on its project\'s build path",
- pkg);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensure that an excluded package fragment doesn't exist.
- * (regression test for bug 138577 Package content disapear in package explorer)
- */
-public void testNonExistingPackageFragment3() throws CoreException {
- try {
- createJavaProject("P");
- createFolder("/P/pack");
- IPackageFragment pkg = getPackage("/P/pack");
- editFile(
- "/P/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry excluding=\"pack/\" kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>"
- );
- assertFalse( "pack should not exist", pkg.exists());
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensure that a non-Java project doesn't exist.
- * (regression test for bug 28545 JavaProject.exists() returns true if project doesn't have Java nature)
- */
-public void testNonJavaProject() throws CoreException {
- try {
- createProject("P");
- IProject project = getProject("P");
- IJavaScriptProject javaProject = JavaScriptCore.create(project);
-
- assertTrue("Simple project should not exist", !javaProject.exists());
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package fragment root that is not on the classpath cannot be opened.
- */
-public void testPkgFragmentRootNotInClasspath() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IFolder folder = createFolder("/P/otherRoot");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(folder);
- assertTrue("Root should not exist", !root.exists());
- assertOpenFails(
- "otherRoot [in P] is not on its project\'s build path",
- root);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the corresponding resource of a non-existing class file.
- */
-public void testCorrespondingResourceNonExistingClassFile() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"}, new String[] {"lib"});
- IJavaScriptElement classFile = getClassFile("/P/lib/X.class");
- assertCorrespondingResourceFails(classFile);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the corresponding resource of a non-existing compilation unit.
- */
-public void testCorrespondingResourceNonExistingCompilationUnit() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"});
- IJavaScriptUnit compilationUnit = getCompilationUnit("/P/src/X.js");
- assertCorrespondingResourceFails(compilationUnit);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the corresponding resource of a non-existing jar package fragment root.
- */
-public void testCorrespondingResourceNonExistingJarPkgFragmentRoot() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IPackageFragmentRoot root = project.getPackageFragmentRoot("/nonExisting.jar");
- assertCorrespondingResourceFails(root);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the corresponding resource of a non-existing package fragment.
- */
-public void testCorrespondingResourceNonExistingPkgFragment() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"});
- IPackageFragment pkg = getPackage("/P/src/nonExisting");
- assertCorrespondingResourceFails(pkg);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the corresponding resource of a non-existing package fragment root.
- */
-public void testCorrespondingResourceNonExistingPkgFragmentRoot() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IFolder folder = createFolder("/P/nonExistingRoot");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(folder);
- assertCorrespondingResourceFails(root);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the corresponding resource of a non-existing java project.
- */
-public void testCorrespondingResourceNonExistingProject() {
- IProject nonExistingProject = ResourcesPlugin.getWorkspace().getRoot().getProject("NonExisting");
- IJavaScriptProject javaProject = JavaScriptCore.create(nonExistingProject);
- assertCorrespondingResourceFails(javaProject);
-}
-/*
- * Ensures that one cannot get the corresponding resource of a non-existing type.
- */
-public void testCorrespondingResourceNonExistingType() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"});
- createFile(
- "/P/src/X.js",
- "public class X{\n" +
- "}"
- );
- IType type = getCompilationUnit("/P/src/X.js").getType("NonExisting");
- assertCorrespondingResourceFails(type);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the underlying resource of a non-existing class file.
- */
-public void testUnderlyingResourceNonExistingClassFile() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"}, new String[] {"lib"});
- IJavaScriptElement classFile = getClassFile("/P/lib/X.js");
- assertUnderlyingResourceFails(classFile);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the underlying resource of a non-existing compilation unit.
- */
-public void testUnderlyingResourceNonExistingCompilationUnit() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"});
- IJavaScriptUnit compilationUnit = getCompilationUnit("/P/src/X.js");
- assertUnderlyingResourceFails(compilationUnit);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the underlying resource of a non-existing package fragment.
- */
-public void testUnderlyingResourceNonExistingPkgFragment() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"});
- IPackageFragment pkg = getPackage("/P/src/nonExisting");
- assertUnderlyingResourceFails(pkg);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the underlying resource of a non-existing package fragment root.
- */
-public void testUnderlyingResourceNonExistingPkgFragmentRoot() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IFolder folder = createFolder("/P/nonExistingRoot");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(folder);
- assertUnderlyingResourceFails(root);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that one cannot get the underlying resource of a non-existing java project.
- */
-public void testUnderlyingResourceNonExistingProject() {
- IProject nonExistingProject = ResourcesPlugin.getWorkspace().getRoot().getProject("NonExisting");
- IJavaScriptProject javaProject = JavaScriptCore.create(nonExistingProject);
- assertUnderlyingResourceFails(javaProject);
-}
-/*
- * Ensures that one cannot get the underlying resource of a non-existing type.
- */
-public void testUnderlyingResourceNonExistingType() throws CoreException {
- try {
- createJavaProject("P", new String[] {"src"});
- createFile(
- "/P/src/X.js",
- "function X(){\n" +
- "}"
- );
- IType type = getCompilationUnit("/P/src/X.js").getType("NonExisting");
- assertUnderlyingResourceFails(type);
- } finally {
- deleteProject("P");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExternalJarDeltaTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExternalJarDeltaTests.java
deleted file mode 100644
index 2c6a7fe..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ExternalJarDeltaTests.java
+++ /dev/null
@@ -1,541 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-/**
- * These test ensure that modifications in external jar are correctly reported as
- * IJavaEllementDeltas after a JavaModel#refreshExternalArchives().
- */
-public class ExternalJarDeltaTests extends ModifyingResourceTests {
-
-public ExternalJarDeltaTests(String name) {
- super(name);
-}
-public static Test suite() {
- return buildModelTestSuite(ExternalJarDeltaTests.class);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_PREFIX = "testBug79990";
-// TESTS_NAMES = new String[] { "testExternalJarInternalExternalJar"};
-// TESTS_NUMBERS = new int[] { 79860, 80918, 91078 };
-// TESTS_RANGE = new int[] { 83304, -1 };
-}
-private void touch(File f) {
- f.setLastModified(f.lastModified() + 10000);
-}
-/**
- * Test if a modification is detected without doing a refresh.
- * Currently no modification are detected.
- */
-public void testExternalJar0() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
-
- startDeltas();
- touch(f);
-
- assertDeltas(
- "Unexpected delta",
- ""
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-
-/**
- * Refresh the JavaModel after a modification of an external jar.
- */
-public void testExternalJarChanged1() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- touch(f);
- getJavaModel().refreshExternalArchives(null,null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[*]: {CONTENT | ARCHIVE CONTENT CHANGED}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh a JavaProject after a modification of an external jar.
- */
-public void testExternalJarChanged2() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- touch(f);
- getJavaModel().refreshExternalArchives(new IJavaScriptElement[]{project},null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[*]: {CONTENT | ARCHIVE CONTENT CHANGED}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh an external jar after a modification of this jar.
- */
-public void testExternalJarChanged3() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- touch(f);
- IPackageFragmentRoot root = project.getPackageFragmentRoot(pPath);
- getJavaModel().refreshExternalArchives(new IJavaScriptElement[]{root},null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[*]: {CONTENT | ARCHIVE CONTENT CHANGED}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh the JavaModel after a modification of an external jar after shutdown.
- * (regression test for bug 39856 External jar's timestamps should be persisted accross sessions)
- */
-public void testExternalJarChanged4() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
-
- // exit, change the jar, and restart
- simulateExit();
- touch(f);
- simulateRestart();
-
- startDeltas();
- getJavaModel().refreshExternalArchives(null,null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[*]: {CONTENT | ARCHIVE CONTENT CHANGED}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Ensure that the external jars are refreshed by a call to JavaScriptCore#initializeAfterLoad()
- * (regression test for bug 93668 Search indexes not rebuild)
- */
-public void testExternalJarChanged5() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
-
- // exit, change the jar, and restart
- simulateExit();
- touch(f);
- simulateRestart();
-
- startDeltas();
- JavaScriptCore.initializeAfterLoad(null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[*]: {CONTENT | ARCHIVE CONTENT CHANGED}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Ensure that the external jars are refreshed by full build
- * (regression test for bug 93668 Search indexes not rebuild)
- */
-public void testExternalJarChanged6() throws CoreException, IOException {
- File f = null;
- try {
- String pPath = getExternalPath() + "p.jar";
- f = new File(pPath);
- f.createNewFile();
- createJavaProject("P", new String[] {""}, new String[] {"JCL_LIB", pPath});
- createFile("/P/X.js", "public class X{}");
- getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
-
- // exit, change the jar, and restart
- simulateExit();
- touch(f);
- simulateRestart();
-
- startDeltas();
- getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[*]: {CONTENT | ARCHIVE CONTENT CHANGED}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh the JavaModel after an addition of an external jar.
- */
-public void testExternalJarAdded1() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "pAdded1.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[+]: {}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh a JavaProject after an addition of an external jar.
- */
-public void testExternalJarAdded2() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "pAdded2.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(new IJavaScriptElement[]{project},null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[+]: {}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh an external jar after an addition of this jar.
- */
-public void testExternalJarAdded3() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "pAdded3.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- f = new File(pPath);
- f.createNewFile();
- IPackageFragmentRoot root = project.getPackageFragmentRoot(pPath);
- getJavaModel().refreshExternalArchives(new IJavaScriptElement[]{root},null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[+]: {}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh the JavaModel after a removal of an external jar.
- */
-public void testExternalJarRemoved1() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- deleteFile(f);
- getJavaModel().refreshExternalArchives(null,null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[-]: {}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh a JavaProject after a removal of an external jar.
- */
-public void testExternalJarRemoved2() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- deleteFile(f);
- getJavaModel().refreshExternalArchives(new IJavaScriptElement[]{project},null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[-]: {}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * Refresh an external jar after a removal of this jar.
- */
-public void testExternalJarRemoved3() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String pPath = getExternalPath() + "p.jar";
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(pPath), null, null)});
-
- f = new File(pPath);
- f.createNewFile();
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- deleteFile(f);
- IPackageFragmentRoot root = project.getPackageFragmentRoot(pPath);
- getJavaModel().refreshExternalArchives(new IJavaScriptElement[]{root},null);
-
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"+
- " "+f.getCanonicalPath()+"[-]: {}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-/**
- * - add an internal jar to claspath
- * - remove internal jar and the same jar as external jar
- * - refresh the JavaModel
- */
-public void testExternalJarInternalExternalJar() throws CoreException, IOException {
- File f = null;
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- String internalFooPath = "/P/foo.jar";
- IFile fooIFile = this.createFile(internalFooPath, new byte[0]);
-
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(new Path(internalFooPath), null, null)});
- getJavaModel().refreshExternalArchives(null,null);
- waitUntilIndexesReady();
- startDeltas();
-
- // canonicalize the external path as this is not done on case sensitive platforms when creating a new lib entry
- IPath externalFooPath = new Path(fooIFile.getLocation().toFile().getCanonicalPath());
- setClasspath(project, new IIncludePathEntry[]{JavaScriptCore.newLibraryEntry(externalFooPath, null, null)});
-
- f = new File(externalFooPath.toOSString());
- f.createNewFile();
- touch(f);
-
- getJavaModel().refreshExternalArchives(null,null);
-
- String externalFooPathString = f.getCanonicalPath();
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n"+
- " "+externalFooPathString+"[+]: {}\n"+
- " foo.jar[*]: {REMOVED FROM CLASSPATH}\n"+
- " ResourceDelta(/P/.classpath)[*]\n"+
- "\n"+
- "P[*]: {CHILDREN}\n"+
- " "+externalFooPathString+"[*]: {CONTENT | ARCHIVE CONTENT CHANGED}"
- );
- } finally {
- if(f != null) {
- deleteFile(f);
- }
- this.deleteProject("P");
- this.stopDeltas();
- }
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/FactoryTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/FactoryTests.java
deleted file mode 100644
index e044ab0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/FactoryTests.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.wst.jsdt.core.*;
-import junit.framework.Test;
-public class FactoryTests extends ModifyingResourceTests {
-public FactoryTests(String name) {
- super(name);
-}
-
-public static Test suite() {
- return buildModelTestSuite(FactoryTests.class);
-}
-/**
- * Ensures that a Java model element can be created from a IFile that
- * is a class file.
- */
-public void testCreateBinaryToolObject() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {}, new String[] {"lib"});
- IFile file = this.createFile("/P/lib/X.class", "");
-
- IJavaScriptElement object = JavaScriptCore.create(file);
- assertTrue("tooling object not created", object != null);
- assertTrue("class file does not exist", object.exists());
- assertTrue("wrong object created", object instanceof IClassFile);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that a Java model element can be created from a IFile that
- * is a Java file. Ensures that any two model elements created will share
- * the same project.
- */
-public void testCreateCompilationUnits() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- this.createFolder("/P/src/x/y/z");
- IFile fileA = this.createFile(
- "/P/src/x/y/z/A.js",
- "package x.y.z;\n" +
- "public class A {\n" +
- "}"
- );
- IFile fileB = this.createFile(
- "/P/src/x/y/B.js",
- "package x.y;\n" +
- "public class B {\n" +
- "}"
- );
-
- IJavaScriptElement objectA = JavaScriptCore.create(fileA);
- assertTrue("tooling object A not created", objectA != null);
- assertTrue("wrong object A created", objectA instanceof IJavaScriptUnit);
- assertTrue("compilation unit A does not exist", objectA.exists());
-
- IJavaScriptElement objectB = JavaScriptCore.create(fileB);
- assertTrue("tooling object B not created", objectB != null);
- assertTrue("wrong object B created", objectB instanceof IJavaScriptUnit);
- assertTrue("compilation unit B does not exist", objectB.exists());
-
- assertEquals("should share project", ((IJavaScriptUnit)objectA).getJavaScriptProject(), ((IJavaScriptUnit)objectB).getJavaScriptProject());
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that a Java model element can be created from a IFile that
- * is a Java file. Even if not on the classpath (in this case it should not exist).
- */
-public void testCreateCompilationUnitsNotOnClasspath() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- this.createFolder("/P/other/nested");
- IFile fileA = this.createFile("/P/other/A.js", "public class A {}");
- IFile fileB = this.createFile("/P/other/nested/B.js", "public class B {}");
- IFile fileC = this.createFile("/P/C.js", "public class C {}");
-
- IJavaScriptElement objectA = JavaScriptCore.create(fileA);
- assertTrue("tooling object A not created", objectA != null);
- assertTrue("wrong object A created", objectA instanceof IJavaScriptUnit);
- assertTrue("compilation unit A should not exist", !objectA.exists());
-
- IJavaScriptElement objectB = JavaScriptCore.create(fileB);
- assertTrue("tooling object B not created", objectB != null);
- assertTrue("wrong object B created", objectB instanceof IJavaScriptUnit);
- assertTrue("compilation unit B should not exist", !objectB.exists());
-
- assertEquals("should share project", ((IJavaScriptUnit)objectA).getJavaScriptProject(), ((IJavaScriptUnit)objectB).getJavaScriptProject());
-
- IJavaScriptElement objectC = JavaScriptCore.create(fileC);
- assertTrue("tooling object C not created", objectC != null);
- assertTrue("wrong object C created", objectC instanceof IJavaScriptUnit);
- assertTrue("compilation unit C should not exist", !objectC.exists());
-
- IPackageFragment pkg= (IPackageFragment)objectA.getParent() ;
- IPackageFragmentRoot root= (IPackageFragmentRoot)pkg.getParent();
- assertEquals("pkg should be default", "", pkg.getElementName());
- assertEquals("unexpected parent's folder", this.getFolder("/P/other"), pkg.getResource());
- assertEquals("unexpected root", this.getFolder("/P/other"), root.getResource());
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that a Java model element can be created from a IFolder.
- * Test that no elements are created if there is no classpath.
- * Ensure that the correct Java model element is created based on the
- * classpath.
- */
-public void testCreateFolderToolObjects() throws CoreException {
- try {
- IJavaScriptProject javaProject = this.createJavaProject("P", new String[] {});
- this.createFolder("/P/src/x/y/z");
-
- IFolder src =this.getFolder("/P/src");
- IFolder res = src.getFolder("x");
- IJavaScriptElement object = JavaScriptCore.create(res);
- assertTrue("tooling object 1 should not be created", object == null);
-
- //set a classpath
- IIncludePathEntry[] classpath= new IIncludePathEntry[] {JavaScriptCore.newSourceEntry(src.getFullPath())};
- javaProject.setRawIncludepath(classpath, null);
-
- //test with a class path
- object = JavaScriptCore.create(src);
- assertTrue("tooling object 2 should be created", object != null);
- assertTrue("tooling object 2 should be a IPackageFragmentRoot", object instanceof IPackageFragmentRoot);
- assertEquals("IPackageFragmentRoot 2 name is incorrect", "src", object.getElementName());
- assertTrue("root 'src' does not exist", object.exists());
-
- object = JavaScriptCore.create(res);
- assertTrue("tooling object 3 should be created", object != null);
- assertTrue("tooling object 3 should be a IPackageFragment", object instanceof IPackageFragment);
- assertEquals("IPackageFragment 3 name is incorrect", "x", object.getElementName());
- assertTrue("package 'com' does not exist", object.exists());
-
- IFolder subFolder= res.getFolder("y");
- object= JavaScriptCore.create(subFolder);
- assertTrue("tooling object 'x.y' should be created", object != null);
- assertTrue("tooling object 'x.y' should be a IPackageFragment", object instanceof IPackageFragment);
- assertEquals("IPackageFragment 'x.y' name is incorrect", "x.y", object.getElementName());
- assertTrue("package 'x.y' does not exist", object.exists());
-
- //not on or below the class path
- IFolder bin = this.getFolder("/P/bin");
- object = JavaScriptCore.create(bin);
- assertTrue("tooling object 4 should not be created", object == null);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that the factory correctly handles empty java files
- */
-public void testCreateFromEmptyJavaFile() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- IFile file = this.createFile("/P/src/X.js", "");
-
- IJavaScriptElement cu = JavaScriptCore.create(file);
- assertTrue("does not handle empty Java files", cu != null);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that the factory correctly handles files without extensions
- */
-public void testCreateFromFileWithoutExtension() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
- IFile file = this.createFile("/P/src/FileWithoutExtension", "public class X {}");
-
- IJavaScriptElement cu = JavaScriptCore.create(file);
- assertTrue("invalid file not detected", cu == null);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that factory correctly handles invalid mementos.
- */
-public void testCreateFromInvalidMemento() {
- assertTrue("invalid parameter not detected", JavaScriptCore.create((String) null) == null);
- assertTrue("should return the java model", JavaScriptCore.create("") != null);
-}
-/**
- * Ensures that a Java model element can be created from a IFile
- * that is a zip or jar.
- */
-public void testCreateJarToolObject() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {}, new String[] {"/P/lib.jar"});
- IFile file = this.createFile("/P/lib.jar", "");
-
- IJavaScriptElement jar = JavaScriptCore.create(file);
- assertTrue("tooling object not created", jar != null);
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Ensures that a Java model element can be created from a class folder library that is in the project's output.
- * (regression test for bug 25538 Conflict of classfolder and outputfolder not reported)
-*/
-public void testCreateLibInOutput() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {}, new String[] {"/P/lib"});
- IFolder folder = this.createFolder("/P/lib");
-
- IJavaScriptElement lib = JavaScriptCore.create(folder);
- assertTrue("tooling object not created", lib != null);
- } finally {
- this.deleteProject("P");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/GetSourceTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/GetSourceTests.java
deleted file mode 100644
index aa9c0d3..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/GetSourceTests.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.Test;
-
-public class GetSourceTests extends ModifyingResourceTests {
-
- IJavaScriptUnit cu;
-
- public GetSourceTests(String name) {
- super(name);
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- createJavaProject("P");
- createFolder("/P/p");
- createFile("/P/p/X.js", "package p;\n" + "import java.lang.*;\n"
- + "public class X {\n" + " public Object field;\n"
- + " private int s\\u0069ze;\n" + " void foo(String s) {\n"
- + " final int var1 = 2;\n" + " Object var2;\n"
- + " for (int i = 0; i < 10; i++) {}\n" + " }\n"
- + " private int bar() {\n" + " return 1;\n" + " }\n"
- + " /**\n" + " * Returns the size.\n" + " * @return\n"
- + " * the size\n" + " */\n"
- + " int getSiz\\u0065 () {\n" + " return this.size;\n"
- + " }\n" + "}");
- this.cu = getCompilationUnit("/P/p/X.js");
- String cuSource = "package p;\n" + "public class Constants {\n"
- + " static final long field1 = 938245798324893L;\n"
- + " static final long field2 = 938245798324893l;\n"
- + " static final long field3 = 938245798324893;\n"
- + " static final char field4 = ' ';\n"
- + " static final double field5 = 938245798324893D;\n"
- + " static final float field6 = 123456f;\n"
- + " static final int field7 = 1<<0;\n" + "}";
- createFile("/P/p/Constants.js", cuSource);
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
- // Names of tests to run: can be "testBugXXXX" or "BugXXXX")
- // TESTS_NAMES = new String[] { "TypeParameterBug73884" };
- // Numbers of tests to run: "test<number>" will be run for each number
- // of this array
- // TESTS_NUMBERS = new int[] { 13 };
- // Range numbers of tests to run: all tests between "test<first>" and
- // "test<last>" will be run for { first, last }
- // TESTS_RANGE = new int[] { 16, -1 };
- }
-
- public static Test suite() {
- return buildModelTestSuite(GetSourceTests.class);
- }
-
- public void tearDownSuite() throws Exception {
- deleteProject("P");
- super.tearDownSuite();
- }
-
- /**
- * Ensure the source for a field contains the modifiers, field type, name,
- * and terminator.
- */
- public void testField() throws JavaScriptModelException {
- IType type = this.cu.getType("X");
- IField field = type.getField("field");
-
- String actualSource = field.getSource();
- String expectedSource = "public Object field;";
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /**
- * Ensure the source for an import contains the 'import' keyword, name, and
- * terminator.
- */
- public void testImport() throws JavaScriptModelException {
- IImportDeclaration i = this.cu.getImport("java.lang.*");
-
- String actualSource = i.getSource();
- String expectedSource = "import java.lang.*;";
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /*
- * Ensures the source for a local variable contains the modifiers, type and
- * name.
- */
- public void testLocalVariable1() throws JavaScriptModelException {
- ILocalVariable var = getLocalVariable("/P/p/X.js", "var1 = 2;", "var1");
-
- String actualSource = ((ISourceReference) var).getSource();
- String expectedSource = "final int var1 = 2;";
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /*
- * Ensures the source for a local variable contains the modifiers, type and
- * name.
- */
- public void testLocalVariable2() throws JavaScriptModelException {
- ILocalVariable var = getLocalVariable("/P/p/X.js", "var2;", "var2");
-
- String actualSource = ((ISourceReference) var).getSource();
- String expectedSource = "Object var2;";
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /*
- * Ensures the source for a local variable contains the modifiers, type and
- * name.
- */
- public void testLocalVariable3() throws JavaScriptModelException {
- ILocalVariable var = getLocalVariable("/P/p/X.js", "i = 0;", "i");
-
- String actualSource = ((ISourceReference) var).getSource();
- String expectedSource = "int i = 0"; // semi-colon is not part of the
- // local declaration in a for
- // statement
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /*
- * Ensures the source for a local variable contains the modifiers, type and
- * name.
- */
- public void testLocalVariable4() throws JavaScriptModelException {
- ILocalVariable var = getLocalVariable("/P/p/X.js", "s) {", "s");
-
- String actualSource = ((ISourceReference) var).getSource();
- String expectedSource = "String s";
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /**
- * Ensure the source for a method contains the modifiers, return type,
- * selector, and terminator.
- */
- public void testMethod() throws JavaScriptModelException {
- IType type = this.cu.getType("X");
- IFunction method = type.getFunction("bar", new String[0]);
-
- String actualSource = method.getSource();
- String expectedSource = "private int bar() {\n" + " return 1;\n"
- + " }";
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /*
- * Ensures the name range for a method with syntax errors in its header is
- * correct. (regression test for bug 43139 Delete member in Outliner not
- * working)
- */
- public void testNameRangeMethodWithSyntaxError() throws CoreException {
- try {
- String cuSource = "package p;\n" + "public class Y {\n"
- + " void foo() {\n" + " }\n" + " void static bar() {}\n"
- + "}";
- createFile("/P/p/Y.js", cuSource);
- IFunction method = getCompilationUnit("/P/p/Y.js").getType("Y")
- .getFunction("bar", new String[0]);
-
- String actualSource = getNameSource(cuSource, method);
- String expectedSource = "bar";
- assertSourceEquals("Unexpected source'", expectedSource,
- actualSource);
- } finally {
- deleteFile("/P/p/Y.js");
- }
- }
-
- /*
- * Ensures the name range for an anonymous class is correct. (regression
- * test for bug 44450 Strange name range for anonymous classes)
- */
- public void testNameRangeAnonymous() throws CoreException {
- try {
- String cuSource = "package p;\n" + "public class Y {\n"
- + " void foo() {\n" + " Y y = new Y() {};\n"
- + " class C {\n" + " }\n" + " }\n" + "}";
- createFile("/P/p/Y.js", cuSource);
- IType anonymous = getCompilationUnit("/P/p/Y.js").getType("Y")
- .getFunction("foo", new String[0]).getType("", 1);
-
- String actualSource = getNameSource(cuSource, anonymous);
- String expectedSource = "Y";
- assertSourceEquals("Unexpected source'", expectedSource,
- actualSource);
- } finally {
- deleteFile("/P/p/Y.js");
- }
- }
-
- /**
- * Ensure the source for a field contains the modifiers, field type, name,
- * and terminator, and unicode characters.
- */
- public void testUnicodeField() throws JavaScriptModelException {
- IType type = this.cu.getType("X");
- IField field = type.getField("size");
-
- String actualSource = field.getSource();
- String expectedSource = "private int s\\u0069ze;";
- assertSourceEquals("Unexpected source'", expectedSource, actualSource);
- }
-
- /**
- * Ensure the source for a field contains the modifiers, field type, name,
- * and terminator, and unicode characters.
- */
- public void testUnicodeMethod() throws JavaScriptModelException {
- IType type = this.cu.getType("X");
- IFunction method = type.getFunction("getSize", null);
-
- String actualSource = method.getSource();
- String expectedSource = "/**\n" + " * Returns the size.\n"
- + " * @return\n" + " * the size\n" + " */\n"
- + " int getSiz\\u0065 () {\n" + " return this.size;\n"
- + " }";
- assertSourceEquals("Unexpected source", expectedSource, actualSource);
- }
-
- /**
- * Test the field constant
- */
- private IField getConstantField(String fieldName) {
- IType type = getCompilationUnit("/P/p/Constants.js").getType(
- "Constants");
- IField field = type.getField(fieldName);
- return field;
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/HierarchyOnWorkingCopiesTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
deleted file mode 100644
index f41c826..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.ITypeHierarchy;
-import junit.framework.Test;
-
-public class HierarchyOnWorkingCopiesTests extends WorkingCopyTests {
-
-public HierarchyOnWorkingCopiesTests(String name) {
- super(name);
-}
-
-public static Test suite() {
- return buildModelTestSuite(HierarchyOnWorkingCopiesTests.class);
- /* NOTE: cannot use 'new Suite(HierarchyOnWorkingCopiesTests.class)' as this would include tests from super class
- TestSuite suite = new Suite(HierarchyOnWorkingCopiesTests.class.getName());
-
- suite.addTest(new HierarchyOnWorkingCopiesTests("testSimpleSuperTypeHierarchy"));
- suite.addTest(new HierarchyOnWorkingCopiesTests("testSimpleSubTypeHierarchy"));
-
- return suite;
- */
-}
-/**
- */
-public void testSimpleSubTypeHierarchy() throws CoreException {
- String newContents =
- "function A(){}\n" +
- "A.prototype = new B()\n";
- this.copy.getBuffer().setContents(newContents);
- this.copy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- IFile file = null;
- try {
- file = this.createFile(
- "P/src/x/y/B.js",
- "function B() {}\n");
-
- IType type = this.getCompilationUnit("P/src/x/y/B.js").getType("B");
- ITypeHierarchy h = type.newTypeHierarchy(new IJavaScriptUnit[] {this.copy}, null);
-
- assertHierarchyEquals(
- "Focus: B [in B.js [in x.y [in src [in P]]]]\n" +
- "Super types:\n" +
- " Object [in System.js [in java.lang [in "+ getSystemJsPathString() + " [in P]]]]\n" +
- "Sub types:\n" +
- " A [in [Working copy] A.js [in x.y [in src [in P]]]]\n",
- h);
- } finally {
- if (file != null) {
- this.deleteResource(file);
- }
- }
-}
-/**
- */
-public void testSimpleSuperTypeHierarchy() throws CoreException {
- String newContents =
- "function A() {this.a = 1;}\n" +
- "function B(this.b = 2;) {\n" +
- "}";
- this.copy.getBuffer().setContents(newContents);
- this.copy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- IFile file = null;
- try {
- file = this.createFile(
- "P/src/x/y/C.js",
- "function C() {} {\n" +
- "C.prototype = new B();");
-
- IType type = this.getCompilationUnit("P/src/x/y/C.js").getType("C");
- ITypeHierarchy h = type.newSupertypeHierarchy(new IJavaScriptUnit[] {this.copy}, null);
-
- assertHierarchyEquals(
- "Focus: C [in C.js [in x.y [in src [in P]]]]\n" +
- "Super types:\n" +
- " B [in [Working copy] A.js [in x.y [in src [in P]]]]\n" +
- " Object [in Object.class [in java.lang [in "+ getSystemJsPathString() + " [in P]]]]\n" +
- "Sub types:\n",
- h);
- } finally {
- if (file != null) {
- this.deleteResource(file);
- }
- }
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/InclusionPatternsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/InclusionPatternsTests.java
deleted file mode 100644
index 4531c77..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/InclusionPatternsTests.java
+++ /dev/null
@@ -1,1049 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-
-import junit.framework.Test;
-
-public class InclusionPatternsTests extends ModifyingResourceTests {
- IJavaScriptProject project;
-public InclusionPatternsTests(String name) {
- super(name);
-}
-
-static {
-// TESTS_NAMES = new String[] { "testIncludeCUOnly02" };
-}
-public static Test suite() {
- return buildModelTestSuite(InclusionPatternsTests.class);
-}
-protected void setClasspath(String[] sourceFoldersAndInclusionPatterns) throws JavaScriptModelException {
- this.project.setRawIncludepath(createClasspath(sourceFoldersAndInclusionPatterns, true/*inclusion*/, false/*no exclusion*/), null);
-}
-protected void setUp() throws Exception {
- super.setUp();
- this.project = createJavaProject( "P", new String[] {"src"}, new String[] {}, new String[] {}, new boolean[] {}, "bin", new String[] {"bin"}, new String[][] {new String[] {}}, new String[][] {new String[] {"**"}}, "1.4");
- startDeltas();
-}
-
-protected void tearDown() throws Exception {
- stopDeltas();
- deleteProject("P");
- super.tearDown();
-}
-/*
- * Ensure that adding an inclusion on a compilation unit
- * makes it appear in the children of its package and it is removed from the non-java resources.
- */
-public void testAddInclusionOnCompilationUnit() throws CoreException {
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", "**/A.js"});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "A.java [in p [in src [in P]]]",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that adding an inclusion on a folder directly under a project (and prj=src)
- * makes it disappear from the non-java resources.
- */
-public void testAddInclusionOnFolderUnderProject() throws CoreException {
- try {
- IJavaScriptProject javaProject = createJavaProject("P1", new String[] {""});
- createFolder("/P1/doc");
-
- clearDeltas();
- javaProject.setRawIncludepath(createClasspath(new String[] {"/P1", "doc/"}, true/*inclusion*/, false/*no exclusion*/), null);
-
- assertDeltas(
- "Unexpected deltas",
- "P1[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " <project root>[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P1/.classpath)[*]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P1");
- assertSortedElementsEqual(
- "Unexpected children",
- "doc [in <project root> [in P1]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources of project",
- ".classpath\n" +
- ".project",
- javaProject.getNonJavaScriptResources());
- } finally {
- deleteProject("P1");
- }
-}
-/*
- * Ensure that adding an inclusion on a package
- * makes it appear in the list of children of its package fragment root
- * and it is removed from the non-java resources.
- */
-public void testAddInclusionOnPackage() throws CoreException {
- createFolder("/P/src/p");
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", "p/"});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "p [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that adding a file to a folder that is included reports the correct delta.
- */
-public void testAddToIncludedFolder() throws CoreException {
- createFolder("/P/src/p");
-
- // include folder and its contents
- setClasspath(new String[] {"/P/src", "p/"});
-
- clearDeltas();
- createFile("/P/src/p/my.txt", "");
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/p/my.txt)[+]"
- );
-
- clearDeltas();
- deleteFile("/P/src/p/my.txt");
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src/p/my.txt)[-]"
- );
-}
-/*
- * Ensure that creating an included compilation unit
- * doesn't make it appear as a non-java resource but it is a child of its package.
- */
-public void testCreateIncludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IPackageFragment pkg = getPackage("/P/src/p");
-
- clearDeltas();
- pkg.createCompilationUnit(
- "A.js",
- "package p;\n" +
- "public class A {\n" +
- "}",
- false,
- null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " A.java[+]: {}"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "A.java [in p [in src [in P]]]",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that creating an included package
- * makes it appear as a child of its package fragment root and not as a non-java resource.
- */
-public void testCreateIncludedPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
-
- clearDeltas();
- root.createPackageFragment("p", false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[+]: {}"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "p [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that creating a file that corresponds to an included compilation unit
- * makes it appear as a child of its package and not as a non-java resource.
- */
-public void testCreateResourceIncludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
-
- clearDeltas();
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN}\n" +
- " A.java[+]: {}"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "A.java [in p [in src [in P]]]",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that creating a file that corresponds to an included compilation unit
- * in a folder that is not included makes it appear as a child of its package and not as a non-java resource.
- * (regression test for bug 65234 Inclusion filter not working)
- */
-public void testCreateResourceIncludedCompilationUnit2() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/p3/A.js"});
- createFolder("/P/src/p1/p2/p3");
-
- clearDeltas();
- createFile(
- "/P/src/p1/p2/p3/A.js",
- "package p1.p2.p3;\n" +
- "public class A {\n" +
- "}"
- );
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " p1.p2.p3[*]: {CHILDREN}\n" +
- " A.java[+]: {}\n" +
- " ResourceDelta(/P/src/p1)[*]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p1/p2/p3");
- assertSortedElementsEqual(
- "Unexpected children",
- "A.java [in p1.p2.p3 [in src [in P]]]",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that creating a folder that corresponds to an included package
- * makes it appear as a child of its package fragment root and not as a non-java resource.
- */
-public void testCreateResourceIncludedPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
-
- clearDeltas();
- createFolder("/P/src/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[+]: {}"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "p [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that creating a folder that is included in a folder that is not included
- * makes it appear as a child of its package fragment root and not as a non-java resource.
- * (regression test for bug 65234 Inclusion filter not working)
- */
-public void testCreateResourceIncludedPackage2() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/p3/"});
- createFolder("/P/src/p1/p2");
-
- clearDeltas();
- createFolder("/P/src/p1/p2/p3");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " p1.p2.p3[+]: {}\n" +
- " ResourceDelta(/P/src/p1)[*]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "p1.p2.p3 [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "p1",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensures that the default package is included if the project is a source folder and one of the
- * compilation unit of the default package is included.
- * (regression test for bug 148278 Default-package classes missing in Package Explorer)
- */
-public void testDefaultPackageProjectIsSource() throws CoreException {
- setClasspath(new String[] {"/P", "**/*.js"});
- deleteFolder("/P/src");
- createFile("/P/A.js", "public class A {}");
- IPackageFragmentRoot root = getPackageFragmentRoot("/P");
- assertElementDescendants(
- "Unexpected descendants of root",
- "<project root>\n" +
- " <default> (...)\n" +
- " A.java\n" +
- " class A",
- root);
-}
-/*
- * Ensure that a type can be resolved if it is included but not its super packages.
- * (regression test for bug 119161 classes in "deep" packages not fully recognized when using tight inclusion filters)
- */
-public void testIncludeCUOnly01() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/*.java|q/*.js"});
- addLibraryEntry(getJavaProject("P"), getSystemJsPathString(), false);
- createFolder("/P/src/p1/p2");
- createFile(
- "/P/src/p1/p2/X.js",
- "package p1.p2;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit workingCopy = null;
- try {
- ProblemRequestor problemRequestor = new ProblemRequestor();
- workingCopy = getWorkingCopy(
- "/P/src/Y.js",
- "import p1.p2.X;\n" +
- "public class Y extends X {\n" +
- "}",
- null/*primary owner*/,
- problemRequestor);
- assertProblems(
- "Unepected problems",
- "----------\n" +
- "----------\n",
- problemRequestor);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
-}
-/*
- * Ensure that a type can be resolved if it is included but not its super packages.
- * (regression test for bug 119161 classes in "deep" packages not fully recognized when using tight inclusion filters)
- */
-public void testIncludeCUOnly02() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/p3/*.java|q/*.js"});
- addLibraryEntry(getJavaProject("P"), getSystemJsPathString(), false);
- createFolder("/P/src/p1/p2/p3");
- createFile(
- "/P/src/p1/p2/p3/X.js",
- "package p1.p2.p3;\n" +
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit workingCopy = null;
- try {
- ProblemRequestor problemRequestor = new ProblemRequestor();
- workingCopy = getWorkingCopy(
- "/P/src/Y.js",
- "import p1.p2.p3.X;\n" +
- "public class Y extends X {\n" +
- "}",
- null/*primary owner*/,
- problemRequestor);
- assertProblems(
- "Unepected problems",
- "----------\n" +
- "----------\n",
- problemRequestor);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
-}
-/*
- * Ensures that a cu that is not included is not on the classpath of the project.
- */
-public void testIsOnClasspath1() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/B.js"});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
- assertTrue("Resource should not be on classpath", !project.isOnIncludepath(file));
-
- IJavaScriptUnit cu = getCompilationUnit("/P/src/p/A.js");
- assertTrue("CU should not be on classpath", !project.isOnIncludepath(cu));
-}
-/*
- * Ensures that a cu that is included is on the classpath of the project.
- */
-public void testIsOnClasspath2() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
- assertTrue("Resource should be on classpath", project.isOnIncludepath(file));
-
- IJavaScriptUnit cu = getCompilationUnit("/P/src/p/A.js");
- assertTrue("CU should be on classpath", project.isOnIncludepath(cu));
-}
-/*
- * Ensures that a non-java resource that is not included is not on the classpath of the project.
- */
-public void testIsOnClasspath3() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/X.js"});
- createFolder("/P/src/p");
- IFile file = createFile("/P/src/p/readme.txt", "");
- assertTrue("Resource should not be on classpath", !project.isOnIncludepath(file));
-}
-/*
- * Ensures that a non-java resource that is included is on the classpath of the project.
- */
-public void testIsOnClasspath4() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/**"});
- createFolder("/P/src/p");
- IFile file = createFile("/P/src/p/readme.txt", "");
- assertTrue("Resource should be on classpath", project.isOnIncludepath(file));
-}
-/*
- * Ensures that moving a folder that contains an included package reports the correct delta.
- * (regression test for bug 67324 Package Explorer doesn't update included package after moving contents of source folder)
- */
-public void testMoveFolderContainingPackage1() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/"});
- createFolder("/P/src/p1/p2");
-
- clearDeltas();
- getFolder("/P/src/p1").move(new Path("/P/p1"), false, null);
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " p1.p2[-]: {}\n" +
- " ResourceDelta(/P/src/p1)[-]\n" +
- " ResourceDelta(/P/p1)[+]"
- );
-}
-/*
- * Ensures that moving a folder that contains an included package reports the correct delta.
- * (regression test for bug 67324 Package Explorer doesn't update included package after moving contents of source folder)
- */
-public void testMoveFolderContainingPackage2() throws CoreException {
- setClasspath(new String[] {"/P/src", "p1/p2/"});
- createFolder("/P/p1/p2");
-
- clearDeltas();
- getFolder("/P//p1").move(new Path("/P/src/p1"), false, null);
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " p1.p2[+]: {}\n" +
- " ResourceDelta(/P/src/p1)[+]\n" +
- " ResourceDelta(/P/p1)[-]"
- );
-}
-/*
- * Ensures that a non-included nested source folder doesn't appear as a non-java resource of the outer folder.
- *
- */
-public void testNestedSourceFolder1() throws CoreException {
- setClasspath(new String[] {"/P/src1", "**/A.js", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
- IPackageFragmentRoot root1 = getPackageFragmentRoot("/P/src1");
- assertResourceNamesEqual(
- "Unexpected non-java resources for /P/src1",
- "",
- root1.getNonJavaScriptResources());
-}
-/*
- * Ensures that adding a .java file in a nested source folder reports
- * a delta on the nested source folder and not on the outer one.
- */
-public void testNestedSourceFolder2() throws CoreException {
- setClasspath(new String[] {"/P/src1", "**/X.js", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFile(
- "/P/src1/src2/A.js",
- "public class A {\n" +
- "}"
- );
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1/src2[*]: {CHILDREN}\n" +
- " <default>[*]: {CHILDREN}\n" +
- " A.java[+]: {}"
- );
-}
-/*
- * Ensures that adding a .txt file in a nested source folder reports
- * a resource delta on the nested source folder and not on the outer one.
- */
-public void testNestedSourceFolder3() throws CoreException {
- setClasspath(new String[] {"/P/src1", "**/X.js", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFile("/P/src1/src2/readme.txt", "");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1/src2[*]: {CONTENT}\n" +
- " ResourceDelta(/P/src1/src2/readme.txt)[+]"
- );
-}
-/*
- * Ensures that adding a folder in a nested source folder reports
- * a delta on the nested source folder and not on the outer one.
- */
-public void testNestedSourceFolder4() throws CoreException {
- setClasspath(new String[] {"/P/src1", "**/X.js", "/P/src1/src2", "**/X.js"});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFolder("/P/src1/src2/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1/src2[*]: {CHILDREN}\n" +
- " p[+]: {}"
- );
-}
-/*
- * Ensures that adding a folder in a outer source folder reports
- * a delta on the outer source folder and not on the nested one.
- */
-public void testNestedSourceFolder5() throws CoreException {
- setClasspath(new String[] {"/P/src1", "**/X.js", "/P/src1/src2", ""});
- createFolder("/P/src1/src2");
-
- clearDeltas();
- createFolder("/P/src1/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1[*]: {CHILDREN}\n" +
- " p[+]: {}"
- );
-}
-/*
- * Ensures that moving a package from an outer source folder to a nested
- * source folder reports a move delta.
- */
-public void testNestedSourceFolder6() throws CoreException {
- setClasspath(new String[] {"/P/src1", "**/X.js", "/P/src1/src2", "**/X.js"});
- createFolder("/P/src1/src2");
- createFolder("/P/src1/p");
-
- clearDeltas();
- moveFolder("/P/src1/p", "/P/src1/src2/p");
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src1[*]: {CHILDREN}\n" +
- " p[-]: {MOVED_TO(p [in src1/src2 [in P]])}\n" +
- " src1/src2[*]: {CHILDREN}\n" +
- " p[+]: {MOVED_FROM(p [in src1 [in P]])}"
- );
-}
-/*
- * Ensure that removing the inclusion on a compilation unit
- * makes it disappears from the children of its package and it is added to the non-java resources.
- */
-public void testRemoveInclusionOnCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", "**/B.js"});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "A.js",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that removing the inclusion on a package
- * makes it disappears from the children of its package fragment root
- * and it is added to the non-java resources.
- */
-public void testRemoveInclusionOnPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p"});
- createFolder("/P/src/p");
-
- clearDeltas();
- setClasspath(new String[] {"/P/src", "q"});
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN | CONTENT | CLASSPATH CHANGED}\n" +
- " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n" +
- " ResourceDelta(/P/.classpath)[*]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "<default> [in src [in P]]",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "p",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that renaming an included compilation unit so that it is not included any longer
- * makes it disappears from the children of its package and it is added to the non-java resources.
- */
-public void testRenameIncludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- file.move(new Path("/P/src/p/B.js"), false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN | CONTENT}\n" +
- " A.java[-]: {}\n" +
- " ResourceDelta(/P/src/p/B.java)[+]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "B.js",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that renaming an included package so that it is not included any longer
- * makes it disappears from the children of its package fragment root
- * and it is added to the non-java resources.
- */
-public void testRenameIncludedPackage1() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- IPackageFragment pkg = root.createPackageFragment("p", false, null);
-
- clearDeltas();
- pkg.rename("q", false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " p[-]: {}\n" +
- " ResourceDelta(/P/src/q)[+]"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "q",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that renaming an included package that has compilation units
- * so that it is not included any longer doesn't throw a JavaScriptModelException.
- * (regression test for bug 67297 Renaming included package folder throws JME)
- */
-public void testRenameIncludedPackage2() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- IPackageFragment pkg = root.createPackageFragment("p", false, null);
- createFile(
- "/P/src/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- "}"
- );
-
- clearDeltas();
- pkg.rename("q", false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " p[-]: {}\n" +
- " ResourceDelta(/P/src/q)[+]"
- );
-
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "q",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that renaming a file that corresponds to an included compilation unit so that it is not included any longer
- * makes it disappears from the children of its package and it is added to the non-java resources.
- */
-public void testRenameResourceIncludedCompilationUnit() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- IFile file = createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- clearDeltas();
- file.move(new Path("/P/src/p/B.js"), false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN}\n" +
- " p[*]: {CHILDREN | CONTENT}\n" +
- " A.java[-]: {}\n" +
- " ResourceDelta(/P/src/p/B.java)[+]"
- );
-
- IPackageFragment pkg = getPackage("/P/src/p");
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- pkg.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "B.js",
- pkg.getNonJavaScriptResources());
-}
-/*
- * Ensure that renaming a folder that corresponds to an included package
- * so that it is not included any longer
- * makes it disappears afrom the children of its package fragment root
- * and it is added to the non-java resources.
- */
-public void testRenameResourceIncludedPackage() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- IFolder folder = createFolder("/P/src/p");
-
- clearDeltas();
- folder.move(new Path("/P/src/q"), false, null);
-
- assertDeltas(
- "Unexpected deltas",
- "P[*]: {CHILDREN}\n" +
- " src[*]: {CHILDREN | CONTENT}\n" +
- " p[-]: {}\n" +
- " ResourceDelta(/P/src/q)[+]"
- );
-
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children",
- "",
- root.getChildren());
-
- assertResourceNamesEqual(
- "Unexpected non-java resources",
- "q",
- root.getNonJavaScriptResources());
-}
-/*
- * Ensure that a potential match in the output folder is not indexed.
- * (regression test for bug 32041 Multiple output folders fooling Java Model)
- */
-public void testSearchPotentialMatchInOutput() throws CoreException {
- try {
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptProject javaProject = createJavaProject("P2", new String[] {});
- javaProject.setRawIncludepath(createClasspath(new String[] {"/P2", "**/X.js", "/P2/src", ""}, true/*inclusion*/, false/*no exclusion*/), null);
- createFile(
- "/P2/bin/X.js",
- "public class X {\n" +
- "}"
- );
- }
- }, null);
-
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {getJavaProject("P")});
- search(
- "X",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- scope,
- resultCollector);
- assertEquals("", resultCollector.toString());
- } finally {
- deleteProject("P2");
- }
-}
-/*
- * Ensure search finds matches in an included compilation unit.
- */
-public void testSearchWithIncludedCompilationUnit1() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- search(
- "A",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("P")}),
- resultCollector);
- assertEquals(
- "Unexpected matches found",
- "src/p/A.java p.A [A]",
- resultCollector.toString());
-}
-/*
- * Ensure search doesn't find matches in a compilation unit that was included but that is not any longer.
- */
-public void testSearchWithIncludedCompilationUnit2() throws CoreException {
- setClasspath(new String[] {"/P/src", "**/A.js"});
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
-
- setClasspath(new String[] {"/P/src", "**/B.js"});
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- search(
- "A",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("P")}),
- resultCollector);
- assertEquals(
- "Unexpected matches found",
- "",
- resultCollector.toString());
-}
-/*
- * Ensure search finds matches in an included package.
- * (case of setting the classpath)
- */
-public void testSearchWithIncludedPackage1() throws CoreException {
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
- setClasspath(new String[] {"/P/src", "p/"});
-
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- search(
- "A",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("P")}),
- resultCollector);
- assertEquals(
- "Unexpected matches found",
- "src/p/A.java p.A [A]",
- resultCollector.toString());
-}
-/*
- * Ensure search finds matches in an included package.
- * (case of opening the project)
- */
-public void testSearchWithIncludedPackage2() throws CoreException {
- setClasspath(new String[] {"/P/src", "p/"});
- createFolder("/P/src/p");
- createFile(
- "/P/src/p/A.js",
- "package p;\n" +
- "public class A {\n" +
- "}"
- );
- IProject p = this.project.getProject();
- p.close(null);
- p.open(null);
-
- JavaSearchTests.JavaSearchResultCollector resultCollector = new JavaSearchTests.JavaSearchResultCollector();
- search(
- "A",
- IJavaScriptSearchConstants.TYPE,
- IJavaScriptSearchConstants.DECLARATIONS,
- SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("P")}),
- resultCollector);
- assertEquals(
- "Unexpected matches found",
- "src/p/A.java p.A [A]",
- resultCollector.toString());
-}
-/*
- * Ensure that an included pattern of the form "com/" includes all the subtree
- * (regression test for bug 62608 Include pattern ending with slash should include all subtree)
- */
-public void testTrailingSlash() throws CoreException {
- setClasspath(new String[] {"/P/src", "a/"});
- createFolder("/P/src/a/b/c");
- IPackageFragmentRoot root = getPackageFragmentRoot("/P/src");
- assertSortedElementsEqual(
- "Unexpected children of root",
- "a [in src [in P]]\n" +
- "a.b [in src [in P]]\n" +
- "a.b.c [in src [in P]]",
- root.getChildren());
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JSDTModelTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JSDTModelTests.java
deleted file mode 100644
index 1adedf0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JSDTModelTests.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.tests.junit.extension.TestCase;
-
- /**
- * Run all java model tests.
- */
- public class JSDTModelTests extends TestSuite {
- static {
- JavaScriptCore.getPlugin().getPluginPreferences().setValue("semanticValidation", true);
- }
-
- public JSDTModelTests() {
- this("JavaScript Model Tests");
- }
-
- public JSDTModelTests(String name) {
- super(name);
- Class[] classes = getAllTestClasses();
- for (int i = 0; i < classes.length; i++) {
- addTestSuite(classes[i]);
- }
- }
-
-private static Class[] getAllTestClasses() {
- Class[] classes = new Class[] {
-
- // Enter each test here, grouping the tests that are related
-
- // Binding key tests
- BindingKeyTests.class,
-
-// // creation of method
-// CreateMembersTests.class,
-//
-// // Java Naming convention tests
-// JavaConventionTests.class,
-//
-// // Project & Root API unit tests
-// JavaProjectTests.class,
-//
-// // Compilation unit tests
-// CompilationUnitTests.class,
-//
-// // Source attachment tests
-// AttachSourceTests.class,
-//
-// // Attached javadoc tests
-// AttachedJavadocTests.class,
-//
-// // Java search tests
-// RunJavaSearchTests.class,
-//
-// // Working copy tests
- WorkingCopyTests.class,
-// WorkingCopyNotInClasspathTests.class,
-// HierarchyOnWorkingCopiesTests.class,
-//
-// // test IJavaScriptModel
-// JavaModelTests.class,
-//
-// // tests to check the encoding
-// EncodingTests.class,
-//
-// // test class name with special names like names containing '$'
-// ClassNameTests.class,
-//
- // IBuffer tests
- BufferTests.class,
-//
-// // Name lookup tests
-// NameLookupTests2.class,
-//
-// // Classpath and output location tests
-// ClasspathTests.class,
-//
-// // Delta tests
-// JavaElementDeltaTests.class,
-// ExternalJarDeltaTests.class,
-//
-// // Java element existence tests
-// ExistenceTests.class,
-//
-// // Support for "open on" feature tests
-// ResolveTests.class,
-// ResolveTests_1_5.class,
-// SelectionJavadocModelTests.class,
-//
-// // Support for completion tests
- RunCompletionModelTests.class,
-//
-// // Prefix and suffix tests
-// NamingConventionTests.class,
-//
-// // Code correction tests
-// CodeCorrectionTests.class,
-//
-// // Options tests
-// OptionTests.class,
-//
-// // Type hierarchy tests
-// TypeHierarchyTests.class,
-// TypeHierarchyNotificationTests.class,
-// TypeHierarchySerializationTests.class,
-//
-// // Resolve type tests
-// TypeResolveTests.class,
-//
-// // Reconciler tests
-// ReconcilerTests.class,
-// ReconcilerStatementsRecoveryTests.class,
-//
-// // Copy and move operation tests
-// CopyMoveElementsTests.class,
-// CopyMoveResourcesTests.class,
-//
-// // Rename tests
-// RenameTests.class,
-//
-// // Exclusion patterns tests
-// ExclusionPatternsTests.class,
-//
-// // Inclusion patterns tests
-// InclusionPatternsTests.class,
-//
-// // Access restrictions tests
-// AccessRestrictionsTests.class,
-//
-// // Signature tests
-// SignatureTests.class,
-//
-// // Variable initializers and container initializers tests
-// ClasspathInitializerTests.class,
-//
-// // Java Model Factory tests
-// FactoryTests.class,
-//
-// // Java Element persistence tests
-// MementoTests.class,
-//
-// // Java Element sorting tests
-// SortCompilationUnitElementsTests.class,
-//
-// // Package fragment root manipulation tests
-// RootManipulationsTests.class,
-//
-// // Owverflowing cache tests
-// OverflowingCacheTests.class,
-//
-// // Working copy owner tests
-// WorkingCopyOwnerTests.class,
-//
-// // Delete Java element tests
-// DeleteTests.class,
-//
-// // Local element tests
-// LocalElementTests.class,
-//
-// // Get source tests
-// GetSourceTests.class,
-//
-// // Create packages tests
-// CreatePackageTests.class,
-//
-// // Create compilation units tests
-// CreateCompilationUnitTests.class,
-//
-// // Create search participant tests
-// SearchParticipantTests.class,
-//
-// // Class file tests
-// ClassFileTests.class,
-//
- // Java-like extensions tests
- JavaScriptLikeExtensionsTests.class,
-
- // Code snipper parsing util tests
- CodeSnippetParsingUtilTests.class
- };
-
- int classesLength = classes.length;
- Class[] result = new Class[classesLength];
- System.arraycopy(classes, 0, result, 0, classesLength);
-
- return result;
-}
-
-public static Test suite() {
- TestSuite suite = new TestSuite("JSDT Model Tests");
-
- // Hack to load all classes before computing their suite of test cases
- // this allow to reset test cases subsets while running all Java Model tests...
- Class[] classes = getAllTestClasses();
-
- // Reset forgotten subsets of tests
- TestCase.TESTS_PREFIX = null;
- TestCase.TESTS_NAMES = null;
- TestCase.TESTS_NUMBERS = null;
- TestCase.TESTS_RANGE = null;
- TestCase.RUN_ONLY_ID = null;
-
- for (int i = 0, length = classes.length; i < length; i++) {
- Class clazz = classes[i];
- Method suiteMethod;
- try {
- suiteMethod = clazz.getDeclaredMethod("suite", new Class[0]);
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- continue;
- }
- Object test;
- try {
- test = suiteMethod.invoke(null, new Object[0]);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- continue;
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- continue;
- }
- suite.addTest((Test) test);
- }
-
- return suite;
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java
deleted file mode 100644
index 4729f12..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.jsdt.core.JavaScriptConventions;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-public class JavaConventionTests extends AbstractJavaModelTests {
- public JavaConventionTests(String name) {
- super(name);
- }
-
- static {
-// TESTS_PREFIX = "testInvalidCompilerOptions";
-// TESTS_NAMES = new String[] { "testValidCompilerOptions", "testInvalidCompilerOptions" };
- }
- public static Test suite() {
- return buildModelTestSuite(JavaConventionTests.class);
- }
-
- /*
- * Verify status type and messages.
- */
- protected void verifyStatus(IStatus status, String[] expectedMessages) {
- int length = expectedMessages.length;
- IStatus[] allStatus = status.getChildren();
- switch (length) {
- case 0:
- assertTrue("Status should be OK!", status.isOK());
- return;
- case 1:
- assertFalse("Unexpected type of status!", status.isMultiStatus());
- assertEquals("Unexpected number of errors!", length, 1);
- allStatus = new IStatus[] { status };
- break;
- default:
- assertTrue("Unexpected type of status!", status.isMultiStatus());
- assertEquals("Unexpected number of errors!", length, allStatus.length);
- break;
- }
- List failuresMessages = new ArrayList();
- for (int i=0; i<length; i++) {
- assertFalse("Status should be KO!", allStatus[i].isOK());
- if (!allStatus[i].getMessage().equals(expectedMessages[i])) {
- failuresMessages.add(allStatus[i].getMessage());
- }
- }
- int count = failuresMessages.size();
- if (count > 0) {
- System.out.println("Test "+getName()+" fails. Add this declaration to fix it:");
- System.out.println(" String[] expectedMessages = {");
- for (int i=0; i<count; i++) {
- System.out.print(" \""+failuresMessages.get(i)+"\"");
- if (i==(count-1))
- System.out.println("");
- else
- System.out.println(",");
- }
- System.out.println(" };");
- }
- assertTrue("There "+(count>1?"are ":"is ")+count+" unexpected status!", count==0);
- }
-
- // Kind of validations
- static final int COMPILATION_UNIT_NAME = 1;
- static final int CLASS_FILE_NAME = 2;
- static final int FIELD_NAME = 3;
- static final int IDENTIFIER = 4;
- static final int IMPORT_DECLARATION = 5;
- static final int JAVA_TYPE_NAME = 6;
- static final int METHOD_NAME = 7;
- static final int PACKAGE_NAME = 8;
- static final int TYPE_VARIABLE_NAME = 9;
-
- // All possible compiler versions
- static final String[] VERSIONS = new String[] {
- CompilerOptions.VERSION_1_1,
- CompilerOptions.VERSION_1_2,
- CompilerOptions.VERSION_1_3,
- CompilerOptions.VERSION_1_4,
- CompilerOptions.VERSION_1_5,
- CompilerOptions.VERSION_1_6,
- };
-
- /*
- * Return the status for a string regarding a given kind of validation.
- * Use JavaScriptConventions default source and compliance levels.
- */
- int validate(String string, int kind) {
- return validate(string, kind, CompilerOptions.VERSION_1_3, CompilerOptions.VERSION_1_3);
- }
-
- /*
- * Return the status for a string regarding a given kind of validation.
- */
- int validate(String string, int kind, String sourceLevel, String complianceLevel) {
- switch (kind) {
- case COMPILATION_UNIT_NAME:
- return JavaScriptConventions.validateCompilationUnitName(string, sourceLevel, complianceLevel).getSeverity();
- case CLASS_FILE_NAME:
- return JavaScriptConventions.validateClassFileName(string, sourceLevel, complianceLevel).getSeverity();
- case FIELD_NAME:
- return JavaScriptConventions.validateFieldName(string, sourceLevel, complianceLevel).getSeverity();
- case IDENTIFIER:
- return JavaScriptConventions.validateIdentifier(string, sourceLevel, complianceLevel).getSeverity();
- case IMPORT_DECLARATION:
- return JavaScriptConventions.validateImportDeclaration(string, sourceLevel, complianceLevel).getSeverity();
- case JAVA_TYPE_NAME:
- return JavaScriptConventions.validateJavaScriptTypeName(string, sourceLevel, complianceLevel).getSeverity();
- case METHOD_NAME:
- return JavaScriptConventions.validateFunctionName(string, sourceLevel, complianceLevel).getSeverity();
- case PACKAGE_NAME:
- return JavaScriptConventions.validatePackageName(string, sourceLevel, complianceLevel).getSeverity();
- case TYPE_VARIABLE_NAME:
- return JavaScriptConventions.validateTypeVariableName(string, sourceLevel, complianceLevel).getSeverity();
- }
- return -1;
- }
-
- /**
- * @see JavaScriptConventions
- */
- public void testInvalidIdentifier() {
- String[] invalidIds = new String[] {" s\\u0069ze", " s\\u0069ze ", "", "1java", "Foo Bar", "#@$!", "Foo-Bar", "if", "InvalidEscapeSequence\\g", "true", "false", "null", null, " untrimmmed "};
- for (int i = 0; i < invalidIds.length; i++) {
- assertEquals("identifier not recognized as invalid: " + invalidIds[i], IStatus.ERROR, validate(invalidIds[i], IDENTIFIER));
- }
- }
- /**
- * @see JavaScriptConventions
- */
- public void testInvalidImportDeclaration1() {
- assertEquals("import not reconized as invalid; java.math.", IStatus.ERROR, validate("java.math.", IMPORT_DECLARATION));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testInvalidImportDeclaration2() {
- assertEquals("import not reconized as invalid; java.math*", IStatus.ERROR, validate("java.math*", IMPORT_DECLARATION));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testInvalidImportDeclaration3() {
- assertEquals("import not reconized as invalid; empty string", IStatus.ERROR, validate("", IMPORT_DECLARATION));
- }
-// /**
-// * Test for package fragment root overlap
-// * @deprecated isOverlappingRoots is deprecated
-// */
-// public void testPackageFragmentRootOverlap() throws Exception {
-// try {
-// IJavaScriptProject project = this.createJavaProject("P1", new String[] {"src"}, new String[] {"/P1/jclMin.jar"}, "bin");
-//
-// // ensure the external JCL is copied
-// setupExternalJCL("jclMin");
-//
-// this.copy(new java.io.File(getExternalJCLPathString()), new java.io.File(getWorkspaceRoot().getLocation().toOSString() + java.io.File.separator + "P1" + java.io.File.separator + "jclMin.jar"));
-// project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
-//
-// IPackageFragmentRoot p1Zip= getPackageFragmentRoot("P1", "jclMin.jar");
-// IPackageFragmentRoot p1Src= getPackageFragmentRoot("P1", "src");
-//
-// assertTrue("zip should not overlap source root",
-// !JavaScriptConventions.isOverlappingRoots(p1Zip.getUnderlyingResource().getFullPath(), p1Src.getUnderlyingResource().getFullPath()));
-//
-// this.createJavaProject("P2", new String[] {"src"}, "bin");
-//
-// IPackageFragmentRoot p2Src= getPackageFragmentRoot("P2", "src");
-// assertTrue("source roots in different projects should not overlap ",
-// !JavaScriptConventions.isOverlappingRoots(p1Src.getUnderlyingResource().getFullPath(), p2Src.getUnderlyingResource().getFullPath()));
-//
-// assertTrue("The same root should overlap", JavaScriptConventions.isOverlappingRoots(p2Src.getUnderlyingResource().getFullPath(), p2Src.getUnderlyingResource().getFullPath()));
-//
-// assertTrue("isOverLappingRoot does not handle null arguments", !JavaScriptConventions.isOverlappingRoots(p2Src.getUnderlyingResource().getFullPath(), null));
-// assertTrue("isOverLappingRoot does not handle null arguments", !JavaScriptConventions.isOverlappingRoots(null, null));
-// } finally {
-// this.deleteProject("P1");
-// this.deleteProject("P2");
-// }
-// }
- /**
- * @see JavaScriptConventions
- */
- public void testValidCompilationUnitName() {
- String[] invalidNames = new String[] {"java/lang/Object.js", "Object.class", ".js", "Object.javaaa", "A.B.js"};
- for (int i = 0; i < invalidNames.length; i++) {
- assertEquals("compilation unit name not recognized as invalid: " + invalidNames[i], IStatus.ERROR, validate(invalidNames[i], COMPILATION_UNIT_NAME));
- }
- String[] validNames = new String[] {"Object.js", "OBJECT.js", "object.js", "package-info.js"};
- for (int i = 0; i < validNames.length; i++) {
- assertEquals("compilation unit name not recognized as valid: " + validNames[i], IStatus.OK, validate(validNames[i], COMPILATION_UNIT_NAME));
- }
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidFieldName() {
- assertEquals("unicode field name not handled", IStatus.OK, validate("s\\u0069ze", FIELD_NAME));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidIdentifier() {
- String[] validIds = new String[] {"s\\u0069ze", "Object", "An_Extremly_Long_Class_Name_With_Words_Separated_By_Undescores"};
- for (int i = 0; i < validIds.length; i++) {
- assertEquals("identifier not recognized as valid: " + validIds[i], IStatus.OK, validate(validIds[i], IDENTIFIER));
- }
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidImportDeclaration() {
- assertEquals("import not reconized as valid", IStatus.OK, validate("java.math.*", IMPORT_DECLARATION));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidMethodName() {
- assertEquals("unicode method name not handled", IStatus.OK, validate("getSiz\\u0065", METHOD_NAME));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidPackageName() {
-
- String pkgName= "org.eclipse.wst.jsdt.core.t\\u0065sts.MyPackage";
- assertEquals("unicode package name not recognized as not handled", IStatus.ERROR, validate(pkgName, PACKAGE_NAME));
-
- assertEquals("package name not recognized as invalid1", IStatus.ERROR, validate("", PACKAGE_NAME));
- assertEquals("package name not recognized as valid1", IStatus.OK, validate("java . lang", PACKAGE_NAME));
- assertEquals("package name not recognized as invalid2", IStatus.ERROR, validate(" java . lang", PACKAGE_NAME));
- assertEquals("package name not recognized as invalid3", IStatus.ERROR, validate("java . lang ", PACKAGE_NAME));
- assertEquals("package name not recognized as invalid4", IStatus.ERROR, validate(null, PACKAGE_NAME));
- assertEquals("package name not recognized as unconventional1", IStatus.WARNING, validate("Java.lang", PACKAGE_NAME));
- assertEquals("package name not recognized as valid2", IStatus.OK, validate("java.Lang", PACKAGE_NAME));
- assertEquals("package name not recognized as invalid5", IStatus.WARNING, validate("Test.sample&plugin", PACKAGE_NAME));
- assertEquals("package name not recognized as unconventional2", IStatus.WARNING, validate("Test.sample", PACKAGE_NAME));
- assertEquals("package name not recognized as unconventional3", IStatus.WARNING, validate("white space", PACKAGE_NAME));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidTypeName() {
- // regression tests for 1G5HVPB: ITPJCORE:WINNT - validateJavaTypeName accepts type names ending with \
- assertEquals("type name should not contain slashes (1)", IStatus.ERROR, validate("Object\\", JAVA_TYPE_NAME));
- assertEquals("type name should not contain slashes (2)", IStatus.ERROR, validate("Object/", JAVA_TYPE_NAME));
- assertEquals("type name should not contain slashes (3)", IStatus.ERROR, validate("\\Object", JAVA_TYPE_NAME));
- assertEquals("type name should not contain slashes (4)", IStatus.ERROR, validate("java\\lang\\Object", JAVA_TYPE_NAME));
-
- // regression test for 1G52ZIF: ITPJUI:WINNT - Wizards should strongly discourage the use of non-standard names
- assertEquals("discouraged type names not handled", IStatus.WARNING, validate("alowercasetypename", JAVA_TYPE_NAME));
-
- // other tests
- assertEquals("unicode type name not handled", IStatus.OK, validate("P\\u0065a", JAVA_TYPE_NAME));
- assertEquals("qualified type names not handled", IStatus.OK, validate("java . lang\t.Object", JAVA_TYPE_NAME));
- assertEquals("simple qualified type names not handled", IStatus.OK, validate("java.lang.Object", JAVA_TYPE_NAME));
- assertEquals("simple type names not handled", IStatus.OK, validate("Object", JAVA_TYPE_NAME));
- assertEquals("discouraged type names not handled", IStatus.WARNING, validate("Object$SubType", JAVA_TYPE_NAME));
- assertEquals("invalid type name not recognized", IStatus.ERROR, validate("==?==", JAVA_TYPE_NAME));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidTypeVariableName() {
- assertEquals("E sould be a valid variable name", IStatus.OK, validate("E", TYPE_VARIABLE_NAME));
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidUnicodeImportDeclaration() {
-
- String pkgName= "com.\\u0069bm.jdt.core.tests.MyPackag\\u0065";
- assertEquals("import not reconized as valid", IStatus.OK, validate(pkgName, IMPORT_DECLARATION));
-
- }
- /**
- * @see JavaScriptConventions
- */
- public void testValidUnicodePackageName() {
-
- String pkgName= "com.\\u0069bm.jdt.core.tests.MyPackag\\u0065";
- assertEquals("unicode package name not handled", IStatus.OK, validate(pkgName, PACKAGE_NAME));
- assertEquals("Parameter modified", "com.\\u0069bm.jdt.core.tests.MyPackag\\u0065", pkgName);
-
- }
-
- /**
- * Test fix for bug 79392: [prefs] JavaScriptConventions should offer compiler options validation API
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=79392">79392</a>
- * TODO (frederic) activate all following tests when bug 79392 will be finalized
- */
- /*
- public void testInvalidCompilerOptions01() throws CoreException, BackingStoreException {
- // Set options
- Map options = JavaScriptCore.getOptions();
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_5);
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_5);
- options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_4);
-
- // Validate options
- String[] expectedMessages = {
- "Target level '1.4' is incompatible with source level '1.5'. A target level '1.5' or better is required"
- };
- verifyStatus(JavaScriptConventions.validateCompilerOptions(options), expectedMessages);
- }
- public void testInvalidCompilerOptions02() throws CoreException, BackingStoreException {
- Map options = JavaScriptCore.getOptions();
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_5);
-
- // Validate options
- String[] expectedMessages = {
- "Target level '1.2' is incompatible with source level '1.5'. A target level '1.5' or better is required",
- "Compliance level '1.4' is incompatible with source level '1.5'. A compliance level '1.5' or better is required"
- };
- verifyStatus(JavaScriptConventions.validateCompilerOptions(options), expectedMessages);
- }
- public void testInvalidCompilerOptions04() throws CoreException, BackingStoreException {
- // Set options
- Map options = JavaScriptCore.getOptions();
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_3);
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_5);
-
- // Validate options
- String[] expectedMessages = {
- "Compliance level '1.3' is incompatible with target level '1.4'. A compliance level '1.4' or better is required",
- "Compliance level '1.3' is incompatible with source level '1.4'. A compliance level '1.4' or better is required"
- };
- verifyStatus(JavaScriptConventions.validateCompilerOptions(options), expectedMessages);
- }
- public void testValidCompilerOptions01() throws CoreException, BackingStoreException {
- // Set options
- Map options = JavaScriptCore.getOptions();
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_5);
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_4);
-
- // Validate options
- String[] expectedMessages = {};
- verifyStatus(JavaScriptConventions.validateCompilerOptions(options), expectedMessages);
- }
- public void testValidCompilerOptions02() throws CoreException, BackingStoreException {
- // Set options
- Map options = JavaScriptCore.getOptions();
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_4);
- options.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_3);
- options.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_4);
-
- // Validate options
- String[] expectedMessages = {};
- verifyStatus(JavaScriptConventions.validateCompilerOptions(options), expectedMessages);
- }
- */
-
- /**
- * @bug 161621: enum is a Keyword for Java5 and cannot be used as a Enum name
- * @test Ensure that 'assert' identifier is rejected when source level greater than 1.3
- * and that 'enum' identifier is rejected when source level greater than 1.4
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=161621"
- */
- public void testAssertIdentifier() {
- int length = VERSIONS.length;
- for (int i=0; i<length; i++) { // source level
- for (int j=0; j<length; j++) { // compliance level
- if (i < 3) { // source level < VERSION_1_4
- assertEquals("'assert' should be accepted with source level "+VERSIONS[i], IStatus.OK, validate("assert", IDENTIFIER,VERSIONS[i], VERSIONS[j]));
- assertEquals("By convention, Java type names usually start with an uppercase letter", IStatus.WARNING, validate("assert", JAVA_TYPE_NAME,VERSIONS[i], VERSIONS[j]));
- } else {
- assertEquals("'assert' should be rejected with source level "+VERSIONS[i], IStatus.ERROR, validate("assert", IDENTIFIER,VERSIONS[i], VERSIONS[j]));
- }
- }
- }
- }
- public void testEnumIdentifier() {
- int length = VERSIONS.length;
- for (int i=0; i<length; i++) { // source level
- for (int j=0; j<length; j++) { // compliance level
- if (i < 4) { // source level < VERSION_1_5
- assertEquals("'enum' should be accepted with source level "+VERSIONS[i], IStatus.OK, validate("enum", IDENTIFIER,VERSIONS[i], VERSIONS[j]));
- assertEquals("By convention, Java type names usually start with an uppercase letter", IStatus.WARNING, validate("enum", JAVA_TYPE_NAME,VERSIONS[i], VERSIONS[j]));
- } else {
- assertEquals("'enum' should be rejected with source level "+VERSIONS[i], IStatus.ERROR, validate("enum", IDENTIFIER,VERSIONS[i], VERSIONS[j]));
- }
- }
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaElementDeltaTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaElementDeltaTests.java
deleted file mode 100644
index a0a5082..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaElementDeltaTests.java
+++ /dev/null
@@ -1,2056 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.ElementChangedEvent;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IElementChangedListener;
-import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.core.*;
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.Test;
-
-/**
- * These test ensure that modifications in Java projects are correctly reported
- * as IJavaElementDeltas.
- */
-public class JavaElementDeltaTests extends ModifyingResourceTests {
-
- public class DeltaListener implements IElementChangedListener {
- ArrayList deltas;
- int eventType;
-
- public DeltaListener() {
- DeltaListener.this.deltas = new ArrayList();
- DeltaListener.this.eventType = -1;
- }
-
- public DeltaListener(int eventType) {
- DeltaListener.this.deltas = new ArrayList();
- DeltaListener.this.eventType = eventType;
- }
-
- public void elementChanged(ElementChangedEvent event) {
- if (DeltaListener.this.eventType == -1
- || event.getType() == DeltaListener.this.eventType) {
- DeltaListener.this.deltas.add(event.getDelta());
- }
- }
-
- public void flush() {
- DeltaListener.this.deltas = new ArrayList();
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = DeltaListener.this.deltas.size(); i < length; i++) {
- IJavaScriptElementDelta delta = (IJavaScriptElementDelta) this.deltas
- .get(i);
- IJavaScriptElementDelta[] children = delta
- .getAffectedChildren();
- if (children.length > 0) {
- for (int j = 0, childrenLength = children.length; j < childrenLength; j++) {
- buffer.append(children[j]);
- if (j != childrenLength - 1) {
- buffer.append("\n");
- }
- }
- } else {
- buffer.append(delta);
- }
- if (i != length - 1) {
- buffer.append("\n\n");
- }
- }
- return buffer.toString();
- }
- }
-
- public static Test suite() {
- return buildModelTestSuite(JavaElementDeltaTests.class);
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
- // TESTS_PREFIX = "testBug100772_ProjectScope";
- // TESTS_NAMES = new String[] { "testAddInvalidSubfolder" };
- // TESTS_NUMBERS = new int[] { 100772 };
- // TESTS_RANGE = new int[] { 83304, -1 };
- }
-
- public JavaElementDeltaTests(String name) {
- super(name);
- }
-
- /**
- * Ensures that adding a comment to a working copy and commiting it triggers
- * an empty fine grained delta with the kind set for POST_CHANGE listeners.
- * (regression test for bug 32937 Kind not set for empty fine-grained delta)
- */
- public void testAddCommentAndCommit() throws CoreException {
- DeltaListener listener = new DeltaListener(
- ElementChangedEvent.POST_CHANGE);
- IJavaScriptUnit copy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFile("P/X.js", "function X() {\n" + "}");
- IJavaScriptUnit unit = getCompilationUnit("P", "", "", "X.js");
- copy = unit.getWorkingCopy(null);
-
- // add comment to working copy
- copy.getBuffer().setContents(
- "function X(){\n" + " // some comment\n" + "}");
-
- // commit working copy
- JavaScriptCore.addElementChangedListener(listener,
- ElementChangedEvent.POST_CHANGE);
- copy.commitWorkingCopy(true, null);
- assertEquals(
- "Unexpected delta after committing working copy",
- "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " X.js[*]: {CONTENT | FINE GRAINED | PRIMARY RESOURCE}",
- listener.toString());
- } finally {
- JavaScriptCore.removeElementChangedListener(listener);
- if (copy != null)
- copy.discardWorkingCopy();
- deleteProject("P");
- }
- }
-
- /*
- * Add cu in default package test (proj=src=bin).
- */
- public void testAddCuInDefaultPkg1() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- startDeltas();
- createFile("P/X.js", "function X() {\n" + "}");
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n" + " X.js[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Add cu in default package test (proj!=src!=bin).
- */
- public void testAddCuInDefaultPkg2() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
- startDeltas();
- createFile("P/src/X.js", "function X() {\n" + "}");
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src[*]: {CHILDREN}\n" + " <default>[*]: {CHILDREN}\n"
- + " X.js[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Add cu after opening its project (regression test for 56870 copied file
- * not shown in package explorer / java browser [ccp])
- */
- public void testAddCuAfterProjectOpen() throws CoreException {
- try {
- IJavaScriptProject p1 = createJavaProject("P1",
- new String[] { "src" });
- IJavaScriptProject p2 = createJavaProject("P2",
- new String[] { "src" });
- createFile("P2/src/X.js", "function X() {\n" + "}");
- IProject project = p2.getProject();
- project.close(null);
-
- // invalidate roots
- p1.setRawIncludepath(new IIncludePathEntry[] {}, null);
-
- // open project
- project.open(null);
-
- startDeltas();
- createFile("P2/src/Y.js", "function Y() {\n" + "}");
- assertDeltas("Unexpected delta", "P2[*]: {CHILDREN}\n"
- + " src[*]: {CHILDREN}\n" + " <default>[*]: {CHILDREN}\n"
- + " Y.js[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
- }
-
- /*
- * Add the .classpath file to a Java project that was missing it.
- * (regression test for bug 26128 packages don't appear in package explorer
- * view)
- */
- public void testAddDotClasspathFile() throws CoreException {
- try {
- createProject("P");
- createFolder("/P/src");
-
- // add Java nature
- editFile(
- "/P/.project",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<projectDescription>\n"
- + " <name>Test</name>\n"
- + " <comment></comment>\n"
- + " <projects>\n"
- + " </projects>\n"
- + " <buildSpec>\n"
- + " <buildCommand>\n"
- + " <name>org.eclipse.wst.jsdt.core.jsbuilder</name>\n"
- + " <arguments>\n"
- + " </arguments>\n"
- + " </buildCommand>\n"
- + " </buildSpec>\n"
- + " <natures>\n"
- + " <nature>org.eclipse.wst.jsdt.core.jsnature</nature>\n"
- + " </natures>\n" + "</projectDescription>");
-
- startDeltas();
- createFile(
- "P/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<classpath>\n"
- + " <classpathentry kind=\"src\" path=\"src\"/>\n"
- + " <classpathentry kind=\"output\" path=\"bin\"/>\n"
- + "</classpath>");
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {REMOVED FROM CLASSPATH}\n"
- + " src[*]: {ADDED TO CLASSPATH}\n"
- + " ResourceDelta(/P/.classpath)[+]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensure that a resource delta is fired when a file is added to a non-java
- * project. (regression test for bug 18698 Seeing non-java projects in
- * package view)
- */
- public void testAddFileToNonJavaProject() throws CoreException {
- try {
- createProject("P");
- startDeltas();
- createFile("/P/toto.txt", "");
- assertDeltas("Unexpected delta", "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensure that adding a folder in a non-Java folder (i.e. a folder with an
- * invalid package name) reports the correct delta (regression test for bug
- * 130982 META-INF directories shown as empty META-INF.* packages in J2EE
- * Navigator)
- */
- public void testAddFolderInNonJavaFolder() throws CoreException {
- try {
- createJavaProject("P");
- createFolder("/P/META-INF");
- startDeltas();
- createFolder("/P/META-INF/folder");
- assertDeltas("Unexpected delta", "P[*]: {CONTENT}\n"
- + " ResourceDelta(/P/META-INF)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensure that a resource delta is fired when a .name folder is added to a
- * java project where prj=src. (regression test for bug 31383 Strange
- * rendering of of link resources when link points to Eclipse workspace)
- */
- public void testAddInvalidSubfolder() throws CoreException {
- try {
- createJavaProject("P");
- startDeltas();
- createFolder("/P/p/.folder");
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n" + " p[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Add the java nature to an existing project.
- */
- public void testAddJavaNature() throws CoreException {
- try {
- createProject("P");
- startDeltas();
- addJavaNature("P");
- assertDeltas("Unexpected delta", "P[+]: {}\n" + "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Add the java nature to an existing project and set the classpath in an
- * IWorkspaceRunnable. Ensures that adding a non-java resource reports the
- * correct delta. (regression test for bug 44066 Package Explorer doesn't
- * show new file)
- */
- public void testAddJavaNatureAndClasspath() throws CoreException {
- try {
- createProject("P");
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- addJavaNature("P");
- createFolder("/P/src");
- getJavaProject("P").setRawIncludepath(
- new IIncludePathEntry[] { JavaScriptCore
- .newSourceEntry(new Path("/P/src")) },
- null);
- }
- }, null);
- startDeltas();
- createFile("/P/src/file.txt", "");
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src[*]: {CONTENT}\n"
- + " ResourceDelta(/P/src/file.txt)[+]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Add a java project.
- */
- public void testAddJavaProject() throws CoreException {
- try {
- startDeltas();
- createJavaProject("P", new String[] { "" });
- assertDeltas("Unexpected delta", "P[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Add a non-java project.
- */
- public void testAddNonJavaProject() throws CoreException {
- try {
- startDeltas();
- createProject("P");
- assertDeltas("Should get a non-Java resource delta",
- "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- public void testAddPackageSourceIsBin() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
- startDeltas();
- createFolder("P/src/x");
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src[*]: {CHILDREN}\n" + " x[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Add 2 java projects in an IWorkspaceRunnable.
- */
- public void testAddTwoJavaProjects() throws CoreException {
- try {
- startDeltas();
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- createJavaProject("P1", new String[] { "" });
- createJavaProject("P2", new String[] { "src" });
- }
- }, null);
- assertEquals("Unexpected delta", "P1[+]: {}\n" + "P2[+]: {}",
- getSortedByProjectDeltas());
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
- }
-
- /*
- * Add 2 java projects in an IWorkspaceRunnable.
- */
- public void testAddTwoJavaProjectsWithExtraSetClasspath()
- throws CoreException {
- try {
- startDeltas();
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptProject p1 = createJavaProject("P1",
- new String[] { "" });
- // should be a no-op and no extra delta volley should be
- // fired
- p1.setRawIncludepath(p1.getRawIncludepath(), null);
- createJavaProject("P2", new String[] { "src" });
- }
- }, null);
- assertEquals("Unexpected delta", "P1[+]: {}\n" + "P2[+]: {}",
- getSortedByProjectDeltas());
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
- }
-
- /*
- * Batch operation test.
- */
- public void testBatchOperation() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
- createFolder("P/src/x");
- createFile("P/src/x/A.js", "function A() {\n" + "}");
- startDeltas();
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("P/src/x/A.js");
- // unit.createType("class B {}", null, false, monitor);
- unit.createField("var i;", null, false, monitor);
- }
- }, null);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"
- + " src[*]: {CHILDREN}\n"
- + " x[*]: {CHILDREN}\n"
- + " A.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n"
- + " i[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that if a project's output folder is used as a lib folder in
- * another project, building the first project results in the correct delta
- * in the other project.
- */
- public void testBuildProjectUsedAsLib() throws CoreException {
- try {
- IJavaScriptProject p1 = createJavaProject("P1",
- new String[] { "src1" }, new String[] { "JCL_LIB" });
- createJavaProject("P2", new String[] { "src2" },
- new String[] { "/P1/bin1" });
- createFile("/P1/src1/X.js", "function X() {\n" + "}");
-
- // force opening of project to avoid external jar delta
- p1.open(null);
-
- startDeltas();
-
- // full build
- p1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
- waitForAutoBuild();
- assertDeltas("Unexpected delta (1)", "P2[*]: {CHILDREN}\n"
- + " /P1/bin1[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n" + " X.class[+]: {}");
-
- editFile("/P1/src1/X.js", "function X() {\n" +
- // " void foo() {}\n" +
- "}\n" + "function Y() {\n" + "}");
- clearDeltas();
-
- // incremental buid
- p1.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD,
- null);
- waitForAutoBuild();
- assertDeltas("Unexpected delta (2)", "P2[*]: {CHILDREN}\n"
- + " /P1/bin1[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " X.class[*]: {CONTENT}\n" + " Y.class[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
- }
-
- /**
- * Ensures that changing the custom output folder of a source entry triggers
- * a F_REMOVED_FROM_CLASSPATH and F_ADDED_TO_CLASSPATH delta.
- */
- public void testChangeCustomOutput() throws CoreException {
- try {
- IJavaScriptProject proj = createJavaProject("P",
- new String[] { "src" }, "bin", new String[] { "bin1" });
- startDeltas();
- setClasspath(proj, new IIncludePathEntry[] { JavaScriptCore
- .newSourceEntry(new Path("/P/src"), new IPath[0], new Path(
- "/P/bin2")) });
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CLASSPATH CHANGED}\n"
- + " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n"
- + " ResourceDelta(/P/.classpath)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- //
- // /*
- // * Ensures that the setting the classpath where the only change is the
- // export flag
- // * triggers a F_CLASSPATH CHANGED delta.
- // * (regression test for bug 75517 No classpath delta for project becoming
- // exported)
- // */
- // public void testChangeExportFlag() throws CoreException {
- // try {
- // createJavaProject("P1");
- // IJavaScriptProject proj = createJavaProject("P2", new String[] {}, new
- // String[] {}, new String[] {"/P1"}, new boolean[] {false}, "bin");
- // startDeltas();
- // setClasspath(
- // proj,
- // new IIncludePathEntry[] {
- // JavaScriptCore.newProjectEntry(new Path("/P1"), true)
- // });
- // assertDeltas(
- // "Unexpected delta",
- // "P2[*]: {CONTENT | CLASSPATH CHANGED}\n" +
- // " ResourceDelta(/P2/.classpath)[*]"
- // );
- // } finally {
- // stopDeltas();
- // deleteProject("P1");
- // deleteProject("P2");
- // }
- // }
-
- /**
- * Ensures that the setting the classpath with a library entry triggers a
- * F_REMOVED_FROM_CLASSPATH and F_ADDED_TO_CLASSPATH delta.
- */
- public void testChangeRootKind() throws CoreException {
- try {
- IJavaScriptProject proj = createJavaProject("P",
- new String[] { "src" });
- startDeltas();
- setClasspath(proj, new IIncludePathEntry[] { JavaScriptCore
- .newLibraryEntry(new Path("/P/src"), null, null, false) });
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN | CLASSPATH CHANGED}\n"
- + " src[*]: {ADDED TO CLASSPATH | REMOVED FROM CLASSPATH}\n"
- + " ResourceDelta(/P/.classpath)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Close a java project.
- */
- public void testCloseJavaProject() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- IProject project = getProject("P");
- startDeltas();
- project.close(null);
- assertDeltas("Unexpected delta", "P[*]: {CLOSED}\n"
- + "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Close a non-java project.
- */
- public void testCloseNonJavaProject() throws CoreException {
- try {
- createProject("P");
- IProject project = getProject("P");
- startDeltas();
- project.close(null);
- assertDeltas("Unexpected delta", "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- // /*
- // * Closing a non-java project that contains a jar referenced in another
- // project should produce
- // * a delta on this other project.
- // * (regression test for bug 19058 Closing non-java project doesn't remove
- // root from java project)
- // */
- // public void testCloseNonJavaProjectUpdateDependent() throws CoreException
- // {
- // try {
- // createProject("SP");
- // createFile("/SP/x.jar", "");
- // createJavaProject("JP", new String[] {""}, new String[] {"/SP/x.jar"},
- // "");
- // IProject project = getProject("SP");
- // startDeltas();
- // project.close(null);
- // assertDeltas(
- // "Unexpected delta",
- // "JP[*]: {CHILDREN}\n" +
- // " /SP/x.jar[-]: {}\n" +
- // "ResourceDelta(/SP)"
- // );
- // } finally {
- // stopDeltas();
- // deleteProject("SP");
- // deleteProject("JP");
- // }
- // }
- /**
- * Test that deltas are generated when a compilation unit is added and
- * removed from a package via core API.
- */
- public void testCompilationUnitRemoveAndAdd() throws CoreException {
- try {
- createJavaProject("P");
- // createFolder("/P/p");
- IFile file = createFile("/P/X.js", "function X() {\n" + "}");
-
- // delete cu
- startDeltas();
- deleteResource(file);
- assertDeltas("Unexpected delta after deleting /P/X.js",
- "P[*]: {CHILDREN}\n" + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n" + " X.js[-]: {}");
-
- // add cu
- clearDeltas();
- createFile("/P/X.js", "function X() {\n" + "}");
- assertDeltas("Unexpected delta after adding /P/p/X.js",
- "P[*]: {CHILDREN}\n" + " <project root>[*]: {CHILDREN}\n"
- + " p[*]: {CHILDREN}\n" + " X.js[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- public void testCreateSharedWorkingCopy() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFile("P/X.js", "function X() {\n" + "}");
- IJavaScriptUnit unit = getCompilationUnit("P", "", "", "X.js");
- startDeltas();
- copy = unit.getWorkingCopy(new WorkingCopyOwner() {
- }, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " [Working copy] X.js[+]: {}");
- } finally {
- stopDeltas();
- if (copy != null)
- copy.discardWorkingCopy();
- deleteProject("P");
- }
- }
-
- public void testCreateWorkingCopy() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFile("P/X.js", "function X() {\n" + "}");
- IJavaScriptUnit unit = getCompilationUnit("P", "", "", "X.js");
- startDeltas();
- copy = unit.getWorkingCopy(null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " [Working copy] X.js[+]: {}");
- } finally {
- stopDeltas();
- if (copy != null)
- copy.discardWorkingCopy();
- deleteProject("P");
- }
- }
-
- /*
- * Ensure that the delta is correct if a package is copied on top of an
- * existing package. (regression test for bug 61270 Wrong delta when copying
- * a package that overrides another package)
- */
- public void testCopyAndOverwritePackage() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src1", "src2" });
- // createFolder("/P/src1/p");
- createFile("P/src1/X.js", "function X() {\n" + "}");
- createFolder("/P/src2");
- startDeltas();
- getPackage("/P/src1").copy(getPackageFragmentRoot("/P/src2"),
- null/* no sibling */, null/* no rename */, true/* replace */,
- null/* no progress */);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src2[*]: {CHILDREN}\n" + " p[*]: {CHILDREN}\n"
- + " X.js[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Test that deltas are generated when a compilation unit not on the
- * classpath is added and removed from a package via core API.
- */
- public void testCUNotOnClasspath() throws CoreException {
- try {
- createJavaProject("P", new String[] {});
- // createFolder("/P/src/p");
- IFile file = createFile("/P/src/p/X.js", "function X() {\n" + "}");
-
- startDeltas();
- deleteResource(file);
- assertDeltas("Unexpected delta after deletion of /P/src/X.js",
- "P[*]: {CONTENT}\n" + " ResourceDelta(/P/src)[*]");
-
- clearDeltas();
- createFile("/P/src/X.js", "function X() {\n" + "}");
- assertDeltas("Unexpected delta after addition of /P/src/X.js",
- "P[*]: {CONTENT}\n" + " ResourceDelta(/P/src)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- // /*
- // * Ensure that deleting a jar that is in a folder and that is on the
- // classpath reports
- // * a removed pkg fragment root delta.
- // * (regression test for bug 27068 Elements in the Package Explorer are
- // displayed but don't more exist [package explorer])
- // *
- // */
- // public void testDeleteInnerJar() throws CoreException {
- // try {
- // createJavaProject("P", new String[] {"src"}, new String[]
- // {"/P/lib/x.jar"}, "bin");
- // createFolder("/P/lib");
- // IFile file = createFile("/P/lib/x.jar", "");
- // startDeltas();
- // deleteResource(file);
- // assertDeltas(
- // "Unexpected deltas",
- // "P[*]: {CHILDREN | CONTENT}\n" +
- // " lib/x.jar[-]: {}\n" +
- // " ResourceDelta(/P/lib)[*]"
- // );
- // } finally {
- // stopDeltas();
- // deleteProject("P");
- // }
- // }
- /*
- * Ensure that deleting a non-Java folder that contains a source root folder
- * reports a removed root delta as well as a resource delta for the removed
- * folder. (regression test for bug 24045 Error deleting parent folder of
- * source folder)
- */
- public void testDeleteNonJavaFolder() throws CoreException {
- try {
- createJavaProject("P", new String[] { "foo/bar" });
- IFolder folder = getFolder("/P/foo");
- startDeltas();
- deleteResource(folder);
- assertDeltas("Unexpected deltas", "P[*]: {CHILDREN | CONTENT}\n"
- + " foo/bar[-]: {}\n" + " ResourceDelta(/P/foo)[-]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that changing a project's classpath and deleting it in an
- * IWorkspaceRunnable doesn't throw an NPE (regression test for bug 148015
- * NPE in log from ClasspathChange)
- */
- public void testDeleteProjectAfterChangingClasspath() throws CoreException {
- try {
- final IJavaScriptProject project = createJavaProject("P");
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- project.setRawIncludepath(createClasspath("P",
- new String[] { "/P/src", "" }),
- monitor);
- deleteProject("P");
- }
- };
- startDeltas();
- getWorkspace().run(runnable, null/* no progress */);
- assertDeltas("Unexpected delta", "P[-]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }/*
- * Ensure that deleting a project and setting the classpath on another
- * project in an IWorkspaceRunnable doesn't throw a NullPointerException
- * (regression test for bug 25197 NPE importing external plugins)
- */
-
- public void testDeleteProjectSetCPAnotherProject() throws CoreException {
- final IJavaScriptProject project = createJavaProject("P1",
- new String[] { "src" });
- createJavaProject("P2", new String[] {});
-
- try {
- startDeltas();
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- deleteProject("P2");
- project.setRawIncludepath(
- new IIncludePathEntry[] { JavaScriptCore
- .newSourceEntry(project.getPath()) }, null);
- }
- }, null);
- assertDeltas("Unexpected deltas",
- "P1[*]: {CHILDREN | CLASSPATH CHANGED}\n"
- + " <project root>[*]: {ADDED TO CLASSPATH}\n"
- + " src[*]: {REMOVED FROM CLASSPATH}\n"
- + " ResourceDelta(/P1/.classpath)[*]\n"
- + "P2[-]: {}");
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- }
- }
-
- public void testDiscardWorkingCopy1() throws CoreException { // renamed from
- // testDestroyWorkingCopy
- IJavaScriptUnit copy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFile("P/X.js", "public class X {\n" + "}");
- IJavaScriptUnit unit = getCompilationUnit("P", "", "", "X.js");
- copy = unit.getWorkingCopy(null);
- startDeltas();
- copy.discardWorkingCopy();
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " [Working copy] X.js[-]: {}");
- } finally {
- stopDeltas();
- if (copy != null)
- copy.discardWorkingCopy();
- deleteProject("P");
- }
- }
-
- public void testDiscardWorkingCopy2() throws CoreException { // renamed from
- // testDestroySharedWorkingCopy
- IJavaScriptUnit copy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFile("P/X.js", "public class X {\n" + "}");
- IJavaScriptUnit unit = getCompilationUnit("P", "", "", "X.js");
- copy = unit.getWorkingCopy(new WorkingCopyOwner() {
- }, null);
- startDeltas();
- copy.discardWorkingCopy();
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " [Working copy] X.js[-]: {}");
- } finally {
- stopDeltas();
- if (copy != null)
- copy.discardWorkingCopy();
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that a delta listener that asks for POST_CHANGE events gets those
- * events and no others.
- */
- public void testListenerPostChange() throws CoreException {
- DeltaListener listener = new DeltaListener(
- ElementChangedEvent.POST_CHANGE);
- IJavaScriptUnit wc = null;
- try {
- createJavaProject("P", new String[] { "" });
- JavaScriptCore.addElementChangedListener(listener,
- ElementChangedEvent.POST_CHANGE);
-
- // cu creation
- IPackageFragment pkg = getPackage("P");
- IJavaScriptUnit cu = pkg.createCompilationUnit("X.js",
- "public class X {\n" + "}", false, null);
- assertEquals(
- "Unexpected delta after creating CU",
- "P[*]: {CHILDREN}\n" + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n" + " X.js[+]: {}",
- listener.toString());
- listener.flush();
-
- // type creation
- cu.createType("class A {\n" + "}", cu.getType("X"), false, null);
- assertEquals(
- "Unexpected delta after creating type",
- "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " X.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n"
- + " A[+]: {}", listener.toString());
- listener.flush();
-
- // non-java resource creation
- createFile("P/readme.txt", "");
- assertEquals("Unexpected delta after creating non-java resource",
- "P[*]: {CONTENT}\n" + " ResourceDelta(/P/readme.txt)[+]",
- listener.toString());
- listener.flush();
-
- // shared working copy creation
- wc = cu.getWorkingCopy(new WorkingCopyOwner() {
- }, null);
- assertEquals("Unexpected delta after creating shared working copy",
- "P[*]: {CHILDREN}\n" + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " [Working copy] X.js[+]: {}", listener
- .toString());
- listener.flush();
-
- // reconcile
- wc.getBuffer().setContents(
- "public class X {\n" + " public void foo() {\n" + " }\n"
- + "}");
- wc.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertEquals("Unexpected delta after reconciling working copy", "",
- listener.toString());
- listener.flush();
-
- // commit
- wc.commitWorkingCopy(false, null);
- assertEquals(
- "Unexpected delta after committing working copy",
- "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " X.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n"
- + " X[*]: {CHILDREN | FINE GRAINED}\n"
- + " foo()[+]: {}\n" + " A[-]: {}", listener
- .toString());
- listener.flush();
-
- // shared working copy destruction
- wc.discardWorkingCopy();
- assertEquals(
- "Unexpected delta after destroying shared working copy",
- "P[*]: {CHILDREN}\n" + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " [Working copy] X.js[-]: {}", listener
- .toString());
- listener.flush();
- wc = null;
-
- } finally {
- if (wc != null)
- wc.discardWorkingCopy();
- JavaScriptCore.removeElementChangedListener(listener);
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that a delta listener that asks for POST_RECONCILE events gets
- * those events and no others.
- */
- public void testListenerReconcile() throws CoreException {
- DeltaListener listener = new DeltaListener(
- ElementChangedEvent.POST_RECONCILE);
- IJavaScriptUnit wc = null;
- try {
- createJavaProject("P", new String[] { "" });
- JavaScriptCore.addElementChangedListener(listener,
- ElementChangedEvent.POST_RECONCILE);
-
- // cu creation
- IPackageFragment pkg = getPackage("P");
- IJavaScriptUnit cu = pkg.createCompilationUnit("X.js",
- "public class X {\n" + "}", false, null);
- assertEquals("Unexpected delta after creating CU", "", listener
- .toString());
- listener.flush();
-
- // type creation
- cu.createType("class A {\n" + "}", cu.getType("X"), false, null);
- assertEquals("Unexpected delta after creating type", "", listener
- .toString());
- listener.flush();
-
- // non-java resource creation
- createFile("P/readme.txt", "");
- assertEquals("Unexpected delta after creating non-java resource",
- "", listener.toString());
- listener.flush();
-
- // shared working copy creation
- wc = cu.getWorkingCopy(new WorkingCopyOwner() {
- }, null);
- assertEquals("Unexpected delta after creating shared working copy",
- "", listener.toString());
- listener.flush();
-
- // reconcile
- wc.getBuffer().setContents(
- "public class X {\n" + " public void foo() {\n" + " }\n"
- + "}");
- wc.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertEquals("Unexpected delta after reconciling working copy",
- "X[*]: {CHILDREN | FINE GRAINED}\n" + " foo()[+]: {}\n"
- + "A[-]: {}", listener.toString());
- listener.flush();
-
- // commit
- wc.commitWorkingCopy(false, null);
- assertEquals("Unexpected delta after committing working copy", "",
- listener.toString());
- listener.flush();
-
- // shared working copy destruction
- wc.discardWorkingCopy();
- assertEquals(
- "Unexpected delta after destroying shared working copy",
- "", listener.toString());
- listener.flush();
- wc = null;
-
- } finally {
- if (wc != null)
- wc.discardWorkingCopy();
- JavaScriptCore.removeElementChangedListener(listener);
- deleteProject("P");
- }
- }
-
- /**
- * Ensures that merging a java delta with another one that contains a
- * resource delta results in a java delta with the resource delta.
- * (regression test for 11210 ResourceDeltas are lost when merging deltas)
- */
- public void testMergeResourceDeltas() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- startDeltas();
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- // an operation that creates a java delta without firing it
- IPackageFragment pkg = getPackageFragment("P", "", "");
- pkg.createCompilationUnit("X.js", "public class X {\n"
- + "}", true, null);
-
- // an operation that generates a non java resource delta
- createFile("P/Y.txt", "");
- }
- }, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n" + " X.js[+]: {}\n"
- + " ResourceDelta(/P/Y.txt)[+]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
-
- }
-
- public void testModifyMethodBodyAndSave() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFolder("P/x/y");
- createFile("P/x/y/A.js", "package x.y;\n" + "public class A {\n"
- + " public void foo() {\n" + " }\n" + "}");
- IJavaScriptUnit cu = getCompilationUnit("P/x/y/A.js");
- workingCopy = cu.getWorkingCopy(null);
- workingCopy.getBuffer().setContents(
- "package x.y;\n" + "public class A {\n"
- + " public void foo() {\n"
- + " // method body change \n" + " }\n" + "}");
-
- startDeltas();
- workingCopy.commitWorkingCopy(true, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " x.y[*]: {CHILDREN}\n"
- + " A.js[*]: {CONTENT | FINE GRAINED | PRIMARY RESOURCE}");
- } finally {
- stopDeltas();
- if (workingCopy != null) {
- workingCopy.discardWorkingCopy();
- }
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that modifying the project output location (i.e. simulate a
- * build) doesn't report any delta.
- */
- public void testModifyOutputLocation1() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
-
- startDeltas();
- createFile("/P/bin/X.class", "");
- assertDeltas("Unexpected delta", "");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that modifying a custom output location (i.e. simulate a build)
- * doesn't report any delta. (regression test for bug 27494 Source folder
- * output folder shown in Package explorer)
- */
- public void testModifyOutputLocation2() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" }, "bin1",
- new String[] { "bin2" });
-
- startDeltas();
- createFile("/P/bin2/X.class", "");
- assertDeltas("Unexpected delta", "");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that modifying a custom output location (i.e. simulate a build)
- * doesn't report any delta. (regression test for bug 27494 Source folder
- * output folder shown in Package explorer)
- */
- public void testModifyOutputLocation3() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src1", "src2" }, "bin",
- new String[] { "src1", null });
-
- startDeltas();
- createFile("/P/bin/X.class", "");
- assertDeltas("Unexpected delta", "");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Ensures that modifying a custom output location (i.e. simulate a build)
- * doesn't report any delta. (regression test for bug 32629 DeltaProcessor
- * walking some binary output)
- */
- public void testModifyOutputLocation4() throws CoreException {
- try {
- createJavaProject("P");
- editFile(
- "/P/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<classpath>\n"
- + " <classpathentry excluding=\"src/\" kind=\"src\" output=\"bin1\" path=\"\"/>\n"
- + " <classpathentry kind=\"src\" output=\"bin2\" path=\"src\"/>\n"
- + " <classpathentry kind=\"output\" path=\"bin\"/>\n"
- + "</classpath>");
- createFolder("/P/bin2");
-
- startDeltas();
- createFile("/P/bin2/X.class", "");
- assertDeltas("Unexpected delta", "");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * bug 18953
- */
- public void testModifyProjectDescriptionAndRemoveFolder()
- throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- final IProject projectFolder = project.getProject();
- final IFolder folder = createFolder("/P/folder");
-
- startDeltas();
- getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IProjectDescription desc = projectFolder.getDescription();
- desc.setComment("A comment");
- projectFolder.setDescription(desc, null);
- deleteResource(folder);
- }
- }, null);
-
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN | CONTENT}\n"
- + " <project root>[*]: {CHILDREN}\n" + " folder[-]: {}\n"
- + " ResourceDelta(/P/.project)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Move a cu from a package to its enclosing package. (regression test for
- * bug 7033 Stale packages view after moving compilation units)
- */
- public void testMoveCuInEnclosingPkg() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- createFolder("P/x/y");
- createFile("P/x/y/A.js", "package x.y;\n" + "public class A {\n"
- + "}");
- IJavaScriptUnit cu = getCompilationUnit("P/x/y/A.js");
- IPackageFragment pkg = getPackage("P/x");
-
- startDeltas();
- cu.move(pkg, null, null, true, null);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " x[*]: {CHILDREN}\n"
- + " A.js[+]: {MOVED_FROM(A.js [in x.y [in <project root> [in P]]])}"
- + " x.y[*]: {CHILDREN}\n"
- + " A.js[-]: {MOVED_TO(A.js [in x [in <project root> [in P]]])}\n");
- assertElementDescendants("Unexpected children for package x", "x\n"
- + " A.js\n" + " package x\n" + " class A", pkg);
- assertElementDescendants("Unexpected children for package x.y",
- "x.y", getPackage("P/x/y"));
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Move a non-java resources that is under a dot-named folder. (regression
- * test for bug 6687 Wrong JavaModel refresh after drag and drop outside
- * folder with dot in name)
- */
- public void testMoveResInDotNamedFolder() throws CoreException {
- try {
- createJavaProject("P", new String[] {});
- IProject project = getProject("P");
- createFolder("P/x.y");
- IFile file = createFile("P/x.y/test.txt", "");
-
- startDeltas();
- file.move(project.getFullPath().append("test.txt"), true, null);
- assertDeltas("Unexpected delta", "P[*]: {CONTENT}\n"
- + " ResourceDelta(/P/test.txt)[+]\n"
- + " ResourceDelta(/P/x.y)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Move 2 non-java resources that were outside classpath to a package
- * fragment root. (regression test for bug 28583 Missing one unit in package
- * view)
- */
- public void testMoveTwoResInRoot() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
- final IFile f1 = createFile("P/X.js", "public class X {}");
- final IFile f2 = createFile("P/Y.js", "public class Y {}");
-
- startDeltas();
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- f1.move(new Path("/P/src/X.js"), true, null);
- f2.move(new Path("/P/src/Y.js"), true, null);
- }
- }, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN | CONTENT}\n"
- + " src[*]: {CHILDREN}\n" + " <default>[*]: {CHILDREN}\n"
- + " X.js[+]: {}\n" + " Y.js[+]: {}\n"
- + " ResourceDelta(/P/X.js)[-]\n"
- + " ResourceDelta(/P/Y.js)[-]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Test that deltas are generated when a nested package fragment root is
- * removed and added via core API.
- */
- public void testNestedRootParentMove() throws CoreException {
- try {
- createJavaProject("P",
- new String[] { "nested2/src", "nested/src" });
- deleteFolder("/P/nested2/src");
-
- startDeltas();
- IFolder folder = getFolder("/P/nested/src");
- folder.move(new Path("/P/nested2/src"), false, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN | CONTENT}\n"
- + " nested2/src[+]: {MOVED_FROM(nested/src [in P])}\n"
- + " nested/src[-]: {MOVED_TO(nested2/src [in P])}\n"
- + " ResourceDelta(/P/nested)[*]\n"
- + " ResourceDelta(/P/nested2)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Test that deltas are generated when a non-java file is removed and added
- */
- public void testNonJavaResourceRemoveAndAdd() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
- IFile file = createFile("/P/src/read.txt", "");
-
- startDeltas();
- deleteResource(file);
- assertDeltas("Unexpected delta after deleting /P/src/read.txt",
- "P[*]: {CHILDREN}\n" + " src[*]: {CONTENT}\n"
- + " ResourceDelta(/P/src/read.txt)[-]");
-
- clearDeltas();
- createFile("/P/src/read.txt", "");
- assertDeltas("Unexpected delta after creating /P/src/read.txt",
- "P[*]: {CHILDREN}\n" + " src[*]: {CONTENT}\n"
- + " ResourceDelta(/P/src/read.txt)[+]");
-
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Open a java project.
- */
- public void testOpenJavaProject() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- IProject project = getProject("P");
- project.close(null);
- startDeltas();
- project.open(null);
- assertDeltas("Unexpected delta", "P[*]: {OPENED}\n"
- + "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Open a non-java project.
- */
- public void testOpenNonJavaProject() throws CoreException {
- try {
- createProject("P");
- IProject project = getProject("P");
- project.close(null);
- startDeltas();
- project.open(null);
- assertDeltas("Unexpected delta", "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Ensures that .classpath overwrite is taken into account. (regression test
- * for bug 21420 Changing .classpath doesn't update JDT)
- */
- public void testOverwriteClasspath() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- createFolder("P/src");
- createFolder("P/bin");
- final IFile newCP = createFile(
- "P/.classpath2",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<classpath>\n"
- + " <classpathentry kind=\"src\" path=\"src\"/>\n"
- + " <classpathentry kind=\"output\" path=\"bin\"/>\n"
- + "</classpath>");
- startDeltas();
- IWorkspaceRunnable run = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IFile oldCP = newCP.getParent().getFile(
- new Path(".classpath"));
- deleteResource(oldCP);
- newCP.move(new Path("/P/.classpath"), true, null);
- }
- };
- getWorkspace().run(run, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {REMOVED FROM CLASSPATH}\n"
- + " src[*]: {ADDED TO CLASSPATH}\n"
- + " ResourceDelta(/P/.classpath)[*]\n"
- + " ResourceDelta(/P/.classpath2)[-]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Test that deltas are generated when package fragments are added and
- * removed from a root via core API.
- */
- public void testPackageFragmentAddAndRemove() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
-
- startDeltas();
- IFolder folder = createFolder("/P/src/p");
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src[*]: {CHILDREN}\n" + " p[+]: {}");
-
- clearDeltas();
- deleteResource(folder);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src[*]: {CHILDREN}\n" + " p[-]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Test that deltas are generated when a package fragment is moved via core
- * API.
- */
- public void testPackageFragmentMove() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
- IFolder folder = createFolder("/P/src/p");
-
- startDeltas();
- folder.move(new Path("/P/src/p2"), false, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src[*]: {CHILDREN}\n"
- + " p[-]: {MOVED_TO(p2 [in src [in P]])}\n"
- + " p2[+]: {MOVED_FROM(p [in src [in P]])}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Test that deltas are generated when a package fragment root is removed
- * and added via core API.
- */
- public void testPackageFragmentRootRemoveAndAdd() throws CoreException {
- try {
- createJavaProject("P", new String[] { "src" });
-
- startDeltas();
- deleteFolder("/P/src");
- assertDeltas("Unexpected delta after deleting /P/src",
- "P[*]: {CHILDREN}\n" + " src[-]: {}");
-
- clearDeltas();
- createFolder("/P/src");
- assertDeltas("Unexpected delta after creating /P/src",
- "P[*]: {CHILDREN}\n" + " src[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Remove then add a binary project (in a workspace runnable). (regression
- * test for 24775 Wrong delta when replacing binary project with source
- * project)
- */
- public void testRemoveAddBinaryProject() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P",
- new String[] { "" });
- createFile("P/lib.jar", "");
- project.setRawIncludepath(new IIncludePathEntry[] { JavaScriptCore
- .newLibraryEntry(new Path("/P/lib.jar"), null, null) },
- null);
-
- startDeltas();
- getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- deleteProject("P");
- createJavaProject("P", new String[] { "" });
- }
- }, null);
- assertDeltas("Unexpected delta",
- "P[*]: {CHILDREN | CLASSPATH CHANGED}\n"
- + " <project root>[*]: {ADDED TO CLASSPATH}\n"
- + " lib.jar[-]: {}\n"
- + " ResourceDelta(/P/.classpath)[*]\n"
- + " ResourceDelta(/P/.project)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Remove then add a java project (in a workspace runnable).
- */
- public void testRemoveAddJavaProject() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- startDeltas();
- getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- deleteProject("P");
- createJavaProject("P", new String[] { "" });
- }
- }, null);
- assertDeltas("Unexpected delta",
- "P[*]: {CONTENT | CLASSPATH CHANGED}\n"
- + " ResourceDelta(/P/.classpath)[*]\n"
- + " ResourceDelta(/P/.project)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Change the .classpath file so as to remove a classpath entry and remove
- * the corresponding resource. (regression test for bug 24517 type view does
- * not notice when jar disappears)
- */
- public void testRemoveCPEntryAndRoot1() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P",
- new String[] { "src" });
-
- // ensure that the project is open (there are clients of the delta
- // only if the project is open)
- project.open(null);
-
- startDeltas();
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- editFile(
- "/P/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<classpath>\n"
- + " <classpathentry kind=\"output\" path=\"bin\"/>\n"
- + "</classpath>");
- deleteFolder("/P/src");
- }
- }, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " src[-]: {}\n" + " ResourceDelta(/P/.classpath)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Remove a classpath entry and remove the corresponding resource.
- * (regression test for bug 24517 type view does not notice when jar
- * disappears)
- */
- public void testRemoveCPEntryAndRoot2() throws CoreException {
- try {
- final IJavaScriptProject project = createJavaProject("P",
- new String[] { "src" });
-
- // ensure that the project is open (there are clients of the delta
- // only if the project is open)
- project.open(null);
-
- startDeltas();
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- project.setRawIncludepath(new IIncludePathEntry[] {}, null);
- deleteFolder("/P/src");
- }
- }, null);
- assertDeltas("Unexpected delta",
- "P[*]: {CHILDREN | CLASSPATH CHANGED}\n" + " src[-]: {}\n"
- + " ResourceDelta(/P/.classpath)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Remove the resource of a classpath entry and remove the classpath entry.
- * (regression test for bug 24517 type view does not notice when jar
- * disappears)
- */
- public void testRemoveCPEntryAndRoot3() throws CoreException {
- try {
- final IJavaScriptProject project = createJavaProject("P",
- new String[] { "src" });
-
- // ensure that the project is open (there are clients of the delta
- // only if the project is open)
- project.open(null);
-
- startDeltas();
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- deleteFolder("/P/src");
- project.setRawIncludepath(new IIncludePathEntry[] {}, null);
- }
- }, null);
- assertDeltas("Unexpected delta",
- "P[*]: {CHILDREN | CLASSPATH CHANGED}\n" + " src[-]: {}\n"
- + " ResourceDelta(/P/.classpath)[*]");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /*
- * Remove the java nature of an existing java project.
- */
- public void testRemoveJavaNature() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- startDeltas();
- removeJavaNature("P");
- assertDeltas("Unexpected delta", "P[-]: {}\n" + "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- public void testRemoveJavaProject() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- startDeltas();
- deleteProject("P");
- assertDeltas("Unexpected delta", "P[-]: {}");
- } finally {
- stopDeltas();
- }
- }
-
- /*
- * Remove a non-java project.
- */
- public void testRemoveNonJavaProject() throws CoreException {
- try {
- createProject("P");
- startDeltas();
- deleteProject("P");
- assertDeltas("Should get a non-Java resource delta",
- "ResourceDelta(/P)");
- } finally {
- stopDeltas();
- }
- }
-
- /*
- * Removing a non-java project that contains a jar referenced in another
- * project should produce a delta on this other project. (regression test
- * for bug 19058 Closing non-java project doesn't remove root from java
- * project)
- */
- public void testRemoveNonJavaProjectUpdateDependent1() throws CoreException {
- try {
- createProject("SP");
- createFile("/SP/x.jar", "");
- createJavaProject("JP", new String[] { "" },
- new String[] { "/SP/x.jar" });
- startDeltas();
- deleteProject("SP");
- assertDeltas("Unexpected delta", "JP[*]: {CHILDREN}\n"
- + " /SP/x.jar[-]: {}\n" + "ResourceDelta(/SP)");
- } finally {
- stopDeltas();
- deleteProject("SP");
- deleteProject("JP");
- }
- }
-
- /*
- * Removing a non-java project and another project reference a non exiting
- * folder in the deleted project should not produce a delta on this other
- * project (and no null pointer exception) (regression test for bug 19131
- * NPE when removing a project containing missing classfile folder)
- */
- public void testRemoveNonJavaProjectUpdateDependent2() throws CoreException {
- try {
- createProject("SP");
- createJavaProject("JP", new String[] { "" },
- new String[] { "/SP/missing" });
- startDeltas();
- deleteProject("SP");
- assertDeltas("Unexpected delta", "ResourceDelta(/SP)");
- } finally {
- stopDeltas();
- deleteProject("SP");
- deleteProject("JP");
- }
- }
-
- /*
- * Removing a non-java project that contains a jar referenced in another
- * project should produce a delta on this other project. Case of the removal
- * being done right after start-up. (regression test for bug 31377
- * NullPointerException on binary import)
- */
- public void testRemoveNonJavaProjectUpdateDependent3() throws CoreException {
- try {
- createProject("SP");
- createFile("/SP/x.jar", "");
- createJavaProject("JP", new String[] { "" },
- new String[] { "/SP/x.jar" });
-
- // simulate start-up state of DeltaProcessor
- DeltaProcessingState deltaState = JavaModelManager
- .getJavaModelManager().deltaState;
- deltaState.oldRoots = null;
- deltaState.roots = null;
- deltaState.rootsAreStale = true;
-
- startDeltas();
- JavaScriptCore.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- deleteProject("SP");
- }
- }, null);
- assertDeltas("Unexpected delta", "JP[*]: {CHILDREN}\n"
- + " /SP/x.jar[-]: {}\n" + "ResourceDelta(/SP)");
- } finally {
- stopDeltas();
- deleteProject("SP");
- deleteProject("JP");
- }
- }
-
- /*
- * Rename a java project. (regression test for bug 7030
- * IllegalArgumentException renaming project)
- */
- public void testRenameJavaProject() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- startDeltas();
- renameProject("P", "P1");
- assertDeltas("Unexpected delta", "P[-]: {MOVED_TO(P1)}\n"
- + "P1[+]: {MOVED_FROM(P)}");
- } finally {
- stopDeltas();
- deleteProject("P");
- deleteProject("P1");
- }
- }
-
- public void testRenameMethodAndSave() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFolder("P/x/y");
- createFile("P/x/y/A.js", "package x.y;\n" + "public class A {\n"
- + " public void foo1() {\n" + " }\n" + "}");
- IJavaScriptUnit cu = getCompilationUnit("P/x/y/A.js");
- workingCopy = cu.getWorkingCopy(null);
- workingCopy.getBuffer().setContents(
- "package x.y;\n" + "public class A {\n"
- + " public void foo2() {\n" + " }\n" + "}");
-
- startDeltas();
- workingCopy.commitWorkingCopy(true, null);
- assertDeltas(
- "Unexpected delta",
- "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " x.y[*]: {CHILDREN}\n"
- + " A.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n"
- + " A[*]: {CHILDREN | FINE GRAINED}\n"
- + " foo1()[-]: {}\n" + " foo2()[+]: {}");
- } finally {
- stopDeltas();
- if (workingCopy != null) {
- workingCopy.discardWorkingCopy();
- }
- deleteProject("P");
- }
- }
-
- /*
- * Rename a non-java project. (regression test for bug 30224 No JavaElement
- * delta when renaming non-Java project)
- */
- public void testRenameNonJavaProject() throws CoreException {
- try {
- createProject("P");
- startDeltas();
- renameProject("P", "P1");
- assertDeltas("Unexpected delta", "ResourceDelta(/P)\n"
- + "ResourceDelta(/P1)");
- } finally {
- stopDeltas();
- deleteProject("P");
- deleteProject("P1");
- }
- }
-
- /*
- * Rename an outer pkg fragment. (regression test for bug 24685 Inner
- * package fragments gets deleted - model out of synch)
- */
- public void testRenameOuterPkgFragment() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- createFolder("P/x/y");
- createFile("P/x/y/X.js", "package x.y;\n" + "public class X {\n"
- + "}");
- startDeltas();
- IPackageFragment pkg = getPackageFragment("P", "", "x");
- pkg.rename("z", false, null);
- assertDeltas("Unexpected delta", "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n" + " z[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-
- /**
- * Ensures that saving a working copy doesn't change the underlying
- * resource. (only commit should do so)
- */
- public void testSaveWorkingCopy() throws CoreException {
- IJavaScriptUnit copy = null;
- try {
- createJavaProject("P", new String[] { "" });
- createFile("P/X.js", "public class X {\n" + "}");
- IJavaScriptUnit unit = getCompilationUnit("P", "", "", "X.js");
- copy = unit.getWorkingCopy(null);
- copy.getType("X").createMethod("void foo() {}", null, true, null);
- startDeltas();
- copy.save(null, true);
- assertDeltas("Unexpected delta after saving working copy", "");
- copy.commitWorkingCopy(true, null);
- assertDeltas(
- "Unexpected delta after committing working copy",
- "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " <default>[*]: {CHILDREN}\n"
- + " X.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n"
- + " X[*]: {CHILDREN | FINE GRAINED}\n"
- + " foo()[+]: {}");
- } finally {
- stopDeltas();
- if (copy != null)
- copy.discardWorkingCopy();
- deleteProject("P");
- }
- }
-
- /**
- * Ensure that a classpath change is detected even on a project which got
- * closed
- */
- public void testSetClasspathOnFreshProject() throws CoreException {
- try {
- createProject("LibProj");
- createFile("LibProj/mylib.jar", "");
- JavaProject p1 = (JavaProject) createJavaProject("P1",
- new String[] { "" });
- createFolder("P1/src2");
-
- p1.getProject().close(null);
- p1.getProject().open(null);
-
- startDeltas();
-
- IIncludePathEntry[] classpath = new IIncludePathEntry[] {
- JavaScriptCore.newSourceEntry(new Path("/P1/src2")),
- JavaScriptCore.newLibraryEntry(new Path(
- "/LibProj/mylib.jar"), null, null) };
- p1.setRawIncludepath(classpath, null);
- assertDeltas(
- "Should notice src2 and myLib additions to the classpath",
- "P1[*]: {CHILDREN | CLASSPATH CHANGED}\n"
- + " <project root>[*]: {REMOVED FROM CLASSPATH}\n"
- + " /LibProj/mylib.jar[*]: {ADDED TO CLASSPATH}\n"
- + " src2[*]: {ADDED TO CLASSPATH}\n"
- + " ResourceDelta(/P1/.classpath)[*]");
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("LibProj");
- }
- }
-
- /**
- * Ensures that setting a classpath variable when there is exactly one
- * project triggers a java element delta.
- */
- public void testSetClasspathVariable1() throws CoreException {
- try {
- createProject("LibProj");
- createFile("LibProj/mylib.jar", "");
- createFile("LibProj/otherlib.jar", "");
- JavaScriptCore.setIncludepathVariables(new String[] { "LIB" },
- new IPath[] { new Path("/LibProj/mylib.jar") }, null);
- createJavaProject("P", new String[] { "" }, new String[] { "LIB" });
- startDeltas();
- JavaScriptCore.setIncludepathVariables(new String[] { "LIB" },
- new IPath[] { new Path("/LibProj/otherlib.jar") }, null);
- assertDeltas(
- "Unexpected delta after setting classpath variable",
- "P[*]: {CHILDREN}\n"
- + " /LibProj/mylib.jar[*]: {REMOVED FROM CLASSPATH}\n"
- + " /LibProj/otherlib.jar[*]: {ADDED TO CLASSPATH}");
- } finally {
- stopDeltas();
- deleteProject("P");
- deleteProject("LibProj");
- }
- }
-
- /**
- * Ensures that setting a classpath variable when there are more than one
- * project triggers a java element delta.
- */
- public void testSetClasspathVariable2() throws CoreException {
- try {
- createProject("LibProj");
- createFile("LibProj/mylib.jar", "");
- createFile("LibProj/otherlib.jar", "");
- JavaScriptCore.setIncludepathVariables(new String[] { "LIB" },
- new IPath[] { new Path("/LibProj/mylib.jar") }, null);
- createJavaProject("P1", new String[] { "" },
- new String[] { "LIB" });
- createJavaProject("P2", new String[] { "" },
- new String[] { "LIB" });
- startDeltas();
- JavaScriptCore.setIncludepathVariables(new String[] { "LIB" },
- new IPath[] { new Path("/LibProj/otherlib.jar") }, null);
- assertEquals(
- "Unexpected delta after setting classpath variable",
- "P1[*]: {CHILDREN}\n"
- + " /LibProj/mylib.jar[*]: {REMOVED FROM CLASSPATH}\n"
- + " /LibProj/otherlib.jar[*]: {ADDED TO CLASSPATH}\n"
- + "P2[*]: {CHILDREN}\n"
- + " /LibProj/mylib.jar[*]: {REMOVED FROM CLASSPATH}\n"
- + " /LibProj/otherlib.jar[*]: {ADDED TO CLASSPATH}",
- getSortedByProjectDeltas());
- } finally {
- stopDeltas();
- deleteProject("P1");
- deleteProject("P2");
- deleteProject("LibProj");
- }
- }
-
- /**
- * Ensures that committing a working copy fires a fine grained delta.
- */
- public void testWorkingCopyCommit() throws CoreException {
- try {
- createJavaProject("P", new String[] { "" });
- createFolder("P/x/y");
- createFile("P/x/y/A.js", "package x.y;\n" + "public class A {\n"
- + "}");
- IJavaScriptUnit cu = getCompilationUnit("P/x/y/A.js");
- IJavaScriptUnit copy = cu.getWorkingCopy(null);
- copy.getBuffer().setContents(
- "package x.y;\n" + "public class A {\n"
- + " public void foo() {\n" + " }\n" + "}");
- copy.save(null, false);
- startDeltas();
- copy.commitWorkingCopy(true, null);
- assertDeltas(
- "Unexpected delta after commit",
- "P[*]: {CHILDREN}\n"
- + " <project root>[*]: {CHILDREN}\n"
- + " x.y[*]: {CHILDREN}\n"
- + " A.js[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n"
- + " A[*]: {CHILDREN | FINE GRAINED}\n"
- + " foo()[+]: {}");
- } finally {
- stopDeltas();
- deleteProject("P");
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaModelTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaModelTests.java
deleted file mode 100644
index bb4cf93..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaModelTests.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.Test;
-/**
- * Tests IJavaScriptModel API.
- */
-public class JavaModelTests extends ModifyingResourceTests {
-
-public static Test suite() {
- return buildModelTestSuite(JavaModelTests.class);
-}
-
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_PREFIX = "testBug100772_ProjectScope";
-// TESTS_NAMES = new String[] { "testFindLineSeparator04" };
-// TESTS_NUMBERS = new int[] { 100772 };
-// TESTS_RANGE = new int[] { 83304, -1 };
-}
-
-public JavaModelTests(String name) {
- super(name);
-}
-protected int indexOf(String projectName, IJavaScriptProject[] projects) {
- for (int i = 0, length = projects.length; i < length; i++) {
- if (projects[i].getElementName().equals(projectName)) {
- return i;
- }
- }
- return -1;
-}
-/*
- * Ensure that a java project is not added to the list of known java project
- * when a file is added to a non-java project.
- * (regression test for bug 18698 Seeing non-java projects in package view)
- */
-public void testAddFileToNonJavaProject() throws CoreException {
- IJavaScriptModel model = this.getJavaModel();
- IJavaScriptProject[] projects = model.getJavaScriptProjects();
- assertTrue(
- "Project P should not be present already",
- this.indexOf("P", projects) == -1
- );
- try {
- this.createProject("P");
- this.createFile("/P/toto.txt", "");
- projects = model.getJavaScriptProjects();
- assertTrue(
- "Project P should not be present",
- this.indexOf("P", projects) == -1
- );
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensiure that no markers are created for a non-Java project
- * (regression test for bug 131937 JDT core adding problem markers to non-java projects)
- */
-public void testCreateNonJavaProject() throws CoreException {
- try {
- IProject project = createProject("NonJava");
- waitForAutoBuild();
- IMarker[] markers = project.findMarkers(null/*all type of markers*/, true, IResource.DEPTH_INFINITE);
- assertMarkers("Unexpected markers", "", markers);
- } finally {
- deleteProject("NonJava");
- }
-}
-/*
- * Ensure that a resource belonging to the Java model is known to be contained in the Java model.
- * Case of non-accessible resources
- */
-public void testContains1() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
-
- // .java file
- IFile file = this.getFile("/P/X.js");
- assertTrue("/P/X.java should be in model", getJavaModel().contains(file));
-
- // .class file
-// file = this.getFile("/P/X.class");
-// assertTrue("/P/X.class should not be in model", !getJavaModel().contains(file));
-
- // non-Java resource
- file = this.getFile("/P/read.txt");
- assertTrue("/P/read.txt should be in model", getJavaModel().contains(file));
-
- // package
- IFolder folder = this.getFolder("/P/p");
- assertTrue("/P/p should be in model", getJavaModel().contains(folder));
-
- // resource in closed project
- file = this.createFile("/P/X.js", "");
- project.getProject().close(null);
- assertTrue("/P/X.java should be in model (even if project is closed)", getJavaModel().contains(file));
-
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a resource belonging to the Java model is known to be contained in the Java model.
- * Case of projects
- */
-public void testContains2() throws CoreException {
- try {
- // Java project
- IProject project = this.createJavaProject("P1", new String[] {""}).getProject();
- assertTrue("/P1 should be in model", getJavaModel().contains(project));
-
- // non-Java project
- project = this.createProject("P2");
- assertTrue("/P2 should be in model", getJavaModel().contains(project));
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
-}
-/*
- * Ensure that a resource belonging to the Java model is known to be contained in the Java model.
- * Case of prj=src=bin
- */
-public void testContains3() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {""});
-
- // .java file
- IFile file = this.createFile("/P/X.js", "");
- assertTrue("/P/X.java should be in model", getJavaModel().contains(file));
-
- // .class file
- file = this.createFile("/P/X.class", "");
- assertTrue("/P/X.class should not be in model", !getJavaModel().contains(file));
-
- // non-Java resource
- file = this.createFile("/P/read.txt", "");
- assertTrue("/P/read.txt should be in model", getJavaModel().contains(file));
-
- // package
- IFolder folder = this.createFolder("/P/p");
- assertTrue("/P/p should be in model", getJavaModel().contains(folder));
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a resource belonging to the Java model is known to be contained in the Java model.
- * Case of empty classpath.
- */
-public void testContains4() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {});
-
- // .java file
- IFile file = this.createFile("/P/X.js", "");
- assertTrue("/P/X.java should be in model", getJavaModel().contains(file));
-
- // .class file
- file = this.createFile("/P/X.class", "");
- assertTrue("/P/X.class should be in model", getJavaModel().contains(file));
-
- // non-Java resource file
- file = this.createFile("/P/read.txt", "");
- assertTrue("/P/read.txt should be in model", getJavaModel().contains(file));
-
- // non-Java resource folder
- IFolder folder = this.createFolder("/P/p");
- assertTrue("/P/p should be in model", getJavaModel().contains(folder));
-
- // bin folder
- folder = this.getFolder("/P/bin");
- assertTrue("/P/bin should not be in model", !getJavaModel().contains(folder));
-
- // classfile in bin folder
- file = this.createFile("/P/bin/X.class", "");
- assertTrue("/P/bin/X.class should not be in model", !getJavaModel().contains(file));
-
- // resource file in bin folder
- this.createFolder("/P/bin/image");
- file = this.createFile("/P/bin/image/ok.gif", "");
- assertTrue("/P/bin/image/ok.gif should not be in model", !getJavaModel().contains(file));
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a resource belonging to the Java model is known to be contained in the Java model.
- * Case of src != bin
- */
-public void testContains5() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src"});
-
- // .java file
- IFile file = this.createFile("/P/src/X.js", "");
- assertTrue("/P/src/X.java should be in model", getJavaModel().contains(file));
-
- // resource file in src
- this.createFolder("/P/src/image");
- file = this.createFile("/P/src/image/ok.gif", "");
- assertTrue("/P/src/image/ok.gif should not be in model", getJavaModel().contains(file));
-
- // .class file in bin
- file = this.createFile("/P/bin/X.class", "");
- assertTrue("/P/bin/X.class should not be in model", !getJavaModel().contains(file));
-
- // resource file in bin
- this.createFolder("/P/bin/image");
- file = this.createFile("/P/bin/image/ok.gif", "");
- assertTrue("/P/bin/image/ok.gif should not be in model", !getJavaModel().contains(file));
-
- // .class file in src
- file = this.createFile("/P/src/X.class", "");
- assertTrue("/P/src/X.class should not be in model", !getJavaModel().contains(file));
-
- // non-Java resource
- file = this.createFile("/P/src/read.txt", "");
- assertTrue("/P/src/read.txt should be in model", getJavaModel().contains(file));
-
- // package
- IFolder folder = this.createFolder("/P/src/p");
- assertTrue("/P/src/p should be in model", getJavaModel().contains(folder));
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a resource belonging to the Java model is known to be contained in the Java model.
- * Case of prj==src and separate bin
- */
-public void testContains6() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {""});
-
- // .java file
- IFile file = this.createFile("/P/X.js", "");
- assertTrue("/P/X.java should be in model", getJavaModel().contains(file));
-
- // resource file in src
- this.createFolder("/P/image");
- file = this.createFile("/P/image/ok.gif", "");
- assertTrue("/P/image/ok.gif should not be in model", getJavaModel().contains(file));
-
- // .class file in bin
- file = this.createFile("/P/bin/X.class", "");
- assertTrue("/P/bin/X.class should not be in model", !getJavaModel().contains(file));
-
- // resource file in bin
- this.createFolder("/P/bin/image");
- file = this.createFile("/P/bin/image/ok.gif", "");
- assertTrue("/P/bin/image/ok.gif should not be in model", !getJavaModel().contains(file));
-
- // .class file in src
- file = this.createFile("/P/X.class", "");
- assertTrue("/P/X.class should not be in model", !getJavaModel().contains(file));
-
- // non-Java resource
- file = this.createFile("/P/read.txt", "");
- assertTrue("/P/read.txt should be in model", getJavaModel().contains(file));
-
- // package
- IFolder folder = this.createFolder("/P/p");
- assertTrue("/P/p should be in model", getJavaModel().contains(folder));
- } finally {
- this.deleteProject("P");
- }
-}
-
-/*
- * Ensure that using JavaScriptCore.create(IResource) for a package that is defined in a different project
- * returns a non-null value
- * (regression test for bug 97487 [call hierarchy] Call Hierarchy Fails in mounted classes with attached src files)
- */
-public void testCreatePkgHandleInDifferentProject() throws CoreException {
- try {
- createJavaProject("P1", new String[] {});
- IFolder folder = createFolder("/P1/lib/x/y");
- createJavaProject("P2", new String[] {}, new String[] {"/P1/lib"});
- IJavaScriptElement element = JavaScriptCore.create(folder);
- assertElementEquals(
- "Unexpected element",
- "x.y [in /P1/lib [in P2]]",
- element
- );
- } finally {
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-
-/*
- * Ensures that the right line separator is found for a compilation unit.
- */
-public void testFindLineSeparator01() throws CoreException {
- try {
- createJavaProject("P");
- createFile(
- "/P/X.js",
- "public class X {\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertEquals("\n", cu.findRecommendedLineSeparator());
- } finally {
- deleteProject("P");
- }
-}
-
-/*
- * Ensures that the right line separator is found for a compilation unit.
- */
-public void testFindLineSeparator02() throws CoreException {
- try {
- createJavaProject("P");
- createFile(
- "/P/X.js",
- "public class X {\r\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertEquals("\r\n", cu.findRecommendedLineSeparator());
- } finally {
- deleteProject("P");
- }
-}
-
-/*
- * Ensures that the right line separator is found for an empty compilation unit.
- */
-public void testFindLineSeparator03() throws CoreException {
- try {
- createJavaProject("P");
- createFile(
- "/P/X.js",
- ""
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertEquals(System.getProperty("line.separator"), cu.findRecommendedLineSeparator());
- } finally {
- deleteProject("P");
- }
-}
-
-/*
- * Ensures that the right line separator is found for a package fragment
- */
-public void testFindLineSeparator04() throws CoreException {
- try {
- createJavaProject("P");
- createFolder("/P/p");
- IPackageFragment pkg = getPackage("/P/p");
- assertEquals(System.getProperty("line.separator"), pkg.findRecommendedLineSeparator());
- } finally {
- deleteProject("P");
- }
-}
-
-/**
- * Test that a model has no project.
- */
-public void testGetJavaProject() {
- IJavaScriptModel model= getJavaModel();
- assertTrue("project should be null", model.getJavaScriptProject() == null);
-}
-/*
- * Ensure that a java project that is added appears in the list of known java project,
- * and that it is removed from this list when deleted.
- */
-public void testGetJavaProjects1() throws CoreException {
- IJavaScriptModel model = this.getJavaModel();
- IJavaScriptProject[] projects = model.getJavaScriptProjects();
- assertTrue(
- "Project P should not be present already",
- this.indexOf("P", projects) == -1
- );
- try {
- this.createJavaProject("P", new String[] {});
- projects = model.getJavaScriptProjects();
- assertTrue(
- "Project P should be present",
- this.indexOf("P", projects) != -1
- );
- this.deleteProject("P");
- projects = model.getJavaScriptProjects();
- assertTrue(
- "Project P should not be present any longer",
- this.indexOf("P", projects) == -1
- );
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensure that a non-java project that is added does not appears in the list of known java project.
- */
-public void testGetJavaProjects2() throws CoreException {
- IJavaScriptModel model = this.getJavaModel();
- IJavaScriptProject[] projects = model.getJavaScriptProjects();
- assertTrue(
- "Project P should not be present already",
- this.indexOf("P", projects) == -1
- );
- try {
- this.createProject("P");
- projects = model.getJavaScriptProjects();
- assertTrue(
- "Project P should not be present",
- this.indexOf("P", projects) == -1
- );
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Test retrieving non-Java projects.
- */
-public void testGetNonJavaResources() throws CoreException {
- try {
- IJavaScriptModel model = this.getJavaModel();
-
- this.createJavaProject("JP", new String[]{});
- assertResourceNamesEqual(
- "Unexpected non-Java resources",
- "",
- model.getNonJavaScriptResources());
-
- this.createProject("SP1");
- assertResourceNamesEqual(
- "Unexpected non-Java resources after creation of SP1",
- "SP1",
- model.getNonJavaScriptResources());
-
- this.createProject("SP2");
- assertResourceNamesEqual(
- "Unexpected non-Java resources after creation of SP2",
- "SP1\n" +
- "SP2",
- model.getNonJavaScriptResources());
-
- this.deleteProject("SP1");
- assertResourceNamesEqual(
- "Unexpected non-Java resources after deletion of SP1",
- "SP2",
- model.getNonJavaScriptResources());
- } finally {
- this.deleteProject("SP1");
- this.deleteProject("SP2");
- this.deleteProject("JP");
- }
-}
-/*
- * Ensures that the right scheduling rule is returned for a Java project
- */
-public void testGetSchedulingRule1() {
- IJavaScriptProject project = getJavaProject("P");
- assertEquals(
- "Unexpected scheduling rule",
- project.getResource(),
- project.getSchedulingRule());
-}
-/*
- * Ensures that the right scheduling rule is returned for a source package fragment root
- */
-public void testGetSchedulingRule2() {
- IResource folder = getFolder("/P/src");
- IPackageFragmentRoot root = getJavaProject("P").getPackageFragmentRoot(folder);
- assertEquals(
- "Unexpected scheduling rule",
- root.getResource(),
- root.getSchedulingRule());
-}
-/*
- * Ensures that the right scheduling rule is returned for an external jar package fragment root
- */
-public void testGetSchedulingRule3() {
- IPackageFragmentRoot root1 = getJavaProject("P1").getPackageFragmentRoot("c:\\some.jar");
- ISchedulingRule rule1 = root1.getSchedulingRule();
- IPackageFragmentRoot root2 = getJavaProject("P2").getPackageFragmentRoot("c:\\some.jar");
- ISchedulingRule rule2 = root2.getSchedulingRule();
- assertTrue("Rule 1 should contain rule 2", rule1.contains(rule2));
- assertTrue("Rule 1 should conflict with rule 2", rule1.isConflicting(rule2));
- assertTrue("Rule 2 should contain rule 1", rule2.contains(rule1));
- assertTrue("Rule 2 should conflict with rule 1", rule2.isConflicting(rule1));
-}
-/*
- * Ensures that the right scheduling rule is returned for a source package fragment
- */
-public void testGetSchedulingRule4() {
- IResource folder = getFolder("/P/src");
- IPackageFragment pkg = getJavaProject("P").getPackageFragmentRoot(folder).getPackageFragment("p");
- assertEquals(
- "Unexpected scheduling rule",
- pkg.getResource(),
- pkg.getSchedulingRule());
-}
-/*
- * Ensures that JavaScriptCore#initializeAfterLoad() can be called on startup
- */
-public void testInitializeAfterLoad() throws CoreException {
- simulateExitRestart();
- JavaScriptCore.initializeAfterLoad(null);
-}
-
-
-/*
- * Ensures that a registered POST_BUILD pre-processing resource changed listener is correctly called.
- */
-public void testPreProcessingResourceChangedListener03() throws CoreException {
- final int[] eventType = new int[] {0};
- IResourceChangeListener listener = new IResourceChangeListener(){
- public void resourceChanged(IResourceChangeEvent event) {
- eventType[0] |= event.getType();
- }
- };
- try {
- JavaScriptCore.addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_BUILD);
- createProject("Test");
- waitForAutoBuild();
- assertEquals("Unexpected event type", IResourceChangeEvent.POST_BUILD, eventType[0]);
- } finally {
- JavaScriptCore.removePreProcessingResourceChangedListener(listener);
- deleteProject("Test");
- }
-}
-
-/*
- * Ensures that a registered POST_CHANGE | PRE_BUILD pre-processing resource changed listener is correctly called.
- */
-public void testPreProcessingResourceChangedListener04() throws CoreException {
- final int[] eventType = new int[] {0};
- IResourceChangeListener listener = new IResourceChangeListener(){
- public void resourceChanged(IResourceChangeEvent event) {
- eventType[0] |= event.getType();
- }
- };
- try {
- JavaScriptCore.addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.POST_BUILD);
- createProject("Test");
- waitForAutoBuild();
- assertEquals("Unexpected event type", IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.POST_BUILD, eventType[0]);
- } finally {
- JavaScriptCore.removePreProcessingResourceChangedListener(listener);
- deleteProject("Test");
- }
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaProjectTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaProjectTests.java
deleted file mode 100644
index 2641f13..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaProjectTests.java
+++ /dev/null
@@ -1,1133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.IOException;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.wst.jsdt.core.IAccessRule;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.UserLibrary;
-import org.eclipse.wst.jsdt.internal.core.UserLibraryManager;
-
-public class JavaProjectTests extends ModifyingResourceTests {
-public JavaProjectTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = (TestSuite) buildModelTestSuite(JavaProjectTests.class);
-
- // The following test must be at the end as it deletes a package and this would have side effects
- // on other tests
- if (suite.testCount() > 1) // if not running only 1 test
- suite.addTest(new JavaProjectTests("lastlyTestDeletePackageWithAutobuild"));
-
- return suite;
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
- setUpJavaProject("JavaProjectTests");
- setUpJavaProject("JavaProjectSrcTests");
- setUpJavaProject("JavaProjectLibTests");
-}
-public void tearDownSuite() throws Exception {
- deleteProject("JavaProjectTests");
- deleteProject("JavaProjectSrcTests");
- deleteProject("JavaProjectLibTests");
- super.tearDownSuite();
-}
-
-
-/**
- * Test adding a non-java resource in a package fragment root that correspond to
- * the project.
- * (Regression test for PR #1G58NB8)
- */
-public void testAddNonJavaResourcePackageFragmentRoot() throws JavaScriptModelException, CoreException {
- // get resources of source package fragment root at project level
- IPackageFragmentRoot root = getPackageFragmentRoot("JavaProjectTests", "");
- Object[] resources = root.getNonJavaScriptResources();
- assertResourceNamesEqual(
- "unexpected non Java resources",
- ".project\n" +
- ".settings\n" +
- "lib142530.jar\n" +
- "lib148949.jar",
- resources);
- IFile resource = (IFile)resources[0];
- IPath newPath = root.getUnderlyingResource().getFullPath().append("TestNonJavaResource.abc");
- try {
- // copy and rename resource
- resource.copy(
- newPath,
- true,
- null);
-
- // ensure the new resource is present
- resources = root.getNonJavaScriptResources();
- assertResourcesEqual(
- "incorrect non java resources",
- "/JavaProjectTests/.project\n" +
- "/JavaProjectTests/.settings\n" +
- "/JavaProjectTests/TestNonJavaResource.abc\n" +
- "/JavaProjectTests/lib142530.jar\n" +
- "/JavaProjectTests/lib148949.jar",
- resources);
- } finally {
- // clean up
- deleteResource(resource.getWorkspace().getRoot().getFile(newPath));
- }
-}
-/*
- * Ensures that adding a project prerequisite in the classpath updates the referenced projects
- */
-public void testAddProjectPrerequisite() throws CoreException {
- try {
- createJavaProject("P1");
- createJavaProject("P2");
- waitForAutoBuild();
- editFile(
- "/P2/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"/P1\"/>\n" +
- "</classpath>"
- );
- getProject("P2").build(IncrementalProjectBuilder.FULL_BUILD, null);
- IProject[] referencedProjects = getProject("P2").getReferencedProjects();
- assertResourcesEqual(
- "Unexpected project references",
- "/P1",
- referencedProjects);
- } finally {
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/**
- * Test that a compilation unit
- * has a corresponding resource.
- */
-public void testCompilationUnitCorrespondingResource() throws JavaScriptModelException {
- IJavaScriptUnit element= getCompilationUnit("JavaProjectTests", "", "q", "A.js");
- IResource corr= element.getCorrespondingResource();
- IResource res= getWorkspace().getRoot().getProject("JavaProjectTests").getFolder("q").getFile("A.js");
- assertTrue("incorrect corresponding resource", corr.equals(res));
- assertEquals("Project is incorrect for the compilation unit", "JavaProjectTests", corr.getProject().getName());
-}
-/**
- * Tests the fix for "1FWNMKD: ITPJCORE:ALL - Package Fragment Removal not reported correctly"
- */
-public void lastlyTestDeletePackageWithAutobuild() throws CoreException {
- // close all project except JavaProjectTests so as to avoid side effects while autobuilding
- IProject[] projects = getWorkspaceRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- IProject project = projects[i];
- if (project.getName().equals("JavaProjectTests")) continue;
- project.close(null);
- }
-
- // turn autobuilding on
- IWorkspace workspace = getWorkspace();
- boolean autoBuild = workspace.isAutoBuilding();
- IWorkspaceDescription description = workspace.getDescription();
- description.setAutoBuilding(true);
- workspace.setDescription(description);
-
- startDeltas();
- IPackageFragment frag = getPackageFragment("JavaProjectTests", "", "x.y");
- IFolder folder = (IFolder) frag.getUnderlyingResource();
- try {
- deleteResource(folder);
- assertDeltas(
- "Unexpected delta",
- "JavaProjectTests[*]: {CHILDREN}\n" +
- " <project root>[*]: {CHILDREN}\n" +
- " x.y[-]: {}"
- );
- } finally {
- stopDeltas();
-
- // turn autobuild off
- description.setAutoBuilding(autoBuild);
- workspace.setDescription(description);
-
- // reopen projects
- projects = getWorkspaceRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- IProject project = projects[i];
- if (project.getName().equals("JavaProjectTests")) continue;
- project.open(null);
- }
- }
-}
-/**
- * Test that an (external) jar
- * has no corresponding resource.
- */
-public void testExternalArchiveCorrespondingResource() throws JavaScriptModelException {
- IJavaScriptProject project= getJavaProject("JavaProjectTests");
- IPackageFragmentRoot element= project.getPackageFragmentRoot(getSystemJsPathString());
- IResource corr= element.getCorrespondingResource();
- assertTrue("incorrect corresponding resource", corr == null);
-}
-/*
- * Ensures that a file with an extra Java-like extension is listed in the children of a package.
- */
-public void testExtraJavaLikeExtension1() throws CoreException {
- try {
- createJavaProject("P");
- createFolder("/P/pack");
- createFile("/P/pack/X.js", "function X() {}");
- createFile("/P/pack/Y.bar", "function Y() {}");
- IPackageFragment pkg = getPackage("/P/pack");
- assertSortedElementsEqual(
- "Unexpected children of package pack",
- "X.js [in pack [in <project root> [in P]]]",
- pkg.getChildren());
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a file with an extra Java-like extension is not listed in the non-Java resources of a package.
- */
-public void testExtraJavaLikeExtension2() throws CoreException {
- try {
- createJavaProject("P");
- createFolder("/P/pack");
- createFile("/P/pack/X.txt", "");
- createFile("/P/pack/Y.bar", "function Y() {}");
- IPackageFragment pkg = getPackage("/P/pack");
- assertResourceNamesEqual(
- "Unexpected non-Java resources of package pack",
- "X.txt\n" +
- "Y.bar",
- pkg.getNonJavaScriptResources());
- } finally {
- deleteProject("P");
- }
-}
-/**
- * Test that a compilation unit can be found
- */
-public void testFindElementCompilationUnit() throws JavaScriptModelException {
- IJavaScriptProject project= getJavaProject("JavaProjectTests");
- IJavaScriptElement element= project.findElement(new Path("x/y/Main.js"));
- assertTrue("CU not found" , element != null && element.getElementType() == IJavaScriptElement.JAVASCRIPT_UNIT
- && element.getElementName().equals("Main.js"));
-}
-/**
- * Test that a compilation unit can be found in a default package
- */
-public void testFindElementCompilationUnitDefaultPackage() throws JavaScriptModelException {
- IJavaScriptProject project= getJavaProject("JavaProjectTests");
- IJavaScriptElement element= project.findElement(new Path("B.js"));
- assertTrue("CU not found" , element != null && element.getElementType() == IJavaScriptElement.JAVASCRIPT_UNIT
- && element.getElementName().equals("B.js"));
-}
-/**
- * Test that an invlaid path throws an exception
- */
-public void testFindElementInvalidPath() throws JavaScriptModelException {
- IJavaScriptProject project= getJavaProject("JavaProjectTests");
- boolean failed= false;
- try {
- project.findElement(null);
- } catch (JavaScriptModelException e) {
- failed= true;
- assertTrue("wrong status code" , e.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_PATH);
- }
- assertTrue("Shold have failed", failed);
-
- failed = false;
- try {
- project.findElement(new Path("/something/absolute"));
- } catch (JavaScriptModelException e) {
- failed= true;
- assertTrue("wrong status code" , e.getStatus().getCode() == IJavaScriptModelStatusConstants.INVALID_PATH);
- }
- assertTrue("Shold have failed", failed);
-
- IJavaScriptElement element= project.findElement(new Path("does/not/exist/HelloWorld.js"));
- assertTrue("should get no element", element == null);
-}
-/**
- * Test that a package can be found
- */
-public void testFindElementPackage() throws JavaScriptModelException {
- IJavaScriptProject project= getJavaProject("JavaProjectTests");
- IJavaScriptElement element= project.findElement(new Path("x/y"));
- assertTrue("package not found" , element != null && element.getElementType() == IJavaScriptElement.PACKAGE_FRAGMENT
- && element.getElementName().equals("x.y"));
-}
-/**
- * Test that a class can be found even if the project prereq a simple project
- * (regression test for bug 28434 Open Type broken when workspace has build path problems)
- */
-public void testFindElementPrereqSimpleProject() throws CoreException {
- try {
- this.createProject("R");
- IJavaScriptProject project = this.createJavaProject("J", new String[] {"src"}, new String[] {}, new String[] {"/R"});
- this.createFile(
- "J/src/X.js",
- "public class X {\n" +
- "}"
- );
- assertTrue("X.java not found", project.findElement(new Path("X.js")) != null);
- } finally {
- this.deleteProject("R");
- this.deleteProject("J");
- }
-}
-/**
- * Test that a package fragment root can be found from a classpath entry.
- */
-public void testFindPackageFragmentRootFromClasspathEntry() {
- IJavaScriptProject project = getJavaProject("JavaProjectTests");
-
- // existing classpath entry
- IIncludePathEntry entry = JavaScriptCore.newLibraryEntry(new Path("/JavaProjectTests/lib.jar"), null, null);
- IPackageFragmentRoot[] roots = project.findPackageFragmentRoots(entry);
- assertEquals("Unexpected number of roots for existing entry", 1, roots.length);
- assertEquals("Unexpected root", "/JavaProjectTests/lib.jar", roots[0].getPath().toString());
-
- // non-existing classpath entry
- entry = JavaScriptCore.newSourceEntry(new Path("/JavaProjectTests/nonExisting"));
- roots = project.findPackageFragmentRoots(entry);
- assertEquals("Unexpected number of roots for non existing entry", 0, roots.length);
-
-}
-/**
- * Test that a folder with a dot name does not relate to a package fragment
- */
-public void testFolderWithDotName() throws JavaScriptModelException, CoreException {
- IPackageFragmentRoot root= getPackageFragmentRoot("JavaProjectTests", "");
- IContainer folder= (IContainer)root.getCorrespondingResource();
- try {
- startDeltas();
- folder.getFolder(new Path("org.eclipse")).create(false, true, null);
- assertTrue("should be one Java Delta", this.deltaListener.deltas.length == 1);
-
- stopDeltas();
- IJavaScriptElement[] children = root.getChildren();
- IPackageFragment bogus = root.getPackageFragment("org.eclipse");
- for (int i = 0; i < children.length; i++) {
- assertTrue("org.eclipse should not be present as child", !children[i].equals(bogus));
- }
- assertTrue("org.eclipse should not exist", !bogus.exists());
- } finally {
- deleteResource(folder.getFolder(new Path("org.eclipse")));
- }
-}
-/*
- * Ensures that getting the classpath on a closed project throws a JavaScriptModelException
- * (regression test for bug 25358 Creating a new Java class - Browse for parent)
- */
-public void testGetClasspathOnClosedProject() throws CoreException {
- IProject project = getProject("JavaProjectTests");
- try {
- project.close(null);
- boolean gotException = false;
- IJavaScriptProject javaProject = JavaScriptCore.create(project);
- try {
- javaProject.getRawIncludepath();
- } catch (JavaScriptModelException e) {
- if (e.isDoesNotExist()) {
- gotException = true;
- }
- }
- assertTrue("Should get a not present exception for getRawClasspath()", gotException);
- gotException = false;
- try {
- javaProject.getResolvedIncludepath(true);
- } catch (JavaScriptModelException e) {
- if (e.isDoesNotExist()) {
- gotException = true;
- }
- }
- assertTrue("Should get a not present exception for getResolvedClasspath(true)", gotException);
- } finally {
- project.open(null);
- }
-}
-/*
- * Ensures that the non-java resources for a project do not contain the project output location.
- */
-public void testGetNonJavaResources1() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"src"});
- assertResourcesEqual(
- "Unexpected non-java resources for project",
- "/P/.project\n" +
- "/P/.settings",
- project.getNonJavaScriptResources());
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensures that the non-java resources for a project do not contain a custom output location.
- * (regression test for 27494 Source folder output folder shown in Package explorer)
- */
-public void testGetNonJavaResources2() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {"src"}, "bin1", new String[] {"bin2"});
- assertResourcesEqual(
- "Unexpected non-java resources for project",
- "/P/.project\n" +
- "/P/.settings",
- project.getNonJavaScriptResources());
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensures that the non-java resources for a project do not contain a folder that should be a package fragment.
- */
-public void testGetNonJavaResources3() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P", new String[] {""});
- this.createFolder("/P/p1");
- assertResourcesEqual(
- "Unexpected non-java resources for project",
- "/P/.project\n" +
- "/P/.settings",
- project.getNonJavaScriptResources());
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensures that the non-java resources for a project contain a folder that have an invalid name for a package fragment.
- * (regression test for bug 31757 Folder with invalid pkg name should be non-Java resource)
- */
-public void testGetNonJavaResources4() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P");
- this.createFolder("/P/x.y");
- assertResourcesEqual(
- "Unexpected non-java resources for project",
- "/P/.project\n" +
- "/P/.settings\n" +
- "/P/x.y",
- project.getNonJavaScriptResources());
- } finally {
- this.deleteProject("P");
- }
-}
-/*
- * Ensures that getRequiredProjectNames() returns the project names in the classpath order
- * (regression test for bug 25605 [API] someJavaProject.getRequiredProjectNames(); API should specify that the array is returned in ClassPath order)
- */
-public void testGetRequiredProjectNames() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject(
- "P",
- new String[] {},
- new String[] {},
- new String[] {"/JavaProjectTests", "/P1", "/P0", "/P2", "/JavaProjectSrcTests"});
- String[] requiredProjectNames = project.getRequiredProjectNames();
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, length = requiredProjectNames.length; i < length; i++) {
- buffer.append(requiredProjectNames[i]);
- if (i != length-1) {
- buffer.append(", ");
- }
- }
- assertEquals(
- "Unexpected required project names",
- "JavaProjectTests, P1, P0, P2, JavaProjectSrcTests",
- buffer.toString());
- } finally {
- this.deleteProject("P");
- }
-}
-/**
- * Test that an (internal) jar
- * has a corresponding resource.
- */
-public void testInternalArchiveCorrespondingResource() throws JavaScriptModelException {
- IPackageFragmentRoot element= getPackageFragmentRoot("JavaProjectTests", "lib.jar");
- IResource corr= element.getCorrespondingResource();
- IResource res= getWorkspace().getRoot().getProject("JavaProjectTests").getFile("lib.jar");
- assertTrue("incorrect corresponding resource", corr.equals(res));
-}
-/**
- * Test IJavaPackageFragment.isDefaultPackage().
- */
-public void testIsDefaultPackage() throws JavaScriptModelException {
- IPackageFragment def = getPackageFragment("JavaProjectTests", "", "");
- assertTrue("should be default package", def.isDefaultPackage());
- IPackageFragment y =
- getPackageFragment("JavaProjectTests", "", "x.y");
- assertTrue("x.y should not be default pakackage", !y.isDefaultPackage());
-
- IPackageFragment def2 = getPackageFragment("JavaProjectTests", "lib.jar", "");
- assertTrue("lib.jar should have default package", def2.isDefaultPackage());
- IPackageFragment p =
- getPackageFragment("JavaProjectTests", "lib.jar", "p");
- assertTrue("p should not be default package", !p.isDefaultPackage());
-}
-/**
- * Test that a package fragment (non-external, non-jar, non-default)
- * has a corresponding resource.
- */
-public void testPackageFragmentCorrespondingResource() throws JavaScriptModelException {
- IPackageFragment element= getPackageFragment("JavaProjectTests", "", "x.y");
- IResource corr= element.getCorrespondingResource();
- IResource res= getWorkspace().getRoot().getProject("JavaProjectTests").getFolder("x").getFolder("y");
- assertTrue("incorrect corresponding resource", corr.equals(res));
-}
-/**
- * Test that a package fragment (non-external, non-jar, non-default)
- * has a corresponding resource.
- */
-public void testPackageFragmentHasSubpackages() throws JavaScriptModelException {
- IPackageFragment def= getPackageFragment("JavaProjectTests", "", "");
- IPackageFragment x= getPackageFragment("JavaProjectTests", "", "x");
- IPackageFragment y= getPackageFragment("JavaProjectTests", "", "x.y");
- assertTrue("default should have subpackages", def.hasSubpackages());
- assertTrue("x should have subpackages", x.hasSubpackages());
- assertTrue("x.y should NOT have subpackages", !y.hasSubpackages());
-
- IPackageFragment java = getPackageFragment("JavaProjectTests", getSystemJsPathString(), "java");
- IPackageFragment lang= getPackageFragment("JavaProjectTests", getSystemJsPathString(), "java.lang");
-
- assertTrue("java should have subpackages", java.hasSubpackages());
- assertTrue("java.lang should NOT have subpackages", !lang.hasSubpackages());
-}
-/*
- * Ensures that the structure is known for a package fragment on the classpath.
- */
-public void testPackageFragmentIsStructureKnown1() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "", "x");
- assertTrue("Structure of package 'x' should be known", pkg.isStructureKnown());
-}
-/*
- * Ensures that asking if the structure is known for a package fragment outside the classpath throws a JavaScriptModelException.
- * (regression test for bug 138577 Package content disapear in package explorer)
- */
-public void testPackageFragmentIsStructureKnown2() throws CoreException {
- try {
- createJavaProject("P");
- createFolder("/P/pack");
- IPackageFragment pkg = getPackage("/P/pack");
- editFile(
- "/P/.classpath",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry excluding=\"pack/\" kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>"
- );
- JavaScriptModelException exception = null;
- try {
- pkg.isStructureKnown();
- } catch (JavaScriptModelException e) {
- exception = e;
- }
- assertExceptionEquals(
- "Unexpected exception",
- "pack [in <project root> [in P]] does not exist",
- exception);
- } finally {
- deleteProject("P");
- }
-}
-
-/*
- * Ensure that the non-Java resources of a source package are correct.
- */
-public void testPackageFragmentNonJavaResources1() throws JavaScriptModelException {
- // regular source package with resources
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "", "x");
- Object[] resources = pkg.getNonJavaScriptResources();
- assertResourcesEqual(
- "Unexpected resources",
- "/JavaProjectTests/x/readme.txt\n" +
- "/JavaProjectTests/x/readme2.txt",
- resources);
-}
-
-/*
- * Ensure that the non-Java resources of a source package without resources are correct.
- */
-public void testPackageFragmentNonJavaResources2() throws JavaScriptModelException {
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "", "x.y");
- Object[] resources = pkg.getNonJavaScriptResources();
- assertResourcesEqual(
- "Unexpected resources",
- "",
- resources);
-}
-
-/*
- * Ensure that the non-Java resources of the default package are correct.
- */
-public void testPackageFragmentNonJavaResources3() throws JavaScriptModelException {
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "", "");
- Object[] resources = pkg.getNonJavaScriptResources();
- assertResourcesEqual(
- "Unexpected resources",
- "",
- resources);
-}
-
-/*
- * Ensure that the non-Java resources of a zip package without resources are correct.
- */
-public void testPackageFragmentNonJavaResources4() throws JavaScriptModelException {
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "lib.jar", "p");
- Object[] resources = pkg.getNonJavaScriptResources();
- assertResourcesEqual(
- "Unexpected resources",
- "",
- resources);
-}
-
-// TODO: zip default package with potentialy resources
-
-/*
- * Ensure that the non-Java resources of a zip default package without resources are correct.
- */
-public void testPackageFragmentNonJavaResources5() throws JavaScriptModelException {
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "lib.jar", "");
- Object[] resources = pkg.getNonJavaScriptResources();
- assertResourcesEqual(
- "Unexpected resources",
- "",
- resources);
-}
-
-/*
- * Ensure that the non-Java resources of a zip package with resources are correct.
- * (regression test for bug 142530 [hierarchical packages] '.' in folder names confuses package explorer)
- */
-public void testPackageFragmentNonJavaResources6() throws JavaScriptModelException {
- // regular zip package without resources
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "lib142530.jar", "p");
- Object[] resources = pkg.getNonJavaScriptResources();
- assertResourcesEqual(
- "Unexpected resources",
- "x.y/Test.txt",
- resources);
-}
-
-/*
- * Ensure that the non-Java resources of a zip package with resources are correct.
- * (regression test for bug 148949 JarEntryFile now returning 'null')
- */
-public void testPackageFragmentNonJavaResources7() throws JavaScriptModelException {
- // regular zip package without resources
- IPackageFragment pkg = getPackageFragment("JavaProjectTests", "lib148949.jar", "p");
- Object[] resources = pkg.getNonJavaScriptResources();
- assertResourceNamesEqual(
- "Unexpected resources",
- "test.txt",
- resources);
-}
-
-/*
- * Ensures that the package-info.class file doesn't appear as a child of a package if proj=src
- * (regression test for bug 99654 [5.0] JavaModel returns both IClassFile and IJavaScriptUnit for package-info.java)
- */
-public void testPackageFragmentPackageInfoClass() throws CoreException {
- try {
- createJavaProject("P");
- createFolder("/P/p1");
- IPackageFragment pkg = getPackage("/P/p1");
- pkg.open(null);
- createFile("/P/p1/package-info.class", "");
- assertResourceNamesEqual(
- "Unexpected resources of /P/p1",
- "",
- pkg.getNonJavaScriptResources());
- } finally {
- deleteProject("P");
- }
-}
-/**
- * Tests that after a package "foo" has been renamed into "bar", it is possible to recreate
- * a "foo" package.
- * @see "1FWX0HY: ITPCORE:WIN98 - Problem after renaming a Java package"
- */
-public void testPackageFragmentRenameAndCreate() throws JavaScriptModelException, CoreException {
- IPackageFragment y = getPackageFragment("JavaProjectTests", "", "x.y");
- IFolder yFolder = (IFolder) y.getUnderlyingResource();
- IPath yPath = yFolder.getFullPath();
- IPath fooPath = yPath.removeLastSegments(1).append("foo");
-
- yFolder.move(fooPath, true, null);
- try {
- yFolder.create(true, true, null);
- } catch (Throwable e) {
- e.printStackTrace();
- assertTrue("should be able to recreate the y folder", false);
- }
- // restore the original state
- deleteResource(yFolder);
- IPackageFragment foo = getPackageFragment("JavaProjectTests", "", "x.foo");
- IFolder fooFolder = (IFolder) foo.getUnderlyingResource();
- fooFolder.move(yPath, true, null);
-}
-/**
- * Test that a package fragment root (non-external, non-jar, non-default root)
- * has a corresponding resource.
- */
-public void testPackageFragmentRootCorrespondingResource() throws JavaScriptModelException {
- IPackageFragmentRoot element= getPackageFragmentRoot("JavaProjectTests", "");
- IResource corr= element.getCorrespondingResource();
- IResource res= getWorkspace().getRoot().getProject("JavaProjectTests");
- assertTrue("incorrect corresponding resource", corr.equals(res));
- assertEquals("Project incorrect for folder resource", "JavaProjectTests", corr.getProject().getName());
-}
-/**
- * Test getting the non-java resources from a package fragment root.
- */
-public void testPackageFragmentRootNonJavaResources() throws JavaScriptModelException {
- // source package fragment root with resources
- IPackageFragmentRoot root = getPackageFragmentRoot("JavaProjectTests", "");
- Object[] resources = root.getNonJavaScriptResources();
- assertResourceNamesEqual(
- "unexpected non java resoures (test case 1)",
- ".project\n" +
- ".settings\n" +
- "lib142530.jar\n" +
- "lib148949.jar",
- resources);
-
- // source package fragment root without resources
- root = getPackageFragmentRoot("JavaProjectSrcTests", "src");
- resources = root.getNonJavaScriptResources();
- assertResourceNamesEqual(
- "unexpected non java resoures (test case 2)",
- "",
- resources);
-
- // zip package fragment root with resources
- // TO DO
-
- // zip package fragment root without resources
- root = getPackageFragmentRoot("JavaProjectTests", "lib.jar");
- resources = root.getNonJavaScriptResources();
- assertResourceNamesEqual(
- "unexpected non java resoures (test case 4)",
- "MANIFEST.MF",
- resources);
-}
-/**
- * Test raw entry inference performance for package fragment root
- */
-public void testPackageFragmentRootRawEntry() throws CoreException, IOException {
- File libDir = null;
- try {
- String libPath = getExternalPath() + "lib";
- JavaScriptCore.setIncludepathVariable("MyVar", new Path(libPath), null);
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {});
- libDir = new File(libPath);
- libDir.mkdirs();
- final int length = 200;
- IIncludePathEntry[] classpath = new IIncludePathEntry[length];
- for (int i = 0; i < length; i++){
- File libJar = new File(libDir, "lib"+i+".jar");
- libJar.createNewFile();
- classpath[i] = JavaScriptCore.newVariableEntry(new Path("/MyVar/lib"+i+".jar"), null, null);
- }
- proj.setRawIncludepath(classpath, null);
-
- IPackageFragmentRoot[] roots = proj.getPackageFragmentRoots();
- assertEquals("wrong number of entries:", length, roots.length);
- //long start = System.currentTimeMillis();
- for (int i = 0; i < roots.length; i++){
- IIncludePathEntry rawEntry = roots[i].getRawIncludepathEntry();
- assertEquals("unexpected root raw entry:", classpath[i], rawEntry);
- }
- //System.out.println((System.currentTimeMillis() - start)+ "ms for "+roots.length+" roots");
- } finally {
- if (libDir != null) {
- org.eclipse.wst.jsdt.core.tests.util.Util.delete(libDir);
- }
- this.deleteProject("P");
- JavaScriptCore.removeIncludepathVariable("MyVar", null);
- }
-}
-/**
- * Test raw entry inference performance for package fragment root in case
- * original classpath had duplicate entries pointing to it: first raw entry should be found
- */
-public void testPackageFragmentRootRawEntryWhenDuplicate() throws CoreException, IOException {
- File libDir = null;
- try {
- String externalPath = getExternalPath();
- String libPath = externalPath + "lib";
- JavaScriptCore.setIncludepathVariable("MyVar", new Path(externalPath), null);
- IJavaScriptProject proj = this.createJavaProject("P", new String[] {});
- libDir = new File(libPath);
- libDir.mkdirs();
- IIncludePathEntry[] classpath = new IIncludePathEntry[2];
- File libJar = new File(libDir, "lib.jar");
- libJar.createNewFile();
- classpath[0] = JavaScriptCore.newLibraryEntry(new Path(libPath).append("lib.jar"), null, null);
- classpath[1] = JavaScriptCore.newVariableEntry(new Path("/MyVar").append("lib.jar"), null, null);
- proj.setRawIncludepath(classpath, null);
- JavaScriptCore.setIncludepathVariable("MyVar", new Path(libPath), null); // change CP var value to cause collision
-
- IPackageFragmentRoot[] roots = proj.getPackageFragmentRoots();
- assertEquals("wrong number of entries:", 1, roots.length);
- IIncludePathEntry rawEntry = roots[0].getRawIncludepathEntry();
- assertEquals("unexpected root raw entry:", classpath[0], rawEntry); // ensure first entry is associated to the root
- } finally {
- if (libDir != null) {
- org.eclipse.wst.jsdt.core.tests.util.Util.delete(libDir);
- }
- this.deleteProject("P");
- JavaScriptCore.removeIncludepathVariable("MyVar", null);
- }
-}
-/*
- * Ensures that opening a project update the project references
- * (regression test for bug 73253 [model] Project references not set on project open)
- */
-public void testProjectOpen() throws CoreException {
- try {
- createJavaProject("P1");
- createJavaProject("P2", new String[0], new String[0], new String[] {"/P1"});
- IProject p2 = getProject("P2");
- p2.close(null);
- p2.open(null);
- IProject[] references = p2.getDescription().getDynamicReferences();
- assertResourcesEqual(
- "Unexpected referenced projects",
- "/P1",
- references);
- } finally {
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/**
- * Tests that closing and opening a project triggers the correct deltas.
- */
-public void testProjectClose() throws JavaScriptModelException, CoreException {
- IJavaScriptProject jproject= getJavaProject("JavaProjectTests");
- IPackageFragmentRoot[] originalRoots = jproject.getPackageFragmentRoots();
- IProject project= jproject.getProject();
-
- try {
- startDeltas();
- project.close(null);
- assertDeltas(
- "Unexpected delta 1",
- "JavaProjectTests[*]: {CLOSED}\n" +
- "ResourceDelta(/JavaProjectTests)"
- );
- } finally {
- try {
- clearDeltas();
-
- project.open(null);
- assertDeltas(
- "Unexpected delta 2",
- "JavaProjectTests[*]: {OPENED}\n" +
- "ResourceDelta(/JavaProjectTests)"
- );
-
- IPackageFragmentRoot[] openRoots = jproject.getPackageFragmentRoots();
- assertTrue("should have same number of roots", openRoots.length == originalRoots.length);
- for (int i = 0; i < openRoots.length; i++) {
- assertTrue("root not the same", openRoots[i].equals(originalRoots[i]));
- }
- } finally {
- stopDeltas();
- }
- }
-}
-/**
- * Test that a project has a corresponding resource.
- */
-public void testProjectCorrespondingResource() throws JavaScriptModelException {
- IJavaScriptProject project= getJavaProject("JavaProjectTests");
- IResource corr= project.getCorrespondingResource();
- IResource res= getWorkspace().getRoot().getProject("JavaProjectTests");
- assertTrue("incorrect corresponding resource", corr.equals(res));
-}
-/**
- * Test that the correct children exist in a project
- */
-public void testProjectGetChildren() throws JavaScriptModelException {
- IJavaScriptProject project = getJavaProject("JavaProjectTests");
- IJavaScriptElement[] roots= project.getChildren();
- assertElementsEqual(
- "Unexpected package fragment roots",
- "<project root> [in JavaProjectTests]\n" +
- getSystemJsPathString() + "\n" +
- "lib.jar [in JavaProjectTests]\n" +
- "lib142530.jar [in JavaProjectTests]\n" +
- "lib148949.jar [in JavaProjectTests]",
- roots);
-}
-/**
- * Test that the correct package fragments exist in the project.
- */
-public void testProjectGetPackageFragments() throws JavaScriptModelException {
- IJavaScriptProject project= getJavaProject("JavaProjectTests");
- IPackageFragment[] fragments= project.getPackageFragments();
- assertSortedElementsEqual(
- "unexpected package fragments",
- "<default> [in "+ getSystemJsPathString() + "]\n" +
- "q [in <project root> [in JavaProjectTests]]\n" +
- "x [in <project root> [in JavaProjectTests]]\n" +
- "x/y [in <project root> [in JavaProjectTests]]",
- fragments);
-}
-/*
- * Ensures that importing a project correctly update the project references
- * (regression test for bug 121569 [Import/Export] Importing projects in workspace, the default build order is alphabetical instead of by dependency)
- */
-public void testProjectImport() throws CoreException {
- try {
- createJavaProject("P1");
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- createJavaProject("P2");
- editFile(
- "/P2/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"/P1\"/>\n" +
- " <classpathentry kind=\"output\" path=\"\"/>\n" +
- "</classpath>"
- );
- }
- };
- getWorkspace().run(runnable, null);
- waitForAutoBuild();
- IProject[] referencedProjects = getProject("P2").getReferencedProjects();
- assertResourcesEqual(
- "Unexpected project references",
- "/P1",
- referencedProjects);
- } finally {
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/**
- * Test that the correct package fragments exist in the project.
- */
-public void testRootGetPackageFragments() throws JavaScriptModelException {
- IPackageFragmentRoot root= getPackageFragmentRoot("JavaProjectTests", "");
- IJavaScriptElement[] fragments= root.getChildren();
- assertElementsEqual(
- "unexpected package fragments in source folder",
- "<default> [in <project root> [in JavaProjectTests]]\n" +
- "q [in <project root> [in JavaProjectTests]]\n" +
- "x [in <project root> [in JavaProjectTests]]\n" +
- "x/y [in <project root> [in JavaProjectTests]]",
- fragments);
-
- root= getPackageFragmentRoot("JavaProjectTests", "lib.jar");
- fragments= root.getChildren();
- assertSortedElementsEqual(
- "unexpected package fragments in library",
- "<default> [in lib.jar [in JavaProjectTests]]\n" +
- "p [in lib.jar [in JavaProjectTests]]",
- fragments);
-}
-/**
- * Test that the correct package fragments exist in the project.
- * (regression test for bug 65693 Package Explorer shows .class files instead of .java)
- */
-public void testRootGetPackageFragments3() throws CoreException {
- try {
- IJavaScriptProject p1 = createJavaProject("P1");
- createFile(
- "/P1/X.js",
- "function X() {\n" +
- "}"
- );
- getProject("P1").build(IncrementalProjectBuilder.FULL_BUILD, null);
- IJavaScriptProject p2 = createJavaProject("P2");
- editFile(
- "/P2/.settings/.jsdtscope",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<classpath>\n" +
- " <classpathentry kind=\"src\" path=\"\"/>\n" +
- " <classpathentry kind=\"lib\" path=\"/P1\"/>\n" +
- "</classpath>"
- );
- IPackageFragment pkg = p1.getPackageFragmentRoot(p1.getProject()).getPackageFragment("");
- assertElementsEqual(
- "Unexpected packages for P1",
- "X.js [in <default> [in <project root> [in P1]]]",
- pkg.getChildren());
- pkg = p2.getPackageFragmentRoot(p1.getProject()).getPackageFragment("");
- assertElementsEqual(
- "Unexpected packages for P2",
- "X.js [in <default> [in /P1 [in P2]]]",
- pkg.getChildren());
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Ensure a source folder can have a name ending with ".jar"
- */
-public void testSourceFolderWithJarName() throws CoreException {
- try {
- this.createJavaProject("P", new String[] {"src.jar"});
- IFile file = createFile("/P/src.jar/X.js", "class X {}");
- IJavaScriptUnit unit = (IJavaScriptUnit)JavaScriptCore.create(file);
- unit.getAllTypes(); // force to open
- } catch (CoreException e) {
- assertTrue("unable to open unit in 'src.jar' source folder", false);
- } finally {
- this.deleteProject("P");
- }
-}/**
- * Test that a method
- * has no corresponding resource.
- */
-public void testSourceMethodCorrespondingResource() throws JavaScriptModelException {
- IJavaScriptUnit element= getCompilationUnit("JavaProjectTests", "", "q", "A.js");
- IFunction[] methods = element.getFunctions();
- assertTrue("missing methods", methods.length > 0);
- IResource corr= methods[0].getCorrespondingResource();
- assertTrue("incorrect corresponding resource", corr == null);
-}
-
-/**
- * Test User Library preference. External jar file referenced in library entry does not exist.
- * It does not need to as we only test the preference value...
- *
- * @test bug 88719: UserLibrary.serialize /createFromString need support for access restriction / attributes
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=88719"
- */
-public void testUserLibrary() throws JavaScriptModelException {
-
- IIncludePathEntry[] userEntries = new IIncludePathEntry[2];
-
- // Set first classpath entry
- IPath path = new Path("/tmp/test.jar");
- IAccessRule[] pathRules = new IAccessRule[3];
- pathRules[0] = JavaScriptCore.newAccessRule(new Path("**/forbidden/**"), IAccessRule.K_NON_ACCESSIBLE);
- pathRules[1] = JavaScriptCore.newAccessRule(new Path("**/discouraged/**"), IAccessRule.K_DISCOURAGED);
- pathRules[2] = JavaScriptCore.newAccessRule(new Path("**/accessible/**"), IAccessRule.K_ACCESSIBLE);
- IIncludePathAttribute[] extraAttributes = new IIncludePathAttribute[2];
- extraAttributes[0] = JavaScriptCore.newIncludepathAttribute("javadoc_location", "http://www.sample-url.org/doc/");
- extraAttributes[1] = JavaScriptCore.newIncludepathAttribute("org.eclipse.wst.jsdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY", "/tmp");
- userEntries[0] = JavaScriptCore.newLibraryEntry(path, null, null, pathRules, extraAttributes, false);
-
- // Set second classpath entry
- path = new Path("/tmp/test.jar");
- pathRules = new IAccessRule[3];
- pathRules[0] = JavaScriptCore.newAccessRule(new Path("/org/eclipse/forbidden/**"), IAccessRule.K_NON_ACCESSIBLE);
- pathRules[1] = JavaScriptCore.newAccessRule(new Path("/org/eclipse/discouraged/**"), IAccessRule.K_DISCOURAGED);
- pathRules[2] = JavaScriptCore.newAccessRule(new Path("/org/eclipse/accessible/**"), IAccessRule.K_ACCESSIBLE);
- extraAttributes = new IIncludePathAttribute[2];
- extraAttributes[0] = JavaScriptCore.newIncludepathAttribute("javadoc_location", "http://www.sample-url.org/doc/");
- extraAttributes[1] = JavaScriptCore.newIncludepathAttribute("org.eclipse.wst.jsdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY", "/tmp");
- userEntries[1] = JavaScriptCore.newLibraryEntry(path, null, null, pathRules, extraAttributes, false);
-
- // Create user library
- UserLibrary library = new UserLibrary(userEntries, false);
- UserLibraryManager.setUserLibrary("TEST", library, null);
-
- // Verify it has been written in preferences
- IEclipsePreferences instancePreferences = JavaModelManager.getJavaModelManager().getInstancePreferences();
- String containerKey = UserLibraryManager.CP_USERLIBRARY_PREFERENCES_PREFIX+"TEST";
- String libraryPreference = instancePreferences.get(containerKey, null);
- assertNotNull("Should get a preference for TEST user library", libraryPreference);
-
- assertSourceEquals(
- "Invalid library contents",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<userlibrary systemlibrary=\"false\" version=\"1\">\n" +
- " <archive path=\"/tmp/test.jar\">\n" +
- " <attributes>\n" +
- " <attribute name=\"javadoc_location\" value=\"http://www.sample-url.org/doc/\"/>\n" +
- " <attribute name=\"org.eclipse.wst.jsdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY\" value=\"/tmp\"/>\n" +
- " </attributes>\n" +
- " <accessrules>\n" +
- " <accessrule kind=\"nonaccessible\" pattern=\"**/forbidden/**\"/>\n" +
- " <accessrule kind=\"discouraged\" pattern=\"**/discouraged/**\"/>\n" +
- " <accessrule kind=\"accessible\" pattern=\"**/accessible/**\"/>\n" +
- " </accessrules>\n" +
- " </archive>\n" +
- " <archive path=\"/tmp/test.jar\">\n" +
- " <attributes>\n" +
- " <attribute name=\"javadoc_location\" value=\"http://www.sample-url.org/doc/\"/>\n" +
- " <attribute name=\"org.eclipse.wst.jsdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY\" value=\"/tmp\"/>\n" +
- " </attributes>\n" +
- " <accessrules>\n" +
- " <accessrule kind=\"nonaccessible\" pattern=\"/org/eclipse/forbidden/**\"/>\n" +
- " <accessrule kind=\"discouraged\" pattern=\"/org/eclipse/discouraged/**\"/>\n" +
- " <accessrule kind=\"accessible\" pattern=\"/org/eclipse/accessible/**\"/>\n" +
- " </accessrules>\n" +
- " </archive>\n" +
- "</userlibrary>\n",
- libraryPreference);
-}
-
-/**
- * @bug 148859: [model][delta] Package Explorer only shows default package after import
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=148859"
- */
-public void testBug148859() throws CoreException {
- try {
- ResourcesPlugin.getWorkspace().run(
- new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IJavaScriptProject project = createJavaProject("P");
- project.findType("X");
- createFolder("/P/pack");
- }
- },
- null);
- IPackageFragmentRoot root = getPackageFragmentRoot("P", "");
- assertElementsEqual(
- "Unexpected children size in 'P' default source folder",
- "<default> [in <project root> [in P]]\n" +
- "pack [in <project root> [in P]]",
- root.getChildren());
- } finally {
- deleteProject("P");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaScriptLikeExtensionsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaScriptLikeExtensionsTests.java
deleted file mode 100644
index 35b294e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaScriptLikeExtensionsTests.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-
-public class JavaScriptLikeExtensionsTests extends ModifyingResourceTests {
-
- public JavaScriptLikeExtensionsTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(JavaScriptLikeExtensionsTests.class);
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- Util.resetJavaLikeExtensions();
- }
-
- /*
- * Ensures that the known JavaScript-like extensions are correct.
- */
- public void testGetJavaScriptLikeExtensions01() {
- assertSortedStringsEqual(
- "Unexpected file extensions",
- "js\n",
- JavaScriptCore.getJavaScriptLikeExtensions()
- );
- }
-
- /*
- * Ensures that the known JavaScript-like extensions are correct after a JavaScript-like file extension is added.
- */
- public void testGetJavaScriptLikeExtensions02() throws CoreException {
- IContentType javaContentType = Platform.getContentTypeManager().getContentType(JavaScriptCore.JAVA_SOURCE_CONTENT_TYPE);
- try {
- if (javaContentType != null)
- javaContentType.addFileSpec("abc", IContentType.FILE_EXTENSION_SPEC);
- assertSortedStringsEqual(
- "Unexpected file extensions",
- "abc\n" +
- "js\n",
- JavaScriptCore.getJavaScriptLikeExtensions()
- );
- } finally {
- if (javaContentType != null)
- javaContentType.removeFileSpec("abc", IContentType.FILE_EXTENSION_SPEC);
- }
- }
-
- /*
- * Ensure that file.js is a Java-like file name
- */
- public void testIJavaScriptLikeFileName01() {
- assertTrue("file.js should be a JavaScript-like file name", JavaScriptCore.isJavaScriptLikeFileName("file.js"));
- }
-
- /*
- * Ensure that file.other is not a Java-like file name
- */
- public void testIJavaScriptLikeFileName02() {
- assertFalse("file.other should not be a JavaScript-like file name", JavaScriptCore.isJavaScriptLikeFileName("file.other"));
- }
-
- /*
- * Ensure that file is not a JavaScript-like file name
- */
- public void testIJavaScriptLikeFileName04() {
- assertFalse("file should not be a JavaScript-like file name", JavaScriptCore.isJavaScriptLikeFileName("file"));
- }
-
- /*
- * Ensure that removing the JavaScript-like extension for file.js returns js
- */
- public void testRemoveJavaScriptLikeExtension02() {
- assertEquals("Unexpected file without JavaScript-like extension", "file", JavaScriptCore.removeJavaScriptLikeExtension("file.js"));
- }
-
- /*
- * Ensure that removing the JavaScript-like extension for file.other returns foo.other
- */
- public void testRemoveJavaScriptLikeExtension03() {
- assertEquals("Unexpected file without JavaScript-like extension", "file.other", JavaScriptCore.removeJavaScriptLikeExtension("file.other"));
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchBugsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchBugsTests.java
deleted file mode 100644
index bc55c61..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchBugsTests.java
+++ /dev/null
@@ -1,7560 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IImportDeclaration;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.ILocalVariable;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-import org.eclipse.wst.jsdt.core.search.SearchParticipant;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.core.search.TypeNameMatch;
-import org.eclipse.wst.jsdt.core.search.TypeNameMatchRequestor;
-import org.eclipse.wst.jsdt.core.search.TypeNameRequestor;
-import org.eclipse.wst.jsdt.core.search.TypeReferenceMatch;
-import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.wst.jsdt.internal.core.ClassFile;
-import org.eclipse.wst.jsdt.internal.core.SourceMethod;
-import org.eclipse.wst.jsdt.internal.core.search.AbstractSearchScope;
-import org.eclipse.wst.jsdt.internal.core.search.indexing.IIndexConstants;
-import org.eclipse.wst.jsdt.internal.core.search.matching.MatchLocator;
-import org.eclipse.wst.jsdt.internal.core.search.matching.PatternLocator;
-
-/**
- * Non-regression tests for bugs fixed in Java Search engine.
- */
-public class JavaSearchBugsTests extends AbstractJavaSearchTests implements IJavaScriptSearchConstants {
- private final static int UI_DECLARATIONS = DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE;
-
-public JavaSearchBugsTests(String name) {
- super(name);
- this.endChar = "";
-}
-public static Test suite() {
- return buildModelTestSuite(JavaSearchBugsTests.class);
-}
-static {
-// org.eclipse.wst.jsdt.internal.core.search.BasicSearchEngine.VERBOSE = true;
-// org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.DEBUG = true;
-}
-
-class TestCollector extends JavaSearchResultCollector {
- public List matches = new ArrayList();
- public void acceptSearchMatch(SearchMatch searchMatch) throws CoreException {
- super.acceptSearchMatch(searchMatch);
- matches.add(searchMatch);
- }
-}
-class TypeReferencesCollector extends JavaSearchResultCollector {
- protected IJavaScriptElement getElement(SearchMatch searchMatch) {
- IJavaScriptElement element = super.getElement(searchMatch);
- IJavaScriptElement localElement = null;
- TypeReferenceMatch typeRefMatch = (TypeReferenceMatch) match;
- localElement = typeRefMatch.getLocalElement();
- if (localElement != null) {
- return localElement;
- }
- return element;
- }
- protected void writeLine() throws CoreException {
- super.writeLine();
- TypeReferenceMatch typeRefMatch = (TypeReferenceMatch) this.match;
- IJavaScriptElement[] others = typeRefMatch.getOtherElements();
- int length = others==null ? 0 : others.length;
- if (length > 0) {
- line.append("+[");
- for (int i=0; i<length; i++) {
- IJavaScriptElement other = others[i];
- if (i>0) line.append(',');
- line.append(other.getElementName());
- }
- line.append(']');
- }
- }
-}
-
-IJavaScriptSearchScope getJavaSearchScopeBugs() {
- return SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("JavaSearchBugs")});
-}
-IJavaScriptSearchScope getJavaSearchScopeBugs(String packageName, boolean addSubpackages) throws JavaScriptModelException {
- if (packageName == null) return getJavaSearchScopeBugs();
- return getJavaSearchPackageScope("JavaSearchBugs", packageName, addSubpackages);
-}
-public IJavaScriptUnit getWorkingCopy(String path, String source) throws JavaScriptModelException {
- if (this.wcOwner == null) {
- this.wcOwner = new WorkingCopyOwner() {};
- }
- return getWorkingCopy(path, source, this.wcOwner, null/*don't compute problems*/);
-}
-protected void search(IJavaScriptElement element, int limitTo) throws CoreException {
- search(element, limitTo, EXACT_RULE, getJavaSearchScopeBugs(), resultCollector);
-}
-protected void search(IJavaScriptElement element, int limitTo, int matchRule) throws CoreException {
- search(element, limitTo, matchRule, getJavaSearchScopeBugs(), resultCollector);
-}
-protected void search(String patternString, int searchFor, int limitTo) throws CoreException {
- search(patternString, searchFor, limitTo, EXACT_RULE, getJavaSearchScopeBugs(), resultCollector);
-}
-protected void search(String patternString, int searchFor, int limitTo, int matchRule) throws CoreException {
- search(patternString, searchFor, limitTo, matchRule, getJavaSearchScopeBugs(), resultCollector);
-}
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.SuiteOfTestCases#setUpSuite()
- */
-public void setUpSuite() throws Exception {
- super.setUpSuite();
- JAVA_PROJECT = setUpJavaProject("JavaSearchBugs", "1.5");
-// addLibraryEntry(JAVASCRIPT_PROJECT, "/JavaSearchBugs/lib/b95152.jar", false);
-// addLibraryEntry(JAVASCRIPT_PROJECT, "/JavaSearchBugs/lib/b123679.jar", false);
-// addLibraryEntry(JAVASCRIPT_PROJECT, "/JavaSearchBugs/lib/b140156.jar", false);
-// addLibraryEntry(JAVASCRIPT_PROJECT, "/JavaSearchBugs/lib/b164791.jar", false);
-// addLibraryEntry(JAVASCRIPT_PROJECT, "/JavaSearchBugs/lib/b166348.jar", false);
-}
-public void tearDownSuite() throws Exception {
- deleteProject("JavaSearchBugs");
- super.tearDownSuite();
-}
-protected void setUp () throws Exception {
- super.setUp();
- this.resultCollector = new TestCollector();
- resultCollector.showInsideDoc = false;
- resultCollector.showAccuracy = true;
-}
-
-/**
- * Bug 41018: Method reference not found
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=41018"
- */
-public void testBug41018() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b41018/A.js",
- "package b41018;\n" +
- "public class A {\n" +
- " protected void anotherMethod() {\n" +
- " methodA(null);\n" +
- " }\n" +
- " private Object methodA(ClassB.InnerInterface arg3) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n" +
- "class ClassB implements InterfaceB {\n" +
- "}\n" +
- "interface InterfaceB {\n" +
- " interface InnerInterface {\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("A");
- IFunction method = type.getFunction("methodA", new String[] { "QClassB.InnerInterface;" });
- search(method, REFERENCES);
- assertSearchResults(
- "src/b41018/A.java void b41018.A.anotherMethod() [methodA(null)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 70827: [Search] wrong reference match to private method of supertype
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=70827"
- */
-public void testBug70827() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b70827/A.js",
- "package b70827;\n" +
- "class A {\n" +
- " private void privateMethod() {\n" +
- " }\n" +
- "}\n" +
- "class Second extends A {\n" +
- " void call() {\n" +
- " int i= privateMethod();\n" +
- " }\n" +
- " int privateMethod() {\n" +
- " return 1;\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("A");
- IFunction method = type.getFunction("privateMethod", new String[] {});
- search(method, REFERENCES);
- assertSearchResults(
- ""
- );
-}
-
-/**
- * Bug 71279: [Search] NPE in TypeReferenceLocator when moving CU with unresolved type reference
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=71279"
- */
-public void testBug71279() throws CoreException {
- JavaSearchResultCollector result = new JavaSearchResultCollector() {
- public void beginReporting() {
- results.append("Starting search...");
- }
- public void endReporting() {
- results.append("\nDone searching.");
- }
- };
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b71279/AA.js",
- "package b71279;\n" +
- "public class AA {\n" +
- " Unknown ref;\n" +
- "}\n"
- );
- new SearchEngine(workingCopies).searchDeclarationsOfReferencedTypes(workingCopies[0], result, null);
- assertSearchResults(
- "Starting search...\n" +
- "Done searching.",
- result);
-}
-
-/**
- * Bug 72866: [search] references to endVisit(FunctionInvocation) reports refs to endVisit(SuperMethodInvocation)
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=72866"
- */
-public void testBug72866() throws CoreException {
- workingCopies = new IJavaScriptUnit[4];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b72866/A.js",
- "package b72866;\n" +
- "public abstract class A {\n" +
- " public abstract void foo(V v);\n" +
- "}\n",
- owner,
- true
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b72866/SX.js",
- "package b72866;\n" +
- "public class SX extends A {\n" +
- " public void foo(V v) {\n" +
- " v.bar(this);\n" +
- " }\n" +
- "}\n" ,
- owner,
- true);
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b72866/V.js",
- "package b72866;\n" +
- "public class V {\n" +
- " void bar(A a) {}\n" +
- " void bar(X x) {}\n" +
- " void bar(SX s) {}\n" +
- "}\n" ,
- owner,
- true);
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b72866/X.js",
- "package b72866;\n" +
- "public class X extends A {\n" +
- " public void foo(V v) {\n" +
- " v.bar(this);\n" +
- " }\n" +
- "}\n" ,
- owner,
- true );
- IType type = workingCopies[2].getType("V");
- IFunction method = type.getFunction("bar", new String[] {"QX;"});
- search(method, REFERENCES);
- assertSearchResults(
- "src/b72866/X.java void b72866.X.foo(V) [bar(this)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 73112: [Search] SearchEngine doesn't find all fields multiple field declarations
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=73112"
- */
-public void testBug73112a() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b73112/A.js",
- "package b73112;\n" +
- "public class A {\n" +
- " int fieldA73112a = 1, fieldA73112b = new Integer(2).intValue(), fieldA73112c = fieldA73112a + fieldA73112b;\n" +
- " int fieldA73112d;\n" +
- " \n" +
- " public void method(){}\n" +
- "}\n");
- // search field references to first multiple field
- search("fieldA73112*", FIELD, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b73112/A.java b73112.A.fieldA73112a [fieldA73112a] EXACT_MATCH\n" +
- "src/b73112/A.java b73112.A.fieldA73112b [fieldA73112b] EXACT_MATCH\n" +
- "src/b73112/A.java b73112.A.fieldA73112c [fieldA73112c] EXACT_MATCH\n" +
- "src/b73112/A.java b73112.A.fieldA73112c [fieldA73112a] EXACT_MATCH\n" +
- "src/b73112/A.java b73112.A.fieldA73112c [fieldA73112b] EXACT_MATCH\n" +
- "src/b73112/A.java b73112.A.fieldA73112d [fieldA73112d] EXACT_MATCH"
- );
-}
-public void testBug73112b() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = super.getWorkingCopy("/JavaSearchBugs/src/b73112/B.js",
- "package b73112;\n" +
- "public class B {\n" +
- " int fieldB73112a, fieldB73112b = 10;\n" +
- " int fieldB73112c = fieldB73112a + fieldB73112b, fieldB73112d = fieldB73112c + fieldB73112a, fieldB73112e;\n" +
- " \n" +
- " public void method(){}\n" +
- "}\n");
- // search field references to first multiple field
- search("fieldB73112*", FIELD, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b73112/B.java b73112.B.fieldB73112a [fieldB73112a] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112b [fieldB73112b] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112c [fieldB73112c] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112c [fieldB73112a] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112c [fieldB73112b] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112d [fieldB73112d] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112d [fieldB73112c] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112d [fieldB73112a] EXACT_MATCH\n" +
- "src/b73112/B.java b73112.B.fieldB73112e [fieldB73112e] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 73336: [1.5][search] Search Engine does not find type references of actual generic type parameters
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=73336"
- */
-public void testBug73336() throws CoreException {
- workingCopies = new IJavaScriptUnit[6];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b73336/A.js",
- "package b73336;\n" +
- "public class A {}\n",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b73336/AA.js",
- "package b73336;\n" +
- "public class AA extends A {}\n",
- owner,
- true);
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b73336/B.js",
- "package b73336;\n" +
- "public class B extends X<A, A> {\n" +
- " <T> void foo(T t) {}\n" +
- "}\n",
- owner,
- true);
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b73336/C.js",
- "package b73336;\n" +
- "public class C implements I<A> {\n" +
- " public void foo() {\n" +
- " B b = new B();\n" +
- " b.<A>foo(new A());\n" +
- " }\n" +
- "}\n",
- owner,
- true );
- workingCopies[4] = getWorkingCopy("/JavaSearchBugs/src/b73336/I.js",
- "package b73336;\n" +
- "public interface I<T> {\n" +
- " public void foo();\n" +
- "}\n",
- owner,
- true );
- workingCopies[5] = getWorkingCopy("/JavaSearchBugs/src/b73336/X.js",
- "package b73336;\n" +
- "public class X<T, U> {\n" +
- " <V> void foo(V v) {}\n" +
- " class Member<T> {\n" +
- " void foo() {}\n" +
- " }\n" +
- "}\n",
- owner,
- true );
- // search for first and second method should both return 2 inaccurate matches
- IType type = workingCopies[0].getType("A");
- search(type, REFERENCES); //, getJavaSearchScopeBugs("b73336", false));
- assertSearchResults(
- "src/b73336/AA.java b73336.AA [A] EXACT_MATCH\n" +
- "src/b73336/B.java b73336.B [A] EXACT_MATCH\n" +
- "src/b73336/B.java b73336.B [A] EXACT_MATCH\n" +
- "src/b73336/C.java b73336.C [A] EXACT_MATCH\n" +
- "src/b73336/C.java void b73336.C.foo() [A] EXACT_MATCH\n" +
- "src/b73336/C.java void b73336.C.foo() [A] EXACT_MATCH"
- );
-}
-public void testBug73336b() throws CoreException {
- workingCopies = new IJavaScriptUnit[4];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b73336b/A.js",
- "package b73336b;\n" +
- "public class A {}\n",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b73336b/B.js",
- "package b73336b;\n" +
- "public class B extends X<A, A> {\n" +
- "}\n",
- owner,
- true);
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b73336b/C.js",
- "package b73336b;\n" +
- "public class C extends X<A, A>.Member<A> {\n" +
- " public C() {\n" +
- " new X<A, A>().super();\n" +
- " }\n" +
- "}\n",
- owner,
- true);
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b73336b/X.js",
- "package b73336b;\n" +
- "public class X<T, U> {\n" +
- " <V> void foo(V v) {}\n" +
- " class Member<T> {\n" +
- " void foo() {}\n" +
- " }\n" +
- "}\n",
- owner,
- true );
- // search for first and second method should both return 2 inaccurate matches
- IType type = workingCopies[0].getType("A");
-// search(type, REFERENCES, getJavaSearchScopeBugs("b73336b", false));
- search(type, REFERENCES); //, getJavaSearchScopeBugs("b73336", false));
- assertSearchResults(
- "src/b73336b/B.java b73336b.B [A] EXACT_MATCH\n" +
- "src/b73336b/B.java b73336b.B [A] EXACT_MATCH\n" +
- "src/b73336b/C.java b73336b.C [A] EXACT_MATCH\n" +
- "src/b73336b/C.java b73336b.C [A] EXACT_MATCH\n" +
- "src/b73336b/C.java b73336b.C [A] EXACT_MATCH\n" +
- "src/b73336b/C.java b73336b.C() [A] EXACT_MATCH\n" +
- "src/b73336b/C.java b73336b.C() [A] EXACT_MATCH"
- );
-}
-// Verify that no NPE was raised on following case (which produces compiler error)
-public void testBug73336c() throws CoreException {
- workingCopies = new IJavaScriptUnit[4];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b73336c/A.js",
- "package b73336c;\n" +
- "public class A {}\n",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b73336c/B.js",
- "package b73336c;\n" +
- "public class B extends X<A, A> {\n" +
- "}\n",
- owner,
- true);
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b73336c/C.js",
- "package b73336c;\n" +
- "public class C implements X<A, A>.Interface<A> {\n" +
- " void bar() {}\n" +
- "}\n",
- owner,
- true);
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b73336c/X.js",
- "package b73336c;\n" +
- "public class X<T, U> {\n" +
- " interface Interface<V> {\n" +
- " void bar();\n" +
- " }\n" +
- "}\n",
- owner,
- true );
- // search for first and second method should both return 2 inaccurate matches
- IType type = workingCopies[0].getType("A");
-// search(type, REFERENCES, getJavaSearchScopeBugs("b73336c", false));
- search(type, REFERENCES); //, getJavaSearchScopeBugs("b73336", false));
- assertSearchResults(
- "src/b73336c/B.java b73336c.B [A] EXACT_MATCH\n" +
- "src/b73336c/B.java b73336c.B [A] EXACT_MATCH\n" +
- "src/b73336c/C.java b73336c.C [A] EXACT_MATCH\n" +
- "src/b73336c/C.java b73336c.C [A] EXACT_MATCH\n" +
- "src/b73336c/C.java b73336c.C [A] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 74776: [Search] Wrong search results for almost identical method
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=74776"
- */
-public void testBug74776() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b74776/A.js",
- "package b74776;\n" +
- "public class A {\n" +
- " /**\n" +
- " * @deprecated Use {@link #foo(IRegion)} instead\n" +
- " * @param r\n" +
- " */\n" +
- " void foo(Region r) {\n" +
- " foo((IRegion)r);\n" +
- " }\n" +
- " void foo(IRegion r) {\n" +
- " }\n" +
- "}\n",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b74776/IRegion.js",
- "package b74776;\n" +
- "public interface IRegion {\n" +
- "}\n",
- owner,
- true);
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b74776/Region.js",
- "package b74776;\n" +
- "public class Region implements IRegion {\n" +
- "\n" +
- "}\n",
- owner,
- true);
- // search method references
- IType type = workingCopies[0].getType("A");
- IFunction method = type.getFunction("foo", new String[] { "QRegion;" });
- search(method, REFERENCES);
- assertSearchResults("");
-}
-
-/**
- * Bug 75816: [search] correct results are missing in java search
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=75816"
- */
-public void testBug75816() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/test75816.jar", "", "Test.class").getType();
- IType innerType = type.getType("Inner");
- IFunction[] methods = innerType.getFunctions();
- assertEquals("Wrong number of method.", 1, methods.length);
- search(methods[0], REFERENCES);
- assertSearchResults(
- "lib/test75816.jar Test.Inner Test.newInner(java.lang.Object) EXACT_MATCH"
- );
-}
-
-/**
- * Bug 77093: [search] No references found to method with member type argument
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=77093"
- */
-private void setUpBug77093() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b77093/X.js",
- "package b77093;\n" +
- "public class X {\n" +
- " class Z {\n" +
- " }\n" +
- " Z[][] z_arrays;\n" +
- " X() {\n" +
- " this(new Z[10][]);\n" +
- " }\n" +
- " X(Z[][] arrays) {\n" +
- " z_arrays = arrays;\n" +
- " }\n" +
- " private void foo(Z[] args) {\n" +
- " }\n" +
- " void bar() {\n" +
- " for (int i=0; i<z_arrays.length; i++)\n" +
- " foo(z_arrays[i]);\n" +
- " }\n" +
- "}"
- );
-}
-public void testBug77093constructor() throws CoreException {
- setUpBug77093();
- IType type = workingCopies[0].getType("X");
- IFunction method = type.getFunction("X", new String[] {"[[QZ;"});
- // Search for constructor declarations and references
- search(method, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b77093/X.java b77093.X() [this(new Z[10][]);] EXACT_MATCH\n"+
- "src/b77093/X.java b77093.X(Z[][]) [X] EXACT_MATCH"
- );
-}
-public void testBug77093field() throws CoreException {
- setUpBug77093();
- IType type = workingCopies[0].getType("X");
- IField field = type.getField("z_arrays");
- // Search for field declarations and references
- search(field, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b77093/X.java b77093.X.z_arrays [z_arrays] EXACT_MATCH\n" +
- "src/b77093/X.java b77093.X(Z[][]) [z_arrays] EXACT_MATCH\n" +
- "src/b77093/X.java void b77093.X.bar() [z_arrays] EXACT_MATCH\n" +
- "src/b77093/X.java void b77093.X.bar() [z_arrays] EXACT_MATCH"
- );
-}
-public void testBug77093method() throws CoreException {
- setUpBug77093();
- IType type = workingCopies[0].getType("X");
- IFunction method = type.getFunction("foo", new String[] {"[QZ;"});
- search(method, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b77093/X.java void b77093.X.foo(Z[]) [foo] EXACT_MATCH\n" +
- "src/b77093/X.java void b77093.X.bar() [foo(z_arrays[i])] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 77388: [compiler] Reference to constructor includes space after closing parenthesis
- */
-public void testBug77388() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b77388/Test.js",
- "package b77388;\n" +
- "class Test {\n" +
- " Test(int a, int b) { }\n" +
- " void take(Test mc) { }\n" +
- " void run() {\n" +
- " take( new Test(1, 2) ); // space in \") )\" is in match\n" +
- " }\n" +
- "}");
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("Test", new String[] {"I", "I"});
- // Search for constructor references
- search(method, REFERENCES);
- assertSearchResults(
- "src/b77388/Test.java void b77388.Test.run() [new Test(1, 2)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 78082: [1.5][search] FieldReferenceMatch in static import should not include qualifier
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=78082"
- */
-public void testBug78082() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b78082/M.js",
- "package b78082;\n" +
- "public class M {\n" +
- " static int VAL=78082;\n" +
- "}\n",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b78082/XY.js",
- "package b78082;\n" +
- "import static b78082.M.VAL;\n" +
- "public class XY {\n" +
- " double val = VAL;\n" +
- " double val2= b78082.M.VAL;\n" +
- "}\n",
- owner,
- true);
- // search field references
- IType type = workingCopies[0].getType("M");
- IField field = type.getField("VAL");
- search(field, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b78082/M.java b78082.M.VAL [VAL] EXACT_MATCH\n" +
- "src/b78082/XY.java [VAL] EXACT_MATCH\n" +
- "src/b78082/XY.java b78082.XY.val [VAL] EXACT_MATCH\n" +
- "src/b78082/XY.java b78082.XY.val2 [VAL] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 79267: [search] Refactoring of static generic member fails partially
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=79267"
- */
-public void testBug79267() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79267/Test.js",
- "package b79267;\n" +
- "public class Test {\n" +
- " private static final X<String, String> BEFORE = new X<String, String>(4);\n" +
- "\n" +
- " static {\n" +
- " BEFORE.put(\"key1\",\"value1\");\n" +
- " BEFORE.put(\"key2\",\"value2\");\n" +
- " }\n" +
- " \n" +
- " private static final X<Y, Object> objectToPrimitiveMap = new X<Y, Object>(8);\n" +
- "\n" +
- " static {\n" +
- " objectToPrimitiveMap.put(new Y<Object>(new Object()), new Object());\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "class X<T, U> {\n" +
- " X(int x) {}\n" +
- " void put(T t, U u) {}\n" +
- "}\n" +
- "\n" +
- "class Y<T> {\n" +
- " Y(T t) {}\n" +
- "}\n");
- // search field references
- IType type = workingCopies[0].getType("Test");
- IField field = type.getField("BEFORE");
- search(field, REFERENCES);
- field = type.getField("objectToPrimitiveMap");
- search(field, REFERENCES);
- assertSearchResults(
- "src/b79267/Test.java b79267.Test.static {} [BEFORE] EXACT_MATCH\n" +
- "src/b79267/Test.java b79267.Test.static {} [BEFORE] EXACT_MATCH\n" +
- "src/b79267/Test.java b79267.Test.static {} [objectToPrimitiveMap] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 79378: [search] IOOBE when inlining a method
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=79378"
- */
-public void testBug79378() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79378/A.js",
- "package b79378;\n" +
- "public class Test {\n" +
- " void foo79378(String s, RuntimeException[] exceptions) {}\n" +
- " void foo79378(RuntimeException[] exceptions) {}\n" +
- " void call() {\n" +
- " String s= null; \n" +
- " Exception[] exceptions= null;\n" +
- " foo79378(s, exceptions);\n" +
- " }\n" +
- "}\n"
- );
- IFunction[] methods = workingCopies[0].getType("Test").getFunctions();
- assertEquals("Invalid number of methods", 3, methods.length);
- search(methods[0], REFERENCES);
- assertSearchResults(
- "src/b79378/A.java void b79378.Test.call() [foo79378(s, exceptions)] POTENTIAL_MATCH"
- );
-}
-public void testBug79378b() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79378/A.js",
- "package b79378;\n" +
- "public class Test {\n" +
- " void foo79378(String s, RuntimeException[] exceptions) {}\n" +
- " void foo79378(RuntimeException[] exceptions) {}\n" +
- " void call() {\n" +
- " String s= null; \n" +
- " Exception[] exceptions= null;\n" +
- " foo79378(s, exceptions);\n" +
- " }\n" +
- "}\n"
- );
- IFunction[] methods = workingCopies[0].getType("Test").getFunctions();
- assertEquals("Invalid number of methods", 3, methods.length);
- search(methods[1], REFERENCES);
- assertSearchResults("");
-}
-
-/**
- * Bug 79803: [1.5][search] Search for references to type A reports match for type variable A
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=79803"
- */
-public void testBug79803() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79803/A.js",
- "package b79803;\n" +
- "class A<A> {\n" +
- " A a;\n" +
- " b79803.A pa= new b79803.A();\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("A");
- search(type, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b79803/A.java b79803.A.pa [b79803.A] EXACT_MATCH\n" +
- "src/b79803/A.java b79803.A.pa [b79803.A] EXACT_MATCH"
- );
-}
-public void testBug79803string() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79803/A.js",
- "package b79803;\n" +
- "class A<A> {\n" +
- " A a;\n" +
- " b79803.A pa= new b79803.A();\n" +
- "}\n"
- );
- search("A", TYPE, REFERENCES);
- assertSearchResults(
- "src/b79803/A.java b79803.A.a [A] EXACT_MATCH\n" +
- "src/b79803/A.java b79803.A.pa [A] EXACT_MATCH\n" +
- "src/b79803/A.java b79803.A.pa [A] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 79860: [1.5][search] Search doesn't find type reference in type parameter bound
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=79860"
- */
-public void testBug79860() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79860/X.js",
- "package b79860;\n" +
- "public class X<T extends A> { }\n" +
- "class A { }",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b79860/Y.js",
- "package b79860;\n" +
- "public class Y<T extends B&I1&I2&I3> { }\n" +
- "class B { }\n" +
- "interface I1 {}\n" +
- "interface I2 {}\n" +
- "interface I3 {}\n",
- owner,
- true);
- IType type = workingCopies[0].getType("A");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b79860/X.java b79860.X [A] EXACT_MATCH"
- );
-}
-public void testBug79860string() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79860/X.js",
- "package b79860;\n" +
- "public class X<T extends A> { }\n" +
- "class A { }",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b79860/Y.js",
- "package b79860;\n" +
- "public class Y<T extends B&I1&I2&I3> { }\n" +
- "class B { }\n" +
- "interface I1 {}\n" +
- "interface I2 {}\n" +
- "interface I3 {}\n",
- owner,
- true);
- search("I?", TYPE, REFERENCES);
- assertSearchResults(
- "src/b79860/Y.java b79860.Y [I1] EXACT_MATCH\n" +
- "src/b79860/Y.java b79860.Y [I2] EXACT_MATCH\n" +
- "src/b79860/Y.java b79860.Y [I3] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 79990: [1.5][search] Search doesn't find type reference in type parameter bound
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=79990"
- */
-private void setUpBug79990() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79990/Test.js",
- "package b79990;\n" +
- "class Test<T> {\n" +
- " public void first(Exception num) {}\n" +
- " public void second(T t) {}\n" +
- "}\n" +
- "class Sub extends Test<Exception> {\n" +
- " public void first(Exception num) {}\n" +
- " public void second(Exception t) {}\n" +
- "}\n"
- );}
-public void testBug79990() throws CoreException {
- setUpBug79990();
- IFunction method = workingCopies[0].getType("Test").getFunctions()[0];
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b79990/Test.java void b79990.Test.first(Exception) [first] EXACT_MATCH\n" +
- "src/b79990/Test.java void b79990.Sub.first(Exception) [first] EXACT_MATCH"
- );
-}
-public void testBug79990b() throws CoreException {
- setUpBug79990();
- IFunction method = workingCopies[0].getType("Test").getFunctions()[1];
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b79990/Test.java void b79990.Test.second(T) [second] EXACT_MATCH\n" +
- "src/b79990/Test.java void b79990.Sub.second(Exception) [second] EXACT_MATCH"
- );
-}
-public void testBug79990c() throws CoreException {
- setUpBug79990();
- IFunction method = workingCopies[0].getType("Test").getFunctions()[1];
- search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b79990/Test.java void b79990.Test.second(T) [second] EXACT_MATCH\n" +
- "src/b79990/Test.java void b79990.Sub.second(Exception) [second] EXACT_MATCH"
- );
-}
-public void testBug79990d() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79990/Test.js",
- "package b79990;\n" +
- "public class Test<T> {\n" +
- " void methodT(T t) {}\n" +
- "}\n" +
- "class Sub<X> extends Test<X> {\n" +
- " void methodT(X x) {} // overrides Super#methodT(T)\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Test").getFunctions()[0];
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b79990/Test.java void b79990.Test.methodT(T) [methodT] EXACT_MATCH\n" +
- "src/b79990/Test.java void b79990.Sub.methodT(X) [methodT] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 80084: [1.5][search]Rename field fails on field based on parameterized type with member type parameter
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=80084"
- */
-public void testBug80084() throws CoreException, JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b80084/Test.js",
- "package b80084;\n" +
- "class List<T> {}\n" +
- "public class Test {\n" +
- " void foo(List<Exception> le) {}\n" +
- " void bar() {\n" +
- " List<Exception> le = new List<Exception>();\n" +
- " foo(le);\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QList<QException;>;" } );
- search(method, REFERENCES);
- assertSearchResults(
- "src/b80084/Test.java void b80084.Test.bar() [foo(le)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 80194: [1.5][search]Rename field fails on field based on parameterized type with member type parameter
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=80194"
- */
-private void setUpBug80194() throws CoreException, JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b80194/Test.js",
- "package b80194;\n" +
- "interface Map<K, V> {}\n" +
- "class HashMap<K, V> implements Map {}\n" +
- "public class Test {\n" +
- " void callDoSomething() {\n" +
- " final Map<String, Object> map = new HashMap<String, Object>();\n" +
- " doSomething(map);\n" +
- " doSomething(map, true);\n" +
- " doSomething(true);\n" +
- " }\n" +
- " void doSomething(final Map<String, Object> map) {}\n" +
- " void doSomething(final Map<String, Object> map, final boolean flag) {}\n" +
- " void doSomething(final boolean flag) {}\n" +
- "}\n"
- );
-}
-public void testBug80194() throws CoreException, JavaScriptModelException {
- setUpBug80194();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("doSomething", new String[] { "QMap<QString;QObject;>;" } );
- search(method, REFERENCES);
- assertSearchResults(
- "src/b80194/Test.java void b80194.Test.callDoSomething() [doSomething(map)] EXACT_MATCH"
- );
-}
-public void testBug80194b() throws CoreException, JavaScriptModelException {
- setUpBug80194();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("doSomething", new String[] { "QMap<QString;QObject;>;", "Z" } );
- search(method, REFERENCES);
- assertSearchResults(
- "src/b80194/Test.java void b80194.Test.callDoSomething() [doSomething(map, true)] EXACT_MATCH"
- );
-}
-public void testBug80194string1() throws CoreException, JavaScriptModelException {
- setUpBug80194();
- search("doSomething(boolean)", METHOD, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b80194/Test.java void b80194.Test.callDoSomething() [doSomething(map)] EXACT_MATCH\n" +
- "src/b80194/Test.java void b80194.Test.callDoSomething() [doSomething(true)] EXACT_MATCH\n" +
- "src/b80194/Test.java void b80194.Test.doSomething(boolean) [doSomething] EXACT_MATCH"
- );
-}
-public void testBug80194string2() throws CoreException, JavaScriptModelException {
- setUpBug80194();
- search("doSomething(Map<String,Object>)", METHOD, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b80194/Test.java void b80194.Test.callDoSomething() [doSomething(map)] EXACT_MATCH\n" +
- "src/b80194/Test.java void b80194.Test.callDoSomething() [doSomething(true)] EXACT_MATCH\n" +
- "src/b80194/Test.java void b80194.Test.doSomething(Map<String,Object>) [doSomething] EXACT_MATCH"
- );
-}
-public void testBug80194string3() throws CoreException, JavaScriptModelException {
- setUpBug80194();
- search("doSomething(Map<String,Object>,boolean)", METHOD, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b80194/Test.java void b80194.Test.callDoSomething() [doSomething(map, true)] EXACT_MATCH\n" +
- "src/b80194/Test.java void b80194.Test.doSomething(Map<String,Object>, boolean) [doSomething] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 80223: [search] Declaration search doesn't consider visibility to determine overriding methods
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=80223"
- */
-public void testBug80223() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b80223/a/A.js",
- "package b80223.a;\n" +
- "public class A {\n" +
- " void m() {}\n" +
- "}",
- owner,
- true);
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b80223/b/B.js",
- "package b80223.b;\n" +
- "public class B extends b80223.a.A {\n" +
- " void m() {}\n" +
- "}",
- owner,
- true);
- // search for method declaration should find only A match
- IType type = workingCopies[0].getType("A");
- IFunction method = type.getFunction("m", new String[0]);
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b80223/a/A.java void b80223.a.A.m() [m] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 80264: [search] Search for method declarations in workspace, disregarding declaring type
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=80264"
- *
- * Following tests also verify
- * Bug 87778: [search] doesn't find all declarations of method with covariant return type
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=87778"
- */
-// Methods
-private void setUpBug80264_Methods() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b80264/Methods.js",
- "package b80264;\n" +
- "class Methods {\n" +
- " Methods stable() { return null; }\n" +
- " Methods covariant() { return null; }\n" +
- "}\n" +
- "class MethodsSub extends Methods {\n" +
- " Methods stable() { return null; }\n" +
- " MethodsSub covariant() { return null; }\n" +
- "}\n" +
- "class MethodsOther {\n" +
- " Methods stable() { return null; }\n" +
- " Methods covariant() { return null; }\n" +
- "}\n"
- );
-}
-public void testBug80264_Methods() throws CoreException {
- setUpBug80264_Methods();
- IType type = workingCopies[0].getType("Methods");
- IFunction[] methods = type.getFunctions();
- search(methods[0], DECLARATIONS);
- search(methods[1], DECLARATIONS);
- assertSearchResults(
- "src/b80264/Methods.java Methods b80264.Methods.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsSub.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.Methods.covariant() [covariant] EXACT_MATCH\n" +
- "src/b80264/Methods.java MethodsSub b80264.MethodsSub.covariant() [covariant] EXACT_MATCH"
- );
-}
-public void testBug80264_MethodsIgnoreDeclaringType() throws CoreException, JavaScriptModelException {
- setUpBug80264_Methods();
- IType type = workingCopies[0].getType("Methods");
- IFunction[] methods = type.getFunctions();
- search(methods[0], DECLARATIONS|IGNORE_DECLARING_TYPE);
- search(methods[1], DECLARATIONS|IGNORE_DECLARING_TYPE);
- assertSearchResults(
- "src/b80264/Methods.java Methods b80264.Methods.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsSub.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsOther.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.Methods.covariant() [covariant] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsOther.covariant() [covariant] EXACT_MATCH"
- );
-}
-public void testBug80264_MethodsIgnoreReturnType() throws CoreException, JavaScriptModelException {
- setUpBug80264_Methods();
- IType type = workingCopies[0].getType("Methods");
- IFunction[] methods = type.getFunctions();
- search(methods[0], DECLARATIONS|IGNORE_RETURN_TYPE);
- search(methods[1], DECLARATIONS|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b80264/Methods.java Methods b80264.Methods.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsSub.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.Methods.covariant() [covariant] EXACT_MATCH\n" +
- "src/b80264/Methods.java MethodsSub b80264.MethodsSub.covariant() [covariant] EXACT_MATCH"
- );
-}
-public void testBug80264_MethodsIgnoreBothTypes() throws CoreException, JavaScriptModelException {
- setUpBug80264_Methods();
- IType type = workingCopies[0].getType("Methods");
- IFunction[] methods = type.getFunctions();
- search(methods[0], DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- search(methods[1], DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b80264/Methods.java Methods b80264.Methods.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsSub.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsOther.stable() [stable] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.Methods.covariant() [covariant] EXACT_MATCH\n" +
- "src/b80264/Methods.java MethodsSub b80264.MethodsSub.covariant() [covariant] EXACT_MATCH\n" +
- "src/b80264/Methods.java Methods b80264.MethodsOther.covariant() [covariant] EXACT_MATCH"
- );
-}
-// Classes
-private void setUpBug80264_Classes() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b80264/Classes.js",
- "package b80264;\n" +
- "class Classes {\n" +
- " class Inner {}\n" +
- "}\n" +
- "class ClassesSub extends Classes {\n" +
- " class Inner {}\n" +
- "}\n" +
- "class ClassesOther {\n" +
- " class Inner {}\n" +
- "}\n"
- );
-}
-public void testBug80264_Classes() throws CoreException {
- setUpBug80264_Classes();
- IType type = workingCopies[0].getType("Classes").getType("Inner");
- search(type, DECLARATIONS);
- assertSearchResults(
- "src/b80264/Classes.java b80264.Classes$Inner [Inner] EXACT_MATCH"
- );
-}
-public void testBug80264_ClassesIgnoreDeclaringType() throws CoreException, JavaScriptModelException {
- setUpBug80264_Classes();
- IType type = workingCopies[0].getType("Classes").getType("Inner");
- search(type, DECLARATIONS|IGNORE_DECLARING_TYPE);
- assertSearchResults(
- "src/b80264/Classes.java b80264.Classes$Inner [Inner] EXACT_MATCH\n" +
- "src/b80264/Classes.java b80264.ClassesSub$Inner [Inner] EXACT_MATCH\n" +
- "src/b80264/Classes.java b80264.ClassesOther$Inner [Inner] EXACT_MATCH"
- );
-}
-public void testBug80264_ClassesIgnoreReturnType() throws CoreException, JavaScriptModelException {
- setUpBug80264_Classes();
- IType type = workingCopies[0].getType("Classes").getType("Inner");
- search(type, DECLARATIONS|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b80264/Classes.java b80264.Classes$Inner [Inner] EXACT_MATCH"
- );
-}
-public void testBug80264_ClassesIgnoreTypes() throws CoreException, JavaScriptModelException {
- setUpBug80264_Classes();
- IType type = workingCopies[0].getType("Classes").getType("Inner");
- search(type, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b80264/Classes.java b80264.Classes$Inner [Inner] EXACT_MATCH\n" +
- "src/b80264/Classes.java b80264.ClassesSub$Inner [Inner] EXACT_MATCH\n" +
- "src/b80264/Classes.java b80264.ClassesOther$Inner [Inner] EXACT_MATCH"
- );
-}
-// Fields
-private void setUpBug80264_Fields() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b80264/Fields.js",
- "package b80264;\n" +
- "class Fields {\n" +
- " Fields field1;\n" +
- " Fields field2;\n" +
- "}\n" +
- "class FieldsSub extends Fields {\n" +
- " Fields field1;\n" +
- " FieldsSub field2;\n" +
- "}\n" +
- "class FieldsOther {\n" +
- " Fields field1;\n" +
- " Fields field2;\n" +
- "}\n"
- );
-}
-public void testBug80264_Fields() throws CoreException {
- setUpBug80264_Fields();
- IType type = workingCopies[0].getType("Fields");
- IField[] fields = type.getFields();
- search(fields[0], DECLARATIONS);
- search(fields[1], DECLARATIONS);
- assertSearchResults(
- "src/b80264/Fields.java b80264.Fields.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.Fields.field2 [field2] EXACT_MATCH"
- );
-}
-public void testBug80264_FieldsIgnoreDeclaringType() throws CoreException, JavaScriptModelException {
- setUpBug80264_Fields();
- IType type = workingCopies[0].getType("Fields");
- IField[] fields = type.getFields();
- search(fields[0], DECLARATIONS|IGNORE_DECLARING_TYPE);
- search(fields[1], DECLARATIONS|IGNORE_DECLARING_TYPE);
- assertSearchResults(
- "src/b80264/Fields.java b80264.Fields.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.FieldsSub.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.FieldsOther.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.Fields.field2 [field2] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.FieldsOther.field2 [field2] EXACT_MATCH"
- );
-}
-public void testBug80264_FieldsIgnoreReturnType() throws CoreException, JavaScriptModelException {
- setUpBug80264_Fields();
- IType type = workingCopies[0].getType("Fields");
- IField[] fields = type.getFields();
- search(fields[0], DECLARATIONS|IGNORE_RETURN_TYPE);
- search(fields[1], DECLARATIONS|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b80264/Fields.java b80264.Fields.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.Fields.field2 [field2] EXACT_MATCH"
- );
-}
-public void testBug80264_FieldsIgnoreBothTypes() throws CoreException, JavaScriptModelException {
- setUpBug80264_Fields();
- IType type = workingCopies[0].getType("Fields");
- IField[] fields = type.getFields();
- search(fields[0], DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- search(fields[1], DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b80264/Fields.java b80264.Fields.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.FieldsSub.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.FieldsOther.field1 [field1] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.Fields.field2 [field2] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.FieldsSub.field2 [field2] EXACT_MATCH\n" +
- "src/b80264/Fields.java b80264.FieldsOther.field2 [field2] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 80890: [search] Strange search engine behaviour
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=80890"
- */
-public void testBug80890() throws CoreException, JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b80890/A.js",
- "package b80890;\n" +
- "public class A {\n" +
- " protected void foo(Exception e) {}\n" +
- " protected void foo(String s) {}\n" +
- "}\n" +
- "class B1 extends A {\n" +
- " public void bar1() {\n" +
- " foo(null);\n" +
- " }\n" +
- "}\n" +
- "class B2 extends A {\n" +
- " public void bar2() {\n" +
- " foo(null);\n" +
- " }\n" +
- "}\n"
- );
- // search for first and second method should both return 2 inaccurate matches
- IType type = workingCopies[0].getType("A");
- IFunction method = type.getFunctions()[0];
- search(method, REFERENCES);
- method = type.getFunctions()[1];
- search(method, REFERENCES);
- assertSearchResults(
- "src/b80890/A.java void b80890.B1.bar1() [foo(null)] POTENTIAL_MATCH\n" +
- "src/b80890/A.java void b80890.B2.bar2() [foo(null)] POTENTIAL_MATCH\n" +
- "src/b80890/A.java void b80890.B1.bar1() [foo(null)] POTENTIAL_MATCH\n" +
- "src/b80890/A.java void b80890.B2.bar2() [foo(null)] POTENTIAL_MATCH"
- );
-}
-
-/**
- * Bug 80918: [1.5][search] ClassCastException when searching for references to binary type
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=80918"
- */
-public void testBug80918() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", getExternalJCLPathString("1.5"), "java.lang", "Exception.class").getType();
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("JavaSearchBugs")}, IJavaScriptSearchScope.SOURCES);
- search(type, REFERENCES, SearchPattern.R_CASE_SENSITIVE|SearchPattern.R_ERASURE_MATCH, scope);
- assertSearchResults(
- "" // do not expect to find anything, just verify that no CCE happens
- );
-}
-
-/**
- * Bug 81084: [1.5][search]Rename field fails on field based on parameterized type with member type parameter
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=81084"
- */
-public void testBug81084a() throws CoreException, JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b81084a/Test.js",
- "package b81084a;\n" +
- "class List<E> {}\n" +
- "public class Test {\n" +
- " class Element{}\n" +
- " static class Inner {\n" +
- " private final List<Element> fList1;\n" +
- " private final List<Test.Element> fList2;\n" +
- " public Inner(List<Element> list) {\n" +
- " fList1 = list;\n" +
- " fList2 = list;\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("Test").getType("Inner");
- IField field1 = type.getField("fList1");
- search(field1, REFERENCES);
- IField field2 = type.getField("fList2");
- search(field2, REFERENCES);
- assertSearchResults(
- "src/b81084a/Test.java b81084a.Test$Inner(List<Element>) [fList1] EXACT_MATCH\n" +
- "src/b81084a/Test.java b81084a.Test$Inner(List<Element>) [fList2] EXACT_MATCH"
- );
-}
-public void testBug81084string() throws CoreException, JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b81084a/Test.js",
- "package b81084a;\n" +
- "class List<E> {}\n" +
- "public class Test {\n" +
- " class Element{}\n" +
- " static class Inner {\n" +
- " private final List<Element> fList1;\n" +
- " private final List<Test.Element> fList2;\n" +
- " public Inner(List<Element> list) {\n" +
- " fList1 = list;\n" +
- " fList2 = list;\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- search("fList1", FIELD, REFERENCES);
- search("fList2", FIELD, REFERENCES);
- assertSearchResults(
- "src/b81084a/Test.java b81084a.Test$Inner(List<Element>) [fList1] EXACT_MATCH\n" +
- "src/b81084a/Test.java b81084a.Test$Inner(List<Element>) [fList2] EXACT_MATCH"
- );
-}
-public void testBug81084b() throws CoreException, JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b81084b/Test.js",
- "package b81084b;\n" +
- "class List<E> {}\n" +
- "public class Test {\n" +
- " class Element{}\n" +
- " static class Inner {\n" +
- " private final List<? extends Element> fListb1;\n" +
- " private final List<? extends Test.Element> fListb2;\n" +
- " public Inner(List<Element> list) {\n" +
- " fListb1 = list;\n" +
- " fListb2 = list;\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- // search element patterns
- IType type = workingCopies[0].getType("Test").getType("Inner");
- IField field1 = type.getField("fListb1");
- search(field1, REFERENCES);
- IField field2 = type.getField("fListb2");
- search(field2, REFERENCES);
- assertSearchResults(
- "src/b81084b/Test.java b81084b.Test$Inner(List<Element>) [fListb1] EXACT_MATCH\n" +
- "src/b81084b/Test.java b81084b.Test$Inner(List<Element>) [fListb2] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 81556: [search] correct results are missing in java search
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=81556"
- */
-public void testBug81556() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b81556.a", "X81556.js");
- IType type = unit.getType("X81556");
- IFunction method = type.getFunction("foo", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b81556/a/A81556.java void b81556.a.A81556.bar(XX81556) [foo()] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 82088: [search][javadoc] Method parameter types references not found in @see/@link tags
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=82088"
- */
-public void testBug82088method() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b82088/m/Test.js",
- "package b82088.m;\n" +
- "/**\n" +
- " * @see #setA(A)\n" +
- " */\n" +
- "public class Test {\n" +
- " A a;\n" +
- " public void setA(A a) {\n" +
- " this.a = a;\n" +
- " }\n" +
- "}\n" +
- "class A {}\n"
- );
- IType type = workingCopies[0].getType("A");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b82088/m/Test.java b82088.m.Test [A] EXACT_MATCH\n" +
- "src/b82088/m/Test.java b82088.m.Test.a [A] EXACT_MATCH\n" +
- "src/b82088/m/Test.java void b82088.m.Test.setA(A) [A] EXACT_MATCH"
- );
-}
-public void testBug82088constructor() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b82088/c/Test.js",
- "package b82088.c;\n" +
- "/**\n" +
- " * @see #Test(A)\n" +
- " */\n" +
- "public class Test {\n" +
- " A a;\n" +
- " Test(A a) {\n" +
- " this.a = a;\n" +
- " }\n" +
- "}\n" +
- "class A {}\n"
- );
- IType type = workingCopies[0].getType("A");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b82088/c/Test.java b82088.c.Test [A] EXACT_MATCH\n" +
- "src/b82088/c/Test.java b82088.c.Test.a [A] EXACT_MATCH\n" +
- "src/b82088/c/Test.java b82088.c.Test(A) [A] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 82208: [1.5][search][annot] Search for annotations misses references in default and values constructs
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=82208"
- */
-private void setUpBug82208() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b82208/Test.js",
- "package b82208;\n" +
- "interface B82208_I {}\n" +
- "enum B82208_E {}\n" +
- "@interface B82208_A {}\n" +
- "public class B82208 {}\n"
- );
-}
-public void testBug82208_TYPE() throws CoreException {
- resultCollector.showRule = true;
- setUpBug82208();
- search("B82208*", TYPE, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b82208/Test.java b82208.B82208_I [B82208_I] EXACT_MATCH\n" +
- "src/b82208/Test.java b82208.B82208_E [B82208_E] EXACT_MATCH\n" +
- "src/b82208/Test.java b82208.B82208_A [B82208_A] EXACT_MATCH\n" +
- "src/b82208/Test.java b82208.B82208 [B82208] EXACT_MATCH"
- );
-}
-public void testBug82208_CLASS() throws CoreException {
- resultCollector.showRule = true;
- setUpBug82208();
- search("B82208*", CLASS, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b82208/Test.java b82208.B82208 [B82208] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 82673: [1.5][search][annot] Search for annotations misses references in default and values constructs
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83012"
- */
-public void testBug82673() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b82673/Test.js",
- "package b82673;\n" +
- "public class Test {\n" +
- " void test1() {\n" +
- " class Dummy {};\n" +
- " Dummy d = new Dummy();\n" +
- " new X();\n" +
- " }\n" +
- " \n" +
- " void test2() {\n" +
- " class Dummy {};\n" +
- " Dummy d = new Dummy();\n" +
- " new Y();\n" +
- " }\n" +
- "}\n" +
- "class X {}\n" +
- "class Y {}\n"
- );
- IType type = selectType(workingCopies[0], "Test").getFunction("test1", new String[0]).getType("Dummy", 1);
- search(type, REFERENCES);
- assertSearchResults(
- "src/b82673/Test.java void b82673.Test.test1() [Dummy] EXACT_MATCH\n" +
- "src/b82673/Test.java void b82673.Test.test1() [Dummy] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 83012: [1.5][search][annot] Search for annotations misses references in default and values constructs
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83012"
- */
-public void testBug83012() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83012/Test.js",
- "package b83012;\n" +
- "@interface A {\n" +
- " String value() default \"\";\n" +
- "}\n" +
- "@interface Main {\n" +
- " A first() default @A(\"Void\");\n" +
- " A second();\n" +
- "}\n" +
- "\n" +
- "@Main(first=@A(\"\"), second=@A(\"2\"))\n" +
- "public class Test {\n" +
- "}\n"
- );
- IType type = selectType(workingCopies[0], "A");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b83012/Test.java A b83012.Main.first() [A] EXACT_MATCH\n" +
- "src/b83012/Test.java A b83012.Main.first() [A] EXACT_MATCH\n" +
- "src/b83012/Test.java A b83012.Main.second() [A] EXACT_MATCH\n" +
- "src/b83012/Test.java b83012.Test [A] EXACT_MATCH\n" +
- "src/b83012/Test.java b83012.Test [A] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 83230: [1.5][search][annot] search for annotation elements does not seem to be implemented yet
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83230"
- */
-private void setUpBug83230_Explicit() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.js",
- "package b83230;\n" +
- "@interface Author {\n" +
- " String[] authorName() default \"FREDERIC\";\n" +
- " int[] age();\n" +
- " int ageMin = 20;\n" +
- " @interface Surname {}\n" +
- " class Address {\n" +
- " String city;\n" +
- " public void foo(Object obj) {}\n" +
- " }\n" +
- "}\n" +
- "\n" +
- "@Author(authorName=\"FREDERIC\", age=41)\n" +
- "public class Test {\n" +
- " @Author(authorName={\"FREDERIC\", \"JEROME\"}, age={41, 35} )\n" +
- " Test() {}\n" +
- " @Author(authorName=\"PHILIPPE\", age=37)\n" +
- " void foo() {\n" +
- " @Author(authorName=\"FREDERIC\", age=41)\n" +
- " final Object obj = new Object() {};\n" +
- " @Author(authorName=\"FREDERIC\", age=41)\n" +
- " class Local {\n" +
- " @Author(authorName=\"FREDERIC\", age=41)\n" +
- " String foo() {\n" +
- " Author.Address address = new Author.Address();\n" +
- " address.foo(obj);\n" +
- " return address.city;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " @Author(authorName=\"DAVID\", age=28)\n" +
- " int min = Author.ageMin;\n" +
- "}\n"
- );
-}
-public void testBug83230_Explicit() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83230_Explicit();
- IFunction method = selectMethod(workingCopies[0], "authorName");
- search(method, REFERENCES);
- assertSearchResults(
- "src/b83230/Test.java b83230.Test [authorName] EXACT_MATCH\n" +
- "src/b83230/Test.java b83230.Test.min [authorName] EXACT_MATCH\n" +
- "src/b83230/Test.java b83230.Test() [authorName] EXACT_MATCH\n" +
- "src/b83230/Test.java void b83230.Test.foo():Local#1 [authorName] EXACT_MATCH\n" +
- "src/b83230/Test.java String void b83230.Test.foo():Local#1.foo() [authorName] EXACT_MATCH\n" +
- "src/b83230/Test.java void b83230.Test.foo() [authorName] EXACT_MATCH\n" +
- "src/b83230/Test.java void b83230.Test.foo() [authorName] EXACT_MATCH"
- );
-}
-public void testBug83230_Explicit01() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83230_Explicit();
- IFunction method = selectMethod(workingCopies[0], "authorName");
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b83230/Test.java String[] b83230.Author.authorName() [authorName] EXACT_MATCH"
- );
-}
-public void testBug83230_Explicit02() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83230_Explicit();
- IType type = selectType(workingCopies[0], "Address");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b83230/Test.java String void b83230.Test.foo():Local#1.foo() [Author.Address] EXACT_MATCH\n" +
- "src/b83230/Test.java String void b83230.Test.foo():Local#1.foo() [Author.Address] EXACT_MATCH"
- );
-}
-public void testBug83230_Explicit03() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83230_Explicit();
- IFunction method = selectMethod(workingCopies[0], "foo");
- search(method, REFERENCES);
- assertSearchResults(
- "src/b83230/Test.java String void b83230.Test.foo():Local#1.foo() [foo(obj)] EXACT_MATCH"
- );
-}
-public void testBug83230_Explicit04() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83230_Explicit();
- IField field = selectField(workingCopies[0], "city");
- search(field, REFERENCES);
- assertSearchResults(
- "src/b83230/Test.java String void b83230.Test.foo():Local#1.foo() [city] EXACT_MATCH"
- );
-}
-public void testBug83230_Explicit05() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83230_Explicit();
- IField field = selectField(workingCopies[0], "ageMin");
- search(field, REFERENCES);
- assertSearchResults(
- "src/b83230/Test.java b83230.Test.min [ageMin] EXACT_MATCH"
- );
-}
-public void testBug83230_Implicit01() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.js",
- "package b83230;\n" +
- "@interface Annot {\n" +
- " int value();\n" +
- "}\n" +
- "@Annot(41)\n" +
- "public class Test {\n" +
- " @Annot(10)\n" +
- " public void foo() {}\n" +
- " @Annot(21)\n" +
- " int bar;\n" +
- "}\n"
- );
- IType type = selectType(workingCopies[0], "Annot");
- IFunction method = type.getFunction("value", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b83230/Test.java b83230.Test [41] EXACT_MATCH\n" +
- "src/b83230/Test.java b83230.Test.bar [21] EXACT_MATCH\n" +
- "src/b83230/Test.java void b83230.Test.foo() [10] EXACT_MATCH"
- );
-}
-public void testBug83230_Implicit02() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83230/Test.js",
- "package b83230;\n" +
- "@interface A {\n" +
- " String value() default \"\";\n" +
- "}\n" +
- "@interface Main {\n" +
- " A first() default @A(\"Void\");\n" +
- " A second();\n" +
- "}\n" +
- "\n" +
- "@Main(first=@A(\"\"), second=@A(\"2\"))\n" +
- "public class Test {\n" +
- "}\n"
- );
- IType type = selectType(workingCopies[0], "A");
- IFunction method = type.getFunction("value", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b83230/Test.java A b83230.Main.first() [\"Void\"] EXACT_MATCH\n" +
- "src/b83230/Test.java b83230.Test [\"\"] EXACT_MATCH\n" +
- "src/b83230/Test.java b83230.Test [\"2\"] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 83304: [search] correct results are missing in java search
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83304"
- */
-public void testBug83304() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Test.js",
- "package b83304;\n" +
- "public class Test {\n" +
- " void foo() {\n" +
- " Class<? extends Throwable> l1= null;\n" +
- " Class<Exception> l2= null;\n" +
- " \n" +
- " Class<String> string_Class;\n" +
- " }\n" +
- "}\n"
- );
- IType type = selectType(workingCopies[0], "Class", 3);
- search(type, REFERENCES, ERASURE_RULE, getJavaSearchWorkingCopiesScope());
- assertSearchResults(
- "src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" +
- "src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" +
- "src/b83304/Test.java void b83304.Test.foo() [Class] EXACT_MATCH"
- );
-}
-private void setUpBug83304_TypeParameterizedElementPattern() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Types.js",
- "package b83304;\n" +
- "import g1.t.s.def.Generic;\n" +
- "public class Types {\n" +
- " public Generic gen;\n" +
- " public Generic<Object> gen_obj;\n" +
- " public Generic<Exception> gen_exc;\n" +
- " public Generic<?> gen_wld;\n" +
- " public Generic<? extends Throwable> gen_thr;\n" +
- " public Generic<? super RuntimeException> gen_run;\n" +
- "}\n"
- );
-}
-public void testBug83304_TypeParameterizedElementPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_TypeParameterizedElementPattern();
- IType type = selectType(workingCopies[0], "Generic", 4);
- search(type, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Types.java [g1.t.s.def.Generic] EQUIVALENT_RAW_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen [Generic] EQUIVALENT_RAW_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_obj [Generic] ERASURE_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_exc [Generic] EXACT_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_wld [Generic] EQUIVALENT_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_thr [Generic] EQUIVALENT_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_run [Generic] EQUIVALENT_MATCH\n" +
- "lib/JavaSearch15.jar g1.t.s.def.Generic<T> g1.t.s.def.Generic.foo() ERASURE_MATCH"
- );
-}
-public void testBug83304_TypeGenericElementPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_TypeParameterizedElementPattern();
- IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g1.t.s.def", "Generic.class").getType();
- search(type, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Types.java [g1.t.s.def.Generic] EQUIVALENT_RAW_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen [Generic] ERASURE_RAW_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_obj [Generic] ERASURE_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_exc [Generic] ERASURE_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_wld [Generic] ERASURE_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_thr [Generic] ERASURE_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_run [Generic] ERASURE_MATCH\n" +
- "lib/JavaSearch15.jar g1.t.s.def.Generic<T> g1.t.s.def.Generic.foo() EXACT_MATCH"
- );
-}
-public void testBug83304_TypeStringPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_TypeParameterizedElementPattern();
- search("Generic<? super Exception>", TYPE, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Types.java [Generic] EQUIVALENT_RAW_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen [Generic] EQUIVALENT_RAW_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_obj [Generic] EQUIVALENT_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_exc [Generic] EQUIVALENT_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_wld [Generic] EQUIVALENT_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_thr [Generic] ERASURE_MATCH\n" +
- "src/b83304/Types.java b83304.Types.gen_run [Generic] ERASURE_MATCH\n" +
- "lib/JavaSearch15.jar g1.t.s.def.Generic<T> g1.t.s.def.Generic.foo() ERASURE_MATCH"
- );
-}
-private void setUpBug83304_MethodParameterizedElementPattern() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Methods.js",
- "package b83304;\n" +
- "import g5.m.def.Single;\n" +
- "public class Methods {\n" +
- " void test() {\n" +
- " Single<Exception> gs = new Single<Exception>();\n" +
- " Exception exc = new Exception();\n" +
- " gs.<Throwable>generic(exc);\n" +
- " gs.<Exception>generic(exc);\n" +
- " gs.<String>generic(\"\");\n" +
- " }\n" +
- "}\n"
- );
-}
-public void testBug83304_MethodParameterizedElementPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_MethodParameterizedElementPattern();
- IFunction method = selectMethod(workingCopies[0], "generic", 2);
- search(method, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" +
- "src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] EXACT_MATCH\n" +
- "src/b83304/Methods.java void b83304.Methods.test() [generic(\"\")] ERASURE_MATCH"
- );
-}
-public void testBug83304_MethodGenericElementPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_MethodParameterizedElementPattern();
- IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.m.def", "Single.class").getType();
- IFunction method = type.getFunction("generic", new String[] { "TU;" });
- search(method, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" +
- "src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" +
- "src/b83304/Methods.java void b83304.Methods.test() [generic(\"\")] ERASURE_MATCH"
- );
-}
-public void testBug83304_MethodStringPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_MethodParameterizedElementPattern();
- search("<Exception>generic", METHOD, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" +
- "src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] EXACT_MATCH\n" +
- "src/b83304/Methods.java void b83304.Methods.test() [generic(\"\")] ERASURE_MATCH"
- );
-}
-private void setUpBug83304_ConstructorGenericElementPattern() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Constructors.js",
- "package b83304;\n" +
- "import g5.c.def.Single;\n" +
- "public class Constructors {\n" +
- " void test() {\n" +
- " Exception exc= new Exception();\n" +
- " new <Throwable>Single<String>(\"\", exc);\n" +
- " new <Exception>Single<String>(\"\", exc);\n" +
- " new <String>Single<String>(\"\", \"\");\n" +
- " }\n" +
- "}\n"
- );
-}
-public void testBug83304_ConstructorGenericElementPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_ConstructorGenericElementPattern();
- IFunction method = selectMethod(workingCopies[0], "Single", 3);
- search(method, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <Throwable>Single<String>(\"\", exc)] ERASURE_MATCH\n" +
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <Exception>Single<String>(\"\", exc)] EXACT_MATCH\n" +
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <String>Single<String>(\"\", \"\")] ERASURE_MATCH"
- );
-}
-public void testBug83304_ConstructorParameterizedElementPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_ConstructorGenericElementPattern();
- IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.c.def", "Single.class").getType();
- IFunction method = type.getFunction("Single", new String[] { "TT;", "TU;" });
- search(method, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <Throwable>Single<String>(\"\", exc)] ERASURE_MATCH\n" +
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <Exception>Single<String>(\"\", exc)] ERASURE_MATCH\n" +
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <String>Single<String>(\"\", \"\")] ERASURE_MATCH"
- );
-}
-public void testBug83304_ConstructorStringPattern() throws CoreException {
- resultCollector.showRule = true;
- setUpBug83304_ConstructorGenericElementPattern();
- search("<Exception>Single", CONSTRUCTOR, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <Throwable>Single<String>(\"\", exc)] ERASURE_MATCH\n" +
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <Exception>Single<String>(\"\", exc)] EXACT_MATCH\n" +
- "src/b83304/Constructors.java void b83304.Constructors.test() [new <String>Single<String>(\"\", \"\")] ERASURE_MATCH\n" +
- "lib/JavaSearch15.jar g5.m.def.Single<T> g5.m.def.Single.returnParamType() ERASURE_MATCH\n" +
- "lib/JavaSearch15.jar g5.m.def.Single<T> g5.m.def.Single.complete(U, g5.m.def.Single<T>) ERASURE_MATCH"
- );
-}
-
-/**
- * Bug 83804: [1.5][javadoc] Missing Javadoc node for package declaration
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83804"
- */
-private void setUpBug83804_Type() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83804/package-info.js",
- "/**\n" +
- " * Valid javadoc.\n" +
- " * @see Test\n" +
- " * @see Unknown\n" +
- " * @see Test#foo()\n" +
- " * @see Test#unknown()\n" +
- " * @see Test#field\n" +
- " * @see Test#unknown\n" +
- " * @param unexpected\n" +
- " * @throws unexpected\n" +
- " * @return unexpected \n" +
- " */\n" +
- "package b83804;\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b83804/Test.js",
- "/**\n" +
- " * Invalid javadoc\n" +
- " */\n" +
- "package b83804;\n" +
- "public class Test {\n" +
- " public int field;\n" +
- " public void foo() {}\n" +
- "}\n"
- );
-}
-public void testBug83804_Type() throws CoreException {
- resultCollector.showInsideDoc = true;
- setUpBug83804_Type();
- IType type = workingCopies[1].getType("Test");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b83804/package-info.java [Test] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b83804/package-info.java [Test] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b83804/package-info.java [Test] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b83804/package-info.java [Test] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b83804/package-info.java [Test] EXACT_MATCH INSIDE_JAVADOC"
- );
-}
-public void testBug83804_Method() throws CoreException {
- resultCollector.showInsideDoc = true;
- setUpBug83804_Type();
- IFunction[] methods = workingCopies[1].getType("Test").getFunctions();
- assertEquals("Invalid number of methods", 1, methods.length);
- search(methods[0], REFERENCES);
- assertSearchResults(
- "src/b83804/package-info.java [foo()] EXACT_MATCH INSIDE_JAVADOC"
- );
-}
-public void testBug83804_Field() throws CoreException {
- resultCollector.showInsideDoc = true;
- setUpBug83804_Type();
- IField[] fields = workingCopies[1].getType("Test").getFields();
- assertEquals("Invalid number of fields", 1, fields.length);
- search(fields[0], REFERENCES);
- assertSearchResults(
- "src/b83804/package-info.java [field] EXACT_MATCH INSIDE_JAVADOC"
- );
-}
-
-/**
- * Bug 83388: [1.5][search] Search for varargs method not finding match
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83388"
- */
-public void testBug83388() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83388/R.js",
- "package b83388;\n" +
- "import b83388.*;\n" +
- "public class R {}\n"
- );
- IImportDeclaration importDeclaration = workingCopies[0].getImport("pack");
- assertNotNull("Cannot find \"pack\" import declaration for "+workingCopies[0].getElementName(), importDeclaration);
- SearchPattern pattern = SearchPattern.createPattern(
- "pack",
- PACKAGE,
- DECLARATIONS,
- EXACT_RULE);
- assertNotNull("Pattern should not be null", pattern);
- MatchLocator.setFocus(pattern, importDeclaration);
- new SearchEngine(workingCopies).search(
- pattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- getJavaSearchScopeBugs(),
- resultCollector,
- null
- );
- assertSearchResults(
- "src/b83388/R.java b83388 [No source] EXACT_MATCH"
- );
-}
-public void testBug83388b() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83388/R.js",
- "package b83388;\n" +
- "import b83388.*;\n" +
- "public class R {}\n"
- );
- SearchPattern pattern = SearchPattern.createPattern(
- "pack",
- PACKAGE,
- DECLARATIONS,
- EXACT_RULE);
- assertNotNull("Pattern should not be null", pattern);
- new SearchEngine(workingCopies).search(
- pattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- getJavaSearchScopeBugs(),
- resultCollector,
- null
- );
- assertSearchResults(
- "src/b83388/R.java b83388 [No source] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 83693: [search][javadoc] References to methods/constructors: range does not include parameter lists
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83693"
- */
-public void testBug83693() throws CoreException {
- resultCollector.showRule = true;
- resultCollector.showInsideDoc = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83693/A.js",
- "package b83693;\n" +
- "import static b83693.A.m;\n" +
- "/**\n" +
- " * @see A#m(int)\n" +
- " */\n" +
- "class A {\n" +
- " static void m(int i) {\n" +
- " b83693.A.m(i);\n" +
- " }\n" +
- "}"
- );
- IFunction[] methods = workingCopies[0].getType("A").getFunctions();
- assertEquals("Invalid number of methods", 1, methods.length);
- search(methods[0], REFERENCES);
- assertSearchResults(
- "src/b83693/A.java [b83693.A.m] EXACT_MATCH OUTSIDE_JAVADOC\n" +
- "src/b83693/A.java b83693.A [m(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b83693/A.java void b83693.A.m(int) [m(i)] EXACT_MATCH OUTSIDE_JAVADOC"
- );
-}
-
-/**
- * Bug 83716: [search] refs to 2-arg constructor on Action found unexpected matches
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83716"
- *
- * Note that this test does verify that bug is really fixed, but only that it has no impact
- * on existing behavior. It was not really possible to put a test in this suite to verify that
- * bug is effectively fixed as it appears only to potential match found in plugin dependencies...
- */
-public void testBug83716() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83716/X.js",
- "package b83716;\n" +
- "public class X {\n" +
- " X() {}\n" +
- " X(int x) {}\n" +
- "}\n" +
- "class Y extends X {\n" +
- " Y(int y) {\n" +
- " }\n" +
- "}"
- );
- search("X", CONSTRUCTOR, REFERENCES);
- assertSearchResults(
- "src/b83716/X.java b83716.Y(int) [Y] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 84100: [1.5][search] Search for varargs method not finding match
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84100"
- */
-private void setUpBug84100() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84100/X.js",
- "package b84100;\n" +
- "public class X {\n" +
- " void foo() {}\n" +
- " void foo(String s) {}\n" +
- " void foo(String... xs) {}\n" +
- " void foo(int x, String... xs) {}\n" +
- " void foo(String s, int x, String... xs) {}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b84100/Z.js",
- "package b84100;\n" +
- "public class Z {\n" +
- " X x;\n" +
- " void foo() {\n" +
- " x.foo();\n" +
- " x.foo(\"\");\n" +
- " x.foo(\"\", \"\");\n" +
- " x.foo(\"\", \"\", null);\n" +
- " x.foo(3, \"\", \"\");\n" +
- " x.foo(\"\", 3, \"\", \"\");\n" +
- " }\n" +
- "}\n"
- );
-}
-public void testBug84100() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84100();
- IFunction method = selectMethod(workingCopies[0], "foo", 1);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84100/Z.java void b84100.Z.foo() [foo()] EXACT_MATCH"
- );
-}
-public void testBug84100b() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84100();
- IFunction method = selectMethod(workingCopies[0], "foo", 2);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84100/Z.java void b84100.Z.foo() [foo(\"\")] EXACT_MATCH"
- );
-}
-public void testBug84100c() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84100();
- IFunction method = selectMethod(workingCopies[0], "foo", 3);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84100/Z.java void b84100.Z.foo() [foo(\"\", \"\")] EXACT_MATCH\n" +
- "src/b84100/Z.java void b84100.Z.foo() [foo(\"\", \"\", null)] EXACT_MATCH"
- );
-}
-public void testBug84100d() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84100();
- IFunction method = selectMethod(workingCopies[0], "foo", 4);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84100/Z.java void b84100.Z.foo() [foo(3, \"\", \"\")] EXACT_MATCH"
- );
-}
-public void testBug84100e() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84100();
- IFunction method = selectMethod(workingCopies[0], "foo", 5);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84100/Z.java void b84100.Z.foo() [foo(\"\", 3, \"\", \"\")] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 84121: [1.5][search][varargs] reference to type reported as inaccurate in vararg
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84121"
- */
-public void testBug84121() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84121/Test.js",
- "package b84121;\n" +
- "public class Test {\n" +
- " void foo(Test... t) {}\n" +
- " void foo(int x, Test... t) {}\n" +
- " void foo(Test[] t1, Test... t2) {}\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("Test");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b84121/Test.java void b84121.Test.foo(Test ...) [Test] EXACT_MATCH\n" +
- "src/b84121/Test.java void b84121.Test.foo(int, Test ...) [Test] EXACT_MATCH\n" +
- "src/b84121/Test.java void b84121.Test.foo(Test[], Test ...) [Test] EXACT_MATCH\n" +
- "src/b84121/Test.java void b84121.Test.foo(Test[], Test ...) [Test] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 84724: [1.5][search] Search for varargs method not finding match
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84724"
- */
-private void setUpBug84724() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84724/X.js",
- "package b84724;\n" +
- "public class X {\n" +
- " X(String s) {}\n" +
- " X(String... v) {}\n" +
- " X(int x, String... v) {}\n" +
- " X(String s, int x, String... v) {}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b84724/Z.js",
- "package b84724;\n" +
- "public class Z {\n" +
- " void foo() {\n" +
- " new X();\n" +
- " new X(\"\");\n" +
- " new X(\"\", \"\");\n" +
- " new X(\"\", \"\", null);\n" +
- " new X(3, \"\", \"\");\n" +
- " new X(\"\", 3, \"\", \"\");\n" +
- " }\n" +
- "}\n"
- );
-}
-public void testBug84724() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84724();
- IFunction method = selectMethod(workingCopies[0], "X", 2);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84724/Z.java void b84724.Z.foo() [new X(\"\")] EXACT_MATCH"
- );
-}
-public void testBug84724b() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84724();
- IFunction method = selectMethod(workingCopies[0], "X", 3);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84724/Z.java void b84724.Z.foo() [new X()] EXACT_MATCH\n" +
- "src/b84724/Z.java void b84724.Z.foo() [new X(\"\", \"\")] EXACT_MATCH\n" +
- "src/b84724/Z.java void b84724.Z.foo() [new X(\"\", \"\", null)] EXACT_MATCH"
- );
-}
-public void testBug84724c() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84724();
- IFunction method = selectMethod(workingCopies[0], "X", 4);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84724/Z.java void b84724.Z.foo() [new X(3, \"\", \"\")] EXACT_MATCH"
- );
-}
-public void testBug84724d() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84724();
- IFunction method = selectMethod(workingCopies[0], "X", 5);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b84724/Z.java void b84724.Z.foo() [new X(\"\", 3, \"\", \"\")] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 84727: [1.5][search] String pattern search does not work with multiply nested types
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=84727"
- */
-private void setUpBug84727() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b84727/A.js",
- "package b84727;\n" +
- "public interface A {\n" +
- " Set<Set<Exception>> getXYZ(List<Set<Exception>> arg);\n" +
- " void getXYZ(String s);\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b84727/X.js",
- "package b84727;\n" +
- "public class X {\n" +
- " A a;\n" +
- " void foo() {\n" +
- " a.getXYZ(new ArrayList());\n" +
- " a.getXYZ(\"\");\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b84727/List.js",
- "package b84727;\n" +
- "public interface List<E> {}\n" +
- "interface Set<E> {}\n" +
- "class ArrayList<E> implements List<E> {}"
- );
-}
-public void testBug84727() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84727();
- IFunction[] methods = workingCopies[0].getType("A").getFunctions();
- assertEquals("Invalid number of methods", 2, methods.length);
- search(methods[0], REFERENCES);
- assertSearchResults(
- "src/b84727/X.java void b84727.X.foo() [getXYZ(new ArrayList())] EXACT_MATCH"
- );
-}
-public void testBug84727b() throws CoreException {
- resultCollector.showRule = true;
- setUpBug84727();
- IFunction[] methods = workingCopies[0].getType("A").getFunctions();
- assertEquals("Invalid number of methods", 2, methods.length);
- search(methods[1], REFERENCES);
- assertSearchResults(
- "src/b84727/X.java void b84727.X.foo() [getXYZ(\"\")] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 86596: [search] Search for type finds segments in import
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86596"
- */
-public void testBug86596() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86596/aa/link/A.js",
- "package b86596.aa.link;\n" +
- "public interface A {}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b86596/bb/Link.js",
- "package b86596.bb;\n" +
- "public class Link{}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b86596/cc/X.js",
- "package b86596.cc;\n" +
- "import b86596.aa.link.A;\n" +
- "import b86596.bb.Link;\n" +
- "public class X {\n" +
- " A a;\n" +
- " Link l;\n" +
- "}\n"
- );
- search("Link", TYPE, REFERENCES, SearchPattern.R_EXACT_MATCH);
- assertSearchResults(
- "src/b86596/cc/X.java [Link] EXACT_RAW_MATCH\n" +
- "src/b86596/cc/X.java b86596.cc.X.l [Link] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 86642: [search] no match found of package-visible supertypes in subtypes
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86642"
- */
-public void testBug86642() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86642/A.js",
- "package b86642;\n" +
- "class A {\n" +
- " public void m() {}\n" +
- " protected void f(A a){}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b86642/B.js",
- "package b86642;\n" +
- "public class B extends A{\n" +
- " protected void f(A a){\n" +
- " a.m();\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("A");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b86642/A.java void b86642.A.f(A) [A] EXACT_MATCH\n" +
- "src/b86642/B.java b86642.B [A] EXACT_MATCH\n" +
- "src/b86642/B.java void b86642.B.f(A) [A] EXACT_MATCH"
- );
-}
-/**
- * Bug 86293: [search] Search for method declaration with pattern "run()" reports match in binary field instead of anonymous class
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86293"
- */
-public void testBug86293() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b86293.jar", "", "I86293.class").getType();
- IFunction method = type.getFunction("m86293", new String[0]);
- search(method, DECLARATIONS);
- assertSearchResults(
- "lib/b86293.jar void <anonymous>.m86293() EXACT_MATCH\n" +
- "lib/b86293.jar void I86293.m86293() EXACT_MATCH"
- );
-}
-
-/**
- * Bug 86380: [1.5][search][annot] Add support to find references inside annotations on a package declaration
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86380"
- */
-private void setUpBug86380() throws CoreException {
- resultCollector.showInsideDoc = true;
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b86380/package-info.js",
- "/**\n" +
- " * @see Annot#field\n" +
- " */\n" +
- "@Annot(value=11)\n" +
- "package b86380;\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b86380/Test.js",
- "package b86380;\n" +
- "@Annot(12) public class Test {\n" +
- " public int field = Annot.field;\n" +
- " public void foo() {}\n" +
- "}\n"
- );
-}
-public void testBug86380_Type() throws CoreException {
- resultCollector.showInsideDoc = true;
- setUpBug86380();
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.js");
- IType type = unit.getType("Annot");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b86380/Test.java b86380.Test [Annot] EXACT_MATCH OUTSIDE_JAVADOC\n" +
- "src/b86380/Test.java b86380.Test.field [Annot] EXACT_MATCH OUTSIDE_JAVADOC\n" +
- "src/b86380/package-info.java [Annot] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b86380/package-info.java [Annot] EXACT_MATCH OUTSIDE_JAVADOC"
- );
-}
-public void testBug86380_Method() throws CoreException {
- resultCollector.showInsideDoc = true;
- setUpBug86380();
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.js");
- IFunction[] methods = unit.getType("Annot").getFunctions();
- assertEquals("Invalid number of methods", 1, methods.length);
- search(methods[0], REFERENCES);
- assertSearchResults(
- "src/b86380/Test.java b86380.Test [12] EXACT_MATCH OUTSIDE_JAVADOC\n" +
- "src/b86380/package-info.java [value] EXACT_MATCH OUTSIDE_JAVADOC"
- );
-}
-public void testBug86380_Field() throws CoreException {
- resultCollector.showInsideDoc = true;
- setUpBug86380();
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b86380", "Annot.js");
- IField[] fields = unit.getType("Annot").getFields();
- assertEquals("Invalid number of fields", 1, fields.length);
- search(fields[0], REFERENCES);
- assertSearchResults(
- "src/b86380/Test.java b86380.Test.field [field] EXACT_MATCH OUTSIDE_JAVADOC\n" +
- "src/b86380/package-info.java [field] EXACT_MATCH INSIDE_JAVADOC"
- );
-}
-
-/**
- * Bug 88174: [1.5][search][annot] Search for annotations misses references in default and values constructs
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174"
- */
-public void testBug88174() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b88174/Test.js",
- "package b88174;\n" +
- "public enum Test {\n" +
- " a {\n" +
- " int getTheValue() { // not found\n" +
- " return 0;\n" +
- " }\n" +
- " };\n" +
- " abstract int getTheValue();\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b88174/X.js",
- "package b88174;\n" +
- "public class X {\n" +
- " X x = new X() {\n" +
- " int getTheValue() {\n" +
- " return 0;\n" +
- " }\n" +
- " };\n" +
- " int getTheValue() { return 0; }\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Test").getFunction("getTheValue", new String[0]);
- search(method, DECLARATIONS | IGNORE_DECLARING_TYPE);
- assertSearchResults(
- "src/b88174/Test.java int b88174.Test.a:<anonymous>#1.getTheValue() [getTheValue] EXACT_MATCH\n" +
- "src/b88174/Test.java int b88174.Test.getTheValue() [getTheValue] EXACT_MATCH\n" +
- "src/b88174/X.java int b88174.X.x:<anonymous>#1.getTheValue() [getTheValue] EXACT_MATCH\n" +
- "src/b88174/X.java int b88174.X.getTheValue() [getTheValue] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 88300: [search] Reference search result is changed by placement of private method
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=88300"
- */
-public void testBug88300() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b88300/SubClass.js",
- "package b88300;\n" +
- "public class SubClass extends SuperClass {\n" +
- " private void aMethod(String x) {\n" +
- " }\n" +
- " public void aMethod(Object x) {\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b88300/SuperClass.js",
- "package b88300;\n" +
- "public class SuperClass {\n" +
- " public void aMethod(Object x) {\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b88300/User.js",
- "package b88300;\n" +
- "public class User {\n" +
- " public void methodUsingSubClassMethod() {\n" +
- " SuperClass user = new SubClass();\n" +
- " user.aMethod(new Object());\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("SubClass");
- search(type.getFunctions()[1], REFERENCES);
- assertSearchResults(
- "src/b88300/User.java void b88300.User.methodUsingSubClassMethod() [aMethod(new Object())] EXACT_MATCH"
- );
-}
-public void testBug88300b() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b88300/SubClass.js",
- "package b88300;\n" +
- "public class SubClass extends SuperClass {\n" +
- " public void aMethod(Object x) {\n" +
- " }\n" +
- " private void aMethod(String x) {\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b88300/SuperClass.js",
- "package b88300;\n" +
- "public class SuperClass {\n" +
- " public void aMethod(Object x) {\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b88300/User.js",
- "package b88300;\n" +
- "public class User {\n" +
- " public void methodUsingSubClassMethod() {\n" +
- " SuperClass user = new SubClass();\n" +
- " user.aMethod(new Object());\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("SubClass");
- search(type.getFunctions()[0], REFERENCES);
- assertSearchResults(
- "src/b88300/User.java void b88300.User.methodUsingSubClassMethod() [aMethod(new Object())] EXACT_MATCH"
- );
-}
-public void testBug88300c() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b88300/not/fixed/ConditionalFlowInfo.js",
- "package b88300.not.fixed;\n" +
- "public class ConditionalFlowInfo extends FlowInfo {\n" +
- " public FlowInfo info;\n" +
- " ConditionalFlowInfo(FlowInfo info){\n" +
- " this.info = info;\n" +
- " }\n" +
- " public void markAsDefinitelyNull(FieldBinding field) {\n" +
- " info.markAsDefinitelyNull(field);\n" +
- " }\n" +
- " public void markAsDefinitelyNull(LocalVariableBinding local) {\n" +
- " info.markAsDefinitelyNull(local);\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b88300/not/fixed/FlowInfo.js",
- "package b88300.not.fixed;\n" +
- "\n" +
- "class FieldBinding {\n" +
- " int id;\n" +
- "}\n" +
- "class LocalVariableBinding extends FieldBinding {}\n" +
- "\n" +
- "public abstract class FlowInfo {\n" +
- " abstract public void markAsDefinitelyNull(LocalVariableBinding local);\n" +
- " abstract public void markAsDefinitelyNull(FieldBinding field);\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b88300/not/fixed/UnconditionalFlowInfo.js",
- "package b88300.not.fixed;\n" +
- "public class UnconditionalFlowInfo extends FlowInfo {\n" +
- " final private void markAsDefinitelyNull(int position) {}\n" +
- " public void markAsDefinitelyNull(FieldBinding field) {\n" +
- " markAsDefinitelyNull(field.id);\n" +
- " }\n" +
- " public void markAsDefinitelyNull(LocalVariableBinding local) {\n" +
- " markAsDefinitelyNull(local.id + 1);\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[2].getType("UnconditionalFlowInfo");
- search(type.getFunctions()[2], REFERENCES);
- assertSearchResults(
- "src/b88300/not/fixed/ConditionalFlowInfo.java void b88300.not.fixed.ConditionalFlowInfo.markAsDefinitelyNull(LocalVariableBinding) [markAsDefinitelyNull(local)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 89686: [1.5][search] JavaScriptModelException on ResolvedSourceMethod during refactoring
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=89686"
- */
-public void testBug89686() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b89686/A.js",
- "package b89686;\n" +
- "public enum Color {\n" +
- " RED, GREEN(), BLUE(17), PINK((1+(1+1))) {/*anon*/};\n" +
- " Color() {}\n" +
- " Color(int i) {}\n" +
- "}"
- );
- IType type = workingCopies[0].getType("Color");
- IFunction method = type.getFunction("Color", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/b89686/A.java b89686.Color.RED [RED] EXACT_MATCH\n" +
- "src/b89686/A.java b89686.Color.GREEN [GREEN()] EXACT_MATCH"
- );
-}
-public void testBug89686b() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b89686/A.js",
- "package b89686;\n" +
- "public enum Color {\n" +
- " RED, GREEN(), BLUE(17), PINK((1+(1+1))) {/*anon*/};\n" +
- " Color() {}\n" +
- " Color(int i) {}\n" +
- "}"
- );
- IType type = workingCopies[0].getType("Color");
- IFunction method = type.getFunction("Color", new String[] { "I"} );
- search(method, REFERENCES);
- assertSearchResults(
- "src/b89686/A.java b89686.Color.BLUE [BLUE(17)] EXACT_MATCH\n" +
- "src/b89686/A.java b89686.Color.PINK [PINK((1+(1+1)))] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 89848: [search] does not find method references in anonymous class of imported jarred plugin
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=89848"
- */
-public void testBug89848() throws CoreException {
- IType classFile = getClassFile("JavaSearchBugs", "lib", "b89848", "X.class").getType();
- IFunction method = classFile.getFunction("foo", new String[0]);
- search(method, ALL_OCCURRENCES);
- assertSearchResults(
- "lib/b89848/Test.class void b89848.Test.foo() EXACT_MATCH\n" +
- "lib/b89848/X.class void b89848.X.foo() EXACT_MATCH"
- );
-}
-
-/**
- * Bug 90779: [search] Constructor Declaration search with ignoring declaring and return type also ignores type name
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=90779"
- */
-public void testBug90779() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b90779/A.js",
- "package b90779;\n" +
- "public class A {\n" +
- " public A() {}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b90779/B.js",
- "package b90779;\n" +
- "public class B {\n" +
- " public B() {}\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b90779/C.js",
- "package b90779;\n" +
- "public class C {\n" +
- " public C() {}\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("A");
- IFunction[] methods = type.getFunctions();
- assertEquals("Wrong number of methods", 1, methods.length);
- search(methods[0], DECLARATIONS | IGNORE_DECLARING_TYPE | IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b90779/A.java b90779.A() [A] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 90915: [1.5][search] NPE in PatternLocator
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=90915"
- */
-public void testBug90915() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b90915/X.js",
- "package b90915;\n" +
- "import g5.m.def.Single;\n" +
- "public class X<T> {\n" +
- " void foo() {\n" +
- " Single<String> single = new Single<String>() {\n" +
- " public <U> String generic(U u) { return \"\"; }\n" +
- " public void paramTypesArgs(Single<String> gs) {}\n" +
- " };\n" +
- " single.paramTypesArgs(null);\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("X");
- IFunction[] methods = type.getFunctions();
- assertEquals("Wrong number of methods", 1, methods.length);
- IType anonymous = methods[0].getType("", 1);
- assertNotNull("Cannot find anonymous in method foo()", anonymous);
- methods = anonymous.getFunctions();
- assertEquals("Wrong number of methods", 2, methods.length);
- search(methods[1], REFERENCES);
- assertSearchResults(
- "src/b90915/X.java void b90915.X.foo() [paramTypesArgs(null)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 91542: [1.5][search] JavaScriptModelException on ResolvedSourceMethod during refactoring
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=91542"
- */
-public void testBug91542() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b91542/A.js",
- "package b91542;\n" +
- "\n" +
- "class A<T> {\n" +
- " void a(A<T> a){}\n" +
- "}\n" +
- "\n" +
- "class B<T> extends A<T> {\n" +
- " protected void foo() { \n" +
- " a(this);\n" +
- " }\n" +
- "}"
- );
- IType type = workingCopies[0].getType("B");
- IFunction method = type.getFunction("foo", new String[0]);
- searchDeclarationsOfSentMessages(method, this.resultCollector);
- assertSearchResults(
- "src/b91542/A.java void b91542.A.a(A<T>) [a(A<T> a)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 91078: [search] Java search for package reference wrongly identifies inner class as package
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=91078"
- */
-public void testBug91078() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b91078/test/Example.js",
- "package b91078.test;\n" +
- "import b91078.util.HashMap;\n" +
- "import b91078.util.Map;\n" +
- "public class Example {\n" +
- " public Map.Entry logAll(Object obj) {\n" +
- " if (obj instanceof b91078.util.HashMap) {\n" +
- " HashMap map = (HashMap) obj;\n" +
- " return map.entry;\n" +
- " }\n" +
- " if (obj instanceof b91078.util.HashMap.Entry) {\n" +
- " Map.Entry entry = (Map.Entry) obj;\n" +
- " return entry;\n" +
- " }\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b91078/util/HashMap.js",
- "package b91078.util;\n" +
- "public class HashMap implements Map {\n" +
- " public Entry entry;\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b91078/util/Map.js",
- "package b91078.util;\n" +
- "public interface Map {\n" +
- " class Entry{}\n" +
- "}\n"
- );
- search("*", PACKAGE, REFERENCES, getJavaSearchWorkingCopiesScope(workingCopies[0]));
- assertSearchResults(
- "src/b91078/test/Example.java [b91078.util] EXACT_MATCH\n" +
- "src/b91078/test/Example.java [b91078.util] EXACT_MATCH\n" +
- "src/b91078/test/Example.java Map.Entry b91078.test.Example.logAll(Object) [b91078.util] EXACT_MATCH\n" +
- "src/b91078/test/Example.java Map.Entry b91078.test.Example.logAll(Object) [b91078.util] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 92264: [search] all types names should support patterns for package/enclosing type name
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=92264"
- */
-public void testBug92264a() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- "*.lang".toCharArray(),
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- IIndexConstants.ONE_STAR,
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "java.lang.CharSequence\n" +
- "java.lang.Class\n" +
- "java.lang.CloneNotSupportedException\n" +
- "java.lang.Comparable\n" +
- "java.lang.Enum\n" +
- "java.lang.Error\n" +
- "java.lang.Exception\n" +
- "java.lang.IllegalMonitorStateException\n" +
- "java.lang.InterruptedException\n" +
- "java.lang.Object\n" +
- "java.lang.RuntimeException\n" +
- "java.lang.String\n" +
- "java.lang.Throwable",
- requestor);
-}
-public void testBug92264b() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- "*.lang*".toCharArray(),
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- "*tion".toCharArray(),
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "java.lang.CloneNotSupportedException\n" +
- "java.lang.Exception\n" +
- "java.lang.IllegalMonitorStateException\n" +
- "java.lang.InterruptedException\n" +
- "java.lang.RuntimeException\n" +
- "java.lang.annotation.Annotation",
- requestor);
-}
-public void testBug92264c() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- "*.test*".toCharArray(),
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- IIndexConstants.ONE_STAR,
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "Test$Inner\n" +
- "b123679.test.Test\n" +
- "b123679.test.Test$StaticClass\n" +
- "b123679.test.Test$StaticClass$Member\n" +
- "b124645.test.A_124645\n" +
- "b124645.test.X_124645\n" +
- "b127628.Test127628$Member127628\n" +
- "b95794.Test$Color\n" +
- "pack.age.Test$Member\n" +
- "test.Test$StaticClass\n" +
- "test.Test$StaticClass$Member",
- requestor);
-}
-public void testBug92264d() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- "b12*".toCharArray(),
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- new char[] { 'X' },
- SearchPattern.R_PREFIX_MATCH, // case insensitive
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b124645.test.X_124645\n" +
- "b124645.xy.X_124645",
- requestor);
-}
-
-/**
- * Bug 92944: [1.5][search] SearchEngine#searchAllTypeNames doesn't honor enum or annotation element kind
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=92944"
- */
-private void setUpBug92944() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b92944/Test.js",
- "package b92944;\n" +
- "interface B92944_I {}\n" +
- "enum B92944_E {}\n" +
- "@interface B92944_A {}\n" +
- "public class B92944 {}\n"
- );
-}
-public void testBug92944_TYPE() throws CoreException {
- resultCollector.showRule = true;
- setUpBug92944();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- TYPE,
- getJavaSearchScopeBugs("b92944", true),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b92944.B92944\n" +
- "b92944.B92944_A\n" +
- "b92944.B92944_E\n" +
- "b92944.B92944_I",
- requestor);
-}
-public void testBug92944_CLASS() throws CoreException {
- resultCollector.showRule = true;
- setUpBug92944();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- IIndexConstants.ONE_STAR,
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- CLASS,
- getJavaSearchWorkingCopiesScope(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- // Remove interface, enum and annotation
- assertSearchResults(
- "Unexpected all type names",
- "b92944.B92944",
- requestor);
-}
-
-/**
- * Bug 93392: [1.5][search][annot] search for annotation elements does not seem to be implemented yet
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=93392"
- *
- * Note that this test valid also:
- * Bug 94062: [1.5][search][annot] search for annotation elements incorrect match range
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=94062"
- */
-public void testBug93392() throws CoreException {
- TestCollector collector = new TestCollector();
- collector.showAccuracy = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b93392/Test.js",
- "package b93392;\n" +
- "@interface Annot {\n" +
- " int value();\n" +
- "}\n" +
- "@Annot(41)\n" +
- "public class Test {\n" +
- " @Annot(21)\n" +
- " int bar;\n" +
- " @Annot(10)\n" +
- " public void foo() {}\n" +
- "}\n"
- );
- IType type = selectType(workingCopies[0], "Annot");
- IFunction method = type.getFunction("value", new String[0]);
- search(method, REFERENCES, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b93392/Test.java b93392.Test [41] EXACT_MATCH\n" +
- "src/b93392/Test.java b93392.Test.bar [21] EXACT_MATCH\n" +
- "src/b93392/Test.java void b93392.Test.foo() [10] EXACT_MATCH",
- collector
- );
- // Verify matches positions
- String source = workingCopies[0].getSource();
- String str = "@Annot(";
- // First match
- assertEquals("Invalid number of matches", 3, collector.matches.size());
- int index= source.indexOf(str)+str.length();
- assertEquals("Invalid offset for first match", index, ((SearchMatch)collector.matches.get(0)).getOffset());
- assertEquals("Invalid length for first match", 2, ((SearchMatch)collector.matches.get(0)).getLength());
- // Second match
- index= source.indexOf(str, index)+str.length();
- assertEquals("Invalid offset for second match", index, ((SearchMatch)collector.matches.get(1)).getOffset());
- assertEquals("Invalid length for second match", 2, ((SearchMatch)collector.matches.get(1)).getLength());
- // Last match
- index= source.indexOf(str, index)+str.length();
- assertEquals("Invalid offset for last match", index, ((SearchMatch)collector.matches.get(2)).getOffset());
- assertEquals("Invalid length for last match", 2, ((SearchMatch)collector.matches.get(2)).getLength());
-}
-
-/**
- * Bug 94160: [1.5][search] Generic method in superclass does not exist
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=94160"
- */
-public void testBug94160() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b94160/Test.js",
- "package b94160;\n" +
- "public class Test {\n" +
- " <T> List<T> generateList(Class<T> clazz) {\n" +
- " return new ArrayList<T>();\n" +
- " }\n" +
- "}\n" +
- "class CTest extends Test {\n" +
- " private List<String> myList = generateList(String.class);\n" +
- " CTest() {\n" +
- " myList = new ArrayList<String>();\n" +
- " }\n" +
- "}\n" +
- "interface List<E> {}\n" +
- "class ArrayList<E> implements List<E> {}"
- );
- IType type = workingCopies[0].getType("CTest");
- IField field = type.getField("myList");
- new SearchEngine(this.workingCopies).searchDeclarationsOfSentMessages(field, resultCollector, null);
- assertSearchResults(
- "src/b94160/Test.java List<T> b94160.Test.generateList(Class<T>) [generateList(Class<T> clazz)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 94389: [search] InvocationTargetException on Rename
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=94389"
- */
-public void testBug94389() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b94389/Test.js",
- "package b94389;\n" +
- "public class Test {\n" +
- " public void foo() {}\n" +
- " public void foo() {}\n" +
- " public void foo() {}\n" +
- " public void foo() {}\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("Test");
- IFunction[] methods = type.getFunctions();
- int methodsLength = methods.length;
-
- // Perform search on each duplicate method
- IJavaScriptSearchScope scope = getJavaSearchScopeBugs();
- for (int m=0; m<methodsLength; m++) {
-
- // Search method declaration
- TestCollector collector = new TestCollector();
- search(methods[m], DECLARATIONS, scope, collector);
- assertSearchResults(
- "src/b94389/Test.java void b94389.Test.foo() [foo]\n" +
- "src/b94389/Test.java void b94389.Test.foo() [foo]\n" +
- "src/b94389/Test.java void b94389.Test.foo() [foo]\n" +
- "src/b94389/Test.java void b94389.Test.foo() [foo]",
- collector
- );
-
- // Verify that all matches have correct occurence count
- int size = collector.matches.size();
- for (int i=0; i<size; i++) {
- assertEquals("Invalid foo method occurence count (m="+(m+1)+")", i+1, ((SourceMethod) methods[i]).occurrenceCount);
- }
- }
-}
-
-/**
- * Bug 94718: [1.5][search][annot] Find references in workspace breaks on an annotation
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=94718"
- */
-public void testBug94718() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b94718/SetUp.js",
- "package b94718;\n" +
- "public @interface SetUp {\n" +
- " String value() {}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b94718/Test.js",
- "package b94718;\n" +
- "@SetUp(\"howdy\")\n" +
- "public class Test {\n" +
- "}\n"
- );
- IType type = workingCopies[1].getType("SetUp");
- search(type, REFERENCES, SearchEngine.createWorkspaceScope());
- assertSearchResults(
- "src/b94718/Test.java b94718.Test [SetUp] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 95152: [search] Field references not found when type is a qualified member type [regression]
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=95152"
- */
-public void testBug95152_jar01() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T1$T12.class").getType();
- // search constructor first level member
- search(type.getFunctions()[0], REFERENCES);
- type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T1$T12$T13.class").getType();
- // search constructor second level member
- search(type.getFunctions()[0], REFERENCES);
- assertSearchResults(
- "lib/b95152.jar b95152.T1() EXACT_MATCH\n" +
- "lib/b95152.jar b95152.T1() EXACT_MATCH"
- );
-}
-public void testBug95152_jar02() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T2$T22.class").getType();
- // search constructor first level member
- search(type.getFunctions()[0], REFERENCES);
- type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T2$T22$T23.class").getType();
- // search constructor second level member
- search(type.getFunctions()[0], REFERENCES);
- assertSearchResults(
- "lib/b95152.jar b95152.T2(int) EXACT_MATCH\n" +
- "lib/b95152.jar b95152.T2(int) EXACT_MATCH"
- );
-}
-public void testBug95152_jar03() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T3$T32.class").getType();
- // search constructor first level member
- search(type.getFunctions()[0], REFERENCES);
- type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T3$T32$T33.class").getType();
- // search constructor second level member
- search(type.getFunctions()[0], REFERENCES);
- assertSearchResults(
- "lib/b95152.jar b95152.T3(b95152.T3) EXACT_MATCH\n" +
- "lib/b95152.jar b95152.T3(b95152.T3) EXACT_MATCH"
- );
-}
-public void testBug95152_jar04() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T4$T42.class").getType();
- // search constructor first level member
- search(type.getFunctions()[0], REFERENCES);
- type = getPackageFragment("JavaSearchBugs", "lib/b95152.jar", "b95152").getClassFile("T4$T42$T43.class").getType();
- // search constructor second level member
- search(type.getFunctions()[0], REFERENCES);
- assertSearchResults(
- "lib/b95152.jar b95152.T4(b95152.T4, java.lang.String) EXACT_MATCH\n" +
- "lib/b95152.jar b95152.T4(b95152.T4, java.lang.String) EXACT_MATCH"
- );
-}
-public void testBug95152_wc01() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b95152/T.js",
- "package b95152;\n" +
- "public class T {\n" +
- " T2 c2;\n" +
- " T2.T3 c3;\n" +
- " T() {\n" +
- " c2 = new T2();\n" +
- " c3 = c2.new T3();\n" +
- " }\n" +
- " class T2 {\n" +
- " T2() {}\n" +
- " class T3 {\n" +
- " T3() {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- // search constructor first level member
- IType type = workingCopies[0].getType("T").getType("T2");
- search(type.getFunctions()[0], REFERENCES);
- // search constructor second level member
- type = type.getType("T3");
- search(type.getFunctions()[0], REFERENCES);
- // verify searches results
- assertSearchResults(
- "src/b95152/T.java b95152.T() [new T2()] EXACT_MATCH\n" +
- "src/b95152/T.java b95152.T() [c2.new T3()] EXACT_MATCH"
- );
-}
-public void testBug95152_wc02() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b95152/T.js",
- "package b95152;\n" +
- "public class T {\n" +
- " T2 c2;\n" +
- " T2.T3 c3;\n" +
- " T(int c) {\n" +
- " c2 = new T2(c);\n" +
- " c3 = c2.new T3(c);\n" +
- " }\n" +
- " class T2 {\n" +
- " T2(int x) {}\n" +
- " class T3 {\n" +
- " T3(int x) {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- // search constructor first level member
- IType type = workingCopies[0].getType("T").getType("T2");
- search(type.getFunctions()[0], REFERENCES);
- // search constructor second level member
- type = type.getType("T3");
- search(type.getFunctions()[0], REFERENCES);
- // verify searches results
- assertSearchResults(
- "src/b95152/T.java b95152.T(int) [new T2(c)] EXACT_MATCH\n" +
- "src/b95152/T.java b95152.T(int) [c2.new T3(c)] EXACT_MATCH"
- );
-}
-public void testBug95152_wc03() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b95152/T.js",
- "package b95152;\n" +
- "public class T {\n" +
- " T2 c2;\n" +
- " T2.T3 c3;\n" +
- " T(T c) {\n" +
- " c2 = new T2(c);\n" +
- " c3 = c2.new T3(c2);\n" +
- " }\n" +
- " class T2 {\n" +
- " T2(T c) {}\n" +
- " class T3 {\n" +
- " T3(T2 c) {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- // search constructor first level member
- IType type = workingCopies[0].getType("T").getType("T2");
- search(type.getFunctions()[0], REFERENCES);
- // search constructor second level member
- type = type.getType("T3");
- search(type.getFunctions()[0], REFERENCES);
- // verify searches results
- assertSearchResults(
- "src/b95152/T.java b95152.T(T) [new T2(c)] EXACT_MATCH\n" +
- "src/b95152/T.java b95152.T(T) [c2.new T3(c2)] EXACT_MATCH"
- );
-}
-public void testBug95152_wc04() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b95152/T.js",
- "package b95152;\n" +
- "public class T {\n" +
- " T2 c2;\n" +
- " T2.T3 c3;\n" +
- " T(T c, String str) {\n" +
- " c2 = new T2(c, str);\n" +
- " c3 = c2.new T3(c2, str);\n" +
- " }\n" +
- " class T2 {\n" +
- " T2(T c, String str) {}\n" +
- " class T3 {\n" +
- " T3(T2 c, String str) {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- // search constructor first level member
- IType type = workingCopies[0].getType("T").getType("T2");
- search(type.getFunctions()[0], REFERENCES);
- // search constructor second level member
- type = type.getType("T3");
- search(type.getFunctions()[0], REFERENCES);
- // verify searches results
- assertSearchResults(
- "src/b95152/T.java b95152.T(T, String) [new T2(c, str)] EXACT_MATCH\n" +
- "src/b95152/T.java b95152.T(T, String) [c2.new T3(c2, str)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 95794: [1.5][search][annot] Find references in workspace breaks on an annotation
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=95794"
- */
-public void testBug95794() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b95794", "Test.js");
- IType type = unit.getType("Test");
-
- // Verify matches
- TestCollector occurencesCollector = new TestCollector();
- occurencesCollector.showAccuracy = true;
- search(type, ALL_OCCURRENCES, getJavaSearchScopeBugs(), occurencesCollector);
- assertSearchResults(
- "src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" +
- "src/b95794/Test.java [b95794.Test] EXACT_MATCH\n" +
- "src/b95794/Test.java b95794.Test [Test] EXACT_MATCH\n" +
- "src/b95794/Test.java b95794.Test.there [Test] EXACT_MATCH",
- occurencesCollector
- );
-
- // Verify with references matches
- TestCollector referencesCollector = new TestCollector();
- search(type, REFERENCES, getJavaSearchScopeBugs(), referencesCollector);
- assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size());
-}
-public void testBug95794b() throws CoreException {
- resultCollector.showRule = true;
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b95794", "Test.js");
- IType type = unit.getType("Test").getType("Color");
-
- // Verify matches
- TestCollector occurencesCollector = new TestCollector();
- occurencesCollector.showAccuracy = true;
- search(type, ALL_OCCURRENCES, getJavaSearchScopeBugs(), occurencesCollector);
- assertSearchResults(
- "src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" +
- "src/b95794/Test.java [b95794.Test.Color] EXACT_MATCH\n" +
- "src/b95794/Test.java void b95794.Test.main(String[]) [Color] EXACT_MATCH\n" +
- "src/b95794/Test.java b95794.Test$Color [Color] EXACT_MATCH",
- occurencesCollector
- );
-
- // Verify with references matches
- TestCollector referencesCollector = new TestCollector();
- search(type, REFERENCES, getJavaSearchScopeBugs(), referencesCollector);
- assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size());
-}
-public void testBug95794c() throws CoreException {
- resultCollector.showRule = true;
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b95794", "Test.js");
- IField field = unit.getType("Test").getType("Color").getField("WHITE");
-
- // Verify matches
- TestCollector occurencesCollector = new TestCollector();
- occurencesCollector.showAccuracy = true;
- search(field, ALL_OCCURRENCES, getJavaSearchScopeBugs(), occurencesCollector);
- assertSearchResults(
- "src/b95794/Test.java [WHITE] EXACT_MATCH\n" +
- "src/b95794/Test.java void b95794.Test.main(String[]) [WHITE] EXACT_MATCH\n" +
- "src/b95794/Test.java b95794.Test$Color.WHITE [WHITE] EXACT_MATCH",
- occurencesCollector
- );
-
- // Verify with references matches
- TestCollector referencesCollector = new TestCollector();
- search(field, REFERENCES, getJavaSearchScopeBugs(), referencesCollector);
- assertEquals("Problem with occurences or references number of matches: ", occurencesCollector.matches.size()-1, referencesCollector.matches.size());
-}
-
-/**
- * Bug 96761: [1.5][search] Search for declarations of generic method finds non-overriding method
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=96761"
- */
-public void testBug96761() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b96761/Generic.js",
- "package b96761;\n" +
- "public class Generic<G> {\n" +
- " void take(G g) {\n" +
- " }\n" +
- "}\n" +
- "class Impl extends Generic<RuntimeException> {\n" +
- " void take(InterruptedException g) {\n" +
- " }\n" +
- " void take(RuntimeException g) {\n" +
- " }\n" +
- "}"
- );
- IType type = workingCopies[0].getType("Generic");
- IFunction method= type.getFunctions()[0];
- search(method, REFERENCES);
- assertSearchResults(""); // Expect no result
-}
-
-/**
- * Bug 96763: [1.5][search] Search for method declarations does not find overridden method with different signature
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96763"
- */
-public void testBug96763() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b96763/Test.js",
- "package b96763;\n" +
- "class Test<T> {\n" +
- " public void first(Exception num) {}\n" +
- " public void second(T t) {}\n" +
- "}\n" +
- "class Sub extends Test<Exception> {\n" +
- " public void first(Exception num) {}\n" +
- " public void second(Exception t) {}\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Sub").getFunctions()[0];
- search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b96763/Test.java void b96763.Test.first(Exception) [first] EXACT_MATCH\n" +
- "src/b96763/Test.java void b96763.Sub.first(Exception) [first] EXACT_MATCH"
- );
-}
-public void testBug96763b() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b96763/Test.js",
- "package b96763;\n" +
- "class Test<T> {\n" +
- " public void first(Exception num) {}\n" +
- " public void second(T t) {}\n" +
- "}\n" +
- "class Sub extends Test<Exception> {\n" +
- " public void first(Exception num) {}\n" +
- " public void second(Exception t) {}\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Sub").getFunctions()[1];
- search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b96763/Test.java void b96763.Test.second(T) [second] EXACT_MATCH\n" +
- "src/b96763/Test.java void b96763.Sub.second(Exception) [second] EXACT_MATCH"
- );
-}
-public void testBug96763c() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b96763/Test.js",
- "package b96763;\n" +
- "public class Test<T> {\n" +
- " void methodT(T t) {}\n" +
- "}\n" +
- "class Sub<X> extends Test<X> {\n" +
- " void methodT(X x) {} // overrides Super#methodT(T)\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Sub").getFunctions()[0];
- search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE);
- assertSearchResults(
- "src/b96763/Test.java void b96763.Test.methodT(T) [methodT] EXACT_MATCH\n" +
- "src/b96763/Test.java void b96763.Sub.methodT(X) [methodT] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 97087: [1.5][search] Can't find reference of generic class's constructor.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97087"
- */
-public void testBug97087() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- this.resultCollector.showRule = true;
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97087/Bug.js",
- "package b97087;\n" +
- "public class Bug<Type> {\n" +
- " Bug(){}\n" +
- "}\n" +
- "class Foo extends Bug<String>{\n" +
- " Foo(){}\n" +
- "}\n" +
- "class Bar extends Bug<Exception>{\n" +
- " Bar(){super();}\n" +
- "}"
- );
- IType type = workingCopies[0].getType("Bug");
- IFunction method= type.getFunctions()[0];
- search(method, REFERENCES, SearchPattern.R_ERASURE_MATCH);
- assertSearchResults(
- "src/b97087/Bug.java b97087.Foo() [Foo] EXACT_MATCH\n" +
- "src/b97087/Bug.java b97087.Bar() [super();] ERASURE_MATCH"
- );
-}
-
-/**
- * Bug 97120:
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97120"
- */
-public void testBug97120() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", getExternalJCLPathString("1.5"), "java.lang", "Throwable.class").getType();
- IJavaScriptSearchScope scope = SearchEngine.createHierarchyScope(type);
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "E*".toCharArray(),
- SearchPattern.R_PATTERN_MATCH,
- TYPE,
- scope,
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "java.lang.Error\n" +
- "java.lang.Exception",
- requestor
- );
-}
-
-/**
- * Bug 97322: [search] Search for method references sometimes reports potential match with differing argument count
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97322"
- */
-public void testBug97322() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97322/Test.js",
- "package b97322;\n" +
- "class Test {\n" +
- " static void myMethod(int a, String b) {}\n" +
- " void call() {\n" +
- " myMethod(12);\n" +
- " }\n" +
- "}"
- );
- IType type = workingCopies[0].getType("Test");
- IFunction method= type.getFunctions()[0];
- search(method, REFERENCES);
- assertSearchResults(""); // Expect no result
-}
-
-/**
- * Bug 97606: [1.5][search] Raw type reference is reported as exact match for qualified names
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97606"
- */
-public void testBug97606() throws CoreException {
- workingCopies = new IJavaScriptUnit[4];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/def/L.js",
- "package b97606.pack.def;\n" +
- "public interface L<E> {}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/def/LL.js",
- "package b97606.pack.def;\n" +
- "public class LL<E> implements L<E> {\n" +
- " public Object clone() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/ref/K.js",
- "package b97606.pack.ref;\n" +
- "public interface K {}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/ref/X.js",
- "package b97606.pack.ref;\n" +
- "public class X implements K {\n" +
- " private b97606.pack.def.LL sg;\n" +
- " protected synchronized b97606.pack.def.L<K> getSG() {\n" +
- " return (sg != null) \n" +
- " ? (b97606.pack.def.L) sg.clone()\n" +
- " : null;\n" +
- " }\n" +
- "}\n"
- );
- IPath pathDef = new Path("/JavaSearchBugs/src/b97606/pack/def");
- IPath pathRef = new Path("/JavaSearchBugs/src/b97606/pack/ref");
- try {
- createFolder(pathDef);
- createFolder(pathRef);
- workingCopies[0].commitWorkingCopy(true, null);
- workingCopies[1].commitWorkingCopy(true, null);
- workingCopies[2].commitWorkingCopy(true, null);
- workingCopies[3].commitWorkingCopy(true, null);
- this.resultCollector.showRule = true;
- IType type = workingCopies[0].getType("L");
- search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH);
- assertSearchResults(
- "src/b97606/pack/def/LL.java b97606.pack.def.LL [L] ERASURE_MATCH\n" +
- "src/b97606/pack/ref/X.java b97606.pack.def.L<K> b97606.pack.ref.X.getSG() [b97606.pack.def.L] ERASURE_MATCH\n" +
- "src/b97606/pack/ref/X.java b97606.pack.def.L<K> b97606.pack.ref.X.getSG() [b97606.pack.def.L] ERASURE_RAW_MATCH"
- );
- }
- finally {
- deleteFolder(pathDef);
- deleteFolder(pathRef);
- }
-}
-public void testBug97606b() throws CoreException {
- workingCopies = new IJavaScriptUnit[4];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/def/L.js",
- "package b97606.pack.def;\n" +
- "public interface L<E> {}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/def/LL.js",
- "package b97606.pack.def;\n" +
- "public class LL<E> implements L<E> {\n" +
- " public Object clone() {\n" +
- " return null;\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/ref/K.js",
- "package b97606.pack.ref;\n" +
- "public interface K {}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/ref/X.js",
- "package b97606.pack.ref;\n" +
- "import b97606.pack.def.*;\n" +
- "public class X implements K {\n" +
- " private LL sg;\n" +
- " protected synchronized L<K> getSG() {\n" +
- " return (sg != null) \n" +
- " ? (L) sg.clone()\n" +
- " : null;\n" +
- " }\n" +
- "}\n"
- );
- IPath pathDef = new Path("/JavaSearchBugs/src/b97606/pack/def");
- IPath pathRef = new Path("/JavaSearchBugs/src/b97606/pack/ref");
- try {
- createFolder(pathDef);
- createFolder(pathRef);
- workingCopies[0].commitWorkingCopy(true, null);
- workingCopies[1].commitWorkingCopy(true, null);
- workingCopies[2].commitWorkingCopy(true, null);
- workingCopies[3].commitWorkingCopy(true, null);
- this.resultCollector.showRule = true;
- IType type = workingCopies[0].getType("L");
- search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH);
- assertSearchResults(
- "src/b97606/pack/def/LL.java b97606.pack.def.LL [L] ERASURE_MATCH\n" +
- "src/b97606/pack/ref/X.java L<K> b97606.pack.ref.X.getSG() [L] ERASURE_MATCH\n" +
- "src/b97606/pack/ref/X.java L<K> b97606.pack.ref.X.getSG() [L] ERASURE_RAW_MATCH"
- );
- }
- finally {
- deleteFolder(pathDef);
- deleteFolder(pathRef);
- }
-}
-
-/**
- * Bug 97614: [1.5][search] Refactoring: renaming of field of a (complex) parametrized type does not replace all occurrences
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97614"
- */
-public void testBug97614() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97614/W.js",
- "package b97614;\n" +
- "public class W {\n" +
- " private final Map<String, Y<?, ? extends b97614.X.XX<?, ?>, ? >> m1 = null; // (a)\n" +
- " public void getStore(final Object o) {\n" +
- " m1.get(o); // (b)\n" +
- " }\n" +
- "}\n" +
- "interface Map<K, V> {\n" +
- " V get(Object k);\n" +
- "}"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b97614/X.js",
- "package b97614;\n" +
- "import java.io.Serializable;\n" +
- "public interface X<T extends X<T, U, V>, \n" +
- " U extends X.XX<T, V>, \n" +
- " V extends X.XY> {\n" +
- " public interface XX<TT extends X<TT, ?, UU>, \n" +
- " UU extends X.XY> \n" +
- " extends Serializable {\n" +
- " }\n" +
- " public interface XY extends Serializable {\n" +
- " }\n" +
- "}"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b97614/Y.js",
- "package b97614;\n" +
- "public class Y<T extends X<T, U, V>, U extends X.XX<T, V>, V extends X.XY> {\n" +
- "}\n"
- );
- IField field = workingCopies[0].getType("W").getField("m1");
- search(field, REFERENCES);
- assertSearchResults(
- "src/b97614/W.java void b97614.W.getStore(Object) [m1] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 98378: [search] does not find method references in anonymous class of imported jarred plugin
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=98378"
- */
-public void testBug98378() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b98378/X.js",
- "package b98378;\n" +
- "public class X implements java.lang.CharSequence {\n" +
- " public int length() {\n" +
- " return 1;\n" +
- " }\n" +
- "}"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b98378/Y.js",
- "package b98378;\n" +
- "public class Y {\n" +
- " public int length() {\n" +
- " return -1;\n" +
- " }\n" +
- "}\n"
- );
- String jclPath = getExternalJCLPathString("1.5");
- IType type = getClassFile("JavaSearchBugs", jclPath, "java.lang", "CharSequence.class").getType();
- IFunction method = type.getFunction("length", new String[] {});
- search(method, DECLARATIONS, SearchEngine.createHierarchyScope(type, this.wcOwner));
- assertSearchResults(
- jclPath + " int java.lang.CharSequence.length() EXACT_MATCH\n" +
- jclPath + " int java.lang.String.length() EXACT_MATCH"
- );
-}
-public void testBug98378b() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b98378/X.js",
- "package b98378;\n" +
- "public class X implements java.lang.CharSequence {\n" +
- " public int length() {\n" +
- " return 1;\n" +
- " }\n" +
- "}"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b98378/Y.js",
- "package b98378;\n" +
- "public class Y {\n" +
- " public int length() {\n" +
- " return -1;\n" +
- " }\n" +
- "}\n"
- );
- String jclPath = getExternalJCLPathString("1.5");
- IType type = getClassFile("JavaSearchBugs", jclPath, "java.lang", "CharSequence.class").getType();
- IFunction method = type.getFunction("length", new String[] {});
- search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchEngine.createHierarchyScope(type, this.wcOwner));
- assertSearchResults(
- "src/b98378/X.java int b98378.X.length() [length] EXACT_MATCH\n" +
- jclPath + " int java.lang.CharSequence.length() EXACT_MATCH\n" +
- jclPath + " int java.lang.String.length() EXACT_MATCH"
- );
-}
-
-/**
- * Bug 99600: [search] Java model exception on "Move to new file" on inner type with inner type
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=99600"
- */
-public void testBug99600() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b99600/Test.js",
- "package b99600;\n" +
- "public class Test {\n" +
- " public class C1 {}\n" +
- " public class C2 {\n" +
- " class C3 {\n" +
- " int foo(C1 c) { return 0; }\n" +
- " }\n" +
- " public void foo(C1 c, int i) {\n" +
- " new C3().foo(c);\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("Test").getType("C2");
- new SearchEngine(this.workingCopies).searchDeclarationsOfSentMessages(type, resultCollector, null);
- assertSearchResults(
- "src/b99600/Test.java int b99600.Test$C2$C3.foo(C1) [foo(C1 c)] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 99903: [1.5][search] range wrong for package-info
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=99903"
- */
-public void testBug99903_annotation() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b99903/package-info.js",
- "/**\n" +
- " * @see Test\n" +
- " */\n" +
- "@Annot\n" +
- "package b99903;\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b99903/Test.js",
- "package b99903;\n" +
- "public class Test {\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b99903/Annot.js",
- "package b99903;\n" +
- "public @interface Annot {\n" +
- "}\n"
- );
- IType type = workingCopies[2].getType("Annot");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b99903/package-info.java [Annot] EXACT_MATCH"
- );
-}
-public void testBug99903_javadoc() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b99903/package-info.js",
- "/**\n" +
- " * @see Test\n" +
- " */\n" +
- "@Annot\n" +
- "package b99903;\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b99903/Test.js",
- "package b99903;\n" +
- "public class Test {\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b99903/Annot.js",
- "package b99903;\n" +
- "public @interface Annot {\n" +
- "}\n"
- );
- resultCollector.showInsideDoc = true;
- IType type = workingCopies[1].getType("Test");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b99903/package-info.java [Test] EXACT_MATCH INSIDE_JAVADOC"
- );
-}
-
-/**
- * Bug 100695: [1.5][search] Renaming a field of generic array type has no effect
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=100695"
- */
-public void testBug100695() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100695/Test.js",
- "package b100695;\n" +
- "public class Test {\n" +
- " Class<Class>[] foo;\n" +
- " Class<Class>[] bar = foo;\n" +
- " Test() {\n" +
- " foo = null;\n" +
- " }\n" +
- "}\n"
- );
- IField field = workingCopies[0].getType("Test").getField("foo");
- search(field, REFERENCES);
- assertSearchResults(
- "src/b100695/Test.java b100695.Test.bar [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java b100695.Test() [foo] EXACT_MATCH"
- );
-}
-public void testBug100695a() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100695/Test.js",
- "package b100695;\n" +
- "public class Test {\n" +
- " Class<Class>[] foo;\n" +
- " Class<Class>[] bar = foo;\n" +
- " Test() {\n" +
- " foo = null;\n" +
- " }\n" +
- "}\n"
- );
- IField field = workingCopies[0].getType("Test").getField("foo");
- search(field, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b100695/Test.java b100695.Test.foo [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java b100695.Test.bar [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java b100695.Test() [foo] EXACT_MATCH"
- );
-}
-public void testBug100695b() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100695/Test.js",
- "package b100695;\n" +
- "public class Test {\n" +
- " Class<Class> foo;\n" +
- " Class<Class> bar = foo;\n" +
- " Test() {\n" +
- " foo = null;\n" +
- " }\n" +
- "}\n"
- );
- IField field = workingCopies[0].getType("Test").getField("foo");
- search(field, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b100695/Test.java b100695.Test.foo [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java b100695.Test.bar [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java b100695.Test() [foo] EXACT_MATCH"
- );
-}
-public void testBug100695c() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100695/Test.js",
- "package b100695;\n" +
- "public class Test {\n" +
- " Class[] foo;\n" +
- " Class[] bar = foo;\n" +
- " Test() {\n" +
- " foo = null;\n" +
- " }\n" +
- "}\n"
- );
- IField field = workingCopies[0].getType("Test").getField("foo");
- search(field, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b100695/Test.java b100695.Test.foo [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java b100695.Test.bar [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java b100695.Test() [foo] EXACT_MATCH"
- );
-}
-public void testBug100695d() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100695/Test.js",
- "package b100695;\n" +
- "public class Test {\n" +
- " public Class<Class>[] foo(Class<Class>[] a) {\n" +
- " return a;\n" +
- " }\n" +
- " void bar() {\n" +
- " foo(new Class[0]);\n" +
- " }\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Test").getFunctions()[0];
- search(method, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b100695/Test.java Class<Class>[] b100695.Test.foo(Class<Class>[]) [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java void b100695.Test.bar() [foo(new Class[0])] EXACT_MATCH"
- );
-}
-public void testBug100695e() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100695/Test.js",
- "package b100695;\n" +
- "public class Test {\n" +
- " public Class<Class> foo(Class<Class> a) {\n" +
- " return a;\n" +
- " }\n" +
- " void bar() {\n" +
- " foo(null);\n" +
- " }\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Test").getFunctions()[0];
- search(method, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b100695/Test.java Class<Class> b100695.Test.foo(Class<Class>) [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java void b100695.Test.bar() [foo(null)] EXACT_MATCH"
- );
-}
-public void testBug100695f() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100695/Test.js",
- "package b100695;\n" +
- "public class Test {\n" +
- " public Class[] foo(Class[] a) {\n" +
- " return a;\n" +
- " }\n" +
- " void bar() {\n" +
- " foo(new Class[0]);\n" +
- " }\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("Test").getFunctions()[0];
- search(method, ALL_OCCURRENCES);
- assertSearchResults(
- "src/b100695/Test.java Class[] b100695.Test.foo(Class[]) [foo] EXACT_MATCH\n" +
- "src/b100695/Test.java void b100695.Test.bar() [foo(new Class[0])] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 100772: [1.5][search] Search for declarations in hierarchy reports to many matches
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=100772"
- */
-private void setUpBug100772_HierarchyScope_ClassAndSubclass() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100772/Test.js",
- "package b100772;\n" +
- "class Test<T> {\n" +
- " public void foo(T t) {}\n" +
- " public void foo(Class c) {}\n" +
- "}\n" +
- "class Sub extends Test<String> {\n" +
- " public void foo(String str) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
-}
-public void testBug100772_HierarchyScope_ClassAndSubclass01() throws CoreException {
- setUpBug100772_HierarchyScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Sub.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_ClassAndSubclass02() throws CoreException {
- setUpBug100772_HierarchyScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Sub.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_ClassAndSubclass03() throws CoreException {
- setUpBug100772_HierarchyScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QClass;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(Class) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_ClassAndSubclass04() throws CoreException {
- setUpBug100772_HierarchyScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Sub.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_ClassAndSubclass05() throws CoreException {
- setUpBug100772_HierarchyScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Sub.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-private void setUpBug100772_HierarchyScope_InterfacesAndClass() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100772/Test.js",
- "package b100772;\n" +
- "interface Test<T> {\n" +
- " public void foo(T t);\n" +
- " public void foo(Class c);\n" +
- "}\n" +
- "interface Sub extends Test<String> {\n" +
- " public void foo(String str);\n" +
- " public void foo(Exception e);\n" +
- "}\n" +
- "class X implements Test<String> {\n" +
- " public void foo(String str) {}\n" +
- " public void foo(Class c) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass01() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.X.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass02() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.X.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass03() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QClass;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(Class) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.X.foo(Class) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass04() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Sub.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass05() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Sub.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass06() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.X.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass07() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QClass;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(Class) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.X.foo(Class) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_InterfacesAndClass08() throws CoreException {
- setUpBug100772_HierarchyScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.X.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-private void setUpBug100772_HierarchyScope_Complex() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100772/Test.js",
- "package b100772;\n" +
- "public class X<T> implements IX<T> {\n" +
- " public void foo(T t) {}\n" +
- "}\n" +
- "class XX extends X<String> {\n" +
- " public void foo(String s) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n" +
- "interface IX<U> {\n" +
- " public void foo(U u);\n" +
- "}\n" +
- "class Y implements IX<String> {\n" +
- " public void foo(String s) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n" +
- "interface IXX<V extends Exception> {\n" +
- " public void foo(V v);\n" +
- "}\n" +
- "class Z extends Y implements IXX<Exception> {\n" +
- " public void foo(String s) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
-}
-public void testBug100772_HierarchyScope_Complex01() throws CoreException {
- setUpBug100772_HierarchyScope_Complex();
- IType type = workingCopies[0].getType("IX");
- IFunction method = type.getFunction("foo", new String[] { "QU;" });
- search(method, DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.X.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.XX.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.IX.foo(U) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Y.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Z.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_Complex02() throws CoreException {
- setUpBug100772_HierarchyScope_Complex();
- IType type = workingCopies[0].getType("Z");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.IX.foo(U) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Y.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Z.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_Complex03() throws CoreException {
- setUpBug100772_HierarchyScope_Complex();
- IType type = workingCopies[0].getType("Z");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.Y.foo(Exception) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.IXX.foo(V) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Z.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_HierarchyScope_Complex04() throws CoreException {
- setUpBug100772_HierarchyScope_Complex();
- IType type = workingCopies[0].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, UI_DECLARATIONS, SearchEngine.createHierarchyScope(type));
- assertSearchResults(
- "src/b100772/Test.java void b100772.X.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.XX.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.IX.foo(U) [foo] EXACT_MATCH"
- );
-}
-private void setUpBug100772_ProjectScope_ClassAndSubclass() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100772/Test.js",
- "package b100772;\n" +
- "class Test<T> {\n" +
- " public void foo(T t) {}\n" +
- " public void foo(Class c) {}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b100772/Sub.js",
- "package b100772;\n" +
- "class Sub extends Test<String> {\n" +
- " public void foo(String str) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
-}
-public void testBug100772_ProjectScope_ClassAndSubclass01() throws CoreException {
- setUpBug100772_ProjectScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_ClassAndSubclass02() throws CoreException {
- setUpBug100772_ProjectScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_ClassAndSubclass03() throws CoreException {
- setUpBug100772_ProjectScope_ClassAndSubclass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QClass;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(Class) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_ClassAndSubclass04() throws CoreException {
- setUpBug100772_ProjectScope_ClassAndSubclass();
- IType type = workingCopies[1].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_ClassAndSubclass05() throws CoreException {
- setUpBug100772_ProjectScope_ClassAndSubclass();
- IType type = workingCopies[1].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-private void setUpBug100772_ProjectScope_InterfacesAndClass() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100772/Test.js",
- "package b100772;\n" +
- "interface Test<T> {\n" +
- " public void foo(T t);\n" +
- " public void foo(Class c);\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b100772/Sub.js",
- "package b100772;\n" +
- "interface Sub extends Test<String> {\n" +
- " public void foo(String str);\n" +
- " public void foo(Exception e);\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b100772/X.js",
- "package b100772;\n" +
- "class X implements Test<String> {\n" +
- " public void foo(String str) {}\n" +
- " public void foo(Class c) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass01() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass02() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass03() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunction("foo", new String[] { "QClass;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(Class) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(Class) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass04() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[1].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass05() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[1].getType("Sub");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(Exception) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass06() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[2].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Test.java void b100772.Test.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass07() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[2].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QClass;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Test.java void b100772.Test.foo(Class) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(Class) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_InterfacesAndClass08() throws CoreException {
- setUpBug100772_ProjectScope_InterfacesAndClass();
- IType type = workingCopies[2].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/Sub.java void b100772.Sub.foo(Exception) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-private void setUpBug100772_ProjectScope_Complex() throws CoreException {
- workingCopies = new IJavaScriptUnit[6];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b100772/X.js",
- "package b100772;\n" +
- "public class X<T> implements IX<T> {\n" +
- " public void foo(T t) {}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b100772/XX.js",
- "package b100772;\n" +
- "class XX extends X<String> {\n" +
- " public void foo(String s) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b100772/IX.js",
- "package b100772;\n" +
- "interface IX<U> {\n" +
- " public void foo(U u);\n" +
- "}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b100772/Y.js",
- "package b100772;\n" +
- "class Y implements IX<String> {\n" +
- " public void foo(String s) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
- workingCopies[4] = getWorkingCopy("/JavaSearchBugs/src/b100772/IXX.js",
- "package b100772;\n" +
- "interface IXX<V extends Exception> {\n" +
- " public void foo(V v);\n" +
- "}\n"
- );
- workingCopies[5] = getWorkingCopy("/JavaSearchBugs/src/b100772/Z.js",
- "package b100772;\n" +
- "class Z extends Y implements IXX<Exception> {\n" +
- " public void foo(String s) {}\n" +
- " public void foo(Exception e) {}\n" +
- "}\n"
- );
-}
-public void testBug100772_ProjectScope_Complex01() throws CoreException {
- setUpBug100772_ProjectScope_Complex();
- IType type = workingCopies[2].getType("IX");
- IFunction method = type.getFunction("foo", new String[] { "QU;" });
- search(method, DECLARATIONS);
- assertSearchResults(
- "src/b100772/IX.java void b100772.IX.foo(U) [foo] EXACT_MATCH\n" +
- "src/b100772/X.java void b100772.X.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/XX.java void b100772.XX.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Y.java void b100772.Y.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Z.java void b100772.Z.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_Complex02() throws CoreException {
- setUpBug100772_ProjectScope_Complex();
- IType type = workingCopies[5].getType("Z");
- IFunction method = type.getFunction("foo", new String[] { "QString;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/IX.java void b100772.IX.foo(U) [foo] EXACT_MATCH\n" +
- "src/b100772/XX.java void b100772.XX.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Y.java void b100772.Y.foo(String) [foo] EXACT_MATCH\n" +
- "src/b100772/Z.java void b100772.Z.foo(String) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_Complex03() throws CoreException {
- setUpBug100772_ProjectScope_Complex();
- IType type = workingCopies[5].getType("Z");
- IFunction method = type.getFunction("foo", new String[] { "QException;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/IXX.java void b100772.IXX.foo(V) [foo] EXACT_MATCH\n" +
- "src/b100772/XX.java void b100772.XX.foo(Exception) [foo] EXACT_MATCH\n" +
- "src/b100772/Y.java void b100772.Y.foo(Exception) [foo] EXACT_MATCH\n" +
- "src/b100772/Z.java void b100772.Z.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-public void testBug100772_ProjectScope_Complex04() throws CoreException {
- setUpBug100772_ProjectScope_Complex();
- IType type = workingCopies[0].getType("X");
- IFunction method = type.getFunction("foo", new String[] { "QT;" });
- search(method, UI_DECLARATIONS);
- assertSearchResults(
- "src/b100772/X.java void b100772.X.foo(T) [foo] EXACT_MATCH\n" +
- "src/b100772/IX.java void b100772.IX.foo(U) [foo] EXACT_MATCH\n" +
- "src/b100772/XX.java void b100772.XX.foo(String) [foo] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 108088: [search] Inaccurate search match for method invocations with literal arguments
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=108088"
- */
-public void testBug108088() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b108088", "Test108088.js");
- IType type = unit.getType("A108088");
- IFunction method = type.getFunction("subroutine", new String[] { "F" });
- SearchPattern pattern = SearchPattern.createPattern(method, REFERENCES, EXACT_RULE);
- assertNotNull("Pattern should not be null", pattern);
- search(pattern, getJavaSearchScopeBugs(), resultCollector);
- assertSearchResults(
- "src/b108088/B108088.java void b108088.B108088.doit(A108088, String) [subroutine(1.2f)] EXACT_MATCH"
- );
-}
-
-/**
- * To get these tests search matches in a workspace, do NOT forget to modify files
- * to set them as working copies.
- *
- * @test Bug 110060: [plan][search] Add support for Camel Case search pattern
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=110060"
- */
-// Types search
-private void setUpBug110060_TypePattern() throws CoreException {
- workingCopies = new IJavaScriptUnit[5];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/AA.js",
- "package b110060;\n" +
- "public class AA {\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b110060/AAxx.js",
- "package b110060;\n" +
- "public class AAxx {\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxxAyy.js",
- "package b110060;\n" +
- "public class AxxAyy {\n" +
- "}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxA.js",
- "package b110060;\n" +
- "public class AxA {\n" +
- "}\n"
- );
- workingCopies[4] = getWorkingCopy("/JavaSearchBugs/src/b110060/Test.js",
- "package b110060;\n" +
- "public class Test {\n" +
- " AA aa;\n" +
- " AAxx aaxx;\n" +
- " AxA axa;\n" +
- " AxxAyy axxayy;\n" +
- "}\n"
- );
-}
-public void testBug110060_TypePattern01() throws CoreException {
- setUpBug110060_TypePattern();
- search("AA", TYPE, REFERENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern02() throws CoreException {
- setUpBug110060_TypePattern();
- search("AA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" +
- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" +
- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern03() throws CoreException {
- setUpBug110060_TypePattern();
- search("AAx", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern04() throws CoreException {
- setUpBug110060_TypePattern();
- search("Axx", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern05() throws CoreException {
- setUpBug110060_TypePattern();
- search("Ax", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" +
- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern06() throws CoreException {
- setUpBug110060_TypePattern();
- search("A*A*", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" +
- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" +
- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.annotation.Annotation EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern07() throws CoreException {
- setUpBug110060_TypePattern();
- search("aa", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults("");
-}
-
-public void testBug110060_TypePattern08() throws CoreException {
- setUpBug110060_TypePattern();
- search("aa", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH);
- assertSearchResults(
- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" +
- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern09() throws CoreException {
- setUpBug110060_TypePattern();
- search("AA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE);
- assertSearchResults(
- "src/b110060/AA.java b110060.AA [AA] EXACT_MATCH\n" +
- "src/b110060/AAxx.java b110060.AAxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/AxA.java b110060.AxA [AxA] EXACT_MATCH\n" +
- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aa [AA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [AAxx] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [AxA] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern10() throws CoreException {
- setUpBug110060_TypePattern();
- search("AxAx", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults("");
-}
-
-public void testBug110060_TypePattern11() throws CoreException {
- setUpBug110060_TypePattern();
- search("AxxA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH"
- );
-}
-
-public void testBug110060_TypePattern12() throws CoreException {
- setUpBug110060_TypePattern();
- search("AxXA", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AxxAyy.java b110060.AxxAyy [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [AxxAyy] EXACT_MATCH"
- );
-}
-
-public void testBug110060_AllTypeNames01() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx\n" +
- "b110060.AxA\n" +
- "b110060.AxxAyy",
- requestor);
-}
-
-public void testBug110060_AllTypeNames02() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx\n" +
- "b110060.AxA\n" +
- "b110060.AxxAyy",
- requestor);
-}
-
-public void testBug110060_AllTypeNames03() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx\n" +
- "b110060.AxA\n" +
- "b110060.AxxAyy",
- requestor);
-}
-
-public void testBug110060_AllTypeNames04() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx\n" +
- "b110060.AxA\n" +
- "b110060.AxxAyy",
- requestor);
-}
-
-public void testBug110060_AllTypeNames05() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_PREFIX_MATCH,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx",
- requestor);
-}
-
-public void testBug110060_AllTypeNames06() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA",
- requestor);
-}
-
-public void testBug110060_AllTypeNames07() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx",
- requestor);
-}
-
-public void testBug110060_AllTypeNames08() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx",
- requestor);
-}
-
-public void testBug110060_AllTypeNames09() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx",
- requestor);
-}
-
-public void testBug110060_AllTypeNames10() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "",
- requestor);
-}
-
-public void testBug110060_AllTypeNames11() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "",
- requestor);
-}
-
-public void testBug110060_AllTypeNames12() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_PREFIX_MATCH,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b110060.AA\n" +
- "b110060.AAxx",
- requestor);
-}
-
-public void testBug110060_AllTypeNames13() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "",
- requestor);
-}
-
-public void testBug110060_AllTypeNames14() throws CoreException {
- setUpBug110060_TypePattern();
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE,
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "",
- requestor);
-}
-
-// Constructor search
-private void setUpBug110060_ConstructorPattern() throws CoreException {
- workingCopies = new IJavaScriptUnit[5];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/AA.js",
- "package b110060;\n" +
- "public class AA {\n" +
- " AA() {}\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b110060/AAxx.js",
- "package b110060;\n" +
- "public class AAxx {\n" +
- " AAxx() {}\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxxAyy.js",
- "package b110060;\n" +
- "public class AxxAyy {\n" +
- " AxxAyy() {}\n" +
- "}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b110060/AxA.js",
- "package b110060;\n" +
- "public class AxA {\n" +
- " AxA() {}\n" +
- "}\n"
- );
- workingCopies[4] = getWorkingCopy("/JavaSearchBugs/src/b110060/Test.js",
- "package b110060;\n" +
- "public class Test {\n" +
- " AA aa = new AA();\n" +
- " AAxx aaxx = new AAxx();\n" +
- " AxA axa = new AxA();\n" +
- " AxxAyy axxayy = new AxxAyy();\n" +
- "}\n"
- );
-}
-public void testBug110060_ConstructorPattern01() throws CoreException {
- setUpBug110060_ConstructorPattern();
- search("AA", CONSTRUCTOR, REFERENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java b110060.Test.aa [new AA()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_ConstructorPattern02() throws CoreException {
- setUpBug110060_ConstructorPattern();
- search("AA", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AA.java b110060.AA() [AA] EXACT_MATCH\n" +
- "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" +
- "src/b110060/AxA.java b110060.AxA() [AxA] EXACT_MATCH\n" +
- "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aa [new AA()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_ConstructorPattern03() throws CoreException {
- setUpBug110060_ConstructorPattern();
- search("AAx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_ConstructorPattern04() throws CoreException {
- setUpBug110060_ConstructorPattern();
- search("Axx", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_ConstructorPattern05() throws CoreException {
- setUpBug110060_ConstructorPattern();
- search("Ax", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AxA.java b110060.AxA() [AxA] EXACT_MATCH\n" +
- "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_ConstructorPattern06() throws CoreException {
- setUpBug110060_ConstructorPattern();
- search("A*A*", CONSTRUCTOR, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/AA.java b110060.AA() [AA] EXACT_MATCH\n" +
- "src/b110060/AAxx.java b110060.AAxx() [AAxx] EXACT_MATCH\n" +
- "src/b110060/AxA.java b110060.AxA() [AxA] EXACT_MATCH\n" +
- "src/b110060/AxxAyy.java b110060.AxxAyy() [AxxAyy] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aa [new AA()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aaxx [new AAxx()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axa [new AxA()] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.axxayy [new AxxAyy()] EXACT_MATCH"
- );
-}
-
-// Methods search
-private void setUpBug110060_MethodPattern() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/Test.js",
- "package b110060;\n" +
- "public class Test {\n" +
- " void aMethodWithNothingSpecial() {}\n" +
- " void aMethodWith1Digit() {}\n" +
- " void aMethodWith1DigitAnd_AnUnderscore() {}\n" +
- " void aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() {}\n" +
- " void otherMethodWhichStartsWithAnotherLetter() {}\n" +
- " void testReferences() {\n" +
- " aMethodWith1Digit();\n" +
- " aMethodWith1DigitAnd_AnUnderscore();\n" +
- " aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores();\n" +
- " aMethodWithNothingSpecial();\n" +
- " otherMethodWhichStartsWithAnotherLetter();\n" +
- " }\n" +
- "}\n"
- );
-}
-public void testBug110060_MethodPattern01() throws CoreException {
- setUpBug110060_MethodPattern();
- search("MWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults("");
-}
-
-public void testBug110060_MethodPattern02() throws CoreException {
- setUpBug110060_MethodPattern();
- search("AMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults("");
-}
-
-public void testBug110060_MethodPattern03() throws CoreException {
- setUpBug110060_MethodPattern();
- search("aMWD", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java void b110060.Test.aMethodWith1Digit() [aMethodWith1Digit] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1DigitAnd_AnUnderscore() [aMethodWith1DigitAnd_AnUnderscore] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Digit()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_MethodPattern04() throws CoreException {
- setUpBug110060_MethodPattern();
- search("aMW", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java void b110060.Test.aMethodWithNothingSpecial() [aMethodWithNothingSpecial] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1Digit() [aMethodWith1Digit] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1DigitAnd_AnUnderscore() [aMethodWith1DigitAnd_AnUnderscore] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Digit()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_MethodPattern05() throws CoreException {
- setUpBug110060_MethodPattern();
- search("aMethod", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java void b110060.Test.aMethodWithNothingSpecial() [aMethodWithNothingSpecial] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1Digit() [aMethodWith1Digit] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1DigitAnd_AnUnderscore() [aMethodWith1DigitAnd_AnUnderscore] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Digit()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_MethodPattern06() throws CoreException {
- setUpBug110060_MethodPattern();
- search("aMethodWith1", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java void b110060.Test.aMethodWith1Digit() [aMethodWith1Digit] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1DigitAnd_AnUnderscore() [aMethodWith1DigitAnd_AnUnderscore] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Digit()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_MethodPattern07() throws CoreException {
- setUpBug110060_MethodPattern();
- search("*Method*With*A*", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java void b110060.Test.aMethodWithNothingSpecial() [aMethodWithNothingSpecial] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1DigitAnd_AnUnderscore() [aMethodWith1DigitAnd_AnUnderscore] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.otherMethodWhichStartsWithAnotherLetter() [otherMethodWhichStartsWithAnotherLetter] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1DigitAnd_AnUnderscore()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWithNothingSpecial()] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [otherMethodWhichStartsWithAnotherLetter()] EXACT_MATCH"
- );
-}
-
-public void testBug110060_MethodPattern08() throws CoreException {
- setUpBug110060_MethodPattern();
- search("aMW1D", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults("");
-}
-
-public void testBug110060_MethodPattern09() throws CoreException {
- setUpBug110060_MethodPattern();
- search("aMWOOODASU", METHOD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java void b110060.Test.aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aMethodWith1Or2_Or_3_Or__4__DigitsAnd_Several_Underscores()] EXACT_MATCH"
- );
-}
-
-// Fields search
-private void setUpBug110060_FieldPattern() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110060/Test.js",
- "package b110060;\n" +
- "public class Test {\n" +
- " Object aFieldWithNothingSpecial;\n" +
- " Object aFieldWithS$Dollar;\n" +
- " Object aFieldWith$Several$DollarslAnd1DigitAnd_1Underscore;\n" +
- " Object aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars;\n" +
- " Object otherFieldWhichStartsWithAnotherLetter;\n" +
- " void testReferences() {\n" +
- " Object o0 = aFieldWithNothingSpecial;\n" +
- " Object o1 = aFieldWithS$Dollar;\n" +
- " Object o2 = aFieldWith$Several$DollarslAnd1DigitAnd_1Underscore;\n" +
- " Object o3 = aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars;\n" +
- " }\n" +
- " Object oF = otherFieldWhichStartsWithAnotherLetter;\n" +
- "}\n"
- );
-}
-public void testBug110060_FieldPattern01() throws CoreException {
- setUpBug110060_FieldPattern();
- search("aFWSD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java b110060.Test.aFieldWithS$Dollar [aFieldWithS$Dollar] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.aFieldWith$Several$DollarslAnd1DigitAnd_1Underscore [aFieldWith$Several$DollarslAnd1DigitAnd_1Underscore] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWithS$Dollar] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWith$Several$DollarslAnd1DigitAnd_1Underscore] EXACT_MATCH"
- );
-}
-
-public void testBug110060_FieldPattern02() throws CoreException {
- setUpBug110060_FieldPattern();
- search("afwsd", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults("");
-}
-
-public void testBug110060_FieldPattern03() throws CoreException {
- setUpBug110060_FieldPattern();
- search("aFWS$", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java b110060.Test.aFieldWithS$Dollar [aFieldWithS$Dollar] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aFieldWithS$Dollar] EXACT_MATCH"
- );
-}
-
-public void testBug110060_FieldPattern04() throws CoreException {
- setUpBug110060_FieldPattern();
- search("aSFWSCD", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java b110060.Test.aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars [aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars] EXACT_MATCH\n" +
- "src/b110060/Test.java void b110060.Test.testReferences() [aStrangeFieldWith$$$$$$$$$$$$$$$SeveraContiguousDollars] EXACT_MATCH"
- );
-}
-
-public void testBug110060_FieldPattern05() throws CoreException {
- setUpBug110060_FieldPattern();
- search("oF", FIELD, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b110060/Test.java b110060.Test.otherFieldWhichStartsWithAnotherLetter [otherFieldWhichStartsWithAnotherLetter] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.oF [oF] EXACT_MATCH\n" +
- "src/b110060/Test.java b110060.Test.oF [otherFieldWhichStartsWithAnotherLetter] EXACT_MATCH"
- );
-}
-
-/**
- * @test Bug 110291: [search] BasicSearchEngine return constructor declarations that doesn't exist in source
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=110291"
- */
-public void testBug110291() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110291/Test110291XX.js",
- "package b110291;\n" +
- "public class Test110291XX {\n" +
- " class Test110291YY {}" +
- "}\n"
- );
- search("Test110291", CONSTRUCTOR, DECLARATIONS, SearchPattern.R_PREFIX_MATCH);
- assertSearchResults(
- "src/b110291/Test110291XX.java b110291.Test110291XX$Test110291YY [Test110291YY] EXACT_MATCH"
- );
-}
-
-/**
- * @test Bug 110336: [plan][search] Should optionaly return the local variable for type reference
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=110336"
- */
-public void testBug110336a() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test {\n" +
- " <TP extends Test> void method(Class<Test> clazz) {\n" +
- " Test localVar1 = new Test();\n" +
- " Class<Test> localVar2 = new Class<Test>();\n" +
- " localVar1.method(localVar2);\n" +
- " }\n" +
- "}\n"
- );
- IType type = this.workingCopies[0].getType("Test");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java void b110336.Test.method(Class<Test>).TP [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>).clazz [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>).localVar1 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>).localVar1 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>).localVar2 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method(Class<Test>).localVar2 [Test]",
- collector
- );
-}
-public void testBug110336b() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test {\n" +
- " void method1(Test methodParam) {\n" +
- " Test localVar1 = new Test(){\n" +
- " Class c = Test.class;\n" +
- " <TP extends Test> void foo(){\n" +
- " Test o = (Test) null;\n" +
- " }\n" +
- " };\n" +
- " } \n" +
- "}\n"
- );
- IType type = this.workingCopies[0].getType("Test");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method1(Test):<anonymous>#1.c [Test]\n" +
- "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo().TP [Test]\n" +
- "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo().o [Test]\n" +
- "src/b110336/Test.java void void b110336.Test.method1(Test):<anonymous>#1.foo().o [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method1(Test).methodParam [Test]\n" +
- "src/b110336/Test.java void b110336.Test.method1(Test).localVar1 [Test]",
- collector
- );
-}
-public void testBug110336c() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test<TP extends X> {\n" +
- " X x;\n" +
- "\n" +
- "}\n" +
- "class X {}\n"
- );
- IType type = this.workingCopies[0].getType("X");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java b110336.Test.TP [X]\n" +
- "src/b110336/Test.java b110336.Test.x [X]",
- collector
- );
-}
-public void testBug110336d() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test {\n" +
- " Test a1Test = null, b1Test = new Test(), c1Test;\n" +
- " Test a2Test = new Test(), b2Test, c2Test = null;\n" +
- " Test a3Test, b3Test = null, c3Test = new Test();\n" +
- "}\n"
- );
- IType type = this.workingCopies[0].getType("Test");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java b110336.Test.a1Test [Test]+[b1Test,c1Test]\n" +
- "src/b110336/Test.java b110336.Test.b1Test [Test]\n" +
- "src/b110336/Test.java b110336.Test.a2Test [Test]+[b2Test,c2Test]\n" +
- "src/b110336/Test.java b110336.Test.a2Test [Test]\n" +
- "src/b110336/Test.java b110336.Test.a3Test [Test]+[b3Test,c3Test]\n" +
- "src/b110336/Test.java b110336.Test.c3Test [Test]",
- collector
- );
-}
-public void testBug110336e() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test {\n" +
- " void foo() {\n" +
- " Test lv1 = null, lv2 = new Test(), lv3;\n" +
- " Test lv4 = new Test(), lv5, lv6 = null;\n" +
- " Test lv7, lv8 = null, lv9 = new Test();\n" +
- " }\n" +
- "}\n"
- );
- IType type = this.workingCopies[0].getType("Test");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java void b110336.Test.foo().lv1 [Test]+[lv2,lv3]\n" +
- "src/b110336/Test.java void b110336.Test.foo().lv2 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.foo().lv4 [Test]+[lv5,lv6]\n" +
- "src/b110336/Test.java void b110336.Test.foo().lv4 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.foo().lv7 [Test]+[lv8,lv9]\n" +
- "src/b110336/Test.java void b110336.Test.foo().lv9 [Test]",
- collector
- );
-}
-public void testBug110336f() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test extends Exception {\n" +
- " void foo(Test test1) { // <- no local element\n" +
- " Test test2; // <- local element\n" +
- " try {\n" +
- " throw new Test();\n" +
- " }\n" +
- " catch (Test test4) { // <- no local element\n" +
- " }\n" +
- " for(Test test3;;) {} // <- local element\n" +
- " }\n" +
- "\n" +
- "}\n"
- );
- IType type = this.workingCopies[0].getType("Test");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java void b110336.Test.foo(Test).test1 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.foo(Test).test2 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.foo(Test) [Test]\n" +
- "src/b110336/Test.java void b110336.Test.foo(Test).test4 [Test]\n" +
- "src/b110336/Test.java void b110336.Test.foo(Test).test3 [Test]",
- collector
- );
-}
-public void testBug110336g() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test {\n" +
- " {\n" +
- " Test lv1 = null, lv2 = new Test(), lv3;\n" +
- " Test lv4 = new Test(), lv5, lv6 = null;\n" +
- " Test lv7, lv8 = null, lv9 = new Test();\n" +
- " }\n" +
- "}\n"
- );
- IType type = this.workingCopies[0].getType("Test");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java b110336.Test.{}.lv1 [Test]+[lv2,lv3]\n" +
- "src/b110336/Test.java b110336.Test.{}.lv2 [Test]\n" +
- "src/b110336/Test.java b110336.Test.{}.lv4 [Test]+[lv5,lv6]\n" +
- "src/b110336/Test.java b110336.Test.{}.lv4 [Test]\n" +
- "src/b110336/Test.java b110336.Test.{}.lv7 [Test]+[lv8,lv9]\n" +
- "src/b110336/Test.java b110336.Test.{}.lv9 [Test]",
- collector
- );
-}
-public void testBug110336h() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b110336/Test.js",
- "package b110336;\n" +
- "public class Test {\n" +
- " static {\n" +
- " Test lv1 = null, lv2 = new Test(), lv3;\n" +
- " Test lv4 = new Test(), lv5, lv6 = null;\n" +
- " Test lv7, lv8 = null, lv9 = new Test();\n" +
- " }\n" +
- "}\n"
- );
- IType type = this.workingCopies[0].getType("Test");
- TypeReferencesCollector collector = new TypeReferencesCollector();
- search(type, REFERENCES, EXACT_RULE, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "src/b110336/Test.java b110336.Test.static {}.lv1 [Test]+[lv2,lv3]\n" +
- "src/b110336/Test.java b110336.Test.static {}.lv2 [Test]\n" +
- "src/b110336/Test.java b110336.Test.static {}.lv4 [Test]+[lv5,lv6]\n" +
- "src/b110336/Test.java b110336.Test.static {}.lv4 [Test]\n" +
- "src/b110336/Test.java b110336.Test.static {}.lv7 [Test]+[lv8,lv9]\n" +
- "src/b110336/Test.java b110336.Test.static {}.lv9 [Test]",
- collector
- );
-}
-
-/**
- * @test Bug 110422: [search] BasicSearchEngine doesn't find all type declarations
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=110422"
- */
-public void testBug110422a() throws CoreException {
- search("TestP", TYPE, DECLARATIONS, SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE);
- assertSearchResults(
- "lib/b110422.jar b110422.TestPrefix [No source] EXACT_MATCH"
- );
-}
-public void testBug110422b() throws CoreException {
- search("TESTP", TYPE, DECLARATIONS, SearchPattern.R_PREFIX_MATCH);
- assertSearchResults(
- "lib/b110422.jar b110422.TestPrefix [No source] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 113671: [search] AIOOBE in SearchEngine#searchAllTypeNames
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=113671"
- */
-public void testBug113671() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- "java.lang".toCharArray(),
- SearchPattern.R_EXACT_MATCH,
- CharOperation.NO_CHAR,
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "java.lang.CharSequence\n" +
- "java.lang.Class\n" +
- "java.lang.CloneNotSupportedException\n" +
- "java.lang.Comparable\n" +
- "java.lang.Enum\n" +
- "java.lang.Error\n" +
- "java.lang.Exception\n" +
- "java.lang.IllegalMonitorStateException\n" +
- "java.lang.InterruptedException\n" +
- "java.lang.Object\n" +
- "java.lang.RuntimeException\n" +
- "java.lang.String\n" +
- "java.lang.Throwable",
- requestor);
-}
-
-/**
- * @test Bug 114539: [search] Internal error when refactoring code with errors
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=114539"
- */
-public void testBug114539() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b114539/Foo.js",
- "package b114539;\n" +
- "public class Foo {\n" +
- " int bar=Bar.FOO;\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b114539/Bar.js",
- "package b114539;\n" +
- "public class Bar {\n" +
- " private static final int FOO=0;\n" +
- "}\n"
- );
- IField field = this.workingCopies[1].getType("Bar").getField("FOO");
- search(field, REFERENCES);
- assertSearchResults(
- "src/b114539/Foo.java b114539.Foo.bar [FOO] POTENTIAL_MATCH"
- );
-}
-
-/**
- * Bug 116459: [search] correct results are missing in java search
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=116459"
- */
-public void testBug116459() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/p1/X.js",
- "package p1;\n" +
- "class X<T> {\n" +
- " X<T> gen;\n" +
- " X<String> param;\n" +
- " X raw;\n" +
- "}"
- );
- IType type = workingCopies[0].getType("X");
- this.resultCollector.showRule = true;
- search(type, REFERENCES, ERASURE_RULE);
- assertSearchResults(
- "src/p1/X.java p1.X.gen [X] EXACT_MATCH\n" +
- "src/p1/X.java p1.X.param [X] ERASURE_MATCH\n" +
- "src/p1/X.java p1.X.raw [X] ERASURE_RAW_MATCH"
- );
-}
-
-/**
- * @test Bug 119545: [search] Binary java method model elements returned by SearchEngine have unresolved parameter types
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=119545"
- */
-public void testBug119545() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b119545/Test.js",
- "package b119545;\n" +
- "class Test {\n" +
- " void foo(Object o1, Object o2){\n" +
- " if (o1.equals(o2)) {}\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("Test");
- IFunction method = type.getFunctions()[0];
- searchDeclarationsOfSentMessages(method, this.resultCollector);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " boolean java.lang.Object.equals(java.lang.Object) EXACT_MATCH"
- );
-}
-
-/**
- * @test Bug 120816: [search] NullPointerException at ...jdt.internal.compiler.lookup.SourceTypeBinding.getMethods
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=120816"
- */
-public void testBug120816a() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b120816/Test.js",
- "package b120816;\n" +
- "public class Test<E> {\n" +
- " String foo(E e) { return \"\"; }\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b120816/Sub.js",
- "package b120816;\n" +
- "public class Sub extends Test<Exception> {\n" +
- " String foo(RuntimeException e) { return \"\"; }\n" +
- " String foo(Exception e) {\n" +
- " return super.foo(e);\n" +
- " }\n" +
- "}\n"
- );
- search("* String (Exception)", METHOD, DECLARATIONS);
- assertSearchResults(
- "src/b120816/Sub.java String b120816.Sub.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-public void testBug120816b() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b120816/Test.js",
- "package b120816;\n" +
- "public class Test<E> {\n" +
- " String foo(E e) { return \"\"; }\n" +
- "}\n" +
- "class Sub extends Test<Exception> {\n" +
- " String foo(RuntimeException e) { return \"\"; }\n" +
- " String foo(Exception e) {\n" +
- " return super.foo(e);\n" +
- " }\n" +
- "}\n"
- );
- search("* String (Exception)", METHOD, DECLARATIONS);
- assertSearchResults(
- "src/b120816/Test.java String b120816.Sub.foo(Exception) [foo] EXACT_MATCH"
- );
-}
-
-/**
- * @test Bug 122442: [search] API inconsistency with IJavaScriptSearchConstants.IMPLEMENTORS and SearchPattern
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=122442"
- */
-private void setUpBug122442a() throws CoreException {
- workingCopies = new IJavaScriptUnit[3];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b122442/I.js",
- "package b122442;\n" +
- "public interface I {}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b122442/II.js",
- "package b122442;\n" +
- "public interface II extends I {}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b122442/X.js",
- "package b122442;\n" +
- "public class X implements I {}\n"
- );
-}
-public void testBug122442a() throws CoreException {
- setUpBug122442a();
- search("I", TYPE, IMPLEMENTORS);
- assertSearchResults(
- "src/b122442/II.java b122442.II [I] EXACT_MATCH\n" +
- "src/b122442/X.java b122442.X [I] EXACT_MATCH"
- );
-}
-public void testBug122442c() throws CoreException {
- setUpBug122442a();
- search("I", CLASS, IMPLEMENTORS);
- assertSearchResults(
- "src/b122442/X.java b122442.X [I] EXACT_MATCH"
- );
-}
-private void setUpBug122442d() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b122442/User.js",
- "class Klass {}\n" +
- "interface Interface {}\n" +
- "class User {\n" +
- " void m() {\n" +
- " new Klass() {};\n" +
- " new Interface() {};\n" +
- " }\n" +
- "}\n" +
- "class Sub extends Klass {}"
- );
-}
-public void testBug122442d() throws CoreException {
- setUpBug122442d();
- search("Interface", TYPE, IMPLEMENTORS);
- assertSearchResults(
- "src/b122442/User.java void b122442.User.m():<anonymous>#2 [Interface] EXACT_MATCH"
- );
-}
-public void testBug122442f() throws CoreException {
- setUpBug122442d();
- search("Interface", CLASS, IMPLEMENTORS);
- assertSearchResults(
- "src/b122442/User.java void b122442.User.m():<anonymous>#2 [Interface] EXACT_MATCH"
- );
-}
-public void testBug122442g() throws CoreException {
- setUpBug122442d();
- search("Klass", TYPE, IMPLEMENTORS);
- assertSearchResults(
- "src/b122442/User.java void b122442.User.m():<anonymous>#1 [Klass] EXACT_MATCH\n" +
- "src/b122442/User.java b122442.Sub [Klass] EXACT_MATCH"
- );
-}
-public void testBug122442i() throws CoreException {
- setUpBug122442d();
- search("Klass", CLASS, IMPLEMENTORS);
- assertSearchResults(
- "src/b122442/User.java void b122442.User.m():<anonymous>#1 [Klass] EXACT_MATCH\n" +
- "src/b122442/User.java b122442.Sub [Klass] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 123679: [search] Field references not found when type is a qualified member type [regression]
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=123679"
- */
-public void testBug123679() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b123679.jar", "pack").getClassFile("I123679.class").getType();
- search(type, REFERENCES);
- assertSearchResults(
- "lib/b123679.jar test.<anonymous> EXACT_MATCH\n" +
- "lib/b123679.jar test.Test$StaticClass$Member.parent EXACT_MATCH\n" +
- "lib/b123679.jar test.<anonymous> EXACT_MATCH\n" +
- "lib/b123679.jar test.Test$StaticClass$Member(test.Test.StaticClass, java.lang.Object) EXACT_MATCH\n" +
- "lib/b123679.jar test.Test$StaticClass$Member(test.Test.StaticClass, java.lang.Object) EXACT_MATCH\n" +
- "lib/b123679.jar pack.I123679 test.Test$StaticClass$Member.getParent() EXACT_MATCH"
- );
-}
-public void testBug123679_cu() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b123679.pack", "I123679.js");
- IType type = unit.getType("I123679");
- search(type, REFERENCES);
- assertSearchResults(
- "src/b123679/test/Test.java [b123679.pack.I123679] EXACT_MATCH\n" +
- "src/b123679/test/Test.java b123679.test.Test$StaticClass$Member.parent [I123679] EXACT_MATCH\n" +
- "src/b123679/test/Test.java b123679.test.Test$StaticClass$Member(Object):<anonymous>#1 [I123679] EXACT_MATCH\n" +
- "src/b123679/test/Test.java b123679.test.Test$StaticClass$Member(Object) [I123679] EXACT_MATCH\n" +
- "src/b123679/test/Test.java b123679.test.Test$StaticClass$Member(Object) [I123679] EXACT_MATCH\n" +
- "src/b123679/test/Test.java I123679 b123679.test.Test$StaticClass$Member.getParent() [I123679] EXACT_MATCH"
- );
-}
-public void testBug123679_wc() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/pack/I122679.js",
- "package pack;\n" +
- "public interface I123679 {\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/test/Test.js",
- "package test;\n" +
- "import pack.I123679;\n" +
- "public class Test {\n" +
- " static class StaticClass {\n" +
- " class Member {\n" +
- " private I123679 parent;\n" +
- " Member(Object obj) {\n" +
- " if (obj instanceof I123679) {\n" +
- " parent = (I123679) obj;\n" +
- " } else {\n" +
- " parent = new I123679() {};\n" +
- " }\n" +
- " }\n" +
- " I123679 getParent() {\n" +
- " return parent;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- IType type = workingCopies[0].getType("I123679");
- search(type, REFERENCES);
- assertSearchResults(
- // import reference is not found because package fragment and CU do not exist on disk
- // So, PackageReferenceLocator.isDeclaringPackageFragment(...) returns false and S.E. misses this match
- "src/test/Test.java test.Test$StaticClass$Member.parent [I123679] EXACT_MATCH\n" +
- "src/test/Test.java test.Test$StaticClass$Member(Object):<anonymous>#1 [I123679] EXACT_MATCH\n" +
- "src/test/Test.java test.Test$StaticClass$Member(Object) [I123679] EXACT_MATCH\n" +
- "src/test/Test.java test.Test$StaticClass$Member(Object) [I123679] EXACT_MATCH\n" +
- "src/test/Test.java I123679 test.Test$StaticClass$Member.getParent() [I123679] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 124469: [search] AIOOBE in PatternLocator when searching for dependency extent from manifest
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=124469"
- */
-public void testBug124469a() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- search(type, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar pack.E pack.A1.value() EXACT_MATCH\n" +
- "lib/b124469.jar pack.E[] pack.A1.list() EXACT_MATCH\n" +
- "lib/b124469.jar pack.E pack.A2.value() EXACT_MATCH\n" +
- "lib/b124469.jar pack.E[] pack.A2.list() EXACT_MATCH\n" +
- "lib/b124469.jar pack.E pack.A3.value() EXACT_MATCH\n" +
- "lib/b124469.jar pack.E[] pack.A3.list() EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH"
- );
-}
-public void testBug124469b() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "A1.class").getType();
- search(type, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar pack.A1 pack.A2.annot() EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH"
- );
-}
-public void testBug124469c() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "A2.class").getType();
- search(type, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar pack.A2 pack.A3.annot() EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH"
- );
-}
-public void testBug124469d() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "A3.class").getType();
- search(type, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH"
- );
-}
-public void testBug124469e() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CC");
- search(field, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH"
- );
-}
-public void testBug124469f() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CF");
- search(field, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH"
- );
-}
-public void testBug124469g() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CM");
- search(field, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH"
- );
-}
-public void testBug124469h() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CP");
- search(field, REFERENCES);
- assertSearchResults(
- "" // expected no result as parameters annotations are not stored in class file
- );
-}
-public void testBug124469i() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CV");
- search(field, REFERENCES);
- assertSearchResults(
- "" // expected no result as parameters annotations are not stored in class file
- );
-}
-public void testBug124469j() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CAC");
- search(field, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH\n" +
- "lib/b124469.jar test.C EXACT_MATCH"
- );
-}
-public void testBug124469k() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CAF");
- search(field, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH\n" +
- "lib/b124469.jar test.F.field EXACT_MATCH"
- );
-}
-public void testBug124469l() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CAM");
- search(field, REFERENCES);
- assertSearchResults(
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH\n" +
- "lib/b124469.jar void test.M.foo() EXACT_MATCH"
- );
-}
-public void testBug124469m() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CAP");
- search(field, REFERENCES);
- assertSearchResults(
- "" // expected no result as parameters annotations are not stored in class file
- );
-}
-public void testBug124469n() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
- IField field = type.getField("CAV");
- search(field, REFERENCES);
- assertSearchResults(
- "" // expected no result as parameters annotations are not stored in class file
- );
-}
-
-/**
- * Bug 124489: [search] correct results are missing in java search
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=124489"
- */
-public void testBug124489() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Foo.js",
- "public class Foo<T> {}"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/Bar.js",
- "public class Bar {\n" +
- " Foo<String> f = new Foo<String>();\n" +
- " Foo f2 = new Foo();\n" +
- "}"
- );
- IType type = workingCopies[0].getType("Foo");
- this.resultCollector.showRule = true;
- new SearchEngine(workingCopies).search(
- SearchPattern.createPattern(type, REFERENCES),
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- getJavaSearchScopeBugs(),
- this.resultCollector,
- null
- );
- assertSearchResults(
- "src/Bar.java Bar.f [Foo] ERASURE_MATCH\n" +
- "src/Bar.java Bar.f [Foo] ERASURE_MATCH\n" +
- "src/Bar.java Bar.f2 [Foo] ERASURE_RAW_MATCH\n" +
- "src/Bar.java Bar.f2 [Foo] ERASURE_RAW_MATCH"
- );
-}
-
-/**
- * @test Bug 124645: [search] for implementors does not find subclasses of binary classes
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=124645"
- */
-public void testBug124645a() throws CoreException {
- IClassFile classFile = getClassFile("JavaSearchBugs", "lib/b124645.jar", "xy", "BE_124645.class");
- IType type = classFile.getType();
- search(type, IMPLEMENTORS);
- assertSearchResults(
- "src/b124645/xy/X_124645.java b124645.xy.X_124645$Y [BE_124645] EXACT_MATCH\n" +
- "src/b124645/xy/Y_124645.java b124645.xy.Y_124645 [BE_124645] EXACT_MATCH\n" +
- "lib/b124645.jar xy.BX_124645$Y EXACT_MATCH\n" +
- "lib/b124645.jar xy.BY_124645 EXACT_MATCH"
- );
-}
-public void testBug124645b() throws CoreException {
- IClassFile classFile = getClassFile("JavaSearchBugs", "lib/b124645.jar", "test", "BE_124645.class");
- IType type = classFile.getType();
- search(type, IMPLEMENTORS);
- assertSearchResults(
- "src/b124645/test/A_124645.java b124645.test.A_124645 [BE_124645] EXACT_MATCH\n" +
- "src/b124645/test/A_124645.java void b124645.test.A_124645.m():<anonymous>#1 [BE_124645] EXACT_MATCH\n" +
- "src/b124645/test/X_124645.java b124645.test.X_124645 [BE_124645] EXACT_MATCH\n" +
- "src/b124645/test/X_124645.java void b124645.test.X_124645.m():Y_124645#1 [BE_124645] EXACT_MATCH\n" +
- "lib/b124645.jar test.BA_124645 EXACT_MATCH\n" +
- "lib/b124645.jar test.<anonymous> EXACT_MATCH\n" +
- "lib/b124645.jar test.BX_124645 EXACT_MATCH\n" +
- "lib/b124645.jar test.Y EXACT_MATCH"
- );
-}
-public void testBug124645c() throws CoreException {
- IClassFile classFile = getClassFile("JavaSearchBugs", "lib/b124645.jar", "", "BC_124645.class");
- IType type = classFile.getType();
- search(type, IMPLEMENTORS);
- assertSearchResults(
- "lib/b124645.jar <anonymous> EXACT_MATCH"
- );
-}
-public void testBug124645d() throws CoreException {
- IClassFile classFile = getClassFile("JavaSearchBugs", "lib/b124645.jar", "", "BI_124645.class");
- IType type = classFile.getType();
- search(type, IMPLEMENTORS);
- assertSearchResults(
- "lib/b124645.jar <anonymous> EXACT_MATCH"
- );
-}
-
-/**
- * Bug 125178: [search] AIOOBE in PatternLocator when searching for dependency extent from manifest
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125178"
- */
-public void testBug125178() throws CoreException {
- // Need a working copy as anonymous are not indexed...
- ProblemRequestor problemRequestor = new ProblemRequestor();
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b125178/X.js",
- "package b125178;\n" +
- "import pack.age.Test;\n" +
- "public class X {\n" +
- " public static void main(String[] args) {\n" +
- " new Test().foo(100);\n" +
- " }\n" +
- "}\n",
- new WorkingCopyOwner() {},
- problemRequestor
- );
- assertEquals("CU Should not have any problem!",
- "----------\n" +
- "----------\n",
- problemRequestor.problems.toString()
- );
-
- // Get anonymous from
- IPackageFragment jar = getPackageFragment("JavaSearchBugs", "lib/b125178.jar", "pack.age");
- IJavaScriptElement[] children = jar.getChildren();
- assertNotNull("We should have children for in default package of lib/b125178.jar", children);
- for (int i=0,l=children.length; i<l; i++) {
- assertTrue("Jar should only have class files!", children[i] instanceof ClassFile);
- IType type = ((ClassFile)children[i]).getType();
- if (type.isAnonymous()) {
- search(type, REFERENCES);
- }
- }
- assertSearchResults(
- "" // no result expected
- );
-}
-
-/**
- * Bug 126330: Type reference not found in jar file if sources was not already opened
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=126330"
- */
-public void testBug126330() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b126330.jar", "").getClassFile("A126330.class").getType();
- search(type, REFERENCES);
- assertSearchResults(
- "lib/b126330.jar B126330.a EXACT_MATCH"
- );
-}
-
-/**
- * Bug 127628: [index] CodeAssist doesn't filter deprecated types
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=127628"
- */
-public void testBug127628() throws CoreException {
- class DeprecatedTypesRequestor extends SearchTests.SearchTypeNameRequestor {
- public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) {
- if ((modifiers & ClassFileConstants.AccDeprecated) != 0) {
- char[] typeName =
- CharOperation.concat(
- CharOperation.concatWith(enclosingTypeNames, '$'),
- simpleTypeName,
- '$');
- results.addElement(new String(CharOperation.concat(packageName, typeName, '.')));
- }
- }
- }
- TypeNameRequestor requestor = new DeprecatedTypesRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_PATTERN_MATCH, // case insensitive
- TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "b127628.Test127628",
- requestor);
-}
-
-/**
- * Bug 128877: [search] reports inexistent IFunction for binary constructor of inner class
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=128877"
- */
-public void testBug128877a() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b128877.jar", "pack").getClassFile("Test.class").getType();
- IFunction method = type.getFunction("Test", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "lib/b128877.jar pack.X$Sub(pack.X) EXACT_MATCH"
- );
-}
-public void testBug128877b() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b128877.jar", "pack").getClassFile("Test.class").getType();
- IFunction method = type.getFunction("Test", new String[] { "Ljava.lang.String;" });
- search(method, REFERENCES);
- assertSearchResults(
- "lib/b128877.jar pack.X$Sub(pack.X, java.lang.String) EXACT_MATCH"
- );
-}
-public void testBug128877c() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b128877.jar", "pack").getClassFile("Test.class").getType();
- IFunction method = type.getFunction("foo128877", new String[] { "I" });
- search(method, REFERENCES);
- assertSearchResults(
- "lib/b128877.jar pack.X$Sub(pack.X) EXACT_MATCH"
- );
-}
-
-/**
- * To get these tests search matches in a workspace, do NOT forget to modify files
- * to set them as working copies.
- *
- * @test Bug 130390: CamelCase algorithm cleanup and improvement
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=130390"
- */
-private void setUpBug130390() throws CoreException {
- workingCopies = new IJavaScriptUnit[4];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b130390/TZ.js",
- "package b130390;\n" +
- "public class TZ {\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b130390/TimeZone.js",
- "package b130390;\n" +
- "public class TimeZone{\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b130390/Npe.js",
- "package b130390;\n" +
- "public class Npe {\n" +
- "}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b130390/NullPointerException.js",
- "package b130390;\n" +
- "public class NullPointerException {\n" +
- "}\n"
- );
-}
-public void testBug130390() throws CoreException {
- setUpBug130390();
- search("NuPoEx", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH"
- );
-}
-public void testBug130390b() throws CoreException {
- setUpBug130390();
- search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH\n" +
- "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH"
- );
-}
-public void testBug130390c() throws CoreException {
- setUpBug130390();
- search("NPE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE);
- assertSearchResults(
- "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH"
- );
-}
-public void testBug130390d() throws CoreException {
- setUpBug130390();
- search("Npe", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH"
- );
-}
-public void testBug130390e() throws CoreException {
- setUpBug130390();
- search("Npe", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE);
- assertSearchResults(
- "src/b130390/Npe.java b130390.Npe [Npe] EXACT_MATCH"
- );
-}
-public void testBug130390f() throws CoreException {
- setUpBug130390();
- search("NullPE", TYPE, ALL_OCCURRENCES, SearchPattern.R_CAMELCASE_MATCH);
- assertSearchResults(
- "src/b130390/NullPointerException.java b130390.NullPointerException [NullPointerException] EXACT_MATCH"
- );
-}
-public void testBug130390g() throws CoreException {
- setUpBug130390();
- search("TZ", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE);
- assertSearchResults(
- "src/b130390/TZ.java b130390.TZ [TZ] EXACT_MATCH\n" +
- "src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH"
- );
-}
-public void testBug130390h() throws CoreException {
- setUpBug130390();
- search("TiZo", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_CASE_SENSITIVE);
- assertSearchResults(
- "src/b130390/TimeZone.java b130390.TimeZone [TimeZone] EXACT_MATCH"
- );
-}
-/**
- * To get these tests search matches in a workspace, do NOT forget to modify files
- * to set them as working copies.
- *
- * @test Bug 137087: Open Type - missing matches when using mixed case pattern
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=137087"
- */
-public void testBug137087() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "runtimeEx";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH"
- );
-}
-public void testBug137087b() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "Runtimeex";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH"
- );
-}
-public void testBug137087c() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "runtimeexception";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- "" // no match expected as this is not a valid camel case
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.RuntimeException EXACT_MATCH"
- );
-}
-public void testBug137087d() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "Runtimexception";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- "" // no match expected as pattern is missing a 'e'
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- "" // no match expected as pattern is missing a 'e'
- );
-}
-public void testBug137087e() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "IllegalMSException";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.IllegalMonitorStateException EXACT_MATCH"
- );
-}
-public void testBug137087f() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "illegalMsExceptionSException";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- "" // expected no result as uppercase characters in pattern do not match any camelcase ones in existing types
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- "" // expected no result as uppercase characters in pattern do not match any camelcase ones in existing types
- );
-}
-public void testBug137087g() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "clonenotsupportedex";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- "" // no match expected as this is not a valid camel case
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
-}
-public void testBug137087h() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "CloneNotSupportedEx";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
-}
-public void testBug137087i() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "cloneNotsupportedEx";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
-}
-public void testBug137087j() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "ClonenotSupportedexc";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
-}
-public void testBug137087k() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "cloneNotSupportedExcep";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
-}
-public void testBug137087l() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "Clonenotsupportedexception";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
-}
-public void testBug137087m() throws CoreException {
- // Search CamelCase
- int matchRule = SearchPattern.R_CAMELCASE_MATCH;
- String pattern = "CloneNotSupportedException";
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
- // Search like UI does (ie. replace it with prefix if it's not a valid CamelCase)
- int validatedRule = SearchPattern.validateMatchRule(pattern, matchRule);
- if (validatedRule != matchRule) {
- matchRule = SearchPattern.R_PREFIX_MATCH;
- }
- search(pattern, TYPE, DECLARATIONS, matchRule);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.CloneNotSupportedException EXACT_MATCH"
- );
-}
-/**
- * Bug 137984: [search] Field references not found when type is a qualified member type [regression]
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=137984"
- */
-public void testBug137984_jar() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b137984.jar", "").getClassFile("CJ.class").getType();
- IField field = type.getField("c3");
- search(field, REFERENCES);
- assertSearchResults(
- "lib/b137984.jar CJ(int) EXACT_MATCH"
- );
-}
-public void testBug137984_cu() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JavaSearchBugs", "src", "b137984", "C.js");
- IField field = unit.getType("C").getField("c3");
- search(field, REFERENCES);
- assertSearchResults(
- "src/b137984/C.java b137984.C(int) [c3] EXACT_MATCH"
- );
-}
-public void testBug137984_wc() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/CW.js",
- "public class CW {\n" +
- " CW2 c2;\n" +
- " CW2.CW3 c3;\n" +
- " CW(int c) {\n" +
- " c2 = new CW2(c);\n" +
- " c3 = c2.new CW3(c);\n" +
- " }\n" +
- " class CW2 {\n" +
- " CW2(int x) {}\n" +
- " class CW3 {\n" +
- " CW3(int x) {}\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
- IField field = workingCopies[0].getType("CW").getField("c3");
- search(field, REFERENCES);
- assertSearchResults(
- "src/CW.java CW(int) [c3] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 140156: [1.5][search] Invalid method handle with parameterized parameters when no source is attached
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=140156"
- */
-public void testBug140156() throws CoreException {
- IType type = getPackageFragment("JavaSearchBugs", "lib/b140156.jar", "").getClassFile("X.class").getType();
- IFunction method = type.getFunctions()[1];
- assertEquals("Search wrong method!!!", "foo", method.getElementName());
- search(method, DECLARATIONS);
- assertSearchResults(
- "lib/b140156.jar void X.foo(List<T>) [No source] EXACT_MATCH"
- );
-}
-
-/**
- * Bug 144044: [search] NPE when trying to find references to field variable
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=144044"
- */
-public void testBug144044() throws CoreException {
- workingCopies = new IJavaScriptUnit[2];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/test1/p/Test.js",
- "package test1.p;\n" +
- "import test1.q.X;\n" +
- "public class Test {\n" +
- " String foo(X val) {\n" +
- " return val.str;\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/test1/q/X.js",
- "package test1.q;\n" +
- "public class X {\n" +
- " String str;\n" +
- "}\n"
- );
- IType type = this.workingCopies[1].getType("X");
- IField field = type.getField("str");
- search(field, REFERENCES);
- assertSearchResults(
- "src/test1/p/Test.java String test1.p.Test.foo(X) [str] POTENTIAL_MATCH"
- );
-}
-public void testBug144044b() throws CoreException {
- workingCopies = new IJavaScriptUnit[4];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/test2/p/Test.js",
- "package test2.p;\n" +
- "import test2.q.X;\n" +
- "public class Test {\n" +
- " X foo() {\n" +
- " return X.y_field.z_field.x_field.y_field.z_field.x_field;\n" +
- " }\n" +
- "}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/test2/q/X.js",
- "package test2.q;\n" +
- "public class X {\n" +
- " public static Y y_field;\n" +
- "}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/test2/q/Y.js",
- "package test2.q;\n" +
- "public class Y {\n" +
- " public static Z z_field;\n" +
- "}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/test2/q/Z.js",
- "package test2.q;\n" +
- "public class Z {\n" +
- " static X x_field;\n" +
- "}\n"
- );
- IType type = this.workingCopies[3].getType("Z");
- IField field = type.getField("x_field");
- search(field, REFERENCES);
- assertSearchResults(
- "src/test2/p/Test.java X test2.p.Test.foo() [x_field] POTENTIAL_MATCH\n" +
- "src/test2/p/Test.java X test2.p.Test.foo() [x_field] POTENTIAL_MATCH"
- );
-}
-
-/**
- * Bug 148215: [search] correct results are missing in java search
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=148215"
- */
-public void testBug148215_Types() throws CoreException {
- addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b148215.jar", false);
- try {
- IType type = getClassFile("JavaSearchBugs", "lib/b148215.jar", "test.pack", "Test.class").getType();
- IFunction method = type.getFunctions()[1];
- searchDeclarationsOfReferencedTypes(method, this.resultCollector);
- assertSearchResults(
- ""+ getExternalJCLPathString("1.5") + " java.lang.Object EXACT_MATCH\n" +
- ""+ getExternalJCLPathString("1.5") + " java.lang.String EXACT_MATCH\n" +
- "lib/b148215.jar test.def.Reference EXACT_MATCH"
- );
- }
- finally {
- removeLibraryEntry(JAVA_PROJECT, new Path("/JavaSearchBugs/lib/b148215.jar"));
- }
-}
-public void testBug148215_Messages() throws CoreException {
- addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b148215.jar", false);
- try {
- IType type = getClassFile("JavaSearchBugs", "lib/b148215.jar", "test.pack", "Test.class").getType();
- IFunction method = type.getFunctions()[1];
- searchDeclarationsOfSentMessages(method, this.resultCollector);
- assertSearchResults(
- "lib/b148215.jar void test.pack.Test.bar(java.lang.String) EXACT_MATCH\n" +
- "lib/b148215.jar void test.pack.Test.bar(test.def.Reference) EXACT_MATCH"
- );
- }
- finally {
- removeLibraryEntry(JAVA_PROJECT, new Path("/JavaSearchBugs/lib/b148215.jar"));
- }
-}
-public void testBug148215_Fields() throws CoreException {
- addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b148215.jar", false);
- try {
- IType type = getClassFile("JavaSearchBugs", "lib/b148215.jar", "test.pack", "Test.class").getType();
- IFunction method = type.getFunctions()[1];
- searchDeclarationsOfAccessedFields(method, this.resultCollector);
- assertSearchResults(
- "lib/b148215.jar test.pack.Test.sField EXACT_MATCH\n" +
- "lib/b148215.jar test.pack.Test.rField EXACT_MATCH"
- );
- }
- finally {
- removeLibraryEntry(JAVA_PROJECT, new Path("/JavaSearchBugs/lib/b148215.jar"));
- }
-}
-
-/**
- * @bug 148380: [search] get IType from TypeNameRequestor result
- * @test new SearchEngine.searchAllTypeName API method using {@link TypeNameMatchRequestor}
- * instead of {@link TypeNameRequestor}
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=148380"
- */
-public void testBug148380_SearchAllTypes_wc() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[4];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b148380/I.js",
- "package b148380;\n" +
- "public interface I {}\n"
- );
- workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b148380/X.js",
- "package b148380;\n" +
- "public class X {}\n"
- );
- workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b148380/Sub.js",
- "package b148380;\n" +
- "public class Sub extends X {}\n"
- );
- workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b148380/Y.js",
- "package b148380;\n" +
- "public class Y {}\n"
- );
- IJavaScriptSearchScope scope = getJavaSearchScopeBugs();
- TypeNameMatchCollector requestor1 = new TypeNameMatchCollector();
- new SearchEngine(this.workingCopies).searchAllTypeNames(
- "b148380".toCharArray(),
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_EXACT_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor1,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- String expected = "class Sub [in [Working copy] Sub.java [in b148380 [in src [in JavaSearchBugs]]]]\n" +
- "class X [in [Working copy] X.java [in b148380 [in src [in JavaSearchBugs]]]]\n" +
- "class Y [in [Working copy] Y.java [in b148380 [in src [in JavaSearchBugs]]]]\n" +
- "interface I [in [Working copy] I.java [in b148380 [in src [in JavaSearchBugs]]]]";
- assertSearchResults(expected, requestor1);
- // Expected same result with the wc owner
- TypeNameMatchCollector requestor2 = new TypeNameMatchCollector();
- new SearchEngine(this.wcOwner).searchAllTypeNames(
- "b148380".toCharArray(),
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_EXACT_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor2,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- assertSearchResults(expected, requestor2);
-}
-public void testBug148380_SearchAllTypes_cu() throws CoreException, JavaScriptModelException {
- IJavaScriptSearchScope scope = getJavaSearchScopeBugs();
- TypeNameMatchCollector requestor = new TypeNameMatchCollector();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "Bug".toCharArray(),
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- assertSearchResults(
- "Bug148380 (not open) [in Bug148380.class [in <default> [in lib [in JavaSearchBugs]]]]",
- requestor
- );
-}
-public void testBug148380_SearchAllTypes_cu_wksp() throws CoreException, JavaScriptModelException {
- IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope();
- TypeNameMatchCollector requestor = new TypeNameMatchCollector();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "Bug".toCharArray(),
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- assertSearchResults(
- "Bug148380 (not open) [in Bug148380.class [in <default> [in lib [in JavaSearchBugs]]]]",
- requestor
- );
-}
-
-/**
- * Bug 156340: [search] searchAllTypeNames return nothing for empty prefix
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156340"
- */
-public void testBug156340() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- IPackageFragment fragment = getPackageFragment("JavaSearchBugs", getSystemJsPathString(), "java.lang");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] { fragment });
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- CharOperation.NO_CHAR,
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor,
- WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "java.lang.Class\n" +
- "java.lang.CloneNotSupportedException\n" +
- "java.lang.Error\n" +
- "java.lang.Exception\n" +
- "java.lang.IllegalMonitorStateException\n" +
- "java.lang.InterruptedException\n" +
- "java.lang.Object\n" +
- "java.lang.RuntimeException\n" +
- "java.lang.String\n" +
- "java.lang.Throwable",
- requestor);
-}
-
-/**
- * Bug 156491: [1.5][search] interfaces and annotations could be found with only one requets of searchAllTypeName
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156491"
- */
-public void testBug156491() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/pack/Test.js",
- "package pack;\n" +
- "public class Test {\n" +
- " void noMatch(Y y) {\n" +
- " y.toString();\n" +
- " toString();\n" +
- " }\n" +
- " void validMatches(X x) {\n" +
- " x.toString();\n" +
- " }\n" +
- " void superInvocationMatches(Object o) {\n" +
- " o.toString();\n" +
- " }\n" +
- " void interfaceMatches(I i) {\n" +
- " i.toString();\n" +
- " }\n" +
- " void subtypeMatches(Sub s) {\n" +
- " s.toString();\n" +
- " }\n" +
- "}\n" +
- "interface I {}\n" +
- "class X {\n" +
- " public String toString() {\n" +
- " return \"X\";\n" +
- " }\n" +
- "}\n" +
- "class Sub extends X {}\n" +
- "class Y {\n" +
- " public String toString() {\n" +
- " return \"Y\";\n" +
- " }\n" +
- "}\n"
- );
- IFunction method = workingCopies[0].getType("X").getFunction("toString", new String[0]);
- this.resultCollector.showFlavors = PatternLocator.SUPER_INVOCATION_FLAVOR;
- search(method, REFERENCES);
- assertSearchResults(
- "src/pack/Test.java void pack.Test.validMatches(X) [toString()] EXACT_MATCH\n" +
- "src/pack/Test.java void pack.Test.superInvocationMatches(Object) [toString()] EXACT_MATCH SUPER INVOCATION\n" +
- "src/pack/Test.java void pack.Test.subtypeMatches(Sub) [toString()] EXACT_MATCH"
- );
-}
-private void setUpBug156491() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/other/Test.js",
- "package other;\n" +
- "public class Test {\n" +
- " void testInterface(I i) {\n" +
- " i.test();\n" +
- " }\n" +
- " void testSuperInvocation(L1 l) {\n" +
- " l.test();\n" +
- " }\n" +
- " void testInvocation(L2 l) {\n" +
- " l.test();\n" +
- " }\n" +
- "}\n" +
- "class L1 implements I {\n" +
- " public void test() {}\n" +
- "}\n" +
- "interface I {\n" +
- " void test();\n" +
- "}\n" +
- "class L2 extends L1 {\n" +
- " public void test() {}\n" +
- "}"
- );
-}
-public void testBug156491a() throws CoreException {
- resultCollector.showRule = true;
- setUpBug156491();
- IFunction method = workingCopies[0].getType("L2").getFunction("test", new String[0]);
- this.resultCollector.showFlavors = PatternLocator.SUPER_INVOCATION_FLAVOR;
- search(method, REFERENCES);
- assertSearchResults(
- "src/other/Test.java void other.Test.testInterface(I) [test()] EXACT_MATCH SUPER INVOCATION\n" +
- "src/other/Test.java void other.Test.testSuperInvocation(L1) [test()] EXACT_MATCH SUPER INVOCATION\n" +
- "src/other/Test.java void other.Test.testInvocation(L2) [test()] EXACT_MATCH"
- );
-}
-public void testBug156491b() throws CoreException {
- resultCollector.showRule = true;
- setUpBug156491();
- IFunction method = workingCopies[0].getType("L1").getFunction("test", new String[0]);
- this.resultCollector.showFlavors = PatternLocator.SUPER_INVOCATION_FLAVOR;
- search(method, REFERENCES);
- assertSearchResults(
- "src/other/Test.java void other.Test.testInterface(I) [test()] EXACT_MATCH SUPER INVOCATION\n" +
- "src/other/Test.java void other.Test.testSuperInvocation(L1) [test()] EXACT_MATCH"
- // since bug 160301 fix, subclass overridden method calls are not reported
- //"src/other/Test.java void other.Test.testInvocation(L2) [test()] EXACT_MATCH"
- );
-}
-/**
- * @bug 160301: [search] too many matches found for method references
- * @test Ensure that correct number of method references are found
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160301"
- */
-public void testBug160301() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.js",
- "public class Test {\n" +
- " class A {\n" +
- " void foo() {}\n" +
- " void bar() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- " class B extends A {\n" +
- " void foo() {}\n" +
- " void bar() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- " class C extends B {\n" +
- " void method() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IFunction method = workingCopies[0].getType("Test").getType("A").getFunction("foo", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/Test.java void Test$A.bar() [foo()] EXACT_MATCH"
- );
-}
-public void testBug160301b() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " class A {\n" +
- " void foo() {}\n" +
- " }\n" +
- " class B extends A {}\n" +
- " class C extends B {\n" +
- " void foo() {}\n" +
- " }\n" +
- " class D extends C {}\n" +
- " void a() {\n" +
- " new A().foo();\n" +
- " }\n" +
- " void b() {\n" +
- " new B().foo();\n" +
- " }\n" +
- " void c() {\n" +
- " new C().foo();\n" +
- " }\n" +
- " void d() {\n" +
- " new D().foo();\n" +
- " }\n" +
- " \n" +
- "}"
- );
- IFunction method = workingCopies[0].getType("Test").getType("A").getFunction("foo", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/test/Test.java void test.Test.a() [foo()] EXACT_MATCH\n" +
- "src/test/Test.java void test.Test.b() [foo()] EXACT_MATCH"
- );
-}
-public void testBug160301_Interface() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.js",
- "public class Test {\n" +
- " interface I {\n" +
- " void foo();\n" +
- " }\n" +
- " class A1 implements I {\n" +
- " public void foo() {}\n" +
- " void a1() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- " class B1 extends A1 {\n" +
- " void b1() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- " class C1 extends B1 {\n" +
- " public void foo() {}\n" +
- " void c1() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- " abstract class A2 implements I {\n" +
- " void a2() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- " class B2 extends A2 {\n" +
- " public void foo() {}\n" +
- " void b2() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- " class A3 implements I {\n" +
- " public void foo() {}\n" +
- " void a3() {\n" +
- " foo();\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IFunction method = workingCopies[0].getType("Test").getType("I").getFunction("foo", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/Test.java void Test$A1.a1() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$B1.b1() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$A2.a2() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$B2.b2() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$A3.a3() [foo()] EXACT_MATCH"
- );
-}
-public void testBug160301_Abstract() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.js",
- "public class Test {\n" +
- " abstract class Abstract {\n" +
- " abstract void foo();\n" +
- " }\n" +
- " class A1 extends Abstract {\n" +
- " public void foo() {}\n" +
- " void a1() {\n" +
- " foo(); // valid match as A1.foo() is the first override in sub-class\n" +
- " }\n" +
- " }\n" +
- " class B1 extends A1 {\n" +
- " void b1() {\n" +
- " foo(); // valid match as B1 does not override A.foo()\n" +
- " }\n" +
- " }\n" +
- " class C1 extends B1 {\n" +
- " public void foo() {}\n" +
- " void c1() {\n" +
- " foo(); // invalid match as C1 does override A.foo()\n" +
- " }\n" +
- " }\n" +
- " abstract class A2 extends Abstract {\n" +
- " void a2() {\n" +
- " foo(); // valid match as A2 does not override Abstract.foo()\n" +
- " }\n" +
- " }\n" +
- " class B2 extends A2 {\n" +
- " public void foo() {}\n" +
- " void b2() {\n" +
- " foo(); // valid match as B2.foo() is the first override in sub-class\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IFunction method = workingCopies[0].getType("Test").getType("Abstract").getFunction("foo", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/Test.java void Test$A1.a1() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$B1.b1() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$A2.a2() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$B2.b2() [foo()] EXACT_MATCH"
- );
-}
-public void testBug160301_Abstract2() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.js",
- "public class Test {\n" +
- " abstract class Abstract {\n" +
- " public abstract void foo();\n" +
- " }\n" +
- " abstract class A extends Abstract {\n" +
- " public abstract void foo();\n" +
- " void a() {\n" +
- " foo(); // valid match as A is abstract => does not override Abstract.foo()\n" +
- " }\n" +
- " }\n" +
- " class B extends A {\n" +
- " public void foo() {}\n" +
- " void b() {\n" +
- " foo(); // valid match as B.foo() is the first override in sub-class\n" +
- " }\n" +
- " }\n" +
- " class C extends B {\n" +
- " public void foo() {}\n" +
- " void c() {\n" +
- " foo(); // invalid match as C.foo() overrides Abstract.foo() \n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IFunction method = workingCopies[0].getType("Test").getType("Abstract").getFunction("foo", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/Test.java void Test$A.a() [foo()] EXACT_MATCH\n" +
- "src/Test.java void Test$B.b() [foo()] EXACT_MATCH"
- );
-}
-public void testBug160301_Abstract3() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/Test.js",
- "public class Test {\n" +
- " abstract class Abstract {\n" +
- " public abstract void foo();\n" +
- " }\n" +
- " class A extends Abstract {\n" +
- " public void foo() {}\n" +
- " void a() {\n" +
- " foo(); // valid match as A.foo() is the first override in sub-class\n" +
- " }\n" +
- " }\n" +
- " abstract class B extends A {\n" +
- " public abstract void foo();\n" +
- " void b() {\n" +
- " foo(); // invalid match as B.foo() is hidden by the override A.foo()\n" +
- " }\n" +
- " }\n" +
- " class C extends B {\n" +
- " public void foo() {}\n" +
- " void c() {\n" +
- " foo(); // invalid match as C.foo() overrides A.foo()\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IFunction method = workingCopies[0].getType("Test").getType("Abstract").getFunction("foo", new String[0]);
- search(method, REFERENCES);
- assertSearchResults(
- "src/Test.java void Test$A.a() [foo()] EXACT_MATCH"
- );
-}
-
-/**
- * @bug 160323: [search] TypeNameMatch: support hashCode/equals
- * @test Ensure that match equals and hashCode methods return same values than those of stored {@link IType}.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160323"
- */
-public void testBug160323() throws CoreException {
- // Search all type names with TypeNameMatchRequestor
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- getJavaSearchScopeBugs(),
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with TypeNameRequestor
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Should have same types with these 2 searches
- assertTrue("We should get some types!", collector.size() > 0);
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-
-/**
- * @bug 160324: [search] SearchEngine.searchAllTypeNames(char[][], char[][], TypeNameMatchRequestor
- * @test Ensure that types found using {@link SearchEngine#searchAllTypeNames(char[][], char[][], IJavaScriptSearchScope, TypeNameMatchRequestor, int, org.eclipse.core.runtime.IProgressMonitor) new API method}
- * are the same than with already existing API method using {@link TypeNameRequestor}...
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160324"
- */
-public void testBug160324a() throws CoreException {
- boolean debug = false;
- // Search all type names with new API
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- new SearchEngine().searchAllTypeNames(
- null,
- null,
- getJavaSearchScopeBugs(),
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with old API
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- null,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- if (debug) System.out.println("TypeNameRequestor results: \n"+requestor);
- // Should have same types with these 2 searches
- assertTrue("We should get some types!", collector.size() > 0);
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-public void testBug160324b() throws CoreException {
- // Search all type names with new API
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- new SearchEngine().searchAllTypeNames(
- null,
- new char[][] { "Test".toCharArray() },
- getJavaSearchScopeBugs(),
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with old API
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- new char[][] { "Test".toCharArray() },
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Should have same types with these 2 searches
- assertTrue("We should get some types!", collector.size() > 0);
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-
-/**
- * @bug 160494: [search] searchAllTypeNames(char[][], char[][],...) fails to find types in default package
- * @test Ensure that types of default packge are found when empty package is specified in package lists
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160494"
- */
-public void testBug160324c() throws CoreException {
- boolean debug = false;
- char[][] packagesList = new char[][] {
- CharOperation.NO_CHAR,
- "b110422".toCharArray(),
- "b123679.test".toCharArray(),
- "b89848".toCharArray(),
- "b95794".toCharArray(),
- "pack".toCharArray(),
- "pack.age".toCharArray()
- };
- char[][] typesList = new char[][] {
- "Test".toCharArray(),
- "TestPrefix".toCharArray()
- };
- // Search all type names with new API
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- new SearchEngine().searchAllTypeNames(
- packagesList,
- typesList,
- getJavaSearchScopeBugs(),
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- if (debug) System.out.println("TypeNameMatchRequestor results: \n"+collector);
- // Search all type names with old API
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- packagesList,
- typesList,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- if (debug) System.out.println("TypeNameRequestor results: \n"+requestor);
- // Should have same types with these 2 searches
- assertEquals("Wrong number of found types!", packagesList.length, collector.size());
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-
-/**
- * @bug 160854: [search] No type is found using seachAllTypeNames(char[][],char[][],...) methods when no type names is specified
- * @test Ensure that types are found when typeNames parameter is null...
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160854"
- */
-public void testBug160854() throws CoreException {
- char[][] packagesList = new char[][] {
- "java.lang".toCharArray()
- };
- // Search all type names with new API
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- new SearchEngine().searchAllTypeNames(
- packagesList,
- null,
- getJavaSearchScopeBugs(),
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with old API
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- packagesList,
- null,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Should have same types with these 2 searches
- assertSearchResults("Wrong types found!",
- "java.lang.CharSequence\n" +
- "java.lang.Class\n" +
- "java.lang.CloneNotSupportedException\n" +
- "java.lang.Comparable\n" +
- "java.lang.Enum\n" +
- "java.lang.Error\n" +
- "java.lang.Exception\n" +
- "java.lang.IllegalMonitorStateException\n" +
- "java.lang.InterruptedException\n" +
- "java.lang.Object\n" +
- "java.lang.RuntimeException\n" +
- "java.lang.String\n" +
- "java.lang.Throwable",
- requestor
- );
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-
-/**
- * @bug 161028: [search] NPE on organize imports in TypeNameMatch.equals
- * @test Ensure that no NPE may happen calling <code>equals(Object)</code>,
- * <code>hashCode()</code> or <code>toString()</code> methods.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=161028"
- */
-public void testBug161028() throws CoreException {
- TypeNameMatch match1 = SearchEngine.createTypeNameMatch(null, 0);
- assertEquals("Should be equals!", match1, match1);
- assertEquals("Wrong toString value!", "org.eclipse.wst.jsdt.internal.core.search.JavaSearchTypeNameMatch@0", match1.toString());
- TypeNameMatch match2 = SearchEngine.createTypeNameMatch(null, 0);
- assertFalse("Should NOT be identical!", match1 == match2);
- assertTrue("Should be equals!", match1.equals(match2));
- assertTrue("Should be equals!", match2.equals(match1));
- assertEquals("Wrong toString value!", match1, match2);
- assertEquals("Should have same hashCode!", match1.hashCode(), match2.hashCode());
-}
-
-/**
- * @bug 161190: [search] All type search doesn't find all types
- * @test Ensure that access rules does not change searchAllTypeNames results.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=161190"
- */
-public void testBug161190() throws CoreException {
- char[][] packagesList = new char[][] {
- "xy".toCharArray()
- };
- // Search all type names with new API
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- new SearchEngine().searchAllTypeNames(
- packagesList,
- null,
- getJavaSearchScopeBugs(),
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with old API
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- packagesList,
- null,
- getJavaSearchScopeBugs(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- assertSearchResults("Wrong types found!",
- "xy.BE_124645\n" +
- "xy.BX_124645\n" +
- "xy.BY_124645",
- requestor
- );
- // Should have same types with these 2 searches
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-
-/**
- * @bug 163984: [search] no results from SearchEngine.searchAllTypeNames with types in scope
- * @test Ensure that types are found even when scope is made of elements
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=163984"
- */
-public void testBug163984() throws CoreException {
- // Search all type names with TypeNameMatchRequestor
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- IJavaScriptUnit[] elements = getCompilationUnits("JavaSearchBugs", "src", "b163984");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- new char[] { '*' },
- SearchPattern.R_PATTERN_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with TypeNameRequestor
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- new char[] { '*' },
- SearchPattern.R_PATTERN_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Should have same types with these 2 searches
- assertEquals("We should get 3 types!", 3, collector.size());
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-
-/**
- * @bug 164121: [search] Misses declarations of method parameters
- * @test Ensure that param declaration are correctly found by search engine
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=164121"
- */
-private void setUpBug164121() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/A.js",
- "class A {\n" +
- " int x(int param) {\n" +
- " param = 2 + 2;\n" +
- " int x = param + 2;\n" +
- " return param - x;\n" +
- " }\n" +
- "}\n"
- );
-}
-public void testBug164121a() throws CoreException {
- resultCollector.showRule = true;
- setUpBug164121();
- ILocalVariable param = getLocalVariable(this.workingCopies[0], "param", "param");
- search(param, DECLARATIONS);
- assertSearchResults(
- "src/A.java int A.x(int).param [param] EXACT_MATCH"
- );
-}
-public void testBug164121b() throws CoreException {
- resultCollector.showRule = true;
- setUpBug164121();
- ILocalVariable param = getLocalVariable(this.workingCopies[0], "param", "param");
- search(param, ALL_OCCURRENCES);
- assertSearchResults(
- "src/A.java int A.x(int).param [param] EXACT_MATCH\n" +
- "src/A.java int A.x(int) [param] EXACT_MATCH\n" +
- "src/A.java int A.x(int) [param] EXACT_MATCH\n" +
- "src/A.java int A.x(int) [param] EXACT_MATCH"
- );
-}
-
-/**
- * @bug 164791: [search] Type reference reports anonymous type in invalid class file
- * @test Ensure that match on anonymous type in local type is well reported
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=164791"
- */
-public void testBug164791() throws CoreException {
- IType type = getClassFile("JavaSearchBugs", "lib/b164791.jar", "pack", "ELPM.class").getType();
- JavaSearchResultCollector collector = new JavaSearchResultCollector() {
- public void acceptSearchMatch(SearchMatch searchMatch) throws CoreException {
- super.acceptSearchMatch(searchMatch);
- IJavaScriptElement element = (IJavaScriptElement) searchMatch.getElement();
- assertTrue("Search match element "+element.getElementName()+" should exist!!!", element.exists());
- }
- };
- collector.showAccuracy = true;
- search(type, REFERENCES, getJavaSearchScopeBugs(), collector);
- assertSearchResults(
- "lib/b164791.jar test.<anonymous> EXACT_MATCH\n" +
- "lib/b164791.jar test.<anonymous> EXACT_MATCH",
- collector
- );
-}
-
-/**
- * @bug 166348: [search] Stack trace console resolves wrong source
- * @test Ensure that only type with same qualification is found in class files
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=166348"
- */
-public void testBug166348() throws CoreException {
- search("Test166348", TYPE, DECLARATIONS);
- assertSearchResults(
- "lib/b166348.jar pack.Test166348 [No source] EXACT_MATCH\n" +
- "lib/b166348.jar test.Test166348 [No source] EXACT_MATCH"
- );
-}
-public void testBug166348_Qualified() throws CoreException {
- search("test.Test166348", TYPE, DECLARATIONS);
- assertSearchResults(
- "lib/b166348.jar test.Test166348 [No source] EXACT_MATCH"
- );
-}
-
-/**
- * @bug 167190: [search] TypeNameMatchRequestorWrapper causing ClassCastException
- * @test Ensure that types are found even when scope is not a {@link org.eclipse.wst.jsdt.internal.core.search.JavaSearchScope}
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=167190"
- */
-public void testBug167190() throws CoreException, JavaScriptModelException {
- IJavaScriptSearchScope scope = new AbstractSearchScope() {
- IJavaScriptSearchScope jsScope = getJavaSearchScopeBugs();
- public void processDelta(IJavaScriptElementDelta delta) {
- // we should have no delta on this test case
- }
- public boolean encloses(String resourcePath) {
- return this.jsScope.encloses(resourcePath);
- }
- public boolean encloses(IJavaScriptElement element) {
- return this.jsScope.encloses(element);
- }
- public IPath[] enclosingProjectsAndJars() {
- return this.jsScope.enclosingProjectsAndJars();
- }
- };
- TypeNameMatchCollector requestor = new TypeNameMatchCollector();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "C".toCharArray(), // need a prefix which returns most of different types (class file, CU, member,...)
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- assertSearchResults(
- "C (not open) [in C.class [in test [in lib/b124469.jar [in JavaSearchBugs]]]]\n" +
- "C (not open) [in C.java [in b137984 [in src [in JavaSearchBugs]]]]\n" +
- "C (not open) [in C.java [in b137984 [in src [in JavaSearchBugs]]]]\n" +
- "C (not open) [in C.java [in b163984 [in src [in JavaSearchBugs]]]]\n" +
- "C2 (not open) [in C [in C.java [in b137984 [in src [in JavaSearchBugs]]]]]\n" +
- "C86293 (not open) [in C86293.class [in <default> [in lib/b86293.jar [in JavaSearchBugs]]]]\n" +
- "CJ (not open) [in CJ.class [in <default> [in lib/b137984.jar [in JavaSearchBugs]]]]\n" +
- "CJ2 (not open) [in CJ$CJ2.class [in <default> [in lib/b137984.jar [in JavaSearchBugs]]]]\n" +
- "CJ3 (not open) [in CJ$CJ2$CJ3.class [in <default> [in lib/b137984.jar [in JavaSearchBugs]]]]\n" +
- "C_124645 (not open) [in T_124645.java [in b124645 [in src [in JavaSearchBugs]]]]\n" +
- "CharSequence (not open) [in CharSequence.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]\n" +
- "Class (not open) [in Class.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]\n" +
- "CloneNotSupportedException (not open) [in CloneNotSupportedException.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]\n" +
- "Collection (not open) [in Collection.class [in b87627 [in lib/b87627.jar [in JavaSearchBugs]]]]\n" +
- "Comparable (not open) [in Comparable.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]\n" +
- "Test (not open) [in Test.java [in b95794 [in src [in JavaSearchBugs]]]]",
- requestor
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchJavadocTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchJavadocTests.java
deleted file mode 100644
index 53e244c..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchJavadocTests.java
+++ /dev/null
@@ -1,926 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-
-/**
- * Tests the Java search engine in Javadoc comment.
- *
- * @see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=45518">bug 45518</a>
- * @see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=46761">bug 46761</a>
- */
-public class JavaSearchJavadocTests extends JavaSearchTests {
-
- Map originalOptions;
-
- /**
- * @param name
- */
- public JavaSearchJavadocTests(String name) {
- super(name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.SuiteOfTestCases#setUpSuite()
- */
- protected void setUp() throws Exception {
- super.setUp();
- this.originalOptions = JAVA_PROJECT.getOptions(true);
- JAVA_PROJECT.setOption(JavaScriptCore.COMPILER_DOC_COMMENT_SUPPORT, JavaScriptCore.ENABLED);
- this.resultCollector.showAccuracy = true;
- this.resultCollector.showInsideDoc = true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.SuiteOfTestCases#tearDownSuite()
- */
- public void tearDown() throws Exception {
- JAVA_PROJECT.setOptions(originalOptions);
- super.tearDown();
- }
- private void setJavadocOptions() {
- JAVA_PROJECT.setOption(JavaScriptCore.COMPILER_PB_INVALID_JAVADOC, JavaScriptCore.WARNING);
- JAVA_PROJECT.setOption(JavaScriptCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS, JavaScriptCore.ERROR);
- }
- private void disableJavadocOptions() {
- JAVA_PROJECT.setOption(JavaScriptCore.COMPILER_DOC_COMMENT_SUPPORT, JavaScriptCore.DISABLED);
- }
- public static Test suite() {
-// return buildTestSuite(JavaSearchJavadocTests.class, "testJavadocMethod", null);
- return buildModelTestSuite(JavaSearchJavadocTests.class);
- }
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
-// TESTS_NAMES = new String[] { "testGenericFieldReferenceAC04" };
-// TESTS_NUMBERS = new int[] { 83285 };
-// TESTS_RANGE = new int[] { -1, -1 };
- }
-
- /*
- * Test search of type declaration in javadoc comments
- * ===================================================
- */
- public void testJavadocTypeDeclaration() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- search(
- type,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java j1.JavadocSearched [JavadocSearched] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocTypeStringDeclaration() throws CoreException {
- search(
- "JavadocSearched",
- TYPE,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java j1.JavadocSearched [JavadocSearched] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocTypeDeclarationWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- search(
- type,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java j1.JavadocSearched [JavadocSearched] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
-
- /*
- * Test search of field declaration in javadoc comments
- * ====================================================
- */
- public void testJavadocFieldDeclaration() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IField field = type.getField("javadocSearchedVar");
- search(
- field,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java j1.JavadocSearched.javadocSearchedVar [javadocSearchedVar] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocFieldStringDeclaration() throws CoreException {
- search(
- "javadocSearchedVar",
- FIELD,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java j1.JavadocSearched.javadocSearchedVar [javadocSearchedVar] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocFieldDeclarationWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IField field = type.getField("javadocSearchedVar");
- setJavadocOptions();
- search(
- field,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java j1.JavadocSearched.javadocSearchedVar [javadocSearchedVar] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
-
- /*
- * Test search of method declarations in javadoc comments
- * ======================================================
- */
- public void testJavadocMethodDeclaration() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("javadocSearchedMethod", null);
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java void j1.JavadocSearched.javadocSearchedMethod() [javadocSearchedMethod] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodArgDeclaration() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("javadocSearchedMethod", new String[] { "QString;" });
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java void j1.JavadocSearched.javadocSearchedMethod(String) [javadocSearchedMethod] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodStringDeclaration() throws CoreException {
- search(
- "javadocSearchedMethod",
- METHOD,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java void j1.JavadocSearched.javadocSearchedMethod() [javadocSearchedMethod] EXACT_MATCH OUTSIDE_JAVADOC\n" +
- "src/j1/JavadocSearched.java void j1.JavadocSearched.javadocSearchedMethod(String) [javadocSearchedMethod] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodDeclarationWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- IFunction method = type.getFunction("javadocSearchedMethod", null);
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java void j1.JavadocSearched.javadocSearchedMethod() [javadocSearchedMethod] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodArgDeclarationWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- IFunction method = type.getFunction("javadocSearchedMethod", new String[] { "QString;" });
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocSearched.java void j1.JavadocSearched.javadocSearchedMethod(String) [javadocSearchedMethod] EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
-
- /*
- * Test search of type references in javadoc comments
- * ==================================================
- */
- public void testJavadocTypeReference() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [j1.JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [j1.JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocTypeStringReference() throws CoreException {
- search(
- "JavadocSearched",
- TYPE,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocTypeReferenceWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [j1.JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [j1.JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocTypeStringReferenceWithJavadoc() throws CoreException {
- setJavadocOptions();
- search(
- "JavadocSearched",
- TYPE,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC\n"+
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocTypeStringReferenceWithJavadocDisabled() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- disableJavadocOptions();
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("", this.resultCollector);
- }
-
- /*
- * Test search of field references in javadoc comments
- * ===================================================
- */
- public void testJavadocFieldReference() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IField field = type.getField("javadocSearchedVar");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedVar] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocFieldStringReference() throws CoreException {
- search(
- "javadocSearchedVar",
- FIELD,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedVar] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocFieldReferenceWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IField field = type.getField("javadocSearchedVar");
- setJavadocOptions();
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedVar] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocFieldStringReferenceWithJavadoc() throws CoreException {
- setJavadocOptions();
- search(
- "javadocSearchedVar",
- FIELD,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedVar] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedVar] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocFieldStringReferenceWithJavadocDisabled() throws CoreException {
- disableJavadocOptions();
- search(
- "javadocSearchedVar",
- FIELD,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("", this.resultCollector);
- }
-
- /*
- * Test search of method references in javadoc comments
- * ====================================================
- */
- public void testJavadocMethodReference() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("javadocSearchedMethod", null);
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod()] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodArgReference() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("javadocSearchedMethod", new String[] { "QString;" });
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod(String)] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodStringReference() throws CoreException {
- search(
- "javadocSearchedMethod",
- METHOD,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod()] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod()] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod(String)] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodReferenceWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- IFunction method = type.getFunction("javadocSearchedMethod", null);
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod()] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodArgReferenceWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- IFunction method = type.getFunction("javadocSearchedMethod", new String[] { "QString;" });
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod(String)] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodStringReferenceWithJavadoc() throws CoreException {
- setJavadocOptions();
- search(
- "javadocSearchedMethod",
- METHOD,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod()] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [javadocSearchedMethod(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod()] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [javadocSearchedMethod(String)] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testJavadocMethodArgReferenceWithJavadocDisabled() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("javadocSearchedMethod", new String[] { "QString;" });
- disableJavadocOptions();
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("", this.resultCollector);
- }
-
- /*
- * Test search of constructor references in javadoc comments
- * ====================================================
- */
- public void testJavadocConstructorReference() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("JavadocSearched", null);
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched()] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testJavadocConstructorArgReference() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("JavadocSearched", new String[] { "QString;" });
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched(String)] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testJavadocConstructorStringReference() throws CoreException {
- search(
- "JavadocSearched",
- CONSTRUCTOR,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched()] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched(String)] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testJavadocConstructorReferenceWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- IFunction method = type.getFunction("JavadocSearched", null);
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched()] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testJavadocConstructorArgReferenceWithJavadoc() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- setJavadocOptions();
- IFunction method = type.getFunction("JavadocSearched", new String[] { "QString;" });
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched(String)] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testJavadocConstructorStringReferenceWithJavadoc() throws CoreException {
- setJavadocOptions();
- search(
- "JavadocSearched",
- CONSTRUCTOR,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched()] POTENTIAL_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocInvalidRef.java void j1.JavadocInvalidRef.invalid() [JavadocSearched(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched()] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j1/JavadocValidRef.java void j1.JavadocValidRef.valid() [JavadocSearched(String)] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testJavadocConstructorReferenceWithJavadocDisabled() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j1", "JavadocSearched.js").getType("JavadocSearched");
- IFunction method = type.getFunction("JavadocSearched", null);
- disableJavadocOptions();
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("");
- }
- private void setUpJavadocTypeParameterReferences() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearch15/src/b81190/Test.js",
- "package b81190;\n" +
- "/**\n" +
- " * @param <T1> First class type parameter\n" +
- " * @param <T2> Second class type parameter\n" +
- " * @param <T3> Last class type parameter\n" +
- " */\n" +
- "public class Test<T1, T2, T3> {\n" +
- " /**\n" +
- " * @param <U> Method type parameter\n" +
- " * @param x Method parameter\n" +
- " */\n" +
- " <U> void generic(U x, T1 t) {\n" +
- " Object o = x;\n" +
- " o.toString();\n" +
- " }\n" +
- "}\n"
- );
- }
- // Local variables references in Javadoc have been fixed while implementing 81190
- public void testJavadocParameterReferences01() throws CoreException {
- setUpJavadocTypeParameterReferences();
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(workingCopies);
- ILocalVariable local = selectLocalVariable(workingCopies[0], "x", 2);
- search(local, REFERENCES, scope);
- assertSearchResults(
- "src/b81190/Test.java void b81190.Test.generic(U, T1) [x] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b81190/Test.java void b81190.Test.generic(U, T1) [x] EXACT_MATCH OUTSIDE_JAVADOC"
- );
- }
-
- /**
- * Test fix for bug 47909.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=47909">47909</a>
- * @throws CoreException
- */
- public void testBug47909() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j3", "Y.js").getType("Y");
- setJavadocOptions();
- IFunction method = type.getFunction("Y", new String[] { "I" });
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "test47909.jar void j3.X.bar() EXACT_MATCH OUTSIDE_JAVADOC",
- this.resultCollector);
- }
-
- /**
- * Test fix for bug 47968.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=47968">47968</a>
- * @throws CoreException
- */
- public void testBug47968type() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j2", "Bug47968.js").getType("Bug47968");
- setJavadocOptions();
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- // These matches were not found before...
- "src/j2/Bug47968s.java j2.Bug47968s [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- // ...end
- "src/j2/Bug47968s.java j2.Bug47968s.y [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s.y [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s.y [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s.y [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s() [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s() [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s() [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s() [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java void j2.Bug47968s.bar() [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java void j2.Bug47968s.bar() [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java void j2.Bug47968s.bar() [Bug47968] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java void j2.Bug47968s.bar() [Bug47968] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testBug47968field() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j2", "Bug47968.js").getType("Bug47968");
- setJavadocOptions();
- IField field = type.getField("x");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j2/Bug47968s.java j2.Bug47968s [x] EXACT_MATCH INSIDE_JAVADOC\n" + // This match was not found before...
- "src/j2/Bug47968s.java j2.Bug47968s.y [x] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s() [x] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java void j2.Bug47968s.bar() [x] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testBug47968method() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j2", "Bug47968.js").getType("Bug47968");
- setJavadocOptions();
- IFunction method = type.getFunction("foo", new String[] { "I" });
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j2/Bug47968s.java j2.Bug47968s [foo(int)] EXACT_MATCH INSIDE_JAVADOC\n" + // This match was not found before...
- "src/j2/Bug47968s.java j2.Bug47968s.y [foo(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s() [foo(int)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java void j2.Bug47968s.bar() [foo(int)] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testBug47968constructor() throws CoreException {
- IType type = getCompilationUnit("JavaSearch", "src", "j2", "Bug47968.js").getType("Bug47968");
- setJavadocOptions();
- IFunction method = type.getFunction("Bug47968", new String[] { "QString;" });
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/j2/Bug47968s.java j2.Bug47968s [Bug47968(String)] EXACT_MATCH INSIDE_JAVADOC\n" + // This match was not found before...
- "src/j2/Bug47968s.java j2.Bug47968s.y [Bug47968(String)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java j2.Bug47968s() [Bug47968(String)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j2/Bug47968s.java void j2.Bug47968s.bar() [Bug47968(String)] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
-
- /**
- * Test fix for bug 47209.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=47209">47209</a>
- * @throws CoreException
- */
- public void testBug47209type() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j4", "TT47209.js").getType("TT47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "TF47209.js").getType("TF47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "TC47209.js").getType("TC47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "TT47209.js").getType("TM47209");
- search(type, REFERENCES, getJavaSearchScope());
- assertSearchResults(
- "src/j4/TT47209.java j4.TT47209 [TT47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/TF47209.java j4.TF47209.f47209 [TF47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/TC47209.java j4.TC47209(String) [TC47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/TM47209.java void j4.TM47209.m47209(int) [TM47209] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testBug47209field() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j4", "FT47209.js").getType("FT47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "FF47209.js").getType("FF47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "FC47209.js").getType("FC47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "FT47209.js").getType("FM47209");
- search(type, REFERENCES, getJavaSearchScope());
- assertSearchResults(
- "src/j4/FT47209.java j4.FT47209 [FT47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/FF47209.java j4.FF47209.f47209 [FF47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/FC47209.java j4.FC47209(String) [FC47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/FM47209.java void j4.FM47209.m47209(int) [FM47209] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testBug47209method() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j4", "MT47209.js").getType("MT47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "MF47209.js").getType("MF47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "MC47209.js").getType("MC47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "MT47209.js").getType("MM47209");
- search(type, REFERENCES, getJavaSearchScope());
- assertSearchResults(
- "src/j4/MT47209.java j4.MT47209 [MT47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/MF47209.java j4.MF47209.f47209 [MF47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/MC47209.java j4.MC47209(String) [MC47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/MM47209.java void j4.MM47209.m47209(int) [MM47209] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
- public void testBug47209constructor() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j4", "CT47209.js").getType("CT47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "CF47209.js").getType("CF47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "CC47209.js").getType("CC47209");
- search(type, REFERENCES, getJavaSearchScope());
- type = getCompilationUnit("JavaSearch", "src", "j4", "CT47209.js").getType("CM47209");
- search(type, REFERENCES, getJavaSearchScope());
- assertSearchResults(
- "src/j4/CT47209.java j4.CT47209 [CT47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/CF47209.java j4.CF47209.f47209 [CF47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/CC47209.java j4.CC47209(String) [CC47209] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/j4/CM47209.java void j4.CM47209.m47209(int) [CM47209] EXACT_MATCH INSIDE_JAVADOC",
- this.resultCollector);
- }
-
- /**
- * Test fix for bug 49994.
- * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=49994">49994</a>
- * @throws CoreException
- */
- public void testBug49994() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j5", "Bug49994.js").getType("Bug49994");
- search(type, REFERENCES, getJavaSearchScope());
- assertSearchResults("", this.resultCollector);
- }
- public void testBug49994field() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j5", "Bug49994.js").getType("Bug49994");
- IField field = type.getField("field");
- search(field, REFERENCES, getJavaSearchScope(), this.resultCollector);
- assertSearchResults("src/j5/Bug49994.java void j5.Bug49994.foo() [field] EXACT_MATCH INSIDE_JAVADOC", this.resultCollector);
- }
- public void testBug49994method() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j5", "Bug49994.js").getType("Bug49994");
- IFunction method = type.getFunction("bar", new String[0]);
- search(method, REFERENCES, getJavaSearchScope(), this.resultCollector);
- assertSearchResults("src/j5/Bug49994.java void j5.Bug49994.foo() [bar()] EXACT_MATCH INSIDE_JAVADOC", this.resultCollector);
- }
- public void testBug49994constructor() throws CoreException {
- setJavadocOptions();
- IType type = getCompilationUnit("JavaSearch", "src", "j5", "Bug49994.js").getType("Bug49994");
- IFunction method = type.getFunction("Bug49994", new String[] { "QString;" });
- search(method, REFERENCES, getJavaSearchScope(), this.resultCollector);
- assertSearchResults("src/j5/Bug49994.java void j5.Bug49994.foo() [Bug49994(String)] EXACT_MATCH INSIDE_JAVADOC", this.resultCollector);
- }
-
- /**
- * Bug 83285: [javadoc] Javadoc reference to constructor of secondary type has no binding / not found by search
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83285"
- */
- public void testBug83285() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearch/src/b83285/A.js",
- "package b83285;\n" +
- "class A { }\n" +
- "class C {\n" +
- " /**\n" +
- " * Link {@link #C(String)} was also wrongly warned...\n" +
- " */\n" +
- " private String fGerman;\n" +
- " public C(String german) {\n" +
- " fGerman = german;\n" +
- " }\n" +
- "}"
- );
- IFunction[] methods = workingCopies[0].getType("C").getFunctions();
- assertEquals("Invalid number of methods", 1, methods.length);
- search(methods[0], REFERENCES, getJavaSearchScope());
- assertSearchResults(
- "src/b83285/A.java b83285.C.fGerman [C(String)] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testBug83285a() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearch/src/b83285/A.js",
- "package b83285;\n" +
- "class A {\n" +
- " A(char c) {}\n" +
- "}\n" +
- "class B {\n" +
- " B(Exception ex) {}\n" +
- " void foo() {} \n" +
- " class C { \n" +
- " /**\n" +
- " * Link {@link #B(Exception)} OK\n" +
- " * Link {@link #C(String)} OK\n" +
- " * Link {@link #foo()} OK\n" +
- " * Link {@link #bar()} OK\n" +
- " */\n" +
- " public C(String str) {}\n" +
- " void bar() {}\n" +
- " }\n" +
- "}"
- );
- IFunction[] methods = workingCopies[0].getType("B").getFunctions();
- assertEquals("Invalid number of methods", 2, methods.length);
- for (int i=0,l=methods.length; i<l; i++) {
- search(methods[i], REFERENCES, getJavaSearchScope());
- }
- assertSearchResults(
- "src/b83285/A.java b83285.B$C(String) [B(Exception)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b83285/A.java b83285.B$C(String) [foo()] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
- public void testBug83285b() throws CoreException {
- resultCollector.showRule = true;
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearch/src/b83285/A.js",
- "package b83285;\n" +
- "class A {\n" +
- " A(char c) {}\n" +
- "}\n" +
- "class B {\n" +
- " B(Exception ex) {}\n" +
- " void foo() {} \n" +
- " class C { \n" +
- " /**\n" +
- " * Link {@link #B(Exception)} OK\n" +
- " * Link {@link #C(String)} OK\n" +
- " * Link {@link #foo()} OK\n" +
- " * Link {@link #bar()} OK\n" +
- " */\n" +
- " public C(String str) {}\n" +
- " void bar() {}\n" +
- " }\n" +
- "}"
- );
- IFunction[] methods = workingCopies[0].getType("B").getType("C").getFunctions();
- assertEquals("Invalid number of methods", 2, methods.length);
- for (int i=0,l=methods.length; i<l; i++) {
- search(methods[i], REFERENCES, getJavaSearchScope());
- }
- assertSearchResults(
- "src/b83285/A.java b83285.B$C(String) [C(String)] EXACT_MATCH INSIDE_JAVADOC\n" +
- "src/b83285/A.java b83285.B$C(String) [bar()] EXACT_MATCH INSIDE_JAVADOC"
- );
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchMultipleProjectsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchMultipleProjectsTests.java
deleted file mode 100644
index da1cddd..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchMultipleProjectsTests.java
+++ /dev/null
@@ -1,919 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.search.*;
-import org.eclipse.wst.jsdt.core.tests.model.AbstractJavaSearchTests.JavaSearchResultCollector;
-
-/**
- * Tests the Java search engine accross multiple projects.
- */
-public class JavaSearchMultipleProjectsTests extends ModifyingResourceTests implements IJavaScriptSearchConstants {
- private final static int UI_DECLARATIONS = DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE;
-public JavaSearchMultipleProjectsTests(String name) {
- super(name);
-}
-public static Test suite() {
- return buildModelTestSuite(JavaSearchMultipleProjectsTests.class);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "testJavaSearchScopeBug101426" };
-// TESTS_NUMBERS = new int[] { 101426 };
-// TESTS_RANGE = new int[] { 16, -1 };
-// TESTS_PREFIX = "testScopeEncloses";
-}
-
-/**
- * Field occurences in 2 working copies within 2 projects (one prereq this other one).
- * (regression test for bug 41534 incorrect shadowing reported by rename [refactoring])
- */
-public void testFieldOccurencesInWorkingCopies() throws CoreException {
- IJavaScriptUnit wc1 = null, wc2 = null;
- try {
- // setup project P1
- IJavaScriptProject p1 = createJavaProject("P1");
- createFolder("/P1/p1");
- createFile(
- "/P1/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " public static int FOO;\n" +
- "}"
- );
-
- // setup project P2
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P1"});
- createFolder("/P2/p2");
- createFile(
- "/P2/p2/Y.js",
- "package p2;\n" +
- "import p1.X;\n" +
- "public class Y {\n" +
- " int bar() {\n" +
- " return X.FOO;\n" +
- "}"
- );
-
- // create working copies and rename X.FOO to X.BAR in these working copies
- wc1 = getCompilationUnit("P1/p1/X.js").getWorkingCopy(null);
- wc1.getBuffer().setContents(
- "package p1;\n" +
- "public class X {\n" +
- " public static int BAR;\n" +
- "}"
- );
- wc1.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- wc2 = getCompilationUnit("P2/p2/Y.js").getWorkingCopy(null);
- wc2.getBuffer().setContents(
- "package p2;\n" +
- "import p1.X;\n" +
- "public class Y {\n" +
- " int bar() {\n" +
- " return X.BAR;\n" +
- "}"
- );
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- IField field = wc1.getType("X").getField("BAR");
- SearchPattern pattern = SearchPattern.createPattern(field, ALL_OCCURRENCES);
- new SearchEngine(new IJavaScriptUnit[] {wc1, wc2}).search(
- pattern,
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- scope,
- resultCollector,
- null);
- assertEquals(
- "Unexpected occurences of field p1.X.BAR",
- "p1/X.java [in P1] p1.X.BAR [BAR]\n" +
- "p2/Y.java [in P2] int p2.Y.bar() [BAR]",
- resultCollector.toString());
- } finally {
- if (wc1 != null) {
- wc1.discardWorkingCopy();
- }
- if (wc2 != null) {
- wc2.discardWorkingCopy();
- }
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Search for references in a hierarchy should find matches in super type.
- * (regression test for bug 31748 [search] search for reference is broken 2.1 M5)
- */
-public void testHierarchyScope1() throws CoreException {
- try {
- createJavaProject("P1");
- createFolder("/P1/p");
- createFile(
- "/P1/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- " protected void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " foo();\n" +
- " }\n" +
- "}"
- );
- createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P1"});
- createFile(
- "/P2/Y.js",
- "import p.X;\n" +
- "public class Y extends X {\n" +
- " protected void foo() {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P2/Y.js");
- IType type = cu.getType("Y");
- IFunction method = type.getFunction("foo", new String[] {});
- IJavaScriptSearchScope scope = SearchEngine.createHierarchyScope(type);
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- method,
- REFERENCES,
- scope,
- resultCollector);
- assertSearchResults(
- "p/X.java [in P1] void p.X.bar() [foo()]",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Search for references in a hierarchy should find matches in super type.
- * (regression test for bug 31748 [search] search for reference is broken 2.1 M5)
- */
-public void testHierarchyScope2() throws CoreException {
- try {
- createJavaProject("P1");
- createFolder("/P1/p");
- createFile(
- "/P1/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- " protected void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " foo();\n" +
- " }\n" +
- "}"
- );
- createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P1"});
- createFile(
- "/P2/Y.js",
- "import p.X;\n" +
- "public class Y extends X {\n" +
- " protected void foo() {\n" +
- " }\n" +
- "}"
- );
- createFile(
- "/P2/Z.js",
- "public class Z extends Y {\n" +
- " protected void foo() {\n" +
- " }\n" +
- "}"
- );
-
- IJavaScriptUnit cu = getCompilationUnit("/P2/Z.js");
- IType type = cu.getType("Z");
- IFunction method = type.getFunction("foo", new String[] {});
- IJavaScriptSearchScope scope = SearchEngine.createHierarchyScope(type);
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- method,
- REFERENCES,
- scope,
- resultCollector);
- assertSearchResults(
- "p/X.java [in P1] void p.X.bar() [foo()]",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Search for references in a hierarchy should find matches in super type.
- * (regression test for bug 35755 Search in hierarchy misses dependent projects )
- */
-public void testHierarchyScope3() throws CoreException {
- try {
- createJavaProject("P1");
- createFolder("/P1/p");
- createFile(
- "/P1/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- " protected void foo() {\n" +
- " }\n" +
- "}"
- );
- createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P1"});
- createFolder("/P2/q");
- createFile(
- "/P2/q/Y.js",
- "package q;\n" +
- "import p.X;\n" +
- "public class Y extends X {\n" +
- " void bar() {\n" +
- " foo();\n" +
- " }\n" +
- "}"
- );
-
- IJavaScriptUnit cu = getCompilationUnit("/P1/p/X.js");
- IType type = cu.getType("X");
- IFunction method = type.getFunction("foo", new String[] {});
- IJavaScriptSearchScope scope = SearchEngine.createHierarchyScope(type);
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- method,
- REFERENCES,
- scope,
- resultCollector);
- assertSearchResults(
- "q/Y.java [in P2] void q.Y.bar() [foo()]",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Search for references in a hierarchy should not find inaccurate match if reference is indirect.
- * (regression test for bug 35755 Search in hierarchy misses dependent projects )
- */
-public void testHierarchyScope4() throws CoreException {
- try {
- createJavaProject("P0");
- createFolder("/P0/p0");
- createFile(
- "/P0/p0/X.js",
- "package p0;\n" +
- "public class X {\n" +
- " public static X TheX;\n" +
- " public void foo() {\n" +
- " }\n" +
- "}"
- );
- createJavaProject("P1", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P0"});
- createFolder("/P1/p1");
- createFile(
- "/P1/p1/T.js",
- "package p1;\n" +
- "import p0.X;\n" +
- "public class T {\n" +
- " public X zork() {\n" +
- " return X.TheX;\n" +
- " }\n" +
- "}"
- );
- createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P0", "/P1"});
- createFolder("/P2/p2");
- createFile(
- "/P2/p2/Y.js",
- "package p2;\n" +
- "import p0.X;\n" +
- "import p1.T;\n" +
- "public class Y extends X {\n" +
- " public void bar() {\n" +
- " new T().zork().foo();\n" +
- " }\n" +
- "}"
- );
- createJavaProject("P3", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P0", "/P2"});
- createFolder("/P3/p3");
- createFile(
- "/P3/p3/Z.js",
- "package p3;\n" +
- "import p0.X;\n" +
- "import p2.Y;\n" +
- "public class Z extends Y {\n" +
- " static {\n" +
- " X.TheX = new Z(); // zork() will actually answer an instance of Z\n" +
- " }\n" +
- " public void foo() {\n" +
- " } // refs should find one in Y.bar()\n" +
- "}"
- );
-
- IJavaScriptUnit cu = getCompilationUnit("/P3/p3/Z.js");
- IType type = cu.getType("Z");
- IFunction method = type.getFunction("foo", new String[] {});
- IJavaScriptSearchScope scope = SearchEngine.createHierarchyScope(type);
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showAccuracy = true;
- resultCollector.showProject = true;
- search(
- method,
- REFERENCES,
- scope,
- resultCollector);
- assertSearchResults(
- "p2/Y.java [in P2] void p2.Y.bar() [foo()] EXACT_MATCH",
- resultCollector);
- } finally {
- deleteProjects(new String[] {"P0", "P1", "P2", "P3"});
- }
-}
-/**
- * Method occurences with 2 unrelated projects that contain the same source.
- * (regression test for bug 33800 search: reporting too many method occurrences)
- */
-public void testMethodOccurences() throws CoreException {
- try {
- // setup project P1
- IJavaScriptProject p1 = createJavaProject("P1");
- createFolder("/P1/p");
- createFile(
- "/P1/p/I.js",
- "package p;\n" +
- "public interface I {\n" +
- " void method(Object o);\n" +
- "}"
- );
- createFile(
- "/P1/p/C.js",
- "package p;\n" +
- "public class C implements I {\n" +
- " void method(Object o) {\n" +
- " }\n" +
- "}"
- );
-
- // copy to project P2
- p1.getProject().copy(new Path("/P2"), false, null);
- IJavaScriptProject p2 = getJavaProject("P2");
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- IFunction method = getCompilationUnit("/P1/p/I.js").getType("I").getFunction("method", new String[] {"QObject;"});
- search(
- method,
- ALL_OCCURRENCES,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected occurences of method p.I.method(Object)",
- "p/C.java [in P1] void p.C.method(Object) [method]\n" +
- "p/I.java [in P1] void p.I.method(Object) [method]",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Package declaration with 2 unrelated projects that contain the same source.
- * (regression test for bug 46276 Search for package declarations incorrectly finds matches in clone project)
- */
-public void testPackageDeclaration() throws CoreException {
- try {
- // setup project P1
- IJavaScriptProject p1 = createJavaProject("P1");
- createFolder("/P1/p");
- createFile(
- "/P1/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- "}"
- );
-
- // copy to project P2
- p1.getProject().copy(new Path("/P2"), false, null);
- IJavaScriptProject p2 = getJavaProject("P2");
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- IPackageFragment pkg = getPackage("/P1/p");
- search(
- pkg,
- DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected package declarations",
- "p [in P1] p",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Package reference with fragments in 2 different source projects.
- * (regression test for bug 47415 [Search] package references confused with multiple fragments)
- */
-public void testPackageReference1() throws CoreException {
- try {
- // setup project P1
- IJavaScriptProject p1 = createJavaProject("P1");
- createFolder("/P1/p");
- createFile(
- "/P1/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- "}"
- );
-
- // setup project P2
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {""},
- new String[] {"JCL_LIB"},
- new String[] {"/P1"});
- createFolder("/P2/p");
- createFile(
- "/P2/p/Y.js",
- "package p;\n" +
- "public class Y {\n" +
- "}"
- );
-
- // create package references
- createFolder("/P2/q");
- createFile(
- "/P2/q/Z.js",
- "package q;\n" +
- "import p.X;\n" +
- "import p.Y;\n" +
- "public class Z {\n" +
- " X onlyHereForTheImport = null;\n" +
- " Y alsoOnlyHereForTheImport = null;\n" +
- " void foo(){\n" +
- " p.X x = (p.X)null;\n" +
- " p.Y y = (p.Y)null;\n" +
- " }\n" +
- "}"
- );
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- IPackageFragment pkg = getPackage("/P1/p");
- search(
- pkg,
- REFERENCES,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected package references",
- "q/Z.java [p]\n" +
- "q/Z.java void q.Z.foo() [p]\n" +
- "q/Z.java void q.Z.foo() [p]",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Package reference with fragments in 2 different binary projects.
- * (regression test for bug 47415 [Search] package references confused with multiple fragments)
- */
-public void testPackageReference2() throws CoreException, IOException {
- try {
- // setup project JavaSearchMultipleProjects1
- IJavaScriptProject p1 = setUpJavaProject("JavaSearchMultipleProjects1");
-
- // setup project JavaSearchMultipleProjects2
- IJavaScriptProject p2 = setUpJavaProject("JavaSearchMultipleProjects2");
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- IPackageFragment pkg = getPackage("/JavaSearchMultipleProjects1/lib/p");
- search(
- pkg,
- REFERENCES,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected package references",
- "src/q/Z.java [p]\n" +
- "src/q/Z.java void q.Z.foo() [p]\n" +
- "src/q/Z.java void q.Z.foo() [p]",
- resultCollector);
- } finally {
- deleteProject("JavaSearchMultipleProjects1");
- deleteProject("JavaSearchMultipleProjects2");
- }
-}
-/**
- * Method reference with 2 working copies in 2 different project.
- * (regression test for bug 57749 Search in working copies doesn't find all matches)
- */
-public void testReferenceInWorkingCopies() throws CoreException {
- IJavaScriptUnit workingCopy1 = null;
- IJavaScriptUnit workingCopy2 = null;
- try {
- // setup project P1
- IJavaScriptProject p1 = createJavaProject("P1");
- createFolder("/P1/p1");
- createFile(
- "/P1/p1/X.js",
- "package p1;\n" +
- "public class X {\n" +
- " void foo() {\n" +
- " }\n" +
- "}"
- );
- createFile(
- "/P1/p1/Test.js",
- "package p1;\n" +
- "public class Test {\n" +
- "}"
- );
-
- // setup project P2
- IJavaScriptProject p2 = createJavaProject(
- "P2",
- new String[] {""},
- new String[] {"JCL_LIB"},
- new String[] {"/P1"});
- createFolder("/P2/p2");
- createFile(
- "/P2/p2/Y.js",
- "package p2;\n" +
- "public class Y {\n" +
- "}"
- );
- // need a second potential match to see the problem
- createFile(
- "/P2/p2/Z.js",
- "public class Z {\n" +
- " void bar(p1.Test test) {\n" +
- " }\n" +
- " void foo() {\n" +
- " bar(null);\n" + // potential match
- " }\n" +
- "}"
- );
-
- // create working copies
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- workingCopy1 = getCompilationUnit("/P1/p1/X.js").getWorkingCopy(owner, null/*no progress monitor*/);
- workingCopy1.getBuffer().setContents(
- "package p1;\n" +
- "public class X {\n" +
- " void bar(Test test) {\n" +
- " }\n" +
- "}"
- );
- workingCopy1.makeConsistent(null);
- workingCopy2 = getCompilationUnit("/P2/p2/Y.js").getWorkingCopy(owner, null/*no progress monitor*/);
- workingCopy2.getBuffer().setContents(
- "package p2;\n" +
- "import p1.X;\n" +
- "public class Y {\n" +
- " void fred() {\n" +
- " new X().bar(null);\n" +
- " }\n" +
- "}"
- );
- workingCopy2.makeConsistent(null);
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- IFunction method = workingCopy1.getType("X").getFunction("bar", new String[] {"QTest;"});
- new SearchEngine(owner).search(
- SearchPattern.createPattern(method, REFERENCES),
- new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
- scope,
- resultCollector,
- null
- );
- assertSearchResults(
- "Unexpected package references",
- "p2/Y.java void p2.Y.fred() [bar(null)]",
- resultCollector);
- } finally {
- if (workingCopy1 != null) workingCopy1.discardWorkingCopy();
- if (workingCopy2 != null) workingCopy1.discardWorkingCopy();
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/**
- * Type declaration in external jar file that is shared by 2 projects.
- * (regression test for bug 27485 SearchEngine returns wrong java element when searching in an archive that is included by two distinct java projects.)
- */
-public void testTypeDeclarationInJar() throws CoreException {
- try {
- IJavaScriptProject p1 = createJavaProject("P1", new String[] {}, new String[] {"JCL_LIB"});
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {}, new String[] {"JCL_LIB"});
-
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p1});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- "Object",
- TYPE,
- DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected result in scope of P1",
- getSystemJsPathString() + " [in P1] java.lang.Object",
- resultCollector);
-
- scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p2});
- resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- "Object",
- TYPE,
- DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected result in scope of P2",
- getSystemJsPathString() + " [in P2] java.lang.Object",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/**
- * Bug 151189: [search] Declaration search does not find all matches
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=151189"
- */
-public void testBug151189_Workspace() throws CoreException {
- try {
- // setup project P1
- /*IJavaScriptProject p1 = */createJavaProject("P1");
- createFolder("/P1/pack");
- createFile(
- "/P1/pack/Declaration.js",
- "package pack;\n" +
- "public class Declaration implements Interface {\n" +
- " public void doOperation(int val) {}\n" +
- "}\n"
- );
- createFile(
- "/P1/pack/Interface.js",
- "package pack;\n" +
- "public interface Interface {\n" +
- " void doOperation(int val);\n" +
- "}\n"
- );
-
- // setup project P2
- createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] { "/P1" });
- createFolder("/P2/test");
- createFile(
- "/P2/test/Declaration_bis.js",
- "package test;\n" +
- "import pack.Interface;\n" +
- "public class Declaration_bis implements Interface {\n" +
- " public void doOperation(int val) {}\n" +
- "}\n"
- );
-
- // Get method
- IFunction method = getCompilationUnit("/P2/test/Declaration_bis.js").getType("Declaration_bis").getFunction("doOperation", new String[] {"I"});
-
- // search method declaration in workspace scope
- IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope(); //JavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- method,
- DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected declarations of method test.Declaration_bis.doOperation(int)",
- "test/Declaration_bis.java [in P2] void test.Declaration_bis.doOperation(int) [doOperation]",
- resultCollector);
-
- // search method declaration in workspace scope with JDT-UI flags
- resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- method,
- UI_DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected declarations of method test.Declaration_bis.doOperation(int)",
- "pack/Declaration.java [in P1] void pack.Declaration.doOperation(int) [doOperation]\n" +
- "pack/Interface.java [in P1] void pack.Interface.doOperation(int) [doOperation]\n" +
- "test/Declaration_bis.java [in P2] void test.Declaration_bis.doOperation(int) [doOperation]",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-public void testBug151189_Project() throws CoreException {
- try {
- // setup project P1
- createJavaProject("P1");
- createFolder("/P1/pack");
- createFile(
- "/P1/pack/Declaration.js",
- "package pack;\n" +
- "public class Declaration implements Interface {\n" +
- " public void doOperation(int val) {}\n" +
- "}\n"
- );
- createFile(
- "/P1/pack/Interface.js",
- "package pack;\n" +
- "public interface Interface {\n" +
- " void doOperation(int val);\n" +
- "}\n"
- );
-
- // setup project P2
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] { "/P1" });
- createFolder("/P2/test");
- createFile(
- "/P2/test/Declaration_bis.js",
- "package test;\n" +
- "import pack.Interface;\n" +
- "public class Declaration_bis implements Interface {\n" +
- " public void doOperation(int val) {}\n" +
- "}\n"
- );
-
- // Get method
- IFunction method = getCompilationUnit("/P2/test/Declaration_bis.js").getType("Declaration_bis").getFunction("doOperation", new String[] {"I"});
-
- // search method declaration in project scope
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search(
- method,
- UI_DECLARATIONS,
- scope,
- resultCollector);
- assertSearchResults(
- "Unexpected declarations of method test.Declaration_bis.doOperation(int)",
- "pack/Declaration.java [in P1] void pack.Declaration.doOperation(int) [doOperation]\n" +
- "pack/Interface.java [in P1] void pack.Interface.doOperation(int) [doOperation]\n" +
- "test/Declaration_bis.java [in P2] void test.Declaration_bis.doOperation(int) [doOperation]",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/**
- * @bug 163072: [search] method reference reports wrong potential matches
- * @test Ensure that there's no potential match while searching in two projects having 1.4 and 1.5 compliances
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=163072"
- */
-public void testBug163072() throws CoreException {
- try {
- // setup project P1
- /*IJavaScriptProject p1 = */createJavaProject("P1"); // standard project using 1.4 compliance
- createFolder("/P1/test");
- createFile(
- "/P1/test/Test.js",
- "package test;\n" +
- "public class Test {\n" +
- " public Object getType() {\n" +
- " return null;\n" +
- " }\n" +
- " public void foo() {\n" +
- " if (getType() == null) {\n" +
- " System.out.println(\"null\");\n" +
- " }\n" +
- " }\n" +
- "}\n"
- );
-
- // setup project P2
- createJavaProject("P2", new String[] {""}, new String[] {"JCL15_LIB"}, new String[] { "/P1" }, "", "1.5");
- createFolder("/P2/pack");
- createFile(
- "/P2/pack/FactoryContainer.js",
- "package pack;\n" +
- "public class FactoryContainer {\n" +
- " public enum FactoryType { PLUGIN }\n" +
- " public FactoryType getType() {\n" +
- " return FactoryType.PLUGIN;\n" +
- " }\n" +
- "}\n"
- );
- createFile(
- "/P2/pack/Reference.js",
- "package pack;\n" +
- "public class Reference {\n" +
- " private final FactoryContainer _fc;\n" +
- " public Reference() {\n" +
- " _fc = new FactoryContainer();\n" +
- " }\n" +
- " boolean foo() {\n" +
- " return _fc.getType() == FactoryContainer.FactoryType.PLUGIN;\n" +
- " }\n" +
- "}\n"
- );
-
- // Get method
- IFunction method = getCompilationUnit("/P1/test/Test.js").getType("Test").getFunction("getType", new String[0]);
- assertTrue("Method 'Test.getType()' should exist!", method.exists());
-
- // search method declaration in workspace scope
- IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope(); //JavaSearchScope(new IJavaScriptElement[] {p1, p2});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- resultCollector.showAccuracy = true;
- search(method, REFERENCES, scope, resultCollector);
- assertSearchResults(
- "Unexpected references of method Test.getType()",
- "test/Test.java [in P1] void test.Test.foo() [getType()] EXACT_MATCH",
- resultCollector);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-
-/**
- * @bug 167743: [search] Open Type Dialog cannot find types from projects migrated from 3.2.1 workspace
- * @test Ensure that types are found even in default package fragment root
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=167743"
- */
-public void testBug167743() throws CoreException {
- try {
- IJavaScriptProject p = createJavaProject("P");
- createFolder("/P/test");
- createFile(
- "/P/test/TestClass.js",
- "package test;\n" +
- "public class Test {\n" +
- "}\n"
- );
-
- // Search all type names with TypeNameMatchRequestor
- AbstractJavaSearchTests.TypeNameMatchCollector collector = new AbstractJavaSearchTests.TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] { p });
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- new char[] { '*' },
- SearchPattern.R_PATTERN_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with TypeNameRequestor
- SearchTests.SearchTypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- new char[] { '*' },
- SearchPattern.R_PATTERN_MATCH,
- IJavaScriptSearchConstants.TYPE,
- scope,
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Should have same types with these 2 searches
- assertEquals("Invalid number of types found!", requestor.size(), collector.size());
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
- } finally {
- deleteProject("P");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchScopeTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchScopeTests.java
deleted file mode 100644
index a4ccbc6..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchScopeTests.java
+++ /dev/null
@@ -1,966 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.HashMap;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.search.*;
-import org.eclipse.wst.jsdt.core.tests.model.AbstractJavaSearchTests.JavaSearchResultCollector;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-
-/**
- * Tests the Java search engine accross multiple projects.
- */
-public class JavaSearchScopeTests extends ModifyingResourceTests implements IJavaScriptSearchConstants {
-public JavaSearchScopeTests(String name) {
- super(name);
-}
-public static Test suite() {
- return buildModelTestSuite(JavaSearchScopeTests.class);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_NAMES = new String[] { "testMethodOccurences" };
-// TESTS_NUMBERS = new int[] { 101426 };
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-
-protected void tearDown() throws Exception {
- // Cleanup caches
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- manager.containers = new HashMap(5);
- manager.variables = new HashMap(5);
-
- super.tearDown();
-}
-protected void assertScopeEquals(String expected, IJavaScriptSearchScope scope) {
- String actual = scope.toString();
- if (!expected.equals(actual)) {
- System.out.println(displayString(actual, 3) + ",");
- }
- assertEquals("Unexpected scope", expected, actual);
-}
-/*
- * Ensures that a Java search scope with SOURCES only is correct.
- */
-public void testSources() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.SOURCES);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " /P\n" +
- "]",
- scope);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java search scope with APPLICATION_LIBRARIES only is correct
- * (external jar case)
- */
-public void testApplicationLibrairiesExternalJar() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.APPLICATION_LIBRARIES);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " "+ getExternalJCLPath("").toOSString() +"\n" +
- "]",
- scope);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java search scope with APPLICATION_LIBRARIES only is correct
- * (internal jar and class folder cases)
- */
-public void testApplicationLibrairiesJarAndClassFolder() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"}, new String[] {"/P/internal.jar", "/P/classfolder"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.APPLICATION_LIBRARIES);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " /P/internal.jar\n" +
- " /P/classfolder\n" +
- "]",
- scope);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java search scope with APPLICATION_LIBRARIES only is correct
- * (classpath variable case)
- */
-public void testApplicationLibrairiesClasspathVariable() throws CoreException {
- try {
- VariablesInitializer.setInitializer(new ClasspathInitializerTests.DefaultVariableInitializer(new String[] {"TEST_LIB", "/P/lib.jar"}));
- IJavaScriptProject project = createJavaProject("P", new String[] {}, new String[] {"TEST_LIB"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.APPLICATION_LIBRARIES);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " /P/lib.jar\n" +
- "]",
- scope);
- } finally {
- deleteProject("P");
- VariablesInitializer.reset();
- }
-}
-/*
- * Ensures that a Java search scope with APPLICATION_LIBRARIES only is correct
- * (classpath container case)
- */
-public void testApplicationLibrairiesJsGlobalScopeContainer() throws CoreException {
- try {
- ContainerInitializer.setInitializer(new ClasspathInitializerTests.DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}));
- IJavaScriptProject project = createJavaProject("P", new String[] {}, new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.APPLICATION_LIBRARIES);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " /P/lib.jar\n" +
- "]",
- scope);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java search scope with SYSTEM_LIBRARIES only is correct
- * (classpath container case)
- */
-public void testSystemLibraries() throws CoreException {
- try {
- ClasspathInitializerTests.DefaultContainerInitializer intializer = new ClasspathInitializerTests.DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}) {
- protected DefaultContainer newContainer(char[][] libPaths) {
- return new DefaultContainer(libPaths) {
- public int getKind() {
- return IJsGlobalScopeContainer.K_SYSTEM;
- }
- };
- }
- };
- ContainerInitializer.setInitializer(intializer);
- IJavaScriptProject project = createJavaProject("P", new String[] {}, new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.SYSTEM_LIBRARIES);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " /P/lib.jar\n" +
- "]",
- scope);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java search scope with SOURCES | REFERENCED_PROJECTS is correct
- * (direct reference case)
- */
-public void testSourcesOrDirectReferencedProjects() throws CoreException {
- try {
- createJavaProject("P1");
- IJavaScriptProject project = createJavaProject("P2", new String[] {"src"}, new String[] {}, new String[] {"/P1"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.SOURCES | IJavaScriptSearchScope.REFERENCED_PROJECTS);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " /P1\n" +
- " /P2/src\n" +
- "]",
- scope);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/*
- * Ensures that a Java search scope with SOURCES | REFERENCED_PROJECTS is correct
- * (reference through a container case)
- */
-public void testSourcesOrContainerReferencedProjects() throws CoreException {
- try {
- createJavaProject("P1");
- ContainerInitializer.setInitializer(new ClasspathInitializerTests.DefaultContainerInitializer(new String[] {"P2", "/P1"}));
- IJavaScriptProject project = createJavaProject("P2", new String[] {"src"}, new String[] {"org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}, IJavaScriptSearchScope.SOURCES | IJavaScriptSearchScope.REFERENCED_PROJECTS);
- assertScopeEquals(
- "JavaSearchScope on [\n" +
- " /P1\n" +
- " /P2/src\n" +
- "]",
- scope);
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/*
- * Ensures that a Java project is enclosed in a scope on the project (proj=src)
- * (resourcePath case)
- */
-public void testScopeEncloses01() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P\"", scope.encloses("/P"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is enclosed in a scope on the project (proj=src)
- * (Java element case)
- */
-public void testScopeEncloses02() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose P", scope.encloses(project));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj=src)
- * (resource path with traling slash case)
- */
-public void testScopeEncloses03() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/\"", scope.encloses("/P/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj=src)
- * (Java element case)
- */
-public void testScopeEncloses04() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragmentRoot root = project.getPackageFragmentRoot(project.getProject());
- assertTrue("scope on P should enclose root P", scope.encloses(root));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj=src)
- * (resource path case)
- */
-public void testScopeEncloses05() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/x/y\"", scope.encloses("/P/x/y"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj=src)
- * (resource path with trailing slash case)
- */
-public void testScopeEncloses06() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/x/y/\"", scope.encloses("/P/x/y/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj=src)
- * (Java element case)
- */
-public void testScopeEncloses07() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragment pkg = getPackage("/P/x/y");
- assertTrue("scope on P should enclose package x.y", scope.encloses(pkg));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a default package is enclosed in a scope on the project (proj=src)
- * (Java element case)
- */
-public void testScopeEncloses08() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragment pkg = getPackage("/P");
- assertTrue("scope on P should enclose default package", scope.encloses(pkg));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit is enclosed in a scope on the project (proj=src)
- * (resource path case)
- */
-public void testScopeEncloses09() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/x/y/A.java\"", scope.encloses("/P/x/y/A.js"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit is enclosed in a scope on the project (proj=src)
- * (Java element case)
- */
-public void testScopeEncloses10() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/x/y/A.js");
- assertTrue("scope on P should enclose compilation unit A.js", scope.encloses(cu));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit in the default package is enclosed in a scope on the project (proj=src)
- * (resource path case)
- */
-public void testScopeEncloses11() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/A.java\"", scope.encloses("/P/A.js"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit in the default package is enclosed in a scope on the project (proj=src)
- * (Java element case)
- */
-public void testScopeEncloses12() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/A.js");
- assertTrue("scope on P should enclose compilation unit A.js", scope.encloses(cu));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a source type is enclosed in a scope on the project (proj=src)
- * (Java element case)
- */
-public void testScopeEncloses13() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/x/y/A.js");
- IType type = cu.getType("A");
- assertTrue("scope on P should enclose type A", scope.encloses(type));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src)
- * (resourcePath case)
- */
-public void testScopeEncloses14() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should not enclose \"/P\"", scope.encloses("/P"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src)
- * (resourcePath case)
- */
-public void testScopeEncloses14b() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should not enclose \"/\"", scope.encloses("/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src)
- * (resourcePath case)
- */
-public void testScopeEncloses14c() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should not enclose \"\"", scope.encloses(""));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src)
- * (Java element case)
- */
-public void testScopeEncloses15() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should enclose P", scope.encloses(project));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj != src)
- * (resource path case)
- */
-public void testScopeEncloses16() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src\"", scope.encloses("/P/src"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj != src)
- * (resource path with traling slash case)
- */
-public void testScopeEncloses17() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/\"", scope.encloses("/P/src/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj != src)
- * (Java element case)
- */
-public void testScopeEncloses18() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragmentRoot root = project.getPackageFragmentRoot(project.getProject().getFolder("src"));
- assertTrue("scope on P should enclose root P/src", scope.encloses(root));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj != src)
- * (resource path case)
- */
-public void testScopeEncloses19() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/x/y\"", scope.encloses("/P/src/x/y"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj != src)
- * (resource path with trailing slash case)
- */
-public void testScopeEncloses20() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/x/y/\"", scope.encloses("/P/src/x/y/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj != src)
- * (Java element case)
- */
-public void testScopeEncloses21() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragment pkg = getPackage("/P/src/x/y");
- assertTrue("scope on P should enclose package x.y", scope.encloses(pkg));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a default package is enclosed in a scope on the project (proj != src)
- * (Java element case)
- */
-public void testScopeEncloses22() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragment pkg = getPackage("/P/src");
- assertTrue("scope on P should enclose default package", scope.encloses(pkg));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit is enclosed in a scope on the project (proj != src)
- * (resource path case)
- */
-public void testScopeEncloses23() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/x/y/A.java\"", scope.encloses("/P/src/x/y/A.js"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit is enclosed in a scope on the project (proj != src)
- * (Java element case)
- */
-public void testScopeEncloses24() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/src/x/y/A.js");
- assertTrue("scope on P should enclose compilation unit A.js", scope.encloses(cu));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit in the default package is enclosed in a scope on the project (proj != src)
- * (resource path case)
- */
-public void testScopeEncloses25() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/A.java\"", scope.encloses("/P/src/A.js"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit in the default package is enclosed in a scope on the project (proj != src)
- * (Java element case)
- */
-public void testScopeEncloses26() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/src/A.js");
- assertTrue("scope on P should enclose compilation unit A.js", scope.encloses(cu));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a source type is enclosed in a scope on the project (proj != src)
- * (Java element case)
- */
-public void testScopeEncloses27() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/src/x/y/A.js");
- IType type = cu.getType("A");
- assertTrue("scope on P should enclose type A", scope.encloses(type));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src/)
- * (resourcePath case)
- */
-public void testScopeEncloses28() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should not enclose \"/P\"", scope.encloses("/P"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src/)
- * (resourcePath case)
- */
-public void testScopeEncloses28b() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should not enclose \"/P\"", scope.encloses("/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src/)
- * (resourcePath case)
- */
-public void testScopeEncloses28c() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should not enclose \"/P\"", scope.encloses(""));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a Java project is not enclosed in a scope on the project (proj != src/)
- * (Java element case)
- */
-public void testScopeEncloses29() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertFalse("scope on P should enclose P", scope.encloses(project));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj != src/)
- * (resource path case)
- */
-public void testScopeEncloses30() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src\"", scope.encloses("/P/src"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj != src/)
- * (resource path with traling slash case)
- */
-public void testScopeEncloses31() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/\"", scope.encloses("/P/src/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a root is enclosed in a scope on the project (proj != src/)
- * (Java element case)
- */
-public void testScopeEncloses32() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragmentRoot root = project.getPackageFragmentRoot(project.getProject().getFolder("src"));
- assertTrue("scope on P should enclose root P/src", scope.encloses(root));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj != src/)
- * (resource path case)
- */
-public void testScopeEncloses33() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/x/y\"", scope.encloses("/P/src/x/y"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj != src/)
- * (resource path with trailing slash case)
- */
-public void testScopeEncloses34() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/x/y/\"", scope.encloses("/P/src/x/y/"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a package is enclosed in a scope on the project (proj != src/)
- * (Java element case)
- */
-public void testScopeEncloses35() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragment pkg = getPackage("/P/src/x/y");
- assertTrue("scope on P should enclose package x.y", scope.encloses(pkg));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a default package is enclosed in a scope on the project (proj != src/)
- * (Java element case)
- */
-public void testScopeEncloses36() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IPackageFragment pkg = getPackage("/P/src");
- assertTrue("scope on P should enclose default package", scope.encloses(pkg));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit is enclosed in a scope on the project (proj != src/)
- * (resource path case)
- */
-public void testScopeEncloses37() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/x/y/A.java\"", scope.encloses("/P/src/x/y/A.js"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit is enclosed in a scope on the project (proj != src/)
- * (Java element case)
- */
-public void testScopeEncloses38() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/src/x/y/A.js");
- assertTrue("scope on P should enclose compilation unit A.js", scope.encloses(cu));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit in the default package is enclosed in a scope on the project (proj != src/)
- * (resource path case)
- */
-public void testScopeEncloses39() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- assertTrue("scope on P should enclose \"/P/src/A.java\"", scope.encloses("/P/src/A.js"));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a compilation unit in the default package is enclosed in a scope on the project (proj != src/)
- * (Java element case)
- */
-public void testScopeEncloses40() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/src/A.js");
- assertTrue("scope on P should enclose compilation unit A.js", scope.encloses(cu));
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a source type is enclosed in a scope on the project (proj != src/)
- * (Java element case)
- */
-public void testScopeEncloses41() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {"src/"});
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- IJavaScriptUnit cu = getCompilationUnit("/P/src/x/y/A.js");
- IType type = cu.getType("A");
- assertTrue("scope on P should enclose type A", scope.encloses(type));
- } finally {
- deleteProject("P");
- }
-}
-
-/**
- * Bug 101022: [search] JUnit Test Runner on folder runs tests outside directory
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=101022"
- */
-public void testBug101022() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P1", new String[] {"src", "test", "test2"});
- createFile(
- "/P1/src/Test.js",
- "public class Test {\n" +
- " protected void foo() {}\n" +
- "}"
- );
- createFile(
- "/P1/test/Test.js",
- "public class Test {\n" +
- " protected void foo() {}\n" +
- "}"
- );
- createFile(
- "/P1/test2/Test.js",
- "public class Test {\n" +
- " protected void foo() {}\n" +
- "}"
- );
- IPackageFragmentRoot root = project.getPackageFragmentRoot(getFolder("/P1/test"));
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {root});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search("foo", METHOD, DECLARATIONS, scope, resultCollector);
- assertSearchResults(
- "test/Test.java [in P1] void Test.foo() [foo]",
- resultCollector);
- }
- finally {
- deleteProject("P1");
- }
-}
-
-/**
- * Bug 101426: Search doesn't work with imported plugin
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=101426"
- */
-public void testBug101426() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P1", new String[] {"src/", "test/", "test2/"}, new String[] {"JCL_LIB"});
- createFile(
- "/P1/src/Test.js",
- "public interface ITest {\n" +
- "}"
- );
- createFile(
- "/P1/test/Test.js",
- "public class Test {\n" +
- " ITest test;\n" +
- "}"
- );
- createFile(
- "/P1/test2/Test.js",
- "public class Test2 {\n" +
- " ITest test;\n" +
- "}"
- );
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search("ITest", TYPE, REFERENCES, scope, resultCollector);
- assertSearchResults(
- "test/Test.java [in P1] Test.test [ITest]\n" +
- "test2/Test.java [in P1] Test2.test [ITest]",
- resultCollector);
- }
- finally {
- deleteProject("P1");
- }
-}
-
-/**
- * Bug 101777: [search] selecting class with a main type ignores the default package
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=101777"
- */
-public void testBug101777() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P1");
- createFile(
- "/P1/Test.js",
- "public class Test {\n" +
- " public static void main(String[] args) {}\n" +
- "}"
- );
- IPackageFragment[] fragments = project.getPackageFragments();
- IPackageFragment defaultFragment = null;
- for (int i = 0; i < fragments.length; i++) {
- IPackageFragment fragment = fragments[i];
- if (fragment.getElementName().length() == 0) {
- defaultFragment = fragment;
- break;
- }
- }
- assertNotNull("We should have a default fragment for project P1!", defaultFragment);
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {defaultFragment});
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search("main(String[]) void", METHOD, DECLARATIONS, scope, resultCollector);
- assertSearchResults(
- "Test.java [in P1] void Test.main(String[]) [main]",
- resultCollector);
- }
- finally {
- deleteProject("P1");
- }
-}
-
-/**
- * Bug 119203: Search doesn't work with imported plugin
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=119203"
- * WARNING: Fix for this bug has been disabled due to bad regression
- *
- * Bug 127048: [search] References to Java element 'CorrectionEngine' not found
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=127048"
- */
-public void testBug119203() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P1", new String[] {"src"});
- createFile(
- "/P1/src/Test.js",
- "public class Test {\n" +
- "}"
- );
- createFile(
- "/P1/src/X.js",
- "public class X {\n" +
- " Test test;\n" +
- "}"
- );
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] { project });
- JavaSearchResultCollector resultCollector = new JavaSearchResultCollector();
- resultCollector.showProject = true;
- search("Test", TYPE, REFERENCES, scope, resultCollector);
- assertSearchResults(
- "src/X.java [in P1] X.test [Test]",
- resultCollector);
- }
- finally {
- deleteProject("P1");
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java
deleted file mode 100644
index 8529ee1..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java
+++ /dev/null
@@ -1,3616 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Hashtable;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.search.*;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.core.JavaModelStatus;
-
-/**
- * Tests the Java search engine where results are JavaElements and source positions.
- */
-public class JavaSearchTests extends AbstractJavaSearchTests implements IJavaScriptSearchConstants {
-
- public JavaSearchTests(String name) {
- super(name);
- }
- public static Test suite() {
- return buildModelTestSuite(JavaSearchTests.class);
- }
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
- static {
-// org.eclipse.jsdt.internal.core.search.BasicSearchEngine.VERBOSE = true;
-// TESTS_PREFIX = "testPackageDeclaration";
-// TESTS_NAMES = new String[] { "testMethodReference17" };
-// TESTS_NUMBERS = new int[] { 113671 };
-// TESTS_RANGE = new int[] { 16, -1 };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jsdt.core.tests.model.AbstractJavaModelTests#copyDirectory(java.io.File, java.io.File)
- */
- protected void copyDirectory(File sourceDir, File targetDir) throws IOException {
- if (!targetDir.exists()) {
- super.copyDirectory(sourceDir, targetDir);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jsdt.core.tests.model.SuiteOfTestCases#setUpSuite()
- */
- public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- if (JAVA_PROJECT == null) {
- JAVA_PROJECT = setUpJavaProject("JSSearch");
-// setUpJavaProject("JavaSearch15", "1.5");
- }
- }
- public void tearDownSuite() throws Exception {
- if (JAVA_SEARCH_SUITES == null) {
- deleteProject("JSSearch");
-// deleteProject("JavaSearch15");
- } else {
- JAVA_SEARCH_SUITES.remove(getClass());
- if (JAVA_SEARCH_SUITES.size() == 0) {
- deleteProject("JSSearch");
- //deleteProject("JavaSearch15");
- }
- }
-
- super.tearDownSuite();
- }
-
- public void test00() throws CoreException { // was testSimpleConstructorReference1
- IJavaScriptUnit compilationUnit = getCompilationUnit("JSSearch", "src", "p", "A.js");
- IFunction constructor = compilationUnit.getFunction("A", new String[] {"QX;"});
- search(
- constructor,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("src/p/A.js any A(any) [A]", resultCollector);
- }
-
-
-
- public void test01() throws CoreException { // was testSimpleConstructorDeclaration
- IJavaScriptUnit compilationUnit = getCompilationUnit("JSSearch", "src", "p", "A.js");
- IFunction constructor = compilationUnit.getFunction("A", new String[] {"QX;"});
- search(
- constructor,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("src/p/A.js any A(any) [A]", resultCollector);
- }
-
-
- public void test02() throws CoreException { // was testSimpleConstructorReference1
- IJavaScriptUnit compilationUnit = getCompilationUnit("JSSearch", "src", "p", "A.js");
- IFunction constructor = compilationUnit.getFunction("A", new String[] {"QX;"});
- search(
- constructor,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.js any main(any) [A(0)]",
- this.resultCollector);
- }
-
- public void test03() throws CoreException { // was testSimpleConstructorReference1
- IJavaScriptUnit compilationUnit = getCompilationUnit("JSSearch", "src", "p", "A.js");
- IField field = compilationUnit.getField("x");
- search(
- field,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.js x [x]",
- this.resultCollector);
- }
-
- public void test04() throws CoreException { // was testSimpleConstructorReference1
- IJavaScriptUnit compilationUnit = getCompilationUnit("JSSearch", "src", "p", "A.js");
- IField field = compilationUnit.getField("x");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.js any A(any) [x]",
- this.resultCollector);
- }
-
- public void test05() throws CoreException { // was testSimpleConstructorReference1
- IType type = getCompilationUnit("JSSearch", "src", "p", "cls1.js").getType("MyClass");
- IFunction method = type.getFunction("someMethod", new String[] {});
-
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/cls1.js any MyClass_someMethod() [MyClass_someMethod]",
- this.resultCollector);
- }
-
- public void test06() throws CoreException {
- IFunction method =
- getCompilationUnit("JSSearch", "src", "a6", "A.js").
- getFunction("m", new String[] {});
- searchDeclarationsOfAccessedFields(
- method,
- resultCollector
- );
- assertSearchResults(
- "src/a6/A.js a6.P.f [P.prototype.f=1]",
- this.resultCollector);
- }
-// /**
-// * Simple constructor declaration test.
-// */
-// public void testConstructorDeclaration01() throws CoreException { // was testSimpleConstructorDeclaration
-// IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
-// IFunction constructor = type.getMethod("A", new String[] {"QX;"});
-// search(
-// constructor,
-// DECLARATIONS,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults("src/p/A.js p.A(X) [A]", resultCollector);
-// }
-// /**
-// * Constructor declaration in jar file test.
-// */
-// public void testConstructorDeclaration02() throws CoreException { // was testConstructorDeclarationInJar
-// IType type = getClassFile("JSSearch", "MyJar.jar", "p1", "A.class").getType();
-// IFunction method = type.getMethod("A", new String[] {"Ljava.lang.String;"});
-// search(
-// method,
-// DECLARATIONS,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "MyJar.jar p1.A(java.lang.String) [No source]",
-// this.resultCollector);
-// }
-// /**
-// * Simple constructor reference test.
-// */
-// public void testConstructorReference01() throws CoreException { // was testSimpleConstructorReference1
-// IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
-// IFunction constructor = type.getMethod("A", new String[] {"QX;"});
-// search(
-// constructor,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/Test.js void Test.main(String[]) [new p.A(y)]",
-// this.resultCollector);
-// }
-// /**
-// * Simple constructor reference test.
-// */
-// public void testConstructorReference02() throws CoreException { // was testSimpleConstructorReference2
-// search(
-// "p.A(X)",
-// CONSTRUCTOR,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/Test.js void Test.main(String[]) [new p.A(y)]",
-// this.resultCollector);
-// }
-// /**
-// * Constructor reference using an explicit constructor call.
-// */
-// public void testConstructorReference03() throws CoreException { // was testConstructorReferenceExplicitConstructorCall1
-// IType type = getCompilationUnit("JSSearch", "src", "p", "Y.js").getType("Y");
-// IFunction method = type.getMethod("Y", new String[] {"I"});
-// search(
-// method,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/p/Z.js p.Z(int) [super(i)]",
-// this.resultCollector);
-// }
-// /**
-// * Constructor reference using an explicit constructor call.
-// */
-// public void testConstructorReference04() throws CoreException { // was testConstructorReferenceExplicitConstructorCall2
-// IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
-// IFunction method = type.getMethod("X", new String[] {"I"});
-// search(
-// method,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/p/Y.js p.Y(int) [super(i)]\n" +
-// "src/p/Y.js p.Y(boolean) [super(1)]",
-// this.resultCollector);
-// }
-// /**
-// * Constructor reference using an implicit constructor call.
-// * (regression test for bug 23112 search: need a way to search for references to the implicit non-arg constructor)
-// */
-// public void testConstructorReference05() throws CoreException { // was testConstructorReferenceImplicitConstructorCall1
-// IType type = getCompilationUnit("JSSearch", "src", "c7", "X.js").getType("X");
-// IFunction method = type.getMethod("X", new String[] {});
-// search(
-// method,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/c7/Y.js c7.Y() [Y]",
-// this.resultCollector);
-// }
-// /**
-// * Constructor reference using an implicit constructor call.
-// * (regression test for bug 23112 search: need a way to search for references to the implicit non-arg constructor)
-// */
-// public void testConstructorReference06() throws CoreException { // was testConstructorReferenceImplicitConstructorCall2
-// search(
-// "c8.X()",
-// CONSTRUCTOR,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/c8/Y.js c8.Y [Y]",
-// this.resultCollector);
-// }
-// /**
-// * Constructor reference in a field initializer.
-// * (regression test for PR 1GKZ8VZ: ITPJCORE:WINNT - Search - did not find references to member constructor)
-// */
-// public void testConstructorReference07() throws CoreException { // was testConstructorReferenceInFieldInitializer
-// IType type = getCompilationUnit("JSSearch", "src", "", "A.js").getType("A").getType("Inner");
-// IFunction method = type.getMethod("Inner", new String[] {"I"});
-// search(
-// method,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/A.js A.field [new Inner(1)]\n" +
-// "src/A.js A.field [new Inner(2)]",
-// this.resultCollector);
-// }
-// /**
-// * Constructor reference in case of default constructor of member type
-// * (regression test for bug 43276)
-// */
-// public void testConstructorReference08() throws CoreException { // was testConstructorReferenceDefaultConstructorOfMemberClass
-// search(
-// "c10.X.Inner()",
-// CONSTRUCTOR,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/c10/X.js c10.B() [new X().super()]",
-// this.resultCollector);
-// }
-// /*
-// * Generic constructor reference
-// */
-// public void testConstructorReference09() throws CoreException {
-// IType type = getCompilationUnit("JavaSearch15/src/p2/X.js").getType("X");
-// IFunction method = type.getMethod("X", new String[] {"QE;"});
-// search(
-// method,
-// REFERENCES,
-// ERASURE_RULE,
-// getJavaSearchScope15(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/p2/Y.js Object p2.Y.foo() [new X<Object>(this)]",
-// this.resultCollector);
-// }
-// /**
-// * Constructor reference using an implicit constructor call.
-// * (regression test for bug 23112 search: need a way to search for references to the implicit non-arg constructor)
-// */
-// public void testConstructorReference10() throws CoreException { // was testConstructorReferenceImplicitConstructorCall2
-// resultCollector.showSynthetic = true;
-// search(
-// "c11.A()",
-// CONSTRUCTOR,
-// REFERENCES,
-// getJavaSearchScope(),
-// this.resultCollector);
-// assertSearchResults(
-// "src/c11/A.js c11.A1 [A1] SYNTHETIC\n" +
-// "src/c11/A.js c11.A2() [A2] SYNTHETIC\n" +
-// "src/c11/A.js c11.A3() [super()]",
-// this.resultCollector);
-// }
- /**
- * CoreException thrown during accept.
- * (regression test for PR #1G3UI7A)
- */
- public void testCoreException() throws CoreException {
- IJavaScriptUnit compilationUnit = getCompilationUnit("JSSearch", "src", "p", "A.js");
- IFunction method = compilationUnit.getFunction("A", new String[] {"QX;"});
- SearchRequestor result = new SearchRequestor() {
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- throw new CoreException(new JavaModelStatus(-1, "test"));
- }
- };
- try {
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- result);
- } catch (CoreException e) {
- assertEquals("Unexpected CoreException has been thrown", "test", e.getStatus().getMessage());
- return;
- }
- assertTrue("CoreException should have been thrown", false);
- }
- /**
- * Declaration of accessed fields test.
- * (regression test for bug 6538 searchDeclarationsOf* incorrect)
- */
- public void testDeclarationOfAccessedFields1() throws CoreException {
- IFunction method =
- getCompilationUnit("JSSearch", "src", "a5", "B.js").
- getType("C").getFunction("i", new String[] {});
- searchDeclarationsOfAccessedFields(
- method,
- resultCollector
- );
- assertSearchResults(
- "",
- this.resultCollector);
- }
-// COVERED BY TEST06
-// /**
-// * Declaration of accessed fields test.
-// * (regression test for bug 6538 searchDeclarationsOf* incorrect)
-// */
-// public void testDeclarationOfAccessedFields2() throws CoreException {
-// IFunction method =
-// getCompilationUnit("JSSearch", "src", "a6", "A.js").
-// getType("P").getMethod("mm", new String[] {});
-// searchDeclarationsOfAccessedFields(
-// method,
-// resultCollector
-// );
-// assertSearchResults(
-// "src/a6/A.js a6.B.f [f]",
-// this.resultCollector);
-// }
-// /**
-// * Declaration of accessed fields test.
-// * (regression test for bug 10386 NPE in MatchLocator.lookupType)
-// */
-// public void testDeclarationOfAccessedFields3() throws CoreException {
-// IFunction method =
-// getCompilationUnit("JSSearch", "src", "b6", "A.js").
-// getType("A").getMethod("foo", new String[] {});
-// searchDeclarationsOfAccessedFields(
-// method,
-// resultCollector
-// );
-// assertSearchResults(
-// "src/b6/A.js b6.A.field [field]",
-// this.resultCollector);
-// }
-// /**
-// * Declaration of referenced types test.
-// */
-// public void testDeclarationOfReferencedTypes01() throws CoreException {
-// IFunction method =
-// getCompilationUnit("JSSearch", "src", "a3", "References.js").
-// getType("References").getMethod("foo", new String[] {});
-// searchDeclarationsOfReferencedTypes(
-// method,
-// resultCollector
-// );
-// assertSearchResults(
-// "src/a3/X.js a3.X [X]\n" +
-// "src/a3/Z.js a3.Z [Z]\n" +
-// "src/a3/b/A.js a3.b.A [A]\n" +
-// "src/a3/b/A.js a3.b.A$B$C [C]\n" +
-// "src/a3/b/A.js a3.b.A$B [B]\n" +
-// getExternalJCLPathString() + " java.lang.Object\n" +
-// "src/a3/Y.js a3.Y [Y]\n" +
-// "src/a3/b/B.js a3.b.B [B]",
-// this.resultCollector);
-// }
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 6779 searchDeclarationsOfReferencedTyped - missing exception types)
- */
-public void testDeclarationOfReferencedTypes02() throws CoreException {
- IFunction method =
- getCompilationUnit("JSSearch", "src", "a7", "X.js").
- getType("X").getFunction("foo", new String[] {});
- searchDeclarationsOfReferencedTypes(
- method,
- resultCollector
- );
- assertSearchResults(
- "src/a7/X.java a7.MyException [MyException]",
- this.resultCollector);
-}
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 12649 Missing import after move )
- */
-public void testDeclarationOfReferencedTypes03() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JSSearch", "src", "c1", "A.js");
- searchDeclarationsOfReferencedTypes(
- unit,
- resultCollector
- );
- assertSearchResults(
- "src/c1/I.java c1.I [I]",
- this.resultCollector);
-}
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 12649 Missing import after move )
- */
-public void testDeclarationOfReferencedTypes04() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JSSearch", "src", "c1", "B.js");
- searchDeclarationsOfReferencedTypes(
- unit,
- resultCollector
- );
- assertSearchResults(
- "src/c1/I.java c1.I [I]",
- this.resultCollector);
-}
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 18418 search: searchDeclarationsOfReferencedTypes reports import declarations)
- */
-public void testDeclarationOfReferencedTypes05() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JSSearch", "src", "c2", "A.js");
- searchDeclarationsOfReferencedTypes(
- unit,
- resultCollector
- );
- assertSearchResults(
- "src/c3/C.java c3.C [C]",
- this.resultCollector);
-}
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 24934 Move top level doesn't optimize the imports[refactoring])
- */
-public void testDeclarationOfReferencedTypes06() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JSSearch", "src", "d1", "X.js");
- IType innerType = unit.getType("X").getType("Inner");
- searchDeclarationsOfReferencedTypes(
- innerType,
- resultCollector
- );
- assertSearchResults(
- "src/d2/Y.java d2.Y [Y]",
- this.resultCollector);
-}
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 37438 searchenging NPE in searchDeclarationsOfReferencedTypes
-)
- */
-public void testDeclarationOfReferencedTypes07() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "r7");
- searchDeclarationsOfReferencedTypes(
- pkg,
- resultCollector
- );
- assertSearchResults(
- "",
- this.resultCollector);
-}
-
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 47787 IJavaScriptSearchResultCollector.aboutToStart() and done() not called)
- */
-public void testDeclarationOfReferencedTypes08() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "r7");
- JavaSearchResultCollector result = new JavaSearchResultCollector() {
- public void beginReporting() {
- results.append("Starting search...");
- }
- public void endReporting() {
- results.append("\nDone searching.");
- }
- };
- searchDeclarationsOfReferencedTypes(
- pkg,
- result
- );
- assertSearchResults(
- "Starting search...\n"+
- "Done searching.",
- result);
-}
-
-/**
- * Declaration of referenced types test.
- * (Regression test for bug 68862 [1.5] ClassCastException when moving a a java file
-)
- */
-public void testDeclarationOfReferencedTypes09() throws CoreException {
- IJavaScriptUnit cu = getCompilationUnit("JavaSearch15/src/p3/X.js");
- JavaSearchResultCollector result = new JavaSearchResultCollector() {
- public void beginReporting() {
- results.append("Starting search...");
- }
- public void endReporting() {
- results.append("\nDone searching.");
- }
- };
- searchDeclarationsOfReferencedTypes(
- cu,
- result
- );
- assertSearchResults(
- "Starting search...\n" +
- getExternalJCLPathString("1.5") + " java.lang.Object\n" +
- "Done searching.",
- result);
-}
-/**
- * Simple declarations of sent messages test.
- */
-public void testDeclarationsOfSentMessages01() throws CoreException { // was testSimpleDeclarationsOfSentMessages
- IJavaScriptUnit cu = getCompilationUnit("JSSearch", "src", "", "Test.js");
- searchDeclarationsOfSentMessages(
- cu,
- this.resultCollector);
- assertSearchResults(
- "src/p/X.java void p.X.foo(int, String, X) [foo(int i, String s, X x)]\n" +
- "src/p/Y.java void p.Y.bar() [bar()]\n" +
- "src/p/Z.java void p.Z.foo(int, String, X) [foo(int i, String s, X x)]\n" +
- "src/p/A.java void p.A.foo(int, String, X) [foo()]",
- this.resultCollector);
-}
-
-/**
- * Declaration of sent messages test.
- * (regression test for bug 6538 searchDeclarationsOf* incorrect)
- */
-public void testDeclarationsOfSentMessages02() throws CoreException { // was testDeclarationOfSentMessages
- IFunction method =
- getCompilationUnit("JSSearch", "src", "a5", "B.js").
- getType("C").getFunction("i", new String[] {});
- searchDeclarationsOfSentMessages(
- method,
- resultCollector
- );
- assertSearchResults(
- "",
- this.resultCollector);
-}
-/**
- * Simple field declaration test.
- */
-public void testFieldDeclaration01() throws CoreException { // was testSimpleFieldDeclaration
- IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
- IField field = type.getField("x");
- search(
- field,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.java p.A.x [x]",
- this.resultCollector);
-}
-/**
- * Field declaration in jar file test.
- */
-public void testFieldDeclaration02() throws CoreException { // was testFieldDeclarationInJar
- IType type = getClassFile("JSSearch", "MyJar.jar", "p1", "A.class").getType();
- IField field = type.getField("field");
- search(
- field,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "MyJar.jar p1.A.field [No source]",
- this.resultCollector);
-}
-
-
-/**
- * Field declaration with array type test.
- * (regression test for PR 1GKEG73: ITPJCORE:WIN2000 - search (136): missing field declaration)
- */
-public void testFieldDeclaration03() throws CoreException { // was testFieldDeclarationArrayType
- IType type = getCompilationUnit("JSSearch", "src", "", "B.js").getType("B");
- IField field = type.getField("open");
- search(
- field,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/B.java B.open [open]",
- this.resultCollector);
-}
-/**
- * Field declaration with wild card test.
- * (regression test for bug 21763 Problem in Java search [search] )
- */
-public void testFieldDeclaration04() throws CoreException { // was testFieldDeclarationWithWildCard
- search(
- "class*path",
- FIELD,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/c5/Test.java c5.Test.class_path [class_path]",
- this.resultCollector);
-}
-/**
- * Field reference test.
- * (regression test for bug #3433 search: missing field occurrecnces (1GKZ8J6))
- */
-public void testFieldReference01() throws CoreException { // was testFieldReference
- IType type = getCompilationUnit("JSSearch", "src", "p8", "A.js").getType("A");
- IField field = type.getField("g");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p8/A.java void p8.A.m() [g]\n" +
- "src/p8/A.java void p8.B.m() [g]",
- this.resultCollector);
-}
-/**
- * Field reference test.
- * (regression test for PR 1GK8TXE: ITPJCORE:WIN2000 - search: missing field reference)
- */
-public void testFieldReference02() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "p9", "X.js").getType("X");
- IField field = type.getField("f");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p9/X.java void p9.X.m() [f]",
- this.resultCollector);
-}
-/**
- * Field reference test.
- * (regression test for bug 5821 Refactor > Rename renames local variable instead of member in case of name clash )
- */
-public void testFieldReference03() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "q8", "EclipseTest.js").getType("EclipseTest");
- IField field = type.getField("test");
- resultCollector.showPotential = false;
- search(field, REFERENCES, getJavaSearchScope());
- assertSearchResults(
- "src/q8/EclipseTest.java void q8.EclipseTest.main(String[]) [test]"
- );
-}
-/**
- * Field reference test.
- * (regression test for bug 5923 Search for "length" field refs finds [].length)
- */
-public void testFieldReference04() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "a2", "X.js").getType("X");
- IField field = type.getField("length");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/a2/X.java void a2.X.foo() [length]",
- this.resultCollector);
-}
-/**
- * Field reference test.
- * (regression test for bug 7987 Field reference search should do lookup in 1.4 mode)
- */
-public void testFieldReference05() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "b1", "A.js").getType("A");
- IField field = type.getField("x");
-
- // Set 1.4 compliance level (no constant yet)
- Hashtable options = JavaScriptCore.getOptions();
- String currentOption = (String)options.get("org.eclipse.wst.jsdt.core.compiler.compliance");
- options.put("org.eclipse.wst.jsdt.core.compiler.compliance", "1.4");
- JavaScriptCore.setOptions(options);
-
- try {
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/b1/B.java void b1.B.foo() [x]",
- this.resultCollector);
- } finally {
- // Restore compliance level
- options.put("org.eclipse.wst.jsdt.core.compiler.compliance", currentOption);
- JavaScriptCore.setOptions(options);
- }
-}
-/**
- * Field reference test.
- * (regression test for bug 20693 Finding references to variables does not find all occurances)
- */
-public void testFieldReference06() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "c4", "X.js").getType("X");
- IField field = type.getField("x");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/c4/X.java int c4.X.foo() [x]",
- this.resultCollector);
-}
-/**
- * Field reference test.
- * (regression test for bug 61017 Refactoring - test case that results in uncompilable source)
- */
-public void testFieldReference07() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "s5", "A.js").getType("A");
- IField field = type.getField("b");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/s5/A.java void s5.A.method() [b]",
- this.resultCollector);
-}
-/**
- * Simple field reference test.
- */
-public void testFieldReference08() throws CoreException { // was testSimpleFieldReference
- IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
- IField field = type.getField("x");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/Test.java void Test.main(String[]) [x]\n" +
- "src/p/A.java p.A(X) [x]",
- this.resultCollector);
-}
-/**
- * Simple field read access reference test.
- */
-public void testFieldReference09() throws CoreException { // was testSimpleReadFieldReference
- IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
- IField field = type.getField("x");
- search(
- field,
- READ_ACCESSES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/Test.java void Test.main(String[]) [x]",
- this.resultCollector);
-}
-/**
- * Simple write field access reference test.
- */
-public void testFieldReference10() throws CoreException { // was testSimpleWriteFieldReference
- IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
- IField field = type.getField("x");
- search(
- field,
- WRITE_ACCESSES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.java p.A(X) [x]",
- this.resultCollector);
-}
-/**
- * Multiple field references in one ast test.
- * (regression test for PR 1GD79XM: ITPJCORE:WINNT - Search - search for field references - not all found)
- */
-public void testFieldReference11() throws CoreException { // was testMultipleFieldReference
- IType type = getCompilationUnit("JSSearch", "src", "p5", "A.js").getType("A");
- IField field = type.getField("x");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p5/A.java void p5.A.k() [x]\n" +
- "src/p5/A.java void p5.A.k() [x]\n" +
- "src/p5/A.java void p5.A.k() [x]",
- this.resultCollector);
-}
-/**
- * Static field reference test.
- * (regression test for PR #1G2P5EP)
- */
-public void testFieldReference12() throws CoreException { // was testStaticFieldReference
- IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
- IField field = type.getField("DEBUG");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.java void p.A.foo() [DEBUG]",
- this.resultCollector);
-}
-/**
- * Field reference in inner class test.
- * (regression test for PR 1GL11J6: ITPJCORE:WIN2000 - search: missing field references (nested types))
- */
-public void testFieldReference13() throws CoreException { // was testFieldReferenceInInnerClass
- IType type = getCompilationUnit("JSSearch", "src", "", "O.js").getType("O");
- IField field = type.getField("y");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/O.java void O$I.y() [y]",
- this.resultCollector);
-}
-/**
- * Field reference in anonymous class test.
- * (regression test for PR 1GL12XE: ITPJCORE:WIN2000 - search: missing field references in inner class)
- */
-public void testFieldReference14() throws CoreException { // was testFieldReferenceInAnonymousClass
- IType type = getCompilationUnit("JSSearch", "src", "", "D.js").getType("D");
- IField field = type.getField("h");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/D.java void void D.g():<anonymous>#1.run() [h]",
- this.resultCollector);
-}
-/**
- * Field reference through subclass test.
- * (regression test for PR 1GKB9YH: ITPJCORE:WIN2000 - search for field refs - incorrect results)
- */
-public void testFieldReference15() throws CoreException { // was testFieldReferenceThroughSubclass
- IType type = getCompilationUnit("JSSearch", "src", "p6", "A.js").getType("A");
- IField field = type.getField("f");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p6/A.java void p6.A.m() [f]\n" +
- "src/p6/A.java void p6.B.m() [f]\n" +
- "src/p6/A.java void p6.B.m() [f]",
- this.resultCollector);
-
- type = getCompilationUnit("JSSearch", "src", "p6", "A.js").getType("AA");
- field = type.getField("f");
- resultCollector = new JavaSearchResultCollector();
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p6/A.java void p6.B.m() [f]",
- this.resultCollector);
-
-}
-/**
- * Read and write access reference in compound expression test.
- * (regression test for bug 6158 Search - Prefix and postfix expression not found as write reference)
- */
-public void testFieldReference16() throws CoreException { // was testReadWriteFieldReferenceInCompoundExpression
- IType type = getCompilationUnit("JSSearch", "src", "a4", "X.js").getType("X");
- IField field = type.getField("field");
-
- // Read reference
- search(
- field,
- READ_ACCESSES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/a4/X.java void a4.X.foo() [field]",
- this.resultCollector);
-
- // Write reference
- resultCollector = new JavaSearchResultCollector();
- search(
- field,
- WRITE_ACCESSES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/a4/X.java void a4.X.foo() [field]",
- this.resultCollector);
-}
-/**
- * Write access reference in a qualified name reference test.
- * (regression test for bug 7344 Search - write acces give wrong result)
- */
-public void testFieldReference17() throws CoreException { // was testReadWriteAccessInQualifiedNameReference
- IType type = getCompilationUnit("JSSearch", "src", "a8", "A.js").getType("A");
- IField field = type.getField("a");
- search(
- field,
- WRITE_ACCESSES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "",
- this.resultCollector);
-}
-/**
- * Field reference in brackets test.
- * (regression test for bug 23329 search: incorrect range for type references in brackets)
- */
-public void testFieldReference18() throws CoreException { // was testFieldReferenceInBrackets
- IType type = getCompilationUnit("JSSearch", "src", "s3", "A.js").getType("A");
- IField field = type.getField("field");
- search(
- field,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/s3/A.java int s3.A.bar() [field]",
- this.resultCollector);
-}
-
-/**
- * Accurate field reference test.
- */
-public void testFieldReference19() throws CoreException { // was testAccurateFieldReference1
- search(
- "d6.X.CONSTANT",
- FIELD,
- REFERENCES,
- SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {
- getPackageFragment("JSSearch", "src", "d6")
- }),
- this.resultCollector);
- assertSearchResults(
- "src/d6/Y.java d6.Y.T [CONSTANT]",
- this.resultCollector);
-}
-/**
- * Field reference inside/outside doc comment.
- */
-public void testFieldReference20() throws CoreException { // was testFieldReferenceInOutDocComment
- IType type = getCompilationUnit("JSSearch", "src", "s4", "X.js").getType("X");
- IField field = type.getField("x");
- resultCollector.showInsideDoc = true;
- search(field, REFERENCES, getJavaSearchScope(), resultCollector);
- assertSearchResults(
- "src/s4/X.java int s4.X.foo() [x] OUTSIDE_JAVADOC\n" +
- "src/s4/X.java void s4.X.bar() [x] INSIDE_JAVADOC",
- this.resultCollector);
-}
-/**
- * Interface implementors test.
- */
-public void testInterfaceImplementors1() throws CoreException { // was testInterfaceImplementors
- // implementors of an interface
- IType type = getCompilationUnit("JSSearch", "src", "p", "I.js").getType("I");
- search(
- type,
- IMPLEMENTORS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/InterfaceImplementors.java InterfaceImplementors [p.I]\n" +
- "src/p/X.java p.X [I]",
- this.resultCollector);
-
- /**
- * Implementors of a class should now give a match
- * Bug 1G5HBQA: "ITPJUI:WINNT - Search - search for implementors of a class finds subclasses" is cancelled
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=124645"
- */
- type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
- resultCollector = new JavaSearchResultCollector();
- search(
- type,
- IMPLEMENTORS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/Y.java p.Y [X]",
- this.resultCollector);
-}
-/**
- * Interface implementors test.
- * (regression test for bug 22102 Not all implementors found for IPartListener)
- */
-public void testInterfaceImplementors2() throws CoreException {
- // implementors of an interface
- IType type = getCompilationUnit("JSSearch", "src", "r2", "I.js").getType("I");
- search(
- type,
- IMPLEMENTORS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/r2/X.java r2.X.field:<anonymous>#1 [I]",
- this.resultCollector);
-}
-/*
- * Local variable declaration test.
- * (SingleNameReference)
- */
-public void testLocalVariableDeclaration1() throws CoreException {
- ILocalVariable localVar = getLocalVariable("/JavaSearch/src/f1/X.js", "var1 = 1;", "var1");
- search(
- localVar,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/f1/X.java void f1.X.foo1().var1 [var1]",
- this.resultCollector);
-}
-/*
- * Local variable declaration test.
- * (QualifiedNameReference)
- */
-public void testLocalVariableDeclaration2() throws CoreException {
- ILocalVariable localVar = getLocalVariable("/JavaSearch/src/f1/X.js", "var2 = new X();", "var2");
- search(
- localVar,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/f1/X.java void f1.X.foo2().var2 [var2]",
- this.resultCollector);
-}
-/*
- * Local variable occurrences test.
- * (SingleNameReference)
- */
-public void testLocalVariableOccurrences1() throws CoreException {
- ILocalVariable localVar = getLocalVariable("/JavaSearch/src/f1/X.js", "var1 = 1;", "var1");
- search(
- localVar,
- ALL_OCCURRENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/f1/X.java void f1.X.foo1().var1 [var1]\n" +
- "src/f1/X.java void f1.X.foo1() [var1]",
- this.resultCollector);
-}
-/*
- * Local variable occurences test.
- * (QualifiedNameReference)
- */
-public void testLocalVariableOccurrences2() throws CoreException {
- ILocalVariable localVar = getLocalVariable("/JavaSearch/src/f1/X.js", "var2 = new X();", "var2");
- search(
- localVar,
- ALL_OCCURRENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/f1/X.java void f1.X.foo2().var2 [var2]\n" +
- "src/f1/X.java void f1.X.foo2() [var2]",
- this.resultCollector);
-}
-/*
- * Local variable reference test.
- * (SingleNameReference)
- */
-public void testLocalVariableReference1() throws CoreException {
- ILocalVariable localVar = getLocalVariable("/JavaSearch/src/f1/X.js", "var1 = 1;", "var1");
- search(
- localVar,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/f1/X.java void f1.X.foo1() [var1]",
- this.resultCollector);
-}
-/*
- * Local variable reference test.
- * (QualifiedNameReference)
- */
-public void testLocalVariableReference2() throws CoreException {
- ILocalVariable localVar = getLocalVariable("/JavaSearch/src/f1/X.js", "var2 = new X();", "var2");
- search(
- localVar,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/f1/X.java void f1.X.foo2() [var2]",
- this.resultCollector);
-}
-/*
- * Local variable reference test.
- * (regression test for bug 48725 Cannot search for local vars in jars.)
- */
-public void testLocalVariableReference3() throws CoreException {
- IClassFile classFile = getClassFile("JSSearch", "test48725.jar", "p48725", "X.class");
- ILocalVariable localVar = (ILocalVariable) codeSelect(classFile, "local = 1;", "local")[0];
- search(
- localVar,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "test48725.jar int p48725.<anonymous>.bar()",
- this.resultCollector);
-}
-/**
- * Simple method declaration test.
- */
-public void testMethodDeclaration01() throws CoreException { // was testSimpleMethodDeclaration
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
- IFunction method = type.getFunction("foo", new String[] {"I", "QString;", "QX;"});
-
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/X.java void p.X.foo(int, String, X) [foo]\n" +
- "src/p/Z.java void p.Z.foo(int, String, X) [foo]",
- this.resultCollector);
-}
-/**
- * Method declaration test.
- * (regression test for bug 38568 Search for method declarations fooled by array types)
- */
-public void testMethodDeclaration02() throws CoreException { // was testMethodDeclaration
- IType type = getCompilationUnit("JSSearch", "src", "e2", "X.js").getType("X");
-
- search(
- "foo(String, String)",
- METHOD,
- DECLARATIONS,
- SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type}),
- this.resultCollector);
- assertSearchResults(
- "src/e2/X.java void e2.X.foo(String, String) [foo]",
- this.resultCollector);
-}
-
-
-/**
- * Inner method declaration test.
- */
-public void testMethodDeclaration03() throws CoreException { // was testInnerMethodDeclaration
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X").getType("Inner");
- IFunction method = type.getFunction("foo", new String[] {});
-
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/X.java String p.X$Inner.foo() [foo]",
- this.resultCollector);
-}
-/**
- * Method declaration in hierarchy test.
- */
-public void testMethodDeclaration04() throws CoreException { // was testMethodDeclarationInHierarchyScope1
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
-
- search(
- "foo",
- METHOD,
- DECLARATIONS,
- SearchEngine.createHierarchyScope(type),
- this.resultCollector);
- assertSearchResults(
- "src/p/X.java void p.X.foo(int, String, X) [foo]\n" +
- "src/p/Z.java void p.Z.foo(int, String, X) [foo]",
- this.resultCollector);
-}
-/**
- * Method declaration in hierarchy that contains elements in external jar.
- * (regression test for PR #1G2E4F1)
- */
-public void testMethodDeclaration05() throws CoreException { // was testMethodDeclarationInHierarchyScope2
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
- IFunction method = type.getFunction("foo", new String[] {"I", "QString;", "QX;"});
-
- search(
- method,
- DECLARATIONS,
- SearchEngine.createHierarchyScope(type),
- this.resultCollector);
- assertSearchResults(
- "src/p/X.java void p.X.foo(int, String, X) [foo]\n" +
- "src/p/Z.java void p.Z.foo(int, String, X) [foo]",
- this.resultCollector);
-}
-/**
- * Method declaration in hierarchy on a secondary type.
- */
-public void testMethodDeclaration06() throws CoreException { // was testMethodDeclarationInHierarchyScope3
- IType type = getCompilationUnit("JSSearch", "src", "d3", "A.js").getType("B");
- IFunction method = type.getFunction("foo", new String[] {});
-
- search(
- method,
- DECLARATIONS,
- SearchEngine.createHierarchyScope(type),
- this.resultCollector);
- assertSearchResults(
- "src/d3/A.java void d3.B.foo() [foo]",
- this.resultCollector);
-}
-/**
- * Method declaration in package test.
- * (regression tets for PR #1G2KA97)
- */
-public void testMethodDeclaration07() throws CoreException { // was testMethodDeclarationInPackageScope
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getPackageFragment()});
-
- search(
- "main(String[])",
- METHOD,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/p/A.java void p.A.main(String[]) [main]",
- this.resultCollector);
-}
-/**
- * Method declaration in jar file test.
- */
-public void testMethodDeclaration08() throws CoreException { // was testMethodDeclarationInJar
- IType type = getClassFile("JSSearch", "MyJar.jar", "p1", "A.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"Ljava.lang.String;"});
-
- search(
- method,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "MyJar.jar boolean p1.A.foo(java.lang.String) [No source]",
- this.resultCollector);
-}
-/**
- * Method declaration in field initialzer.
- * (regression test for bug 24346 Method declaration not found in field initializer )
- */
-public void testMethodDeclaration09() throws CoreException { // was testMethodDeclarationInInitializer
-
- search(
- "foo24346",
- METHOD,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/c6/X.java void c6.X.x:<anonymous>#1.foo24346() [foo24346]",
- this.resultCollector);
-}
-/*
- * Method declaration with a missing return type.
- * (regression test for bug 43080 NPE when searching in CU with incomplete method declaration)
- */
-public void testMethodDeclaration10() throws CoreException { // was testMethodDeclarationNoReturnType
- IType type = getCompilationUnit("JSSearch", "src", "e8", "A.js").getType("A");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getPackageFragment()});
-
- search(
- "m() int",
- METHOD,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/e8/A.java void e8.A.m() [m]",
- this.resultCollector);
-}
-/**
- * Method declaration with source folder as java search scope.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=92210"
- */
-public void testMethodDeclaration11() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JSSearch", "otherSrc()", "", "X92210.js");
- assertNotNull("Should have found an unit", unit);
- IJavaScriptElement root = unit.getAncestor(IJavaScriptElement.PACKAGE_FRAGMENT_ROOT);
- assertNotNull("Should have found package fragment root", root);
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {root});
-
- search(
- "foo",
- METHOD,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "otherSrc()/X92210.java void X92210.foo() [foo]",
- this.resultCollector);
-}
-/**
- * Method reference test.
- * (regression test for bug 5068 search: missing method reference)
- */
-public void testMethodReference01() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "q5", "AQ.js").getType("I");
- IFunction method = type.getFunction("k", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/q5/AQ.java void q5.T.m() [k()]",
- this.resultCollector);
-}
-/**
- * Method reference test.
- * (regression test for bug 5069 search: method reference in super missing)
- */
-public void testMethodReference02() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "q6", "CD.js").getType("AQ");
- IFunction method = type.getFunction("k", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/q6/CD.java void q6.AQE.k() [k()]",
- this.resultCollector);
-}
-/**
- * Method reference test.
- * (regression test for bug 5070 search: missing interface method reference )
- */
-public void testMethodReference03() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "q7", "AQ.js").getType("I");
- IFunction method = type.getFunction("k", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/q7/AQ.java void q7.D.h() [k()]",
- this.resultCollector);
-}
-/**
- * Method reference test.
- * (regression test for bug 8928 Unable to find references or declarations of methods that use static inner classes in the signature)
- */
-public void testMethodReference04() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "b2", "Y.js").getType("Y");
- IFunction method = type.getFunction("foo", new String[] {"QX.Inner;"});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/b2/Z.java void b2.Z.bar() [foo(inner)]",
- this.resultCollector);
-}
-/**
- * Method reference test.
- * (regression test for bug 49120 search doesn't find references to anonymous inner methods)
- */
-public void testMethodReference05() throws CoreException {
- IType type = getCompilationUnit("JavaSearch/src/e9/A.js").getType("A").getFunction("foo", new String[] {}).getType("", 1);
- IFunction method = type.getFunction("bar", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/e9/A.java void e9.A.foo() [bar()]",
- this.resultCollector);
-}
-/*
- * Method reference in second anonymous and second local type of a method test.
- */
-public void testMethodReference06() throws CoreException {
- IFunction method= getCompilationUnit("JavaSearch/src/f3/X.js").getType("X").getFunction("bar", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/f3/X.java void void f3.X.foo():<anonymous>#2.foobar() [bar()]\n" +
- "src/f3/X.java void void f3.X.foo():Y#2.foobar() [bar()]",
- this.resultCollector);
-}
-/**
- * Simple method reference test.
- */
-public void testMethodReference07() throws CoreException { // was testSimpleMethodReference
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
- IFunction method = type.getFunction("foo", new String[] {"I", "QString;", "QX;"});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/Test.java void Test.main(String[]) [foo(1, \"a\", y)]\n" +
- // since bug 160301 fix, subclass overridden method calls are not reported
- //"src/Test.java void Test.main(String[]) [foo(1, \"a\", z)]\n" +
- "src/p/Z.java void p.Z.foo(int, String, X) [foo(i, s, new Y(true))]",
- this.resultCollector);
-}
-/**
- * Static method reference test.
- */
-public void testMethodReference08() throws CoreException { // was testStaticMethodReference1
- IType type = getCompilationUnit("JSSearch", "src", "p", "Y.js").getType("Y");
- IFunction method = type.getFunction("bar", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/Test.java void Test.main(String[]) [bar()]",
- this.resultCollector);
-}
-/**
- * Static method reference test.
- */
-public void testMethodReference09() throws CoreException { // was testStaticMethodReference2
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
- IFunction method = type.getFunction("bar", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "",
- this.resultCollector);
-}
-/**
- * Inner method reference test.
- */
-public void testMethodReference10() throws CoreException { // was testInnerMethodReference
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X").getType("Inner");
- IFunction method = type.getFunction("foo", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.java void p.A.foo(int, String, X) [foo()]",
- this.resultCollector);
-}
-/**
- * Method reference through super test.
- */
-public void testMethodReference11() throws CoreException { // was testMethodReferenceThroughSuper
- IType type = getCompilationUnit("JSSearch", "src", "sd", "AQ.js").getType("AQ");
- IFunction method = type.getFunction("k", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/sd/AQ.java void sd.AQE.k() [k()]",
- this.resultCollector);
-}
-/**
- * Method reference in inner class test.
- */
-public void testMethodReference12() throws CoreException { // was testMethodReferenceInInnerClass
- IType type = getCompilationUnit("JSSearch", "src", "", "CA.js").getType("CA");
- IFunction method = type.getFunction("m", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/CA.java void CA$CB.f() [m()]\n" +
- "src/CA.java void CA$CB$CC.f() [m()]",
- this.resultCollector);
-}
-/**
- * Method reference in anonymous class test.
- * (regression test for PR 1GGNOTF: ITPJCORE:WINNT - Search doesn't find method referenced in anonymous inner class)
- */
-public void testMethodReference13() throws CoreException { // was testMethodReferenceInAnonymousClass
- IType type = getCompilationUnit("JSSearch", "src", "", "PR_1GGNOTF.js").getType("PR_1GGNOTF");
- IFunction method = type.getFunction("method", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/PR_1GGNOTF.java void void PR_1GGNOTF.method2():<anonymous>#1.run() [method()]",
- this.resultCollector);
-}
-/**
- * Method reference through array test.
- * (regression test for 1GHDA2V: ITPJCORE:WINNT - ClassCastException when doing a search)
- */
-public void testMethodReference14() throws CoreException { // was testMethodReferenceThroughArray
- IType type = getClassFile("JSSearch", getSystemJsPathString(), "java.lang", "Object.class").getType();
- IFunction method = type.getFunction("clone", new String[] {});
-
- search(
- method,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/E.java Object E.foo() [clone()]",
- this.resultCollector);
-}
-/**
- * Method reference inside/outside doc comment.
- */
-public void testMethodReference15() throws CoreException { // was testMethodReferenceInOutDocComment
- IType type = getCompilationUnit("JSSearch", "src", "s4", "X.js").getType("X");
- IFunction method = type.getFunction("foo", new String[] {});
- resultCollector.showInsideDoc = true;
- search(method, REFERENCES, getJavaSearchScope(), resultCollector);
- assertSearchResults(
- "src/s4/X.java void s4.X.bar() [foo()] INSIDE_JAVADOC\n" +
- "src/s4/X.java void s4.X.fred() [foo()] OUTSIDE_JAVADOC",
- this.resultCollector);
-}
-/*
- * Generic method reference.
- */
-public void testMethodReference16() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15/src/p2/X.js").getType("X");
- IFunction method = type.getFunction("foo", new String[] {"QE;"});
- search(method, REFERENCES, ERASURE_RULE, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/p2/Y.java void p2.Y.bar() [foo(this)]",
- this.resultCollector);
-}
-/**
- * Bug 111416: [search] wrong potential matches on a static method open
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=111416"
- */
-public void testMethodReference17() throws CoreException {
- IType type = getCompilationUnit("JavaSearch/src/b111416/X.js").getType("X");
- IFunction method = type.getFunction("open", new String[] {"QString;"});
- resultCollector.showAccuracy = true;
- search(method, REFERENCES, ERASURE_RULE, getJavaSearchScope(), resultCollector);
- assertSearchResults(
- "src/b111416/X.java void b111416.X.foo() [open(\"\")] EXACT_MATCH",
- this.resultCollector);
-}
-/**
- * OrPattern test.
- * (regression test for bug 5862 search : too many matches on search with OrPattern)
- */
-public void testOrPattern() throws CoreException {
- IFunction leftMethod = getCompilationUnit("JSSearch", "src", "q9", "I.js")
- .getType("I").getFunction("m", new String[] {});
- SearchPattern leftPattern = createPattern(leftMethod, ALL_OCCURRENCES);
- IFunction rightMethod = getCompilationUnit("JSSearch", "src", "q9", "I.js")
- .getType("A1").getFunction("m", new String[] {});
- SearchPattern rightPattern = createPattern(rightMethod, ALL_OCCURRENCES);
- SearchPattern orPattern = SearchPattern.createOrPattern(leftPattern, rightPattern);
- resultCollector.showAccuracy = true;
- search(
- orPattern,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/e8/A.java void e8.A.m() [m] POTENTIAL_MATCH\n" +
- "src/q9/I.java void q9.I.m() [m] EXACT_MATCH\n" +
- "src/q9/I.java void q9.A1.m() [m] EXACT_MATCH",
- this.resultCollector);
-}
-/**
- * Simple package declaration test.
- */
-public void testPackageDeclaration1() throws CoreException { // was testSimplePackageDeclaration
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "p");
- search(
- pkg,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p p",
- this.resultCollector);
-}
-
-/**
- * Various package declarations test.
- */
-public void testPackageDeclaration2() throws CoreException { // was testVariousPackageDeclarations
-
- search(
- "p3*",
- PACKAGE,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p3 p3\n" +
- "src/p3/p2 p3.p2\n" +
- "src/p3/p2/p p3.p2.p",
- this.resultCollector);
-}
-/**
- * Package declaration test.
- * (regression test for bug 62698 NPE while searching for declaration of binary package)
- */
-public void testPackageDeclaration3() throws CoreException { // was testPackageDeclaration
- IPackageFragment pkg = getPackageFragment("JSSearch", getSystemJsPathString(), "java.lang");
-
- search(
- pkg,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- getExternalJCLPath("") + " java.lang",
- this.resultCollector);
-}
-/**
- * Package declaration with corrupt jar on the classpath test.
- * (regression test for bug 75561 Rename package results in I/O exception)
- */
-public void testPackageDeclaration4() throws CoreException {
- IJavaScriptProject project = getJavaProject("JSSearch");
- IIncludePathEntry[] originalCP = project.getRawIncludepath();
- try {
- // add corrupt.jar to classpath
- int cpLength = originalCP.length;
- IIncludePathEntry[] newCP = new IIncludePathEntry[cpLength+1];
- System.arraycopy(originalCP, 0, newCP, 0, cpLength);
- newCP[cpLength] = JavaScriptCore.newLibraryEntry(new Path("/JavaSearch/corrupt.jar"), null, null);
- project.setRawIncludepath(newCP, null);
-
-
- search(
- "r9",
- PACKAGE,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/r9 r9",
- this.resultCollector);
- } finally {
- project.setRawIncludepath(originalCP, null);
- }
-}
-/**
- * Bug 117020: [search] Search for '*' does not report empty packages
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=117020"
- */
-public void testPackageDeclarationBug117020() throws CoreException {
- IFolder srcFolder = getFolder(new Path("/JavaSearch/src"));
- IPackageFragmentRoot srcRoot = JAVA_PROJECT.getPackageFragmentRoot(srcFolder);
- IPackageFragment test = null;
- try {
- test = srcRoot.createPackageFragment("b117020", true, null);
- JavaSearchResultCollector result = new JavaSearchResultCollector();
- result.showAccuracy = true;
- search(test, DECLARATIONS, getJavaSearchScope(), result);
- assertSearchResults(
- "src/b117020 b117020 EXACT_MATCH",
- result);
- }
- catch (JavaScriptModelException jme) {
- // give up
- }
- finally {
- if (test != null && test.exists()) {
- test.delete(true, null);
- }
- }
-}
-/**
- * Package reference test.
- * (regression test for PR 1GK90H4: ITPJCORE:WIN2000 - search: missing package reference)
- */
-public void testPackageReference1() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "q2");
-
- search(
- pkg,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/q1/B.java void q1.B.m(AA) [q2]",
- this.resultCollector);
-}
-/**
- * Package reference test.
- * (regression test for bug 17906 Rename package fails when inner classes are imported)
- */
-public void testPackageReference2() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "b8");
-
- search(
- pkg,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/b9/Foo.java [b8]",
- this.resultCollector);
-}
-/**
- * Package reference in jar test.
- * (regression test for bug 47989 Exception when searching for IPackageFragment "java.util.zip")
- */
-public void testPackageReference3() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JSSearch", "test47989.jar", "p1");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg.getParent()});
-
- search(
- pkg,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "test47989.jar java.lang.Object p2.Y.foo()",
- this.resultCollector);
-}
-/**
- * Simple package reference test.
- */
-public void testPackageReference4() throws CoreException { // was testSimplePackageReference
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "p");
-
- search(
- pkg,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/InterfaceImplementors.java InterfaceImplementors [p]\n" +
- "src/Test.java void Test.main(String[]) [p]\n" +
- "src/Test.java void Test.main(String[]) [p]\n" +
- "src/Test.java void Test.main(String[]) [p]\n" +
- "src/Test.java void Test.main(String[]) [p]\n" +
- "src/Test.java void Test.main(String[]) [p]\n" +
- "src/Test.java void Test.main(String[]) [p]\n" +
- "src/Test.java void Test.main(String[]) [p]\n" +
- "src/TypeReferenceInImport/X.java [p]",
- this.resultCollector);
-}
-/**
- * Various package reference test.
- */
-public void testPackageReference5() throws CoreException { // was testVariousPackageReference
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "p3.p2.p");
-
- search(
- pkg,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/PackageReference/A.java [p3.p2.p]\n" +
- "src/PackageReference/B.java [p3.p2.p]\n" +
- "src/PackageReference/C.java PackageReference.C [p3.p2.p]\n" +
- "src/PackageReference/D.java PackageReference.D.x [p3.p2.p]\n" +
- "src/PackageReference/E.java PackageReference.E.x [p3.p2.p]\n" +
- "src/PackageReference/F.java p3.p2.p.X PackageReference.F.foo() [p3.p2.p]\n" +
- "src/PackageReference/G.java void PackageReference.G.foo(p3.p2.p.X) [p3.p2.p]\n" +
- "src/PackageReference/H.java void PackageReference.H.foo() [p3.p2.p]\n" +
- "src/PackageReference/I.java void PackageReference.I.foo() [p3.p2.p]\n" +
- "src/PackageReference/J.java void PackageReference.J.foo() [p3.p2.p]",
- this.resultCollector);
-}
-/**
- * Regression test for 1GBK7B2: ITPJCORE:WINNT - package references: could be more precise
- */
-public void testPackageReference6() throws CoreException { // was testAccuratePackageReference
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "p3.p2");
-
- search(
- pkg,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/PackageReference/K.java [p3.p2]",
- this.resultCollector);
-}
-/**
- * Test pattern match package references
- */
-public void testPackageReference7() throws CoreException { // was testPatternMatchPackageReference
-
- search(
- "*p2.*",
- PACKAGE,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/PackageReference/A.java [p3.p2.p]\n" +
- "src/PackageReference/B.java [p3.p2.p]\n" +
- "src/PackageReference/C.java PackageReference.C [p3.p2.p]\n" +
- "src/PackageReference/D.java PackageReference.D.x [p3.p2.p]\n" +
- "src/PackageReference/E.java PackageReference.E.x [p3.p2.p]\n" +
- "src/PackageReference/F.java p3.p2.p.X PackageReference.F.foo() [p3.p2.p]\n" +
- "src/PackageReference/G.java void PackageReference.G.foo(p3.p2.p.X) [p3.p2.p]\n" +
- "src/PackageReference/H.java void PackageReference.H.foo() [p3.p2.p]\n" +
- "src/PackageReference/I.java void PackageReference.I.foo() [p3.p2.p]\n" +
- "src/PackageReference/J.java void PackageReference.J.foo() [p3.p2.p]",
- this.resultCollector);
-}
-/**
- * Test pattern match package references
- * Just verify that there's no ArrayOutOfBoundException to validate fix for
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=64421
- */
-public void testPackageReference8() throws CoreException { // was testPatternMatchPackageReference2
-
- search(
- "*",
- PACKAGE,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- resultCollector.toString();
-}
-/**
- * Test that we find potential matches in binaries even if we can't resolve the entire
- * class file.
- * (Regression test for 1G4IN3E: ITPJCORE:WINNT - AbortCompilation using J9 to search for class declaration)
- */
-public void testPotentialMatchInBinary1() throws CoreException {
- IJavaScriptProject project = this.getJavaProject("JSSearch");
- IIncludePathEntry[] classpath = project.getRawIncludepath();
- try {
- // add AbortCompilation.jar to classpath
- int length = classpath.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[length+1];
- System.arraycopy(classpath, 0, newClasspath, 0, length);
- newClasspath[length] = JavaScriptCore.newLibraryEntry(new Path("/JavaSearch/AbortCompilation.jar"), null, null);
- project.setRawIncludepath(newClasspath, null);
-
- // potential match for a field declaration
-
- resultCollector.showAccuracy = true;
- search(
- "MissingFieldType.*",
- FIELD,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "AbortCompilation.jar AbortCompilation.MissingFieldType.field [No source] POTENTIAL_MATCH\n" +
- "AbortCompilation.jar AbortCompilation.MissingFieldType.missing [No source] POTENTIAL_MATCH\n" +
- "AbortCompilation.jar AbortCompilation.MissingFieldType.otherField [No source] POTENTIAL_MATCH",
- this.resultCollector);
- } finally {
- // reset classpath
- project.setRawIncludepath(classpath, null);
- }
-}
-/**
- * Test that we find potential matches in binaries even if we can't resolve the entire
- * class file.
- * (Regression test for 1G4IN3E: ITPJCORE:WINNT - AbortCompilation using J9 to search for class declaration)
- */
-public void testPotentialMatchInBinary2() throws CoreException {
- IJavaScriptProject project = this.getJavaProject("JSSearch");
- IIncludePathEntry[] classpath = project.getRawIncludepath();
- try {
- // add AbortCompilation.jar to classpath
- int length = classpath.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[length+1];
- System.arraycopy(classpath, 0, newClasspath, 0, length);
- newClasspath[length] = JavaScriptCore.newLibraryEntry(new Path("/JavaSearch/AbortCompilation.jar"), null, null);
- project.setRawIncludepath(newClasspath, null);
-
- // potential match for a method declaration
-
- resultCollector.showAccuracy = true;
- search(
- "MissingArgumentType.foo*",
- METHOD,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "AbortCompilation.jar void AbortCompilation.MissingArgumentType.foo() [No source] POTENTIAL_MATCH\n" +
- "AbortCompilation.jar void AbortCompilation.MissingArgumentType.foo(java.util.EventListener) [No source] POTENTIAL_MATCH\n" +
- "AbortCompilation.jar void AbortCompilation.MissingArgumentType.foo2() [No source] POTENTIAL_MATCH",
- this.resultCollector);
- } finally {
- // reset classpath
- project.setRawIncludepath(classpath, null);
- }
-}
-/**
- * Test that we find potential matches in binaries even if we can't resolve the entire
- * class file.
- * (Regression test for 1G4IN3E: ITPJCORE:WINNT - AbortCompilation using J9 to search for class declaration)
- */
-public void testPotentialMatchInBinary3() throws CoreException {
- IJavaScriptProject project = this.getJavaProject("JSSearch");
- IIncludePathEntry[] classpath = project.getRawIncludepath();
- try {
- // add AbortCompilation.jar to classpath
- int length = classpath.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[length+1];
- System.arraycopy(classpath, 0, newClasspath, 0, length);
- newClasspath[length] = JavaScriptCore.newLibraryEntry(new Path("/JavaSearch/AbortCompilation.jar"), null, null);
- project.setRawIncludepath(newClasspath, null);
-
- // potential match for a type declaration
-
- resultCollector.showAccuracy = true;
- search(
- "Missing*",
- TYPE,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "AbortCompilation.jar AbortCompilation.EnclosingType$MissingEnclosingType [No source] EXACT_MATCH\n" +
- "AbortCompilation.jar AbortCompilation.MissingArgumentType [No source] EXACT_MATCH\n" +
- "AbortCompilation.jar AbortCompilation.MissingFieldType [No source] EXACT_MATCH",
- this.resultCollector);
- } finally {
- // reset classpath
- project.setRawIncludepath(classpath, null);
- }
-}
-/**
- * Hierarchy scope test.
- * (regression test for bug 3445 search: type hierarchy scope incorrect (1GLC8VS))
- */
-public void testSearchScope01() throws CoreException { // was testHierarchyScope
- IJavaScriptUnit cu = this. getCompilationUnit("JSSearch", "src", "a9", "A.js");
- IType type = cu.getType("C");
- IJavaScriptSearchScope scope = SearchEngine.createHierarchyScope(type);
- assertTrue("a9.C should be included in hierarchy scope", scope.encloses(type));
- assertTrue("a9.A should be included in hierarchy scope", scope.encloses(cu.getType("A")));
- assertTrue("a9.B should be included in hierarchy scope", scope.encloses(cu.getType("B")));
- assertTrue("a9/A.java should be included in hierarchy scope", scope.encloses(cu.getUnderlyingResource().getFullPath().toString()));
-}
-/**
- * Sub-cu java search scope test.
- * (regression test for bug 9041 search: cannot create a sub-cu scope)
- */
-public void testSearchScope02() throws CoreException { // was testSubCUSearchScope1
- IType type = getCompilationUnit("JSSearch", "src", "b3", "X.js").getType("X");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type});
-
- search(
- type,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/b3/X.java b3.X.field [X]\n" +
- "src/b3/X.java Object b3.X.foo() [X]\n" +
- "src/b3/X.java b3.X$Y.field2 [X]\n" +
- "src/b3/X.java Object b3.X$Y.foo2() [X]",
- this.resultCollector);
-}
-/**
- * Sub-cu java search scope test.
- * (regression test for bug 9041 search: cannot create a sub-cu scope)
- */
-public void testSearchScope03() throws CoreException { // was testSubCUSearchScope2
- IType type = getCompilationUnit("JSSearch", "src", "b3", "X.js").getType("X");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getField("field")});
-
- search(
- type,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/b3/X.java b3.X.field [X]",
- this.resultCollector);
-}
-/**
- * Sub-cu java search scope test.
- * (regression test for bug 9041 search: cannot create a sub-cu scope)
- */
-public void testSearchScope04() throws CoreException { // was testSubCUSearchScope3
- IType type = getCompilationUnit("JSSearch", "src", "b3", "X.js").getType("X");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getType("Y")});
-
- search(
- type,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/b3/X.java b3.X$Y.field2 [X]\n" +
- "src/b3/X.java Object b3.X$Y.foo2() [X]",
- this.resultCollector);
-}
-/**
- * Java search scope on java element in external jar test.
- */
-public void testSearchScope05() throws CoreException, IOException { // was testExternalJarScope
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- File workspaceLocation = new File(workspace.getRoot().getLocation().toOSString());
- File minimalJar = new File(workspaceLocation, "JavaSearch/MyJar.jar");
- File externalJar = new File(workspaceLocation.getParentFile().getCanonicalFile(), "MyJar.jar"); // canonicalize the external path as this is not done on case sensitive platforms when creating a new lib entry
- IJavaScriptProject project = this.getJavaProject("JSSearch");
- IIncludePathEntry[] classpath = project.getRawIncludepath();
- try {
- copy(minimalJar, externalJar);
- int length = classpath.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[length];
- System.arraycopy(classpath, 0, newClasspath, 0, length-1);
- String externalPath = externalJar.getAbsolutePath();
- newClasspath[length-1] = JavaScriptCore.newLibraryEntry(new Path(externalPath), new Path(externalPath), null, false);
- project.setRawIncludepath(newClasspath, null);
-
- IPackageFragment pkg = this.getPackageFragment("JSSearch", externalPath, "p0");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg});
-
- search(
- "X",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- externalJar + " p0.X",
- this.resultCollector);
-
- IClassFile classFile = pkg.getClassFile("X.class");
- scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {classFile});
- resultCollector = new JavaSearchResultCollector();
- search(
- classFile.getType(),
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- externalJar.getCanonicalPath()+ " p0.X",
- this.resultCollector);
-
- } finally {
- Util.delete(externalJar);
- project.setRawIncludepath(classpath, null);
- }
-
-}
-/**
- * Simple type declaration test.
- */
-public void testTypeDeclaration01() throws CoreException { // was testSimpleTypeDeclaration
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
-
- search(
- type,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("src/p/X.java p.X [X]", resultCollector);
-}
-/**
- * Type declaration test.
- * (generic type)
- */
-public void testTypeDeclaration02() throws CoreException {
- IPackageFragment pkg = this.getPackageFragment("JavaSearch15", "src", "p1");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg});
-
- search(
- "Y",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/p1/Y.java p1.Y [Y]",
- this.resultCollector);
-}
-/**
- * Type declaration test.
- * (regression test for bug 29524 Search for declaration via patterns adds '"*")
- */
-public void testTypeDeclaration03() throws CoreException { // was testTypeDeclaration
- IPackageFragment pkg = this.getPackageFragment("JSSearch", "src", "d8");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg});
-
- search(
- "A",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults("src/d8/A.java d8.A [A]", resultCollector);
-}
-/**
- * Type declaration in jar file test.
- */
-public void testTypeDeclaration04() throws CoreException { // was testTypeDeclarationInJar
- IType type = getClassFile("JSSearch", "MyJar.jar", "p1", "A.class").getType();
-
- search(
- type,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "MyJar.jar p1.A [No source]",
- this.resultCollector);
-}
-/**
- * Type declaration in jar file and in anonymous class test.
- * (regression test for 20631 Declaration of local binary type not found)
- */
-public void testTypeDeclaration05() throws CoreException { // was testTypeDeclarationInJar2
- IPackageFragmentRoot root = getPackageFragmentRoot("JSSearch", "test20631.jar");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {root});
-
- search(
- "Y",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "test20631.jar Y",
- this.resultCollector);
-}
-/**
- * Type declaration using a package scope test.
- * (check that subpackages are not included)
- */
-public void testTypeDeclaration06() throws CoreException { // was testTypeDeclarationInPackageScope
- IType type = getCompilationUnit("JSSearch", "src", "p3", "X.js").getType("X");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getPackageFragment()});
-
- search(
- "X",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/p3/X.java p3.X [X]",
- this.resultCollector);
-}
-/**
- * Type declaration using a binary package scope test.
- * (check that subpackages are not included)
- */
-public void testTypeDeclaration07() throws CoreException { // was testTypeDeclarationInPackageScope2
- IType type = getClassFile("JSSearch", "MyJar.jar", "p0", "X.class").getType();
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getPackageFragment()});
-
- search(
- "X",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "MyJar.jar p0.X [No source]",
- this.resultCollector);
-}
-/**
- * Memeber type declaration test.
- * (regression test for bug 9992 Member class declaration not found)
- */
-public void testTypeDeclaration08() throws CoreException { // was testMemberTypeDeclaration
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[]{
- this.getPackageFragment("JSSearch", "src", "b4")
- });
-
- search(
- "*.A.B",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/b4/A.java b4.A$B [B]",
- this.resultCollector);
-}
-/**
- * Test pattern match type declaration
- * (regression test for bug 17210 No match found when query contains '?')
- */
-public void testTypeDeclaration09() throws CoreException {
-
- search(
- "X?Z",
- TYPE,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults("src/r5/XYZ.java r5.XYZ [XYZ]", resultCollector);
-}
-/**
- * Long declaration (>255) test.
- * (regression test for bug 25859 Error doing Java Search)
- */
-public void testTypeDeclaration10() throws CoreException { // was testLongDeclaration
-
- search(
- "AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyz",
- TYPE,
- DECLARATIONS,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/c9/X.java c9.AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyz [AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyz]",
- this.resultCollector);
-}
-/*
- * Local type declaration test.
- */
-public void testTypeDeclaration11() throws CoreException { // was testLocalTypeDeclaration1
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "f2");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg});
-
- search(
- "Y",
- TYPE,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/f2/X.java Object f2.X.foo1():Y#1 [Y]",
- this.resultCollector);
-}
-/*
- * Local type declaration test.
- */
-public void testTypeDeclaration12() throws CoreException { // was testLocalTypeDeclaration2
- IType type = getCompilationUnit("JavaSearch/src/f2/X.js").getType("X").getFunction("foo1", new String[0]).getType("Y", 1);
-
- IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope();
-
- search(
- type,
- DECLARATIONS,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/f2/X.java Object f2.X.foo1():Y#1 [Y]",
- this.resultCollector);
-}
-/**
- * Type ocurrence test.
- * (regression test for PR 1GKAQJS: ITPJCORE:WIN2000 - search: incorrect results for nested types)
- */
-public void testTypeOccurence1() throws CoreException { // was testTypeOccurence
- IType type = getCompilationUnit("JSSearch", "src", "r", "A.js").getType("A").getType("X");
-
- search(
- type,
- ALL_OCCURRENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/r/A.java A r.A.m() [X]\n" +
- "src/r/A.java r.A$X [X]\n" +
- "src/r/A.java r.A$X(X) [X]\n" +
- "src/r/A.java r.A$X(X) [X]\n" +
- "src/r/A.java r.B.ax [A.X]\n" +
- "src/r/A.java r.B.ax [X]",
- this.resultCollector);
-}
-/**
- * Type ocuurence in unresolvable import test.
- * (regression test for bug 37166 NPE in SearchEngine when matching type against ProblemReferenceBinding )
- */
-public void testTypeOccurence2() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "r8", "B.js").getType("B");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getPackageFragment()});
-
- search(
- type,
- ALL_OCCURRENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/r8/A.java [B]",
- this.resultCollector);
-}
-/**
- * Type occurences test.
- * Ensures that correct positions are reported for an inner type reference using a ALL_OCCURENCES pattern
- */
-public void testTypeOccurence3() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "e4", "A.js").getType("A").getType("Inner");
-
- search(
- type,
- ALL_OCCURRENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/e4/A.java e4.A$Inner [Inner]\n" +
- "src/e5/A1.java [e4.A.Inner]\n" +
- "src/e5/A1.java e5.A1.a [e4.A.Inner]\n" +
- "src/e5/A1.java e5.A1.a1 [e4.A.Inner]\n" +
- "src/e5/A1.java e5.A1.a2 [Inner]\n" +
- "src/e5/A1.java e5.A1.a3 [Inner]",
- this.resultCollector);
-}
-/**
- * Type name with $ ocurrence test.
- * (regression test for bug 3310 Smoke 124: Compile errors introduced with rename refactoring (1GFBK2G))
- */
-public void testTypeOccurence4() throws CoreException { // was testTypeOccurenceWithDollar
- IType type = getCompilationUnit("JSSearch", "src", "q3", "A$B.js").getType("A$B");
-
- search(
- type,
- ALL_OCCURRENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/q3/A$B.java q3.A$B [A$B]\n" +
- "src/q4/C.java Object q4.C.foo() [q3.A$B]",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for PR 1GK7K17: ITPJCORE:WIN2000 - search: missing type reference)
- */
-public void testTypeReference01() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "", "X.js").getType("X");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/X.java AA() [X]",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for bug 29516 SearchEngine regressions in 20030114)
- */
-public void testTypeReference02() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "src", "d7", "A.js").getType("A");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/d7/A.java d7.A.A [A]\n" +
- "src/d7/A.java A d7.A.A(A) [A]\n" +
- "src/d7/A.java A d7.A.A(A) [A]",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for bug 31985 NPE searching non-qualified and case insensitive type ref)
- */
-public void testTypeReference03() throws CoreException {
- SearchPattern pattern = createPattern("x31985", TYPE, REFERENCES, false);
-
- resultCollector.showAccuracy = true;
- search(
- pattern,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/e3/X31985.java e3.X31985.CONSTANT [X31985] EXACT_MATCH\n" +
- "src/e3/Y31985.java Object e3.Y31985.foo() [X31985] EXACT_MATCH",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for bug 31997 Refactoring d.n. work for projects with brackets in name.)
- */
-public void testTypeReference04() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "otherSrc()", "", "X31997.js").getType("X31997");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "otherSrc()/Y31997.java Y31997 [X31997]",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for bug 48261 Search does not show results)
- */
-public void testTypeReference05() throws CoreException {
- IType type = getCompilationUnit("JSSearch", "test48261.jar", "p", "X.js").getType("X");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type.getPackageFragment().getParent()});
-
- search(
- type,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "test48261.jar p.X$Y(java.lang.String)",
- this.resultCollector);
-}
-/**
- * Type reference test
- * (in a generic type)
- */
-public void testTypeReference06() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15/src/p1/X.js").getType("X");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope15("p1", true),
- this.resultCollector);
- assertSearchResults(
- "src/p1/Y.java Object p1.Y.foo() [X]",
- this.resultCollector);
-}
-/**
- * Simple type reference test.
- */
-public void testTypeReference07() throws CoreException { // was testTypeDeclaration01
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.java p.A.x [X]\n" +
- "src/p/A.java p.A(X) [X]\n" +
- "src/p/A.java void p.A.foo(int, String, X) [X]\n" +
- "src/p/X.java p.X() [X]\n" +
- "src/p/X.java void p.X.foo(int, String, X) [X]\n" +
- "src/p/Y.java p.Y [X]\n" +
- "src/p/Z.java void p.Z.foo(int, String, X) [X]",
- this.resultCollector);
-}
-/**
- * Type reference in initializer test.
- * (regression test for PR #1G4GO4O)
- */
-public void testTypeReference08() throws CoreException { // was testTypeReferenceInInitializer
- IType type = getCompilationUnit("JSSearch", "src", "", "Test.js").getType("Test");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/Test.java Test.static {} [Test]\n" +
- "src/Test.java Test.static {} [Test]\n" +
- "src/Test.java Test.{} [Test]",
- this.resultCollector);
-}
-/**
- * Type reference as a single name reference test.
- */
-public void testTypeReference09() throws CoreException { // was testTypeReferenceAsSingleNameReference
- IType type = getCompilationUnit("JSSearch", "src", "", "TypeReferenceAsSingleNameReference.js").getType("TypeReferenceAsSingleNameReference");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/TypeReferenceAsSingleNameReference.java void TypeReferenceAsSingleNameReference.hasReference() [TypeReferenceAsSingleNameReference]\n" +
- "src/TypeReferenceAsSingleNameReference.java void TypeReferenceAsSingleNameReference.hasReference() [TypeReferenceAsSingleNameReference]",
- this.resultCollector);
-}
-/**
- * Member type reference test.
- */
-public void testTypeReference10() throws CoreException { // was testMemberTypeReference
- // references to second level member type
-
- resultCollector.showAccuracy = true;
- search(
- "BMember",
- TYPE,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "References to type BMember",
- "src/MemberTypeReference/Azz.java void MemberTypeReference.Azz.poo() [BMember] EXACT_MATCH\n" +
- "src/MemberTypeReference/Azz.java MemberTypeReference.Azz$AzzMember [BMember] EXACT_MATCH\n" +
- "src/MemberTypeReference/Azz.java MemberTypeReference.X.val [BMember] EXACT_MATCH\n" +
- "src/MemberTypeReference/B.java void MemberTypeReference.B.foo() [BMember] EXACT_MATCH",
- this.resultCollector);
-
- // references to first level member type
- resultCollector = new JavaSearchResultCollector();
- resultCollector.showAccuracy = true;
- search(
- "AzzMember",
- TYPE,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "References to type AzzMember",
- "src/MemberTypeReference/Azz.java MemberTypeReference.X.val [AzzMember] EXACT_MATCH\n" +
- "src/MemberTypeReference/B.java void MemberTypeReference.B.foo() [AzzMember] EXACT_MATCH",
- this.resultCollector);
-
- // no reference to a field with same name as member type
- resultCollector = new JavaSearchResultCollector();
- resultCollector.showAccuracy = true;
- search(
- "BMember",
- FIELD,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "References to field BMember",
- "",
- this.resultCollector);
-}
-/**
- * Member type reference test.
- * (regression test for PR 1GL0MN9: ITPJCORE:WIN2000 - search: not consistent results for nested types)
- */
-public void testTypeReference11() throws CoreException { // was testMemberTypeReference2
- IType type = getCompilationUnit("JSSearch", "src", "a", "A.js").getType("A").getType("X");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/a/A.java a.B.ax [A.X]\n" +
- "src/a/A.java a.B.sx [S.X]",
- this.resultCollector);
-}
-/**
- * Member type named "Object" reference test.
- * (regression test for 1G4GHPS: ITPJUI:WINNT - Strange error message in search)
- */
-public void testTypeReference12() throws CoreException { // was testObjectMemberTypeReference
- IType type = getCompilationUnit("JSSearch", "src", "ObjectMemberTypeReference", "A.js")
- .getType("A")
- .getType("Object");
-
- resultCollector.showAccuracy = true;
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/ObjectMemberTypeReference/A.java void ObjectMemberTypeReference.A.foo() [Object] EXACT_MATCH",
- this.resultCollector);
-}
-/**
- * Type reference inside a qualified name reference test.
- * (Regression test for PR #1G4TSC0)
- */
-public void testTypeReference13() throws CoreException { // was testTypeReferenceInQualifiedNameReference
- IType type = getCompilationUnit("JSSearch", "src", "p", "A.js").getType("A");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/Test.java void Test.main(String[]) [p.A]\n" +
- "src/Test.java void Test.main(String[]) [p.A]\n" +
- "src/p/A.java void p.A.foo() [A]",
- this.resultCollector);
-}
-/**
- * Type reference inside a qualified name reference test.
- * (Regression test for PR #1GLBP65)
- */
-public void testTypeReference14() throws CoreException { // was testTypeReferenceInQualifiedNameReference2
- IType type = getCompilationUnit("JSSearch", "src", "p4", "A.js").getType("A");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p4/A.java p4.A.A [A]\n" +
- "src/p4/A.java p4.X [p4.A]\n" +
- "src/p4/A.java void p4.X.x() [p4.A]",
- this.resultCollector);
-}
-/**
- * Type reference inside a qualified name reference test.
- * (Regression test for PR 1GL9UMH: ITPJCORE:WIN2000 - search: missing type occurrences)
- */
-public void testTypeReference15() throws CoreException { // was testTypeReferenceInQualifiedNameReference3
- IType type = getCompilationUnit("JSSearch", "src", "", "W.js").getType("W");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/W.java int W.m() [W]",
- this.resultCollector);
-}
-/**
- * Type reference inside a qualified name reference test.
- * (Regression test for bug 16751 Renaming a class doesn't update all references )
- */
-public void testTypeReference16() throws CoreException { // was testTypeReferenceInQualifiedNameReference4
- IType type = getCompilationUnit("JSSearch", "src", "b7", "X.js").getType("SubClass");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/b7/X.java void b7.Test.main(String[]) [SubClass]",
- this.resultCollector);
-}
-/**
- * Type reference in a folder that is not in the classpath.
- * (regression test for PR #1G5N8KS)
- */
-public void testTypeReference17() throws CoreException { // was testTypeReferenceNotInClasspath
- IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/p/A.java p.A.x [X]\n" +
- "src/p/A.java p.A(X) [X]\n" +
- "src/p/A.java void p.A.foo(int, String, X) [X]\n" +
- "src/p/X.java p.X() [X]\n" +
- "src/p/X.java void p.X.foo(int, String, X) [X]\n" +
- "src/p/Y.java p.Y [X]\n" +
- "src/p/Z.java void p.Z.foo(int, String, X) [X]",
- this.resultCollector);
-}
-/**
- * Type reference inside an argument, a return type or a field type.
- * (Regression test for PR #1GA7QA1)
- */
-public void testTypeReference18() throws CoreException { // was testVariousTypeReferences
- IType type = getCompilationUnit("JSSearch", "src", "NoReference", "A.js").getType("A");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "", // no reference should be found
- this.resultCollector);
-}
-/**
- * Type reference in import test.
- * (regression test for PR #1GA7PAS)
- */
-public void testTypeReference19() throws CoreException { // was testTypeReferenceInImport
- IType type = getCompilationUnit("JSSearch", "src", "p2", "Z.js").getType("Z");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/TypeReferenceInImport/X.java [p2.Z]",
- this.resultCollector);
-}
-/**
- * Type reference in import test.
- * (regression test for bug 23077 search: does not find type references in some imports)
- */
-public void testTypeReference20() throws CoreException { // was testTypeReferenceInImport2
- IType type = getCompilationUnit("JSSearch", "src", "r6", "A.js").getType("A");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/r6/B.java [r6.A]\n" +
- "src/r6/B.java [r6.A]\n" +
- "src/r6/B.java [r6.A]\n" +
- "src/r6/B.java [r6.A]\n" +
- "src/r6/B.java [r6.A]\n" +
- "src/r6/B.java [r6.A]",
- this.resultCollector);
-}
-/**
- * Type reference in array test.
- * (regression test for PR #1GAL424)
- */
-public void testTypeReference21() throws CoreException { // was testTypeReferenceInArray
- IType type = getCompilationUnit("JSSearch", "src", "TypeReferenceInArray", "A.js").getType("A");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/TypeReferenceInArray/A.java TypeReferenceInArray.A.a [A]\n" +
- "src/TypeReferenceInArray/A.java TypeReferenceInArray.A.b [TypeReferenceInArray.A]",
- this.resultCollector);
-}
-/**
- * Type reference in array test.
- * (regression test for bug 3230 Search - Too many type references for query ending with * (1GAZVGI) )
- */
-public void testTypeReference22() throws CoreException { // was testTypeReferenceInArray2
- IType type = getCompilationUnit("JSSearch", "src", "s1", "X.js").getType("X");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/s1/Y.java s1.Y.f [X]",
- this.resultCollector);
-}
-/**
- * Negative type reference test.
- * (regression test for 1G52F7P: ITPJCORE:WINNT - Search - finds bogus references to class)
- */
-public void testTypeReference23() throws CoreException { // testNegativeTypeReference
- IType type = getCompilationUnit("JSSearch", "src", "p7", "A.js").getType("A");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "",
- this.resultCollector);
-}
-/**
- * Type reference in a throw clause test.
- * (Regression test for bug 6779 searchDeclarationsOfReferencedTyped - missing exception types)
- */
-public void testTypeReference24() throws CoreException { // was testTypeReferenceInThrows
- IType type = getCompilationUnit("JSSearch", "src", "a7", "X.js").getType("MyException");
-
- resultCollector.showAccuracy = true;
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/a7/X.java void a7.X.foo() [MyException] EXACT_MATCH",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for bug 9642 Search - missing inaccurate type matches)
- */
-public void testTypeReference25() throws CoreException { // was testInnacurateTypeReference1
-
- search(
- "Zork",
- TYPE,
- REFERENCES,
- SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {
- getPackageFragment("JSSearch", "src", "b5")
- }),
- this.resultCollector);
- assertSearchResults(
- "src/b5/A.java [Zork]\n" +
- "src/b5/A.java b5.A.{} [Zork]\n" +
- "src/b5/A.java b5.A.{} [Zork]\n" +
- "src/b5/A.java b5.A.{} [Zork]",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for bug 9642 Search - missing inaccurate type matches)
- */
-public void testTypeReference26() throws CoreException { // was testInnacurateTypeReference2
-
- search(
- "p.Zork",
- TYPE,
- REFERENCES,
- SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {
- getPackageFragment("JSSearch", "src", "b5")
- }),
- this.resultCollector);
- assertSearchResults(
- "src/b5/A.java b5.A.{} [Zork]\n" +
- "src/b5/A.java b5.A.{} [Zork]\n" +
- "src/b5/A.java b5.A.{} [Zork]",
- this.resultCollector);
-}
-/**
- * Type reference test.
- * (Regression test for bug 21485 NPE when doing a reference search to a package)
- */
-public void testTypeReference27() throws CoreException { // was testInnacurateTypeReference3
- IType type = getCompilationUnit("JSSearch", "src", "r3", "A21485.js").getType("A21485");
-
- resultCollector.showAccuracy = true;
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/r4/B21485.java [r3.A21485] EXACT_MATCH\n" +
- "src/r4/B21485.java r4.B21485 [A21485] POTENTIAL_MATCH",
- this.resultCollector);
-}
-/**
- * Type reference in cast test.
- * (regression test for bug 23329 search: incorrect range for type references in brackets)
- */
-public void testTypeReference28() throws CoreException { // was testTypeReferenceInCast
- IType type = getCompilationUnit("JSSearch", "src", "s3", "A.js").getType("B");
-
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/s3/A.java Object s3.A.foo() [B]",
- this.resultCollector);
-}
-/**
- * Test pattern match type reference in binary
- * (regression test for bug 24741 Search does not find patterned type reference in binary project )
- */
-public void testTypeReference29() throws CoreException { // was testPatternMatchTypeReference
-
- search(
- "p24741.*",
- TYPE,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "test24741.jar q24741.B",
- this.resultCollector);
-}
-/**
- * Type reference test (not case sensitive)
- */
-public void testTypeReference30() throws CoreException { // was testTypeReferenceNotCaseSensitive
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "d4");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg});
- SearchPattern pattern = createPattern("Y", TYPE, REFERENCES, false);
-
- search(
- pattern,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/d4/X.java Object d4.X.foo() [Y]",
- this.resultCollector);
-}
-/**
- * Type reference test.
- */
-public void testTypeReference31() throws CoreException { // was testAccurateTypeReference
-
- search(
- "d5.X",
- TYPE,
- REFERENCES,
- SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {
- getPackageFragment("JSSearch", "src", "d5")
- }),
- this.resultCollector);
- assertSearchResults(
- "src/d5/Y.java d5.Y.T [d5.X]\n" +
- "src/d5/Y.java d5.Y.c [d5.X]\n" +
- "src/d5/Y.java d5.Y.o [d5.X]",
- this.resultCollector);
-}
-/**
- * Type reference in hierarchy test.
- * (regression test for bug 28236 Search for refs to class in hierarchy matches class outside hierarchy )
- */
-public void testTypeReference32() throws CoreException { // was testTypeReferenceInHierarchy
- IType type = getCompilationUnit("JSSearch", "src", "d9.p1", "A.js").getType("A");
-
- IJavaScriptSearchScope scope = SearchEngine.createHierarchyScope(type);
- search(
- type,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "",
- this.resultCollector);
-}
-/**
- * Type reference with recovery test.
- * (Regression test for bug 29366 Search reporting invalid inaccurate match )
- */
-public void testTypeReference33() throws CoreException { // was testTypeReferenceWithRecovery
- IType type = getCompilationUnit("JSSearch", "src", "e1", "A29366.js").getType("A29366");
-
- resultCollector.showAccuracy = true;
- search(
- type,
- REFERENCES,
- getJavaSearchScope(),
- this.resultCollector);
- assertSearchResults(
- "src/e1/A29366.java void e1.A29366.foo() [A29366] EXACT_MATCH",
- this.resultCollector);
-}
-/**
- * Type reference with problem test.
- * (Regression test for bug 36479 Rename operation during refactoring fails)
- */
-public void testTypeReference34() throws CoreException { // was testTypeReferenceWithProblem
- IType type = getCompilationUnit("JSSearch", "src", "e6", "A.js").getType("A");
-
- resultCollector.showAccuracy = true;
- search(
- "B36479",
- TYPE,
- REFERENCES,
- SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {type}),
- this.resultCollector);
- assertSearchResults(
- "src/e6/A.java Object e6.A.foo() [B36479] POTENTIAL_MATCH",
- this.resultCollector);
-}
-/**
- * Type reference with corrupt jar on the classpath test.
- * (Regression test for bug 39831 Search finds only "inexact" matches)
- */
-public void testTypeReference35() throws CoreException { // was testTypeReferenceWithCorruptJar
- IJavaScriptProject project = getJavaProject("JSSearch");
- IIncludePathEntry[] originalCP = project.getRawIncludepath();
- try {
- // add corrupt.jar to classpath
- int cpLength = originalCP.length;
- IIncludePathEntry[] newCP = new IIncludePathEntry[cpLength+1];
- System.arraycopy(originalCP, 0, newCP, 0, cpLength);
- newCP[cpLength] = JavaScriptCore.newLibraryEntry(new Path("/JavaSearch/corrupt.jar"), null, null);
- project.setRawIncludepath(newCP, null);
-
- IType type = getCompilationUnit("JSSearch", "src", "e7", "A.js").getType("A");
-
- resultCollector.showAccuracy = true;
- search(
- type,
- REFERENCES,
- SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {project}),
- this.resultCollector);
- assertSearchResults(
- "src/e7/A.java e7.A.a [A] EXACT_MATCH",
- this.resultCollector);
- } finally {
- project.setRawIncludepath(originalCP, null);
- }
-}
-/*
- * Local type reference test.
- */
-public void testTypeReference36() throws CoreException { // was testLocalTypeReference1
- IPackageFragment pkg = getPackageFragment("JSSearch", "src", "f2");
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptElement[] {pkg});
-
- resultCollector.showContext = true;
- search(
- "Y",
- TYPE,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/f2/X.java Object f2.X.foo1() [ return new <Y>();]",
- this.resultCollector);
-}
-/*
- * Local type reference test.
- */
-public void testTypeReference37() throws CoreException { // was testLocalTypeReference2
- IType type = getCompilationUnit("JavaSearch/src/f2/X.js").getType("X");
- IFunction method = type.getFunction("foo1", new String[0]);
- IType localType = method.getType("Y", 1);
-
- IJavaScriptSearchScope scope = SearchEngine.createWorkspaceScope();
-
- resultCollector.showContext = true;
- search(
- localType,
- REFERENCES,
- scope,
- this.resultCollector);
- assertSearchResults(
- "src/f2/X.java Object f2.X.foo1() [ return new <Y>();]",
- this.resultCollector);
-}
-/**
- * Type reference inside/outside doc comment.
- */
-public void testTypeReference38() throws CoreException { // was testTypeReferenceInOutDocComment
- IType type = getCompilationUnit("JSSearch", "src", "s4", "X.js").getType("X");
- resultCollector.showInsideDoc = true;
- search(type, REFERENCES, getJavaSearchScope(), this.resultCollector);
- assertSearchResults(
- "src/s4/X.java void s4.X.bar() [X] INSIDE_JAVADOC\n" +
- "src/s4/X.java void s4.X.bar() [X] INSIDE_JAVADOC\n" +
- "src/s4/X.java void s4.X.bar() [X] INSIDE_JAVADOC\n" +
- "src/s4/X.java void s4.X.fred() [X] OUTSIDE_JAVADOC",
- this.resultCollector);
-}
-
-/**
- * Search for enumerations
- */
-public void testEnum01() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "e1", "Team.js").getType("Team");
- search(type, REFERENCES, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/a1/Author.java [e1.Team]\n" +
- "src/a1/Author.java [e1.Team]\n" +
- "src/a1/Author.java Team[] a1.Author.name() [Team]\n" +
- "src/a1/Test.java [e1.Team]\n" +
- "src/e1/Test.java void e1.Test.main(String[]) [Team]\n" +
- "src/e1/Test.java void e1.Test.main(String[]) [Team]\n" +
- "src/e1/Test.java Location e1.Test.location(Team) [Team]",
- this.resultCollector);
-}
-public void testEnum02() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "e1", "Team.js").getType("Team");
- IFunction method = type.getFunction("Team", new String[0]);
- search(method, REFERENCES, getJavaSearchScope15("e1", false), this.resultCollector);
- assertSearchResults(
- "src/e1/Team.java e1.Team.FREDERIC [FREDERIC]",
- this.resultCollector);
-}
-public void testEnum03() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "e1", "Team.js").getType("Team");
- IFunction method = type.getFunction("Team", new String[] { "I" });
- search(method, REFERENCES, getJavaSearchScope15("e1", false), this.resultCollector);
- assertSearchResults(
- "src/e1/Team.java e1.Team.PHILIPPE [PHILIPPE(37)]\n" +
- "src/e1/Team.java e1.Team.DAVID [DAVID(27)]\n" +
- "src/e1/Team.java e1.Team.JEROME [JEROME(33)]\n" +
- "src/e1/Team.java e1.Team.OLIVIER [OLIVIER(35)]\n" +
- "src/e1/Team.java e1.Team.KENT [KENT(40)]",
- this.resultCollector);
-}
-public void testEnum04() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "e1", "Team.js").getType("Team");
- IFunction method = type.getFunction("age", new String[0]);
- search(method, REFERENCES, getJavaSearchScope15("e1", false), this.resultCollector);
- assertSearchResults(
- "src/e1/Test.java void e1.Test.main(String[]) [age()]",
- this.resultCollector);
-}
-public void testEnum05() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "e1", "Team.js").getType("Team");
- IFunction method = type.getFunction("isManager", new String[0]);
- search(method, ALL_OCCURRENCES, getJavaSearchScope15("e1", false), this.resultCollector);
- assertSearchResults(
- "src/e1/Team.java boolean e1.Team.PHILIPPE:<anonymous>#1.isManager() [isManager]\n" +
- "src/e1/Team.java boolean e1.Team.isManager() [isManager]\n" +
- "src/e1/Test.java void e1.Test.main(String[]) [isManager()]",
- this.resultCollector);
-}
-public void testEnum06() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "e1", "Team.js").getType("Team");
- IFunction method = type.getFunction("setRole", new String[] { "Z" });
- search(method, REFERENCES, getJavaSearchScope15("e1", false), this.resultCollector);
- assertSearchResults(
- "src/e1/Test.java void e1.Test.main(String[]) [setRole(t.isManager())]",
- this.resultCollector);
-}
-/**
- * Search method with varargs
- */
-public void testVarargs01() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "v1", "X.js").getType("X");
- IFunction method = type.getFunction("vargs", new String[] { "I", "I" });
- search(method, ALL_OCCURRENCES, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/v1/X.java void v1.X.vargs(int, int) [vargs]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(1, 2)]",
- this.resultCollector);
-}
-public void testVarargs02() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "v1", "X.js").getType("X");
- IFunction method = type.getFunction("vargs", new String[] { "I", "[I" });
- search(method, ALL_OCCURRENCES, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/v1/X.java void v1.X.vargs(int, int ...) [vargs]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(1, 2, 3)]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(1, 2, 3, 4, 5, 6)]",
- this.resultCollector);
-}
-public void testVarargs03() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "v1", "X.js").getType("X");
- IFunction method = type.getFunction("vargs", new String[] { "[QString;" });
- search(method, ALL_OCCURRENCES, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/v1/X.java void v1.X.vargs(String ...) [vargs]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(\"x\", \"a\",\"'b\", \"c\")]",
- this.resultCollector);
-}
-public void testVarargs04() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "v1", "X.js").getType("X");
- IFunction method = type.getFunction("vargs", new String[] { "QString;", "[Z" });
- search(method, ALL_OCCURRENCES, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/v1/X.java void v1.X.vargs(String, boolean ...) [vargs]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(\"x\", false, true)]",
- this.resultCollector);
-}
-public void testVarargs05() throws CoreException {
- search("vargs", METHOD, DECLARATIONS, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/v1/X.java void v1.X.vargs(int, int) [vargs]\n" +
- "src/v1/X.java void v1.X.vargs(int, int ...) [vargs]\n" +
- "src/v1/X.java void v1.X.vargs(String ...) [vargs]\n" +
- "src/v1/X.java void v1.X.vargs(String, boolean ...) [vargs]",
- this.resultCollector);
-}
-public void testVarargs06() throws CoreException {
- search("vargs", METHOD, REFERENCES, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/v1/X.java void v1.X.bar() [vargs(1, 2)]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(1, 2, 3)]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(1, 2, 3, 4, 5, 6)]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(\"x\", \"a\",\"\'b\", \"c\")]\n" +
- "src/v1/X.java void v1.X.bar() [vargs(\"x\", false, true)]",
- this.resultCollector);
-}
-/**
- * Search for annotations
- */
-public void testAnnotationType01() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "a1", "Author.js").getType("Author");
- search(type, REFERENCES, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/a1/Test.java a1.Test [Author]\n" +
- "src/a1/Test.java a1.Test.t [Author]\n" +
- "src/a1/Test.java void a1.Test.foo() [Author]",
- this.resultCollector);
-}
-public void testAnnotationType02() throws CoreException {
- IJavaScriptUnit unit = getCompilationUnit("JavaSearch15", "src", "a1", "Test.js");
- IType type = selectType(unit, "Author");
- search(type, DECLARATIONS, getJavaSearchScope15(), this.resultCollector);
- assertSearchResults(
- "src/a1/Author.java a1.Author [Author]",
- this.resultCollector);
-}
-
-/**
- * Search for auto-boxing
- */
-public void testAutoBoxing01() throws CoreException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/JavaSearch15/src/p/X.js",
- "package p;\n" +
- "public class X {\n" +
- " void foo(int x) {}\n" +
- " void bar() {\n" +
- " foo(new Integer(0));\n" +
- " }\n" +
- "}\n"
- );
- IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(workingCopies);
- IFunction method = workingCopies[0].getType("X").getFunction("foo", new String[] { "I" });
- search(method, REFERENCES, scope);
- assertSearchResults(
- "src/p/X.java void p.X.bar() [foo(new Integer(0))]"
- );
-}
-
-/**
- * Test static import
- */
-// for fields
-public void testStaticImportField01() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s1.pack.age", "S.js").getType("S");
- search(type, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s1/A.java [s1.pack.age.S]\n" +
- "src/s1/A.java [s1.pack.age.S]\n" +
- "src/s1/A.java [s1.pack.age.S]\n" +
- "src/s1/B.java [s1.pack.age.S]\n" +
- "src/s1/B.java [s1.pack.age.S]\n" +
- "src/s1/C.java [s1.pack.age.S]\n" +
- "src/s1/C.java [s1.pack.age.S]\n" +
- "src/s1/D.java [s1.pack.age.S]"
- );
-}
-public void testStaticImportField02() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s1.pack.age", "S.js").getType("S");
- IField field = type.getField("out");
- search(field, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s1/A.java [out]\n" +
- "src/s1/B.java void s1.B.foo() [out]\n" +
- "src/s1/C.java [out]\n" +
- "src/s1/C.java void s1.C.foo() [out]"
- );
-}
-public void testStaticImportField03() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s1.pack.age", "S.js").getType("S");
- IType member = type.getType("M");
- search(member, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s1/A.java [s1.pack.age.S.M]\n" +
- "src/s1/B.java [s1.pack.age.S.M]\n" +
- "src/s1/C.java [s1.pack.age.S.M]\n" +
- "src/s1/D.java [s1.pack.age.S.M]\n" +
- "src/s1/D.java void s1.D.foo() [M]\n" +
- "src/s1/D.java void s1.D.foo() [M]"
- );
-}
-public void testStaticImportField04() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s1.pack.age", "S.js").getType("S");
- IType member = type.getType("M");
- IField field = member.getField("in");
- search(field, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s1/A.java [in]\n" +
- "src/s1/B.java void s1.B.foo() [in]\n" +
- "src/s1/C.java [in]\n" +
- "src/s1/C.java void s1.C.foo() [in]\n" +
- "src/s1/D.java void s1.D.foo() [in]"
- );
-}
-// for methods
-public void testStaticImportMethod01() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s2.pack.age", "S.js").getType("S");
- search(type, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s2/A.java [s2.pack.age.S]\n" +
- "src/s2/A.java [s2.pack.age.S]\n" +
- "src/s2/A.java [s2.pack.age.S]\n" +
- "src/s2/B.java [s2.pack.age.S]\n" +
- "src/s2/B.java [s2.pack.age.S]\n" +
- "src/s2/C.java [s2.pack.age.S]\n" +
- "src/s2/C.java [s2.pack.age.S]\n" +
- "src/s2/D.java [s2.pack.age.S]"
- );
-}
-public void testStaticImportMethod02() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s2.pack.age", "S.js").getType("S");
- IFunction method = type.getFunction("out", new String[0]);
- search(method, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s2/A.java [s2.pack.age.S.out]\n" +
- "src/s2/B.java void s2.B.foo() [out()]\n" +
- "src/s2/C.java [s2.pack.age.S.out]\n" +
- "src/s2/C.java void s2.C.foo() [out()]"
- );
-}
-public void testStaticImportMethod03() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s2.pack.age", "S.js").getType("S");
- IType member = type.getType("M");
- search(member, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s2/A.java [s2.pack.age.S.M]\n" +
- "src/s2/B.java [s2.pack.age.S.M]\n" +
- "src/s2/C.java [s2.pack.age.S.M]\n" +
- "src/s2/D.java [s2.pack.age.S.M]\n" +
- "src/s2/D.java void s2.D.foo() [M]\n" +
- "src/s2/D.java void s2.D.foo() [M]"
- );
-}
-public void testStaticImportMethod04() throws CoreException {
- IType type = getCompilationUnit("JavaSearch15", "src", "s2.pack.age", "S.js").getType("S");
- IType member = type.getType("M");
- IFunction method = member.getFunction("in", new String[0]);
- search(method, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s2/A.java [s2.pack.age.S.M.in]\n" +
- "src/s2/B.java void s2.B.foo() [in()]\n" +
- "src/s2/C.java [s2.pack.age.S.M.in]\n" +
- "src/s2/C.java void s2.C.foo() [in()]\n" +
- "src/s2/D.java void s2.D.foo() [in()]"
- );
-}
-// for packages
-public void testStaticImportPackage01() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JavaSearch15", "src", "s1.pack.age");
- search(pkg, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s1/A.java [s1.pack.age]\n" +
- "src/s1/A.java [s1.pack.age]\n" +
- "src/s1/A.java [s1.pack.age]\n" +
- "src/s1/B.java [s1.pack.age]\n" +
- "src/s1/B.java [s1.pack.age]\n" +
- "src/s1/C.java [s1.pack.age]\n" +
- "src/s1/C.java [s1.pack.age]\n" +
- "src/s1/D.java [s1.pack.age]"
- );
-}
-public void testStaticImportPackage02() throws CoreException {
- IPackageFragment pkg = getPackageFragment("JavaSearch15", "src", "s2.pack.age");
- search(pkg, REFERENCES, getJavaSearchScope15(), resultCollector);
- assertSearchResults(
- "src/s2/A.java [s2.pack.age]\n" +
- "src/s2/A.java [s2.pack.age]\n" +
- "src/s2/A.java [s2.pack.age]\n" +
- "src/s2/B.java [s2.pack.age]\n" +
- "src/s2/B.java [s2.pack.age]\n" +
- "src/s2/C.java [s2.pack.age]\n" +
- "src/s2/C.java [s2.pack.age]\n" +
- "src/s2/D.java [s2.pack.age]"
- );
-}
-
-/**
- * @test Bug 110060: [plan][search] Add support for Camel Case search pattern
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=110060"
- *
- * These tests are not really duplicates of {@link JavaSearchBugsTests} ones
- * as they also test camel case in indexes...
- */
-public void testCamelCaseTypePattern01() throws CoreException {
- search("RE", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope());
- assertSearchResults(
- "src/a3/References.java a3.References [References]\n" +
- ""+ getSystemJsPathString() + " java.lang.RuntimeException"
- );
-}
-
-public void testCamelCaseTypePattern02() throws CoreException {
- search("RException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope());
- assertSearchResults(
- ""+ getSystemJsPathString() + " java.lang.RuntimeException"
- );
-}
-
-public void testCamelCaseTypePattern03() throws CoreException {
- search("RuntimeException", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope());
- assertSearchResults(
- ""+ getSystemJsPathString() + " java.lang.RuntimeException"
- );
-}
-
-public void testCamelCaseTypePattern04() throws CoreException {
- search("RUNTIMEEXCEPTION", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope());
- assertSearchResults(
- ""+ getSystemJsPathString() + " java.lang.RuntimeException"
- );
-}
-
-public void testCamelCaseTypePattern05() throws CoreException {
- search("R*E*", TYPE, DECLARATIONS, SearchPattern.R_CAMELCASE_MATCH, getJavaSearchScope());
- assertSearchResults(
- "src/a3/References.java a3.References [References]\n" +
- ""+ getSystemJsPathString() + " java.lang.RuntimeException"
- );
-}
-
-public void testCamelCaseTypePattern06() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "CNS".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH,
- TYPE,
- getJavaSearchScope(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "java.lang.CloneNotSupportedException",
- requestor);
-}
-
-public void testCamelCaseTypePattern07() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "AA".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH,
- TYPE,
- getJavaSearchScope(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "AA\n" +
- "c9.AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyz\n" +
- "d8.AA\n" +
- "p6.AA\n" +
- "q1.AA",
- requestor);
-}
-
-public void testCamelCaseTypePattern08() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH,
- TYPE,
- getJavaSearchScope(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "AA\n" +
- "d8.AA\n" +
- "p6.AA\n" +
- "q1.AA",
- requestor);
-}
-
-public void testCamelCaseTypePattern09() throws CoreException {
- TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- "aa".toCharArray(),
- SearchPattern.R_CAMELCASE_MATCH | SearchPattern.R_PREFIX_MATCH,
- TYPE,
- getJavaSearchScope(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- assertSearchResults(
- "Unexpected all type names",
- "AA\n" +
- "d8.AA\n" +
- "p6.AA\n" +
- "q1.AA",
- requestor);
-}
-
-/**
- * @bug 160323: [search] TypeNameMatch: support hashCode/equals
- * @test Ensure that match equals and hashCode methods return same values than those of stored {@link IType}.
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=160323"
- */
-public void testBug160323() throws CoreException {
- // Search all type names with TypeNameMatchRequestor
- TypeNameMatchCollector collector = new TypeNameMatchCollector() {
- public String toString(){
- return toFullyQualifiedNamesString();
- }
- };
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- getJavaSearchScope(),
- collector,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Search all type names with TypeNameRequestor
- SearchTests.SearchTypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor();
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH,
- null,
- SearchPattern.R_PREFIX_MATCH,
- IJavaScriptSearchConstants.TYPE,
- getJavaSearchScope(),
- requestor,
- IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null);
- // Should have same types with these 2 searches
- assertEquals("We should get some types!", requestor.size(), collector.size());
- assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString());
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocBugsCompletionModelTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocBugsCompletionModelTest.java
deleted file mode 100644
index 9d780d4..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocBugsCompletionModelTest.java
+++ /dev/null
@@ -1,1061 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-/**
- * Test class for completion in Javadoc comment of a field declaration.
- */
-public class JavadocBugsCompletionModelTest extends AbstractJavadocCompletionModelTest {
-
-public JavadocBugsCompletionModelTest(String name) {
- super(name);
- this.tabs = 2;
-}
-
-static {
-// TESTS_NAMES = new String[] { "testBug22043a" };
-// TESTS_NUMBERS = new int[] { 118092 };
-}
-public static Test suite() {
- return buildModelTestSuite(JavadocBugsCompletionModelTest.class);
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavadocCompletionModelTest#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- setUpProjectOptions(CompilerOptions.VERSION_1_4);
-}
-
-/**
- * Bug 3270: [javadoc][assist] Javadoc content assist should show classes after @throws tag (1GDWWV9)
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=3270"
- */
-public void testBug3270() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @throws \n" +
- " */\n" +
- " void foo() throws InterruptedException {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "@throws ", 0); // empty token
- if (CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertSortedResults(
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICUNREETE+"}"
- );
- } else {
- assertSortedResults(
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICUNREETE+"}\n" +
- "BasicTestBugs[TYPE_REF]{BasicTestBugs, javadoc.bugs, Ljavadoc.bugs.BasicTestBugs;, null, null, "+this.positions+R_DICUNR+"}"
- );
- }
-}
-public void testBug3270a() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @throws I\n" +
- " */\n" +
- " void foo() throws InterruptedException {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "I");
- assertSortedResults(
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICUNREEET+"}\n" +
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICUNRE+"}"
- );
-}
-public void testBug3270b() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @throws Cl\n" +
- " */\n" +
- " void foo() throws InterruptedException {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "Cl");
- assertSortedResults(
- "CloneNotSupportedException[TYPE_REF]{CloneNotSupportedException, java.lang, Ljava.lang.CloneNotSupportedException;, null, null, "+this.positions+R_DICUNRE+"}\n" +
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-/**
- * Bug 22043: [javadoc][assist] Code Completion in Javadoc @see/@link doesn't work on partially entered argument types
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=22043"
- */
-public void testBug22043() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Complete after (S:\n" +
- " * @see #thisIsAMethod(S\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " public void thisIsAMethod(String param) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "S", 2); // 2nd occurence
- assertSortedResults(
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "Serializable[TYPE_REF]{java.io.Serializable, java.io, Ljava.io.Serializable;, null, null, "+this.positions+R_DICNR+"}\n" +
- "short[KEYWORD]{short, null, null, short, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void testBug22043a() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Complete after 'thisIsAMethod':\n" +
- " * @see #thisIsAMethod(S\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " public void thisIsAMethod(String param) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "thisIsAMethod", 2); // 2nd occurence
- assertResults(
- "thisIsAMethod[FUNCTION_REF]{thisIsAMethod(String), Ljavadoc.bugs.BasicTestBugs;, (Ljava.lang.String;)V, thisIsAMethod, (param), "+this.positions+R_DICENNRNS+"}"
- );
-}
-
-public void testBug22043b() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Complete after 'thisIsAMethod(':\n" +
- " * @see #thisIsAMethod(S\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " public void thisIsAMethod(String param) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "thisIsAMethod(", 2); // 2nd occurence
- assertResults(
- "thisIsAMethod[FUNCTION_REF]{thisIsAMethod(String), Ljavadoc.bugs.BasicTestBugs;, (Ljava.lang.String;)V, thisIsAMethod, (param), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void testBug22043c() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Complete after thisIsAMethod(:\n" +
- " * @see #thisIsAMethod(Object\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " public void thisIsAMethod(String param) {}\n" +
- " public void thisIsAMethod(Object str) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "thisIsAMethod(", 2); // 2nd occurence
- assertResults(
- "thisIsAMethod[FUNCTION_REF]{thisIsAMethod(Object), Ljavadoc.bugs.BasicTestBugs;, (Ljava.lang.Object;)V, thisIsAMethod, (str), "+this.positions+R_DICENUNR+"}\n" +
- "thisIsAMethod[FUNCTION_REF]{thisIsAMethod(String), Ljavadoc.bugs.BasicTestBugs;, (Ljava.lang.String;)V, thisIsAMethod, (param), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-/**
- * Bug 67732: [javadoc][assist] Content assist doesn't work in Javadoc "line breaks"
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=67732"
- */
-public void testBug67732() throws JavaScriptModelException {
- String source =
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * This line approaches the print margin {@link \n" +
- " * Object#to\n" +
- " */\n" +
- "public class T67732 {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "to");
- assertSortedResults(
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-/**
- * Bug 68757: [javadoc][assist] inconsistent type qualification
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=68757"
- */
-public void testBug68757() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "import javadoc.tests.OtherType;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @see Other\n" +
- " */\n" +
- " public void foo(OtherType type) {}\n" +
- "}\n",
- "/Completion/src/javadoc/tests/OtherType.js",
- "package javadoc.tests;\n" +
- "public class OtherType {\n" +
- "}\n"
- };
- completeInJavadoc(sources, true, "Other", 2); // 2nd occurrence
- assertSortedResults(
- "OtherType[TYPE_REF]{OtherType, javadoc.tests, Ljavadoc.tests.OtherType;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void testBug68757a() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @see Other\n" +
- " */\n" +
- " public void foo(javadoc.tests.OtherType type) {}\n" +
- "}\n",
- "/Completion/src/javadoc/tests/OtherType.js",
- "package javadoc.tests;\n" +
- "public class OtherType {\n" +
- "}\n"
- };
- completeInJavadoc(sources, true, "Other");
- assertSortedResults(
- "OtherType[TYPE_REF]{javadoc.tests.OtherType, javadoc.tests, Ljavadoc.tests.OtherType;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-public void testBug68757b() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @see Other\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n",
- "/Completion/src/javadoc/tests/OtherType.js",
- "package javadoc.tests;\n" +
- "public class OtherType {\n" +
- "}\n"
- };
- completeInJavadoc(sources, true, "Other");
- assertSortedResults(
- "OtherType[TYPE_REF]{javadoc.tests.OtherType, javadoc.tests, Ljavadoc.tests.OtherType;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/**
- * Bug 75551: [javadoc][assist] javadoc completion for links to method with inner classes as argument is not correct
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=75551"
- * TODO (frederic) fix while fixing bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=96237
- */
-public void _testBug75551() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs extends SuperClass {\n" +
- " /**\n" +
- " * {@link #kick(Inner\n" +
- " */\n" +
- " public BasicTestBugs() {\n" +
- " }\n" +
- " public void kick(InnerClass innerClass) {}\n" +
- "}",
- "/Completion/src/javadoc/bugs/SuperClass.js",
- "package javadoc.bugs;\n" +
- "public class SuperClass {\n" +
- " protected static class InnerClass {\n" +
- " }\n" +
- "}"
- };
- completeInJavadoc(sources, true, "Inner");
- assertSortedResults(
- "SuperClass.InnerClass[TYPE_REF]{SuperClass.InnerClass, javadoc.bugs, Ljavadoc.bugs.SuperClass$InnerClass;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-/**
- * Bug 86112: [javadoc][assist] Wrong reference to binary static initializer in javadoc
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=86112"
- */
-public void testBug86112() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @see Terminator#\n" +
- " */\n" +
- " public BasicTestBugs() {\n" +
- " }\n" +
- "}",
- "/Completion/src/javadoc/bugs/Terminator.js",
- "package javadoc.bugs;\n" +
- "public class Terminator {\n" +
- " static {\n" +
- " }\n" +
- "}"
- };
- completeInJavadoc(sources, true, "#", 0); // empty token
- assertSortedResults(
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "Terminator[FUNCTION_REF<CONSTRUCTOR>]{Terminator(), Ljavadoc.bugs.Terminator;, ()V, Terminator, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * Bug 87868: [javadoc][assist] Wrong reference to binary static initializer in javadoc
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=87868"
- */
-public void testBug87868() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.bugs;\n" +
- "public class BasicTestBugs<S> {\n" +
- " /** \n" +
- " * Calls {@link #meth\n" +
- " */\n" +
- " public void method(S s) {}\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "meth");
- assertSortedResults(
- "method[FUNCTION_REF]{method(Object), Ljavadoc.bugs.BasicTestBugs<TS;>;, (TS;)V, method, (s), "+this.positions+R_DICNRNS+"}"
- );
-}
-
-/**
- * Bug 113374: [javadoc][assist] do not propose anything if the prefix is preceded by a special character
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=113374"
- */
-public void testBug113374a() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.bugs;\n" +
- "/** \n" +
- " * <co\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "co");
- assertSortedResults("");
-}
-public void testBug113374b() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.bugs;\n" +
- "/** \n" +
- " * &un\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.js", source, true, "un");
- assertSortedResults("");
-}
-
-/**
- * Bug 113376: [javadoc][assist] wrong overwrite range on completion followed by a tag
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=113376"
- */
-public void testBug113376a() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestFields.js",
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * @see javadoc.util.Collection\n" +
- " * @see javadoc.util.List#add(Object)\n" +
- " */public class BasicTestBugs<A> {\n" +
- "}",
- "/Completion/src/javadoc/util/Collection.js",
- "package javadoc.util;\n" +
- "public interface Collection<E> {}\n" +
- "public interface List<E> {}\n" +
- " public void add(E e);\n" +
- "}"
- };
- completeInJavadoc(sources, true, "javadoc.util.Collection");
- assertSortedResults(
- "Collection[TYPE_REF]{javadoc.util.Collection, javadoc.util, Ljavadoc.util.Collection;, null, null, "+this.positions+R_DICENQNR+"}"
- );
-}
-public void testBug113376b() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestFields.js",
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * {@link String.}\n" +
- " * \n" +
- " * @see javadoc.util.Collection\n" +
- " * @see javadoc.util.List#add(Object)\n" +
- " */public class BasicTestBugs<A> {\n" +
- "}",
- "/Completion/src/javadoc/util/Collection.js",
- "package javadoc.util;\n" +
- "public interface Collection<E> {}\n" +
- "public interface List<E> {}\n" +
- " public void add(E e);\n" +
- "}"
- };
- completeInJavadoc(sources, true, "String.", 0); // empty token
- assertSortedResults("");
-}
-
-/**
- * Bug 114341: [javadoc][assist] range of the qualified type completion in javadoc text isn't corect
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=114341"
- */
-public void testBug114341a() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Secondary.Mem\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class Member {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "Secondary.Mem");
- assertSortedResults(
- "Secondary.Member[JSDOC_TYPE_REF]{{@link Member}, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNRIT+"}\n" +
- "Secondary.Member[TYPE_REF]{Member, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void testBug114341b() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * @see Secondary.Mem\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class Member {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "Mem");
- assertSortedResults(
- "Secondary.Member[TYPE_REF]{Member, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void testBug114341c() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * {@link Secondary.Mem }\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class Member {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "Mem");
- assertSortedResults(
- "Secondary.Member[TYPE_REF]{Member, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-public void testBug114341d() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * javadoc.text.Secondary.Mem\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class Member {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "javadoc.text.Secondary.Mem");
- assertSortedResults(
- "Secondary.Member[JSDOC_TYPE_REF]{{@link Member}, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNRIT+"}\n" +
- "Secondary.Member[TYPE_REF]{Member, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void testBug114341e() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * @see javadoc.text.Secondary.Mem\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class Member {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "Mem");
- assertSortedResults(
- "Secondary.Member[TYPE_REF]{Member, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void testBug114341f() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * {@link javadoc.text.Secondary.Mem }\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n" +
- "class Secondary {\n" +
- " class Member {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "Mem");
- assertSortedResults(
- "Secondary.Member[TYPE_REF]{Member, javadoc.text, Ljavadoc.text.Secondary$Member;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/**
- * Bug 115662: [javadoc][assist] link completion in types
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=115662"
- */
-public void testBug115662a() throws JavaScriptModelException {
- String source =
- "package bugs.b115662;\n" +
- "/**\n" +
- " * {@link #to\n" +
- " */\n" +
- "public class Tests {\n" +
- " int toto;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b115662/Test.js", source, true, "to");
- assertSortedResults(
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "toto[FIELD_REF]{toto, Lbugs.b115662.Tests;, I, toto, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void testBug115662b() throws JavaScriptModelException {
- String source =
- "package bugs.b115662;\n" +
- "/**\n" +
- " * {@link #toString()\n" +
- " */\n" +
- "public class Tests {\n" +
- " int toto;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b115662/Test.js", source, true, "to");
- assertSortedResults(
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "toto[FIELD_REF]{toto, Lbugs.b115662.Tests;, I, toto, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void testBug115662c() throws JavaScriptModelException {
- String source =
- "package bugs.b115662;\n" +
- "/**\n" +
- " * {@link #toString()\n" +
- " */\n" +
- "public class Test {\n" +
- " int toto;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b115662/Test.js", source, true, "toString");
- assertSortedResults(
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICENNRNS+"}"
- );
-}
-
-/**
- * Bug 117183: [javadoc][assist] No completion in text when cursor location is followed by a '.'
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=117183"
- */
-public void testBug117183a() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Completion inside reference Reference#A_STATIC_FIELD.\n" +
- " * Try to complete wherever inside A_STATIC_FIELD gives no proposal!\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- "}\n",
- "/Completion/src/javadoc/bugs/Reference.js",
- "package javadoc.bugs;\n" +
- "public class Reference {\n" +
- " public static int A_STATIC_FIELD = 0;\n" +
- "}\n"
- };
- completeInJavadoc(sources, true, "Reference#A_");
- assertSortedResults(
- "A_STATIC_FIELD[JSDOC_FIELD_REF]{{@link Reference#A_STATIC_FIELD}, Ljavadoc.bugs.Reference;, I, A_STATIC_FIELD, null, "+this.positions+R_DICNRIT+"}\n" +
- "A_STATIC_FIELD[JSDOC_VALUE_REF]{{@value Reference#A_STATIC_FIELD}, Ljavadoc.bugs.Reference;, I, A_STATIC_FIELD, null, "+this.positions+R_DICNRIT+"}"
- );
-}
-public void testBug117183b() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Completion inside reference Reference#A_STATIC_FIELD.\n" +
- " * Try to complete wherever inside A_STATIC_FIELD gives no proposal!\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- "}\n",
- "/Completion/src/javadoc/bugs/Reference.js",
- "package javadoc.bugs;\n" +
- "public class Reference {\n" +
- " public static int A_STATIC_FIELD = 0;\n" +
- "}\n"
- };
- completeInJavadoc(sources, true, "Reference#A_STATIC_FIELD");
- assertSortedResults(
- "A_STATIC_FIELD[JSDOC_FIELD_REF]{{@link Reference#A_STATIC_FIELD}, Ljavadoc.bugs.Reference;, I, A_STATIC_FIELD, null, "+this.positions+R_DICENNRIT+"}\n" +
- "A_STATIC_FIELD[JSDOC_VALUE_REF]{{@value Reference#A_STATIC_FIELD}, Ljavadoc.bugs.Reference;, I, A_STATIC_FIELD, null, "+this.positions+R_DICENNRIT+"}"
- );
-}
-public void testBug117183c() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Completion after Obj|\n" +
- " */\n" +
- "class BasicTestBugs {\n" +
- "}\n"
- };
- completeInJavadoc(sources, true, "Obj");
- assertSortedResults(
- "Object[JSDOC_TYPE_REF]{{@link Object}, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNRIT+"}\n" +
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void testBug117183d() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/bugs/BasicTestBugs.js",
- "package javadoc.bugs;\n" +
- "/**\n" +
- " * Completion after Str.\n" +
- " */\n" +
- "class BasicTestBugs {\n" +
- "}\n"
- };
- completeInJavadoc(sources, true, "Str");
- assertSortedResults(
- "String[JSDOC_TYPE_REF]{{@link String}, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNRIT+"}\n" +
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-/**
- * Bug 118105: [javadoc][assist] Hang with 100% CPU during code assist on comment
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=118105"
- */
-public void testBug118105() throws JavaScriptModelException {
- String source =
- "package bugs.b118105;\n" +
- "/**\n" +
- " * Some words here {@link Str.\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b118105/BasicTestBugs.js", source, true, "Str");
- assertSortedResults(
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-/**
- * Bug 118092: [javadoc][assist] Eclipse hangs on code assist when writing \u00B8<c
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=118092"
- */
-public void testBug118092() throws JavaScriptModelException {
- String source =
- "package bugs.b118092;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * \u00B8<c\n" +
- " */\n" +
- " public void method() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b118092/BasicTestBugs.js", source, true, "<c");
- // expect no result, just not hang...
- assertSortedResults("");
-}
-
-/**
- * Bug 118311: [javadoc][assist] type \@ in javadoc comment and code assist == hang
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=118311"
- */
-public void testBug118311() throws JavaScriptModelException {
- String source =
- "package bugs.b118311;\n" +
- "/**\n" +
- " * Text \\@\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- "\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b118311/BasicTestBugs.js", source, true, "@");
- assertSortedResults(
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * Bug 118397: [javadoc][assist] type \@ in javadoc comment and code assist == hang
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=118397"
- */
-public void testBug118397a() throws JavaScriptModelException {
- String source =
- "package bugs.b118397;\n" +
- "/**\n" +
- " * @see bugs.b118.BasicTestBugs\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b118397/BasicTestBugs.js", source, true, "bugs.b118", 2); // 2nd occurence
- assertSortedResults(
- "bugs.b118397[PACKAGE_REF]{bugs.b118397, bugs.b118397, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-public void testBug118397b() throws JavaScriptModelException {
- String source =
- "package bugs.b118397;\n" +
- "/**\n" +
- " * @see Basic.Inner\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " class Inner {\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b118397/BasicTestBugs.js", source, true, "Basic");
- assertSortedResults(
- "BasicTestBugs[TYPE_REF]{BasicTestBugs, bugs.b118397, Lbugs.b118397.BasicTestBugs;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestReferences[TYPE_REF]{org.eclipse.wst.jsdt.core.tests.BasicTestReferences, org.eclipse.wst.jsdt.core.tests, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-public void testBug118397c() throws JavaScriptModelException {
- String source =
- "package bugs.b118397;\n" +
- "/**\n" +
- " * @see BasicTestBugs.In.Level2\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b118397/BasicTestBugs.js", source, true, "In");
- assertSortedResults(
- "BasicTestBugs.Inner[TYPE_REF]{Inner, bugs.b118397, Lbugs.b118397.BasicTestBugs$Inner;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-public void testBug118397d() throws JavaScriptModelException {
- String source =
- "package bugs.b118397;\n" +
- "/**\n" +
- " * @see BasicTestBugs.Inner.Lev.Level3\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " class Inner {\n" +
- " class Level2 {\n" +
- " class Level3 {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b118397/BasicTestBugs.js", source, true, "Lev");
- assertSortedResults(
- "BasicTestBugs.Inner.Level2[TYPE_REF]{Level2, bugs.b118397, Lbugs.b118397.BasicTestBugs$Inner$Level2;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/**
- * @bug 139621: [javadoc][assist] No Javadoc completions if there's no member below
- * @test Ensure that completion happens in an orphan javadoc (ie. a javadoc comment not attached to a declaration
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=139621"
- */
-public void testBug139621a() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * Test with only an orphan comment in type declaration\n" +
- " * @see Obj\n" +
- " */\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "Obj");
- assertSortedResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void testBug139621b() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "/**\n" +
- " * Test with an existing javadoc type declaration\n" +
- " * @see Test\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * Test with only an orphan comment in type declaration\n" +
- " * @see Obj\n" +
- " */\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "Obj");
- assertSortedResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void testBug139621c() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * Test with only an orphan comment in type declaration\n" +
- " * (completion for tags)\n" +
- " * @\n" +
- " */\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "@");
- assertSortedResults(
- "author[JSDOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "exception[JSDOC_BLOCK_TAG]{@exception, null, null, exception, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "param[JSDOC_BLOCK_TAG]{@param, null, null, param, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "return[JSDOC_BLOCK_TAG]{@return, null, null, return, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialData[JSDOC_BLOCK_TAG]{@serialData, null, null, serialData, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialField[JSDOC_BLOCK_TAG]{@serialField, null, null, serialField, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "throws[JSDOC_BLOCK_TAG]{@throws, null, null, throws, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "version[JSDOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-public void testBug139621d() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * Test with only an orphan comment in type declaration\n" +
- " * (variation of completion for tags but considered in text as it's in fact tag start character is after a reference )\n" +
- " * @see Object" + // missing \n
- " * @\n" +
- " */\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "@", 2);
- assertSortedResults(
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-public void testBug139621e() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "/**\n" +
- " * Test with orphan comment after a method declaration\n" +
- " * @see Test\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " public void foo() {}\n" +
- " /**\n" +
- " * This method returns an object\n" +
- " * @see Obj\n" +
- " */\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "Obj");
- assertSortedResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void testBug139621f() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "/**\n" +
- " * Test with orphan comment after a field declaration\n" +
- " * @see Test\n" +
- " */\n" +
- "public class BasicTestBugs {\n" +
- " public int x;\n" +
- " /**\n" +
- " * This method returns an object\n" +
- " * @see Obj\n" +
- " */\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "Obj");
- assertSortedResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void testBug139621g() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "/**\n" +
- " * Compilation unit without any type\n" +
- " * @see Obj\n" +
- " */\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "Obj");
- assertSortedResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void testBug139621h() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "/**\n" +
- " * Compilation unit without any type\n" +
- " * (completion for tags)\n" +
- " * @\n" +
- " */\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "@");
- assertSortedResults(
- "author[JSDOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "version[JSDOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-public void testBug139621i() throws JavaScriptModelException {
- String source =
- "package bugs.b139621;\n" +
- "/**\n" +
- " * Compilation unit without any type\n" +
- " * (variation of completion for tags but considered in text as it's in fact tag start character is after a reference )\n" +
- " * @see Object The root class" + // missing \n
- " * @\n" +
- " */\n";
- completeInJavadoc("/Completion/src/bugs/b139621/BasicTestBugs.js", source, true, "@", 2);
- assertSortedResults(
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * Bug 144866: [assist][javadoc] Wrong completion inside @value tag
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=144866"
- */
-public void testBug144866() throws JavaScriptModelException {
- String source =
- "package bugs.b144866;\n" +
- "public class BasicTestBugs {\n" +
- " public static int EXAMPLE = 0;\n" +
- " /**\n" +
- " * This method returns an object\n" +
- " * @see Object\n" +
- " * This method will use {@value #EX } constant value...\n" +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b144866/BasicTestBugs.js", source, true, "EX", 2); // 2nd occurence
- assertSortedResults(
- "EXAMPLE[FIELD_REF]{EXAMPLE, Lbugs.b144866.BasicTestBugs;, I, EXAMPLE, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/**
- * @bug 171016: [javadoc][assist] No completion for tag when uppercase is used
- * @test Ensure that tag is proposed when prefix match a tag case insensitive
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=171016"
- */
-public void testBug171016() throws JavaScriptModelException {
- String source =
- "package bugs.b171016;\n" +
- "public class BasicTestBugs {\n" +
- " public void foo() {}" +
- "}\n" +
- "class X extends BasicTestBugs {\n" +
- " /**\n" +
- " * {@In\n" +
- " */\n" +
- " public void foo() {}" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b171016/BasicTestBugs.js", source, true, "{@In", 1);
- assertSortedResults(
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-public void testBug171016b() throws JavaScriptModelException {
- String source =
- "package bugs.b171016;\n" +
- "public class BasicTestBugs {\n" +
- " public void foo() {}" +
- "}\n" +
- "class X extends BasicTestBugs {\n" +
- " /**\n" +
- " * @In\n" +
- " */\n" +
- " public void foo() {}" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b171016/BasicTestBugs.js", source, true, "@In", 1);
- assertSortedResults(
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @bug 171031: [javadoc][assist] 'inheritDoc' tag is proposed while completing even if the method does not override any
- * @test Ensure that no 'inheritDoc' tag is proposed when method does not override any
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=171031"
- */
-// TODO (eric) enable when bug will be fixed
-public void _testBug171031() throws JavaScriptModelException {
- String source =
- "package bugs.b171031;\n" +
- "public class BasicTestBugs {\n" +
- " /**\n" +
- " * @In+\n" +
- " */\n" +
- " public void foo() {}" +
- "}\n";
- completeInJavadoc("/Completion/src/bugs/b171031/BasicTestBugs.js", source, true, "@In", 1);
- assertSortedResults(""); // should not have any proposal as
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocCompletionContextTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocCompletionContextTests.java
deleted file mode 100644
index dcbe70b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocCompletionContextTests.java
+++ /dev/null
@@ -1,1587 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.wst.jsdt.core.*;
-
-import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
-
-import junit.framework.*;
-
-public class JavadocCompletionContextTests extends AbstractJavaModelCompletionTests implements RelevanceConstants {
-
-public JavadocCompletionContextTests(String name) {
- super(name);
-}
-public void setUpSuite() throws Exception {
- if (COMPLETION_PROJECT == null) {
- COMPLETION_PROJECT = setUpJavaProject("Completion", "1.4");
- } else {
- setUpProjectCompliance(COMPLETION_PROJECT, "1.4");
- }
- super.setUpSuite();
-}
-
-public void tearDownSuite() throws Exception {
- super.tearDownSuite();
-}
-public static Test suite() {
- return buildModelTestSuite(JavadocCompletionContextTests.class);
-}
-public void test0001() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0001/X.js",
- "package test0001;\n" +
- "/**\n" +
- " * @see ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0002() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0002/X.js",
- "package test0002;\n" +
- "/**\n" +
- " * @see ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0003() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0003/X.js",
- "package test0003;\n" +
- "/**\n" +
- " * @see ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0004() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0004/X.js",
- "package test0004;\n" +
- "/**\n" +
- " * @see \n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@see ") + "@see ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("@see ") + "@see ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0005() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0005/X.js",
- "package test0005;\n" +
- "/**\n" +
- " * @see X.ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0006() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0006/X.js",
- "package test0006;\n" +
- "/**\n" +
- " * @see X.ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0007() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0007/X.js",
- "package test0007;\n" +
- "/**\n" +
- " * @see X.ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0008() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0008/X.js",
- "package test0008;\n" +
- "/**\n" +
- " * @see X.\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("X.") + "X.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("X.") + "X.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0009() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0009/X.js",
- "package test0009;\n" +
- "/**\n" +
- " * @see test0009.ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0010() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0010/X.js",
- "package test0010;\n" +
- "/**\n" +
- " * @see test0010.ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0011() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0011/X.js",
- "package test0011;\n" +
- "/**\n" +
- " * @see test0011.ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0012() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0012/X.js",
- "package test0012;\n" +
- "/**\n" +
- " * @see test0012.\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("test0012.") + "test0012.".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("test0012.") + "test0012.".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0013() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0013/X.js",
- "package test0013;\n" +
- "/**\n" +
- " * @see #ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0014() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0014/X.js",
- "package test0014;\n" +
- "/**\n" +
- " * @see #ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0015() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0015/X.js",
- "package test0015;\n" +
- "/**\n" +
- " * @see #ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0016() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0012/X.js",
- "package test0016;\n" +
- "/**\n" +
- " * @see #\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#") + "#".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#") + "#".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0017() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0017/X.js",
- "package test0017;\n" +
- "/**\n" +
- " * @see X#ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0018() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0018/X.js",
- "package test0018;\n" +
- "/**\n" +
- " * @see X#ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0019() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0019/X.js",
- "package test0019;\n" +
- "/**\n" +
- " * @see X#ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0020() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0020/X.js",
- "package test0020;\n" +
- "/**\n" +
- " * @see X#\n" +
- " */\n" +
- "public class X {\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#") + "#".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#") + "#".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0021() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0021/X.js",
- "package test0021;\n" +
- "/**\n" +
- " * @see X#foo(ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0022() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0022/X.js",
- "package test0022;\n" +
- "/**\n" +
- " * @see X#foo(ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0023() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0023/X.js",
- "package test0023;\n" +
- "/**\n" +
- " * @see X#foo(ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0024() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0024/X.js",
- "package test0024;\n" +
- "/**\n" +
- " * @see X#foo(\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#foo(") + "#foo(".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#foo(") + "#foo(".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0025() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0025/X.js",
- "package test0025;\n" +
- "/**\n" +
- " * @see X#foo(Object ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0026() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0026/X.js",
- "package test0026;\n" +
- "/**\n" +
- " * @see X#foo(Object ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0027() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0027/X.js",
- "package test0027;\n" +
- "/**\n" +
- " * @see X#foo(Object ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0028() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0028/X.js",
- "package test0028;\n" +
- "/**\n" +
- " * @see X#foo(Object \n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#foo(Object ") + "#foo(Object ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#foo(Object ") + "#foo(Object ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0029() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0029/X.js",
- "package test0029;\n" +
- "/**\n" +
- " * @see X#foo(Object a,ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0030() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0030/X.js",
- "package test0030;\n" +
- "/**\n" +
- " * @see X#foo(Object a,ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0031() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0031/X.js",
- "package test0031;\n" +
- "/**\n" +
- " * @see X#foo(Object a,ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0032() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0032/X.js",
- "package test0032;\n" +
- "/**\n" +
- " * @see X#foo(Object a,\n" +
- " */\n" +
- "public class X {\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#foo(Object a,") + "#foo(Object a,".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#foo(Object a,") + "#foo(Object a,".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0033() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0033/X.js",
- "package test0033;\n" +
- "/**\n" +
- " * @see X#X(ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0034() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0034/X.js",
- "package test0034;\n" +
- "/**\n" +
- " * @see X#X(ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0035() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0035/X.js",
- "package test0035;\n" +
- "/**\n" +
- " * @see X#X(ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0036() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0036/X.js",
- "package test0036;\n" +
- "/**\n" +
- " * @see X#X(\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#X(") + "#X(".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#X(") + "#X(".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0037() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0037/X.js",
- "package test0037;\n" +
- "/**\n" +
- " * @see X#X(Object ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0038() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0038/X.js",
- "package test0038;\n" +
- "/**\n" +
- " * @see X#X(Object ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0039() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0039/X.js",
- "package test0039;\n" +
- "/**\n" +
- " * @see X#X(Object ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0040() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0040/X.js",
- "package test0040;\n" +
- "/**\n" +
- " * @see X#X(Object \n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#X(Object ") + "#X(Object ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#X(Object ") + "#X(Object ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0041() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0041/X.js",
- "package test0041;\n" +
- "/**\n" +
- " * @see X#X(Object a,ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0042() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0042/X.js",
- "package test0042;\n" +
- "/**\n" +
- " * @see X#X(Object a,ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0043() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0043/X.js",
- "package test0043;\n" +
- "/**\n" +
- " * @see X#X(Object a,ZZZZ\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0044() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0044/X.js",
- "package test0044;\n" +
- "/**\n" +
- " * @see X#X(Object a,\n" +
- " */\n" +
- "public class X {\n" +
- " public X(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("#X(Object a,") + "#X(Object a,".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("#X(Object a,") + "#X(Object a,".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0045() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0045/X.js",
- "package test0045;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param ZZZZ\n" +
- " */\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0046() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0046/X.js",
- "package test0046;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param ZZZZ\n" +
- " */\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0047() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0047/X.js",
- "package test0047;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param ZZZZ\n" +
- " */\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("ZZZZ");
- int tokenEnd = tokenStart + "ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0048() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0048/X.js",
- "package test0048;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @param \n" +
- " */\n" +
- " public void foo(Object a, Object b){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@param ") + "@param ".length();
- int tokenEnd = tokenStart + "".length() - 1;
- int cursorLocation = str.lastIndexOf("@param ") + "@param ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0049() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0049/X.js",
- "package test0049;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @ZZZZ\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@ZZZZ");
- int tokenEnd = tokenStart + "@ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0050() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0050/X.js",
- "package test0050;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @ZZZZ\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@ZZZZ");
- int tokenEnd = tokenStart + "@ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0051() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0051/X.js",
- "package test0051;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @ZZZZ\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@ZZZZ");
- int tokenEnd = tokenStart + "@ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0052() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0052/X.js",
- "package test0052;\n" +
- "public class X {\n" +
- " /**\n" +
- " * @\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@");
- int tokenEnd = tokenStart + "@".length() - 1;
- int cursorLocation = str.lastIndexOf("@") + "@".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0053() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0053/X.js",
- "package test0053;\n" +
- "public class X {\n" +
- " /**\n" +
- " * blabla @ZZZZ\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@ZZZZ");
- int tokenEnd = tokenStart + "@ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@ZZZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0054() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0054/X.js",
- "package test0054;\n" +
- "public class X {\n" +
- " /**\n" +
- " * blabla @ZZZZ\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@ZZZZ");
- int tokenEnd = tokenStart + "@ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ");
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0055() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0055/X.js",
- "package test0055;\n" +
- "public class X {\n" +
- " /**\n" +
- " * blabla @ZZZZ\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@ZZZZ");
- int tokenEnd = tokenStart + "@ZZZZ".length() - 1;
- int cursorLocation = str.lastIndexOf("ZZZZ") + "ZZ".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@ZZ\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-public void test0056() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Completion/src3/test0056/X.js",
- "package test0056;\n" +
- "public class X {\n" +
- " /**\n" +
- " * blabla @\n" +
- " */\n" +
- " public void foo(){}\n" +
- "}");
-
- String str = this.workingCopies[0].getSource();
- int tokenStart = str.lastIndexOf("@");
- int tokenEnd = tokenStart + "@".length() - 1;
- int cursorLocation = str.lastIndexOf("@") + "@".length();
-
- CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
-
- assertResults(
- "completion offset="+(cursorLocation)+"\n" +
- "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
- "completion token=\"@\"\n" +
- "completion token kind=TOKEN_KIND_NAME\n" +
- "expectedTypesSignatures=null\n" +
- "expectedTypesKeys=null",
- result.context);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocFieldCompletionModelTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocFieldCompletionModelTest.java
deleted file mode 100644
index cf00d7b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocFieldCompletionModelTest.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Hashtable;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-/**
- * Test class for completion in Javadoc comment of a field declaration.
- */
-public class JavadocFieldCompletionModelTest extends AbstractJavadocCompletionModelTest {
-
-public JavadocFieldCompletionModelTest(String name) {
- super(name);
-}
-
-static {
-// TESTS_RANGE = new int[] { 22, -1 };
-// TESTS_NUMBERS = new int[] { 16 };
-}
-public static Test suite() {
- return buildModelTestSuite(JavadocFieldCompletionModelTest.class);
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavaModelCompletionTests#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- setUpProjectOptions(CompilerOptions.VERSION_1_4); // default compliance
-}
-
-/**
- * @category Tests for tag names completion
- */
-public void test001() throws JavaScriptModelException {
- String source =
- "package javadoc.fields;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/Test.js", source, true, "@");
- assertResults(
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialField[JSDOC_BLOCK_TAG]{@serialField, null, null, serialField, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test002() throws JavaScriptModelException {
- String source =
- "package javadoc.fields;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on impossible tag name:\n" +
- " * @thr\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/Test.js", source, true, "@thr");
- assertResults("");
-}
-
-public void test003() throws JavaScriptModelException {
- String source =
- "package javadoc.fields;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on one letter:\n" +
- " * @v\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/Test.js", source, true, "@v");
- assertResults(
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test004() throws JavaScriptModelException {
- String source =
- "package javadoc.fields;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion with several letters:\n" +
- " * @ser\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/Test.js", source, true, "@ser");
- assertResults(
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialField[JSDOC_BLOCK_TAG]{@serialField, null, null, serialField, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test005() throws JavaScriptModelException {
- String source =
- "package javadoc.fields;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on full tag name:\n" +
- " * @docRoot\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/Test.js", source, true, "@docRoot");
- assertResults(
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test006() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_3);
- String source =
- "package javadoc.fields;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/Test.js", source, true, "@");
- assertResults(
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialField[JSDOC_BLOCK_TAG]{@serialField, null, null, serialField, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test007() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.fields;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/Test.js", source, true, "@");
- assertResults(
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialField[JSDOC_BLOCK_TAG]{@serialField, null, null, serialField, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "code[JSDOC_INLINE_TAG]{{@code}, null, null, code, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "literal[JSDOC_INLINE_TAG]{{@literal}, null, null, literal, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @category Tests for types completion
- */
-public void test010() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see Obj\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "Obj");
- assertResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test011() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTest\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "BasicTest", 2);
- assertResults(
- "BasicTestFields[TYPE_REF]{BasicTestFields, javadoc.fields.tags, Ljavadoc.fields.tags.BasicTestFields;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestReferences[TYPE_REF]{org.eclipse.wst.jsdt.core.tests.BasicTestReferences, org.eclipse.wst.jsdt.core.tests, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test012() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.fields.tags.BasicTest\n" +
- " * Note: JDT-UI failed on this one\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "javadoc.fields.tags.BasicTest");
- assertResults(
- "BasicTestFields[TYPE_REF]{BasicTestFields, javadoc.fields.tags, Ljavadoc.fields.tags.BasicTestFields;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test013() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see java.la\n" +
- " * Note: JDT-UI fails on this one\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "java.la");
- assertResults(
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test014() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see pack.Bin\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "pack.Bin");
- assertSortedResults(
- "Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test015() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see I\n" +
- " * Note: completion list shoud not include base types.\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "I");
- assertSortedResults(
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-/**
- * @category Tests for fields completion
- */
-public void test020() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #fo\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.fields.tags.BasicTestFields;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test021() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestFields#fo\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.fields.tags.BasicTestFields;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test022() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.fields.tags.BasicTestFields#fo\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.fields.tags.BasicTestFields;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test023() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/fields/tags/BasicTestFields.js",
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see OtherFields#oth\n" +
- " */\n" +
- " int foo;\n" +
- "}",
- "/Completion/src/javadoc/fields/tags/OtherFields.js",
- "package javadoc.fields.tags;\n" +
- "public class OtherFields {\n" +
- " int other;\n" +
- "}"
- };
- completeInJavadoc(sources, true, "oth");
- assertResults(
- "other[FIELD_REF]{other, Ljavadoc.fields.tags.OtherFields;, I, other, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test024() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #\n" +
- " */\n" +
- " int foo;\n" +
- " Object obj;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "#", 0); // completion on empty token
- assertResults(
- "obj[FIELD_REF]{obj, Ljavadoc.fields.tags.BasicTestFields;, Ljava.lang.Object;, obj, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FIELD_REF]{foo, Ljavadoc.fields.tags.BasicTestFields;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestFields[FUNCTION_REF<CONSTRUCTOR>]{BasicTestFields(), Ljavadoc.fields.tags.BasicTestFields;, ()V, BasicTestFields, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test025() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestFields#\n" +
- " */\n" +
- " int foo;\n" +
- " Object obj;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "#", 0); // completion on empty token
- assertResults(
- "obj[FIELD_REF]{obj, Ljavadoc.fields.tags.BasicTestFields;, Ljava.lang.Object;, obj, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FIELD_REF]{foo, Ljavadoc.fields.tags.BasicTestFields;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestFields[FUNCTION_REF<CONSTRUCTOR>]{BasicTestFields(), Ljavadoc.fields.tags.BasicTestFields;, ()V, BasicTestFields, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test026() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.fields.tags.BasicTestFields#\n" +
- " */\n" +
- " int foo;\n" +
- " Object obj;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "#", 0); // completion on empty token
- assertResults(
- "obj[FIELD_REF]{obj, Ljavadoc.fields.tags.BasicTestFields;, Ljava.lang.Object;, obj, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FIELD_REF]{foo, Ljavadoc.fields.tags.BasicTestFields;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestFields[FUNCTION_REF<CONSTRUCTOR>]{BasicTestFields(), Ljavadoc.fields.tags.BasicTestFields;, ()V, BasicTestFields, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test027() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestReferences#FIE\n" +
- " */\n" +
- " int foo;\n" +
- " Object obj;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "FIE");
- assertResults("");
-}
-
-public void test028() throws JavaScriptModelException {
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see org.eclipse.wst.jsdt.core.tests.BasicTestReferences#FIE\n" +
- " */\n" +
- " int foo;\n" +
- " Object obj;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "FIE");
- assertResults(
- "FIELD[FIELD_REF]{FIELD, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, I, FIELD, null, "+this.positions+R_DICNR+"}"
- );
-}
-/**
- * @tests Tests for camel case completion
- */
-public void test030() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- String source =
- "package javadoc.fields.tags;\n" +
- "public class BasicTestFields {\n" +
- " Object oneTwoThree;\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #oTT\n" +
- " */\n" +
- " int foo;\n" +
-
- "}";
- completeInJavadoc("/Completion/src/javadoc/fields/tags/BasicTestFields.js", source, true, "oTT");
- assertResults(
- "oneTwoThree[FIELD_REF]{oneTwoThree, Ljavadoc.fields.tags.BasicTestFields;, Ljava.lang.Object;, oneTwoThree, null, "+this.positions+"24}"
- );
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocMethodCompletionModelTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocMethodCompletionModelTest.java
deleted file mode 100644
index 8c75e91..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocMethodCompletionModelTest.java
+++ /dev/null
@@ -1,2584 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Hashtable;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-/**
- * Test class for completion in Javadoc comment of a method declaration.
- */
-public class JavadocMethodCompletionModelTest extends AbstractJavadocCompletionModelTest {
-
-public JavadocMethodCompletionModelTest(String name) {
- super(name);
-}
-
-static {
-// TESTS_NUMBERS = new int[] { 58 };
-// TESTS_RANGE = new int[] { 58, 69 };
-}
-public static Test suite() {
- return buildModelTestSuite(JavadocMethodCompletionModelTest.class);
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavadocCompletionModelTest#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- setUpProjectOptions(CompilerOptions.VERSION_1_4);
-}
-
-/**
- * @tests Tests for tag names completion
- */
-public void test001() throws JavaScriptModelException {
- String source =
- "package javadoc.methods;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/Test.js", source, true, "@");
- assertResults(
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "exception[JSDOC_BLOCK_TAG]{@exception, null, null, exception, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "param[JSDOC_BLOCK_TAG]{@param, null, null, param, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "return[JSDOC_BLOCK_TAG]{@return, null, null, return, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialData[JSDOC_BLOCK_TAG]{@serialData, null, null, serialData, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "throws[JSDOC_BLOCK_TAG]{@throws, null, null, throws, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test002() throws JavaScriptModelException {
- String source =
- "package javadoc.methods;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on impossible tag name:\n" +
- " * @aut\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/Test.js", source, true, "@aut");
- assertResults("");
-}
-
-public void test003() throws JavaScriptModelException {
- String source =
- "package javadoc.methods;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on one letter:\n" +
- " * @r\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/Test.js", source, true, "@r");
- assertResults(
- "return[JSDOC_BLOCK_TAG]{@return, null, null, return, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test004() throws JavaScriptModelException {
- String source =
- "package javadoc.methods;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion with several letters:\n" +
- " * @ser\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/Test.js", source, true, "@ser");
- assertResults(
- "serialData[JSDOC_BLOCK_TAG]{@serialData, null, null, serialData, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test005() throws JavaScriptModelException {
- String source =
- "package javadoc.methods;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on full tag name:\n" +
- " * @inheritDoc\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/Test.js", source, true, "@inheritDoc");
- assertResults(
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test006() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_3);
- String source =
- "package javadoc.methods;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/Test.js", source, true, "@");
- assertResults(
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "exception[JSDOC_BLOCK_TAG]{@exception, null, null, exception, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "param[JSDOC_BLOCK_TAG]{@param, null, null, param, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "return[JSDOC_BLOCK_TAG]{@return, null, null, return, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialData[JSDOC_BLOCK_TAG]{@serialData, null, null, serialData, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "throws[JSDOC_BLOCK_TAG]{@throws, null, null, throws, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test007() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods;\n" +
- "public class Test {\n" +
- " /**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/Test.js", source, true, "@");
- assertResults(
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "exception[JSDOC_BLOCK_TAG]{@exception, null, null, exception, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "param[JSDOC_BLOCK_TAG]{@param, null, null, param, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "return[JSDOC_BLOCK_TAG]{@return, null, null, return, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serialData[JSDOC_BLOCK_TAG]{@serialData, null, null, serialData, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "throws[JSDOC_BLOCK_TAG]{@throws, null, null, throws, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "code[JSDOC_INLINE_TAG]{{@code}, null, null, code, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "literal[JSDOC_INLINE_TAG]{{@literal}, null, null, literal, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @tests Tests for types completion
- */
-public void test010() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- "\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethodsE\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n" +
- "class BasicTestMethodsException1 extends Exception{}\n" +
- "class BasicTestMethodsException2 extends Exception{}\n" +
- "class BasicTestMethodsExample {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethodsE");
- assertSortedResults(
- "BasicTestMethodsExample[TYPE_REF]{BasicTestMethodsExample, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsExample;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestMethodsException1[TYPE_REF]{BasicTestMethodsException1, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException1;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestMethodsException2[TYPE_REF]{BasicTestMethodsException2, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException2;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test011() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- "\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see \n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n" +
- "class BasicTestMethodsException1 extends Exception{}\n" +
- "class BasicTestMethodsException2 extends Exception{}\n" +
- "class BasicTestMethodsExample {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@see ", 0); // completion on empty token
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults("");
- } else {
- assertResults(
- "BasicTestMethods[TYPE_REF]{BasicTestMethods, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethods;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestMethodsException1[TYPE_REF]{BasicTestMethodsException1, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException1;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestMethodsException2[TYPE_REF]{BasicTestMethodsException2, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException2;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestMethodsExample[TYPE_REF]{BasicTestMethodsExample, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsExample;, null, null, "+this.positions+R_DICUNR+"}");
- }
-}
-
-public void test012() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- "\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @throws BasicTestMethodsE\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n" +
- "class BasicTestMethodsException1 extends Exception{}\n" +
- "class BasicTestMethodsException2 extends Exception{}\n" +
- "class BasicTestMethodsExample {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethodsE");
- assertSortedResults(
- "BasicTestMethodsException1[TYPE_REF]{BasicTestMethodsException1, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException1;, null, null, "+this.positions+R_DICUNRE+"}\n" +
- "BasicTestMethodsException2[TYPE_REF]{BasicTestMethodsException2, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException2;, null, null, "+this.positions+R_DICUNRE+"}\n" +
- "BasicTestMethodsExample[TYPE_REF]{BasicTestMethodsExample, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsExample;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test013() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- "\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @throws BasicTestMethodsE\n" +
- " */\n" +
- " public void foo() throws BasicTestMethodsException2 {}\n" +
- "}\n" +
- "class BasicTestMethodsException1 extends Exception{}\n" +
- "class BasicTestMethodsException2 extends Exception{}\n" +
- "class BasicTestMethodsExample {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethodsE");
- assertSortedResults(
- "BasicTestMethodsException2[TYPE_REF]{BasicTestMethodsException2, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException2;, null, null, "+this.positions+R_DICUNREEET+"}\n" +
- "BasicTestMethodsException1[TYPE_REF]{BasicTestMethodsException1, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException1;, null, null, "+this.positions+R_DICUNRE+"}\n" +
- "BasicTestMethodsExample[TYPE_REF]{BasicTestMethodsExample, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsExample;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test014() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- "\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @throws \n" +
- " */\n" +
- " public void foo() throws BasicTestMethodsException {}\n" +
- "}\n" +
- "class BasicTestMethodsException extends Exception{}\n" +
- "class BasicTestMethodsExample {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@throws ", 0); // completion on empty token
- if(CompletionEngine.NO_TYPE_COMPLETION_ON_EMPTY_TOKEN) {
- assertResults(
- "BasicTestMethodsException[TYPE_REF]{BasicTestMethodsException, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException;, null, null, "+this.positions+R_DICUNREET+"}"
- );
- } else {
- assertResults(
- "BasicTestMethods[TYPE_REF]{BasicTestMethods, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethods;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestMethodsException[TYPE_REF]{BasicTestMethodsException, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsException;, null, null, "+this.positions+R_DICUNREEET+"}\n" +
- "BasicTestMethodsExample[TYPE_REF]{BasicTestMethodsExample, javadoc.methods.tags, Ljavadoc.methods.tags.BasicTestMethodsExample;, null, null, "+this.positions+R_DICUNR+"}");
- }
-}
-
-public void test015() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- "\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @throws I\n" +
- " * Note: there should be NO base types in proposals." +
- " */\n" +
- " public void foo() {\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "I");
- assertResults(
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICUNRE+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICUNRE+"}"
- );
-}
-
-public void test016() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- "\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @throws java.lang.I\n" +
- " */\n" +
- " public void foo() throws InterruptedException {\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "java.lang.I");
- assertResults(
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNRE+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNREEET+"}"
- );
-}
-
-/**
- * @tests Tests for fields completion
- */
-public void test020() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #fo\n" +
- " */\n" +
- " int foo;\n" +
- " void foo() {}\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.methods.tags.BasicTestMethods;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test021() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#fo\n" +
- " */\n" +
- " int foo;\n" +
- " void foo() {}\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.methods.tags.BasicTestMethods;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test022() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.methods.tags.BasicTestMethods#fo\n" +
- " */\n" +
- " int foo;\n" +
- " void foo() {}\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.methods.tags.BasicTestMethods;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test023() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/methods/tags/BasicTestMethods.js",
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see OtherFields#fo\n" +
- " */\n" +
- " int foo;\n" +
- "}",
- "/Completion/src/javadoc/methods/tags/OtherFields.js",
- "package javadoc.methods.tags;\n" +
- "public class OtherFields {\n" +
- " int foo;\n" +
- " void foo() {}\n" +
- "}"
- };
- completeInJavadoc(sources, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.methods.tags.OtherFields;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.OtherFields;, ()V, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-/**
- * @tests Tests for methods completion
- */
-public void test030() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see fo\n" +
- " */\n" +
- " void foo() {}\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "fo");
- assertResults("");
-}
-
-public void test031() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #fo\n" +
- " */\n" +
- " <T> void foo() {}\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "fo");
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, <T:Ljava.lang.Object;>()V, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test032() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #ba\n" +
- " * \n" +
- " * Note that argument names are put in proposals although there are not while completing\n" +
- " * in javadoc text {@link javadoc.text.BasicTestMethods }. This is due to the fact that while\n" +
- " * completing in javadoc tags, it\'s JDT-UI which compute arguments, not JDT-CORE.\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "ba");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test033() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #ba\n" +
- " * \n" +
- " * Note that argument names are put in proposals although there are not while completing\n" +
- " * in javadoc text {@link javadoc.text.BasicTestMethods }. This is due to the fact that while\n" +
- " * completing in javadoc tags, it\'s JDT-UI which compute arguments, not JDT-CORE.\n" +
- " */\n" +
- " <T, U> void bar(String str, Class<T> clt, Class<U> clu) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "ba");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, Class, Class), Ljavadoc.methods.tags.BasicTestMethods;, <T:Ljava.lang.Object;U:Ljava.lang.Object;>(Ljava.lang.String;Ljava.lang.Class<TT;>;Ljava.lang.Class<TU;>;)V, bar, (str, clt, clu), "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test034() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#ba\n" +
- " * \n" +
- " * Note that argument names are put in proposals although there are not while completing\n" +
- " * in javadoc text {@link javadoc.text.BasicTestMethods }. This is due to the fact that while\n" +
- " * completing in javadoc tags, it\'s JDT-UI which compute arguments, not JDT-CORE.\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "ba");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test035() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.methods.tags.BasicTestMethods#ba\n" +
- " * \n" +
- " * Note that argument names are put in proposals although there are not while completing\n" +
- " * in javadoc text {@link javadoc.text.BasicTestMethods }. This is due to the fact that while\n" +
- " * completing in javadoc tags, it\'s JDT-UI which compute arguments, not JDT-CORE.\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "ba");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test036() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/methods/tags/BasicTestMethods.js",
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#fo\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/methods/tags/OtherTypes.js",
- "package javadoc.methods.tags;\n" +
- "public class OtherTypes {\n" +
- " void foo() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "fo");
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.OtherTypes;, ()V, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test037() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #\n" +
- " */\n" +
- " void foo() {}\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // completion on empty token
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test038() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #\n" +
- " */\n" +
- " <T> void foo() {}\n" +
- " <TParam1, TParam2> void bar(TParam1 tp1, TParam2 tp2) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // completion on empty token
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, <T:Ljava.lang.Object;>()V, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "bar[FUNCTION_REF]{bar(Object, Object), Ljavadoc.methods.tags.BasicTestMethods;, <TParam1:Ljava.lang.Object;TParam2:Ljava.lang.Object;>(TTParam1;TTParam2;)V, bar, (tp1, tp2), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test039() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#\n" +
- " */\n" +
- " void foo() {}\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // completion on empty token
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test040() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.methods.tags.BasicTestMethods#\n" +
- " */\n" +
- " void foo() {}\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // completion on empty token
- assertResults(
- "foo[FUNCTION_REF]{foo(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test041() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test042() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(Str\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "Str");
- assertResults(
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test043() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(java.lang.\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "java.lang.");
- assertSortedResults(
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICNR+"}\n" +
- "CloneNotSupportedException[TYPE_REF]{CloneNotSupportedException, java.lang, Ljava.lang.CloneNotSupportedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Error[TYPE_REF]{Error, java.lang, Ljava.lang.Error;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Exception[TYPE_REF]{Exception, java.lang, Ljava.lang.Exception;, null, null, "+this.positions+R_DICNR+"}\n" +
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICNR+"}\n" +
- "RuntimeException[TYPE_REF]{RuntimeException, java.lang, Ljava.lang.RuntimeException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Throwable[TYPE_REF]{Throwable, java.lang, Ljava.lang.Throwable;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test044() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(java.lang.St\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "java.lang.St");
- assertResults(
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test045() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String s\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String s");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test046() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String str, \n" +
- " */\n" +
- " // Note: Completion takes place just after trailoing comma (there's a space after)\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String str,");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test047() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String str, \n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String str, ");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test048() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String,\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String,");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test049() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String str, bool\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bool");
- assertResults(
- "boolean[KEYWORD]{boolean, null, null, boolean, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/*
- * Specific case where we can complete but we don't want to as the prefix is not syntaxically correct
- */
-public void test050() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String str, boolean,\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String str, boolean,");
- assertResults("");
-}
-
-public void test051() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String str, boolean flag,\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String str, boolean flag,");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test052() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String,boolean,\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String,boolean,");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test053() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String,boolean,Object\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "Object");
- assertResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICENUNR+"}"
- );
-}
-
-/*
- * Specific case where we can complete but we don't want to as the prefix is not syntaxically correct
- */
-public void test054() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String, boolean, Object o\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String, boolean, Object o");
- assertResults("");
-}
-
-public void test055() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #bar(String str, boolean flag, Object o\n" +
- " */\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "bar(String str, boolean flag, Object o");
- assertResults(
- "bar[FUNCTION_REF]{bar(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, bar, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test056() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/methods/tags/BasicTestMethods.js",
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#foo(\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/methods/tags/OtherTypes.js",
- "package javadoc.methods.tags;\n" +
- "public class OtherTypes {\n" +
- " void foo(String str) {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "foo(");
- assertResults(
- "foo[FUNCTION_REF]{foo(String), Ljavadoc.methods.tags.OtherTypes;, (Ljava.lang.String;)V, foo, (str), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test057() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/methods/tags/BasicTestMethods.js",
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.methods.tags.OtherTypes#foo(\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/methods/tags/OtherTypes.js",
- "package javadoc.methods.tags;\n" +
- "public class OtherTypes {\n" +
- " void foo(String str) {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "foo(");
- assertResults(
- "foo[FUNCTION_REF]{foo(String), Ljavadoc.methods.tags.OtherTypes;, (Ljava.lang.String;)V, foo, (str), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test058() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#method()\n" +
- " */\n" +
- " void method() {}\n" +
- " void bar(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "meth", 2); // 2nd occurrence
- assertResults(
- "method[FUNCTION_REF]{method(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test059() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#method()\n" +
- " */\n" +
- " void method() {}\n" +
- " void method(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "meth", 2); // 2nd occurrence
- assertResults(
- "method[FUNCTION_REF]{method(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, method, (str, flag, obj), "+this.positions+R_DICNRNS+"}\n" +
- "method[FUNCTION_REF]{method(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test060() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#method(String)\n" +
- " */\n" +
- " void method() {}\n" +
- " void method(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "meth", 2); // 2nd occurrence
- assertResults(
- "method[FUNCTION_REF]{method(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, method, (str, flag, obj), "+this.positions+R_DICNRNS+"}\n" +
- "method[FUNCTION_REF]{method(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test061() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#method(String,boolean,Object)\n" +
- " */\n" +
- " void method() {}\n" +
- " void method(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "meth", 2); // 2nd occurrence
- assertResults(
- "method[FUNCTION_REF]{method(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, method, (str, flag, obj), [116, 145], "+R_DICNRNS+"}\n" +
- "method[FUNCTION_REF]{method(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, method, null, [116, 145], "+R_DICNRNS+"}"
- );
-}
-
-// TODO (frederic) See with David what to do on this case...
-public void _test062() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#method(String str,boolean,Object)\n" +
- " */\n" +
- " void method() {}\n" +
- " void method(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "meth", 2); // 2nd occurrence
- assertResults(
- "method[FUNCTION_REF]{method(String, boolean, Object), Ljavadoc.methods.tags.BasicTestMethods;, (Ljava.lang.String;ZLjava.lang.Object;)V, method, (str, flag, obj), "+this.positions+R_DICUNR+"}\n" +
- "method[FUNCTION_REF]{method(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, method, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-/**
- * @tests Tests for method parameters completion
- */
-public void test070() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param \n" +
- " */\n" +
- " public String foo(String str) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertResults(
- "str[JSDOC_PARAM_REF]{str, null, null, str, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test071() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param x\n" +
- " */\n" +
- " public String foo(String xstr) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "x");
- assertResults(
- "xstr[JSDOC_PARAM_REF]{xstr, null, null, xstr, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test072() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " */\n" +
- " public String foo(String xstr) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr");
- assertResults(
- "xstr[JSDOC_PARAM_REF]{xstr, null, null, xstr, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test073() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " */\n" +
- " public String foo(String xstr) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "x");
- assertResults(
- "xstr[JSDOC_PARAM_REF]{xstr, null, null, xstr, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test074() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xx\n" +
- " */\n" +
- " public String foo(String xstr) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xx");
- assertResults("");
-}
-
-public void test075() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " ** @param \n" +
- " */\n" +
- " public String foo(String xstr) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "** @param ", 0); // empty token
- assertResults( "");
-}
-
-public void test076() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr\n" +
- " */\n" +
- " public String foo(String xstr) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr");
- assertResults("");
-}
-
-public void test077() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr\n" +
- " */\n" +
- " public String foo(String xstr) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr", 2);
- assertResults("");
-}
-
-public void test078() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr\n" +
- " */\n" +
- " public String foo(String xstr, String xstr2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr");
- assertResults(
- "xstr2[JSDOC_PARAM_REF]{xstr2, null, null, xstr2, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test079() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr\n" +
- " */\n" +
- " public String foo(String xstr, String xstr2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr", 2); // 2nd occurence
- assertResults(
- "xstr2[JSDOC_PARAM_REF]{xstr2, null, null, xstr2, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test080() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr2\n" +
- " */\n" +
- " public String foo(String xstr, String xstr2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr");
- assertResults(
- "xstr[JSDOC_PARAM_REF]{xstr, null, null, xstr, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test081() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr2\n" +
- " */\n" +
- " public String foo(String xstr, String xstr2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr", 2); // 2nd occurence
- assertResults(
- "xstr2[JSDOC_PARAM_REF]{xstr2, null, null, xstr2, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test082() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr\n" +
- " * @param xstr2\n" +
- " */\n" +
- " public String foo(String xstr, String xstr2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr");
- assertResults("");
-}
-
-public void test083() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr\n" +
- " * @param xstr2\n" +
- " */\n" +
- " public String foo(String xstr, String xstr2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr", 2); // 2nd occurence
- assertResults("");
-}
-
-public void test084() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " * @param xstr\n" +
- " * @param xstr2\n" +
- " */\n" +
- " public String foo(String xstr, String xstr2) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "xstr", 3); // 3rd position
- assertResults(
- "xstr2[JSDOC_PARAM_REF]{xstr2, null, null, xstr2, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test085() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param \n" +
- " */\n" +
- " public String foo(String xstr, boolean flag, Object obj) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertResults(
- "xstr[JSDOC_PARAM_REF]{xstr, null, null, xstr, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING+2)+"}\n" +
- "flag[JSDOC_PARAM_REF]{flag, null, null, flag, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING+1)+"}\n" +
- "obj[JSDOC_PARAM_REF]{obj, null, null, obj, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test086() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xstr\n" +
- " ** @param \n" +
- " */\n" +
- " public String methodMultipleParam2(String xstr, boolean flag, Object obj) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "** @param ", 0); // empty token
- assertResults(
- "flag[JSDOC_PARAM_REF]{flag, null, null, flag, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING+1)+"}\n" +
- "obj[JSDOC_PARAM_REF]{obj, null, null, obj, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test087() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param \n" +
- " * @param flag\n" +
- " */\n" +
- " public String methodMultipleParam3(String xstr, boolean flag, Object obj) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertResults(
- "xstr[JSDOC_PARAM_REF]{xstr, null, null, xstr, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING+1)+"}\n" +
- "obj[JSDOC_PARAM_REF]{obj, null, null, obj, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test088() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param obj\n" +
- " * @param xstr\n" +
- " ** @param \n" +
- " */\n" +
- " public String methodMultipleParam4(String xstr, boolean flag, Object obj) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "** @param ", 0); // empty token
- assertResults(
- "flag[JSDOC_PARAM_REF]{flag, null, null, flag, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test089() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param \n" +
- " * @param obj\n" +
- " * @param xstr\n" +
- " * @param flag\n" +
- " */\n" +
- " public String methodMultipleParam5(String xstr, boolean flag, Object obj) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertResults("");
-}
-
-public void test090() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param obj\n" +
- " * @param xstr\n" +
- " * @param flag\n" +
- " */\n" +
- " public String methodMultipleParam5(String xstr, boolean flag, Object obj) {\n" +
- " return null;\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "ob");
- assertResults(
- "obj[JSDOC_PARAM_REF]{obj, null, null, obj, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-/**
- * @tests Tests for type parameters completion
- */
-public void test100() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param \n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING+1)+"}\n" +
- "xtc[JSDOC_PARAM_REF]{xtc, null, null, xtc, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}\n" +
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test101() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <TM>\n" +
- " ** @param \n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "** @param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING+1)+"}\n" +
- "xtc[JSDOC_PARAM_REF]{xtc, null, null, xtc, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test102() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xtc\n" +
- " * @param <TM>\n" +
- " ** @param \n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true,"** @param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test103() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xtc\n" +
- " ** @param \n" +
- " * @param xtc\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true,"** @param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}\n" +
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test104() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " ** @param \n" +
- " * @param xtc\n" +
- " * @param xtm\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true,"** @param ", 0); // empty token
- assertSortedResults(
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test105() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param xtc\n" +
- " * @param xtm\n" +
- " * @param <TM>\n" +
- " ** @param \n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true,"** @param ", 0); // empty token
- assertSortedResults("");
-}
-
-public void test106() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<", 2); // 2nd occurence
- assertSortedResults(
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test107() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <T\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<T", 2); // 2nd occurence
- assertSortedResults(
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test108() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <TC\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<TC", 2); // 2nd occurence
- assertSortedResults("");
-}
-
-public void test109() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <TM>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<TM");
- assertSortedResults(
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test110() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <TM>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<TM>");
- assertSortedResults(
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test111() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <TM>\n" +
- " * @param <TM>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<TM");
- assertSortedResults("");
-}
-
-public void test112() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <TM>\n" +
- " * @param <TM>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<TM>", 2); // 2nd occurence
- assertSortedResults("");
-}
-
-public void test113() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param ab\n" +
- " */\n" +
- " void foo(Object ab1, Object ab2) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0);
- assertSortedResults(
- "ab1[JSDOC_PARAM_REF]{ab1, null, null, ab1, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING+1)+"}\n" +
- "ab2[JSDOC_PARAM_REF]{ab2, null, null, ab2, null, "+this.positions+(JAVADOC_RELEVANCE+R_INTERESTING)+"}"
- );
-}
-
-public void test114() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <ZZZ>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+"14}\n" +
- "xtc[JSDOC_PARAM_REF]{xtc, null, null, xtc, null, "+this.positions+"13}\n" +
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test115() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <ZZZ>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "<", 2); // 2nd occurrence
- assertSortedResults(
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test116() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <ZZZ>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "Z");
- assertSortedResults("");
-}
-
-public void test117() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param <ZZZ>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "ZZZ");
- assertSortedResults("");
-}
-
-public void test118() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param ZZZ>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, [105, 108], 14}\n" +
- "xtc[JSDOC_PARAM_REF]{xtc, null, null, xtc, null, [105, 108], 13}\n" +
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, [105, 108], "+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test119() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param ZZZ>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "Z");
- assertSortedResults("");
-}
-
-public void test120() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param ZZZ>\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "ZZZ");
- assertSortedResults("");
-}
-
-public void test121() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param ZZZ.\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+"14}\n" +
- "xtc[JSDOC_PARAM_REF]{xtc, null, null, xtc, null, "+this.positions+"13}\n" +
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test122() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param ZZZ#\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+"14}\n" +
- "xtc[JSDOC_PARAM_REF]{xtc, null, null, xtc, null, "+this.positions+"13}\n" +
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test123() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods<TC> {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @param ZZZ?\n" +
- " */\n" +
- " <TM> void foo(Class<TM> xtm, Class<TC> xtc) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "@param ", 0); // empty token
- assertSortedResults(
- "xtm[JSDOC_PARAM_REF]{xtm, null, null, xtm, null, "+this.positions+"14}\n" +
- "xtc[JSDOC_PARAM_REF]{xtc, null, null, xtc, null, "+this.positions+"13}\n" +
- "TM[JSDOC_PARAM_REF]{<TM>, null, null, TM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @tests Tests for constructors completion
- */
-public void test130() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTest\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTest", 2); // 2nd occurence
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test131() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTest\n" +
- " * @since 3.2\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTest", 2); // 2nd occurence
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test132() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTest\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " <T> BasicTestMethods(int xxx, float real, Class<T> clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTest", 2); // 2nd occurence
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, <T:Ljava.lang.Object;>(IFLjava.lang.Class<TT;>;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test133() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#BasicTest\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTest", 3); // 3rd occurence
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test134() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.methods.tags.BasicTestMethods#BasicTest\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTest", 3); // 3rd occurence
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test135() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/methods/tags/BasicTestMethods.js",
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#O\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/methods/tags/OtherTypes.js",
- "package javadoc.methods.tags;\n" +
- "public class OtherTypes {\n" +
- " OtherTypes() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "O", 2); // 2nd occurence
- assertResults(
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(), Ljavadoc.methods.tags.OtherTypes;, ()V, OtherTypes, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test136() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/methods/tags/BasicTestMethods.js",
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#O implicit default constructor\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/methods/tags/OtherTypes.js",
- "package javadoc.methods.tags;\n" +
- "public class OtherTypes {\n" +
- "}"
- };
- completeInJavadoc(sources, true, "O", 2); // 2nd occurence
- assertResults(
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(), Ljavadoc.methods.tags.OtherTypes;, ()V, OtherTypes, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test137() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // empty token
- assertResults(
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test138() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #\n" +
- " * @since 3.2\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // empty token
- assertResults(
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test139() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #\n" +
- " */\n" +
- " <T> BasicTestMethods() {}\n" +
- " <T, U> BasicTestMethods(int xxx, Class<T> cl1, Class<U> cl2) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // empty token
- assertResults(
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, Class, Class), Ljavadoc.methods.tags.BasicTestMethods;, <T:Ljava.lang.Object;U:Ljava.lang.Object;>(ILjava.lang.Class<TT;>;Ljava.lang.Class<TU;>;)V, BasicTestMethods, (xxx, cl1, cl2), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, <T:Ljava.lang.Object;>()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test140() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see #\n" +
- " */\n" +
- "public class BasicTestMethods {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "#", 0); // empty token
- assertResults(
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test141() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test142() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(\n" +
- " * @since 3.2\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test143() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods( trailing text\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test144() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods( ...\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test145() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods( \n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test146() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods( ????\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test147() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods( ,,\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test148() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethods#BasicTestMethods(\n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test149() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see javadoc.methods.tags.BasicTestMethods#BasicTestMethods(\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMethods(");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(), Ljavadoc.methods.tags.BasicTestMethods;, ()V, BasicTestMethods, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-// TODO (frederic) Reduce proposal as there's only a single valid proposal: int
-public void test150() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(in\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "in");
- assertResults(
- "int[KEYWORD]{int, null, null, int, null, "+this.positions+R_DICNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DIUNR+"}"
- );
-}
-
-// TODO (frederic) Reduce proposal as there's only a single valid proposal: int
-public void test151() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(int\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "int");
- assertResults(
- "int[KEYWORD]{int, null, null, int, null, "+this.positions+R_DICENNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DIUNR+"}"
- );
-}
-
-public void test152() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(int aaa, fl\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "fl");
- assertResults(
- "float[KEYWORD]{float, null, null, float, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test153() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(int aaa, float\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "float");
- assertResults(
- "float[KEYWORD]{float, null, null, float, null, "+this.positions+R_DICENNR+"}"
- );
-}
-
-public void test154() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(int, float, Cla\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "Cla");
- assertResults(
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-// TODO (frederic) Reduce proposal as there's only a single valid proposal: Class
-public void test155() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(int, float, java.lang.\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "java.lang.");
- assertSortedResults(
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICNR+"}\n" +
- "CloneNotSupportedException[TYPE_REF]{CloneNotSupportedException, java.lang, Ljava.lang.CloneNotSupportedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Error[TYPE_REF]{Error, java.lang, Ljava.lang.Error;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Exception[TYPE_REF]{Exception, java.lang, Ljava.lang.Exception;, null, null, "+this.positions+R_DICNR+"}\n" +
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICNR+"}\n" +
- "RuntimeException[TYPE_REF]{RuntimeException, java.lang, Ljava.lang.RuntimeException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Throwable[TYPE_REF]{Throwable, java.lang, Ljava.lang.Throwable;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test156() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(int, float, java.lang.Cla\n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "java.lang.Cla");
- assertResults(
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test157() throws JavaScriptModelException {
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMethods(int, float, Class\n" +
- " * \n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "Class");
- assertResults(
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICENUNR+"}"
- );
-}
-/**
- * @tests Tests for camel case completion
- */
-public void test160() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void foo() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BTM\n" +
- " * \n" +
- " */\n" +
- " BasicTestMethods(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BTM");
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(int, float, Class), Ljavadoc.methods.tags.BasicTestMethods;, (IFLjava.lang.Class;)V, BasicTestMethods, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-public void test161() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " void oneTwoThree(int i) {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #oTT\n" +
- " * \n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "oTT");
- assertResults(
- "oneTwoThree[FUNCTION_REF]{oneTwoThree(int), Ljavadoc.methods.tags.BasicTestMethods;, (I)V, oneTwoThree, (i), "+this.positions+"24}"
- );
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155824
-public void test162() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
-
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " public void oneTwoThree(Object... o) {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #oneTwoT\n" +
- " * \n" +
- " */\n" +
- " BasicTestMethods() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "oneTwoT", 2);
- assertResults(
- "oneTwoThree[FUNCTION_REF]{oneTwoThree(Object...), Ljavadoc.methods.tags.BasicTestMethods;, ([Ljava.lang.Object;)V, oneTwoThree, (o), "+this.positions+R_DICNRNS+"}"
- );
-}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=155824
-public void test163() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
-
- String source =
- "package javadoc.methods.tags;\n" +
- "public class BasicTestMethods {\n" +
- " public BasicTestMethods(Object... o) {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * @see #BasicTestMeth\n" +
- " * \n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/methods/tags/BasicTestMethods.js", source, true, "BasicTestMeth", 3);
- assertResults(
- "BasicTestMethods[FUNCTION_REF<CONSTRUCTOR>]{BasicTestMethods(Object...), Ljavadoc.methods.tags.BasicTestMethods;, ([Ljava.lang.Object;)V, BasicTestMethods, (o), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocPackageCompletionModelTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocPackageCompletionModelTest.java
deleted file mode 100644
index fcb1c0c..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocPackageCompletionModelTest.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-/**
- * Test class for completion in Javadoc comment of a package declaration.
- */
-public class JavadocPackageCompletionModelTest extends AbstractJavadocCompletionModelTest {
-
-public JavadocPackageCompletionModelTest(String name) {
- super(name);
-}
-
-static {
-// TESTS_RANGE = new int[] { 11, 12 };
-// TESTS_NUMBERS = new int[] { 16 };
-}
-public static Test suite() {
- return buildModelTestSuite(JavadocPackageCompletionModelTest.class);
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavadocCompletionModelTest#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
-}
-
-/*
- * Write files for self-hosting debug.
- */
-protected void writeFiles(String[] sources) {
-
- // Get write directory path
- if (WRITE_DIR_FILE == null) return;
-
- // Get test name
- String testName = getName();
- int idx = testName.indexOf(" - ");
- if (idx > 0) {
- testName = testName.substring(idx+3);
- }
-// testName = "Test"+testName.substring(4);
-
- // Write sources to dir
- int length = sources.length / 2;
- for (int i=0; i<length; i++) {
-
- // Get pathes
- IPath filePath = new Path(sources[2*i]).removeFirstSegments(2); // remove project and source folder
- IPath dirPath = filePath.removeLastSegments(1);
- String fileDir = dirPath.toString();
- String typeName = filePath.removeFileExtension().lastSegment();
- if (i==0 && !typeName.equals("package-info")) {
- System.err.println("Invalid type name: '"+typeName+"' for test "+testName);
- continue;
- }
-
- // Create package dirs or delete dirs if already exist
- File packageDir = new File(WRITE_DIR_FILE, fileDir);
- if (!PACKAGE_FILES.contains(packageDir)) {
- if (packageDir.exists()) {
- PACKAGE_FILES.add(packageDir);
- Util.flushDirectoryContent(packageDir);
- } else if (packageDir.mkdirs()) {
- PACKAGE_FILES.add(packageDir);
- } else {
- System.err.println(packageDir+" does not exist and CANNOT be created!!!");
- continue;
- }
- }
-
- // Create test dir
- File testDir = new File(packageDir, testName);
- if (!testDir.exists() && !testDir.mkdir()) {
- System.err.println(testDir+" does not exist and CANNOT be created!!!");
- continue;
- }
-
- // Store names info
- String fullPathName = testDir.getAbsolutePath()+"\\"+typeName+".js";
- System.out.println("Write file "+fullPathName);
- String contents = null;
- if (i==0) { // package-info
- contents = sources[2*i+1].substring(0, sources[2*i+1].lastIndexOf(';'));
- contents += "."+testName+";\n";
- } else {
- int index = sources[2*i+1].indexOf(';');
- contents = sources[2*i+1].substring(0, index);
- contents += "."+testName;
- contents += sources[2*i+1].substring(index);
- }
- Util.writeToFile(contents, fullPathName);
- }
-}
-
-/**
- * @category Tests for tag names completion
- */
-public void test001() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- "package javadoc;\n";
- completeInJavadoc("/Completion/src/javadoc/package-info.js", source, true, "@");
- assertResults(
- "author[JSDOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "version[JSDOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test002() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion on impossible tag name:\n" +
- " * @deprec\n" +
- " */\n" +
- "package javadoc;\n";
- completeInJavadoc("/Completion/src/javadoc/package-info.js", source, true, "@deprec");
- assertResults("");
-}
-
-public void test003() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion on one letter:\n" +
- " * @a\n" +
- " */\n" +
- "package javadoc;\n";
- completeInJavadoc("/Completion/src/javadoc/package-info.js", source, true, "@a");
- assertResults(
- "author[JSDOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test004() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion with several letters:\n" +
- " * @ser\n" +
- " */\n" +
- "package javadoc;\n";
- completeInJavadoc("/Completion/src/javadoc/package-info.js", source, true, "@ser");
- assertResults(
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test005() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion on full tag name:\n" +
- " * @since\n" +
- " */\n" +
- "package javadoc;\n";
- completeInJavadoc("/Completion/src/javadoc/package-info.js", source, true, "@since");
- assertResults(
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test006() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion on @ inside text\n" +
- " */\n" +
- "package javadoc;\n";
- completeInJavadoc("/Completion/src/javadoc/package-info.js", source, true, "@");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test007() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion on @d inside text\n" +
- " */\n" +
- "package javadoc;\n";
- completeInJavadoc("/Completion/src/javadoc/package-info.js", source, true, "@d");
- assertResults(
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @category Tests for types completion
- */
-public void test010() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see Obj\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "Obj");
- assertResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test011() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestRef\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "BasicTestRef");
- assertResults(
- "BasicTestReferences[TYPE_REF]{org.eclipse.wst.jsdt.core.tests.BasicTestReferences, org.eclipse.wst.jsdt.core.tests, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test012() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see org.eclipse.wst.jsdt.core.tests.BasicTestRef\n" +
- " * Note: JDT-UI failed on this one\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "org.eclipse.wst.jsdt.core.tests.BasicTestRef");
- assertResults(
- "BasicTestReferences[TYPE_REF]{org.eclipse.wst.jsdt.core.tests.BasicTestReferences, org.eclipse.wst.jsdt.core.tests, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test013() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.la\n" +
- " * Note: JDT-UI fails on this one\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "java.la");
- assertResults(
- "java.lang.annotation[PACKAGE_REF]{java.lang.annotation, java.lang.annotation, null, null, null, "+this.positions+R_DICQNR+"}\n" +
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test014() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see pack.Bin\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "pack.Bin");
- assertSortedResults(
- "Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test015() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see I\n" +
- " * Note: completion list shoud not include base types.\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "I");
- assertSortedResults(
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-/**
- * @category Tests for fields completion
- */
-public void test020() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestReferences#FIE\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "FIE");
- assertResults("");
-}
-
-public void test021() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see org.eclipse.wst.jsdt.core.tests.BasicTestReferences#FIE\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "FIE");
- assertResults(
- "FIELD[FIELD_REF]{FIELD, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, I, FIELD, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test022() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/tags/package-info.js",
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#bar\n" +
- " */\n" +
- "package javadoc.tags;\n",
- "/Completion/src/javadoc/tags/OtherTypes.js",
- "package javadoc.tags;\n" +
- "public class OtherTypes {\n" +
- " int bar;\n" +
- "}"
- };
- completeInJavadoc(sources, true, "bar");
- assertResults(
- "bar[FIELD_REF]{bar, Ljavadoc.tags.OtherTypes;, I, bar, null, "+this.positions+R_DICENNRNS+"}"
- );
-}
-
-public void test023() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestReferences#\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "#", 0); // empty token
- assertResults("");
-}
-
-public void test024() throws JavaScriptModelException {
- String source =
- "/**\n" +
- " * Completion after:\n" +
- " * @see org.eclipse.wst.jsdt.core.tests.BasicTestReferences#\n" +
- " */\n" +
- "package javadoc.tags;\n";
- completeInJavadoc("/Completion/src/javadoc/tags/package-info.js", source, true, "#", 0); // empty token
- assertResults(
- "FIELD[FIELD_REF]{FIELD, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, I, FIELD, null, "+this.positions+R_DICNR+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestReferences[FUNCTION_REF<CONSTRUCTOR>]{BasicTestReferences(), Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, ()V, BasicTestReferences, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test025() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/tags/package-info.js",
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#\n" +
- " */\n" +
- "package javadoc.tags;\n",
- "/Completion/src/javadoc/tags/OtherTypes.js",
- "package javadoc.tags;\n" +
- "public class OtherTypes {\n" +
- " int foo;\n" +
- " Object obj;\n" +
- "}"
- };
- completeInJavadoc(sources, true, "#", 0); // empty token
- assertResults(
- "obj[FIELD_REF]{obj, Ljavadoc.tags.OtherTypes;, Ljava.lang.Object;, obj, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FIELD_REF]{foo, Ljavadoc.tags.OtherTypes;, I, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(), Ljavadoc.tags.OtherTypes;, ()V, OtherTypes, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @category Tests for methods completion
- */
-public void test030() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/tags/package-info.js",
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#meth\n" +
- " */\n" +
- "package javadoc.tags;",
- "/Completion/src/javadoc/tags/OtherTypes.js",
- "package javadoc.tags;\n" +
- "public class OtherTypes {\n" +
- " void method() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "meth");
- assertResults(
- "method[FUNCTION_REF]{method(), Ljavadoc.tags.OtherTypes;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-public void test031() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/tags/package-info.js",
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#\n" +
- " */\n" +
- "package javadoc.tags;",
- "/Completion/src/javadoc/tags/OtherTypes.js",
- "package javadoc.tags;\n" +
- "public class OtherTypes {\n" +
- " void method() {};\n" +
- " void foo() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "#", 0); // empty token
- assertResults(
- "method[FUNCTION_REF]{method(), Ljavadoc.tags.OtherTypes;, ()V, method, null, "+this.positions+R_DICNRNS+"}\n" +
- "foo[FUNCTION_REF]{foo(), Ljavadoc.tags.OtherTypes;, ()V, foo, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(), Ljavadoc.tags.OtherTypes;, ()V, OtherTypes, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @category Tests for constructors completion
- */
-public void test040() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/tags/package-info.js",
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#O\n" +
- " */\n" +
- "package javadoc.tags;\n",
- "/Completion/src/javadoc/tags/OtherTypes.js",
- "package javadoc.tags;\n" +
- "public class OtherTypes {\n" +
- " void method() {};\n" +
- " void foo() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "O", 2); // 2nd occurence
- assertResults(
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(), Ljavadoc.tags.OtherTypes;, ()V, OtherTypes, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-public void test041() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/tags/package-info.js",
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#O\n" +
- " */\n" +
- "package javadoc.tags;\n",
- "/Completion/src/javadoc/tags/OtherTypes.js",
- "package javadoc.tags;\n" +
- "public class OtherTypes {\n" +
- " OtherTypes(int x) {};\n" +
- " OtherTypes(Object obj, String str) {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "O", 2); // 2nd occurence
- assertResults(
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(Object, String), Ljavadoc.tags.OtherTypes;, (Ljava.lang.Object;Ljava.lang.String;)V, OtherTypes, (obj, str), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(int), Ljavadoc.tags.OtherTypes;, (I)V, OtherTypes, (x), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocTextCompletionModelTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocTextCompletionModelTest.java
deleted file mode 100644
index 229f3a0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocTextCompletionModelTest.java
+++ /dev/null
@@ -1,1240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-/**
- * Test class for completion in text of a Javadoc comment.
- */
-public class JavadocTextCompletionModelTest extends AbstractJavadocCompletionModelTest {
-
-public JavadocTextCompletionModelTest(String name) {
- super(name);
-}
-
-static {
-// TESTS_NUMBERS = new int[] { 34 };
-// TESTS_RANGE = new int[] { 51, -1 };
-}
-public static Test suite() {
- return buildModelTestSuite(JavadocTextCompletionModelTest.class);
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavadocCompletionModelTest#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- setUpProjectOptions(CompilerOptions.VERSION_1_4);
-}
-
-/**
- * @tests Tests for tag names completion
- */
-public void test001() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion on @ inside text\n" +
- " */\n" +
- "public class BasicTestTextIns {}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test002() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion on @s inside text\n" +
- " */\n" +
- "public class BasicTestTextIns {}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@s");
- assertResults("");
-}
-
-public void test003() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_4);
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion on @ inside text\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test004() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_4);
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion on @d inside text\n" +
- " */\n" +
- " int field;\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@d");
- assertResults(
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test005() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion on empty tag name: @\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test006() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion on impossible tag name: @ret\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@ret");
- assertResults("");
-}
-
-public void test007() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion on one letter: @l\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@l");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test008() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion on started inline tag: {@li\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "{@li");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test009() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion with several letters:\n" +
- " * @param str @inh\n" +
- " */\n" +
- " public void foo(String str) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "@inh");
- assertResults(
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test010() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion with several letters:\n" +
- " * @param str {@inh\n" +
- " */\n" +
- " public void foo(String str) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "{@inh");
- assertResults(
- "inheritDoc[JSDOC_INLINE_TAG]{{@inheritDoc}, null, null, inheritDoc, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test011() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion on full tag name: {@docRoot}\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "{@docRoot");
- assertResults(
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @tests Tests for types completion
- */
-public void test020() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion after: BasicTestTextIns\n" +
- " */\n" +
- "public class BasicTestTextIns {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_TYPE_REF]{{@link BasicTestTextIns}, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNRIT+"}\n" +
- "BasicTestTextIns[TYPE_REF]{BasicTestTextIns, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test021() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion after: {@link BasicTestTextIns\n" +
- " */\n" +
- "public class BasicTestTextIns {\n" +
- "}\n" +
- "class BasicTestTextInsException extends Exception{\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns");
- assertSortedResults(
- "BasicTestTextIns[TYPE_REF]{BasicTestTextIns, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNR+"}\n" +
- "BasicTestTextInsException[TYPE_REF]{BasicTestTextInsException, javadoc.text, Ljavadoc.text.BasicTestTextInsException;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test022() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion after: @link BasicTestTextIns\n" +
- " */\n" +
- "public class BasicTestTextIns {\n" +
- " public void foo() throws BasicTestTextInsException {}\n" +
- "}\n" +
- "class BasicTestTextInsException extends Exception{\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_TYPE_REF]{{@link BasicTestTextIns}, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+(R_DICENUNR+R_INLINE_TAG)+"}\n" +
- "BasicTestTextInsException[JSDOC_TYPE_REF]{{@link BasicTestTextInsException}, javadoc.text, Ljavadoc.text.BasicTestTextInsException;, null, null, "+this.positions+R_DICUNRIT+"}\n" +
- "BasicTestTextIns[TYPE_REF]{BasicTestTextIns, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNR+"}\n" +
- "BasicTestTextInsException[TYPE_REF]{BasicTestTextInsException, javadoc.text, Ljavadoc.text.BasicTestTextInsException;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test023() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: @link BasicTestTextIns\n" +
- " */\n" +
- " public void foo() throws BasicTestTextInsException {}\n" +
- "}\n" +
- "class BasicTestTextInsException extends Exception{\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns", 2); // 2nd occurrence
- assertSortedResults(
- "BasicTestTextInsException[JSDOC_TYPE_REF]{{@link BasicTestTextInsException}, javadoc.text, Ljavadoc.text.BasicTestTextInsException;, null, null, "+this.positions+R_DICUNREETIT+"}\n" +
- "BasicTestTextIns[JSDOC_TYPE_REF]{{@link BasicTestTextIns}, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNRIT+"}\n" +
- "BasicTestTextInsException[TYPE_REF]{BasicTestTextInsException, javadoc.text, Ljavadoc.text.BasicTestTextInsException;, null, null, "+this.positions+R_DICUNREET+"}\n" +
- "BasicTestTextIns[TYPE_REF]{BasicTestTextIns, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test024() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion after: @see BasicTestTextIns\n" +
- " */\n" +
- "public class BasicTestTextIns {\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_TYPE_REF]{{@link BasicTestTextIns}, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNRIT+"}\n" +
- "BasicTestTextIns[TYPE_REF]{BasicTestTextIns, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test025() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: @see BasicTestTextIns\n" +
- " */\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns", 2); // 2nd occurrence
- assertSortedResults(
- "BasicTestTextIns[JSDOC_TYPE_REF]{{@link BasicTestTextIns}, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNRIT+"}\n" +
- "BasicTestTextIns[TYPE_REF]{BasicTestTextIns, javadoc.text, Ljavadoc.text.BasicTestTextIns;, null, null, "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test026() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion after: java.la\n" +
- " */\n" +
- "public class BasicTestTextIns {\n" +
- " public void foo() throws InterruptedException {\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "java.la");
- assertSortedResults(
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test027() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "/**\n" +
- " * Completion after: java.lang.I\n" +
- " */\n" +
- "public class BasicTestTextIns {\n" +
- " public void foo() throws InterruptedException {\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "java.lang.I");
- assertSortedResults(
- "IllegalMonitorStateException[JSDOC_TYPE_REF]{{@link IllegalMonitorStateException}, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNRIT+"}\n" +
- "InterruptedException[JSDOC_TYPE_REF]{{@link InterruptedException}, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNRIT+"}\n" +
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test028() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: java.lang.I\n" +
- " */\n" +
- " public void foo() throws InterruptedException {\n" +
- " }\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "java.lang.I");
- assertSortedResults(
- "InterruptedException[JSDOC_TYPE_REF]{{@link InterruptedException}, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNREETIT+"}\n" +
- "IllegalMonitorStateException[JSDOC_TYPE_REF]{{@link IllegalMonitorStateException}, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNRIT+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNREET+"}\n" +
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/**
- * @tests Tests for fields completion
- */
-public void test030() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #fo\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#fo");
- assertSortedResults(
- "foo[JSDOC_FIELD_REF]{{@link #foo}, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test031() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: BasicTestTextIns#fo\n" +
- " */\n" +
- " static int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns#fo");
- assertSortedResults(
- "foo[JSDOC_FIELD_REF]{{@link BasicTestTextIns#foo}, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRIT+"}\n" +
- "foo[JSDOC_VALUE_REF]{{@value BasicTestTextIns#foo}, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRIT+"}"
- );
-}
-
-public void test032() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: javadoc.text.BasicTestTextIns#fo\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "javadoc.text.BasicTestTextIns#fo");
- assertSortedResults(
- "foo[JSDOC_FIELD_REF]{{@link javadoc.text.BasicTestTextIns#foo}, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test033() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/text/BasicTestTextIns.js",
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: OtherFields#fo\n" +
- " */\n" +
- " int foo;\n" +
- "}",
- "/Completion/src/javadoc/text/OtherFields.js",
- "package javadoc.text;\n" +
- "public class OtherFields {\n" +
- " static int foo;\n" +
- "}"
- };
- completeInJavadoc(sources, true, "OtherFields#fo");
- assertSortedResults(
- "foo[JSDOC_FIELD_REF]{{@link OtherFields#foo}, Ljavadoc.text.OtherFields;, I, foo, null, "+this.positions+R_DICNRIT+"}\n" +
- "foo[JSDOC_VALUE_REF]{{@value OtherFields#foo}, Ljavadoc.text.OtherFields;, I, foo, null, "+this.positions+R_DICNRIT+"}"
- );
-}
-
-public void test034() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@value #fo\n" +
- " * Note: this test must be run with 1.4 compliance\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "fo");
- assertSortedResults(
- "foo[FIELD_REF]{foo, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test035() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@value #fo\n" +
- " * Note: this test must be run with 1.5 compliance\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "fo");
- assertSortedResults(
- "foo[FIELD_REF]{foo, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test036() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link BasicTestTextIns#fo\n" +
- " */\n" +
- " static int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "fo");
- assertSortedResults(
- "foo[FIELD_REF]{foo, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test037() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link javadoc.text.BasicTestTextIns#fo }\n" +
- " */\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "fo");
- assertSortedResults(
- "foo[FIELD_REF]{foo, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test038() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String[] sources = {
- "/Completion/src/javadoc/text/BasicTestTextIns.js",
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@value OtherFields#fo\n" +
- " * Note: this test must be run with 1.5 compliance\n" +
- " */\n" +
- " int foo;\n" +
- "}",
- "/Completion/src/javadoc/text/OtherFields.js",
- "package javadoc.text;\n" +
- "public class OtherFields {\n" +
- " static int foo;\n" +
- "}"
- };
- completeInJavadoc(sources, true, "fo");
- assertSortedResults(
- "foo[FIELD_REF]{foo, Ljavadoc.text.OtherFields;, I, foo, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/**
- * @tests Tests for methods completion
- */
-public void test040() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: meth\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "meth");
- assertSortedResults("");
-}
-
-public void test041() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #meth\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#meth");
- assertSortedResults(
- "method[JSDOC_METHOD_REF]{{@link #method()}, Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test042() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #meth with text after\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#meth");
- assertSortedResults(
- "method[JSDOC_METHOD_REF]{{@link #method()}, Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test043() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #method\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#meth");
- assertSortedResults(
- "method[JSDOC_METHOD_REF]{{@link #method()}, Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test044() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: BasicTestTextIns#param\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns#param");
- assertSortedResults(
- "paramMethod[JSDOC_METHOD_REF]{{@link BasicTestTextIns#paramMethod(String, boolean, Object)}, Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test045() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: javadoc.text.BasicTestTextIns#meth\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "javadoc.text.BasicTestTextIns#meth");
- assertSortedResults(
- "method[JSDOC_METHOD_REF]{{@link javadoc.text.BasicTestTextIns#method()}, Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test046() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: {@link #param\n" +
- " */\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "param");
- assertSortedResults(
- "paramMethod[FUNCTION_REF]{paramMethod(String, boolean, Object), Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test047() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link BasicTestTextIns#meth\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "meth");
- assertSortedResults(
- "method[FUNCTION_REF]{method(), Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test048() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: {@link javadoc.text.BasicTestTextIns#param }\n" +
- " */\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "param");
- assertSortedResults(
- "paramMethod[FUNCTION_REF]{paramMethod(String, boolean, Object), Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test049() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/text/BasicTestTextIns.js",
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: OtherTypes#meth\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/text/OtherTypes.js",
- "package javadoc.text;\n" +
- "public class OtherTypes {\n" +
- " void method() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "OtherTypes#meth");
- assertSortedResults(
- "method[JSDOC_METHOD_REF]{{@link OtherTypes#method()}, Ljavadoc.text.OtherTypes;, ()V, method, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-
-public void test050() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/text/BasicTestTextIns.js",
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link OtherTypes#method }\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/text/OtherTypes.js",
- "package javadoc.text;\n" +
- "public class OtherTypes {\n" +
- " void method() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "meth");
- assertSortedResults(
- "method[FUNCTION_REF]{method(), Ljavadoc.text.OtherTypes;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test051() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#");
- assertSortedResults(
- "clone[JSDOC_METHOD_REF]{{@link #clone()}, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "equals[JSDOC_METHOD_REF]{{@link #equals(Object)}, Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "finalize[JSDOC_METHOD_REF]{{@link #finalize()}, Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "getClass[JSDOC_METHOD_REF]{{@link #getClass()}, Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "hashCode[JSDOC_METHOD_REF]{{@link #hashCode()}, Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "method[JSDOC_METHOD_REF]{{@link #method()}, Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notify[JSDOC_METHOD_REF]{{@link #notify()}, Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notifyAll[JSDOC_METHOD_REF]{{@link #notifyAll()}, Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "paramMethod[JSDOC_METHOD_REF]{{@link #paramMethod(String, boolean, Object)}, Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICNRNSIT+"}\n" +
- "toString[JSDOC_METHOD_REF]{{@link #toString()}, Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long, int)}, Ljava.lang.Object;, (JI)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long)}, Ljava.lang.Object;, (J)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait()}, Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns()}, Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+(JAVADOC_RELEVANCE+R_INLINE_TAG)+"}"
- );
-}
-
-public void test052() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #method\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#");
- assertSortedResults(
- "clone[JSDOC_METHOD_REF]{{@link #clone()}, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "equals[JSDOC_METHOD_REF]{{@link #equals(Object)}, Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "finalize[JSDOC_METHOD_REF]{{@link #finalize()}, Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "getClass[JSDOC_METHOD_REF]{{@link #getClass()}, Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "hashCode[JSDOC_METHOD_REF]{{@link #hashCode()}, Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "method[JSDOC_METHOD_REF]{{@link #method()}, Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notify[JSDOC_METHOD_REF]{{@link #notify()}, Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notifyAll[JSDOC_METHOD_REF]{{@link #notifyAll()}, Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "paramMethod[JSDOC_METHOD_REF]{{@link #paramMethod(String, boolean, Object)}, Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICNRNSIT+"}\n" +
- "toString[JSDOC_METHOD_REF]{{@link #toString()}, Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long, int)}, Ljava.lang.Object;, (JI)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long)}, Ljava.lang.Object;, (J)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait()}, Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns()}, Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+(JAVADOC_RELEVANCE+R_INLINE_TAG)+"}"
- );
-}
-
-public void test053() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link BasicTestTextIns#\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#", 0); //empty token
- assertSortedResults(
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "method[FUNCTION_REF]{method(), Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "paramMethod[FUNCTION_REF]{paramMethod(String, boolean, Object), Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(), Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test054() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link javadoc.text.BasicTestTextIns# }\n" +
- " */\n" +
- " void method() {}\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#", 0); //empty token
- assertSortedResults(
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "method[FUNCTION_REF]{method(), Ljavadoc.text.BasicTestTextIns;, ()V, method, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "paramMethod[FUNCTION_REF]{paramMethod(String, boolean, Object), Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(), Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test055() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: #paramMethod(\n" +
- " */\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#paramMethod(");
- assertSortedResults(
- "paramMethod[JSDOC_METHOD_REF]{{@link #paramMethod(String, boolean, Object)}, Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICENUNRIT+"}"
- );
-}
-
-public void test056() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: {@link #paramMethod(Str\n" +
- " */\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "Str");
- assertSortedResults(
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test057() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: {@link #paramMethod(String s\n" +
- " */\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "paramMethod(String s");
- assertSortedResults(
- "paramMethod[FUNCTION_REF]{paramMethod(String, boolean, Object), Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-public void test058() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: #paramMethod(String str, \n" +
- " */\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#paramMethod(String str,");
- assertSortedResults(
- "paramMethod[JSDOC_METHOD_REF]{{@link #paramMethod(String, boolean, Object)}, Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICENUNRIT+"}"
- );
-}
-
-public void test059() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: {@link #paramMethod(String,\n" +
- " */\n" +
- " void paramMethod(String str, boolean flag, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "paramMethod(String,");
- assertSortedResults(
- "paramMethod[FUNCTION_REF]{paramMethod(String, boolean, Object), Ljavadoc.text.BasicTestTextIns;, (Ljava.lang.String;ZLjava.lang.Object;)V, paramMethod, (str, flag, obj), "+this.positions+R_DICENUNR+"}"
- );
-}
-
-/**
- * @tests Tests for constructors completion
- */
-public void test070() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #BasicTest\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#BasicTest");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns()}, Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test071() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link BasicTestTextIns#BasicTest\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTest", 3); // 3rd occurence
- assertSortedResults(
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(int, float, Class), Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(), Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test072() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@linkplain javadoc.text.BasicTestTextIns#BasicTest }\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTest", 3); // 3rd occurence
- assertSortedResults(
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(int, float, Class), Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(), Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test073() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/text/BasicTestTextIns.js",
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: OtherTypes#Other\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/text/OtherTypes.js",
- "package javadoc.text;\n" +
- "public class OtherTypes {\n" +
- " OtherTypes() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "OtherTypes#O");
- assertSortedResults(
- "OtherTypes[JSDOC_METHOD_REF]{{@link OtherTypes#OtherTypes()}, Ljavadoc.text.OtherTypes;, ()V, OtherTypes, null, "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test074() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/text/BasicTestTextIns.js",
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link OtherTypes#O implicit default constructor\n" +
- " */\n" +
- " void foo() {};\n" +
- "}",
- "/Completion/src/javadoc/text/OtherTypes.js",
- "package javadoc.text;\n" +
- "public class OtherTypes {\n" +
- "}"
- };
- completeInJavadoc(sources, true, "O", 2); // 2nd occurence
- assertSortedResults(
- "OtherTypes[FUNCTION_REF<CONSTRUCTOR>]{OtherTypes(), Ljavadoc.text.OtherTypes;, ()V, OtherTypes, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test075() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#");
- assertSortedResults(
- "clone[JSDOC_METHOD_REF]{{@link #clone()}, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "equals[JSDOC_METHOD_REF]{{@link #equals(Object)}, Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "finalize[JSDOC_METHOD_REF]{{@link #finalize()}, Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "getClass[JSDOC_METHOD_REF]{{@link #getClass()}, Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "hashCode[JSDOC_METHOD_REF]{{@link #hashCode()}, Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notify[JSDOC_METHOD_REF]{{@link #notify()}, Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notifyAll[JSDOC_METHOD_REF]{{@link #notifyAll()}, Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "toString[JSDOC_METHOD_REF]{{@link #toString()}, Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long, int)}, Ljava.lang.Object;, (JI)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long)}, Ljava.lang.Object;, (J)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait()}, Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns()}, Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test076() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: #blabla\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#");
- assertSortedResults(
- "clone[JSDOC_METHOD_REF]{{@link #clone()}, Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "equals[JSDOC_METHOD_REF]{{@link #equals(Object)}, Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "finalize[JSDOC_METHOD_REF]{{@link #finalize()}, Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "getClass[JSDOC_METHOD_REF]{{@link #getClass()}, Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "hashCode[JSDOC_METHOD_REF]{{@link #hashCode()}, Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notify[JSDOC_METHOD_REF]{{@link #notify()}, Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "notifyAll[JSDOC_METHOD_REF]{{@link #notifyAll()}, Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "toString[JSDOC_METHOD_REF]{{@link #toString()}, Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long, int)}, Ljava.lang.Object;, (JI)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait(long)}, Ljava.lang.Object;, (J)V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "wait[JSDOC_METHOD_REF]{{@link #wait()}, Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNSIT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns()}, Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test077() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after: {@link # }\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#", 0); // empty token
- assertSortedResults(
- "clone[FUNCTION_REF]{clone(), Ljava.lang.Object;, ()Ljava.lang.Object;, clone, null, "+this.positions+R_DICNRNS+"}\n" +
- "equals[FUNCTION_REF]{equals(Object), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), "+this.positions+R_DICNRNS+"}\n" +
- "finalize[FUNCTION_REF]{finalize(), Ljava.lang.Object;, ()V, finalize, null, "+this.positions+R_DICNRNS+"}\n" +
- "getClass[FUNCTION_REF]{getClass(), Ljava.lang.Object;, ()Ljava.lang.Class;, getClass, null, "+this.positions+R_DICNRNS+"}\n" +
- "hashCode[FUNCTION_REF]{hashCode(), Ljava.lang.Object;, ()I, hashCode, null, "+this.positions+R_DICNRNS+"}\n" +
- "notify[FUNCTION_REF]{notify(), Ljava.lang.Object;, ()V, notify, null, "+this.positions+R_DICNRNS+"}\n" +
- "notifyAll[FUNCTION_REF]{notifyAll(), Ljava.lang.Object;, ()V, notifyAll, null, "+this.positions+R_DICNRNS+"}\n" +
- "toString[FUNCTION_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long, int), Ljava.lang.Object;, (JI)V, wait, (millis, nanos), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(long), Ljava.lang.Object;, (J)V, wait, (millis), "+this.positions+R_DICNRNS+"}\n" +
- "wait[FUNCTION_REF]{wait(), Ljava.lang.Object;, ()V, wait, null, "+this.positions+R_DICNRNS+"}\n" +
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(int, float, Class), Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(), Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test078() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: {@link #BasicTestTextIns(\n" +
- " */\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns(");
- assertSortedResults(
- "BasicTestTextIns[FUNCTION_REF<CONSTRUCTOR>]{BasicTestTextIns(int, float, Class), Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test079() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: BasicTestTextIns#BasicTestTextIns(int,\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns#BasicTestTextIns(int,");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link BasicTestTextIns#BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test080() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after: BasicTestTextIns#BasicTestTextIns(int,\n" +
- " * Note: completion takes place just after opening brace\n" +
- " */\n" +
- " BasicTestTextIns() {}\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "BasicTestTextIns#BasicTestTextIns(");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link BasicTestTextIns#BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}\n" +
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link BasicTestTextIns#BasicTestTextIns()}, Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test081() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * javadoc.text.BasicTestTextIns#BasicTestTextIns(\n" +
- " */\n" +
- " void method() {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "javadoc.text.BasicTestTextIns#BasicTestTextIns(");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link javadoc.text.BasicTestTextIns#BasicTestTextIns()}, Ljavadoc.text.BasicTestTextIns;, ()V, BasicTestTextIns, null, "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test082() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * #BasicTestTextIns(int, float, java.lang.\n" +
- " */\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#BasicTestTextIns(int, float, java.lang.");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test083() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * #BasicTestTextIns(int, float, java.lang.Cla\n" +
- " */\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#BasicTestTextIns(int, float, java.lang.Cla");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test084() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * #BasicTestTextIns(int, float, Class)\n" +
- " * Note: completion takes place before closing parenthesis\n" +
- " */\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#BasicTestTextIns(int, float, Class");
- assertSortedResults(
- "BasicTestTextIns[JSDOC_METHOD_REF]{{@link #BasicTestTextIns(int, float, Class)}, Ljavadoc.text.BasicTestTextIns;, (IFLjava.lang.Class;)V, BasicTestTextIns, (xxx, real, clazz), "+this.positions+JAVADOC_RELEVANCE_IT+"}"
- );
-}
-
-public void test085() throws JavaScriptModelException {
- String source =
- "package javadoc.text;\n" +
- "public class BasicTestTextIns {\n" +
- " void method() {}\n" +
- " /**\n" +
- " * Completion after:\n" +
- " * #BasicTestTextIns(int, float, Class)\n" +
- " * Note: completion takes place after closing parenthesis\n" +
- " */\n" +
- " BasicTestTextIns(int xxx, float real, Class clazz) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.js", source, true, "#BasicTestTextIns(int, float, Class)");
- assertSortedResults("");
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocTypeCompletionModelTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocTypeCompletionModelTest.java
deleted file mode 100644
index a0b68f0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavadocTypeCompletionModelTest.java
+++ /dev/null
@@ -1,1343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Hashtable;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.CompletionProposal;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-
-/**
- * Test class for completion in Javadoc comment of a type declaration.
- */
-public class JavadocTypeCompletionModelTest extends AbstractJavadocCompletionModelTest {
-
-public JavadocTypeCompletionModelTest(String name) {
- super(name);
-}
-
-static {
-// TESTS_RANGE = new int[] { 22, -1 };
-// TESTS_NUMBERS = new int[] { 20 };
-}
-public static Test suite() {
- return buildModelTestSuite(JavadocTypeCompletionModelTest.class);
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.tests.model.AbstractJavadocCompletionModelTest#setUp()
- */
-protected void setUp() throws Exception {
- super.setUp();
- setUpProjectOptions(CompilerOptions.VERSION_1_4);
-}
-
-/**
- * @category Tests for tag names completion
- */
-public void test001() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- "public class Test {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@");
- assertResults(
- "author[JSDOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "version[JSDOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test002() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion on impossible tag name:\n" +
- " * @par\n" +
- " */\n" +
- "public class Test {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@par");
- assertResults("");
-}
-
-public void test003() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion on one letter:\n" +
- " * @v\n" +
- " */\n" +
- "public class Test {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@v");
- assertResults(
- "version[JSDOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test004() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion with several letters:\n" +
- " * @deprec\n" +
- " */\n" +
- "public class Test {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@deprec");
- assertResults(
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test005() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion on full tag name:\n" +
- " * @link\n" +
- " */\n" +
- "public class Test {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@link");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test006() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion on full tag name:\n" +
- " * @link\n" +
- " */\n" +
- "public class Test {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@li");
- assertResults(
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test007() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_3);
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- "// Note: this test should be done using compliance 1.3\n" +
- "public class Test {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@");
- assertResults(
- "author[JSDOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "version[JSDOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test008() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion on empty tag name:\n" +
- " * @\n" +
- " */\n" +
- "// Note: this test should be done using compliance 1.5\n" +
- "public class Test<T> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/Test.js", source, true, "@");
- assertResults(
- "author[JSDOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "deprecated[JSDOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "param[JSDOC_BLOCK_TAG]{@param, null, null, param, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "see[JSDOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "version[JSDOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "category[JSDOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "since[JSDOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "serial[JSDOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "link[JSDOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "docRoot[JSDOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "linkplain[JSDOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "value[JSDOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "code[JSDOC_INLINE_TAG]{{@code}, null, null, code, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" +
- "literal[JSDOC_INLINE_TAG]{{@literal}, null, null, literal, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-/**
- * @category Tests for types completion
- */
-public void test010() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see Obj\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "Obj");
- assertResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test011() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTest\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTest");
- assertResults(
- "BasicTestTypes[TYPE_REF]{BasicTestTypes, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestReferences[TYPE_REF]{org.eclipse.wst.jsdt.core.tests.BasicTestReferences, org.eclipse.wst.jsdt.core.tests, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test012() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestTypes\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTest");
- assertResults(
- "BasicTestTypes[TYPE_REF]{BasicTestTypes, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestReferences[TYPE_REF]{org.eclipse.wst.jsdt.core.tests.BasicTestReferences, org.eclipse.wst.jsdt.core.tests, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test013() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTest\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTest");
- assertResults(
- "BasicTestTypes<TPARAM>[TYPE_REF]{BasicTestTypes, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes<TTPARAM;>;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "BasicTestReferences[TYPE_REF]{org.eclipse.wst.jsdt.core.tests.BasicTestReferences, org.eclipse.wst.jsdt.core.tests, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test014() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see javadoc.types.tags.BasicTest\n" +
- " * Note: JDT-UI failed on this one\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "javadoc.types.tags.BasicTest");
- assertResults(
- "BasicTestTypes[TYPE_REF]{BasicTestTypes, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test015() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see javadoc.types.tags.BasicTest\n" +
- " * Note: JDT-UI failed on this one\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "javadoc.types.tags.BasicTest");
- assertResults(
- "BasicTestTypes<TPARAM>[TYPE_REF]{BasicTestTypes, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes<TTPARAM;>;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test016() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.la\n" +
- " * Note: JDT-UI fails on this one\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "java.la");
- assertResults(
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test017() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.lang\n" +
- " * Note: JDT-UI fails on this one\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "java.la");
- assertResults(
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test018() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see pack.Bin\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "pack.Bin");
- assertSortedResults(
- "Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test019() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see pack.Bin2\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "pack.Bin");
- assertSortedResults(
- "Bin1[TYPE_REF]{pack.Bin1, pack, Lpack.Bin1;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DICQNR+"}\n" +
- "Bin3[TYPE_REF]{pack.Bin3, pack, Lpack.Bin3;, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test020() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see pack.Bin2\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "pack.Bin2");
- assertSortedResults(
- "Bin2[TYPE_REF]{pack.Bin2, pack, Lpack.Bin2;, null, null, "+this.positions+R_DICENQNR+"}"
- );
-}
-
-public void test021() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see I\n" +
- " * Note: completion list shoud not include base types.\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "I");
- assertSortedResults(
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test022() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.lang.\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "java.lang.");
- assertSortedResults(
- "java.lang.annotation[PACKAGE_REF]{java.lang.annotation, java.lang.annotation, null, null, null, "+this.positions+R_DICQNR+"}\n" +
- "CharSequence[TYPE_REF]{CharSequence, java.lang, Ljava.lang.CharSequence;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICNR+"}\n" +
- "CloneNotSupportedException[TYPE_REF]{CloneNotSupportedException, java.lang, Ljava.lang.CloneNotSupportedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Comparable[TYPE_REF]{Comparable, java.lang, Ljava.lang.Comparable;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Enum[TYPE_REF]{Enum, java.lang, Ljava.lang.Enum;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Error[TYPE_REF]{Error, java.lang, Ljava.lang.Error;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Exception[TYPE_REF]{Exception, java.lang, Ljava.lang.Exception;, null, null, "+this.positions+R_DICNR+"}\n" +
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICNR+"}\n" +
- "RuntimeException[TYPE_REF]{RuntimeException, java.lang, Ljava.lang.RuntimeException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Throwable[TYPE_REF]{Throwable, java.lang, Ljava.lang.Throwable;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test023() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "java.");
- assertResults(
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, "+this.positions+R_DICQNR+"}\n" +
- "java.io[PACKAGE_REF]{java.io, java.io, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test024() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.lang\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "java.");
- assertResults(
- "java.lang.annotation[PACKAGE_REF]{java.lang.annotation, java.lang.annotation, null, null, null, "+this.positions+R_DICQNR+"}\n" +
- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, "+this.positions+R_DICQNR+"}\n" +
- "java.io[PACKAGE_REF]{java.io, java.io, null, null, null, "+this.positions+R_DICQNR+"}"
- );
-}
-
-public void test025() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.lang.Obj\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "java.lang.");
- assertSortedResults(
- "Class[TYPE_REF]{Class, java.lang, Ljava.lang.Class;, null, null, "+this.positions+R_DICNR+"}\n" +
- "CloneNotSupportedException[TYPE_REF]{CloneNotSupportedException, java.lang, Ljava.lang.CloneNotSupportedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Error[TYPE_REF]{Error, java.lang, Ljava.lang.Error;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Exception[TYPE_REF]{Exception, java.lang, Ljava.lang.Exception;, null, null, "+this.positions+R_DICNR+"}\n" +
- "IllegalMonitorStateException[TYPE_REF]{IllegalMonitorStateException, java.lang, Ljava.lang.IllegalMonitorStateException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "InterruptedException[TYPE_REF]{InterruptedException, java.lang, Ljava.lang.InterruptedException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICNR+"}\n" +
- "RuntimeException[TYPE_REF]{RuntimeException, java.lang, Ljava.lang.RuntimeException;, null, null, "+this.positions+R_DICNR+"}\n" +
- "String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, "+this.positions+R_DICNR+"}\n" +
- "Throwable[TYPE_REF]{Throwable, java.lang, Ljava.lang.Throwable;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test026() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see java.lang.Objec\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "java.lang.Ob");
- assertResults(
- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-/**
- * @category Tests for member types completion
- */
-public void test030() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestTypesM\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " class BasicTestTypesMember {}\n" +
- "}\n" +
- "class BasicTestTypesTestSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTestTypesM");
- assertResults(
- "BasicTestTypes.BasicTestTypesMember[TYPE_REF]{BasicTestTypesMember, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes$BasicTestTypesMember;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test031() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestTypesMember\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " class BasicTestTypesMember {}\n" +
- "}\n" +
- "class BasicTestTypesSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTestTypesM");
- assertResults(
- "BasicTestTypes.BasicTestTypesMember[TYPE_REF]{BasicTestTypesMember, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes$BasicTestTypesMember;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test032() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestTypes.BasicTestTypesM\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " class BasicTestTypesMember {}\n" +
- "}\n" +
- "class BasicTestTypesSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTestTypesM");
- assertResults(
- "BasicTestTypes.BasicTestTypesMember[TYPE_REF]{BasicTestTypesMember, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes$BasicTestTypesMember;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test033() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see javadoc.types.tags.BasicTestTypes.BasicTestTypesM\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " class BasicTestTypesMember {}\n" +
- "}\n" +
- "class BasicTestTypesSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTestTypesM");
- assertResults(
- "BasicTestTypes.BasicTestTypesMember[TYPE_REF]{BasicTestTypesMember, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes$BasicTestTypesMember;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test034() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestTypesS\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n" +
- "class BasicTestTypesSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BasicTestTypesS");
- assertResults(
- "BasicTestTypesSecondary[TYPE_REF]{BasicTestTypesSecondary, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypesSecondary;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-
-public void test035() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see javadoc.types.tags.BasicTestTypesS\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n" +
- "class BasicTestTypesSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "javadoc.types.tags.BasicTestTypesS");
- assertResults(
- "BasicTestTypesSecondary[TYPE_REF]{BasicTestTypesSecondary, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypesSecondary;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test036() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see javadoc.types.tags.BasicTestTypesSecondary\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n" +
- "class BasicTestTypesSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "javadoc.types.tags.BasicTestTypesS");
- assertResults(
- "BasicTestTypesSecondary[TYPE_REF]{BasicTestTypesSecondary, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypesSecondary;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test037() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see javadoc.types.tags.BasicTestTypes.BasicTestTypes\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}\n" +
- "class BasicTestTypesSecondary {}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "javadoc.types.tags.BasicTestTypes.BasicTestTypes");
- assertResults("");
-}
-
-
-/**
- * @category Tests for fields completion
- */
-public void test040() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestReferences#FIE\n" +
- " * Note: JDT/UI create one proposal on this one\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "FIE");
- assertResults("");
-}
-
-public void test041() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see org.eclipse.wst.jsdt.core.tests.BasicTestReferences#FIE\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "FIE");
- assertResults(
- "FIELD[FIELD_REF]{FIELD, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, I, FIELD, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test042() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see org.eclipse.wst.jsdt.core.tests.BasicTestReferences#FIELD\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "FIE");
- assertResults(
- "FIELD[FIELD_REF]{FIELD, Lorg.eclipse.wst.jsdt.core.tests.BasicTestReferences;, I, FIELD, null, "+this.positions+R_DICNR+"}"
- );
-}
-
-public void test043() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see #fo\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.types.tags.BasicTestTypes;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test044() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see #foo\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " int foo;\n" +
- "}";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.types.tags.BasicTestTypes;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test045() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/types/tags/BasicTestTypes.js",
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#fo\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}",
- "/Completion/src/javadoc/types/tags/OtherTypes.js",
- "package javadoc.types.tags;\n" +
- "public class OtherTypes {\n" +
- " int foo;\n" +
- "}"
- };
- completeInJavadoc(sources, true, "fo");
- assertResults(
- "foo[FIELD_REF]{foo, Ljavadoc.types.tags.OtherTypes;, I, foo, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-
-/**
- * @category Tests for methods completion
- */
-public void test050() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethod.meth\n" +
- " * Note that test result may change if bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=26814 was fixed\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " void method() {}\n" +
- " void paramMethod(String str, int x, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "meth");
- assertResults("");
-}
-
-public void test051() throws JavaScriptModelException {
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BasicTestMethod#unknown\n" +
- " * - completion list shoud be empty\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- " void method() {}\n" +
- " void paramMethod(String str, int x, Object obj) {}\n" +
- "}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "unknown");
- assertResults("");
-}
-
-public void test052() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/types/tags/BasicTestTypes.js",
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#meth\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}",
- "/Completion/src/javadoc/types/tags/OtherTypes.js",
- "package javadoc.types.tags;\n" +
- "public class OtherTypes {\n" +
- " void method() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "meth");
- assertResults(
- "method[FUNCTION_REF]{method(), Ljavadoc.types.tags.OtherTypes;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-public void test053() throws JavaScriptModelException {
- String[] sources = {
- "/Completion/src/javadoc/types/tags/BasicTestTypes.js",
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see OtherTypes#method\n" +
- " */\n" +
- "public class BasicTestTypes {\n" +
- "}",
- "/Completion/src/javadoc/types/tags/OtherTypes.js",
- "package javadoc.types.tags;\n" +
- "public class OtherTypes {\n" +
- " void method() {};\n" +
- "}"
- };
- completeInJavadoc(sources, true, "meth");
- assertResults(
- "method[FUNCTION_REF]{method(), Ljavadoc.types.tags.OtherTypes;, ()V, method, null, "+this.positions+R_DICNRNS+"}"
- );
-}
-
-/**
- * @category Tests for type parameters completion
- */
-public void test060() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param \n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "@param ", 0); // empty token
- assertResults(
- "TPARAM[JSDOC_PARAM_REF]{<TPARAM>, null, null, TPARAM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test061() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <\n" +
- " * Note:\n" +
- " * JDT/UI fails on this one (no proposal)\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<");
- assertResults(
- "TPARAM[JSDOC_PARAM_REF]{<TPARAM>, null, null, TPARAM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test062() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <TPA\n" +
- " * Note:\n" +
- " * JDT/UI fails on this one (no proposal)\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<TPA");
- assertResults(
- "TPARAM[JSDOC_PARAM_REF]{<TPARAM>, null, null, TPARAM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test063() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <TPARAM\n" +
- " * Note:\n" +
- " * JDT/UI fails on this one (no proposal)\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<TPA");
- assertResults(
- "TPARAM[JSDOC_PARAM_REF]{<TPARAM>, null, null, TPARAM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test064() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <TPARAM\n" +
- " * Note:\n" +
- " * JDT/UI fails on this one (no proposal)\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<TPARAM");
- assertResults(
- "TPARAM[JSDOC_PARAM_REF]{<TPARAM>, null, null, TPARAM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test065() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <TPARAM>\n" +
- " * Note:\n" +
- " * JDT/UI fails on this one (no proposal)\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<TPARAM");
- assertResults(
- "TPARAM[JSDOC_PARAM_REF]{<TPARAM>, null, null, TPARAM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test066() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <TPARAM>\n" +
- " * Note:\n" +
- " * JDT/UI fails on this one (no proposal)\n" +
- " */\n" +
- "public class BasicTestTypes<TPARAM> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<TPARAM>");
- assertResults(
- "TPARAM[JSDOC_PARAM_REF]{<TPARAM>, null, null, TPARAM, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test067() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <T1>\n" +
- " * @param <T1>\n" +
- " */\n" +
- "public class BasicTestTypes<T1, T2, T3> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<T1>");
- assertResults("");
-}
-
-public void test068() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <T1>\n" +
- " * @param <T1>\n" +
- " */\n" +
- "public class BasicTestTypes<T1, T2, T3> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<T1>", 2); //2nd position
- assertResults("");
-}
-
-public void test069() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <T1>\n" +
- " ** @param \n" +
- " * @param <T3>\n" +
- " */\n" +
- "public class BasicTestTypes<T1, T2, T3> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "** @param ", 0); // empty token
- assertResults(
- "T2[JSDOC_PARAM_REF]{<T2>, null, null, T2, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test070() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <T1>\n" +
- " * @param <T2>\n" +
- " * @param <T3>\n" +
- " */\n" +
- "public class BasicTestTypes<T1, T2, T3> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "<T", 3); // 3rd position
- assertResults(
- "T3[JSDOC_PARAM_REF]{<T3>, null, null, T3, null, "+this.positions+JAVADOC_RELEVANCE+"}"
- );
-}
-
-public void test071() throws JavaScriptModelException {
- setUpProjectOptions(CompilerOptions.VERSION_1_5);
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @param <T1>\n" +
- " * @param <T2>\n" +
- " * @param <T3>\n" +
- " ** @param \n" +
- " */\n" +
- "public class BasicTestTypes<T1, T2, T3> {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "** @param ", 0); // empty token
- assertResults("");
-}
-
-/**
- * @tests Tests for camel case completion
- */
-public void test080() throws JavaScriptModelException {
- this.oldOptions = JavaScriptCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaScriptCore.CODEASSIST_CAMEL_CASE_MATCH, JavaScriptCore.ENABLED);
- JavaScriptCore.setOptions(options);
-
- String source =
- "package javadoc.types.tags;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * @see BTT\n" +
- " */\n" +
- "public class BasicTestTypes {}\n";
- completeInJavadoc("/Completion/src/javadoc/types/tags/BasicTestTypes.js", source, true, "BTT");
- assertResults("BasicTestTypes[TYPE_REF]{BasicTestTypes, javadoc.types.tags, Ljavadoc.types.tags.BasicTestTypes;, null, null, "+this.positions+"16}");
- } finally {
- JavaScriptCore.setOptions(oldOptions);
- }
-}
-/**
- * @category Tests for filtered completion
- */
-public void test100() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasi bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasi",
- 1,
- new int[]{});
- assertResults(
- "ZBasicTestTypes[TYPE_REF]{ZBasicTestTypes, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICUNR+"}\n" +
- "ZBasicTestTypes[JSDOC_TYPE_REF]{{@link ZBasicTestTypes}, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICUNRIT+"}"
- );
-}
-public void test101() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasi bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasi",
- 1,
- new int[]{CompletionProposal.JSDOC_TYPE_REF});
- assertResults(
- "ZBasicTestTypes[TYPE_REF]{ZBasicTestTypes, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICUNR+"}"
- );
-}
-public void test102() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasi bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasi",
- 1,
- new int[]{CompletionProposal.TYPE_REF});
- assertResults(
- "ZBasicTestTypes[JSDOC_TYPE_REF]{{@link ZBasicTestTypes}, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICUNRIT+"}"
- );
-}
-public void test103() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasicTestTypes#fo bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasicTestTypes#fo",
- 1,
- new int[]{});
- assertResults(
- "foo[JSDOC_METHOD_REF]{{@link ZBasicTestTypes#foo()}, Ljavadoc.types.ZBasicTestTypes;, ()V, foo, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-public void test104() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasicTestTypes#fo bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasicTestTypes#fo",
- 1,
- new int[]{CompletionProposal.JSDOC_METHOD_REF});
- assertResults(
- ""
- );
-}
-public void test105() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasicTestTypes#fo bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public void foo() {}\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasicTestTypes#fo",
- 1,
- new int[]{CompletionProposal.METHOD_REF});
- assertResults(
- "foo[JSDOC_METHOD_REF]{{@link ZBasicTestTypes#foo()}, Ljavadoc.types.ZBasicTestTypes;, ()V, foo, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-public void test106() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasicTestTypes#fo bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public int foo;\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasicTestTypes#fo",
- 1,
- new int[]{});
- assertResults(
- "foo[JSDOC_FIELD_REF]{{@link ZBasicTestTypes#foo}, Ljavadoc.types.ZBasicTestTypes;, I, foo, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-public void test107() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasicTestTypes#fo bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public int foo;\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasicTestTypes#fo",
- 1,
- new int[]{CompletionProposal.JSDOC_FIELD_REF});
- assertResults(
- ""
- );
-}
-public void test108() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla ZBasicTestTypes#fo bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public int foo;\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "ZBasicTestTypes#fo",
- 1,
- new int[]{CompletionProposal.FIELD_REF});
- assertResults(
- "foo[JSDOC_FIELD_REF]{{@link ZBasicTestTypes#foo}, Ljavadoc.types.ZBasicTestTypes;, I, foo, null, "+this.positions+R_DICNRNSIT+"}"
- );
-}
-public void test109() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla javadoc.types.ZBasi bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "javadoc.types.ZBasi",
- 1,
- new int[]{});
- assertResults(
- "ZBasicTestTypes[TYPE_REF]{ZBasicTestTypes, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICNR+"}\n" +
- "ZBasicTestTypes[JSDOC_TYPE_REF]{{@link ZBasicTestTypes}, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICNRIT+"}"
- );
-}
-public void test110() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla javadoc.types.ZBasi bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "javadoc.types.ZBasi",
- 1,
- new int[]{CompletionProposal.JSDOC_TYPE_REF});
- assertResults(
- "ZBasicTestTypes[TYPE_REF]{ZBasicTestTypes, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-public void test111() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla javadoc.types.ZBasi bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "javadoc.types.ZBasi",
- 1,
- new int[]{CompletionProposal.TYPE_REF});
- assertResults(
- "ZBasicTestTypes[JSDOC_TYPE_REF]{{@link ZBasicTestTypes}, javadoc.types, Ljavadoc.types.ZBasicTestTypes;, null, null, "+this.positions+R_DICNRIT+"}"
- );
-}
-public void test112() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla javadoc.types.ZBasicTestTypes.Inn bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public class Inner {}\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "javadoc.types.ZBasicTestTypes.Inn",
- 1,
- new int[]{});
- assertResults(
- "ZBasicTestTypes.Inner[TYPE_REF]{Inner, javadoc.types, Ljavadoc.types.ZBasicTestTypes$Inner;, null, null, "+this.positions+R_DICNR+"}\n" +
- "ZBasicTestTypes.Inner[JSDOC_TYPE_REF]{{@link Inner}, javadoc.types, Ljavadoc.types.ZBasicTestTypes$Inner;, null, null, "+this.positions+R_DICNRIT+"}"
- );
-}
-public void test113() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla javadoc.types.ZBasicTestTypes.Inn bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public class Inner {}\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "javadoc.types.ZBasicTestTypes.Inn",
- 1,
- new int[]{CompletionProposal.JSDOC_TYPE_REF});
- assertResults(
- "ZBasicTestTypes.Inner[TYPE_REF]{Inner, javadoc.types, Ljavadoc.types.ZBasicTestTypes$Inner;, null, null, "+this.positions+R_DICNR+"}"
- );
-}
-public void test114() throws JavaScriptModelException {
- String source =
- "package javadoc.types;\n" +
- "/**\n" +
- " * Completion after:\n" +
- " * bla javadoc.types.ZBasicTestTypes.Inn bla\n" +
- " */\n" +
- "public class ZBasicTestTypes {\n" +
- " public class Inner {}\n" +
- "}\n";
- completeInJavadoc(
- "/Completion/src/javadoc/types/ZBasicTestTypes.js",
- source,
- true,
- "javadoc.types.ZBasicTestTypes.Inn",
- 1,
- new int[]{CompletionProposal.TYPE_REF});
- assertResults(
- "ZBasicTestTypes.Inner[JSDOC_TYPE_REF]{{@link Inner}, javadoc.types, Ljavadoc.types.ZBasicTestTypes$Inner;, null, null, "+this.positions+R_DICNRIT+"}"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/LocalElementTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/LocalElementTests.java
deleted file mode 100644
index 0a23e4e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/LocalElementTests.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IType;
-
-import junit.framework.Test;
-
-public class LocalElementTests extends ModifyingResourceTests {
-
- public LocalElementTests(String name) {
- super(name);
- }
-
- // Use this static initializer to specify subset for tests
- // All specified tests which do not belong to the class are skipped...
- static {
- // Names of tests to run: can be "testBugXXXX" or "BugXXXX")
-// TESTS_NAMES = new String[] { "testLocalType8" };
- // Numbers of tests to run: "test<number>" will be run for each number of this array
-// TESTS_NUMBERS = new int[] { 13 };
- // Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
-// TESTS_RANGE = new int[] { 16, -1 };
- }
- public static Test suite() {
- return buildModelTestSuite(LocalElementTests.class);
- }
-
- public void setUpSuite() throws Exception {
- createJavaProject("P");
- }
-
- public void tearDownSuite() throws Exception {
- deleteProject("P");
- }
-
- /*
- * Anonymous type test.
- */
- public void testAnonymousType1() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " run(new X() {\n" +
- " });\n" +
- " }\n" +
- " void run(X x) {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class <anonymous #1>\n" +
- " void run(X)",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Anonymous type test.
- */
- public void testAnonymousType2() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " public class Y {\n" +
- " }\n" +
- " void foo() {\n" +
- " run(new X() {\n" +
- " });\n" +
- " run(new Y() {\n" +
- " });\n" +
- " }\n" +
- " void run(X x) {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " class Y\n" +
- " void foo()\n" +
- " class <anonymous #1>\n" +
- " class <anonymous #2>\n" +
- " void run(X)",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Anonymous type test.
- */
- public void testAnonymousType3() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " run(new X() {\n" +
- " void bar() {\n" +
- " run(new X() {\n" +
- " });\n" +
- " }\n" +
- " });\n" +
- " }\n" +
- " void run(X x) {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class <anonymous #1>\n" +
- " void bar()\n" +
- " class <anonymous #1>\n" +
- " void run(X)",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Anonymous type test.
- */
- public void testAnonymousType4() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " {\n" +
- " field = new Vector() {\n" +
- " };\n" +
- " }\n" +
- " Object field = new Object() {\n" +
- " };\n" +
- " void foo() {\n" +
- " run(new X() {\n" +
- " });\n" +
- " }\n" +
- " void run(X x) {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " <initializer #1>\n" +
- " class <anonymous #1>\n" +
- " Object field\n" +
- " class <anonymous #1>\n" +
- " void foo()\n" +
- " class <anonymous #1>\n" +
- " void run(X)",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Anonymous type test.
- * (regression test for bug 69028 Anonymous type in argument of super() is not in type hierarchy)
- */
- public void testAnonymousType5() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " X(Object o) {\n" +
- " }\n" +
- "}\n" +
- "class Y extends X {\n" +
- " Y() {\n" +
- " super(new Object() {});\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " X(Object)\n" +
- " class Y\n" +
- " Y()\n" +
- " class <anonymous #1>",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Ensures that an anonymous in an enum constant is said to be local.
- * (regression test for bug 85298 [1.5][enum] IType of anonymous enum declaration says isLocal() == false)
- */
- public void testAnonymousType6() throws CoreException {
- try {
- createJavaProject("P15", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5");
- createFile(
- "/P15/En.js",
- "public enum En {\n" +
- " CONST() {};\n" +
- "}"
- );
- IType type = getCompilationUnit("/P15/En.js").getType("En").getField("CONST").getType("", 1);
- assertTrue("Should be a local type", type.isLocal());
- } finally {
- deleteProject("P15");
- }
- }
-
- /*
- * Anonymous type test.
- * (regression test for bug 147485 Anonymous type missing from java model)
- */
- public void testAnonymousType7() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " class Y {\n" +
- " }\n" +
- " {\n" +
- " new Y() {\n" +
- " class Z {\n" +
- " }\n" +
- " {\n" +
- " new Y() {\n" +
- " };\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " class Y\n" +
- " <initializer #1>\n" +
- " class <anonymous #1>\n" +
- " class Z\n" +
- " <initializer #1>\n" +
- " class <anonymous #1>",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * IType.getSuperclassName() test
- */
- public void testGetSuperclassName() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " run(new X() {\n" +
- " });\n" +
- " }\n" +
- " void run(X x) {\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- IType type = cu.getType("X").getFunction("foo", new String[0]).getType("", 1);
- assertEquals(
- "Unexpected superclass name",
- "X",
- type.getSuperclassName());
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * IMember.getType(...) test
- */
- public void testGetType() {
- IJavaScriptUnit cu = getCompilationUnit("P/X.js");
- IType topLevelType = cu.getType("X");
- IJavaScriptElement[] types = new IJavaScriptElement[5];
- types[0] = topLevelType.getInitializer(1).getType("", 1);
- types[1] = topLevelType.getInitializer(1).getType("Y", 1);
- types[2] = topLevelType.getField("f").getType("", 1);
- types[3] = topLevelType.getFunction("foo", new String[] {"I", "QString;"}).getType("", 1);
- types[4] = topLevelType.getFunction("foo", new String[] {"I", "QString;"}).getType("Z", 1);
- assertElementsEqual(
- "Unexpected types",
- "<anonymous #1> [in <initializer #1> [in X [in X.java [in <default> [in <project root> [in P]]]]]]\n" +
- "Y [in <initializer #1> [in X [in X.java [in <default> [in <project root> [in P]]]]]]\n" +
- "<anonymous #1> [in f [in X [in X.java [in <default> [in <project root> [in P]]]]]]\n" +
- "<anonymous #1> [in foo(int, String) [in X [in X.java [in <default> [in <project root> [in P]]]]]]\n" +
- "Z [in foo(int, String) [in X [in X.java [in <default> [in <project root> [in P]]]]]]",
- types);
- }
-
- /*
- * Local type test.
- */
- public void testLocalType1() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class Y",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Local type test.
- */
- public void testLocalType2() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " }\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class Y\n" +
- " class Z",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Local type test.
- */
- public void testLocalType3() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " void bar() {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class Y\n" +
- " void bar()\n" +
- " class Z",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Local type test.
- */
- public void testLocalType4() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " {\n" +
- " class Y {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " <initializer #1>\n" +
- " class Y\n" +
- " void foo()\n" +
- " class Z",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- /*
- * Local type test.
- */
- public void testLocalType5() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Z {\n" +
- " }\n" +
- " Z\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class Z",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=167357
- public void _testLocalType6() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class Y\n" +
- " <initializer #1>\n" +
- " class Z",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=167357
- public void _testLocalType7() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " String s = null;\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class Y\n" +
- " <initializer #1>\n" +
- " class Z\n" +
- " String s",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=167357
- public void _testLocalType8() throws CoreException {
- try {
- createFile(
- "/P/X.js",
- "public class X {\n" +
- " void foo() {\n" +
- " class Y {\n" +
- " String s = null;\n" +
- " {\n" +
- " class Z {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}"
- );
- IJavaScriptUnit cu = getCompilationUnit("/P/X.js");
- assertElementDescendants(
- "Unexpected compilation unit contents",
- "X.java\n" +
- " class X\n" +
- " void foo()\n" +
- " class Y\n" +
- " String s\n"+
- " <initializer #1>\n" +
- " class Z",
- cu);
- } finally {
- deleteFile("/P/X.js");
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/MementoTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/MementoTests.java
deleted file mode 100644
index c3fb891..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/MementoTests.java
+++ /dev/null
@@ -1,678 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.File;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.core.JavaElement;
-import org.eclipse.wst.jsdt.internal.core.LocalVariable;
-
-import junit.framework.Test;
-
-public class MementoTests extends ModifyingResourceTests {
-public MementoTests(String name) {
- super(name);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// TESTS_PREFIX = "testArray";
-// TESTS_NAMES = new String[] { "testPackageFragmentRootMemento8" };
-// TESTS_NUMBERS = new int[] { 8 };
-// TESTS_RANGE = new int[] { 6, -1 };
-}
-
-public static Test suite() {
- return buildModelTestSuite(MementoTests.class);
-}
-protected void assertMemento(String expected, IJavaScriptElement element) {
- String actual = element.getHandleIdentifier();
- if (!expected.equals(actual)){
- String escapedExternalJCL = getEscapedExternalJCLPath();
- int start = actual.indexOf(escapedExternalJCL);
- if (start != -1) {
- String firstPart = actual.substring(0, start);
- System.out.print(Util.displayString(firstPart, 2));
- System.out.print(" + getEscapedExternalJCLPath() + ");
- String secondPart = actual.substring(start+escapedExternalJCL.length());
- System.out.print(Util.displayString(secondPart, 0));
- } else {
- System.out.print(Util.displayString(actual, 2));
- }
- System.out.println(",");
- }
- assertEquals(
- "Unexpected memento for " + element,
- expected,
- actual);
- IJavaScriptElement restored = JavaScriptCore.create(actual);
- assertEquals(
- "Unexpected restored element",
- element,
- restored);
-}
-protected String getEscapedExternalJCLPath() {
- String path = getExternalJCLPath("").toString();
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < path.length(); i++) {
- char character = path.charAt(i);
- if (character == '/') buffer.append('\\');
- buffer.append(character);
- }
- return buffer.toString();
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- this.createJavaProject(
- "P",
- new String[] {"src"},
- new String[] {
- getSystemJsPathString(),
- "/P/lib",
- "/P/lib/myLib.jar",
- "/OtherProj/lib",
- "/OtherProj/lib/myLib.jar",
- });
-}
-public void tearDownSuite() throws Exception {
- this.deleteProject("P");
- super.tearDownSuite();
-}
-/**
- * Tests that an anonymous type can be persisted and restored using its memento.
- */
-public void testAnonymousTypeMemento1() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
-
- IType anonymous = type.getInitializer(1).getType("", 1);
- assertMemento(
- "=P/src<p{X.java[X|1[",
- anonymous);
-
- anonymous = type.getInitializer(1).getType("", 2);
- assertMemento(
- "=P/src<p{X.java[X|1[!2",
- anonymous);
-}
-/**
- * Tests that an anonymous type can be persisted and restored using its memento.
- */
-public void testAnonymousTypeMemento2() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
-
- IType anonymous = type.getField("f").getType("", 1);
- assertMemento(
- "=P/src<p{X.java[X^f[",
- anonymous);
-
- anonymous = type.getField("f").getType("", 3);
- assertMemento(
- "=P/src<p{X.java[X^f[!3",
- anonymous);
-}
-/**
- * Tests that an anonymous type can be persisted and restored using its memento.
- */
-public void testAnonymousTypeMemento3() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
-
- IType anonymous = type.getFunction("foo", new String[]{}).getType("", 1);
- assertMemento(
- "=P/src<p{X.java[X~foo[",
- anonymous);
-
- anonymous = type.getFunction("foo", new String[]{}).getType("", 4);
- assertMemento(
- "=P/src<p{X.java[X~foo[!4",
- anonymous);
-}
-/**
- * Tests that a binary field can be persisted and restored using its memento.
- */
-public void testBinaryFieldMemento() throws JavaScriptModelException {
- IField field = getClassFile("/P/lib/p/X.class").getType().getField("field");
- assertMemento(
- "=P/lib<p(X.class[X^field",
- field);
-}
-/**
- * Tests that an inner type, inner field and inner method can be persisted and restored
- * using mementos.
- */
-public void testBinaryInnerTypeMemento() throws JavaScriptModelException {
- IType type = getClassFile("/P/lib/p/X$Inner.class").getType();
-
- assertMemento(
- "=P/lib<p(X$Inner.class[Inner",
- type);
-
- IField innerField = type.getField("field");
- assertMemento(
- "=P/lib<p(X$Inner.class[Inner^field",
- innerField);
-
- IFunction innerMethod = type.getFunction("foo", new String[] {"I", "Ljava.lang.String;"});
- assertMemento(
- "=P/lib<p(X$Inner.class[Inner~foo~I~Ljava.lang.String;",
- innerMethod);
-}
-/**
- * Tests that a binary method can be persisted and restored using its memento.
- */
-public void testBinaryMethodMemento1() throws JavaScriptModelException {
- IType type = getClassFile("/P/lib/p/X.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"I", "Ljava.lang.String;"});
- assertMemento(
- "=P/lib<p(X.class[X~foo~I~Ljava.lang.String;",
- method);
-}
-/**
- * Tests that a binary method can be persisted and restored using its memento.
- */
-public void testBinaryMethodMemento2() throws JavaScriptModelException {
- IType type = getClassFile("/P/lib/p/X.class").getType();
- IFunction method = type.getFunction("bar", new String[] {});
- assertMemento(
- "=P/lib<p(X.class[X~bar",
- method);
-}
-/**
- * Tests that a binary method can be persisted and restored using its memento.
- */
-public void testBinaryMethodMemento3() throws JavaScriptModelException {
- IType type = getClassFile("/P/lib/p/X.class").getType();
- IFunction method = type.getFunction("fred", new String[] {"[Z"});
- assertMemento(
- "=P/lib<p(X.class[X~fred~\\[Z",
- method);
-}
-/**
- * Tests that a binary method with a parameter with wildcard can be persisted and restored using its memento.
- * (regression test for bug 75466 [1.5] IAE in JavaElement.exists() for Collection<E>#containsAll(Collection<?>))
- */
-public void testBinaryMethodMemento4() throws JavaScriptModelException {
- IType type = getClassFile("/P/lib/p/X.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"Ljava.util.Collection<*>;"});
- assertMemento(
- "=P/lib<p(X.class[X~foo~Ljava.util.Collection\\<*>;",
- method);
-}
-
-/**
- * Tests that a binary type can be persisted and restored using its memento.
- */
-public void testBinaryTypeMemento() throws JavaScriptModelException {
- IType type = getClassFile("/P/lib/p/X.class").getType();
- assertMemento(
- "=P/lib<p(X.class[X",
- type);
-}
-/**
- * Tests that a class file can be persisted and restored using its memento.
- */
-public void testClassFileMemento() {
- IClassFile cf = getClassFile("/P/lib/p/X.class");
- assertMemento(
- "=P/lib<p(X.class",
- cf);
-
- cf = getClassFile("/P/lib/Y.class");
- assertMemento(
- "=P/lib<(Y.class",
- cf);
-
-}
-/**
- * Tests that a compilation unit can be persisted and restored using its memento.
- */
-public void testCompilationUnitMemento() {
- IJavaScriptUnit cu = getCompilationUnit("/P/src/p/X.js");
- assertMemento(
- "=P/src<p{X.js",
- cu);
-
- cu = getCompilationUnit("/P/src/Y.js");
- assertMemento(
- "=P/src<{Y.js",
- cu);
-}
-/**
- * Tests that a binary field in an external jar can be persisted and restored using its memento.
- */
-public void testExternalJarBinaryFieldMemento() throws JavaScriptModelException {
- IType type = getClassFile("P", getSystemJsPathString(), "p", "X.class").getType();
- IField field = type.getField("field");
- assertMemento(
- "=P/"+ getEscapedExternalJCLPath() + "<p(X.class[X^field",
- field);
-}
-/**
- * Tests that a inner binary type and field in an external jar can be persisted and restored using its memento.
- */
-public void testExternalJarBinaryInnerTypeMemento() throws JavaScriptModelException {
- IType type = getClassFile("P", getSystemJsPathString(), "p", "X$Inner.class").getType();
- assertMemento(
- "=P/" + getEscapedExternalJCLPath() + "<p(X$Inner.class[Inner",
- type);
-}
-/**
- * Tests that a binary method in an external jar can be persisted and restored using its memento.
- */
-public void testExternalJarBinaryMethodMemento() throws JavaScriptModelException {
- IType type = getClassFile("P", getSystemJsPathString(), "p", "X.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"[Ljava.lang.String;"});
- assertMemento(
- "=P/" + getEscapedExternalJCLPath() + "<p(X.class[X~foo~\\[Ljava.lang.String;",
- method);
-}
-/**
- * Tests that a binary type in an external jar can be persisted and restored using its memento.
- */
-public void testExternalJarBinaryTypeMemento() throws JavaScriptModelException {
- IType type = getClassFile("P", getSystemJsPathString(), "p", "X.class").getType();
- assertMemento(
- "=P/" + getEscapedExternalJCLPath() + "<p(X.class[X",
- type);
-}
-/**
- * Tests that a class file in an external jar at the root of the file system can be persisted and restored using its memento.
- */
-public void testExternalJarClassFileMemento() throws JavaScriptModelException {
- char separator = File.separatorChar;
- String device = separator == '/' ? "" : "C:";
- IClassFile classFile = getClassFile("P", device + separator + "lib.jar", "p", "X.class");
- assertMemento(
- "=P/" + device + "\\/lib.jar<p(X.class",
- classFile);
-}
-/**
- * Tests that an import declaration can be persisted and restored using its memento.
- */
-public void testImportContainerMemento() {
- IImportContainer importContainer = getCompilationUnit("/P/src/p/X.js").getImportContainer();
- assertMemento(
- "=P/src<p{X.java#",
- importContainer);
-}
-/**
- * Tests that an import declaration can be persisted and restored using its memento.
- */
-public void testImportDeclarationMemento() {
- IImportDeclaration importDecl = getCompilationUnit("/P/src/p/X.js").getImport("java.io.Serializable");
- assertMemento(
- "=P/src<p{X.java#java.io.Serializable",
- importDecl);
-
- importDecl = getCompilationUnit("/P/src/p/X.js").getImport("java.util.*");
- assertMemento(
- "=P/src<p{X.java#java.util.*",
- importDecl);
-}
-/*
- * Ensures that a Java element is returned for an invalid memento.
- * (regression test for bug 81762 [model] AIOOB in breakpoints view)
- */
-public void testInvalidMemento() {
- IJavaScriptElement element = JavaScriptCore.create("=P/src<p{");
- assertElementEquals("Unexpected element", "p [in src [in P]]", element);
-}
-/**
- * Tests that an initializer can be persisted and restored using its memento.
- */
-public void testInitializerMemento() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
-
- IInitializer initializer = type.getInitializer(1);
- assertMemento(
- "=P/src<p{X.java[X|1",
- initializer);
-
- initializer = type.getInitializer(2);
- assertMemento(
- "=P/src<p{X.java[X|2",
- initializer);
-}
-/**
- * Tests that a binary field in an internal jar can be persisted and restored using its memento.
- */
-public void testInternalJarBinaryFieldMemento() throws JavaScriptModelException {
- IType type = getPackageFragmentRoot("/P/lib/myLib.jar").getPackageFragment("p").getClassFile("X.class").getType();
- IField field = type.getField("field");
- assertMemento(
- "=P/lib\\/myLib.jar<p(X.class[X^field",
- field);
-}
-/**
- * Tests that a inner binary type and field in an internal jar can be persisted and restored using its memento.
- */
-public void testInternalJarBinaryInnerTypeMemento() throws JavaScriptModelException {
- IType type = getPackageFragmentRoot("/P/lib/myLib.jar").getPackageFragment("p").getClassFile("X$Inner.class").getType();
- assertMemento(
- "=P/lib\\/myLib.jar<p(X$Inner.class[Inner",
- type);
-}
-/**
- * Tests that a binary method in an internal jar can be persisted and restored using its memento.
- */
-public void testInternalJarBinaryMethodMemento() throws JavaScriptModelException {
- IType type = getPackageFragmentRoot("/P/lib/myLib.jar").getPackageFragment("p").getClassFile("X.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"[Ljava.lang.String;"});
- assertMemento(
- "=P/lib\\/myLib.jar<p(X.class[X~foo~\\[Ljava.lang.String;",
- method);
-}
-/**
- * Tests that a binary type in an internal jar can be persisted and restored using its memento.
- */
-public void testInternalJarBinaryTypeMemento() throws JavaScriptModelException {
- IType type = getPackageFragmentRoot("/P/lib/myLib.jar").getPackageFragment("p").getClassFile("X.class").getType();
- assertMemento(
- "=P/lib\\/myLib.jar<p(X.class[X",
- type);
-}
-/**
- * Tests that a local type can be persisted and restored using its memento.
- */
-public void testLocalTypeMemento1() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
-
- IType anonymous = type.getInitializer(1).getType("Y", 1);
- assertMemento(
- "=P/src<p{X.java[X|1[Y",
- anonymous);
-
- anonymous = type.getInitializer(1).getType("Y", 2);
- assertMemento(
- "=P/src<p{X.java[X|1[Y!2",
- anonymous);
-}
-/**
- * Tests that a local type can be persisted and restored using its memento.
- */
-public void testLocalTypeMemento2() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
-
- IType anonymous = type.getFunction("foo", new String[]{}).getType("Y", 1);
- assertMemento(
- "=P/src<p{X.java[X~foo[Y",
- anonymous);
-
- anonymous = type.getFunction("foo", new String[]{}).getType("Y", 3);
- assertMemento(
- "=P/src<p{X.java[X~foo[Y!3",
- anonymous);
-}
-/**
- * Tests that a local variable can be persisted and restored using its memento.
- */
-public void testLocalVariableMemento1() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
- IFunction method = type.getFunction("foo", new String[]{});
-
- ILocalVariable localVar = new LocalVariable((JavaElement)method, "var", 1, 2, 3, 4, "Z");
- assertMemento(
- "=P/src<p{X.java[X~foo@var!1!2!3!4!Z",
- localVar);
-}
-/**
- * Tests that a local variable can be persisted and restored using its memento.
- */
-public void testLocalVariableMemento3() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
- IInitializer initializer = type.getInitializer(1);
-
- ILocalVariable localVar = new LocalVariable((JavaElement)initializer, "var", 1, 2, 3, 4, "Z");
- assertMemento(
- "=P/src<p{X.java[X|1@var!1!2!3!4!Z",
- localVar);
-}
-/**
- * Tests that a local variable can be persisted and restored using its memento.
- */
-public void testLocalVariableMemento2() throws JavaScriptModelException {
- IType type = getClassFile("/P/src/p/X.class").getType();
- IFunction method = type.getFunction("foo", new String[]{"I"});
-
- ILocalVariable localVar = new LocalVariable((JavaElement)method, "var", 1, 2, 3, 4, "Z");
- assertMemento(
- "=P/src<p(X.class[X~foo~I@var!1!2!3!4!Z",
- localVar);
-}
-/**
- * Tests that a package fragment can be persisted and restored using its memento.
- */
-public void testPackageFragmentMemento() {
- IPackageFragment pkg = getPackage("/P/src/p");
- assertMemento(
- "=P/src<p",
- pkg);
-
- pkg = getPackage("/P/src/p1/p2");
- assertMemento(
- "=P/src<p1.p2",
- pkg);
-
- pkg = getPackage("/P/src");
- assertMemento(
- "=P/src<",
- pkg);
-}
-/**
- * Tests that a package fragment in the default root can be persisted and restored using its memento.
- */
-public void testPackageFragmentMemento2() throws CoreException {
- try {
- createJavaProject("P1", new String[] {""});
- IPackageFragment pkg = getPackage("/P1/p");
- assertMemento(
- "=P1/<p",
- pkg);
- } finally {
- deleteProject("P1");
- }
-}
-/**
- * Tests that a source folder package fragment root can be persisted and restored using its memento.
- */
-public void testPackageFragmentRootMemento1() {
- IJavaScriptProject project = getJavaProject("P");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(project.getProject().getFolder("src"));
- assertMemento(
- "=P/src",
- root);
-}
-/**
- * Tests that a source folder package fragment root corresponding to the project
- * can be persisted and restored using its memento.
- */
-public void testPackageFragmentRootMemento2() throws CoreException {
- try {
- IJavaScriptProject project = this.createJavaProject("P1", new String[] {""});
- IPackageFragmentRoot root = project.getPackageFragmentRoot(project.getProject());
- assertMemento(
- "=P1/",
- root);
- } finally {
- this.deleteProject("P1");
- }
-}
-/**
- * Tests that a library folder package fragment root in the same project
- * can be persisted and restored using its memento.
- */
-public void testPackageFragmentRootMemento3() {
- IJavaScriptProject project = getJavaProject("P");
- IFolder libFolder = project.getProject().getFolder("lib");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(libFolder);
- assertMemento(
- "=P/lib",
- root);
-}
-/**
- * Tests that a library folder package fragment root in another project
- * can be persisted and restored using its memento.
- */
-public void testPackageFragmentRootMemento4() {
- IJavaScriptProject project = getJavaProject("P");
- IFolder otherLibFolder = getFolder("/OtherProj/lib");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(otherLibFolder);
- assertMemento(
- "=P/\\/OtherProj\\/lib",
- root);
-}
-/**
- * Tests that a jar package fragment root in the same project
- * can be persisted and restored using its memento.
- */
-public void testPackageFragmentRootMemento5() {
- IJavaScriptProject project = getJavaProject("P");
- IFile jar = getFile("/P/lib/myLib.jar");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(jar);
- assertMemento(
- "=P/lib\\/myLib.jar",
- root);
-}
-/**
- * Tests that a jar package fragment root in another project
- * can be persisted and restored using its memento.
- */
-public void testPackageFragmentRootMemento6() {
- IJavaScriptProject project = getJavaProject("P");
- IFile jar = getFile("/OtherProj/lib/myLib.jar");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(jar);
- assertMemento(
- "=P/\\/OtherProj\\/lib\\/myLib.jar",
- root);
-}
-/**
- * Tests that an external jar package fragment root
- * can be persisted and restored using its memento.
- */
-public void testPackageFragmentRootMemento7() throws CoreException {
- IPackageFragmentRoot root = getPackageFragmentRoot("P", getSystemJsPathString());
- assertMemento(
- "=P/" + getEscapedExternalJCLPath() + "",
- root);
-}
-/*
- * Tests that a library folder package fragment root being another project
- * can be persisted and restored using its memento.
- * (regression test for bug 108539 Error popup at breakpoint in tomcat project)
- */
-public void testPackageFragmentRootMemento8() {
- IJavaScriptProject project = getJavaProject("P");
- IProject otherLibFolder = getProject("/OtherProj");
- IPackageFragmentRoot root = project.getPackageFragmentRoot(otherLibFolder);
- assertMemento(
- "=P/\\/OtherProj",
- root);
-}
-/**
- * Tests that a project can be persisted and restored using its memento.
- */
-public void testProjectMemento() {
- IJavaScriptProject project = getJavaProject("P");
- assertMemento(
- "=P",
- project);
-}
-/**
- * Tests that a project with special chararcters in its name can be persisted and restored using its memento.
- * (regression test for bug 47815 Refactoring doesn't work with some project names [refactoring])
- */
-public void testProjectMemento2() {
- IJavaScriptProject project = getJavaProject("P (abc) ~");
- assertMemento(
- "=P \\(abc) \\~",
- project);
-}
-/**
- * Tests that a project with a ']' in its name can be persisted and restored using its memento.
- * (regression test for bug 108615 Unable to inherit abstract methods from jarred interface)
- */
-public void testProjectMemento3() {
- IJavaScriptProject project = getJavaProject("P[]");
- assertMemento(
- "=P\\[\\]",
- project);
-}
-/**
- * Tests that a bogus memento cannot be restored.
- */
-public void testRestoreBogusMemento() {
- IJavaScriptElement restored = JavaScriptCore.create("bogus");
- assertEquals("should not be able to restore a bogus memento", null, restored);
-}
-/**
- * Tests that a source field can be persisted and restored using its memento.
- */
-public void testSourceFieldMemento() {
- IField field = getCompilationUnit("/P/src/p/X.js").getType("X").getField("field");
- assertMemento(
- "=P/src<p{X.java[X^field",
- field);
-}
-/**
- * Tests that a source inner type, inner field and inner method can be persisted and restored
- * using mementos.
- */
-public void testSourceInnerTypeMemento() {
- IType innerType = getCompilationUnit("/P/src/p/X.js").getType("X").getType("Inner");
- assertMemento(
- "=P/src<p{X.java[X[Inner",
- innerType);
-}
-/**
- * Tests that a source method can be persisted and restored using its memento.
- */
-public void testSourceMethodMemento1() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
- IFunction method = type.getFunction("foo", new String[] {"I", "Ljava.lang.String;"});
- assertMemento(
- "=P/src<p{X.java[X~foo~I~Ljava.lang.String;",
- method);
-}
-/**
- * Tests that a source method can be persisted and restored using its memento.
- */
-public void testSourceMethodMemento2() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
- IFunction method = type.getFunction("bar", new String[] {});
- assertMemento(
- "=P/src<p{X.java[X~bar",
- method);
-}
-/**
- * Tests that a source method can be persisted and restored using its memento.
- */
-public void testSourceMethodMemento3() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
- IFunction method = type.getFunction("fred", new String[] {"[Z"});
- assertMemento(
- "=P/src<p{X.java[X~fred~\\[Z",
- method);
-}
-/**
- * Tests that a source type can be persisted and restored using its memento.
- */
-public void testSourceTypeMemento() {
- IType type = getCompilationUnit("/P/src/p/X.js").getType("X");
- assertMemento(
- "=P/src<p{X.java[X",
- type);
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ModifyingResourceTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ModifyingResourceTests.java
deleted file mode 100644
index 9083ed9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ModifyingResourceTests.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.*;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.compiler.batch.Main;
-import org.eclipse.wst.jsdt.internal.core.JavaElement;
-
-public class ModifyingResourceTests extends AbstractJavaModelTests {
-
-public ModifyingResourceTests(String name) {
- super(name);
-}
-protected void assertElementDescendants(String message, String expected, IJavaScriptElement element) throws CoreException {
- String actual = expandAll(element);
- if (!expected.equals(actual)){
- System.out.println(Util.displayString(actual, 4));
- }
- assertEquals(
- message,
- expected,
- actual);
-}
-protected void assertStatus(String expected, IStatus status) {
- String actual = status.getMessage();
- if (!expected.equals(actual)) {
- System.out.print(Util.displayString(actual, 2));
- System.out.println(",");
- }
- assertEquals(expected, actual);
-}
-protected void assertStatus(String message, String expected, IStatus status) {
- String actual = status.getMessage();
- if (!expected.equals(actual)) {
- System.out.print(Util.displayString(actual, 2));
- System.out.println(",");
- }
- assertEquals(message, expected, actual);
-}
-/**
- * E.g. <code>
- * org.eclipse.wst.jsdt.tests.core.ModifyingResourceTests.generateClassFile(
- * "A",
- * "public class A {\n" +
- * "}")
- */
-public static void generateClassFile(String className, String javaSource) throws IOException {
- String cu = "d:/temp/" + className + ".js";
- Util.createFile(cu, javaSource);
- Main.compile(cu + " -d d:/temp -classpath " + System.getProperty("java.home") + "/lib/rt.jar");
- FileInputStream input = new FileInputStream("d:/temp/" + className + ".class");
- try {
- System.out.println("{");
- byte[] buffer = new byte[80];
- int read = 0;
- while (read != -1) {
- read = input.read(buffer);
- if (read != -1) System.out.print("\t");
- for (int i = 0; i < read; i++) {
- System.out.print(buffer[i]);
- System.out.print(", ");
- }
- if (read != -1) System.out.println();
- }
- System.out.print("}");
- } finally {
- input.close();
- }
-}
-
-protected IFile createFile(String path, InputStream content) throws CoreException {
- IFile file = getFile(path);
- file.create(content, true, null);
- try {
- content.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return file;
-}
-
-protected IFile createFile(String path, byte[] content) throws CoreException {
- return createFile(path, new ByteArrayInputStream(content));
-}
-
-protected IFile createFile(String path, String content) throws CoreException {
- return createFile(path, content.getBytes());
-}
-protected IFile createFile(String path, String content, String charsetName) throws CoreException, UnsupportedEncodingException {
- return createFile(path, content.getBytes(charsetName));
-}
-protected IFolder createFolder(String path) throws CoreException {
- return createFolder(new Path(path));
-}
-protected void deleteFile(String filePath) throws CoreException {
- deleteResource(this.getFile(filePath));
-}
-protected void deleteFolder(String folderPath) throws CoreException {
- deleteFolder(new Path(folderPath));
-}
-protected IFile editFile(String path, String content) throws CoreException {
- IFile file = this.getFile(path);
- InputStream input = new ByteArrayInputStream(content.getBytes());
- file.setContents(input, IResource.FORCE, null);
- return file;
-}
-/*
- * Expands (i.e. open) the given element and returns a toString() representation
- * of the tree.
- */
-protected String expandAll(IJavaScriptElement element) throws CoreException {
- StringBuffer buffer = new StringBuffer();
- this.expandAll(element, 0, buffer);
- return buffer.toString();
-}
-private void expandAll(IJavaScriptElement element, int tab, StringBuffer buffer) throws CoreException {
- IJavaScriptElement[] children = null;
- // force opening of element by getting its children
- if (element instanceof IParent) {
- IParent parent = (IParent)element;
- children = parent.getChildren();
- }
- ((JavaElement)element).toStringInfo(tab, buffer);
- if (children != null) {
- for (int i = 0, length = children.length; i < length; i++) {
- buffer.append("\n");
- this.expandAll(children[i], tab+1, buffer);
- }
- }
-}
-protected void renameProject(String project, String newName) throws CoreException {
- this.getProject(project).move(new Path(newName), true, null);
-}
-protected IClassFile getClassFile(String path) {
- return (IClassFile)JavaScriptCore.create(getFile(path));
-}
-protected IFolder getFolder(String path) {
- return getFolder(new Path(path));
-}
-protected IPackageFragment getPackage(String path) {
- if (path.indexOf('/', 1) != -1) { // if path as more than one segment
- IJavaScriptElement element = JavaScriptCore.create(this.getFolder(path));
- if (element instanceof IPackageFragmentRoot) {
- return ((IPackageFragmentRoot)element).getPackageFragment("");
- }
- return (IPackageFragment)element;
- }
- IProject project = this.getProject(path);
- return JavaScriptCore.create(project).getPackageFragmentRoot(project).getPackageFragment("");
-}
-protected IPackageFragmentRoot getPackageFragmentRoot(String path) {
- if (path.indexOf('/', 1) != -1) { // if path as more than one segment
- if (path.endsWith(".jar")) {
- return (IPackageFragmentRoot)JavaScriptCore.create(this.getFile(path));
- }
- return (IPackageFragmentRoot)JavaScriptCore.create(this.getFolder(path));
- }
- IProject project = this.getProject(path);
- return JavaScriptCore.create(project).getPackageFragmentRoot(project);
-}
-protected String getSortedByProjectDeltas() {
- StringBuffer buffer = new StringBuffer();
- for (int i=0, length = this.deltaListener.deltas.length; i<length; i++) {
- IJavaScriptElementDelta[] projects = this.deltaListener.deltas[i].getAffectedChildren();
- int projectsLength = projects.length;
-
- // sort by project
- IJavaScriptElementDelta[] sorted = new IJavaScriptElementDelta[projectsLength];
- System.arraycopy(projects, 0, sorted, 0, projectsLength);
- org.eclipse.wst.jsdt.internal.core.util.Util.sort(
- sorted,
- new org.eclipse.wst.jsdt.internal.core.util.Util.Comparer() {
- public int compare(Object a, Object b) {
- return a.toString().compareTo(b.toString());
- }
- });
-
- for (int j=0; j<projectsLength; j++) {
- buffer.append(sorted[j]);
- if (j != projectsLength-1) {
- buffer.append("\n");
- }
- }
- if (i != length-1) {
- buffer.append("\n\n");
- }
- }
- return buffer.toString();
-}
-protected void moveFile(String sourcePath, String destPath) throws CoreException {
- this.getFile(sourcePath).move(this.getFile(destPath).getFullPath(), false, null);
-}
-protected void moveFolder(String sourcePath, String destPath) throws CoreException {
- this.getFolder(sourcePath).move(this.getFolder(destPath).getFullPath(), false, null);
-}
-protected void swapFiles(String firstPath, String secondPath) throws CoreException {
- final IFile first = this.getFile(firstPath);
- final IFile second = this.getFile(secondPath);
- IWorkspaceRunnable runnable = new IWorkspaceRunnable( ) {
- public void run(IProgressMonitor monitor) throws CoreException {
- IPath tempPath = first.getParent().getFullPath().append("swappingFile.temp");
- first.move(tempPath, false, monitor);
- second.move(first.getFullPath(), false, monitor);
- getWorkspaceRoot().getFile(tempPath).move(second.getFullPath(), false, monitor);
- }
- };
- getWorkspace().run(runnable, null);
-}
-protected IClassFile createClassFile(String libPath, String classFileRelativePath, String contents) throws CoreException {
- IClassFile classFile = getClassFile(libPath + "/" + classFileRelativePath);
-// classFile.getResource().delete(false, null);
- Util.delete(classFile.getResource());
- IJavaScriptProject javaProject = classFile.getJavaScriptProject();
- IProject project = javaProject.getProject();
- String sourcePath = project.getLocation().toOSString() + File.separatorChar + classFile.getType().getElementName() + ".js";
- String libOSPath = new Path(libPath).segmentCount() > 1 ? getFolder(libPath).getLocation().toOSString() : getProject(libPath).getLocation().toOSString();
- Util.compile(new String[] {sourcePath, contents}, javaProject.getOptions(true), libOSPath);
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- return classFile;
-}
-/*
- * Returns a new classpath from the given source folders and their respective exclusion/inclusion patterns.
- * The folder path is an absolute workspace-relative path.
- * The given array as the following form:
- * [<folder>, "<pattern>[|<pattern]*"]*
- * E.g. new String[] {
- * "/P/src1", "p/A.js",
- * "/P", "*.txt|com.tests/**"
- * }
- */
-protected IIncludePathEntry[] createClasspath(String[] foldersAndPatterns, boolean hasInclusionPatterns, boolean hasExclusionPatterns) {
- int length = foldersAndPatterns.length;
- int increment = 1;
- if (hasInclusionPatterns) increment++;
- if (hasExclusionPatterns) increment++;
- IIncludePathEntry[] classpath = new IIncludePathEntry[length/increment];
- for (int i = 0; i < length; i+=increment) {
- String src = foldersAndPatterns[i];
- IPath[] accessibleFiles = new IPath[0];
- if (hasInclusionPatterns) {
- String patterns = foldersAndPatterns[i+1];
- StringTokenizer tokenizer = new StringTokenizer(patterns, "|");
- int patternsCount = tokenizer.countTokens();
- accessibleFiles = new IPath[patternsCount];
- for (int j = 0; j < patternsCount; j++) {
- accessibleFiles[j] = new Path(tokenizer.nextToken());
- }
- }
- IPath[] nonAccessibleFiles = new IPath[0];
- if (hasExclusionPatterns) {
- String patterns = foldersAndPatterns[i+increment-1];
- StringTokenizer tokenizer = new StringTokenizer(patterns, "|");
- int patternsCount = tokenizer.countTokens();
- nonAccessibleFiles = new IPath[patternsCount];
- for (int j = 0; j < patternsCount; j++) {
- nonAccessibleFiles[j] = new Path(tokenizer.nextToken());
- }
- }
- IPath folderPath = new Path(src);
- classpath[i/increment] = JavaScriptCore.newSourceEntry(folderPath, accessibleFiles, nonAccessibleFiles, null);
- }
- return classpath;
-}
-/*
- * Returns a new classpath from the given folders and their respective accessible/non accessible files patterns.
- * The folder path is an absolute workspace-relative path. If the given project name is non-null,
- * the folder path is considered a project path if it has 1 segment that is different from the project name.
- * The given array as the following form:
- * [<folder>, "<+|-><pattern>[|<+|-><pattern]*"]*
- * E.g. new String[] {
- * "/P/src1", "+p/A.js",
- * "/P", "-*.txt|+com.tests/**"
- * }
- */
-protected IIncludePathEntry[] createClasspath(String projectName, String[] foldersAndPatterns) {
- int length = foldersAndPatterns.length;
- IIncludePathEntry[] classpath = new IIncludePathEntry[length/2];
- for (int i = 0; i < length; i+=2) {
- String src = foldersAndPatterns[i];
- String patterns = foldersAndPatterns[i+1];
- classpath[i/2] = createSourceEntry(projectName, src, patterns);
- }
- return classpath;
-}
-public IIncludePathEntry createSourceEntry(String referingProjectName, String src, String patterns) {
- StringTokenizer tokenizer = new StringTokenizer(patterns, "|");
- int ruleCount = tokenizer.countTokens();
- IAccessRule[] accessRules = new IAccessRule[ruleCount];
- int nonAccessibleRules = 0;
- for (int j = 0; j < ruleCount; j++) {
- String rule = tokenizer.nextToken();
- int kind;
- boolean ignoreIfBetter = false;
- switch (rule.charAt(0)) {
- case '+':
- kind = IAccessRule.K_ACCESSIBLE;
- break;
- case '~':
- kind = IAccessRule.K_DISCOURAGED;
- break;
- case '?':
- kind = IAccessRule.K_NON_ACCESSIBLE;
- ignoreIfBetter = true;
- break;
- case '-':
- default: // TODO (maxime) consider forbidding unspecified rule start; this one tolerates
- // shortcuts that only specify a path matching pattern
- kind = IAccessRule.K_NON_ACCESSIBLE;
- break;
- }
- nonAccessibleRules++;
- accessRules[j] = JavaScriptCore.newAccessRule(new Path(rule.substring(1)), ignoreIfBetter ? kind | IAccessRule.IGNORE_IF_BETTER : kind);
- }
-
- IPath folderPath = new Path(src);
- if (referingProjectName != null && folderPath.segmentCount() == 1 && !referingProjectName.equals(folderPath.lastSegment())) {
- return JavaScriptCore.newProjectEntry(folderPath, accessRules, true/*combine access restrictions*/, new IIncludePathAttribute[0], false);
- } else {
- IPath[] accessibleFiles = new IPath[ruleCount-nonAccessibleRules];
- int accessibleIndex = 0;
- IPath[] nonAccessibleFiles = new IPath[nonAccessibleRules];
- int nonAccessibleIndex = 0;
- for (int j = 0; j < ruleCount; j++) {
- IAccessRule accessRule = accessRules[j];
- if (accessRule.getKind() == IAccessRule.K_ACCESSIBLE)
- accessibleFiles[accessibleIndex++] = accessRule.getPattern();
- else
- nonAccessibleFiles[nonAccessibleIndex++] = accessRule.getPattern();
- }
- return JavaScriptCore.newSourceEntry(folderPath, accessibleFiles, nonAccessibleFiles, null);
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NameLookupTests2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NameLookupTests2.java
deleted file mode 100644
index 31c0e4e..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NameLookupTests2.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
-import org.eclipse.wst.jsdt.internal.core.JavaProject;
-import org.eclipse.wst.jsdt.internal.core.NameLookup;
-import org.eclipse.wst.jsdt.core.*;
-
-import junit.framework.Test;
-
-/**
- * These test ensure that modifications in Java projects are correctly reported as
- * IJavaEllementDeltas.
- */
-public class NameLookupTests2 extends ModifyingResourceTests {
-
-public NameLookupTests2(String name) {
- super(name);
-}
-
-public static Test suite() {
- return buildModelTestSuite(NameLookupTests2.class);
-}
-
-private NameLookup getNameLookup(JavaProject project) throws JavaScriptModelException {
- return project.newNameLookup((WorkingCopyOwner)null);
-}
-public void testAddPackageFragmentRootAndPackageFrament() throws CoreException {
- try {
- IJavaScriptProject p1 = createJavaProject("P1", new String[] {"src1"});
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {});
- IIncludePathEntry[] classpath =
- new IIncludePathEntry[] {
- JavaScriptCore.newProjectEntry(new Path("/P1"))
- };
- p2.setRawIncludepath(classpath, null);
-
- IPackageFragment[] res = getNameLookup((JavaProject)p2).findPackageFragments("p1", false);
- assertTrue("Should get no package fragment", res == null);
-
- IIncludePathEntry[] classpath2 =
- new IIncludePathEntry[] {
- JavaScriptCore.newSourceEntry(new Path("/P1/src1")),
- JavaScriptCore.newSourceEntry(new Path("/P1/src2"))
- };
- p1.setRawIncludepath(classpath2, null);
- createFolder("/P1/src2/p1");
-
- res = getNameLookup((JavaProject)p2).findPackageFragments("p1", false);
- assertTrue(
- "Should get 'p1' package fragment",
- res != null &&
- res.length == 1 &&
- res[0].getElementName().equals("p1"));
-
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-public void testAddPackageFragment() throws CoreException {
- try {
- createJavaProject("P1", new String[] {"src1"});
- IJavaScriptProject p2 = createJavaProject("P2", new String[] {});
- IIncludePathEntry[] classpath =
- new IIncludePathEntry[] {
- JavaScriptCore.newProjectEntry(new Path("/P1"))
- };
- p2.setRawIncludepath(classpath, null);
-
- IPackageFragment[] res = getNameLookup((JavaProject)p2).findPackageFragments("p1", false);
- assertTrue("Should get no package fragment", res == null);
-
- createFolder("/P1/src1/p1");
-
- res = getNameLookup((JavaProject)p2).findPackageFragments("p1", false);
- assertTrue(
- "Should get 'p1' package fragment",
- res != null &&
- res.length == 1 &&
- res[0].getElementName().equals("p1"));
-
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-/*
- * Resolve, add pkg, resolve again: new pkg should be accessible
- * (regression test for bug 37962 Unexpected transient problem during reconcile
- */
-public void testAddPackageFragment2() throws CoreException {
- try {
- JavaProject project = (JavaProject)createJavaProject("P", new String[] {"src"});
- createFolder("/P/src/p1");
-
- IPackageFragment[] pkgs = getNameLookup(project).findPackageFragments("p1", false);
- assertElementsEqual(
- "Didn't find p1",
- "p1 [in src [in P]]",
- pkgs);
-
- createFolder("/P/src/p2");
-
- pkgs = getNameLookup(project).findPackageFragments("p2", false);
- assertElementsEqual(
- "Didn't find p2",
- "p2 [in src [in P]]",
- pkgs);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensures that a NameLookup can be created with working copies that contain duplicate types
- * (regression test for bug 63245 findPackageFragment won't return default package)
- */
-public void testDuplicateTypesInWorkingCopies() throws CoreException {
-// IJavaScriptUnit[] workingCopies = new IJavaScriptUnit[3];
- this.workingCopies = new IJavaScriptUnit[3];
- try {
- JavaProject project = (JavaProject)createJavaProject("P");
- workingCopies[0] = getWorkingCopy(
- "/P/X.js",
- "function foo() {\n" +
- "}"
- );
- workingCopies[1] = getWorkingCopy(
- "/P/Y.js",
- "function foo() {\n" +
- "}"
- );
- workingCopies[2] = getWorkingCopy(
- "/P/Z.js",
- "function foo() {\n" +
- "}"
- );
- NameLookup nameLookup = project.newNameLookup(workingCopies);
- // NameLookup.Answer answer=nameLookup.findBinding("foo","",Binding.METHOD, false, NameLookup.ACCEPT_ALL,false);
- NameLookup.Answer answer=nameLookup.findBinding("foo","",Binding.METHOD, false, NameLookup.ACCEPT_ALL,false, false, null);
- assertEquals(
- "Unepexted ",
- "foo",
- ((IJavaScriptElement)answer.element).getElementName());
- } finally {
-// discardWorkingCopies(workingCopies);
- deleteProject("P");
- }
-}
-/*
- * Find a default package fragment in a non-default root by its path.
- * (regression test for bug 63245 findPackageFragment won't return default package)
- */
-public void testFindDefaultPackageFragmentInNonDefaultRoot() throws CoreException {
- try {
- JavaProject project = (JavaProject)createJavaProject("P", new String[] {"src"});
-
- IPackageFragment pkg = getNameLookup(project).findPackageFragment(new Path("/P/src"));
- assertElementsEqual(
- "Didn't find default package",
- "<default> [in src [in P]]",
- new IJavaScriptElement[] {pkg});
-
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensure that finding a package fragment with a working copy opened returns one element only
- * (regression test for bug 89624 Open on selection proposes twice the same entry)
- */
-public void testFindPackageFragmentWithWorkingCopy() throws CoreException {
- this.workingCopies = new IJavaScriptUnit[1];
- try {
- JavaProject project = (JavaProject)createJavaProject("P");
- createFolder("/P/p1");
- workingCopies[0] = getWorkingCopy(
- "/P/p1/X.js",
- "function X() {\n" +
- "}"
- );
- NameLookup nameLookup = project.newNameLookup(workingCopies);
- IJavaScriptElement[] pkgs = nameLookup.findPackageFragments("p1", false/*not a partial match*/);
- assertElementsEqual(
- "Unexpected packages",
- "p1 [in <project root> [in P]]",
- pkgs);
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensure that a member type with a name ending with a dollar and a number is found
- * (regression test for bug 103466 Stack Overflow: Requesting Java AST from selection)
- */
-public void testFindBinaryTypeWithDollarName() throws CoreException, IOException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- addLibrary(project, "lib.jar", "libsrc.zip",
- new String[] {
- "p/X.js",
- "package p;\n" +
- "public class X {\n" +
- " public class $1 {\n" +
- " public class $2 {\n" +
- " }\n" +
- " }\n" +
- "}"
- },
- "1.4");
- IType type = getNameLookup((JavaProject) project).findType("p.X$$1", false, NameLookup.ACCEPT_ALL);
- assertTypesEqual(
- "Unexpected type",
- "p.X$$1\n",
- new IType[] {type});
- } finally {
- deleteProject("P");
- }
-}
-/*
- * Ensure that a type with the same simple name as its member type is found
- * (regression test for bug 102286 Error when trying F4-Type Hierarchy)
- */
-public void testFindBinaryTypeWithSameNameAsMember() throws CoreException, IOException {
- try {
- IJavaScriptProject project = createJavaProject("P", new String[] {}, new String[] {"/P/lib"}, new String[] {});
- createFolder("/P/lib/p");
- createFile("/P/lib/p/X.js", "");
- createFile("/P/lib/p/X$X.js", "");
- IType type = getNameLookup((JavaProject) project).findType("p.X", false, NameLookup.ACCEPT_ALL);
- assertTypesEqual(
- "Unexpected type",
- "p.X\n",
- new IType[] {type});
- } finally {
- deleteProject("P");
- }
-}
-}
-
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NamingConventionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NamingConventionTests.java
deleted file mode 100644
index 33a9219..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NamingConventionTests.java
+++ /dev/null
@@ -1,729 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.NamingConventions;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-
-public class NamingConventionTests extends AbstractJavaModelTests {
-
-IJavaScriptProject project;
-
-public NamingConventionTests(String name) {
- super(name);
-}
-
-public static Test suite() {
- return buildModelTestSuite(NamingConventionTests.class);
-}
-/**
- * Setup for the next test.
- */
-public void setUp() throws Exception {
- super.setUp();
-
- project = createJavaProject("P", new String[]{"src"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-}
-/**
- * Cleanup after the previous test.
- */
-public void tearDown() throws Exception {
- this.deleteProject("P"); //$NON-NLS-1$
-
- super.tearDown();
-}
-private String toString(char[][] suggestions) {
- if(suggestions == null) {
- return ""; //$NON-NLS-1$
- }
-
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < suggestions.length; i++) {
- if(i != 0) {
- buffer.append('\n');
- }
- buffer.append(suggestions[i]);
- }
- return buffer.toString();
-}
-public void testSuggestFieldName001() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "name\n" + //$NON-NLS-1$
- "oneName", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName002() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneClass".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "class1\n" + //$NON-NLS-1$
- "oneClass", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName003() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"f"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "fName\n" + //$NON-NLS-1$
- "fOneName\n" + //$NON-NLS-1$
- "name\n" + //$NON-NLS-1$
- "oneName", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName004() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"_"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "_name\n" + //$NON-NLS-1$
- "_oneName\n" + //$NON-NLS-1$
- "name\n" + //$NON-NLS-1$
- "oneName", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName005() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"f"); //$NON-NLS-1$
- Object staticFieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES,"fg"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 0,
- Flags.AccStatic,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES,staticFieldPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "fgName\n" + //$NON-NLS-1$
- "fgOneName\n" + //$NON-NLS-1$
- "name\n" + //$NON-NLS-1$
- "oneName", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName006() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "preNamesuf\n" + //$NON-NLS-1$
- "preOneNamesuf\n" + //$NON-NLS-1$
- "preName\n" + //$NON-NLS-1$
- "preOneName\n" + //$NON-NLS-1$
- "namesuf\n" + //$NON-NLS-1$
- "oneNamesuf\n" + //$NON-NLS-1$
- "name\n" + //$NON-NLS-1$
- "oneName", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName007() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "int".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "preIsuf\n" + //$NON-NLS-1$
- "preI\n" + //$NON-NLS-1$
- "isuf\n" + //$NON-NLS-1$
- "i", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName008() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- new char[][]{"name".toCharArray()}); //$NON-NLS-1$
-
- assertEquals(
- "name2\n" + //$NON-NLS-1$
- "oneName", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName009() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- new char[][]{"preNamesuf".toCharArray()}); //$NON-NLS-1$
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "preName2suf\n" + //$NON-NLS-1$
- "preOneNamesuf\n" + //$NON-NLS-1$
- "preName\n" + //$NON-NLS-1$
- "preOneName\n" + //$NON-NLS-1$
- "namesuf\n" + //$NON-NLS-1$
- "oneNamesuf\n" + //$NON-NLS-1$
- "name\n" + //$NON-NLS-1$
- "oneName", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName010() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "OneName".toCharArray(), //$NON-NLS-1$
- 1,
- 0,
- new char[][]{"preNamesuf".toCharArray()}); //$NON-NLS-1$
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "preNamessuf\n" + //$NON-NLS-1$
- "preOneNamessuf\n" + //$NON-NLS-1$
- "preNames\n" + //$NON-NLS-1$
- "preOneNames\n" + //$NON-NLS-1$
- "namessuf\n" + //$NON-NLS-1$
- "oneNamessuf\n" + //$NON-NLS-1$
- "names\n" + //$NON-NLS-1$
- "oneNames", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName011() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c".toCharArray(), //$NON-NLS-1$
- "Factory".toCharArray(), //$NON-NLS-1$
- 1,
- 0,
- CharOperation.NO_CHAR_CHAR); //$NON-NLS-1$
-
- assertEquals(
- "factories", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName012() {
- String[] suggestions = NamingConventions.suggestFieldNames(
- project,
- "a.b.c", //$NON-NLS-1$
- "FooBar", //$NON-NLS-1$
- 0,
- 0,
- new String[]{"bar"}); //$NON-NLS-1$
-
- assertEquals(
- "bar2\n" + //$NON-NLS-1$
- "fooBar", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName013() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "java.lang".toCharArray(), //$NON-NLS-1$
- "Class".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "class1",//$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName014() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "java.lang".toCharArray(), //$NON-NLS-1$
- "Class".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- new char[][]{"class1".toCharArray()}); //$NON-NLS-1$
-
- assertEquals(
- "class2",//$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName015() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "".toCharArray(), //$NON-NLS-1$
- "#".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "name",//$NON-NLS-1$
- toString(suggestions));
-}
-public void testSuggestFieldName016() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "".toCharArray(), //$NON-NLS-1$
- "#".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- new char[][]{"name".toCharArray()}); //$NON-NLS-1$
-
- assertEquals(
- "name2",//$NON-NLS-1$
- toString(suggestions));
-}
-/*
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=35356
- */
-public void testSuggestFieldName017() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "".toCharArray(), //$NON-NLS-1$
- "names".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- new char[][]{});
-
- assertEquals(
- "names",//$NON-NLS-1$
- toString(suggestions));
-}
-/*
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=35356
- */
-public void testSuggestFieldName018() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "".toCharArray(), //$NON-NLS-1$
- "names".toCharArray(), //$NON-NLS-1$
- 1,
- 0,
- new char[][]{});
-
- assertEquals(
- "names",//$NON-NLS-1$
- toString(suggestions));
-}
-/*
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=35356
- */
-public void testSuggestFieldName019() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "".toCharArray(), //$NON-NLS-1$
- "MyClass".toCharArray(), //$NON-NLS-1$
- 0,
- 0,
- new char[][]{});
-
- assertEquals(
- "class1\n" + //$NON-NLS-1$
- "myClass", //$NON-NLS-1$
- toString(suggestions));
-}
-/*
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=35356
- */
-public void testSuggestFieldName020() {
- char[][] suggestions = NamingConventions.suggestFieldNames(
- project,
- "".toCharArray(), //$NON-NLS-1$
- "MyClass".toCharArray(), //$NON-NLS-1$
- 1,
- 0,
- new char[][]{});
-
- assertEquals(
- "classes\n" + //$NON-NLS-1$
- "myClasses", //$NON-NLS-1$
- toString(suggestions));
-}
-public void testRemovePrefixAndSuffixForFieldName001() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] name = NamingConventions.removePrefixAndSuffixForFieldName(
- project,
- "preOneNamesuf".toCharArray(), //$NON-NLS-1$
- 0);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "oneName", //$NON-NLS-1$
- new String(name));
-}
-public void testRemovePrefixAndSuffixForFieldName002() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pr, pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"uf, suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] name = NamingConventions.removePrefixAndSuffixForFieldName(
- project,
- "preOneNamesuf".toCharArray(), //$NON-NLS-1$
- Flags.AccStatic);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "preOneNamesuf", //$NON-NLS-1$
- new String(name));
-}
-public void testRemovePrefixAndSuffixForFieldName003() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pr, pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"uf, suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] name = NamingConventions.removePrefixAndSuffixForFieldName(
- project,
- "preOneNamesuf".toCharArray(), //$NON-NLS-1$
- 0);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "oneName", //$NON-NLS-1$
- new String(name));
-}
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=114086
-public void testRemovePrefixAndSuffixForFieldName004() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pre,"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] name = NamingConventions.removePrefixAndSuffixForFieldName(
- project,
- "preOneName".toCharArray(), //$NON-NLS-1$
- 0);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "oneName", //$NON-NLS-1$
- new String(name));
-}
-public void testRemovePrefixAndSuffixForLocalName001() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,"pr, pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,"uf, suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] name = NamingConventions.removePrefixAndSuffixForLocalVariableName(
- project,
- "preOneNamesuf".toCharArray() //$NON-NLS-1$
- );
-
- options.put(JavaScriptCore.CODEASSIST_LOCAL_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "oneName", //$NON-NLS-1$
- new String(name));
-}
-public void testSuggestGetterName001() {
- char[] suggestion = NamingConventions.suggestGetterName(
- project,
- "fieldName".toCharArray(), //$NON-NLS-1$
- 0,
- false,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "getFieldName", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestGetterName002() {
- char[] suggestion = NamingConventions.suggestGetterName(
- project,
- "FieldName".toCharArray(), //$NON-NLS-1$
- 0,
- false,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "getFieldName", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestGetterName003() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pr, pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"uf, suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] suggestion = NamingConventions.suggestGetterName(
- project,
- "preFieldName".toCharArray(), //$NON-NLS-1$
- 0,
- false,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "getFieldName", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestGetterName004() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pr, pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"uf, suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] suggestion = NamingConventions.suggestGetterName(
- project,
- "preFieldNamesuf".toCharArray(), //$NON-NLS-1$
- 0,
- false,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "getFieldName", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestGetterName005() {
- Hashtable options = JavaScriptCore.getOptions();
- Object fieldPrefixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_PREFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,"pr, pre"); //$NON-NLS-1$
- Object fieldSuffixPreviousValue = options.get(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,"uf, suf"); //$NON-NLS-1$
- JavaScriptCore.setOptions(options);
-
- char[] suggestion = NamingConventions.suggestGetterName(
- project,
- "preFieldNamesuf".toCharArray(), //$NON-NLS-1$
- 0,
- true,
- CharOperation.NO_CHAR_CHAR);
-
- options.put(JavaScriptCore.CODEASSIST_FIELD_PREFIXES,fieldPrefixPreviousValue);
- options.put(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES,fieldSuffixPreviousValue);
- JavaScriptCore.setOptions(options);
- assertEquals(
- "isFieldName", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestGetterName006() {
- char[] suggestion = NamingConventions.suggestGetterName(
- project,
- "isSomething".toCharArray(), //$NON-NLS-1$
- 0,
- true,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "isSomething", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestGetterName007() {
- char[] suggestion = NamingConventions.suggestGetterName(
- project,
- "isSomething".toCharArray(), //$NON-NLS-1$
- 0,
- false,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "getIsSomething", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestSetterName001() {
- char[] suggestion = NamingConventions.suggestSetterName(
- project,
- "isSomething".toCharArray(), //$NON-NLS-1$
- 0,
- true,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "setSomething", //$NON-NLS-1$
- new String(suggestion));
-}
-public void testSuggestSetterName002() {
- char[] suggestion = NamingConventions.suggestSetterName(
- project,
- "isSomething".toCharArray(), //$NON-NLS-1$
- 0,
- false,
- CharOperation.NO_CHAR_CHAR);
-
- assertEquals(
- "setIsSomething", //$NON-NLS-1$
- new String(suggestion));
-}
-/*
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=133562
- */
-public void testSuggestLocalName001() {
- Map options = this.project.getOptions(true);
- try {
- Map newOptions = new HashMap(options);
- newOptions.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_5);
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_5);
- newOptions.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_5);
- this.project.setOptions(newOptions);
-
- String[] suggestions = NamingConventions.suggestLocalVariableNames(
- project,
- "",//$NON-NLS-1$
- "Enum",//$NON-NLS-1$
- 0,
- new String[]{"o"});
-
- assertEquals(
- "enum1", //$NON-NLS-1$
- toString(suggestions));
- } finally {
- this.project.setOptions(options);
- }
-}
-/*
- * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=133562
- */
-public void testSuggestLocalName002() {
- Map options = this.project.getOptions(true);
- try {
- Map newOptions = new HashMap(options);
- newOptions.put(JavaScriptCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaScriptCore.VERSION_1_5);
- newOptions.put(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_5);
- newOptions.put(JavaScriptCore.COMPILER_COMPLIANCE, JavaScriptCore.VERSION_1_5);
- this.project.setOptions(newOptions);
-
- String[] suggestions = NamingConventions.suggestLocalVariableNames(
- project,
- "",//$NON-NLS-1$
- "Enums",//$NON-NLS-1$
- 0,
- new String[]{"o"});
-
- assertEquals(
- "enums", //$NON-NLS-1$
- toString(suggestions));
- } finally {
- this.project.setOptions(options);
- }
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/OptionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/OptionTests.java
deleted file mode 100644
index 5c440e0..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/OptionTests.java
+++ /dev/null
@@ -1,632 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import junit.framework.Test;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.JavaProject;
-import org.osgi.service.prefs.BackingStoreException;
-
-public class OptionTests extends ModifyingResourceTests {
-
- int eventCount = 0;
-
- class TestPropertyListener implements IEclipsePreferences.IPreferenceChangeListener {
- public void preferenceChange(PreferenceChangeEvent event) {
- eventCount++;
- }
- }
-
- public OptionTests(String name) {
- super(name);
- }
- static {
-// TESTS_NUMBERS = new int[] { 125360 };
-// TESTS_RANGE = new int[] { 4, -1 };
- }
- public static Test suite() {
- return buildModelTestSuite(OptionTests.class);
- }
-
- protected void tearDown() throws Exception {
- // Put back default options
- JavaScriptCore.setOptions(JavaScriptCore.getDefaultOptions());
-
- super.tearDown();
- }
-
- /**
- * Test persistence of project custom options
- */
- public void test01() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- IJavaScriptProject projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.DISABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "8.0");
- options.put(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, JavaScriptCore.ERROR);
- JavaScriptCore.setOptions(options);
-
- options.clear();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.ENABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "10.0");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.ENABLED, projectA.getOption(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, true));
- assertEquals("projA:unexpected custom value for compliance option", "10.0", projectA.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true));
- assertEquals("projA:unexpected inherited value1 for hidden-catch option", JavaScriptCore.ERROR, projectA.getOption(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, true));
-
- // check project B custom options (should be none, indicating it sees global ones only)
- assertEquals("projB:unexpected custom value for deprecation option", JavaScriptCore.DISABLED, projectB.getOption(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, true));
- assertEquals("projB:unexpected custom value for compliance option", "8.0", projectB.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true));
- assertEquals("projB:unexpected inherited value for hidden-catch option", JavaScriptCore.ERROR, projectB.getOption(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, true));
-
- // flush custom options - project A should revert to global ones
- projectA.setOptions(null);
- assertEquals("projA:unexpected reverted value for deprecation option", JavaScriptCore.DISABLED, projectA.getOption(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, true));
- assertEquals("projA:unexpected reverted value for compliance option", "8.0", projectA.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true));
- assertEquals("projA:unexpected inherited value2 for hidden-catch option", JavaScriptCore.ERROR, projectA.getOption(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, true));
-
- } finally {
- this.deleteProject("A");
- this.deleteProject("B");
- }
- }
-
- /**
- * Test custom encoding
- */
- public void test02() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- IJavaScriptProject projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- String globalEncoding = JavaScriptCore.getOption(JavaScriptCore.CORE_ENCODING);
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.CORE_ENCODING, "custom");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom encoding", "custom", projectA.getOption(JavaScriptCore.CORE_ENCODING, true));
-
- // check project B custom options (should be none, indicating it sees global ones only)
- assertEquals("projB:unexpected custom encoding", globalEncoding, projectB.getOption(JavaScriptCore.CORE_ENCODING, true));
-
- // flush custom options - project A should revert to global ones
- projectA.setOptions(null);
- assertEquals("projA:unexpected reverted encoding", globalEncoding, projectA.getOption(JavaScriptCore.CORE_ENCODING, true));
-
- } finally {
- this.deleteProject("A");
- this.deleteProject("B");
- }
- }
-
- /**
- * Test custom project option (if not considering JavaScriptCore options)
- */
- public void test03() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- IJavaScriptProject projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.DISABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "8.0");
- options.put(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, JavaScriptCore.ERROR);
- JavaScriptCore.setOptions(options);
-
- options.clear();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.ENABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "10.0");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.ENABLED, projectA.getOption(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, false));
- assertEquals("projA:unexpected custom value for compliance option", "10.0", projectA.getOption(JavaScriptCore.COMPILER_COMPLIANCE, false));
- assertEquals("projA:unexpected inherited value1 for hidden-catch option", null, projectA.getOption(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, false));
-
- // check project B custom options (should be none, indicating it sees global ones only)
- assertEquals("projB:unexpected custom value for deprecation option", null, projectB.getOption(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, false));
- assertEquals("projB:unexpected custom value for compliance option", null, projectB.getOption(JavaScriptCore.COMPILER_COMPLIANCE, false));
- assertEquals("projB:unexpected inherited value for hidden-catch option", null, projectB.getOption(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, false));
-
- // flush custom options - project A should revert to global ones
- projectA.setOptions(null);
- assertEquals("projA:unexpected reverted value for deprecation option", null, projectA.getOption(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, false));
- assertEquals("projA:unexpected reverted value for compliance option", null, projectA.getOption(JavaScriptCore.COMPILER_COMPLIANCE, false));
- assertEquals("projA:unexpected inherited value2 for hidden-catch option", null, projectA.getOption(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, false));
-
- } finally {
- this.deleteProject("A");
- this.deleteProject("B");
- }
- }
- /**
- * Test persistence of project custom options - using getOptions()
- */
- public void test04() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- IJavaScriptProject projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.DISABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "8.0");
- options.put(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, JavaScriptCore.ERROR);
- JavaScriptCore.setOptions(options);
-
- options.clear();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.ENABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "10.0");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.ENABLED, projectA.getOptions(true).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected custom value for compliance option", "10.0", projectA.getOptions(true).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projA:unexpected inherited value1 for hidden-catch option", JavaScriptCore.ERROR, projectA.getOptions(true).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
-
- // check project B custom options (should be none, indicating it sees global ones only)
- assertEquals("projB:unexpected custom value for deprecation option", JavaScriptCore.DISABLED, projectB.getOptions(true).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projB:unexpected custom value for compliance option", "8.0", projectB.getOptions(true).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projB:unexpected inherited value for hidden-catch option", JavaScriptCore.ERROR, projectB.getOptions(true).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
-
- // flush custom options - project A should revert to global ones
- projectA.setOptions(null);
- assertEquals("projA:unexpected reverted value for deprecation option", JavaScriptCore.DISABLED, projectA.getOptions(true).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected reverted value for compliance option", "8.0", projectA.getOptions(true).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projA:unexpected inherited value2 for hidden-catch option", JavaScriptCore.ERROR, projectA.getOptions(true).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
-
- } finally {
- this.deleteProject("A");
- this.deleteProject("B");
- }
- }
-
- /**
- * Test custom encoding - using getOptions()
- */
- public void test05() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- IJavaScriptProject projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- String globalEncoding = JavaScriptCore.getOption(JavaScriptCore.CORE_ENCODING);
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.CORE_ENCODING, "custom");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom encoding", "custom", projectA.getOptions(true).get(JavaScriptCore.CORE_ENCODING));
-
- // check project B custom options (should be none, indicating it sees global ones only)
- assertEquals("projB:unexpected custom encoding", globalEncoding, projectB.getOptions(true).get(JavaScriptCore.CORE_ENCODING));
-
- // flush custom options - project A should revert to global ones
- projectA.setOptions(null);
- assertEquals("projA:unexpected reverted encoding", globalEncoding, projectA.getOptions(true).get(JavaScriptCore.CORE_ENCODING));
-
- } finally {
- this.deleteProject("A");
- this.deleteProject("B");
- }
- }
-
- /**
- * Test custom project option (if not considering JavaScriptCore options) - using getOptions()
- */
- public void test06() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- IJavaScriptProject projectB =
- this.createJavaProject(
- "B",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.DISABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "8.0");
- options.put(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK, JavaScriptCore.ERROR);
- JavaScriptCore.setOptions(options);
-
- options.clear();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.ENABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "10.0");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.ENABLED, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected custom value for compliance option", "10.0", projectA.getOptions(false).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projA:unexpected inherited value1 for hidden-catch option", null, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
-
- // check project B custom options (should be none, indicating it sees global ones only)
- assertEquals("projB:unexpected custom value for deprecation option", null, projectB.getOptions(false).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projB:unexpected custom value for compliance option", null, projectB.getOptions(false).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projB:unexpected inherited value for hidden-catch option", null, projectB.getOptions(false).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
-
- // flush custom options - project A should revert to global ones
- projectA.setOptions(null);
- assertEquals("projA:unexpected reverted value for deprecation option", null, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected reverted value for compliance option", null, projectA.getOptions(false).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projA:unexpected inherited value2 for hidden-catch option", null, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
-
- } finally {
- this.deleteProject("A");
- this.deleteProject("B");
- }
- }
- /**
- * Custom options must replace existing ones completely without loosing property listeners
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=26255
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=49691
- */
- public void test07() throws CoreException {
- try {
- this.eventCount = 0;
- JavaProject projectA = (JavaProject)
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- // Preferences preferences = projectA.getPreferences();
- // preferences.addPropertyChangeListener(new TestPropertyListener());
- IEclipsePreferences eclipsePreferences = projectA.getEclipsePreferences();
- TestPropertyListener listener = new TestPropertyListener();
- eclipsePreferences.addPreferenceChangeListener(listener);
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.ENABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "10.0");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.ENABLED, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected custom value for compliance option", "10.0", projectA.getOptions(false).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projA:unexpected inherited value1 for hidden-catch option", null, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
- // assertTrue("projA:preferences should not be reset", preferences == projectA.getPreferences());
- assertTrue("projA:preferences should not be reset", eclipsePreferences == projectA.getEclipsePreferences());
- assertTrue("projA:preferences property listener has been lost", eventCount == 2);
-
- // change custom options to have one less
- options.clear();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.ENABLED);
- projectA.setOptions(options);
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.ENABLED, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected custom value for compliance option", null, projectA.getOptions(false).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertEquals("projA:unexpected inherited value1 for hidden-catch option", null, projectA.getOptions(false).get(JavaScriptCore.COMPILER_PB_HIDDEN_CATCH_BLOCK));
- // assertTrue("projA:preferences should not be reset", preferences == projectA.getPreferences());
- assertTrue("projA:preferences should not be reset", eclipsePreferences == projectA.getEclipsePreferences());
- assertTrue("projA:preferences property listener has been lost", eventCount == 3);
- } finally {
- this.deleteProject("A");
- }
- }
- /**
- * Empty custom option must not be ignored
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=26251
- */
- public void test08() throws CoreException {
- try {
- IJavaScriptProject projectA =
- this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.COMPILER_TASK_TAGS, "TODO:");
- JavaScriptCore.setOptions(options);
-
-
- // check project A custom options
- assertEquals("1#projA:unexpected custom value for task tags option", null, projectA.getOption(JavaScriptCore.COMPILER_TASK_TAGS, false));
- assertEquals("1#projA:unexpected custom value for inherited task tags option", "TODO:", projectA.getOption(JavaScriptCore.COMPILER_TASK_TAGS, true));
- assertEquals("1#workspace:unexpected custom value for task tags option", "TODO:", JavaScriptCore.getOption(JavaScriptCore.COMPILER_TASK_TAGS));
-
- // change custom options to have one less
- options.clear();
- options.put(JavaScriptCore.COMPILER_TASK_TAGS, "");
- projectA.setOptions(options);
- assertEquals("2#projA:unexpected custom value for task tags option", "", projectA.getOption(JavaScriptCore.COMPILER_TASK_TAGS, false));
- assertEquals("2#projA:unexpected custom value for inherited task tags option", "", projectA.getOption(JavaScriptCore.COMPILER_TASK_TAGS, true));
- assertEquals("2#workspace:unexpected custom value for task tags option", "TODO:", JavaScriptCore.getOption(JavaScriptCore.COMPILER_TASK_TAGS));
-
- // change custom options to have one less
- options.clear();
- options.put(JavaScriptCore.COMPILER_TASK_TAGS, "@TODO");
- JavaScriptCore.setOptions(options);
- assertEquals("3#projA:unexpected custom value for task tags option", "", projectA.getOption(JavaScriptCore.COMPILER_TASK_TAGS, false));
- assertEquals("3#projA:unexpected custom value for inherited task tags option", "", projectA.getOption(JavaScriptCore.COMPILER_TASK_TAGS, true));
- assertEquals("3#workspace:unexpected custom value for task tags option", "@TODO", JavaScriptCore.getOption(JavaScriptCore.COMPILER_TASK_TAGS));
-
- } finally {
- this.deleteProject("A");
- }
- }
- /**
- * Custom options must replace existing ones completely without loosing property listeners
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=59258
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=60896
- */
- public void test09() throws CoreException {
- try {
- this.eventCount = 0;
- JavaProject projectA = (JavaProject) this.createJavaProject("A", new String[] {});
- // Preferences preferences = projectA.getPreferences();
- // preferences.addPropertyChangeListener(new TestPropertyListener());
- IEclipsePreferences eclipsePreferences = projectA.getEclipsePreferences();
- eclipsePreferences.addPreferenceChangeListener(new TestPropertyListener());
-
- Hashtable options = new Hashtable();
- options.put(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE, JavaScriptCore.ENABLED);
- options.put(JavaScriptCore.COMPILER_COMPLIANCE, "10.0");
- projectA.setOptions(options);
-
- // check project A custom options
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.ENABLED, projectA.getOptions(true).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected custom value for compliance option", "10.0", projectA.getOptions(true).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertTrue("projA:preferences should not be reset", eclipsePreferences == projectA.getEclipsePreferences());
- assertEquals("projA:preferences property listener has been lost", 2, eventCount);
-
- // delete/create project A and verify that options are well reset
- this.deleteProject("A");
- projectA = (JavaProject) this.createJavaProject("A", new String[] {});
- assertEquals("projA:unexpected custom value for deprecation option", JavaScriptCore.getOption(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE), projectA.getOptions(true).get(JavaScriptCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE));
- assertEquals("projA:unexpected custom value for compliance option", JavaScriptCore.getOption(JavaScriptCore.COMPILER_COMPLIANCE), projectA.getOptions(true).get(JavaScriptCore.COMPILER_COMPLIANCE));
- assertTrue("projA:preferences should not be reset", eclipsePreferences != projectA.getEclipsePreferences());
- } finally {
- this.deleteProject("A");
- }
- }
-
- /*
- * Ensures that a classpath variable is still in the preferences after shutdown/restart
- * (regression test for bug 98720 [preferences] classpath variables are not exported if the session is closed and restored)
- */
- public void test10() throws CoreException {
- JavaScriptCore.setIncludepathVariable("TEST", new Path("testing"), null);
- simulateExitRestart();
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- IEclipsePreferences preferences = manager.getInstancePreferences();
- assertEquals(
- "Should find variable TEST in preferences",
- "testing",
- preferences.get(JavaModelManager.CP_VARIABLE_PREFERENCES_PREFIX+"TEST", "null"));
- }
-
- /*
- * Ensures that a classpath variable is removed from the preferences if set to null
- * (regression test for bug 98720 [preferences] classpath variables are not exported if the session is closed and restored)
- */
- public void test11() throws CoreException {
- JavaScriptCore.setIncludepathVariable("TEST", new Path("testing"), null);
- JavaScriptCore.removeIncludepathVariable("TEST", null);
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- IEclipsePreferences preferences = manager.getInstancePreferences();
- assertEquals(
- "Should not find variable TEST in preferences",
- "null",
- preferences.get(JavaModelManager.CP_VARIABLE_PREFERENCES_PREFIX+"TEST", "null"));
- }
-
- /*
- * Ensures that classpath problems are removed when a missing classpath variable is added through the preferences
- * (regression test for bug 109691 Importing preferences does not update classpath variables)
- */
- public void test12() throws CoreException {
- IEclipsePreferences preferences = JavaModelManager.getJavaModelManager().getInstancePreferences();
- try {
- IJavaScriptProject project = createJavaProject("P", new String[0], new String[] {"TEST"});
- waitForAutoBuild();
- preferences.put(JavaModelManager.CP_VARIABLE_PREFERENCES_PREFIX+"TEST", getSystemJsPathString());
- assertMarkers("Unexpected markers", "", project);
- } finally {
- deleteProject("P");
- preferences.remove(JavaModelManager.CP_VARIABLE_PREFERENCES_PREFIX+"TEST");
- }
- }
-
- /**
- * Bug 68993: [Preferences] IAE when opening project preferences
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=68993"
- */
- public void testBug68993() throws CoreException, BackingStoreException {
- try {
- JavaProject projectA = (JavaProject) this.createJavaProject(
- "A",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
-
- // Store project eclipse prefs
- IEclipsePreferences eclipsePreferences = projectA.getEclipsePreferences();
-
- // set all project options as custom ones: this is what happens when user select
- // "Use project settings" in project 'Java Compiler' preferences page...
- Hashtable options = new Hashtable(projectA.getOptions(true));
- projectA.setOptions(options);
-
- // reset all project custom options: this is what happens when user select
- // "Use workspace settings" in project 'Java Compiler' preferences page...
- options = new Hashtable();
- options.put("internal.default.compliance", JavaScriptCore.DEFAULT);
- projectA.setOptions(options);
-
- // verify that project preferences have been reset
- assertFalse("projA: Preferences should have been reset", eclipsePreferences == projectA.getEclipsePreferences());
- assertEquals("projA: We should not have any custom options!", 0, projectA.getEclipsePreferences().keys().length);
- } finally {
- this.deleteProject("A");
- }
- }
-
- /**
- * Bug 72214: [Preferences] IAE when opening project preferences
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=72214"
- */
- public void testBug72214() throws CoreException, BackingStoreException {
- // Remove JavaScriptCore instance prefs
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- IEclipsePreferences preferences = manager.getInstancePreferences();
- int size = JavaScriptCore.getOptions().size();
- preferences.removeNode();
-
- // verify that JavaScriptCore preferences have been reset
- assertFalse("JavaScriptCore preferences should have been reset", preferences == manager.getInstancePreferences());
- assertEquals("JavaScriptCore preferences should have been resotred!", size, JavaScriptCore.getOptions().size());
- }
-
- /**
- * Bug 100393: Defaults for compiler errors/warnings settings
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=100393"
- */
- public void testBug100393() throws CoreException, BackingStoreException {
- // Get default compiler options
- Map options = new CompilerOptions().getMap();
-
- // verify that CompilerOptions default preferences for modified options
- assertEquals("Invalid default for "+CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING, options.get(CompilerOptions.OPTION_ReportUnusedLocal));
- assertEquals("Invalid default for "+CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING, options.get(CompilerOptions.OPTION_ReportUnusedPrivateMember));
- assertEquals("Invalid default for "+CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE, options.get(CompilerOptions.OPTION_ReportFieldHiding));
- assertEquals("Invalid default for "+CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE, options.get(CompilerOptions.OPTION_ReportLocalVariableHiding));
- }
- public void testBug100393b() throws CoreException, BackingStoreException {
- // Get JavaScriptCore default preferences
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- IEclipsePreferences preferences = manager.getDefaultPreferences();
-
- // verify that JavaScriptCore default preferences for modified options
- assertEquals("Invalid default for "+JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, "warning", preferences.get(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, "null"));
- assertEquals("Invalid default for "+JavaScriptCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER, "warning", preferences.get(JavaScriptCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER, "null"));
- assertEquals("Invalid default for "+JavaScriptCore.COMPILER_PB_FIELD_HIDING, "ignore", preferences.get(JavaScriptCore.COMPILER_PB_FIELD_HIDING, "null"));
- assertEquals("Invalid default for "+JavaScriptCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, "ignore", preferences.get(JavaScriptCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, "null"));
- }
-
- /**
- * @bug 125360: IJavaScriptProject#setOption() doesn't work if same option as default
- * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=125360"
- */
- public void testBug125360() throws CoreException, BackingStoreException {
- try {
- JavaProject project = (JavaProject) createJavaProject(
- "P",
- new String[] {}, // source folders
- new String[] {}, // lib folders
- new String[] {});
- project.setOption(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- project.setOption(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_3);
- String option = project.getOption(JavaScriptCore.COMPILER_SOURCE, true);
- assertEquals(JavaScriptCore.VERSION_1_3, option);
- } finally {
- deleteProject("P");
- }
- }
-
- /**
- * @bug 131707: Cannot add classpath variables when starting with -pluginCustomization option
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=131707"
- */
- public void testBug131707() throws CoreException {
- IEclipsePreferences defaultPreferences = new DefaultScope().getNode(JavaScriptCore.PLUGIN_ID);
- try {
- defaultPreferences.put("org.eclipse.wst.jsdt.core.classpathVariable.MY_DEFAULT_LIB", "c:\\temp\\lib.jar");
- simulateExitRestart();
- String[] variableNames = JavaScriptCore.getIncludepathVariableNames();
- for (int i = 0, length = variableNames.length; i < length; i++) {
- if ("MY_DEFAULT_LIB".equals(variableNames[i])) {
- assertEquals(
- "Unexpected value for MY_DEFAULT_LIB",
- new Path("c:\\temp\\lib.jar"),
- JavaScriptCore.getIncludepathVariable("MY_DEFAULT_LIB"));
- return;
- }
- }
- assertFalse("Variable MY_DEFAULT_LIB not found", true);
- } finally {
- defaultPreferences.remove("org.eclipse.wst.jsdt.core.classpathVariable.MY_DEFAULT_LIB");
- }
- }
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/OverflowingCacheTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/OverflowingCacheTests.java
deleted file mode 100644
index f28779a..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/OverflowingCacheTests.java
+++ /dev/null
@@ -1,692 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.*;
-import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.IBufferChangedListener;
-import org.eclipse.wst.jsdt.core.IOpenable;
-import org.eclipse.wst.jsdt.internal.core.*;
-import org.eclipse.wst.jsdt.internal.core.BufferCache;
-import org.eclipse.wst.jsdt.internal.core.Openable;
-import org.eclipse.wst.jsdt.internal.core.OverflowingLRUCache;
-import org.eclipse.wst.jsdt.internal.core.util.MementoTokenizer;
-
-import junit.framework.Test;
-
-/**
- * Tests internal Java element cache and buffer cache.
- */
-public class OverflowingCacheTests extends ModifyingResourceTests {
-
- /**
- * Simple implementation of IBuffer to test the BufferCache.
- * A OverflowingTestBuffer is created with/without saved changes (determined
- * by client), and is opened on creation.
- */
- public class OverflowingTestBuffer implements IBuffer {
- /**
- * True if this buffer is open, otherwise false.
- */
- public boolean isOpen;
-
- /**
- * True if this buffer has unsaved changes, otherwise false.
- */
- public boolean hasUnsavedChanges;
-
- /**
- * The cache this buffer is stored in
- */
- public OverflowingLRUCache cache;
-
- /**
- * This buffers owner (this buffer's key in this buffer's cache)
- */
- public IOpenable owner;
-
- public OverflowingTestBuffer(boolean hasUnsavedChanges, OverflowingLRUCache cache) {
- super();
- this.hasUnsavedChanges= hasUnsavedChanges;
- this.cache= cache;
- }
-
- public void addBufferChangedListener(IBufferChangedListener listener) {
- // Not required for testing, does nothing.
- }
-
- public void append(char[] text) {
- // Sets this buffer to have unsaved changes, but the actual contents are ignored.
- this.hasUnsavedChanges= true;
- }
-
- public void append(String text) {
- // Sets this buffer to have unsaved changes, but the actual contents are ignored.
- this.hasUnsavedChanges= true;
- }
-
- public void close() {
- // Closes the buffer and removes it from its cache
- this.isOpen= false;
- this.cache.remove(this.owner);
- }
-
- public char getChar(int position) {
- // Returns a dummy char - test buffers have no contents
- return '.';
- }
-
- public char[] getCharacters() {
- // Returns null - test buffers have no contents
- return null;
- }
-
- public String getContents() {
- // Returns null - test buffers have no contents
- return null;
- }
-
- public int getLength() {
- // Returns 0 - test buffers have no contents
- return 0;
- }
-
- public IOpenable getOwner() {
- return this.owner;
- }
-
- public String getText(int beginIndex, int endIndex) {
- // Returns null - test buffers have no contents
- return null;
- }
-
- public IResource getUnderlyingResource() {
- // Returns null - test buffers have no underlying resource
- return null;
- }
-
- public boolean hasUnsavedChanges() {
- return this.hasUnsavedChanges;
- }
-
- public boolean isClosed() {
- return !this.isOpen;
- }
-
- public boolean isReadOnly() {
- return false;
- }
-
- public void removeBufferChangedListener(IBufferChangedListener listener) {
- // Not required for testing, does nothing.
- }
-
- public void replace(int position, int length, char[] text) {
- // Sets this buffer to have unsaved changes, but the actual contents are ignored.
- this.hasUnsavedChanges = true;
- }
-
- public void replace(int position, int length, String text) {
- // Sets this buffer to have unsaved changes, but the actual contents are ignored.
- this.hasUnsavedChanges = true;
- }
-
- public void save(IProgressMonitor progress) throws IllegalArgumentException {
- save(progress, false);
- }
-
- public void save(IProgressMonitor progress, boolean force) throws IllegalArgumentException {
- this.hasUnsavedChanges= false;
- }
-
- public void setContents(char[] contents) {
- // Sets this buffer to have unsaved changes, but the actual contents are ignored.
- this.hasUnsavedChanges= true;
- }
-
- public void setContents(String contents) {
- // Sets this buffer to have unsaved changes, but the actual contents are ignored.
- this.hasUnsavedChanges= true;
- }
- }
-
- /**
- * Simple implementation of IOpenable to test the ElementCache.
- * A OverflowingTestBuffer is created with/without saved changes (determined
- * by client), and is opened on creation.
- */
-
- public class OverflowingTestOpenable extends Openable {
- /**
- * True if this element is open, otherwise false.
- */
- public boolean isOpen;
-
- public OverflowingTestBuffer buffer;
-
- /**
- * The cache this element is stored in
- */
- public OverflowingLRUCache cache;
-
- /**
- * Constructs a new openable, with unsaved changes as specified,
- * that lives in the given cache, and opens it.
- */
- public OverflowingTestOpenable(OverflowingTestBuffer buffer, OverflowingLRUCache cache) {
- super(null);
- this.buffer = buffer;
- buffer.owner = this;
- this.cache= cache;
- open(null);
- }
-
- protected boolean buildStructure(OpenableElementInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) {
- return false;
- }
-
- public void close() {
- // Closes this element and removes if from the cache.
- this.isOpen = false;
- this.cache.remove(this);
- }
-
- public boolean equals(Object o) {
- if (!(o instanceof OverflowingTestOpenable)) return false;
- return super.equals(o);
- }
-
- public IBuffer getBuffer() {
- // This functionality not required for testing element cache - returns <code>null</code>.
- return null;
- }
-
- public int getElementType() {
- return 0;
- }
-
- public IJavaScriptElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
- return null;
- }
-
- protected char getHandleMementoDelimiter() {
- return 0;
- }
-
- public IPath getPath() {
- return null;
- }
-
- public IResource getResource() {
- return null;
- }
-
- public boolean hasUnsavedChanges() {
- return this.buffer.hasUnsavedChanges();
- }
-
- public boolean isConsistent() {
- return true;
- }
-
- public boolean isOpen() {
- return this.isOpen;
- }
-
- public void makeConsistent(IProgressMonitor pm) {
- // This functionality not required for testing element cache - does nothing.
- }
-
- public void open(IProgressMonitor pm) {
- this.isOpen = true;
- }
-
- public void save(IProgressMonitor pm) {
- save(pm, false);
- }
-
- public void save(IProgressMonitor pm, boolean force) {
- this.buffer.hasUnsavedChanges = false;
- }
- }
-
- public static Test suite() {
- return buildModelTestSuite(OverflowingCacheTests.class);
- }
-
- public OverflowingCacheTests(String name) {
- super(name);
- }
-
- /**
- * Returns true if i is not divisible by 10.
- */
- private boolean hasUnsavedChanges(int i) {
- return i % 10 != 0;
- }
-
- /*
- * Ensures that the Java model cache adapts its size for a project with a number of roots greater than the default max.
- */
- public void testBigNumberOfRoots() throws CoreException {
- try {
- IJavaScriptProject project = createJavaProject("P");
- int rootSize = JavaModelCache.DEFAULT_ROOT_SIZE * 2;
- for (int i = 0; i < rootSize; i++) {
- if (i < 10)
- createFolder("/P/src00" + i);
- else if (i < 100)
- createFolder("/P/src0" + i);
- else
- createFolder("/P/src" + i);
- }
- IIncludePathEntry[] classpath = new IIncludePathEntry[rootSize+1];
- for (int i = 0; i < rootSize; i++) {
- if (i < 10)
- classpath[i] = JavaScriptCore.newSourceEntry(new Path("/P/src00" + i));
- else if (i < 100)
- classpath[i] = JavaScriptCore.newSourceEntry(new Path("/P/src0" + i));
- else
- classpath[i] = JavaScriptCore.newSourceEntry(new Path("/P/src" + i));
- }
- classpath[rootSize] = JavaScriptCore.newVariableEntry(new Path("JCL_LIB"), null, null);
- project.setRawIncludepath(classpath, null);
-
- // Open all roots
- IJavaScriptElement[] roots = project.getChildren();
- for (int i = 0; i < rootSize; i++) {
- ((IOpenable) roots[i]).open(null);
- }
-
- // Ensure that all roots remained opened
- for (int i = 0; i < rootSize; i++) {
- assertTrue("Root should be opened " + roots[i], ((IOpenable) roots[i]).isOpen());
- }
- } finally {
- deleteProject("P");
- }
- }
-
-
- /**
- * Creates an empty BufferCache and ensures that it answers correctly
- * for #getSpaceLimit, #getCurrentSpace, and #getOverlflow.
- */
- public void testBufferCacheCreation() {
- int spaceLimit = 10, actualSpaceLimit;
- int overflow = 0, actualOverflow;
- int current = 0, actualCurrent;
- OverflowingLRUCache cache = new BufferCache(spaceLimit);
-
- actualSpaceLimit = cache.getSpaceLimit();
- assertEquals("space limit incorrect ", spaceLimit, actualSpaceLimit);
-
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect ", current, actualCurrent);
-
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect ", overflow, actualOverflow);
- }
-
- /**
- * Creates an empty BufferCache of size 20, inserts 20 buffers
- * and ensures that it is full, with zero overflow.
- */
- public void testBufferCacheFill() {
- int spaceLimit = 20, actualSpaceLimit;
- int overflow = 0, actualOverflow;
- int current = 0, actualCurrent;
-
- OverflowingLRUCache cache = new BufferCache(spaceLimit);
- OverflowingTestBuffer[] buffers= new OverflowingTestBuffer[spaceLimit];
- OverflowingTestOpenable[] openables= new OverflowingTestOpenable[spaceLimit];
- for(int i = 0; i < spaceLimit; i++) {
- buffers[i] = new OverflowingTestBuffer(false, cache);
- openables[i]= new OverflowingTestOpenable(buffers[i], null);
- cache.put(openables[i], buffers[i]);
- current++;
- }
-
- actualSpaceLimit = cache.getSpaceLimit();
- assertEquals("space limit incorrect ", spaceLimit, actualSpaceLimit);
-
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect ", current, actualCurrent);
-
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect ", overflow, actualOverflow);
-
- for(int i = spaceLimit - 1; i >= 0; i--) {
- Object value = cache.get(openables[i]);
- assertEquals("wrong value ("+i+")", buffers[i], value);
- }
- }
-
- /**
- * Creates an empty BufferCache of size 500, inserts 1000 buffers
- * and ensures that the cache has 334 buffers left in it. When the
- * 501st buffer is placed in the cache, the cache will remove 333
- * buffers from the cache leaving 167 buffers in the cache. When the
- * 833rd buffer is added, it will reach its space limit again, and
- * shrink to 167 entries. The remaining 167 buffers will be added
- * the cache, leaving it with 334 entries.
- */
- public void testBufferCacheUseNoOverflow() {
- int spaceLimit = 500, actualSpaceLimit;
- int overflow = 0, actualOverflow;
- int actualCurrent, predictedCurrent = 334;
- int entryCount = 1000;
-
- OverflowingLRUCache cache = new BufferCache(spaceLimit);
- OverflowingTestOpenable[] openables = new OverflowingTestOpenable[entryCount];
- OverflowingTestBuffer[] buffers= new OverflowingTestBuffer[entryCount];
- for(int i = 0; i < entryCount; i++) {
- buffers[i]= new OverflowingTestBuffer(false, cache);
- openables[i] = new OverflowingTestOpenable(buffers[i], null);
- cache.put(openables[i], buffers[i]);
- }
-
- actualSpaceLimit = cache.getSpaceLimit();
- assertEquals("space limit incorrect ", spaceLimit, actualSpaceLimit);
-
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect ", predictedCurrent, actualCurrent);
-
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect ", overflow, actualOverflow);
-
-
- for(int i = entryCount - 1; i >= entryCount - predictedCurrent; i--) {
- Object value = cache.get(openables[i]);
- assertEquals("wrong value ("+i+")", buffers[i], value);
- }
-
- // ensure first 500 entries swaped out
- for(int i = 0; i < spaceLimit; i++) {
- Object value = cache.get(openables[i]);
- assertEquals("entry should not be present", null, value);
- }
- }
-
- /**
- * Creates an empty BufferCache of size 500, inserts 1000 buffers.
- * Nine of every ten entries cannot be removed - there are 1000 entries,
- * leaving 900 entries which can't be closed. The table size should equal
- * 900 when done with an overflow of 400.
- *
- * @see #hasUnsavedChanges(int)
- */
- public void testBufferCacheUseOverflow() {
- int spaceLimit = 500;
- int entryCount = 1000;
-
- OverflowingLRUCache cache = new BufferCache(spaceLimit);
- OverflowingTestOpenable[] openables = new OverflowingTestOpenable[entryCount];
- OverflowingTestBuffer[] buffers= new OverflowingTestBuffer[entryCount];
- for (int i = 0; i < entryCount; i++) {
- boolean hasUnsavedChanges = hasUnsavedChanges(i);
- buffers[i]= new OverflowingTestBuffer(hasUnsavedChanges, cache);
- openables[i] = new OverflowingTestOpenable(buffers[i], null);
- cache.put(openables[i], buffers[i]);
- }
-
- Hashtable table = cache.getEntryTable();
- assertEquals("Hashtable wrong size", 900, table.size());
-
- int actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect", 900, actualCurrent);
-
- int actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect", 400, actualOverflow);
-
- for (int i = entryCount - 1; i >= 0; i--) {
- if (hasUnsavedChanges(i)) {
- Object value = cache.get(openables[i]);
- assertEquals("wrong value (" + i + ")", buffers[i], value);
- }
- }
-
- // the cache should shrink back to the spaceLimit as we save entries with unsaved changes
- for (int i= 0; i < entryCount; i++) {
- buffers[i].save(null, false);
- }
- // now add another entry to remove saved openables.
- OverflowingTestBuffer buffer1= new OverflowingTestBuffer(false, cache);
- IOpenable openable1= new OverflowingTestOpenable(buffer1, null);
- cache.put(openable1, buffer1);
-
- // now the size should be back to 168, with 0 overflow
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect (after flush)", 168, actualCurrent);
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect (after flush)", 0, actualOverflow);
- }
-
- /**
- * Tests the actual Java Model buffer cache to ensure that it fills and empties
- * as expected. This test first closes all open buffers to ensure the cache
- * is empty.
- *
- * <p>60 compilation units are opened to fill the cache.
- */
- public void testBufferRecycling() throws CoreException {
- Enumeration openBuffers= BufferManager.getDefaultBufferManager().getOpenBuffers();
- while (openBuffers.hasMoreElements()) {
- IBuffer buf= (IBuffer)openBuffers.nextElement();
- buf.close();
- }
- openBuffers= BufferManager.getDefaultBufferManager().getOpenBuffers();
- assertTrue("buffer cache not empty", !openBuffers.hasMoreElements());
-
- try {
- createJavaProject("P");
- for (int i = 0; i < 61; i++) {
- createFile(
- "P/X" + i + ".js",
- "public class X" + i + " {\n" +
- "}"
- );
- }
- IPackageFragment pkg= getPackage("P");
- IJavaScriptUnit[] cus = pkg.getJavaScriptUnits();
-
- // fill the cache - open 60 buffers
- int max = 60;
- for (int i= 0; i < max; i++) {
- cus[i].getBuffer();
- }
-
- // should be 60 buffers now
- openBuffers= BufferManager.getDefaultBufferManager().getOpenBuffers();
- int count= 0;
- while (openBuffers.hasMoreElements()) {
- openBuffers.nextElement();
- count++;
- }
- assertEquals("incorrect numbers of open buffers (1)", max, count);
-
- // open one more buffer should cause the cache to free up 2/3rds of its space
- // which means 40 buffers will be closed, and 1 will be added (this one),
- // totalling 21 = 60 - 40 + 1.
- cus[max].getBuffer();
- openBuffers= BufferManager.getDefaultBufferManager().getOpenBuffers();
- count= 0;
- while (openBuffers.hasMoreElements()) {
- openBuffers.nextElement();
- count++;
- }
- assertEquals("incorrect numbers of open buffers (2)", 21, count);
-
- //re-opening a previous open buffer should work fine
- cus[0].getBuffer();
- openBuffers= BufferManager.getDefaultBufferManager().getOpenBuffers();
- count= 0;
- while (openBuffers.hasMoreElements()) {
- openBuffers.nextElement();
- count++;
- }
- assertEquals("incorrect numbers of open buffers (3)", 22, count);
- } finally {
- deleteProject("P");
- }
- }
-
- /**
- * Creates an empty ElementCache and ensures that it answers correctly
- * for #getSpaceLimit, #getCurrentSpace, and #getOverlflow.
- */
- public void testElementCacheCreation() {
- int spaceLimit = 10, actualSpaceLimit;
- int overflow = 0, actualOverflow;
- int current = 0, actualCurrent;
- OverflowingLRUCache cache = new ElementCache(spaceLimit);
-
- actualSpaceLimit = cache.getSpaceLimit();
- assertEquals("space limit incorrect ", spaceLimit, actualSpaceLimit);
-
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect ", current, actualCurrent);
-
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect ", overflow, actualOverflow);
- }
-
- /**
- * Creates an empty ElementCache of size 500, inserts 500 elements
- * and ensures that it is full, with zero overflow.
- */
- public void testElementCacheFill() {
- int spaceLimit = 500, actualSpaceLimit;
- int overflow = 0, actualOverflow;
- int current = 0, actualCurrent;
-
- OverflowingLRUCache cache = new ElementCache(spaceLimit);
- OverflowingTestOpenable[] openables = new OverflowingTestOpenable[spaceLimit];
- for(int i = 0; i < spaceLimit; i++) {
- openables[i] = new OverflowingTestOpenable(new OverflowingTestBuffer(false, null), cache);
- cache.put(openables[i], Integer.toString(i));
- current++;
- }
-
- actualSpaceLimit = cache.getSpaceLimit();
- assertEquals("space limit incorrect ", spaceLimit, actualSpaceLimit);
-
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect ", current, actualCurrent);
-
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect ", overflow, actualOverflow);
-
- for(int i = spaceLimit - 1; i >= 0; i--) {
- Object value = cache.get(openables[i]);
- assertEquals("wrong value (" + i + ")", Integer.toString(i), value);
- }
- }
-
- /**
- * Creates an empty ElementCache of size 500, inserts 1000 elements
- * and ensures that the cache has 334 elements left in it. When the
- * 501st element is placed in the cache, the cache will remove 333
- * elements from the cache leaving 167 elements in the cache. When the
- * 833rd element is added, it will reach its space limit again, and
- * shrink to 167 entries. The remaining 167 elements will be added
- * the cache, leaving it with 334 entries.
- */
- public void testElementCacheUseNoOverflow() {
- int spaceLimit = 500, actualSpaceLimit;
- int overflow = 0, actualOverflow;
- int actualCurrent, predictedCurrent = 334;
- int entryCount = 1000;
-
- OverflowingLRUCache cache = new ElementCache(spaceLimit);
- OverflowingTestOpenable[] openables = new OverflowingTestOpenable[entryCount];
- for(int i = 0; i < entryCount; i++) {
- openables[i] = new OverflowingTestOpenable(new OverflowingTestBuffer(false, null), cache);
- cache.put(openables[i], Integer.toString(i));
- }
-
- actualSpaceLimit = cache.getSpaceLimit();
- assertEquals("space limit incorrect ", spaceLimit, actualSpaceLimit);
-
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect ", predictedCurrent, actualCurrent);
-
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect ", overflow, actualOverflow);
-
- for(int i = entryCount - 1; i >= entryCount - predictedCurrent; i--) {
- Object value = cache.get(openables[i]);
- assertEquals("wrong value (" + i + ")", Integer.toString(i), value);
- }
-
- // ensure first 500 entries swaped out
- for(int i = 0; i < spaceLimit; i++) {
- Object value = cache.get(openables[i]);
- assertEquals("entry should not be present", null, value);
- }
- }
-
- /**
- * Creates an empty ElementCache of size 500, inserts 1000 elements.
- * Nine of every ten entries cannot be removed - there are 1000 entries,
- * leaving 900 entries which can't be closed. Thetable size should equal
- * 900 when done with an overflow of 400.
- *
- * @see #hasUnsavedChanges(int)
- */
- public void testElementCacheUseOverflow() {
- int spaceLimit = 500;
- int entryCount = 1000;
-
- OverflowingLRUCache cache = new ElementCache(spaceLimit);
- OverflowingTestOpenable[] openables = new OverflowingTestOpenable[entryCount];
- for (int i = 0; i < entryCount; i++) {
- openables[i] = new OverflowingTestOpenable(new OverflowingTestBuffer(hasUnsavedChanges(i), null), cache);
- cache.put(openables[i], Integer.toString(i));
- }
-
- Hashtable table = cache.getEntryTable();
- assertEquals("Hashtable wrong size", 900, table.size());
- int actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect", 900, actualCurrent);
- int actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect", 400, actualOverflow);
-
- for (int i = entryCount - 1; i >= 0; i--) {
- if (hasUnsavedChanges(i)) {
- Object value = cache.get(openables[i]);
- assertEquals("wrong value (" + i + ")", Integer.toString(i), value);
- }
- }
-
- // the cache should shrink back to the spaceLimit as we save entries with unsaved changes
- for (int i= 0; i < entryCount; i++) {
- openables[i].save(null, false);
- }
- // now add another entry to remove saved openables.
- cache.put(Integer.toString(1001), new OverflowingTestOpenable(new OverflowingTestBuffer(false, null), cache));
- // now the size should be back to 500, with 0 overflow
- actualCurrent = cache.getCurrentSpace();
- assertEquals("current space incorrect (after flush)", 168, actualCurrent);
- actualOverflow = cache.getOverflow();
- assertEquals("overflow space incorrect (after flush)", 0, actualOverflow);
- }
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerStatementsRecoveryTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerStatementsRecoveryTests.java
deleted file mode 100644
index d9301cd..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerStatementsRecoveryTests.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-
-import junit.framework.Test;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager;
-import org.eclipse.wst.jsdt.core.*;
-
-public class ReconcilerStatementsRecoveryTests extends ModifyingResourceTests {
-
- protected IJavaScriptUnit workingCopy;
- protected ProblemRequestor problemRequestor;
-
- /* A problem requestor that auto-cancels on first problem */
- class CancelingProblemRequestor extends ProblemRequestor {
- IProgressMonitor progressMonitor = new IProgressMonitor() {
- boolean isCanceled = false;
- public void beginTask(String name, int totalWork) {}
- public void done() {}
- public void internalWorked(double work) {}
- public boolean isCanceled() {
- return this.isCanceled;
- }
- public void setCanceled(boolean value) {
- this.isCanceled = value;
- }
- public void setTaskName(String name) {}
- public void subTask(String name) {}
- public void worked(int work) {}
- };
-
- boolean isCanceling = false;
- public void acceptProblem(IProblem problem) {
- if (isCanceling) this.progressMonitor.setCanceled(true); // auto-cancel on first problem
- super.acceptProblem(problem);
- }
- }
-
-/**
- */
-public ReconcilerStatementsRecoveryTests(String name) {
- super(name);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// JavaModelManager.VERBOSE = true;
-// org.eclipse.wst.jsdt.internal.core.search.BasicSearchEngine.VERBOSE = true;
-// TESTS_PREFIX = "testIgnoreIfBetterNonAccessibleRule";
-// TESTS_NAMES = new String[] { "testExternal" };
-// TESTS_NUMBERS = new int[] { 118823 };
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-public static Test suite() {
- return buildModelTestSuite(ReconcilerStatementsRecoveryTests.class);
-}
-protected void assertProblems(String message, String expected) {
- assertProblems(message, expected, this.problemRequestor);
-}
-// Expect no error as soon as indexing is finished
-protected void assertNoProblem(char[] source, IJavaScriptUnit unit) throws InterruptedException, JavaScriptModelException {
- IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
- if (this.problemRequestor.problemCount > 0) {
- // If errors then wait for indexes to finish
- while (indexManager.awaitingJobsCount() > 0) {
- Thread.sleep(100);
- }
- // Reconcile again to see if error goes away
- this.problemRequestor.initialize(source);
- unit.getBuffer().setContents(source); // need to set contents again to be sure that following reconcile will be really done
- unit.reconcile(AST.JLS3,
- true, // force problem detection to see errors if any
- null, // do not use working copy owner to not use working copies in name lookup
- null);
- if (this.problemRequestor.problemCount > 0) {
- assertEquals("Working copy should NOT have any problem!", "", this.problemRequestor.problems.toString());
- }
- }
-}
-protected void addClasspathEntries(IIncludePathEntry[] entries, boolean enableForbiddenReferences) throws JavaScriptModelException {
- IJavaScriptProject project = getJavaProject("Reconciler");
- IIncludePathEntry[] oldClasspath = project.getRawIncludepath();
- int oldLength = oldClasspath.length;
- int length = entries.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldLength+length];
- System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
- System.arraycopy(entries, 0, newClasspath, oldLength, length);
- project.setRawIncludepath(newClasspath, null);
-
- if (enableForbiddenReferences) {
- project.setOption(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
- }
-}
-protected void removeClasspathEntries(IIncludePathEntry[] entries) throws JavaScriptModelException {
- IJavaScriptProject project = getJavaProject("Reconciler");
- IIncludePathEntry[] oldClasspath = project.getRawIncludepath();
- int oldLength = oldClasspath.length;
- int length = entries.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldLength-length];
- System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength-length);
- project.setRawIncludepath(newClasspath, null);
-}
-/**
- * Setup for the next test.
- */
-public void setUp() throws Exception {
- super.setUp();
- this.problemRequestor = new ProblemRequestor();
- this.workingCopy = getCompilationUnit("Reconciler/src/p1/X.js").getWorkingCopy(new WorkingCopyOwner() {}, null);
- this.problemRequestor.initialize(this.workingCopy.getSource().toCharArray());
- startDeltas();
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- // Create project with 1.4 compliance
- IJavaScriptProject project14 = createJavaProject("Reconciler", new String[] {"src"}, new String[] {"JCL_LIB"});
- createFolder("/Reconciler/src/p1");
- createFolder("/Reconciler/src/p2");
- createFile(
- "/Reconciler/src/p1/X.js",
- " function foo() {\n" +
- "}"
- );
- project14.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
- project14.setOption(JavaScriptCore.COMPILER_PB_INVALID_JAVADOC, JavaScriptCore.WARNING);
-
- // Create project with 1.5 compliance
- IJavaScriptProject project15 = createJavaProject("Reconciler15", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin", "1.5");
- addLibrary(
- project15,
- "lib15.jar",
- "lib15src.zip",
- new String[] {
- "java/util/List.js",
- "package java.util;\n" +
- "public class List<T> {\n" +
- "}",
- "java/util/Stack.js",
- "package java.util;\n" +
- "public class Stack<T> {\n" +
- "}",
- "java/util/Map.js",
- "package java.util;\n" +
- "public interface Map<K,V> {\n" +
- "}",
- "java/lang/annotation/Annotation.js",
- "package java.lang.annotation;\n" +
- "public interface Annotation {\n" +
- "}",
- "java/lang/Deprecated.js",
- "package java.lang;\n" +
- "public @interface Deprecated {\n" +
- "}",
- "java/lang/SuppressWarnings.js",
- "package java.lang;\n" +
- "public @interface SuppressWarnings {\n" +
- " String[] value();\n" +
- "}"
- },
- JavaScriptCore.VERSION_1_5
- );
- project15.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
-}
-//private void setUp15WorkingCopy() throws JavaScriptModelException {
-// setUp15WorkingCopy("Reconciler15/src/p1/X.js", new WorkingCopyOwner() {});
-//}
-//private void setUp15WorkingCopy(String path, WorkingCopyOwner owner) throws JavaScriptModelException {
-// String contents = this.workingCopy.getSource();
-// setUpWorkingCopy(path, contents, owner);
-//}
-//private void setUpWorkingCopy(String path, String contents) throws JavaScriptModelException {
-// setUpWorkingCopy(path, contents, new WorkingCopyOwner() {});
-//}
-//private void setUpWorkingCopy(String path, String contents, WorkingCopyOwner owner) throws JavaScriptModelException {
-// this.workingCopy.discardWorkingCopy();
-// this.workingCopy = getCompilationUnit(path).getWorkingCopy(owner, this.problemRequestor, null);
-// setWorkingCopyContents(contents);
-// this.workingCopy.makeConsistent(null);
-//}
-void setWorkingCopyContents(String contents) throws JavaScriptModelException {
- this.workingCopy.getBuffer().setContents(contents);
- this.problemRequestor.initialize(contents.toCharArray());
-}
-/**
- * Cleanup after the previous test.
- */
-public void tearDown() throws Exception {
- TestvalidationParticipant.PARTICIPANT = null;
- if (this.workingCopy != null) {
- this.workingCopy.discardWorkingCopy();
- }
- stopDeltas();
- super.tearDown();
-}
-public void tearDownSuite() throws Exception {
- deleteProject("Reconciler");
- deleteProject("Reconciler15");
- super.tearDownSuite();
-}
-/*
- * No ast and no statements recovery
- */
-public void testStatementsRecovery01() throws CoreException {
- // Introduce syntax error
- setWorkingCopyContents(
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " UnknownType name\n" +
- " }\n" +
- "}");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, false, null, null);
- assertDeltas(
- "Unexpected delta after syntax error",
- "[Working copy] X.js[*]: {CONTENT | FINE GRAINED}"
- );
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.js (at line 5)\n" +
- " UnknownType name\n" +
- " ^^^^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n"
- );
-
- clearDeltas();
-}
-/*
- * Ast and no statements recovery
- */
-public void testStatementsRecovery02() throws CoreException {
- // Introduce syntax error
- setWorkingCopyContents(
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " UnknownType name\n" +
- " }\n" +
- "}");
- this.workingCopy.reconcile(AST.JLS3, false, false, null, null);
- assertDeltas(
- "Unexpected delta after syntax error",
- "[Working copy] X.js[*]: {CONTENT | FINE GRAINED | AST AFFECTED}"
- );
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.js (at line 5)\n" +
- " UnknownType name\n" +
- " ^^^^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n"
- );
-
- clearDeltas();
-}
-/*
- * No ast, statements recovery
- */
-public void testStatementsRecovery03() throws CoreException {
- // Introduce syntax error
- setWorkingCopyContents(
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " UnknownType name\n" +
- " }\n" +
- "}");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, true, null, null);
- assertDeltas(
- "Unexpected delta after syntax error",
- "[Working copy] X.js[*]: {CONTENT | FINE GRAINED}"
- );
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.js (at line 5)\n" +
- " UnknownType name\n" +
- " ^^^^^^^^^^^\n" +
- "UnknownType cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in /Reconciler/src/p1/X.js (at line 5)\n" +
- " UnknownType name\n" +
- " ^^^^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n"
- );
-
- clearDeltas();
-}
-/*
- * Ast, statements recovery
- */
-public void testStatementsRecovery04() throws CoreException {
- // Introduce syntax error
- setWorkingCopyContents(
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " UnknownType name\n" +
- " }\n" +
- "}");
- this.workingCopy.reconcile(AST.JLS3, false, true, null, null);
- assertDeltas(
- "Unexpected delta after syntax error",
- "[Working copy] X.js[*]: {CONTENT | FINE GRAINED | AST AFFECTED}"
- );
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.js (at line 5)\n" +
- " UnknownType name\n" +
- " ^^^^^^^^^^^\n" +
- "UnknownType cannot be resolved to a type\n" +
- "----------\n" +
- "2. ERROR in /Reconciler/src/p1/X.js (at line 5)\n" +
- " UnknownType name\n" +
- " ^^^^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
- "----------\n"
- );
-
- clearDeltas();
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java
deleted file mode 100644
index 5d2b782..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java
+++ /dev/null
@@ -1,3413 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.model;
-
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.compiler.ReconcileContext;
-import org.eclipse.wst.jsdt.core.compiler.ValidationParticipant;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.tests.util.Util;
-import org.eclipse.wst.jsdt.internal.core.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager;
-
-public class ReconcilerTests extends ModifyingResourceTests {
-
- protected IJavaScriptUnit workingCopy;
- protected ProblemRequestor problemRequestor;
-
- /* A problem requestor that auto-cancels on first problem */
- class CancelingProblemRequestor extends ProblemRequestor {
- IProgressMonitor progressMonitor = new IProgressMonitor() {
- boolean isCanceled = false;
- public void beginTask(String name, int totalWork) {}
- public void done() {}
- public void internalWorked(double work) {}
- public boolean isCanceled() {
- return this.isCanceled;
- }
- public void setCanceled(boolean value) {
- this.isCanceled = value;
- }
- public void setTaskName(String name) {}
- public void subTask(String name) {}
- public void worked(int work) {}
- };
-
- boolean isCanceling = false;
- public void acceptProblem(IProblem problem) {
- if (isCanceling) this.progressMonitor.setCanceled(true); // auto-cancel on first problem
- super.acceptProblem(problem);
- }
- }
-
- class ReconcileParticipant extends ValidationParticipant {
- IJavaScriptElementDelta delta;
- org.eclipse.wst.jsdt.core.dom.JavaScriptUnit ast;
- ReconcileParticipant() {
- TestvalidationParticipant.PARTICIPANT = this;
- }
- public boolean isActive(IJavaScriptProject project) {
- return true;
- }
- public void reconcile(ReconcileContext context) {
- this.delta = context.getDelta();
- try {
- this.ast = context.getAST3();
- } catch (JavaScriptModelException e) {
- assertNull("Unexpected exception", e);
- }
- }
- }
-/**
- */
-public ReconcilerTests(String name) {
- super(name);
-}
-// Use this static initializer to specify subset for tests
-// All specified tests which do not belong to the class are skipped...
-static {
-// JavaModelManager.VERBOSE = true;
-// org.eclipse.jsdt.internal.core.search.BasicSearchEngine.VERBOSE = true;
-// TESTS_PREFIX = "testIgnoreIfBetterNonAccessibleRule";
-// TESTS_NAMES = new String[] { "testRawUsage" };
-// TESTS_NUMBERS = new int[] { 118823 };
-// TESTS_RANGE = new int[] { 16, -1 };
-}
-public static Test suite() {
- return buildModelTestSuite(ReconcilerTests.class);
-}
-protected void assertProblems(String message, String expected) {
- assertProblems(message, expected, this.problemRequestor);
-}
-// Expect no error as soon as indexing is finished
-protected void assertNoProblem(char[] source, IJavaScriptUnit unit) throws InterruptedException, JavaScriptModelException {
- IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
- if (this.problemRequestor.problemCount > 0) {
- // If errors then wait for indexes to finish
- while (indexManager.awaitingJobsCount() > 0) {
- Thread.sleep(100);
- }
- // Reconcile again to see if error goes away
- this.problemRequestor.initialize(source);
- unit.getBuffer().setContents(source); // need to set contents again to be sure that following reconcile will be really done
- unit.reconcile(AST.JLS3,
- true, // force problem detection to see errors if any
- null, // do not use working copy owner to not use working copies in name lookup
- null);
- if (this.problemRequestor.problemCount > 0) {
- assertEquals("Working copy should NOT have any problem!", "", this.problemRequestor.problems.toString());
- }
- }
-}
-protected void addClasspathEntries(IIncludePathEntry[] entries, boolean enableForbiddenReferences) throws JavaScriptModelException {
- IJavaScriptProject project = getJavaProject("Reconciler");
- IIncludePathEntry[] oldClasspath = project.getRawIncludepath();
- int oldLength = oldClasspath.length;
- int length = entries.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldLength+length];
- System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength);
- System.arraycopy(entries, 0, newClasspath, oldLength, length);
- project.setRawIncludepath(newClasspath, null);
-
- if (enableForbiddenReferences) {
- project.setOption(JavaScriptCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaScriptCore.ERROR);
- }
-}
-protected void removeClasspathEntries(IIncludePathEntry[] entries) throws JavaScriptModelException {
- IJavaScriptProject project = getJavaProject("Reconciler");
- IIncludePathEntry[] oldClasspath = project.getRawIncludepath();
- int oldLength = oldClasspath.length;
- int length = entries.length;
- IIncludePathEntry[] newClasspath = new IIncludePathEntry[oldLength-length];
- System.arraycopy(oldClasspath, 0, newClasspath, 0, oldLength-length);
- project.setRawIncludepath(newClasspath, null);
-}
-/**
- * Setup for the next test.
- */
-public void setUp() throws Exception {
- super.setUp();
- this.problemRequestor = new ProblemRequestor();
- this.workingCopy = getCompilationUnit("Reconciler/src/p1/X.js").getWorkingCopy(new WorkingCopyOwner() {}, null);
- this.problemRequestor.initialize(this.workingCopy.getSource().toCharArray());
- startDeltas();
-}
-public void setUpSuite() throws Exception {
- super.setUpSuite();
-
- // Create project with 1.4 compliance
- IJavaScriptProject project14 = createJavaProject("Reconciler", new String[] {"src"}, new String[] {"JCL_LIB"});
- createFolder("/Reconciler/src/p1");
- createFolder("/Reconciler/src/p2");
- createFile(
- "/Reconciler/src/p1/X.js",
- " function foo() {\n" +
- " }\n" +
- ""
- );
- project14.setOption(JavaScriptCore.COMPILER_SOURCE, JavaScriptCore.VERSION_1_4);
- project14.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
- project14.setOption(JavaScriptCore.COMPILER_PB_INVALID_JAVADOC, JavaScriptCore.WARNING);
-
- // Create project with 1.5 compliance
- IJavaScriptProject project15 = createJavaProject("Reconciler15", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin", "1.5");
-// addLibrary(
-// project15,
-// "lib15.jar",
-// "lib15src.zip",
-// new String[] {
-// "java/util/List.js",
-// "package java.util;\n" +
-// "public class List<T> {\n" +
-// "}",
-// "java/util/Stack.js",
-// "package java.util;\n" +
-// "public class Stack<T> {\n" +
-// "}",
-// "java/util/Map.js",
-// "package java.util;\n" +
-// "public interface Map<K,V> {\n" +
-// "}",
-// "java/lang/annotation/Annotation.js",
-// "package java.lang.annotation;\n" +
-// "public interface Annotation {\n" +
-// "}",
-// "java/lang/Deprecated.js",
-// "package java.lang;\n" +
-// "public @interface Deprecated {\n" +
-// "}",
-// "java/lang/SuppressWarnings.js",
-// "package java.lang;\n" +
-// "public @interface SuppressWarnings {\n" +
-// " String[] value();\n" +
-// "}"
-// },
-// JavaScriptCore.VERSION_1_5
-// );
-// project15.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
-// project15.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
-}
-private void setUp15WorkingCopy() throws JavaScriptModelException {
- setUp15WorkingCopy("Reconciler15/src/p1/X.js", new WorkingCopyOwner() {});
-}
-private void setUp15WorkingCopy(String path, WorkingCopyOwner owner) throws JavaScriptModelException {
- String contents = this.workingCopy.getSource();
- setUpWorkingCopy(path, contents, owner);
-}
-private void setUpWorkingCopy(String path, String contents) throws JavaScriptModelException {
- setUpWorkingCopy(path, contents, new WorkingCopyOwner() {});
-}
-private void setUpWorkingCopy(String path, String contents, WorkingCopyOwner owner) throws JavaScriptModelException {
- this.workingCopy.discardWorkingCopy();
- this.workingCopy = getCompilationUnit(path).getWorkingCopy(owner, null);
- setWorkingCopyContents(contents);
- this.workingCopy.makeConsistent(null);
-}
-void setWorkingCopyContents(String contents) throws JavaScriptModelException {
- this.workingCopy.getBuffer().setContents(contents);
- this.problemRequestor.initialize(contents.toCharArray());
-}
-/**
- * Cleanup after the previous test.
- */
-public void tearDown() throws Exception {
- TestvalidationParticipant.PARTICIPANT = null;
- if (this.workingCopy != null) {
- this.workingCopy.discardWorkingCopy();
- }
- stopDeltas();
- super.tearDown();
-}
-public void tearDownSuite() throws Exception {
- deleteProject("Reconciler");
- deleteProject("Reconciler15");
- super.tearDownSuite();
-}
-/*
- * Ensures that no problem is created for a reference to a type that is included in a prereq project.
- */
-
-
-public void test00() throws Exception {
-
-}
-
-
-public void test00a() throws JavaScriptModelException {
- setWorkingCopyContents(
- "function foo(){\n" +
- " alert();\n"+
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- }
-
-public void testAccessRestriction() throws CoreException {
- try {
- createJavaProject("P1", new String[] {"src"}, new String[] {"JCL_LIB"}, null, null, new String[0], null, null, new boolean[0], new String[][] {{"**/X.js"}}, null, "1.4");
- createFile("/P1/src/X.js", "function foo() {}");
-
- createJavaProject("P2", new String[] {"src"}, new String[] {"JCL_LIB"}, new String[] {"/P1"});
- setUpWorkingCopy("/P2/src/Y.js", "foo();");
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- } finally {
- deleteProject("P1");
- deleteProject("P2");
- }
-}
-///*
-// * Ensures that no problem is created for a reference to a binary type that is included in a prereq project.
-// * (regression test for bug 82542 Internal error during AST creation)
-// */
-//public void testAccessRestriction2() throws CoreException, IOException {
-// try {
-// IJavaScriptProject project = createJavaProject("P1");
-// addLibrary(
-// project,
-// "lib.jar",
-// "libsrc.zip",
-// new String[] {
-// "p/X.js",
-// "package p;\n" +
-// "public class X {\n" +
-// "}",
-// },
-// new String[] {
-// "**/*"
-// },
-// null,
-// "1.4"
-// );
-// createJavaProject("P2", new String[] {"src"}, new String[] {"JCL_LIB"}, new String[] {"/P1"}, "bin");
-// setUpWorkingCopy("/P2/src/Y.js", "public class Y extends p.X {}");
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "----------\n"
-// );
-// } finally {
-// deleteProject("P1");
-// deleteProject("P2");
-// }
-//}
-///*
-// * Ensures that no problem is created for a reference to a type that is included and not exported in a prereq project
-// * but with combineAccessRestriction flag set to false.
-// */
-//public void testAccessRestriction3() throws CoreException {
-// try {
-// createJavaProject("P1");
-// createFolder("/P1/p");
-// createFile("/P1/p/X.js", "package p; public class X {}");
-//
-// createJavaProject("P2", new String[] {}, new String[] {}, null, null, new String[] {"/P1"}, null, null, new boolean[] {true}, "", null, null, null, "1.4");
-//
-// createJavaProject("P3", new String[] {"src"}, new String[] {"JCL_LIB"}, null, null, new String[] {"/P2"}, null, new String[][] {new String[] {"**/X"}}, false/*don't combine access restrictions*/, new boolean[] {true}, "bin", null, null, null, "1.4");
-// setUpWorkingCopy("/P3/src/Y.js", "public class Y extends p.X {}");
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "----------\n"
-// );
-// } finally {
-// deleteProjects(new String[] {"P1", "P2", "P3" });
-// }
-//}
-///*
-// * Ensures that a problem is created for a reference to a type that is included and not exported in a prereq project
-// * but with combineAccessRestriction flag set to true.
-// */
-//public void testAccessRestriction4() throws CoreException {
-// try {
-// createJavaProject("P1");
-// createFolder("/P1/p");
-// createFile("/P1/p/X.js", "package p; public class X {}");
-//
-// createJavaProject("P2", new String[] {}, new String[] {}, null, null, new String[] {"/P1"}, null, null, new boolean[] {true}, "", null, null, null, "1.4");
-//
-// createJavaProject("P3", new String[] {"src"}, new String[] {"JCL_LIB"}, null, null, new String[] {"/P2"}, null, new String[][] {new String[] {"**/X"}}, true/*combine access restrictions*/, new boolean[] {true}, "bin", null, null, null, "1.4");
-// setUpWorkingCopy("/P3/src/Y.js", "public class Y extends p.X {}");
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "1. ERROR in /P3/src/Y.js (at line 1)\n" +
-// " public class Y extends p.X {}\n" +
-// " ^^^\n" +
-// "Access restriction: The type X is not accessible due to restriction on required project P1\n" +
-// "----------\n"
-// );
-// } finally {
-// deleteProjects(new String[] {"P1", "P2", "P3" });
-// }
-//}
-///*
-// * Ensures that a problem is created for a reference to a type that is no longer accessible in a prereq project.
-// * (regression test for bug 91498 Reconcile still sees old access rules)
-// */
-//public void testAccessRestriction5() throws CoreException {
-// try {
-// createJavaProject("P1");
-// createFolder("/P1/p");
-// createFile("/P1/p/X.js", "package p; public class X {}");
-// IJavaScriptProject p2 = createJavaProject("P2", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin");
-// IIncludePathEntry[] classpath = p2.getRawClasspath();
-// int length = classpath.length;
-// System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
-// classpath[length] = createSourceEntry("P2", "/P1", "+**/p/|-**/*");
-// p2.setRawClasspath(classpath, null);
-// setUpWorkingCopy("/P2/src/Y.js", "public class Y extends p.X {}");
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "----------\n"
-// );
-//
-// // remove accessible rule
-// System.arraycopy(classpath, 0, classpath = new IIncludePathEntry[length+1], 0, length);
-// classpath[length] = createSourceEntry("P2", "/P1", "-**/*");
-// p2.setRawClasspath(classpath, null);
-// this.problemRequestor.initialize(this.workingCopy.getSource().toCharArray());
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, true/*force problem detection*/, null, null);
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "1. ERROR in /P2/src/Y.js (at line 1)\n" +
-// " public class Y extends p.X {}\n" +
-// " ^^^\n" +
-// "Access restriction: The type X is not accessible due to restriction on required project P1\n" +
-// "----------\n"
-// );
-//
-// } finally {
-// deleteProjects(new String[] {"P1", "P2"});
-// }
-//}
-/**
- * Ensures that the reconciler handles duplicate members correctly.
- */
-public void testAddDuplicateMember() throws JavaScriptModelException {
- setWorkingCopyContents(
- " function foo() {\n" +
- " }\n" +
- " function foo() {\n" +
- " }\n" +
- " ");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "foo()#2[+]: {}"
- );
-}
-/**
- * Ensures that the reconciler reconciles the new contents with the current
- * contents, updating the structure of this reconciler's compilation
- * unit, and fires the Java element delta for the structural changes
- * of the addition of a field and a method.
- */
-public void testAddFieldAndConstructor() throws JavaScriptModelException {
- setWorkingCopyContents(
- " var i;\n" +
- " function X(p) {\n" +
- " }\n" +
- " function foo() {\n" +
- " }\n" +
- " ");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "X(p0)[+]: {}\n"+
- "i[+]: {}"
- );
-}
-///**
-// * Ensures that the reconciler reconciles the new contents with the current
-// * contents, updating the structure of this reconciler's compilation
-// * unit, and fires the Java element delta for the structural changes
-// * of the addition of a field and a constructor.
-// */
-//public void testAddImports() throws JavaScriptModelException {
-// setWorkingCopyContents(
-// "package p1;\n" +
-// "import p2.*;\n" +
-// "import java.lang.reflect.*;\n" +
-// "import java.util.Vector;\n" +
-// "public class X {\n" +
-// " public void foo() {\n" +
-// " }\n" +
-// "}");
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-// assertDeltas(
-// "Unexpected delta",
-// "<import container>[*]: {CHILDREN | FINE GRAINED}\n" +
-// " import java.lang.reflect.*[+]: {}\n" +
-// " import java.util.Vector[+]: {}"
-// );
-//}
-/**
- * Ensures that the reconciler reconciles the new contents with the current
- * contents, updating the structure of this reconciler's compilation
- * unit, and fires the Java element delta for the structural changes
- * of the addition of a method.
- */
-public void testAddMethod1() throws JavaScriptModelException {
- setWorkingCopyContents(
- " function foo() {\n" +
- " }\n" +
- " function bar() {\n" +
- " }\n" +
- " ");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "bar()[+]: {}"
- );
-}
-/**
- * Ensures that the reconciler reconciles the new contents with the current
- * contents,updating the structure of this reconciler's compilation
- * unit, and fires the Java element delta for the structural changes
- * of the addition of a portion of a new method.
- */
-public void testAddPartialMethod1() throws JavaScriptModelException {
- setWorkingCopyContents(
- " function some()\n" +
- " function foo() {\n" +
- " }\n" +
- " ");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "some()[+]: {}"
- );
-}
-/**
- * Ensures that the reconciler reconciles the new contents with the current
- * contents,updating the structure of this reconciler's compilation
- * unit, and fires the Java element delta for the structural changes
- * of the addition of a portion of a new method. Ensures that when a
- * second part is added to the new method no structural changes are recognized.
- */
-public void testAddPartialMethod1and2() throws JavaScriptModelException {
- // Add partial method before foo
- setWorkingCopyContents(
- " function some()\n" +
- " function foo() {\n" +
- " }\n" +
- "");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- // Add { on partial method
- clearDeltas();
- setWorkingCopyContents(
- " function some() {\n" +
- " function foo() {\n" +
- " }\n" +
- "");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "[Working copy] X.js[*]: {CONTENT | FINE GRAINED}"
- );
-}
-/*
- * Ensures that the AST broadcasted during a reconcile operation is correct.
- * (case of a working copy being reconciled with changes, creating AST and no problem detection)
- */
-public void testBroadcastAST1() throws JavaScriptModelException {
- setWorkingCopyContents(
- "var i;\n" +
- "");
- this.workingCopy.reconcile(AST.JLS3, false/*don't force problem detection*/, null/*primary owner*/, null/*no progress*/);
- assertASTNodeEquals(
- "Unexpected ast",
- "var i;\n" +
- "",
- this.deltaListener.getCompilationUnitAST(this.workingCopy));
-}
-/*
- * Ensures that the AST broadcasted during a reconcile operation is correct.
- * (case of a working copy being reconciled with NO changes, creating AST and forcing problem detection)
- */
-public void testBroadcastAST2() throws JavaScriptModelException {
- this.workingCopy.reconcile(AST.JLS3, true/*force problem detection*/, null/*primary owner*/, null/*no progress*/);
- assertASTNodeEquals(
- "Unexpected ast",
- "function foo(){\n" +
- "}\n" +
- "",
- this.deltaListener.getCompilationUnitAST(this.workingCopy));
-}
-/*
- * Ensures that the AST broadcasted during a reconcile operation is correct.
- * (case of a working copy being reconciled with NO changes, creating AST and no problem detection)
- */
-public void testBroadcastAST3() throws JavaScriptModelException {
- this.workingCopy.reconcile(AST.JLS3, false/*don't force problem detection*/, null/*primary owner*/, null/*no progress*/);
- assertASTNodeEquals(
- "Unexpected ast",
- "function foo(){\n" +
- "}" +
- "\n",
- this.deltaListener.getCompilationUnitAST(this.workingCopy));
-}
-/*
- * Ensures that the AST broadcasted during a reconcile operation is correct.
- * (case of a working copy being reconciled twice in a batch operation)
- */
-public void testBroadcastAST4() throws CoreException {
- JavaScriptCore.run(
- new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- ReconcilerTests.this.workingCopy.reconcile(AST.JLS3, true/*force problem detection*/, null/*primary owner*/, monitor);
- setWorkingCopyContents(
- "var i;");
- ReconcilerTests.this.workingCopy.reconcile(AST.JLS3, false/*don't force problem detection*/, null/*primary owner*/, monitor);
- }
- },
- null/*no progress*/);
- assertASTNodeEquals(
- "Unexpected ast",
- "var i;\n",
- this.deltaListener.getCompilationUnitAST(this.workingCopy));
-}
-/*
- * Ensures that reconciling a subclass doesn't close the buffer while resolving its superclass.
- * (regression test for bug 62854 refactoring does not trigger reconcile)
- */
-public void testBufferOpenAfterReconcile() throws CoreException {
- try {
- createFile(
- "/Reconciler/src/p1/Super.js",
- "package p1;\n" +
- "public class Super {\n" +
- "}"
- );
- setWorkingCopyContents(
- " function foo() {\n" +
- " }\n" +
- "");
- IBuffer buffer = this.workingCopy.getBuffer();
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, true, null, null);
- assertTrue("Buffer should still be open", !buffer.isClosed());
- } finally {
- deleteFile("/Reconciler/src/p1/Super.js");
- }
-}
-/**
- * Ensure an OperationCanceledException is correcly thrown when progress monitor is canceled
- * @deprecated using deprecated code
- */
-public void testCancel() throws JavaScriptModelException {
- setWorkingCopyContents(
- " function foo( s) {\n" +
- " }\n" +
- ""
- );
- this.workingCopy.makeConsistent(null);
-
- // count the number of time isCanceled() is called when converting this source unit
- CancelCounter counter = new CancelCounter();
- this.workingCopy.reconcile(AST.JLS2, true, null, counter);
-
- // throw an OperatonCanceledException at each point isCanceled() is called
- for (int i = 0; i < counter.count; i++) {
- boolean gotException = false;
- try {
- this.workingCopy.reconcile(AST.JLS2, true, null, new Canceler(i));
- } catch (OperationCanceledException e) {
- gotException = true;
- }
- assertTrue("Should get an OperationCanceledException (" + i + ")", gotException);
- }
-
- // last should not throw an OperationCanceledException
- this.workingCopy.reconcile(AST.JLS2, true, null, new Canceler(counter.count));
-}
-/**
- * Ensures that the delta is correct when adding a category
- */
-public void testCategories1() throws JavaScriptModelException {
- setWorkingCopyContents(
- " /**\n" +
- " * @category cat1\n" +
- " */\n" +
- " function foo() {\n" +
- " }\n" +
- ""
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "foo()[*]: {CATEGORIES}"
- );
-}
-/**
- * Ensures that the delta is correct when removing a category
- */
-public void testCategories2() throws JavaScriptModelException {
- setWorkingCopyContents(
- " /**\n" +
- " * @category cat1\n" +
- " */\n" +
- " function foo() {\n" +
- " }\n" +
- ""
- );
- this.workingCopy.makeConsistent(null);
-
- setWorkingCopyContents(
- " function foo() {\n" +
- " }\n" +
- ""
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[*]: {CATEGORIES}"
- );
-}
-/**
- * Ensures that the delta is correct when changing a category
- */
-public void testCategories3() throws JavaScriptModelException {
- setWorkingCopyContents(
- " /**\n" +
- " * @category cat1\n" +
- " */\n" +
- " function foo() {\n" +
- " }\n" +
- " "
- );
- this.workingCopy.makeConsistent(null);
-
- setWorkingCopyContents(
- " /**\n" +
- " * @category cat2\n" +
- " */\n" +
- " function foo() {\n" +
- " }\n" +
- ""
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[*]: {CATEGORIES}"
- );
-}
-/*
- * Ensures that the delta is correct when adding a category to a second field
- * (regression test for bug 125675 @category not reflected in outliner in live fashion)
- */
-public void testCategories4() throws JavaScriptModelException {
- setWorkingCopyContents(
- " /**\n" +
- " * @category cat1\n" +
- " */\n" +
- " int f1;\n" +
- " int f2;\n" +
- ""
- );
- this.workingCopy.makeConsistent(null);
-
- setWorkingCopyContents(
- " /**\n" +
- " * @category cat1\n" +
- " */\n" +
- " int f1;\n" +
- " /**\n" +
- " * @category cat2\n" +
- " */\n" +
- " int f2;\n" +
- ""
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "X[*]: {CHILDREN | FINE GRAINED}\n" +
- " f2[*]: {CATEGORIES}"
- );
-}
-///*
-// * Ensures that changing and external jar and refreshing takes the change into account
-// * (regression test for bug 134110 [regression] Does not pick-up interface changes from classes in the build path)
-// */
-//public void testChangeExternalJar() throws CoreException, IOException {
-// IJavaScriptProject project = getJavaProject("Reconciler");
-// String jarPath = getExternalPath() + "lib.jar";
-// try {
-// org.eclipse.jsdt.core.tests.util.Util.createJar(new String[] {
-// "p/Y.js",
-// "package p;\n" +
-// "public class Y {\n" +
-// " function foo() {\n" +
-// " }\n" +
-// "}"
-// }, jarPath, "1.4");
-// addLibraryEntry(project, jarPath, false);
-//
-// // force Y.class file to be cached during resolution
-// setWorkingCopyContents(
-// "package p1;\n" +
-// "public class X extends p.Y {\n" +
-// " function bar() {\n" +
-// " foo();\n" +
-// " }\n" +
-// "}");
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-//
-// // change jar and refresh
-// org.eclipse.jsdt.core.tests.util.Util.createJar(new String[] {
-// "p/Y.js",
-// "package p;\n" +
-// "public class Y {\n" +
-// " function foo(String s) {\n" +
-// " }\n" +
-// "}"
-// }, jarPath, "1.4");
-// getJavaModel().refreshExternalArchives(null,null);
-//
-// setWorkingCopyContents(
-// "package p1;\n" +
-// "public class X extends p.Y {\n" +
-// " function bar() {\n" +
-// " foo(\"a\");\n" +
-// " }\n" +
-// "}");
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "----------\n"
-// );
-// } finally {
-// removeLibraryEntry(project, new Path(jarPath));
-// deleteFile(new File(jarPath));
-// }
-//}
-///**
-// * Ensures that the reconciler reconciles the new contents with the current
-// * contents,updating the structure of this reconciler's compilation
-// * unit, and fires the Java element deltas for the structural changes
-// * of a method's type parameter change.
-// */
-//public void testChangeMethodTypeParameters() throws JavaScriptModelException {
-// setUp15WorkingCopy();
-// clearDeltas();
-// setWorkingCopyContents(
-// " public <T> void foo() {\n" +
-// " }\n" +
-// "");
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-// assertDeltas(
-// "Unexpected delta",
-// "X[*]: {CHILDREN | FINE GRAINED}\n" +
-// " foo()[*]: {CONTENT}"
-// );
-//}
-///**
-// * Ensures that the reconciler reconciles the new contents with the current
-// * contents,updating the structure of this reconciler's compilation
-// * unit, and fires the Java element deltas for the structural changes
-// * of a type's type parameter change.
-// */
-//public void testChangeTypeTypeParameters() throws JavaScriptModelException {
-// setUp15WorkingCopy();
-// clearDeltas();
-// setWorkingCopyContents(
-// "package p1;\n" +
-// "import p2.*;\n" +
-// "public class X <T> {\n" +
-// " function foo() {\n" +
-// " }\n" +
-// "}");
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-// assertDeltas(
-// "Unexpected delta",
-// "X[*]: {CONTENT}"
-// );
-//}
-///**
-// * Ensures that the reconciler reconciles the new contents with the current
-// * contents,updating the structure of this reconciler's compilation
-// * unit, and fires the Java element deltas for the structural changes
-// * of a method visibility change.
-// */
-//public void testChangeMethodVisibility() throws JavaScriptModelException {
-// setWorkingCopyContents(
-// "package p1;\n" +
-// "import p2.*;\n" +
-// "public class X {\n" +
-// " private void foo() {\n" +
-// " }\n" +
-// "}");
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-// assertDeltas(
-// "Unexpected delta",
-// "X[*]: {CHILDREN | FINE GRAINED}\n" +
-// " foo()[*]: {MODIFIERS CHANGED}"
-// );
-//}
-/**
- * Ensures that the correct delta is reported when closing the working copy and modifying its buffer.
- */
-public void testCloseWorkingCopy() throws JavaScriptModelException {
- IBuffer buffer = this.workingCopy.getBuffer();
- this.workingCopy.close();
- buffer.setContents(
- " function foo() {\n" +
- " }\n" +
- " function bar() {\n" +
- " }\n" +
- "");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "bar()[+]: {}"
- );
-}
-
-///**
-// * Ensures that a reference to a constant with type mismatch doesn't show an error.
-// * (regression test for bug 17104 Compiler does not complain but "Quick Fix" ??? complains)
-// */
-//public void testConstantReference() throws CoreException {
-// try {
-// createFile(
-// "/Reconciler/src/p1/OS.js",
-// "package p1;\n" +
-// "public class OS {\n" +
-// " public static final int CONST = 23 * 1024;\n" +
-// "}");
-// setWorkingCopyContents(
-// "package p1;\n" +
-// "public class X {\n" +
-// " public short c;\n" +
-// " public static void main(String[] arguments) {\n" +
-// " short c = 1;\n" +
-// " switch (c) {\n" +
-// " case OS.CONST: return;\n" +
-// " }\n" +
-// " }\n" +
-// "}");
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "----------\n"
-// );
-// } finally {
-// deleteFile("/Reconciler/src/p1/OS.js");
-// }
-//}
-/*
-// * Ensures that the source type converter doesn't throw an OutOfMemoryError if converting a generic type with a primitive type array as argument
-// * (regression test for bug 135296 opening a special java file results in an "out of memory" message)
-// */
-//public void testConvertPrimitiveTypeArrayTypeArgument() throws CoreException {
-// IJavaScriptUnit otherCopy = null;
-// try {
-// WorkingCopyOwner owner = new WorkingCopyOwner() {};
-// otherCopy = getWorkingCopy(
-// "Reconciler15/src/Y.js",
-// "public class Y {\n" +
-// " void foo(Z<int[]> z) {}\n" +
-// "}\n" +
-// "class Z<E> {\n" +
-// "}",
-// owner,
-// false/*don't compute problems*/);
-// setUp15WorkingCopy("/Reconciler15/src/X.js", owner);
-// setWorkingCopyContents(
-// "public class X {\n" +
-// " void bar(Y y) {\n" +
-// " y.foo(new Z<int[]>());\n" +
-// " }\n" +
-// "}"
-// );
-// this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, owner, null);
-// assertProblems(
-// "Unexpected problems",
-// "----------\n" +
-// "----------\n"
-// );
-// } finally {
-// if (otherCopy != null)
-// otherCopy.discardWorkingCopy();
-// }
-//}
-/**
- * Ensures that the reconciler reconciles the new contents with the current
- * contents, updating the structure of this reconciler's compilation
- * unit, and fires the Java element deltas for the structural changes
- * of a method being deleted.
- */
-public void testDeleteMethod1() throws JavaScriptModelException {
- setWorkingCopyContents(
- " ");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "foo()[-]: {}"
- );
-}
-/**
- * Ensures that the reconciler reconciles the new contents with the current
- * contents, updating the structure of this reconciler's compilation
- * unit, and fires the Java element deltas for the structural changes
- * of two methods being deleted.
- */
-public void testDeleteTwoMethods() throws JavaScriptModelException {
- // create 2 methods
- setWorkingCopyContents(
- " function foo() {\n" +
- " }\n" +
- " function bar() {\n" +
- " }\n" +
- "");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- // delete the 2 methods
- clearDeltas();
- setWorkingCopyContents(
- " ");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "bar()[-]: {}\n" +
- "foo()[-]: {}"
- );
-}
-/*
- * Ensures that excluded part of prereq project are not visible
- */
-public void testExcludePartOfAnotherProject1() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P", "-**/internal/"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P");
- createFolder("/P/p/internal");
- createFile(
- "/P/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.internal.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type Y is not accessible due to restriction on required project P\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProject("P");
- }
-}
-/*
- * Ensures that packages that are not in excluded part of prereq project are visible
- */
-public void testExcludePartOfAnotherProject2() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P", "-**/internal/"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P");
- createFolder("/P/p/api");
- createFile(
- "/P/p/api/Y.js",
- "package p.api;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.api.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProject("P");
- }
-}
-/*
- * Ensures that included part of prereq project are visible
- */
-public void testIncludePartOfAnotherProject1() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P", "+**/api/"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P");
- createFolder("/P/p/api");
- createFile(
- "/P/p/api/Y.js",
- "package p.api;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.api.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProject("P");
- }
-}
-/*
- * Ensures that packages that are not in included part of prereq project are not visible
- */
-public void testIncludePartOfAnotherProject2() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P", "+**/api/|-**"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P");
- createFolder("/P/p/internal");
- createFile(
- "/P/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.internal.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type Y is not accessible due to restriction on required project P\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProject("P");
- }
-}
-/**
- * Start with no imports, add an import, and then append to the import name.
- */
-public void testGrowImports() throws JavaScriptModelException {
- // no imports
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X {\n" +
- "}");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- // add an import
- clearDeltas();
- setWorkingCopyContents(
- "package p1;\n" +
- "import p\n" +
- "public class X {\n" +
- "}");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "<import container>[+]: {}"
- );
-
- // append to import name
- clearDeltas();
- setWorkingCopyContents(
- "package p1;\n" +
- "import p2\n" +
- "public class X {\n" +
- "}");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta",
- "<import container>[*]: {CHILDREN | FINE GRAINED}\n" +
- " import p[-]: {}\n" +
- " import p2[+]: {}"
- );
-}
-/*
- * Ensures that a type matching a ignore-if-better non-accessible rule is further found when accessible
- * on another classpath entry.
- * (regression test for bug 98127 Access restrictions started showing up after switching to bundle)
- */
-public void testIgnoreIfBetterNonAccessibleRule1() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P1", "?**/internal/", "/P2", "+**/internal/Y"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P1");
- createFolder("/P1/p/internal");
- createFile(
- "/P1/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- createJavaProject("P2");
- createFolder("/P2/p/internal");
- createFile(
- "/P2/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.internal.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/*
- * Ensures that a type matching a ignore-if-better non-accessible rule is further found when accessible
- * on another classpath entry.
- * (regression test for bug 98127 Access restrictions started showing up after switching to bundle)
- */
-public void testIgnoreIfBetterNonAccessibleRule2() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P1", "?**/internal/", "/P2", "~**/internal/Y"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P1");
- createFolder("/P1/p/internal");
- createFile(
- "/P1/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- createJavaProject("P2");
- createFolder("/P2/p/internal");
- createFile(
- "/P2/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.internal.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Discouraged access: The type Y is not accessible due to restriction on required project P2\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/*
- * Ensures that a type matching a ignore-if-better non-accessible rule is further found non-accessible
- * on another classpath entry.
- * (regression test for bug 98127 Access restrictions started showing up after switching to bundle)
- */
-public void testIgnoreIfBetterNonAccessibleRule3() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P1", "?**/internal/", "/P2", "-**/internal/Y"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P1");
- createFolder("/P1/p/internal");
- createFile(
- "/P1/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- createJavaProject("P2");
- createFolder("/P2/p/internal");
- createFile(
- "/P2/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.internal.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type Y is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProjects(new String[] {"P1", "P2"});
- }
-}
-/*
- * Ensures that a type matching a ignore-if-better non-accessible rule is found non-accessible
- * if no other classpath entry matches it.
- * (regression test for bug 98127 Access restrictions started showing up after switching to bundle)
- */
-public void testIgnoreIfBetterNonAccessibleRule4() throws CoreException {
- IIncludePathEntry[] newEntries = createClasspath("Reconciler", new String[] {"/P1", "?**/internal/"});
- try {
- addClasspathEntries(newEntries, true);
- createJavaProject("P1");
- createFolder("/P1/p/internal");
- createFile(
- "/P1/p/internal/Y.js",
- "package p.internal;\n" +
- "public class Y {\n" +
- "}"
- );
- setWorkingCopyContents(
- "package p1;\n" +
- "public class X extends p.internal.Y {\n" +
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 2)\n" +
- " public class X extends p.internal.Y {\n" +
- " ^^^^^^^^^^^^\n" +
- "Access restriction: The type Y is not accessible due to restriction on required project P1\n" +
- "----------\n"
- );
- } finally {
- removeClasspathEntries(newEntries);
- deleteProjects(new String[] {"P1"});
- }
-}
-/**
- * Introduces a syntax error in the modifiers of a method.
- */
-public void testMethodWithError01() throws CoreException {
- // Introduce syntax error
- setWorkingCopyContents(
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public.void foo() {\n" +
- " }\n" +
- "}");
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta after syntax error",
- "X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[*]: {MODIFIERS CHANGED}"
- );
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
- " public.void foo() {\n" +
- " ^\n" +
- "Syntax error on token \".\", delete this token\n" +
- "----------\n"
- );
-
- // Fix the syntax error
- clearDeltas();
- String contents =
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}";
- setWorkingCopyContents(contents);
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertDeltas(
- "Unexpected delta after fixing syntax error",
- "X[*]: {CHILDREN | FINE GRAINED}\n" +
- " foo()[*]: {MODIFIERS CHANGED}"
- );
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler/src/p1/X.java (at line 2)\n" +
- " import p2.*;\n" +
- " ^^\n" +
- "The import p2 is never used\n" +
- "----------\n"
- );
-}
-/**
- * Test reconcile force flag
- */
-public void testMethodWithError02() throws CoreException {
- String contents =
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public.void foo() {\n" +
- " }\n" +
- "}";
- setWorkingCopyContents(contents);
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- // use force flag to refresh problems
- this.problemRequestor.initialize(contents.toCharArray());
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, true, null, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" +
- " public.void foo() {\n" +
- " ^\n" +
- "Syntax error on token \".\", delete this token\n" +
- "----------\n"
- );
-}
-
-/**
- * Test reconcile force flag off
- */
-public void testMethodWithError03() throws CoreException {
- String contents =
- "package p1;\n" +
- "import p2.*;\n" +
- "public class X {\n" +
- " public.void foo() {\n" +
- " }\n" +
- "}";
- setWorkingCopyContents(contents);
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- // reconcile with force flag turned off
- this.problemRequestor.initialize(contents.toCharArray());
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
- assertProblems(
- "Unexpected problems",
- ""
- );
-}
-/**
- * Test reconcile force flag + cancel
- */
-public void testMethodWithError04() throws CoreException {
-
- CancelingProblemRequestor myPbRequestor = new CancelingProblemRequestor();
-
- this.workingCopy.discardWorkingCopy();
- IJavaScriptUnit x = getCompilationUnit("Reconciler", "src", "p1", "X.js");
- this.problemRequestor = myPbRequestor;
- this.workingCopy = x.getWorkingCopy(new WorkingCopyOwner() {}, null);
-
- String contents =
- "package p1;\n" +
- "public class X {\n" +
- " Zork f; \n"+
- " void foo(Zork z){\n"+
- " }\n"+
- "} \n";
- setWorkingCopyContents(contents);
-
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
-
- // use force flag to refresh problems
- myPbRequestor.isCanceling = true;
- myPbRequestor.initialize(contents.toCharArray());
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, true, null, myPbRequestor.progressMonitor);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/X.java (at line 3)\n" +
- " Zork f; \n" +
- " ^^^^\n" +
- "Zork cannot be resolved to a type\n" +
- "----------\n"
- );
-}
-
-/**
- * Test reconcile force flag off
- */
-public void testMethodWithError05() throws CoreException {
- try {
- createFolder("/Reconciler/src/tests");
- String contents =
- "package tests; \n"+
- "abstract class AbstractSearchableSource extends AbstractSource implements SearchableSource { \n"+
- " abstract int indexOfImpl(long value); \n"+
- " public final int indexOf(long value) { \n"+
- " return indexOfImpl(value); \n"+
- " } \n"+
- "} \n";
- createFile(
- "/Reconciler/src/tests/AbstractSearchableSource.js",
- contents);
-
- createFile(
- "/Reconciler/src/tests/Source.js",
- "package tests; \n"+
- "interface Source { \n"+
- " long getValue(int index); \n"+
- " int size(); \n"+
- "} \n");
-
- createFile(
- "/Reconciler/src/tests/AbstractSource.js",
- "package tests; \n"+
- "abstract class AbstractSource implements Source { \n"+
- " AbstractSource() { \n"+
- " } \n"+
- " void invalidate() { \n"+
- " } \n"+
- " abstract long getValueImpl(int index); \n"+
- " abstract int sizeImpl(); \n"+
- " public final long getValue(int index) { \n"+
- " return 0; \n"+
- " } \n"+
- " public final int size() { \n"+
- " return 0; \n"+
- " } \n"+
- "} \n");
-
- createFile(
- "/Reconciler/src/tests/SearchableSource.js",
- "package tests; \n"+
- "interface SearchableSource extends Source { \n"+
- " int indexOf(long value); \n"+
- "} \n");
-
- IJavaScriptUnit compilationUnit = getCompilationUnit("Reconciler", "src", "tests", "AbstractSearchableSource.js");
- ProblemRequestor pbReq = new ProblemRequestor();
- IJavaScriptUnit wc = compilationUnit.getWorkingCopy(new WorkingCopyOwner() {}, null);
- pbReq.initialize(contents.toCharArray());
- startDeltas();
- wc.reconcile(IJavaScriptUnit.NO_AST, true, null, null);
- String actual = pbReq.problems.toString();
- String expected =
- "----------\n" +
- "----------\n";
- if (!expected.equals(actual)){
- System.out.println(Util.displayString(actual, 2));
- }
- assertEquals(
- "unexpected errors",
- expected,
- actual);
- } finally {
- deleteFile("/Reconciler/src/tests/AbstractSearchableSource.js");
- deleteFile("/Reconciler/src/tests/SearchableSource.js");
- deleteFile("/Reconciler/src/tests/Source.js");
- deleteFile("/Reconciler/src/tests/AbstractSource.js");
- deleteFolder("/Reconciler/src/tests");
- }
-}
-/*
- * Test that the creation of a working copy detects errors
- * (regression test for bug 33757 Problem not detected when opening a working copy)
- */
-public void testMethodWithError06() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- try {
- String contents =
- "package p1;\n" +
- "public class Y {\n" +
- " public.void foo() {\n" +
- " }\n" +
- "}";
- createFile(
- "/Reconciler/src/p1/Y.js",
- contents
- );
- this.problemRequestor = new ProblemRequestor();
- this.problemRequestor.initialize(contents.toCharArray());
- this.workingCopy = getCompilationUnit("Reconciler/src/p1/Y.js").getWorkingCopy(new WorkingCopyOwner() {}, null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/Y.java (at line 3)\n" +
- " public.void foo() {\n" +
- " ^\n" +
- "Syntax error on token \".\", delete this token\n" +
- "----------\n"
- );
- } finally {
- deleteFile("/Reconciler/src/p1/Y.js");
- }
-}
-/*
- * Test that the opening of a working copy detects errors
- * (regression test for bug 33757 Problem not detected when opening a working copy)
- */
-public void testMethodWithError07() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- try {
- String contents =
- "package p1;\n" +
- "public class Y {\n" +
- " public.void foo() {\n" +
- " }\n" +
- "}";
- createFile(
- "/Reconciler/src/p1/Y.js",
- contents
- );
- this.problemRequestor = new ProblemRequestor();
- this.problemRequestor.initialize(contents.toCharArray());
- this.workingCopy = getCompilationUnit("Reconciler/src/p1/Y.js").getWorkingCopy(new WorkingCopyOwner() {}, null);
-
- // Close working copy
- JavaModelManager.getJavaModelManager().removeInfoAndChildren((CompilationUnit)workingCopy); // use a back door as working copies cannot be closed
-
- // Reopen should detect syntax error
- this.problemRequestor.initialize(contents.toCharArray());
- this.workingCopy.open(null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. ERROR in /Reconciler/src/p1/Y.java (at line 3)\n" +
- " public.void foo() {\n" +
- " ^\n" +
- "Syntax error on token \".\", delete this token\n" +
- "----------\n"
- );
- } finally {
- deleteFile("/Reconciler/src/p1/Y.js");
- }
-}
-/*
- * Test that the units with similar names aren't presenting each other errors
- * (regression test for bug 39475)
- */
-public void testMethodWithError08() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- try {
- createFile(
- "/Reconciler/src/p1/X01.js",
- "package p1;\n" +
- "public abstract class X01 {\n" +
- " public abstract void bar(); \n"+
- " public abstract void foo(Zork z); \n"+
- "}"
- );
- String contents =
- "package p2;\n" +
- "public class X01 extends p1.X01 {\n" +
- " public void bar(){} \n"+
- "}";
- createFile(
- "/Reconciler/src/p2/X01.js",
- contents
- );
- this.problemRequestor = new ProblemRequestor();
- this.problemRequestor.initialize(contents.toCharArray());
- this.workingCopy = getCompilationUnit("Reconciler/src/p2/X01.js").getWorkingCopy(new WorkingCopyOwner() {}, null);
-
- // Close working copy
- JavaModelManager.getJavaModelManager().removeInfoAndChildren((CompilationUnit)workingCopy); // use a back door as working copies cannot be closed
-
- // Reopen should detect syntax error
- this.problemRequestor.initialize(contents.toCharArray());
- this.workingCopy.open(null);
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n" // shouldn't report problem against p2.X01
- );
- } finally {
- deleteFile("/Reconciler/src/p1/X01.js");
- deleteFile("/Reconciler/src/p2/X01.js");
- }
-}
-/*
- * Scenario of reconciling using a working copy owner
- */
-public void testMethodWithError09() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- IJavaScriptUnit workingCopy1 = null;
- try {
- workingCopy1 = getCompilationUnit("/Reconciler/src/p1/X1.js").getWorkingCopy(owner, null);
- workingCopy1.getBuffer().setContents(
- "package p1;\n" +
- "public abstract class X1 {\n" +
- " public abstract void bar(); \n"+
- "}"
- );
- workingCopy1.makeConsistent(null);
-
- this.problemRequestor = new ProblemRequestor();
- this.workingCopy = getCompilationUnit("Reconciler/src/p/X.js").getWorkingCopy(owner, null);
- setWorkingCopyContents(
- "package p;\n" +
- "public class X extends p1.X1 {\n" +
- " public void bar(){} \n"+
- "}"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, owner, null);
-
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n" // shouldn't report problem against p.X
- );
- } finally {
- if (workingCopy1 != null) {
- workingCopy1.discardWorkingCopy();
- }
- }
-}
-/*
- * Scenario of reconciling using a working copy owner (68557)
- */
-public void testMethodWithError10() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- IJavaScriptUnit workingCopy1 = null;
- try {
- createFolder("/Reconciler15/src/test/cheetah");
- workingCopy1 = getCompilationUnit("/Reconciler15/src/test/cheetah/NestedGenerics.js").getWorkingCopy(owner, null);
- workingCopy1.getBuffer().setContents(
- "package test.cheetah;\n"+
- "import java.util.List;\n"+
- "import java.util.Stack;\n"+
- "public class NestedGenerics {\n"+
- " Stack< List<Object>> stack = new Stack< List<Object> >();\n"+
- "}\n"
- );
- workingCopy1.makeConsistent(null);
-
- this.problemRequestor = new ProblemRequestor();
- this.workingCopy = getCompilationUnit("Reconciler15/src/test/cheetah/NestedGenericsTest.js").getWorkingCopy(owner, null);
- setWorkingCopyContents(
- "package test.cheetah;\n"+
- "import java.util.Stack;\n"+
- "public class NestedGenericsTest {\n"+
- " void test() { \n"+
- " Stack s = new NestedGenerics().stack; \n"+
- " }\n"+
- "}\n"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, owner, null);
-
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- } finally {
- if (workingCopy1 != null) {
- workingCopy1.discardWorkingCopy();
- }
- deleteFolder("/Reconciler15/src/test");
- }
-}
-/*
- * Scenario of reconciling using a working copy owner (68557)
- */
-public void testMethodWithError11() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- IJavaScriptUnit workingCopy1 = null;
- try {
- createFolder("/Reconciler15/src/test/cheetah");
- workingCopy1 = getCompilationUnit("/Reconciler15/src/test/cheetah/NestedGenerics.js").getWorkingCopy(owner, null);
- workingCopy1.getBuffer().setContents(
- "package test.cheetah;\n"+
- "import java.util.*;\n"+
- "public class NestedGenerics {\n"+
- " Map<List<Object>,String> map = null;\n"+
- " Stack<List<Object>> stack2 = null;\n"+
- " Map<List<Object>,List<Object>> map3 = null;\n"+
- "}\n"
- );
- workingCopy1.makeConsistent(null);
-
- this.problemRequestor = new ProblemRequestor();
- this.workingCopy = getCompilationUnit("Reconciler15/src/test/cheetah/NestedGenericsTest.js").getWorkingCopy(owner, null);
- setWorkingCopyContents(
- "package test.cheetah;\n"+
- "import java.util.*;\n"+
- "public class NestedGenericsTest {\n"+
- " void test() { \n"+
- " Map m = new NestedGenerics().map; \n"+
- " Stack s2 = new NestedGenerics().stack2; \n"+
- " Map m3 = new NestedGenerics().map3; \n"+
- " }\n"+
- "}\n"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, owner, null);
-
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- } finally {
- if (workingCopy1 != null) {
- workingCopy1.discardWorkingCopy();
- }
- deleteFolder("/Reconciler15/src/test");
- }
-}
-/*
- * Scenario of reconciling using a working copy owner (68557 variation with wildcards)
- */
-public void testMethodWithError12() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- IJavaScriptUnit workingCopy1 = null;
- try {
- createFolder("/Reconciler15/src/test/cheetah");
- workingCopy1 = getCompilationUnit("/Reconciler15/src/test/cheetah/NestedGenerics.js").getWorkingCopy(owner, null);
- workingCopy1.getBuffer().setContents(
- "package test.cheetah;\n"+
- "import java.util.*;\n"+
- "public class NestedGenerics {\n"+
- " Map<List<?>,? super String> map = null;\n"+
- " Stack<List<? extends Object>> stack2 = null;\n"+
- " Map<List<Object[]>,List<Object>[]> map3 = null;\n"+
- "}\n"
- );
- workingCopy1.makeConsistent(null);
-
- this.problemRequestor = new ProblemRequestor();
- this.workingCopy = getCompilationUnit("Reconciler15/src/test/cheetah/NestedGenericsTest.js").getWorkingCopy(owner, null);
- setWorkingCopyContents(
- "package test.cheetah;\n"+
- "import java.util.*;\n"+
- "public class NestedGenericsTest {\n"+
- " void test() { \n"+
- " Map m = new NestedGenerics().map; \n"+
- " Stack s2 = new NestedGenerics().stack2; \n"+
- " Map m3 = new NestedGenerics().map3; \n"+
- " }\n"+
- "}\n"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, owner, null);
-
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
- } finally {
- if (workingCopy1 != null) {
- workingCopy1.discardWorkingCopy();
- }
- deleteFolder("/Reconciler15/src/test");
- }
-}
-/*
- * Scenario of reconciling using a working copy owner (68730)
- */
-public void testMethodWithError13() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- IJavaScriptUnit workingCopy1 = null;
- try {
- workingCopy1 = getCompilationUnit("/Reconciler15/src/test/X.js").getWorkingCopy(owner, null);
- createFolder("/Reconciler15/src/test");
- workingCopy1.getBuffer().setContents(
- "package test;\n"+
- "public class X <T extends String, U> {\n"+
- " <Y1> void bar(Y1[] y) {}\n"+
- " void bar2(Y<E3[]>[] ye[]) {}\n"+
- " void foo(java.util.Map<Object[],String>.MapEntry<p.K<T>[],? super q.r.V8> m){}\n"+
- " Class<? extends Object> getClass0() {}\n"+
- " <E extends String> void pair (X<? extends E, U> e, T t){}\n"+
- "}\n"
- );
- workingCopy1.makeConsistent(null);
-
- this.problemRequestor = new ProblemRequestor();
- this.workingCopy = getCompilationUnit("Reconciler15/src/test/Y.js").getWorkingCopy(owner, null);
- setWorkingCopyContents(
- "package test;\n"+
- "public class Y {\n"+
- " void foo(){\n"+
- " X someX = new X();\n"+
- " someX.bar(null);\n"+
- " }\n"+
- "}\n"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, owner, null);
-
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "1. WARNING in /Reconciler15/src/test/Y.java (at line 5)\n" +
- " someX.bar(null);\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Type safety: The method bar(Object[]) belongs to the raw type X. References to generic type X<T,U> should be parameterized\n" +
- "----------\n"
- );
- } finally {
- if (workingCopy1 != null) {
- workingCopy1.discardWorkingCopy();
- }
- deleteFolder("/Reconciler15/src/test");
- }
-}
-/*
- * Scenario of reconciling using a working copy owner (66424)
- */
-public void testMethodWithError14() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- WorkingCopyOwner owner = new WorkingCopyOwner() {};
- IJavaScriptUnit workingCopy1 = null;
- try {
- workingCopy1 = getCompilationUnit("/Reconciler15/src/test/X.js").getWorkingCopy(owner, null);